├── .gitignore
├── poster.png
├── .prettierrc
├── mod.info
├── .eslintrc.cjs
├── pipewrench.json
├── dependabot.yml
├── .github
├── dependabot.yml
└── workflows
│ ├── test.yml
│ └── release.yml
├── src
├── client
│ └── example
│ │ ├── api
│ │ ├── TSUIRedSquare.ts
│ │ └── ExampleAPI.ts
│ │ └── Example.ts
└── shared
│ ├── pipewrench_fixes.lua
│ └── lualib_bundle.lua
├── tsconfig.json
├── LICENSE
├── package.json
└── readme.md
/.gitignore:
--------------------------------------------------------------------------------
1 | media/lua/
2 | node_modules/
3 | dist/
4 | ~/
5 |
--------------------------------------------------------------------------------
/poster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/asledgehammer/PipeWrench-Template/HEAD/poster.png
--------------------------------------------------------------------------------
/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "semi": true,
3 | "trailingComma": "none",
4 | "singleQuote": true,
5 | "printWidth": 80
6 | }
7 |
--------------------------------------------------------------------------------
/mod.info:
--------------------------------------------------------------------------------
1 | name=PipeWrenchModTemplate
2 | poster=poster.png
3 | description=PipeWrenchModTemplate
4 | id=pipewrench_mod_template
5 |
--------------------------------------------------------------------------------
/.eslintrc.cjs:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | extends: [
3 | 'eslint:recommended',
4 | 'plugin:@typescript-eslint/recommended',
5 | 'plugin:@typescript-eslint/eslint-recommended'
6 | ],
7 | ignorePatterns: ['dist/**/*'],
8 | parser: '@typescript-eslint/parser',
9 | plugins: ['@typescript-eslint'],
10 | root: true
11 | };
12 |
--------------------------------------------------------------------------------
/pipewrench.json:
--------------------------------------------------------------------------------
1 | {
2 | "modInfo": {
3 | "name": "My First Mod",
4 | "poster": "./poster.png",
5 | "description": "arf",
6 | "id": "12312312",
7 | "url": "https://www.google.com,"
8 | },
9 | "modelsDir": "./src/models",
10 | "texturesDir": "./src/textures",
11 | "soundDir": "./src/sound",
12 | "scriptsDir": "./src/scripts"
13 | }
14 |
--------------------------------------------------------------------------------
/dependabot.yml:
--------------------------------------------------------------------------------
1 | # Basic dependabot.yml file with
2 | # minimum configuration for two package managers
3 |
4 | version: 2
5 | updates:
6 | # Enable version updates for npm
7 | - package-ecosystem: 'npm'
8 | # Look for `package.json` and `lock` files in the `root` directory
9 | directory: '/'
10 | # Check the npm registry for updates every day (weekdays)
11 | schedule:
12 | interval: 'daily'
13 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | # Basic dependabot.yml file with
2 | # minimum configuration for two package managers
3 |
4 | version: 2
5 | updates:
6 | # Enable version updates for npm
7 | - package-ecosystem: 'npm'
8 | # Look for `package.json` and `lock` files in the `root` directory
9 | directory: '/'
10 | # Check the npm registry for updates every day (weekdays)
11 | schedule:
12 | interval: 'daily'
13 |
--------------------------------------------------------------------------------
/.github/workflows/test.yml:
--------------------------------------------------------------------------------
1 | name: Test
2 | on:
3 | push:
4 | pull_request:
5 | jobs:
6 | test:
7 | runs-on: ubuntu-latest
8 | steps:
9 | - uses: actions/checkout@v3
10 | - uses: actions/setup-node@v3
11 | with:
12 | node-version: 18
13 | cache: npm
14 | cache-dependency-path: package-lock.json
15 | - run: npm install
16 | - run: npm run check
17 | - run: npm run compile
18 |
--------------------------------------------------------------------------------
/.github/workflows/release.yml:
--------------------------------------------------------------------------------
1 | name: Release
2 |
3 | on:
4 | push:
5 | tags:
6 | - 'v*.*.*'
7 |
8 | jobs:
9 | publish:
10 | runs-on: ubuntu-latest
11 | steps:
12 | - uses: actions/checkout@v3
13 | - uses: actions/setup-node@v3
14 | with:
15 | node-version: 18
16 | - run: npm install
17 | - run: npm run build
18 | - uses: JS-DevTools/npm-publish@v1
19 | with:
20 | token: ${{ secrets.NPM_TOKEN }}
21 | access: public
22 | - name: Release
23 | uses: softprops/action-gh-release@v1
24 |
--------------------------------------------------------------------------------
/src/client/example/api/TSUIRedSquare.ts:
--------------------------------------------------------------------------------
1 | import { ISUIElement } from '@asledgehammer/pipewrench/client';
2 |
3 | export class TSUIRedSquare extends ISUIElement {
4 | constructor(x: number, y: number, width: number, height: number) {
5 | super(x, y, width, height);
6 | this.initialise();
7 | this.instantiate();
8 | this.addToUIManager();
9 | this.setVisible(true);
10 | }
11 |
12 | render = (): void => {
13 | this.drawRedSquare();
14 | };
15 |
16 | /**
17 | * Adds a red square element to the UI using the example ISUI typings.
18 | */
19 | drawRedSquare() {
20 | this.drawRect(this.x, this.y, this.width, this.height, 1, 1.0, 0.0, 0.0);
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/client/example/Example.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @noSelfInFile
3 | *
4 | * NOTE: Use this at the top of your TypeScript files. This prevents functions & methods
5 | * from prepending a 'self' reference, which is usually not necessary and complicates
6 | * rendered Lua code.
7 | */
8 |
9 | // PipeWrench API.
10 | import { getPlayer } from '@asledgehammer/pipewrench';
11 | import * as Events from '@asledgehammer/pipewrench-events';
12 | // Example reference API.
13 | import { addRedSquare, alertObjectsAdded, greetPlayer } from './api/ExampleAPI';
14 |
15 | // Add all initialization code here.
16 | Events.onGameStart.addListener(() => {
17 | addRedSquare();
18 | greetPlayer(getPlayer());
19 | alertObjectsAdded();
20 | });
21 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "allowSyntheticDefaultImports": true,
4 | "experimentalDecorators": true,
5 | "lib": ["ESNext"],
6 | "module": "ESNext",
7 | "moduleResolution": "node",
8 | "outDir": "dist",
9 | "rootDir": "src",
10 | "strict": true,
11 | "target": "ESNext",
12 | "types": [
13 | "lua-types/5.1",
14 | "@asledgehammer/pipewrench",
15 | "@asledgehammer/pipewrench-events"
16 | ]
17 | },
18 | "tstl": {
19 | "luaLibImport": "require",
20 | "noHeader": true,
21 | "tstlVerbose": false,
22 | "luaPlugins": [
23 | {
24 | "name": "@asledgehammer/tstl-pipewrench"
25 | }
26 | ]
27 | },
28 | "include": ["src"]
29 | }
30 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2022 asledgehammer
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/src/client/example/api/ExampleAPI.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @noSelfInFile
3 | *
4 | * NOTE: Use this at the top of your TypeScript files. This prevents functions & methods
5 | * from prepending a 'self' reference, which is usually not necessary and complicates
6 | * rendered Lua code.
7 | */
8 |
9 | // PipeWrench API.
10 | import { IsoObject, IsoPlayer } from '@asledgehammer/pipewrench';
11 |
12 | // PipeWrench Events API.
13 | import * as Events from '@asledgehammer/pipewrench-events';
14 |
15 | // Example API.
16 | import { TSUIRedSquare } from './TSUIRedSquare';
17 |
18 | /**
19 | * @param object The object to stringify.
20 | * @returns A string of the object's name, x, y, and z coordinates.
21 | */
22 | export function isoObjectToString(object: IsoObject): string {
23 | return `{name: ${object.getObjectName()}, x: ${object.getX()}, y: ${object.getY()}, z: ${object.getZ()}}`;
24 | }
25 |
26 | /**
27 | * Adds a red square element to the UI using the example ISUI typings.
28 | */
29 | export function addRedSquare() {
30 | new TSUIRedSquare(512, 256, 256, 256);
31 | }
32 |
33 | /**
34 | * @param player The player to greet.
35 | */
36 | export function greetPlayer(player: IsoPlayer) {
37 | print(`Hello, ${player.getFullName()}!`);
38 | }
39 |
40 | /**
41 | * Registers the 'OnObjectAdded' Lua event and prints objects that are added to the world.
42 | */
43 | export function alertObjectsAdded() {
44 | Events.onObjectAdded.addListener((object: IsoObject) => {
45 | if (object != null) {
46 | print(`IsoObject added: ${isoObjectToString(object)}`);
47 | }
48 | });
49 | }
50 |
--------------------------------------------------------------------------------
/src/shared/pipewrench_fixes.lua:
--------------------------------------------------------------------------------
1 | local function __PW__ClassExtends(target, base)
2 |
3 | target.____super = base;
4 |
5 | local staticMetatable = setmetatable({ __index = base }, base);
6 | setmetatable(target, staticMetatable);
7 |
8 | local baseMetatable = getmetatable(base);
9 | if baseMetatable then
10 | if type(baseMetatable.__index) == "function" then
11 | staticMetatable.__index = baseMetatable.__index;
12 | end
13 | if type(baseMetatable.__newindex) == "function" then
14 | staticMetatable.__newindex = baseMetatable.__newindex;
15 | end
16 | end
17 |
18 | ------------------------------------
19 |
20 | -- PZ Class-Structure reroute.
21 | if base.prototype == nil then
22 | base.prototype = base;
23 | end
24 |
25 | -- PZ 'Type' field reroute.
26 | target.Type = target.prototype.name;
27 | target.prototype.Type = target.Type;
28 |
29 | -- PZ Constructor reroute.
30 | if base.prototype.new then
31 | base.prototype.____constructor = base.prototype.new;
32 | target.prototype.____constructor = base.prototype.new;
33 | end
34 |
35 | ------------------------------------
36 |
37 | setmetatable(target.prototype, base.prototype);
38 |
39 | if type(base.prototype.__index) == "function" then
40 | target.prototype.__index = base.prototype.__index;
41 | end
42 |
43 | if type(base.prototype.__newindex) == "function" then
44 | target.prototype.__newindex = base.prototype.__newindex;
45 | end
46 |
47 | if type(base.prototype.__tostring) == "function" then
48 | target.prototype.__tostring = base.prototype.__tostring;
49 | end
50 | end
51 |
52 | return {
53 | __PW__ClassExtends = __PW__ClassExtends
54 | }
55 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "pipewrench_mod_template",
3 | "version": "1.0.0",
4 | "description": "",
5 | "watch": {
6 | "compile": {
7 | "patterns": [
8 | "src"
9 | ],
10 | "extensions": "ts,js,jsx,lua,json"
11 | }
12 | },
13 | "scripts": {
14 | "compile": "tstl",
15 | "clean": "del-cli dist",
16 | "check": "prettier --check . && eslint .",
17 | "lint": "prettier --write . && eslint .",
18 | "watch": "tstl --watch --outDir ~/Zomboid/mods"
19 | },
20 | "repository": {
21 | "type": "git",
22 | "url": "git+https://github.com/asledgehammer/PipeWrench-Template.git"
23 | },
24 | "keywords": [
25 | "zomboid_lua_test"
26 | ],
27 | "author": "asledgehammer",
28 | "license": "ISC",
29 | "bugs": {
30 | "url": "https://github.com/asledgehammer/ZomboidTypeScriptModTemplate/issues"
31 | },
32 | "homepage": "https://github.com/asledgehammer/ZomboidTypeScriptModTemplate.git#readme",
33 | "devDependencies": {
34 | "@asledgehammer/tstl-pipewrench": "^41.78.19",
35 | "@types/fs-extra": "11.0.4",
36 | "@typescript-eslint/eslint-plugin": "7.16.0",
37 | "@typescript-eslint/parser": "7.16.0",
38 | "del-cli": "^5.0.0",
39 | "eslint": "^8.56.0",
40 | "eslint-config-prettier": "^8.5.0",
41 | "eslint-import-resolver-typescript": "^3.5.0",
42 | "eslint-plugin-import": "^2.26.0",
43 | "eslint-plugin-prettier": "^4.2.1",
44 | "lua-types": "^2.13.1",
45 | "npm-watch": "^0.11.0",
46 | "prettier": "3.3.2",
47 | "prettier-eslint": "16.3.0",
48 | "ts-node": "^10.9.1",
49 | "typescript": "^5.5.2",
50 | "typescript-to-lua": "^1.26.0"
51 | },
52 | "dependencies": {
53 | "@asledgehammer/pipewrench": "^41.78.18",
54 | "@asledgehammer/pipewrench-events": "^41.73.0",
55 | "fs-extra": "^10.1.0",
56 | "latest": "^0.2.0"
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/readme.md:
--------------------------------------------------------------------------------
1 | # PipeWrench: TypeScript for Project Zomboid
2 |
3 | 
4 | 
5 |
6 | ## What is PipeWrench?
7 |
8 | The PipeWrench project has three major goals:
9 |
10 | - Allow TypeScript to Lua as an alternative to only using Lua when coding mods in Project Zomboid.
11 | - Expose all API used throughout Project Zomboid's Lua codebase with documenting types, generics, and methods with their associated parameters.
12 | - Provide structured, scalable practices to keep code clean and manageable.
13 |
14 | Other smaller goals include:
15 |
16 | - Ongoing efforts to create an easy-to-use production environment when writing mods.
17 | - Better documentation generated with TypeScript declarations of Project Zomboid's API.
18 |
19 | PipeWrench is essentially two major components:
20 |
21 | - A Java-based transpiler (source-to-source compiler) that converts exposed API from the core of Project Zomboid to TypeScript declarations, mapping the API in a digestable way for IDE software to intelligently forward to programmers when programming their mods.
22 | - A workspace that compiles TypeScript to Lua that is compatible with the Kahlua2 engine, used by Project Zomboid's runtime environment.
23 |
24 | **TL;DR: PipeWrench implements TypeScript support for modding Project Zomboid.**
25 |
26 | ## What's the point of TypeScript in PZ? Isn't Lua enough?
27 |
28 | While you can do everything you need using only Lua (and that's totally fine!), there are a lot of potential issues that come from writing in scripting languages like Lua. Like JavaScript ES5 and prior, Lua itself doesn't deploy any solution for OOP (Object-Oriented Programming), coding practices. For example: While data types exist in Lua, checking parameter values are entirely in the hands of the programmer making for a lot of time spent writing code to maintain a bug-proof codebase. There are a few other issues while implementing pseudo-classes in Lua that deal with assigned properties, property signatures, mutability, visibility scope, property overloading, etc..
29 |
30 | With that said, my opinion of Lua is that it is great for smaller projects and exposing otherwise close-sourced operations to allow transformations of code otherwise unreachable by customers & third-party developers. Lua is a fun language, however for a codebase as big as some mods and Project Zomboid's codebase, this can cause a lot of headaches.
31 |
32 | An advantage of TypeScript is strong-types. Java is like this too however TypeScript is focused on functional, event-based languages primarily used for JavaScript. It's a language that provides OOP-standard features. Where Lua falls short, TypeScript (Using TSTL), bakes these tools into Lua. Classes, Interfaces, Abstracts, Generics, and other toolsets among what's provided in TypeScript are available to save time and keep your code clean.
33 |
34 | If you want to learn more about TypeScript and TypeScriptToLua, check out their websites:
35 |
36 | -
37 | -
38 |
39 | I won't turn this into an opinion piece, so we'll get into the meat and potatoes of PipeWrench!
40 |
41 | ## Setup
42 |
43 | - `git clone https://github.com/asledgehammer/PipeWrenchTemplate`
44 | - run `npm install` or `pnpm install` in the main folder.
45 |
46 | You should now have a _working_ environment.
47 |
48 | ## Commands
49 |
50 | - `npm run clean`: Cleans the `media/lua` output Lua code.
51 | - `npm run compile`: Compiles `.ts` files from the `./src/` folder to `.lua` files in the output folder.
52 | - `npm run dev`: Runs a watcher, watching `.lua`, `.ts`, and `.d.ts` files.
53 |
--------------------------------------------------------------------------------
/src/shared/lualib_bundle.lua:
--------------------------------------------------------------------------------
1 | local function __TS__ArrayIsArray(value)
2 | return type(value) == "table" and (value[1] ~= nil or next(value) == nil)
3 | end
4 |
5 | local function __TS__ArrayConcat(self, ...)
6 | local items = { ... }
7 | local result = {}
8 | local len = 0
9 | for i = 1, #self do
10 | len = len + 1
11 | result[len] = self[i]
12 | end
13 | for i = 1, #items do
14 | local item = items[i]
15 | if __TS__ArrayIsArray(item) then
16 | for j = 1, #item do
17 | len = len + 1
18 | result[len] = item[j]
19 | end
20 | else
21 | len = len + 1
22 | result[len] = item
23 | end
24 | end
25 | return result
26 | end
27 |
28 | local __TS__Symbol, Symbol
29 | do
30 | local symbolMetatable = {
31 | __tostring = function(self)
32 | return ("Symbol(" .. (self.description or "")) .. ")"
33 | end
34 | }
35 | function __TS__Symbol(description)
36 | return setmetatable({ description = description }, symbolMetatable)
37 | end
38 |
39 | Symbol = {
40 | iterator = __TS__Symbol("Symbol.iterator"),
41 | hasInstance = __TS__Symbol("Symbol.hasInstance"),
42 | species = __TS__Symbol("Symbol.species"),
43 | toStringTag = __TS__Symbol("Symbol.toStringTag")
44 | }
45 | end
46 |
47 | local function __TS__ArrayEntries(array)
48 | local key = 0
49 | return {
50 | [Symbol.iterator] = function(self)
51 | return self
52 | end,
53 | next = function(self)
54 | local result = { done = array[key + 1] == nil, value = { key, array[key + 1] } }
55 | key = key + 1
56 | return result
57 | end
58 | }
59 | end
60 |
61 | local function __TS__ArrayEvery(self, callbackfn, thisArg)
62 | for i = 1, #self do
63 | if not callbackfn(thisArg, self[i], i - 1, self) then
64 | return false
65 | end
66 | end
67 | return true
68 | end
69 |
70 | local function __TS__ArrayFilter(self, callbackfn, thisArg)
71 | local result = {}
72 | local len = 0
73 | for i = 1, #self do
74 | if callbackfn(thisArg, self[i], i - 1, self) then
75 | len = len + 1
76 | result[len] = self[i]
77 | end
78 | end
79 | return result
80 | end
81 |
82 | local function __TS__ArrayForEach(self, callbackFn, thisArg)
83 | for i = 1, #self do
84 | callbackFn(thisArg, self[i], i - 1, self)
85 | end
86 | end
87 |
88 | local function __TS__ArrayFind(self, predicate, thisArg)
89 | for i = 1, #self do
90 | local elem = self[i]
91 | if predicate(thisArg, elem, i - 1, self) then
92 | return elem
93 | end
94 | end
95 | return nil
96 | end
97 |
98 | local function __TS__ArrayFindIndex(self, callbackFn, thisArg)
99 | for i = 1, #self do
100 | if callbackFn(thisArg, self[i], i - 1, self) then
101 | return i - 1
102 | end
103 | end
104 | return -1
105 | end
106 |
107 | local __TS__Iterator
108 | do
109 | local function iteratorGeneratorStep(self)
110 | local co = self.____coroutine
111 | local status, value = coroutine.resume(co)
112 | if not status then
113 | error(value, 0)
114 | end
115 | if coroutine.status(co) == "dead" then
116 | return
117 | end
118 | return true, value
119 | end
120 | local function iteratorIteratorStep(self)
121 | local result = self:next()
122 | if result.done then
123 | return
124 | end
125 | return true, result.value
126 | end
127 | local function iteratorStringStep(self, index)
128 | index = index + 1
129 | if index > #self then
130 | return
131 | end
132 | return index, string.sub(self, index, index)
133 | end
134 | function __TS__Iterator(iterable)
135 | if type(iterable) == "string" then
136 | return iteratorStringStep, iterable, 0
137 | elseif iterable.____coroutine ~= nil then
138 | return iteratorGeneratorStep, iterable
139 | elseif iterable[Symbol.iterator] then
140 | local iterator = iterable[Symbol.iterator](iterable)
141 | return iteratorIteratorStep, iterator
142 | else
143 | return ipairs(iterable)
144 | end
145 | end
146 | end
147 |
148 | local __TS__ArrayFrom
149 | do
150 | local function arrayLikeStep(self, index)
151 | index = index + 1
152 | if index > self.length then
153 | return
154 | end
155 | return index, self[index]
156 | end
157 | local function arrayLikeIterator(arr)
158 | if type(arr.length) == "number" then
159 | return arrayLikeStep, arr, 0
160 | end
161 | return __TS__Iterator(arr)
162 | end
163 | function __TS__ArrayFrom(arrayLike, mapFn, thisArg)
164 | local result = {}
165 | if mapFn == nil then
166 | for ____, v in arrayLikeIterator(arrayLike) do
167 | result[#result + 1] = v
168 | end
169 | else
170 | for i, v in arrayLikeIterator(arrayLike) do
171 | result[#result + 1] = mapFn(thisArg, v, i - 1)
172 | end
173 | end
174 | return result
175 | end
176 | end
177 |
178 | local function __TS__ArrayIncludes(self, searchElement, fromIndex)
179 | if fromIndex == nil then
180 | fromIndex = 0
181 | end
182 | local len = #self
183 | local k = fromIndex
184 | if fromIndex < 0 then
185 | k = len + fromIndex
186 | end
187 | if k < 0 then
188 | k = 0
189 | end
190 | for i = k + 1, len do
191 | if self[i] == searchElement then
192 | return true
193 | end
194 | end
195 | return false
196 | end
197 |
198 | local function __TS__ArrayIndexOf(self, searchElement, fromIndex)
199 | if fromIndex == nil then
200 | fromIndex = 0
201 | end
202 | local len = #self
203 | if len == 0 then
204 | return -1
205 | end
206 | if fromIndex >= len then
207 | return -1
208 | end
209 | if fromIndex < 0 then
210 | fromIndex = len + fromIndex
211 | if fromIndex < 0 then
212 | fromIndex = 0
213 | end
214 | end
215 | for i = fromIndex + 1, len do
216 | if self[i] == searchElement then
217 | return i - 1
218 | end
219 | end
220 | return -1
221 | end
222 |
223 | local function __TS__ArrayJoin(self, separator)
224 | if separator == nil then
225 | separator = ","
226 | end
227 | local parts = {}
228 | for i = 1, #self do
229 | parts[i] = tostring(self[i])
230 | end
231 | return table.concat(parts, separator)
232 | end
233 |
234 | local function __TS__ArrayMap(self, callbackfn, thisArg)
235 | local result = {}
236 | for i = 1, #self do
237 | result[i] = callbackfn(thisArg, self[i], i - 1, self)
238 | end
239 | return result
240 | end
241 |
242 | local function __TS__ArrayPush(self, ...)
243 | local items = { ... }
244 | local len = #self
245 | for i = 1, #items do
246 | len = len + 1
247 | self[len] = items[i]
248 | end
249 | return len
250 | end
251 |
252 | local function __TS__ArrayPushArray(self, items)
253 | local len = #self
254 | for i = 1, #items do
255 | len = len + 1
256 | self[len] = items[i]
257 | end
258 | return len
259 | end
260 |
261 | local function __TS__CountVarargs(...)
262 | return select("#", ...)
263 | end
264 |
265 | local function __TS__ArrayReduce(self, callbackFn, ...)
266 | local len = #self
267 | local k = 0
268 | local accumulator = nil
269 | if __TS__CountVarargs(...) ~= 0 then
270 | accumulator = ...
271 | elseif len > 0 then
272 | accumulator = self[1]
273 | k = 1
274 | else
275 | error("Reduce of empty array with no initial value", 0)
276 | end
277 | for i = k + 1, len do
278 | accumulator = callbackFn(
279 | nil,
280 | accumulator,
281 | self[i],
282 | i - 1,
283 | self
284 | )
285 | end
286 | return accumulator
287 | end
288 |
289 | local function __TS__ArrayReduceRight(self, callbackFn, ...)
290 | local len = #self
291 | local k = len - 1
292 | local accumulator = nil
293 | if __TS__CountVarargs(...) ~= 0 then
294 | accumulator = ...
295 | elseif len > 0 then
296 | accumulator = self[k + 1]
297 | k = k - 1
298 | else
299 | error("Reduce of empty array with no initial value", 0)
300 | end
301 | for i = k + 1, 1, -1 do
302 | accumulator = callbackFn(
303 | nil,
304 | accumulator,
305 | self[i],
306 | i - 1,
307 | self
308 | )
309 | end
310 | return accumulator
311 | end
312 |
313 | local function __TS__ArrayReverse(self)
314 | local i = 1
315 | local j = #self
316 | while i < j do
317 | local temp = self[j]
318 | self[j] = self[i]
319 | self[i] = temp
320 | i = i + 1
321 | j = j - 1
322 | end
323 | return self
324 | end
325 |
326 | local function __TS__ArrayUnshift(self, ...)
327 | local items = { ... }
328 | local numItemsToInsert = #items
329 | if numItemsToInsert == 0 then
330 | return #self
331 | end
332 | for i = #self, 1, -1 do
333 | self[i + numItemsToInsert] = self[i]
334 | end
335 | for i = 1, numItemsToInsert do
336 | self[i] = items[i]
337 | end
338 | return #self
339 | end
340 |
341 | local function __TS__ArraySort(self, compareFn)
342 | if compareFn ~= nil then
343 | table.sort(
344 | self,
345 | function(a, b) return compareFn(nil, a, b) < 0 end
346 | )
347 | else
348 | table.sort(self)
349 | end
350 | return self
351 | end
352 |
353 | local function __TS__ArraySlice(self, first, last)
354 | local len = #self
355 | local ____first_0 = first
356 | if ____first_0 == nil then
357 | ____first_0 = 0
358 | end
359 | first = ____first_0
360 | if first < 0 then
361 | first = len + first
362 | if first < 0 then
363 | first = 0
364 | end
365 | else
366 | if first > len then
367 | first = len
368 | end
369 | end
370 | local ____last_1 = last
371 | if ____last_1 == nil then
372 | ____last_1 = len
373 | end
374 | last = ____last_1
375 | if last < 0 then
376 | last = len + last
377 | if last < 0 then
378 | last = 0
379 | end
380 | else
381 | if last > len then
382 | last = len
383 | end
384 | end
385 | local out = {}
386 | first = first + 1
387 | last = last + 1
388 | local n = 1
389 | while first < last do
390 | out[n] = self[first]
391 | first = first + 1
392 | n = n + 1
393 | end
394 | return out
395 | end
396 |
397 | local function __TS__ArraySome(self, callbackfn, thisArg)
398 | for i = 1, #self do
399 | if callbackfn(thisArg, self[i], i - 1, self) then
400 | return true
401 | end
402 | end
403 | return false
404 | end
405 |
406 | local function __TS__ArraySplice(self, ...)
407 | local args = { ... }
408 | local len = #self
409 | local actualArgumentCount = __TS__CountVarargs(...)
410 | local start = args[1]
411 | local deleteCount = args[2]
412 | if start < 0 then
413 | start = len + start
414 | if start < 0 then
415 | start = 0
416 | end
417 | elseif start > len then
418 | start = len
419 | end
420 | local itemCount = actualArgumentCount - 2
421 | if itemCount < 0 then
422 | itemCount = 0
423 | end
424 | local actualDeleteCount
425 | if actualArgumentCount == 0 then
426 | actualDeleteCount = 0
427 | elseif actualArgumentCount == 1 then
428 | actualDeleteCount = len - start
429 | else
430 | local ____deleteCount_0 = deleteCount
431 | if ____deleteCount_0 == nil then
432 | ____deleteCount_0 = 0
433 | end
434 | actualDeleteCount = ____deleteCount_0
435 | if actualDeleteCount < 0 then
436 | actualDeleteCount = 0
437 | end
438 | if actualDeleteCount > len - start then
439 | actualDeleteCount = len - start
440 | end
441 | end
442 | local out = {}
443 | for k = 1, actualDeleteCount do
444 | local from = start + k
445 | if self[from] ~= nil then
446 | out[k] = self[from]
447 | end
448 | end
449 | if itemCount < actualDeleteCount then
450 | for k = start + 1, len - actualDeleteCount do
451 | local from = k + actualDeleteCount
452 | local to = k + itemCount
453 | if self[from] then
454 | self[to] = self[from]
455 | else
456 | self[to] = nil
457 | end
458 | end
459 | for k = len - actualDeleteCount + itemCount + 1, len do
460 | self[k] = nil
461 | end
462 | elseif itemCount > actualDeleteCount then
463 | for k = len - actualDeleteCount, start + 1, -1 do
464 | local from = k + actualDeleteCount
465 | local to = k + itemCount
466 | if self[from] then
467 | self[to] = self[from]
468 | else
469 | self[to] = nil
470 | end
471 | end
472 | end
473 | local j = start + 1
474 | for i = 3, actualArgumentCount do
475 | self[j] = args[i]
476 | j = j + 1
477 | end
478 | for k = #self, len - actualDeleteCount + itemCount + 1, -1 do
479 | self[k] = nil
480 | end
481 | return out
482 | end
483 |
484 | local function __TS__ArrayToObject(self)
485 | local object = {}
486 | for i = 1, #self do
487 | object[i - 1] = self[i]
488 | end
489 | return object
490 | end
491 |
492 | local function __TS__ArrayFlat(self, depth)
493 | if depth == nil then
494 | depth = 1
495 | end
496 | local result = {}
497 | local len = 0
498 | for i = 1, #self do
499 | local value = self[i]
500 | if depth > 0 and __TS__ArrayIsArray(value) then
501 | local toAdd
502 | if depth == 1 then
503 | toAdd = value
504 | else
505 | toAdd = __TS__ArrayFlat(value, depth - 1)
506 | end
507 | for j = 1, #toAdd do
508 | local val = toAdd[j]
509 | len = len + 1
510 | result[len] = val
511 | end
512 | else
513 | len = len + 1
514 | result[len] = value
515 | end
516 | end
517 | return result
518 | end
519 |
520 | local function __TS__ArrayFlatMap(self, callback, thisArg)
521 | local result = {}
522 | local len = 0
523 | for i = 1, #self do
524 | local value = callback(thisArg, self[i], i - 1, self)
525 | if __TS__ArrayIsArray(value) then
526 | for j = 1, #value do
527 | len = len + 1
528 | result[len] = value[j]
529 | end
530 | else
531 | len = len + 1
532 | result[len] = value
533 | end
534 | end
535 | return result
536 | end
537 |
538 | local function __TS__ArraySetLength(self, length)
539 | if length < 0 or length ~= length or length == math.huge or math.floor(length) ~= length then
540 | error(
541 | "invalid array length: " .. tostring(length),
542 | 0
543 | )
544 | end
545 | for i = length + 1, #self do
546 | self[i] = nil
547 | end
548 | return length
549 | end
550 |
551 | local function __TS__InstanceOf(obj, classTbl)
552 | if type(classTbl) ~= "table" then
553 | error("Right-hand side of 'instanceof' is not an object", 0)
554 | end
555 | if classTbl[Symbol.hasInstance] ~= nil then
556 | return not not classTbl[Symbol.hasInstance](classTbl, obj)
557 | end
558 | if type(obj) == "table" then
559 | local luaClass = obj.constructor
560 | while luaClass ~= nil do
561 | if luaClass == classTbl then
562 | return true
563 | end
564 | luaClass = luaClass.____super
565 | end
566 | end
567 | return false
568 | end
569 |
570 | local function __TS__New(target, ...)
571 | local instance = setmetatable({}, target.prototype)
572 | instance:____constructor(...)
573 | return instance
574 | end
575 |
576 | local function __TS__Class(self)
577 | local c = { prototype = {} }
578 | c.prototype.__index = c.prototype
579 | c.prototype.constructor = c
580 | return c
581 | end
582 |
583 | local __TS__Unpack = table.unpack or unpack
584 |
585 | local function __TS__FunctionBind(fn, ...)
586 | local boundArgs = { ... }
587 | return function(____, ...)
588 | local args = { ... }
589 | __TS__ArrayUnshift(
590 | args,
591 | __TS__Unpack(boundArgs)
592 | )
593 | return fn(__TS__Unpack(args))
594 | end
595 | end
596 |
597 | local __TS__Promise
598 | do
599 | local function promiseDeferred(self)
600 | local resolve
601 | local reject
602 | local promise = __TS__New(
603 | __TS__Promise,
604 | function(____, res, rej)
605 | resolve = res
606 | reject = rej
607 | end
608 | )
609 | return { promise = promise, resolve = resolve, reject = reject }
610 | end
611 | local function isPromiseLike(self, thing)
612 | return __TS__InstanceOf(thing, __TS__Promise)
613 | end
614 | __TS__Promise = __TS__Class()
615 | __TS__Promise.name = "__TS__Promise"
616 | function __TS__Promise.prototype.____constructor(self, executor)
617 | self.state = 0
618 | self.fulfilledCallbacks = {}
619 | self.rejectedCallbacks = {}
620 | self.finallyCallbacks = {}
621 | do
622 | local function ____catch(e)
623 | self:reject(e)
624 | end
625 | local ____try, ____hasReturned = pcall(function()
626 | executor(
627 | nil,
628 | __TS__FunctionBind(self.resolve, self),
629 | __TS__FunctionBind(self.reject, self)
630 | )
631 | end)
632 | if not ____try then
633 | ____catch(____hasReturned)
634 | end
635 | end
636 | end
637 |
638 | function __TS__Promise.resolve(data)
639 | local promise = __TS__New(
640 | __TS__Promise,
641 | function()
642 | end
643 | )
644 | promise.state = 1
645 | promise.value = data
646 | return promise
647 | end
648 |
649 | function __TS__Promise.reject(reason)
650 | local promise = __TS__New(
651 | __TS__Promise,
652 | function()
653 | end
654 | )
655 | promise.state = 2
656 | promise.rejectionReason = reason
657 | return promise
658 | end
659 |
660 | __TS__Promise.prototype["then"] = function(self, onFulfilled, onRejected)
661 | local ____promiseDeferred_result_0 = promiseDeferred(nil)
662 | local promise = ____promiseDeferred_result_0.promise
663 | local resolve = ____promiseDeferred_result_0.resolve
664 | local reject = ____promiseDeferred_result_0.reject
665 | local isFulfilled = self.state == 1
666 | local isRejected = self.state == 2
667 | if onFulfilled then
668 | local internalCallback = self:createPromiseResolvingCallback(onFulfilled, resolve, reject)
669 | local ____self_fulfilledCallbacks_1 = self.fulfilledCallbacks
670 | ____self_fulfilledCallbacks_1[#____self_fulfilledCallbacks_1 + 1] = internalCallback
671 | if isFulfilled then
672 | internalCallback(nil, self.value)
673 | end
674 | else
675 | local ____self_fulfilledCallbacks_2 = self.fulfilledCallbacks
676 | ____self_fulfilledCallbacks_2[#____self_fulfilledCallbacks_2 + 1] = function(____, v) return resolve(nil, v) end
677 | end
678 | if onRejected then
679 | local internalCallback = self:createPromiseResolvingCallback(onRejected, resolve, reject)
680 | local ____self_rejectedCallbacks_3 = self.rejectedCallbacks
681 | ____self_rejectedCallbacks_3[#____self_rejectedCallbacks_3 + 1] = internalCallback
682 | if isRejected then
683 | internalCallback(nil, self.rejectionReason)
684 | end
685 | else
686 | local ____self_rejectedCallbacks_4 = self.rejectedCallbacks
687 | ____self_rejectedCallbacks_4[#____self_rejectedCallbacks_4 + 1] = function(____, err) return reject(nil, err) end
688 | end
689 | if isFulfilled then
690 | resolve(nil, self.value)
691 | end
692 | if isRejected then
693 | reject(nil, self.rejectionReason)
694 | end
695 | return promise
696 | end
697 | function __TS__Promise.prototype.catch(self, onRejected)
698 | return self["then"](self, nil, onRejected)
699 | end
700 |
701 | function __TS__Promise.prototype.finally(self, onFinally)
702 | if onFinally then
703 | local ____self_finallyCallbacks_5 = self.finallyCallbacks
704 | ____self_finallyCallbacks_5[#____self_finallyCallbacks_5 + 1] = onFinally
705 | if self.state ~= 0 then
706 | onFinally(nil)
707 | end
708 | end
709 | return self
710 | end
711 |
712 | function __TS__Promise.prototype.resolve(self, data)
713 | if __TS__InstanceOf(data, __TS__Promise) then
714 | data["then"](
715 | data,
716 | function(____, v) return self:resolve(v) end,
717 | function(____, err) return self:reject(err) end
718 | )
719 | return
720 | end
721 | if self.state == 0 then
722 | self.state = 1
723 | self.value = data
724 | for ____, callback in ipairs(self.fulfilledCallbacks) do
725 | callback(nil, data)
726 | end
727 | for ____, callback in ipairs(self.finallyCallbacks) do
728 | callback(nil)
729 | end
730 | end
731 | end
732 |
733 | function __TS__Promise.prototype.reject(self, reason)
734 | if self.state == 0 then
735 | self.state = 2
736 | self.rejectionReason = reason
737 | for ____, callback in ipairs(self.rejectedCallbacks) do
738 | callback(nil, reason)
739 | end
740 | for ____, callback in ipairs(self.finallyCallbacks) do
741 | callback(nil)
742 | end
743 | end
744 | end
745 |
746 | function __TS__Promise.prototype.createPromiseResolvingCallback(self, f, resolve, reject)
747 | return function(____, value)
748 | do
749 | local function ____catch(e)
750 | reject(nil, e)
751 | end
752 | local ____try, ____hasReturned = pcall(function()
753 | self:handleCallbackData(
754 | f(nil, value),
755 | resolve,
756 | reject
757 | )
758 | end)
759 | if not ____try then
760 | ____catch(____hasReturned)
761 | end
762 | end
763 | end
764 | end
765 |
766 | function __TS__Promise.prototype.handleCallbackData(self, data, resolve, reject)
767 | if isPromiseLike(nil, data) then
768 | local nextpromise = data
769 | if nextpromise.state == 1 then
770 | resolve(nil, nextpromise.value)
771 | elseif nextpromise.state == 2 then
772 | reject(nil, nextpromise.rejectionReason)
773 | else
774 | data["then"](data, resolve, reject)
775 | end
776 | else
777 | resolve(nil, data)
778 | end
779 | end
780 | end
781 |
782 | local function __TS__AsyncAwaiter(generator)
783 | return __TS__New(
784 | __TS__Promise,
785 | function(____, resolve, reject)
786 | local adopt, fulfilled, step, resolved, asyncCoroutine
787 | function adopt(self, value)
788 | local ____temp_0
789 | if __TS__InstanceOf(value, __TS__Promise) then
790 | ____temp_0 = value
791 | else
792 | ____temp_0 = __TS__Promise.resolve(value)
793 | end
794 | return ____temp_0
795 | end
796 |
797 | function fulfilled(self, value)
798 | local success, resultOrError = coroutine.resume(asyncCoroutine, value)
799 | if success then
800 | step(nil, resultOrError)
801 | else
802 | reject(nil, resultOrError)
803 | end
804 | end
805 |
806 | function step(self, result)
807 | if resolved then
808 | return
809 | end
810 | if coroutine.status(asyncCoroutine) == "dead" then
811 | resolve(nil, result)
812 | else
813 | local ____self_1 = adopt(nil, result)
814 | ____self_1["then"](____self_1, fulfilled, reject)
815 | end
816 | end
817 |
818 | resolved = false
819 | asyncCoroutine = coroutine.create(generator)
820 | local success, resultOrError = coroutine.resume(
821 | asyncCoroutine,
822 | function(____, v)
823 | resolved = true
824 | local ____self_2 = adopt(nil, v)
825 | ____self_2["then"](____self_2, resolve, reject)
826 | end
827 | )
828 | if success then
829 | step(nil, resultOrError)
830 | else
831 | reject(nil, resultOrError)
832 | end
833 | end
834 | )
835 | end
836 | local function __TS__Await(thing)
837 | return coroutine.yield(thing)
838 | end
839 |
840 | local function __TS__CloneDescriptor(____bindingPattern0)
841 | local value
842 | local writable
843 | local set
844 | local get
845 | local configurable
846 | local enumerable
847 | enumerable = ____bindingPattern0.enumerable
848 | configurable = ____bindingPattern0.configurable
849 | get = ____bindingPattern0.get
850 | set = ____bindingPattern0.set
851 | writable = ____bindingPattern0.writable
852 | value = ____bindingPattern0.value
853 | local descriptor = { enumerable = enumerable == true, configurable = configurable == true }
854 | local hasGetterOrSetter = get ~= nil or set ~= nil
855 | local hasValueOrWritableAttribute = writable ~= nil or value ~= nil
856 | if hasGetterOrSetter and hasValueOrWritableAttribute then
857 | error("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute.", 0)
858 | end
859 | if get or set then
860 | descriptor.get = get
861 | descriptor.set = set
862 | else
863 | descriptor.value = value
864 | descriptor.writable = writable == true
865 | end
866 | return descriptor
867 | end
868 |
869 | local function __TS__ObjectAssign(target, ...)
870 | local sources = { ... }
871 | for i = 1, #sources do
872 | local source = sources[i]
873 | for key in pairs(source) do
874 | target[key] = source[key]
875 | end
876 | end
877 | return target
878 | end
879 |
880 | local function __TS__ObjectGetOwnPropertyDescriptor(object, key)
881 | local metatable = getmetatable(object)
882 | if not metatable then
883 | return
884 | end
885 | if not rawget(metatable, "_descriptors") then
886 | return
887 | end
888 | return rawget(metatable, "_descriptors")[key]
889 | end
890 |
891 | local __TS__SetDescriptor
892 | do
893 | local function descriptorIndex(self, key)
894 | local value = rawget(self, key)
895 | if value ~= nil then
896 | return value
897 | end
898 | local metatable = getmetatable(self)
899 | while metatable do
900 | local rawResult = rawget(metatable, key)
901 | if rawResult ~= nil then
902 | return rawResult
903 | end
904 | local descriptors = rawget(metatable, "_descriptors")
905 | if descriptors then
906 | local descriptor = descriptors[key]
907 | if descriptor then
908 | if descriptor.get then
909 | return descriptor.get(self)
910 | end
911 | return descriptor.value
912 | end
913 | end
914 | metatable = getmetatable(metatable)
915 | end
916 | end
917 | local function descriptorNewIndex(self, key, value)
918 | local metatable = getmetatable(self)
919 | while metatable do
920 | local descriptors = rawget(metatable, "_descriptors")
921 | if descriptors then
922 | local descriptor = descriptors[key]
923 | if descriptor then
924 | if descriptor.set then
925 | descriptor.set(self, value)
926 | else
927 | if descriptor.writable == false then
928 | error(
929 | ((("Cannot assign to read only property '" .. key) .. "' of object '") .. tostring(self)) ..
930 | "'",
931 | 0
932 | )
933 | end
934 | descriptor.value = value
935 | end
936 | return
937 | end
938 | end
939 | metatable = getmetatable(metatable)
940 | end
941 | rawset(self, key, value)
942 | end
943 | function __TS__SetDescriptor(target, key, desc, isPrototype)
944 | if isPrototype == nil then
945 | isPrototype = false
946 | end
947 | local ____isPrototype_0
948 | if isPrototype then
949 | ____isPrototype_0 = target
950 | else
951 | ____isPrototype_0 = getmetatable(target)
952 | end
953 | local metatable = ____isPrototype_0
954 | if not metatable then
955 | metatable = {}
956 | setmetatable(target, metatable)
957 | end
958 | local value = rawget(target, key)
959 | if value ~= nil then
960 | rawset(target, key, nil)
961 | end
962 | if not rawget(metatable, "_descriptors") then
963 | metatable._descriptors = {}
964 | end
965 | metatable._descriptors[key] = __TS__CloneDescriptor(desc)
966 | metatable.__index = descriptorIndex
967 | metatable.__newindex = descriptorNewIndex
968 | end
969 | end
970 |
971 | local function __TS__Decorate(decorators, target, key, desc)
972 | local result = target
973 | do
974 | local i = #decorators
975 | while i >= 0 do
976 | local decorator = decorators[i + 1]
977 | if decorator then
978 | local oldResult = result
979 | if key == nil then
980 | result = decorator(nil, result)
981 | elseif desc == true then
982 | local value = rawget(target, key)
983 | local descriptor = __TS__ObjectGetOwnPropertyDescriptor(target, key) or
984 | ({ configurable = true, writable = true, value = value })
985 | local desc = decorator(nil, target, key, descriptor) or descriptor
986 | local isSimpleValue = desc.configurable == true and desc.writable == true and not desc.get and
987 | not desc.set
988 | if isSimpleValue then
989 | rawset(target, key, desc.value)
990 | else
991 | __TS__SetDescriptor(
992 | target,
993 | key,
994 | __TS__ObjectAssign({}, descriptor, desc)
995 | )
996 | end
997 | elseif desc == false then
998 | result = decorator(nil, target, key, desc)
999 | else
1000 | result = decorator(nil, target, key)
1001 | end
1002 | result = result or oldResult
1003 | end
1004 | i = i - 1
1005 | end
1006 | end
1007 | return result
1008 | end
1009 |
1010 | local function __TS__DecorateParam(paramIndex, decorator)
1011 | return function(____, target, key) return decorator(nil, target, key, paramIndex) end
1012 | end
1013 |
1014 | local function __TS__StringIncludes(self, searchString, position)
1015 | if not position then
1016 | position = 1
1017 | else
1018 | position = position + 1
1019 | end
1020 | local index = string.find(self, searchString, position, true)
1021 | return index ~= nil
1022 | end
1023 |
1024 | local Error, RangeError, ReferenceError, SyntaxError, TypeError, URIError
1025 | do
1026 | local function getErrorStack(self, constructor)
1027 | local level = 1
1028 | while true do
1029 | local info = debug.getinfo(level, "f")
1030 | level = level + 1
1031 | if not info then
1032 | level = 1
1033 | break
1034 | elseif info.func == constructor then
1035 | break
1036 | end
1037 | end
1038 | if __TS__StringIncludes(_VERSION, "Lua 5.0") then
1039 | return debug.traceback(("[Level " .. tostring(level)) .. "]")
1040 | else
1041 | return debug.traceback(nil, level)
1042 | end
1043 | end
1044 | local function wrapErrorToString(self, getDescription)
1045 | return function(self)
1046 | local description = getDescription(self)
1047 | local caller = debug.getinfo(3, "f")
1048 | local isClassicLua = __TS__StringIncludes(_VERSION, "Lua 5.0") or _VERSION == "Lua 5.1"
1049 | if isClassicLua or caller and caller.func ~= error then
1050 | return description
1051 | else
1052 | return (tostring(description) .. "\n") .. self.stack
1053 | end
1054 | end
1055 | end
1056 | local function initErrorClass(self, Type, name)
1057 | Type.name = name
1058 | return setmetatable(
1059 | Type,
1060 | { __call = function(____, _self, message) return __TS__New(Type, message) end }
1061 | )
1062 | end
1063 | local ____initErrorClass_2 = initErrorClass
1064 | local ____class_0 = __TS__Class()
1065 | ____class_0.name = ""
1066 | function ____class_0.prototype.____constructor(self, message)
1067 | if message == nil then
1068 | message = ""
1069 | end
1070 | self.message = message
1071 | self.name = "Error"
1072 | self.stack = getErrorStack(nil, self.constructor.new)
1073 | local metatable = getmetatable(self)
1074 | if not metatable.__errorToStringPatched then
1075 | metatable.__errorToStringPatched = true
1076 | metatable.__tostring = wrapErrorToString(nil, metatable.__tostring)
1077 | end
1078 | end
1079 |
1080 | function ____class_0.prototype.__tostring(self)
1081 | local ____temp_1
1082 | if self.message ~= "" then
1083 | ____temp_1 = (self.name .. ": ") .. self.message
1084 | else
1085 | ____temp_1 = self.name
1086 | end
1087 | return ____temp_1
1088 | end
1089 |
1090 | Error = ____initErrorClass_2(nil, ____class_0, "Error")
1091 | local function createErrorClass(self, name)
1092 | local ____initErrorClass_4 = initErrorClass
1093 | local ____class_3 = __TS__Class()
1094 | ____class_3.name = ____class_3.name
1095 | __TS__ClassExtends(____class_3, Error)
1096 | function ____class_3.prototype.____constructor(self, ...)
1097 | ____class_3.____super.prototype.____constructor(self, ...)
1098 | self.name = name
1099 | end
1100 |
1101 | return ____initErrorClass_4(nil, ____class_3, name)
1102 | end
1103 | RangeError = createErrorClass(nil, "RangeError")
1104 | ReferenceError = createErrorClass(nil, "ReferenceError")
1105 | SyntaxError = createErrorClass(nil, "SyntaxError")
1106 | TypeError = createErrorClass(nil, "TypeError")
1107 | URIError = createErrorClass(nil, "URIError")
1108 | end
1109 |
1110 | local function __TS__ObjectGetOwnPropertyDescriptors(object)
1111 | local metatable = getmetatable(object)
1112 | if not metatable then
1113 | return {}
1114 | end
1115 | return rawget(metatable, "_descriptors") or ({})
1116 | end
1117 |
1118 | local function __TS__Delete(target, key)
1119 | local descriptors = __TS__ObjectGetOwnPropertyDescriptors(target)
1120 | local descriptor = descriptors[key]
1121 | if descriptor then
1122 | if not descriptor.configurable then
1123 | error(
1124 | __TS__New(
1125 | TypeError,
1126 | ((("Cannot delete property " .. tostring(key)) .. " of ") .. tostring(target)) .. "."
1127 | ),
1128 | 0
1129 | )
1130 | end
1131 | descriptors[key] = nil
1132 | return true
1133 | end
1134 | target[key] = nil
1135 | return true
1136 | end
1137 |
1138 | local function __TS__StringAccess(self, index)
1139 | if index >= 0 and index < #self then
1140 | return string.sub(self, index + 1, index + 1)
1141 | end
1142 | end
1143 |
1144 | local function __TS__DelegatedYield(iterable)
1145 | if type(iterable) == "string" then
1146 | for index = 0, #iterable - 1 do
1147 | coroutine.yield(__TS__StringAccess(iterable, index))
1148 | end
1149 | elseif iterable.____coroutine ~= nil then
1150 | local co = iterable.____coroutine
1151 | while true do
1152 | local status, value = coroutine.resume(co)
1153 | if not status then
1154 | error(value, 0)
1155 | end
1156 | if coroutine.status(co) == "dead" then
1157 | return value
1158 | else
1159 | coroutine.yield(value)
1160 | end
1161 | end
1162 | elseif iterable[Symbol.iterator] then
1163 | local iterator = iterable[Symbol.iterator](iterable)
1164 | while true do
1165 | local result = iterator:next()
1166 | if result.done then
1167 | return result.value
1168 | else
1169 | coroutine.yield(result.value)
1170 | end
1171 | end
1172 | else
1173 | for ____, value in ipairs(iterable) do
1174 | coroutine.yield(value)
1175 | end
1176 | end
1177 | end
1178 |
1179 | local __TS__Generator
1180 | do
1181 | local function generatorIterator(self)
1182 | return self
1183 | end
1184 | local function generatorNext(self, ...)
1185 | local co = self.____coroutine
1186 | if coroutine.status(co) == "dead" then
1187 | return { done = true }
1188 | end
1189 | local status, value = coroutine.resume(co, ...)
1190 | if not status then
1191 | error(value, 0)
1192 | end
1193 | return {
1194 | value = value,
1195 | done = coroutine.status(co) == "dead"
1196 | }
1197 | end
1198 | function __TS__Generator(fn)
1199 | return function(...)
1200 | local args = { ... }
1201 | local argsLength = __TS__CountVarargs(...)
1202 | return {
1203 | ____coroutine = coroutine.create(function() return fn(__TS__Unpack(args, 1, argsLength)) end),
1204 | [Symbol.iterator] = generatorIterator,
1205 | next = generatorNext
1206 | }
1207 | end
1208 | end
1209 | end
1210 |
1211 | local function __TS__InstanceOfObject(value)
1212 | local valueType = type(value)
1213 | return valueType == "table" or valueType == "function"
1214 | end
1215 |
1216 | local function __TS__LuaIteratorSpread(self, state, firstKey)
1217 | local results = {}
1218 | local key, value = self(state, firstKey)
1219 | while key do
1220 | results[#results + 1] = { key, value }
1221 | key, value = self(state, key)
1222 | end
1223 | return __TS__Unpack(results)
1224 | end
1225 |
1226 | local Map
1227 | do
1228 | Map = __TS__Class()
1229 | Map.name = "Map"
1230 | function Map.prototype.____constructor(self, entries)
1231 | self[Symbol.toStringTag] = "Map"
1232 | self.items = {}
1233 | self.size = 0
1234 | self.nextKey = {}
1235 | self.previousKey = {}
1236 | if entries == nil then
1237 | return
1238 | end
1239 | local iterable = entries
1240 | if iterable[Symbol.iterator] then
1241 | local iterator = iterable[Symbol.iterator](iterable)
1242 | while true do
1243 | local result = iterator:next()
1244 | if result.done then
1245 | break
1246 | end
1247 | local value = result.value
1248 | self:set(value[1], value[2])
1249 | end
1250 | else
1251 | local array = entries
1252 | for ____, kvp in ipairs(array) do
1253 | self:set(kvp[1], kvp[2])
1254 | end
1255 | end
1256 | end
1257 |
1258 | function Map.prototype.clear(self)
1259 | self.items = {}
1260 | self.nextKey = {}
1261 | self.previousKey = {}
1262 | self.firstKey = nil
1263 | self.lastKey = nil
1264 | self.size = 0
1265 | end
1266 |
1267 | function Map.prototype.delete(self, key)
1268 | local contains = self:has(key)
1269 | if contains then
1270 | self.size = self.size - 1
1271 | local next = self.nextKey[key]
1272 | local previous = self.previousKey[key]
1273 | if next and previous then
1274 | self.nextKey[previous] = next
1275 | self.previousKey[next] = previous
1276 | elseif next then
1277 | self.firstKey = next
1278 | self.previousKey[next] = nil
1279 | elseif previous then
1280 | self.lastKey = previous
1281 | self.nextKey[previous] = nil
1282 | else
1283 | self.firstKey = nil
1284 | self.lastKey = nil
1285 | end
1286 | self.nextKey[key] = nil
1287 | self.previousKey[key] = nil
1288 | end
1289 | self.items[key] = nil
1290 | return contains
1291 | end
1292 |
1293 | function Map.prototype.forEach(self, callback)
1294 | for ____, key in __TS__Iterator(self:keys()) do
1295 | callback(nil, self.items[key], key, self)
1296 | end
1297 | end
1298 |
1299 | function Map.prototype.get(self, key)
1300 | return self.items[key]
1301 | end
1302 |
1303 | function Map.prototype.has(self, key)
1304 | return self.nextKey[key] ~= nil or self.lastKey == key
1305 | end
1306 |
1307 | function Map.prototype.set(self, key, value)
1308 | local isNewValue = not self:has(key)
1309 | if isNewValue then
1310 | self.size = self.size + 1
1311 | end
1312 | self.items[key] = value
1313 | if self.firstKey == nil then
1314 | self.firstKey = key
1315 | self.lastKey = key
1316 | elseif isNewValue then
1317 | self.nextKey[self.lastKey] = key
1318 | self.previousKey[key] = self.lastKey
1319 | self.lastKey = key
1320 | end
1321 | return self
1322 | end
1323 |
1324 | Map.prototype[Symbol.iterator] = function(self)
1325 | return self:entries()
1326 | end
1327 | function Map.prototype.entries(self)
1328 | local items = self.items
1329 | local nextKey = self.nextKey
1330 | local key = self.firstKey
1331 | return {
1332 | [Symbol.iterator] = function(self)
1333 | return self
1334 | end,
1335 | next = function(self)
1336 | local result = { done = not key, value = { key, items[key] } }
1337 | key = nextKey[key]
1338 | return result
1339 | end
1340 | }
1341 | end
1342 |
1343 | function Map.prototype.keys(self)
1344 | local nextKey = self.nextKey
1345 | local key = self.firstKey
1346 | return {
1347 | [Symbol.iterator] = function(self)
1348 | return self
1349 | end,
1350 | next = function(self)
1351 | local result = { done = not key, value = key }
1352 | key = nextKey[key]
1353 | return result
1354 | end
1355 | }
1356 | end
1357 |
1358 | function Map.prototype.values(self)
1359 | local items = self.items
1360 | local nextKey = self.nextKey
1361 | local key = self.firstKey
1362 | return {
1363 | [Symbol.iterator] = function(self)
1364 | return self
1365 | end,
1366 | next = function(self)
1367 | local result = { done = not key, value = items[key] }
1368 | key = nextKey[key]
1369 | return result
1370 | end
1371 | }
1372 | end
1373 |
1374 | Map[Symbol.species] = Map
1375 | end
1376 |
1377 | local __TS__Match = string.match
1378 |
1379 | local __TS__MathAtan2 = math.atan2 or math.atan
1380 |
1381 | local __TS__MathModf = math.modf
1382 |
1383 | local function __TS__MathSign(val)
1384 | if val > 0 then
1385 | return 1
1386 | elseif val < 0 then
1387 | return -1
1388 | end
1389 | return 0
1390 | end
1391 |
1392 | local function __TS__Number(value)
1393 | local valueType = type(value)
1394 | if valueType == "number" then
1395 | return value
1396 | elseif valueType == "string" then
1397 | local numberValue = tonumber(value)
1398 | if numberValue then
1399 | return numberValue
1400 | end
1401 | if value == "Infinity" then
1402 | return math.huge
1403 | end
1404 | if value == "-Infinity" then
1405 | return -math.huge
1406 | end
1407 | local stringWithoutSpaces = string.gsub(value, "%s", "")
1408 | if stringWithoutSpaces == "" then
1409 | return 0
1410 | end
1411 | return 0 / 0
1412 | elseif valueType == "boolean" then
1413 | return value and 1 or 0
1414 | else
1415 | return 0 / 0
1416 | end
1417 | end
1418 |
1419 | local function __TS__NumberIsFinite(value)
1420 | return type(value) == "number" and value == value and value ~= math.huge and value ~= -math.huge
1421 | end
1422 |
1423 | local function __TS__NumberIsNaN(value)
1424 | return value ~= value
1425 | end
1426 |
1427 | local __TS__NumberToString
1428 | do
1429 | local radixChars = "0123456789abcdefghijklmnopqrstuvwxyz"
1430 | function __TS__NumberToString(self, radix)
1431 | if radix == nil or radix == 10 or self == math.huge or self == -math.huge or self ~= self then
1432 | return tostring(self)
1433 | end
1434 | radix = math.floor(radix)
1435 | if radix < 2 or radix > 36 then
1436 | error("toString() radix argument must be between 2 and 36", 0)
1437 | end
1438 | local integer, fraction = __TS__MathModf(math.abs(self))
1439 | local result = ""
1440 | if radix == 8 then
1441 | result = string.format("%o", integer)
1442 | elseif radix == 16 then
1443 | result = string.format("%x", integer)
1444 | else
1445 | repeat
1446 | do
1447 | result = __TS__StringAccess(radixChars, integer % radix) .. result
1448 | integer = math.floor(integer / radix)
1449 | end
1450 | until not (integer ~= 0)
1451 | end
1452 | if fraction ~= 0 then
1453 | result = result .. "."
1454 | local delta = 1e-16
1455 | repeat
1456 | do
1457 | fraction = fraction * radix
1458 | delta = delta * radix
1459 | local digit = math.floor(fraction)
1460 | result = result .. __TS__StringAccess(radixChars, digit)
1461 | fraction = fraction - digit
1462 | end
1463 | until not (fraction >= delta)
1464 | end
1465 | if self < 0 then
1466 | result = "-" .. result
1467 | end
1468 | return result
1469 | end
1470 | end
1471 |
1472 | local function __TS__ObjectDefineProperty(target, key, desc)
1473 | local ____temp_0
1474 | if type(key) == "number" then
1475 | ____temp_0 = key + 1
1476 | else
1477 | ____temp_0 = key
1478 | end
1479 | local luaKey = ____temp_0
1480 | local value = rawget(target, luaKey)
1481 | local hasGetterOrSetter = desc.get ~= nil or desc.set ~= nil
1482 | local descriptor
1483 | if hasGetterOrSetter then
1484 | if value ~= nil then
1485 | error(
1486 | "Cannot redefine property: " .. tostring(key),
1487 | 0
1488 | )
1489 | end
1490 | descriptor = desc
1491 | else
1492 | local valueExists = value ~= nil
1493 | local ____desc_set_5 = desc.set
1494 | local ____desc_get_6 = desc.get
1495 | local ____temp_1
1496 | if desc.configurable ~= nil then
1497 | ____temp_1 = desc.configurable
1498 | else
1499 | ____temp_1 = valueExists
1500 | end
1501 | local ____temp_2
1502 | if desc.enumerable ~= nil then
1503 | ____temp_2 = desc.enumerable
1504 | else
1505 | ____temp_2 = valueExists
1506 | end
1507 | local ____temp_3
1508 | if desc.writable ~= nil then
1509 | ____temp_3 = desc.writable
1510 | else
1511 | ____temp_3 = valueExists
1512 | end
1513 | local ____temp_4
1514 | if desc.value ~= nil then
1515 | ____temp_4 = desc.value
1516 | else
1517 | ____temp_4 = value
1518 | end
1519 | descriptor = {
1520 | set = ____desc_set_5,
1521 | get = ____desc_get_6,
1522 | configurable = ____temp_1,
1523 | enumerable = ____temp_2,
1524 | writable = ____temp_3,
1525 | value = ____temp_4
1526 | }
1527 | end
1528 | __TS__SetDescriptor(target, luaKey, descriptor)
1529 | return target
1530 | end
1531 |
1532 | local function __TS__ObjectEntries(obj)
1533 | local result = {}
1534 | local len = 0
1535 | for key in pairs(obj) do
1536 | len = len + 1
1537 | result[len] = { key, obj[key] }
1538 | end
1539 | return result
1540 | end
1541 |
1542 | local function __TS__ObjectFromEntries(entries)
1543 | local obj = {}
1544 | local iterable = entries
1545 | if iterable[Symbol.iterator] then
1546 | local iterator = iterable[Symbol.iterator](iterable)
1547 | while true do
1548 | local result = iterator:next()
1549 | if result.done then
1550 | break
1551 | end
1552 | local value = result.value
1553 | obj[value[1]] = value[2]
1554 | end
1555 | else
1556 | for ____, entry in ipairs(entries) do
1557 | obj[entry[1]] = entry[2]
1558 | end
1559 | end
1560 | return obj
1561 | end
1562 |
1563 | local function __TS__ObjectKeys(obj)
1564 | local result = {}
1565 | local len = 0
1566 | for key in pairs(obj) do
1567 | len = len + 1
1568 | result[len] = key
1569 | end
1570 | return result
1571 | end
1572 |
1573 | local function __TS__ObjectRest(target, usedProperties)
1574 | local result = {}
1575 | for property in pairs(target) do
1576 | if not usedProperties[property] then
1577 | result[property] = target[property]
1578 | end
1579 | end
1580 | return result
1581 | end
1582 |
1583 | local function __TS__ObjectValues(obj)
1584 | local result = {}
1585 | local len = 0
1586 | for key in pairs(obj) do
1587 | len = len + 1
1588 | result[len] = obj[key]
1589 | end
1590 | return result
1591 | end
1592 |
1593 | local function __TS__ParseFloat(numberString)
1594 | local infinityMatch = __TS__Match(numberString, "^%s*(-?Infinity)")
1595 | if infinityMatch then
1596 | local ____temp_0
1597 | if __TS__StringAccess(infinityMatch, 0) == "-" then
1598 | ____temp_0 = -math.huge
1599 | else
1600 | ____temp_0 = math.huge
1601 | end
1602 | return ____temp_0
1603 | end
1604 | local number = tonumber(__TS__Match(numberString, "^%s*(-?%d+%.?%d*)"))
1605 | local ____number_1 = number
1606 | if ____number_1 == nil then
1607 | ____number_1 = 0 / 0
1608 | end
1609 | return ____number_1
1610 | end
1611 |
1612 | local function __TS__StringSubstring(self, start, ____end)
1613 | if ____end ~= ____end then
1614 | ____end = 0
1615 | end
1616 | if ____end ~= nil and start > ____end then
1617 | start, ____end = ____end, start
1618 | end
1619 | if start >= 0 then
1620 | start = start + 1
1621 | else
1622 | start = 1
1623 | end
1624 | if ____end ~= nil and ____end < 0 then
1625 | ____end = 0
1626 | end
1627 | return string.sub(self, start, ____end)
1628 | end
1629 |
1630 | local __TS__ParseInt
1631 | do
1632 | local parseIntBasePattern = "0123456789aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTvVwWxXyYzZ"
1633 | function __TS__ParseInt(numberString, base)
1634 | if base == nil then
1635 | base = 10
1636 | local hexMatch = __TS__Match(numberString, "^%s*-?0[xX]")
1637 | if hexMatch then
1638 | base = 16
1639 | local ____TS__Match_result__0_0
1640 | if __TS__Match(hexMatch, "-") then
1641 | ____TS__Match_result__0_0 = "-" .. __TS__StringSubstring(numberString, #hexMatch)
1642 | else
1643 | ____TS__Match_result__0_0 = __TS__StringSubstring(numberString, #hexMatch)
1644 | end
1645 | numberString = ____TS__Match_result__0_0
1646 | end
1647 | end
1648 | if base < 2 or base > 36 then
1649 | return 0 / 0
1650 | end
1651 | local ____temp_1
1652 | if base <= 10 then
1653 | ____temp_1 = __TS__StringSubstring(parseIntBasePattern, 0, base)
1654 | else
1655 | ____temp_1 = __TS__StringSubstring(parseIntBasePattern, 0, 10 + 2 * (base - 10))
1656 | end
1657 | local allowedDigits = ____temp_1
1658 | local pattern = ("^%s*(-?[" .. allowedDigits) .. "]*)"
1659 | local number = tonumber(
1660 | __TS__Match(numberString, pattern),
1661 | base
1662 | )
1663 | if number == nil then
1664 | return 0 / 0
1665 | end
1666 | if number >= 0 then
1667 | return math.floor(number)
1668 | else
1669 | return math.ceil(number)
1670 | end
1671 | end
1672 | end
1673 |
1674 | local function __TS__PromiseAll(iterable)
1675 | local results = {}
1676 | local toResolve = {}
1677 | local numToResolve = 0
1678 | local i = 0
1679 | for ____, item in __TS__Iterator(iterable) do
1680 | if __TS__InstanceOf(item, __TS__Promise) then
1681 | if item.state == 1 then
1682 | results[i + 1] = item.value
1683 | elseif item.state == 2 then
1684 | return __TS__Promise.reject(item.rejectionReason)
1685 | else
1686 | numToResolve = numToResolve + 1
1687 | toResolve[i] = item
1688 | end
1689 | else
1690 | results[i + 1] = item
1691 | end
1692 | i = i + 1
1693 | end
1694 | if numToResolve == 0 then
1695 | return __TS__Promise.resolve(results)
1696 | end
1697 | return __TS__New(
1698 | __TS__Promise,
1699 | function(____, resolve, reject)
1700 | for index, promise in pairs(toResolve) do
1701 | promise["then"](
1702 | promise,
1703 | function(____, data)
1704 | results[index + 1] = data
1705 | numToResolve = numToResolve - 1
1706 | if numToResolve == 0 then
1707 | resolve(nil, results)
1708 | end
1709 | end,
1710 | function(____, reason)
1711 | reject(nil, reason)
1712 | end
1713 | )
1714 | end
1715 | end
1716 | )
1717 | end
1718 |
1719 | local function __TS__PromiseAllSettled(iterable)
1720 | local results = {}
1721 | local toResolve = {}
1722 | local numToResolve = 0
1723 | local i = 0
1724 | for ____, item in __TS__Iterator(iterable) do
1725 | if __TS__InstanceOf(item, __TS__Promise) then
1726 | if item.state == 1 then
1727 | results[i + 1] = { status = "fulfilled", value = item.value }
1728 | elseif item.state == 2 then
1729 | results[i + 1] = { status = "rejected", reason = item.rejectionReason }
1730 | else
1731 | numToResolve = numToResolve + 1
1732 | toResolve[i] = item
1733 | end
1734 | else
1735 | results[i + 1] = { status = "fulfilled", value = item }
1736 | end
1737 | i = i + 1
1738 | end
1739 | if numToResolve == 0 then
1740 | return __TS__Promise.resolve(results)
1741 | end
1742 | return __TS__New(
1743 | __TS__Promise,
1744 | function(____, resolve)
1745 | for index, promise in pairs(toResolve) do
1746 | promise["then"](
1747 | promise,
1748 | function(____, data)
1749 | results[index + 1] = { status = "fulfilled", value = data }
1750 | numToResolve = numToResolve - 1
1751 | if numToResolve == 0 then
1752 | resolve(nil, results)
1753 | end
1754 | end,
1755 | function(____, reason)
1756 | results[index + 1] = { status = "rejected", reason = reason }
1757 | numToResolve = numToResolve - 1
1758 | if numToResolve == 0 then
1759 | resolve(nil, results)
1760 | end
1761 | end
1762 | )
1763 | end
1764 | end
1765 | )
1766 | end
1767 |
1768 | local function __TS__PromiseAny(iterable)
1769 | local rejections = {}
1770 | local pending = {}
1771 | for ____, item in __TS__Iterator(iterable) do
1772 | if __TS__InstanceOf(item, __TS__Promise) then
1773 | if item.state == 1 then
1774 | return __TS__Promise.resolve(item.value)
1775 | elseif item.state == 2 then
1776 | rejections[#rejections + 1] = item.rejectionReason
1777 | else
1778 | pending[#pending + 1] = item
1779 | end
1780 | else
1781 | return __TS__Promise.resolve(item)
1782 | end
1783 | end
1784 | if #pending == 0 then
1785 | return __TS__Promise.reject("No promises to resolve with .any()")
1786 | end
1787 | local numResolved = 0
1788 | return __TS__New(
1789 | __TS__Promise,
1790 | function(____, resolve, reject)
1791 | for ____, promise in ipairs(pending) do
1792 | promise["then"](
1793 | promise,
1794 | function(____, data)
1795 | resolve(nil, data)
1796 | end,
1797 | function(____, reason)
1798 | rejections[#rejections + 1] = reason
1799 | numResolved = numResolved + 1
1800 | if numResolved == #pending then
1801 | reject(nil,
1802 | { name = "AggregateError", message = "All Promises rejected", errors = rejections })
1803 | end
1804 | end
1805 | )
1806 | end
1807 | end
1808 | )
1809 | end
1810 |
1811 | local function __TS__PromiseRace(iterable)
1812 | local pending = {}
1813 | for ____, item in __TS__Iterator(iterable) do
1814 | if __TS__InstanceOf(item, __TS__Promise) then
1815 | if item.state == 1 then
1816 | return __TS__Promise.resolve(item.value)
1817 | elseif item.state == 2 then
1818 | return __TS__Promise.reject(item.rejectionReason)
1819 | else
1820 | pending[#pending + 1] = item
1821 | end
1822 | else
1823 | return __TS__Promise.resolve(item)
1824 | end
1825 | end
1826 | return __TS__New(
1827 | __TS__Promise,
1828 | function(____, resolve, reject)
1829 | for ____, promise in ipairs(pending) do
1830 | promise["then"](
1831 | promise,
1832 | function(____, value) return resolve(nil, value) end,
1833 | function(____, reason) return reject(nil, reason) end
1834 | )
1835 | end
1836 | end
1837 | )
1838 | end
1839 |
1840 | local Set
1841 | do
1842 | Set = __TS__Class()
1843 | Set.name = "Set"
1844 | function Set.prototype.____constructor(self, values)
1845 | self[Symbol.toStringTag] = "Set"
1846 | self.size = 0
1847 | self.nextKey = {}
1848 | self.previousKey = {}
1849 | if values == nil then
1850 | return
1851 | end
1852 | local iterable = values
1853 | if iterable[Symbol.iterator] then
1854 | local iterator = iterable[Symbol.iterator](iterable)
1855 | while true do
1856 | local result = iterator:next()
1857 | if result.done then
1858 | break
1859 | end
1860 | self:add(result.value)
1861 | end
1862 | else
1863 | local array = values
1864 | for ____, value in ipairs(array) do
1865 | self:add(value)
1866 | end
1867 | end
1868 | end
1869 |
1870 | function Set.prototype.add(self, value)
1871 | local isNewValue = not self:has(value)
1872 | if isNewValue then
1873 | self.size = self.size + 1
1874 | end
1875 | if self.firstKey == nil then
1876 | self.firstKey = value
1877 | self.lastKey = value
1878 | elseif isNewValue then
1879 | self.nextKey[self.lastKey] = value
1880 | self.previousKey[value] = self.lastKey
1881 | self.lastKey = value
1882 | end
1883 | return self
1884 | end
1885 |
1886 | function Set.prototype.clear(self)
1887 | self.nextKey = {}
1888 | self.previousKey = {}
1889 | self.firstKey = nil
1890 | self.lastKey = nil
1891 | self.size = 0
1892 | end
1893 |
1894 | function Set.prototype.delete(self, value)
1895 | local contains = self:has(value)
1896 | if contains then
1897 | self.size = self.size - 1
1898 | local next = self.nextKey[value]
1899 | local previous = self.previousKey[value]
1900 | if next and previous then
1901 | self.nextKey[previous] = next
1902 | self.previousKey[next] = previous
1903 | elseif next then
1904 | self.firstKey = next
1905 | self.previousKey[next] = nil
1906 | elseif previous then
1907 | self.lastKey = previous
1908 | self.nextKey[previous] = nil
1909 | else
1910 | self.firstKey = nil
1911 | self.lastKey = nil
1912 | end
1913 | self.nextKey[value] = nil
1914 | self.previousKey[value] = nil
1915 | end
1916 | return contains
1917 | end
1918 |
1919 | function Set.prototype.forEach(self, callback)
1920 | for ____, key in __TS__Iterator(self:keys()) do
1921 | callback(nil, key, key, self)
1922 | end
1923 | end
1924 |
1925 | function Set.prototype.has(self, value)
1926 | return self.nextKey[value] ~= nil or self.lastKey == value
1927 | end
1928 |
1929 | Set.prototype[Symbol.iterator] = function(self)
1930 | return self:values()
1931 | end
1932 | function Set.prototype.entries(self)
1933 | local nextKey = self.nextKey
1934 | local key = self.firstKey
1935 | return {
1936 | [Symbol.iterator] = function(self)
1937 | return self
1938 | end,
1939 | next = function(self)
1940 | local result = { done = not key, value = { key, key } }
1941 | key = nextKey[key]
1942 | return result
1943 | end
1944 | }
1945 | end
1946 |
1947 | function Set.prototype.keys(self)
1948 | local nextKey = self.nextKey
1949 | local key = self.firstKey
1950 | return {
1951 | [Symbol.iterator] = function(self)
1952 | return self
1953 | end,
1954 | next = function(self)
1955 | local result = { done = not key, value = key }
1956 | key = nextKey[key]
1957 | return result
1958 | end
1959 | }
1960 | end
1961 |
1962 | function Set.prototype.values(self)
1963 | local nextKey = self.nextKey
1964 | local key = self.firstKey
1965 | return {
1966 | [Symbol.iterator] = function(self)
1967 | return self
1968 | end,
1969 | next = function(self)
1970 | local result = { done = not key, value = key }
1971 | key = nextKey[key]
1972 | return result
1973 | end
1974 | }
1975 | end
1976 |
1977 | Set[Symbol.species] = Set
1978 | end
1979 |
1980 | local function __TS__SparseArrayNew(...)
1981 | local sparseArray = { ... }
1982 | sparseArray.sparseLength = __TS__CountVarargs(...)
1983 | return sparseArray
1984 | end
1985 |
1986 | local function __TS__SparseArrayPush(sparseArray, ...)
1987 | local args = { ... }
1988 | local argsLen = __TS__CountVarargs(...)
1989 | local listLen = sparseArray.sparseLength
1990 | for i = 1, argsLen do
1991 | sparseArray[listLen + i] = args[i]
1992 | end
1993 | sparseArray.sparseLength = listLen + argsLen
1994 | end
1995 |
1996 | local function __TS__SparseArraySpread(sparseArray)
1997 | local ____unpack_0 = unpack
1998 | if ____unpack_0 == nil then
1999 | ____unpack_0 = table.unpack
2000 | end
2001 | local _unpack = ____unpack_0
2002 | return _unpack(sparseArray, 1, sparseArray.sparseLength)
2003 | end
2004 |
2005 | local WeakMap
2006 | do
2007 | WeakMap = __TS__Class()
2008 | WeakMap.name = "WeakMap"
2009 | function WeakMap.prototype.____constructor(self, entries)
2010 | self[Symbol.toStringTag] = "WeakMap"
2011 | self.items = {}
2012 | setmetatable(self.items, { __mode = "k" })
2013 | if entries == nil then
2014 | return
2015 | end
2016 | local iterable = entries
2017 | if iterable[Symbol.iterator] then
2018 | local iterator = iterable[Symbol.iterator](iterable)
2019 | while true do
2020 | local result = iterator:next()
2021 | if result.done then
2022 | break
2023 | end
2024 | local value = result.value
2025 | self.items[value[1]] = value[2]
2026 | end
2027 | else
2028 | for ____, kvp in ipairs(entries) do
2029 | self.items[kvp[1]] = kvp[2]
2030 | end
2031 | end
2032 | end
2033 |
2034 | function WeakMap.prototype.delete(self, key)
2035 | local contains = self:has(key)
2036 | self.items[key] = nil
2037 | return contains
2038 | end
2039 |
2040 | function WeakMap.prototype.get(self, key)
2041 | return self.items[key]
2042 | end
2043 |
2044 | function WeakMap.prototype.has(self, key)
2045 | return self.items[key] ~= nil
2046 | end
2047 |
2048 | function WeakMap.prototype.set(self, key, value)
2049 | self.items[key] = value
2050 | return self
2051 | end
2052 |
2053 | WeakMap[Symbol.species] = WeakMap
2054 | end
2055 |
2056 | local WeakSet
2057 | do
2058 | WeakSet = __TS__Class()
2059 | WeakSet.name = "WeakSet"
2060 | function WeakSet.prototype.____constructor(self, values)
2061 | self[Symbol.toStringTag] = "WeakSet"
2062 | self.items = {}
2063 | setmetatable(self.items, { __mode = "k" })
2064 | if values == nil then
2065 | return
2066 | end
2067 | local iterable = values
2068 | if iterable[Symbol.iterator] then
2069 | local iterator = iterable[Symbol.iterator](iterable)
2070 | while true do
2071 | local result = iterator:next()
2072 | if result.done then
2073 | break
2074 | end
2075 | self.items[result.value] = true
2076 | end
2077 | else
2078 | for ____, value in ipairs(values) do
2079 | self.items[value] = true
2080 | end
2081 | end
2082 | end
2083 |
2084 | function WeakSet.prototype.add(self, value)
2085 | self.items[value] = true
2086 | return self
2087 | end
2088 |
2089 | function WeakSet.prototype.delete(self, value)
2090 | local contains = self:has(value)
2091 | self.items[value] = nil
2092 | return contains
2093 | end
2094 |
2095 | function WeakSet.prototype.has(self, value)
2096 | return self.items[value] == true
2097 | end
2098 |
2099 | WeakSet[Symbol.species] = WeakSet
2100 | end
2101 |
2102 | local function __TS__SourceMapTraceBack(fileName, sourceMap)
2103 | _G.__TS__sourcemap = _G.__TS__sourcemap or ({})
2104 | _G.__TS__sourcemap[fileName] = sourceMap
2105 | if _G.__TS__originalTraceback == nil then
2106 | local originalTraceback = debug.traceback
2107 | _G.__TS__originalTraceback = originalTraceback
2108 | debug.traceback = function(thread, message, level)
2109 | local trace
2110 | if thread == nil and message == nil and level == nil then
2111 | trace = originalTraceback()
2112 | elseif __TS__StringIncludes(_VERSION, "Lua 5.0") then
2113 | trace = originalTraceback((("[Level " .. tostring(level)) .. "] ") .. message)
2114 | else
2115 | trace = originalTraceback(thread, message, level)
2116 | end
2117 | if type(trace) ~= "string" then
2118 | return trace
2119 | end
2120 | local function replacer(____, file, srcFile, line)
2121 | local fileSourceMap = _G.__TS__sourcemap[file]
2122 | if fileSourceMap and fileSourceMap[line] then
2123 | local data = fileSourceMap[line]
2124 | if type(data) == "number" then
2125 | return (srcFile .. ":") .. tostring(data)
2126 | end
2127 | return (tostring(data.file) .. ":") .. tostring(data.line)
2128 | end
2129 | return (file .. ":") .. line
2130 | end
2131 | local result = string.gsub(
2132 | trace,
2133 | "(%S+)%.lua:(%d+)",
2134 | function(file, line) return replacer(nil, file .. ".lua", file .. ".ts", line) end
2135 | )
2136 | local function stringReplacer(____, file, line)
2137 | local fileSourceMap = _G.__TS__sourcemap[file]
2138 | if fileSourceMap and fileSourceMap[line] then
2139 | local chunkName = __TS__Match(file, "%[string \"([^\"]+)\"%]")
2140 | local sourceName = string.gsub(chunkName, ".lua$", ".ts")
2141 | local data = fileSourceMap[line]
2142 | if type(data) == "number" then
2143 | return (sourceName .. ":") .. tostring(data)
2144 | end
2145 | return (tostring(data.file) .. ":") .. tostring(data.line)
2146 | end
2147 | return (file .. ":") .. line
2148 | end
2149 | result = string.gsub(
2150 | result,
2151 | "(%[string \"[^\"]+\"%]):(%d+)",
2152 | function(file, line) return stringReplacer(nil, file, line) end
2153 | )
2154 | return result
2155 | end
2156 | end
2157 | end
2158 |
2159 | local function __TS__Spread(iterable)
2160 | local arr = {}
2161 | if type(iterable) == "string" then
2162 | for i = 0, #iterable - 1 do
2163 | arr[i + 1] = __TS__StringAccess(iterable, i)
2164 | end
2165 | else
2166 | local len = 0
2167 | for ____, item in __TS__Iterator(iterable) do
2168 | len = len + 1
2169 | arr[len] = item
2170 | end
2171 | end
2172 | return __TS__Unpack(arr)
2173 | end
2174 |
2175 | local function __TS__StringCharAt(self, pos)
2176 | if pos ~= pos then
2177 | pos = 0
2178 | end
2179 | if pos < 0 then
2180 | return ""
2181 | end
2182 | return string.sub(self, pos + 1, pos + 1)
2183 | end
2184 |
2185 | local function __TS__StringCharCodeAt(self, index)
2186 | if index ~= index then
2187 | index = 0
2188 | end
2189 | if index < 0 then
2190 | return 0 / 0
2191 | end
2192 | local ____string_byte_result_0 = string.byte(self, index + 1)
2193 | if ____string_byte_result_0 == nil then
2194 | ____string_byte_result_0 = 0 / 0
2195 | end
2196 | return ____string_byte_result_0
2197 | end
2198 |
2199 | local function __TS__StringEndsWith(self, searchString, endPosition)
2200 | if endPosition == nil or endPosition > #self then
2201 | endPosition = #self
2202 | end
2203 | return string.sub(self, endPosition - #searchString + 1, endPosition) == searchString
2204 | end
2205 |
2206 | local function __TS__StringPadEnd(self, maxLength, fillString)
2207 | if fillString == nil then
2208 | fillString = " "
2209 | end
2210 | if maxLength ~= maxLength then
2211 | maxLength = 0
2212 | end
2213 | if maxLength == -math.huge or maxLength == math.huge then
2214 | error("Invalid string length", 0)
2215 | end
2216 | if #self >= maxLength or #fillString == 0 then
2217 | return self
2218 | end
2219 | maxLength = maxLength - #self
2220 | if maxLength > #fillString then
2221 | fillString = fillString .. string.rep(
2222 | fillString,
2223 | math.floor(maxLength / #fillString)
2224 | )
2225 | end
2226 | return self .. string.sub(
2227 | fillString,
2228 | 1,
2229 | math.floor(maxLength)
2230 | )
2231 | end
2232 |
2233 | local function __TS__StringPadStart(self, maxLength, fillString)
2234 | if fillString == nil then
2235 | fillString = " "
2236 | end
2237 | if maxLength ~= maxLength then
2238 | maxLength = 0
2239 | end
2240 | if maxLength == -math.huge or maxLength == math.huge then
2241 | error("Invalid string length", 0)
2242 | end
2243 | if #self >= maxLength or #fillString == 0 then
2244 | return self
2245 | end
2246 | maxLength = maxLength - #self
2247 | if maxLength > #fillString then
2248 | fillString = fillString .. string.rep(
2249 | fillString,
2250 | math.floor(maxLength / #fillString)
2251 | )
2252 | end
2253 | return string.sub(
2254 | fillString,
2255 | 1,
2256 | math.floor(maxLength)
2257 | ) .. self
2258 | end
2259 |
2260 | local __TS__StringReplace
2261 | do
2262 | local sub = string.sub
2263 | function __TS__StringReplace(source, searchValue, replaceValue)
2264 | local startPos, endPos = string.find(source, searchValue, nil, true)
2265 | if not startPos then
2266 | return source
2267 | end
2268 | local before = sub(source, 1, startPos - 1)
2269 | local ____temp_0
2270 | if type(replaceValue) == "string" then
2271 | ____temp_0 = replaceValue
2272 | else
2273 | ____temp_0 = replaceValue(nil, searchValue, startPos - 1, source)
2274 | end
2275 | local replacement = ____temp_0
2276 | local after = sub(source, endPos + 1)
2277 | return (before .. replacement) .. after
2278 | end
2279 | end
2280 |
2281 | local __TS__StringSplit
2282 | do
2283 | local sub = string.sub
2284 | local find = string.find
2285 | function __TS__StringSplit(source, separator, limit)
2286 | if limit == nil then
2287 | limit = 4294967295
2288 | end
2289 | if limit == 0 then
2290 | return {}
2291 | end
2292 | local result = {}
2293 | local resultIndex = 1
2294 | if separator == nil or separator == "" then
2295 | for i = 1, #source do
2296 | result[resultIndex] = sub(source, i, i)
2297 | resultIndex = resultIndex + 1
2298 | end
2299 | else
2300 | local currentPos = 1
2301 | while resultIndex <= limit do
2302 | local startPos, endPos = find(source, separator, currentPos, true)
2303 | if not startPos then
2304 | break
2305 | end
2306 | result[resultIndex] = sub(source, currentPos, startPos - 1)
2307 | resultIndex = resultIndex + 1
2308 | currentPos = endPos + 1
2309 | end
2310 | if resultIndex <= limit then
2311 | result[resultIndex] = sub(source, currentPos)
2312 | end
2313 | end
2314 | return result
2315 | end
2316 | end
2317 |
2318 | local __TS__StringReplaceAll
2319 | do
2320 | local sub = string.sub
2321 | local find = string.find
2322 | function __TS__StringReplaceAll(source, searchValue, replaceValue)
2323 | if type(replaceValue) == "string" then
2324 | local concat = table.concat(
2325 | __TS__StringSplit(source, searchValue),
2326 | replaceValue
2327 | )
2328 | if #searchValue == 0 then
2329 | return (replaceValue .. concat) .. replaceValue
2330 | end
2331 | return concat
2332 | end
2333 | local parts = {}
2334 | local partsIndex = 1
2335 | if #searchValue == 0 then
2336 | parts[1] = replaceValue(nil, "", 0, source)
2337 | partsIndex = 2
2338 | for i = 1, #source do
2339 | parts[partsIndex] = sub(source, i, i)
2340 | parts[partsIndex + 1] = replaceValue(nil, "", i, source)
2341 | partsIndex = partsIndex + 2
2342 | end
2343 | else
2344 | local currentPos = 1
2345 | while true do
2346 | local startPos, endPos = find(source, searchValue, currentPos, true)
2347 | if not startPos then
2348 | break
2349 | end
2350 | parts[partsIndex] = sub(source, currentPos, startPos - 1)
2351 | parts[partsIndex + 1] = replaceValue(nil, searchValue, startPos - 1, source)
2352 | partsIndex = partsIndex + 2
2353 | currentPos = endPos + 1
2354 | end
2355 | parts[partsIndex] = sub(source, currentPos)
2356 | end
2357 | return table.concat(parts)
2358 | end
2359 | end
2360 |
2361 | local function __TS__StringSlice(self, start, ____end)
2362 | if start == nil or start ~= start then
2363 | start = 0
2364 | end
2365 | if ____end ~= ____end then
2366 | ____end = 0
2367 | end
2368 | if start >= 0 then
2369 | start = start + 1
2370 | end
2371 | if ____end ~= nil and ____end < 0 then
2372 | ____end = ____end - 1
2373 | end
2374 | return string.sub(self, start, ____end)
2375 | end
2376 |
2377 | local function __TS__StringStartsWith(self, searchString, position)
2378 | if position == nil or position < 0 then
2379 | position = 0
2380 | end
2381 | return string.sub(self, position + 1, #searchString + position) == searchString
2382 | end
2383 |
2384 | local function __TS__StringSubstr(self, from, length)
2385 | if from ~= from then
2386 | from = 0
2387 | end
2388 | if length ~= nil then
2389 | if length ~= length or length <= 0 then
2390 | return ""
2391 | end
2392 | length = length + from
2393 | end
2394 | if from >= 0 then
2395 | from = from + 1
2396 | end
2397 | return string.sub(self, from, length)
2398 | end
2399 |
2400 | local function __TS__StringTrim(self)
2401 | local result = string.gsub(self, "^[%s ]*(.-)[%s ]*$", "%1")
2402 | return result
2403 | end
2404 |
2405 | local function __TS__StringTrimEnd(self)
2406 | local result = string.gsub(self, "[%s ]*$", "")
2407 | return result
2408 | end
2409 |
2410 | local function __TS__StringTrimStart(self)
2411 | local result = string.gsub(self, "^[%s ]*", "")
2412 | return result
2413 | end
2414 |
2415 | local __TS__SymbolRegistryFor, __TS__SymbolRegistryKeyFor
2416 | do
2417 | local symbolRegistry = {}
2418 | function __TS__SymbolRegistryFor(key)
2419 | if not symbolRegistry[key] then
2420 | symbolRegistry[key] = __TS__Symbol(key)
2421 | end
2422 | return symbolRegistry[key]
2423 | end
2424 |
2425 | function __TS__SymbolRegistryKeyFor(sym)
2426 | for key in pairs(symbolRegistry) do
2427 | if symbolRegistry[key] == sym then
2428 | return key
2429 | end
2430 | end
2431 | end
2432 | end
2433 |
2434 | local function __TS__TypeOf(value)
2435 | local luaType = type(value)
2436 | if luaType == "table" then
2437 | return "object"
2438 | elseif luaType == "nil" then
2439 | return "undefined"
2440 | else
2441 | return luaType
2442 | end
2443 | end
2444 |
2445 | local function __TS__ClassExtends(target, base)
2446 | target.____super = base;
2447 |
2448 | local staticMetatable = setmetatable({ __index = base }, base);
2449 | setmetatable(target, staticMetatable);
2450 |
2451 | local baseMetatable = getmetatable(base);
2452 | if baseMetatable then
2453 | if type(baseMetatable.__index) == "function" then
2454 | staticMetatable.__index = baseMetatable.__index;
2455 | end
2456 | if type(baseMetatable.__newindex) == "function" then
2457 | staticMetatable.__newindex = baseMetatable.__newindex;
2458 | end
2459 | end
2460 |
2461 | -- PZ fix
2462 | if base.prototype == nil then
2463 | base.prototype = base;
2464 | end
2465 |
2466 | setmetatable(target.prototype, base.prototype);
2467 |
2468 | if type(base.prototype.__index) == "function" then
2469 | target.prototype.__index = base.prototype.__index;
2470 | end
2471 |
2472 | if type(base.prototype.__newindex) == "function" then
2473 | target.prototype.__newindex = base.prototype.__newindex;
2474 | end
2475 |
2476 | if type(base.prototype.__tostring) == "function" then
2477 | target.prototype.__tostring = base.prototype.__tostring;
2478 | end
2479 | end
2480 |
2481 | return {
2482 | __TS__ArrayConcat = __TS__ArrayConcat,
2483 | __TS__ArrayEntries = __TS__ArrayEntries,
2484 | __TS__ArrayEvery = __TS__ArrayEvery,
2485 | __TS__ArrayFilter = __TS__ArrayFilter,
2486 | __TS__ArrayForEach = __TS__ArrayForEach,
2487 | __TS__ArrayFind = __TS__ArrayFind,
2488 | __TS__ArrayFindIndex = __TS__ArrayFindIndex,
2489 | __TS__ArrayFrom = __TS__ArrayFrom,
2490 | __TS__ArrayIncludes = __TS__ArrayIncludes,
2491 | __TS__ArrayIndexOf = __TS__ArrayIndexOf,
2492 | __TS__ArrayIsArray = __TS__ArrayIsArray,
2493 | __TS__ArrayJoin = __TS__ArrayJoin,
2494 | __TS__ArrayMap = __TS__ArrayMap,
2495 | __TS__ArrayPush = __TS__ArrayPush,
2496 | __TS__ArrayPushArray = __TS__ArrayPushArray,
2497 | __TS__ArrayReduce = __TS__ArrayReduce,
2498 | __TS__ArrayReduceRight = __TS__ArrayReduceRight,
2499 | __TS__ArrayReverse = __TS__ArrayReverse,
2500 | __TS__ArrayUnshift = __TS__ArrayUnshift,
2501 | __TS__ArraySort = __TS__ArraySort,
2502 | __TS__ArraySlice = __TS__ArraySlice,
2503 | __TS__ArraySome = __TS__ArraySome,
2504 | __TS__ArraySplice = __TS__ArraySplice,
2505 | __TS__ArrayToObject = __TS__ArrayToObject,
2506 | __TS__ArrayFlat = __TS__ArrayFlat,
2507 | __TS__ArrayFlatMap = __TS__ArrayFlatMap,
2508 | __TS__ArraySetLength = __TS__ArraySetLength,
2509 | __TS__AsyncAwaiter = __TS__AsyncAwaiter,
2510 | __TS__Await = __TS__Await,
2511 | __TS__Class = __TS__Class,
2512 | __TS__ClassExtends = __TS__ClassExtends,
2513 | __TS__CloneDescriptor = __TS__CloneDescriptor,
2514 | __TS__CountVarargs = __TS__CountVarargs,
2515 | __TS__Decorate = __TS__Decorate,
2516 | __TS__DecorateParam = __TS__DecorateParam,
2517 | __TS__Delete = __TS__Delete,
2518 | __TS__DelegatedYield = __TS__DelegatedYield,
2519 | Error = Error,
2520 | RangeError = RangeError,
2521 | ReferenceError = ReferenceError,
2522 | SyntaxError = SyntaxError,
2523 | TypeError = TypeError,
2524 | URIError = URIError,
2525 | __TS__FunctionBind = __TS__FunctionBind,
2526 | __TS__Generator = __TS__Generator,
2527 | __TS__InstanceOf = __TS__InstanceOf,
2528 | __TS__InstanceOfObject = __TS__InstanceOfObject,
2529 | __TS__Iterator = __TS__Iterator,
2530 | __TS__LuaIteratorSpread = __TS__LuaIteratorSpread,
2531 | Map = Map,
2532 | __TS__Match = __TS__Match,
2533 | __TS__MathAtan2 = __TS__MathAtan2,
2534 | __TS__MathModf = __TS__MathModf,
2535 | __TS__MathSign = __TS__MathSign,
2536 | __TS__New = __TS__New,
2537 | __TS__Number = __TS__Number,
2538 | __TS__NumberIsFinite = __TS__NumberIsFinite,
2539 | __TS__NumberIsNaN = __TS__NumberIsNaN,
2540 | __TS__NumberToString = __TS__NumberToString,
2541 | __TS__ObjectAssign = __TS__ObjectAssign,
2542 | __TS__ObjectDefineProperty = __TS__ObjectDefineProperty,
2543 | __TS__ObjectEntries = __TS__ObjectEntries,
2544 | __TS__ObjectFromEntries = __TS__ObjectFromEntries,
2545 | __TS__ObjectGetOwnPropertyDescriptor = __TS__ObjectGetOwnPropertyDescriptor,
2546 | __TS__ObjectGetOwnPropertyDescriptors = __TS__ObjectGetOwnPropertyDescriptors,
2547 | __TS__ObjectKeys = __TS__ObjectKeys,
2548 | __TS__ObjectRest = __TS__ObjectRest,
2549 | __TS__ObjectValues = __TS__ObjectValues,
2550 | __TS__ParseFloat = __TS__ParseFloat,
2551 | __TS__ParseInt = __TS__ParseInt,
2552 | __TS__Promise = __TS__Promise,
2553 | __TS__PromiseAll = __TS__PromiseAll,
2554 | __TS__PromiseAllSettled = __TS__PromiseAllSettled,
2555 | __TS__PromiseAny = __TS__PromiseAny,
2556 | __TS__PromiseRace = __TS__PromiseRace,
2557 | Set = Set,
2558 | __TS__SetDescriptor = __TS__SetDescriptor,
2559 | __TS__SparseArrayNew = __TS__SparseArrayNew,
2560 | __TS__SparseArrayPush = __TS__SparseArrayPush,
2561 | __TS__SparseArraySpread = __TS__SparseArraySpread,
2562 | WeakMap = WeakMap,
2563 | WeakSet = WeakSet,
2564 | __TS__SourceMapTraceBack = __TS__SourceMapTraceBack,
2565 | __TS__Spread = __TS__Spread,
2566 | __TS__StringAccess = __TS__StringAccess,
2567 | __TS__StringCharAt = __TS__StringCharAt,
2568 | __TS__StringCharCodeAt = __TS__StringCharCodeAt,
2569 | __TS__StringEndsWith = __TS__StringEndsWith,
2570 | __TS__StringIncludes = __TS__StringIncludes,
2571 | __TS__StringPadEnd = __TS__StringPadEnd,
2572 | __TS__StringPadStart = __TS__StringPadStart,
2573 | __TS__StringReplace = __TS__StringReplace,
2574 | __TS__StringReplaceAll = __TS__StringReplaceAll,
2575 | __TS__StringSlice = __TS__StringSlice,
2576 | __TS__StringSplit = __TS__StringSplit,
2577 | __TS__StringStartsWith = __TS__StringStartsWith,
2578 | __TS__StringSubstr = __TS__StringSubstr,
2579 | __TS__StringSubstring = __TS__StringSubstring,
2580 | __TS__StringTrim = __TS__StringTrim,
2581 | __TS__StringTrimEnd = __TS__StringTrimEnd,
2582 | __TS__StringTrimStart = __TS__StringTrimStart,
2583 | __TS__Symbol = __TS__Symbol,
2584 | Symbol = Symbol,
2585 | __TS__SymbolRegistryFor = __TS__SymbolRegistryFor,
2586 | __TS__SymbolRegistryKeyFor = __TS__SymbolRegistryKeyFor,
2587 | __TS__TypeOf = __TS__TypeOf,
2588 | __TS__Unpack = __TS__Unpack
2589 | }
2590 |
--------------------------------------------------------------------------------