├── .gitignore ├── LICENSE ├── README.md ├── docs └── aefunctions.json ├── package-lock.json ├── package.json ├── prettier.config.js ├── rollup.config.js ├── src └── index.ts └── tsconfig.json /.gitignore: -------------------------------------------------------------------------------- 1 | # compiled output 2 | dist/ 3 | tmp/ 4 | out-tsc/ 5 | 6 | # Logs 7 | logs 8 | *.log 9 | npm-debug.log* 10 | yarn-debug.log* 11 | yarn-error.log* 12 | lerna-debug.log* 13 | 14 | # Diagnostic reports (https://nodejs.org/api/report.html) 15 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 16 | 17 | # Runtime data 18 | pids 19 | *.pid 20 | *.seed 21 | *.pid.lock 22 | 23 | # Directory for instrumented libs generated by jscoverage/JSCover 24 | lib-cov 25 | 26 | # Coverage directory used by tools like istanbul 27 | coverage 28 | *.lcov 29 | 30 | # nyc test coverage 31 | .nyc_output 32 | 33 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 34 | .grunt 35 | 36 | # Bower dependency directory (https://bower.io/) 37 | bower_components 38 | 39 | # node-waf configuration 40 | .lock-wscript 41 | 42 | # Compiled binary addons (https://nodejs.org/api/addons.html) 43 | build/Release 44 | 45 | # Dependency directories 46 | node_modules/ 47 | jspm_packages/ 48 | 49 | # TypeScript v1 declaration files 50 | typings/ 51 | 52 | # TypeScript cache 53 | *.tsbuildinfo 54 | 55 | # Optional npm cache directory 56 | .npm 57 | 58 | # Optional eslint cache 59 | .eslintcache 60 | 61 | # Microbundle cache 62 | .rpt2_cache/ 63 | .rts2_cache_cjs/ 64 | .rts2_cache_es/ 65 | .rts2_cache_umd/ 66 | 67 | # Optional REPL history 68 | .node_repl_history 69 | 70 | # Output of 'npm pack' 71 | *.tgz 72 | 73 | # Yarn Integrity file 74 | .yarn-integrity 75 | 76 | # dotenv environment variables file 77 | .env 78 | .env.test 79 | 80 | # parcel-bundler cache (https://parceljs.org/) 81 | .cache 82 | 83 | # Next.js build output 84 | .next 85 | 86 | # Nuxt.js build / generate output 87 | .nuxt 88 | 89 | # Gatsby files 90 | .cache/ 91 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 92 | # https://nextjs.org/blog/next-9-1#public-directory-support 93 | # public 94 | 95 | # vuepress build output 96 | .vuepress/dist 97 | 98 | # Serverless directories 99 | .serverless/ 100 | 101 | # FuseBox cache 102 | .fusebox/ 103 | 104 | # DynamoDB Local files 105 | .dynamodb/ 106 | 107 | # TernJS port file 108 | .tern-port 109 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Tim Haywood 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. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 🛠 aeFunctions 2 | 3 | **A library of our most used expressions** 4 | 5 | --- 6 | 7 | ✨ View more details on our website: **[motiondeveloper.com/tools/aefunctions](https://www.motiondeveloper.com/tools/aefunctions)** 8 | 9 | --- 10 | 11 | - Functions for commonly used expressions 12 | - Share code across projects and properties 13 | 14 | --- 15 | 16 | 🏗 This project was created with [create-expression-lib](https://github.com/motiondeveloper/create-expression-lib) - our utility for creating and managing After Effects `.jsx` libraries. 17 | 18 | --- 19 | 20 | ## Setup 21 | 22 | 1. Download the latest version from the [releases](https://github.com/motiondeveloper/aefunctions/releases) page. 23 | 2. Import it into After Effects 24 | 25 | ## Expression 26 | 27 | Usage: 28 | 29 | ```js 30 | const { functionName } = footage('aeFunctions.jsx').sourceData.getFunctions(); 31 | functionName(params); 32 | ``` 33 | 34 | ## Development 35 | 36 | 1. **Clone project locally** 37 | 38 | ```sh 39 | git clone https://github.com/motiondeveloper/aeFunctions.git 40 | cd aeFunctions 41 | ``` 42 | 43 | 2. **Start Rollup** 44 | 45 | Start Rollup in watch mode to automatically refresh your code as you make changes, by running: 46 | 47 | ```sh 48 | npm run watch 49 | ``` 50 | 51 | _You can run also run a once off build:_ `npm run build` 52 | 53 | 3. **Edit the `src` files** 54 | 55 | _The `index.ts` contains an example expression setup._ 56 | 57 | Any values exported from this file will be included in your library, for example: 58 | 59 | ```js 60 | export { someValue }; 61 | ``` 62 | 63 | 4. **Import the `dist` file into After Effects** 64 | 65 | Use the compiled output file as you would any other `.jsx` library. Any changes to the `src` files will be live updated, and After Effects will update the result of your expression. 66 | -------------------------------------------------------------------------------- /docs/aefunctions.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": 0, 3 | "name": "aefunctions", 4 | "kind": 0, 5 | "kindString": "Project", 6 | "flags": {}, 7 | "originalName": "", 8 | "children": [ 9 | { 10 | "id": 130, 11 | "name": "version", 12 | "kind": 32, 13 | "kindString": "Variable", 14 | "flags": { 15 | "isConst": true 16 | }, 17 | "sources": [ 18 | { 19 | "fileName": "index.ts", 20 | "line": 675, 21 | "character": 13 22 | } 23 | ], 24 | "type": { 25 | "type": "intrinsic", 26 | "name": "string" 27 | }, 28 | "defaultValue": "'_npmVersion'" 29 | }, 30 | { 31 | "id": 1, 32 | "name": "getFunctions", 33 | "kind": 64, 34 | "kindString": "Function", 35 | "flags": {}, 36 | "sources": [ 37 | { 38 | "fileName": "index.ts", 39 | "line": 17, 40 | "character": 21 41 | } 42 | ], 43 | "signatures": [ 44 | { 45 | "id": 2, 46 | "name": "getFunctions", 47 | "kind": 4096, 48 | "kindString": "Call signature", 49 | "flags": {}, 50 | "parameters": [ 51 | { 52 | "id": 3, 53 | "name": "time", 54 | "kind": 32768, 55 | "kindString": "Parameter", 56 | "flags": {}, 57 | "type": { 58 | "type": "intrinsic", 59 | "name": "number" 60 | }, 61 | "defaultValue": "..." 62 | } 63 | ], 64 | "type": { 65 | "type": "reflection", 66 | "declaration": { 67 | "id": 4, 68 | "name": "__type", 69 | "kind": 65536, 70 | "kindString": "Type literal", 71 | "flags": {}, 72 | "children": [ 73 | { 74 | "id": 125, 75 | "name": "addLineBreaks", 76 | "kind": 1024, 77 | "kindString": "Property", 78 | "flags": {}, 79 | "type": { 80 | "type": "reflection", 81 | "declaration": { 82 | "id": 126, 83 | "name": "__type", 84 | "kind": 65536, 85 | "kindString": "Type literal", 86 | "flags": {}, 87 | "signatures": [ 88 | { 89 | "id": 127, 90 | "name": "__type", 91 | "kind": 4096, 92 | "kindString": "Call signature", 93 | "flags": {}, 94 | "comment": { 95 | "returns": "A new string with line breaks inserted, so each line is within `maxCharacters` length\n" 96 | }, 97 | "parameters": [ 98 | { 99 | "id": 128, 100 | "name": "string", 101 | "kind": 32768, 102 | "kindString": "Parameter", 103 | "flags": {}, 104 | "comment": { 105 | "text": "The input string to add line breaks to" 106 | }, 107 | "type": { 108 | "type": "intrinsic", 109 | "name": "string" 110 | } 111 | }, 112 | { 113 | "id": 129, 114 | "name": "maxCharacters", 115 | "kind": 32768, 116 | "kindString": "Parameter", 117 | "flags": {}, 118 | "comment": { 119 | "text": "The maximum number of characters per line" 120 | }, 121 | "type": { 122 | "type": "intrinsic", 123 | "name": "number" 124 | } 125 | } 126 | ], 127 | "type": { 128 | "type": "intrinsic", 129 | "name": "string" 130 | } 131 | } 132 | ] 133 | } 134 | } 135 | }, 136 | { 137 | "id": 5, 138 | "name": "attachKeys", 139 | "kind": 1024, 140 | "kindString": "Property", 141 | "flags": {}, 142 | "type": { 143 | "type": "reflection", 144 | "declaration": { 145 | "id": 6, 146 | "name": "__type", 147 | "kind": 65536, 148 | "kindString": "Type literal", 149 | "flags": {}, 150 | "signatures": [ 151 | { 152 | "id": 7, 153 | "name": "__type", 154 | "kind": 4096, 155 | "kindString": "Call signature", 156 | "flags": {}, 157 | "comment": { 158 | "returns": "A retimed version of the animation where the in and out animation move with the layer start and end times\n" 159 | }, 160 | "parameters": [ 161 | { 162 | "id": 8, 163 | "name": "inKeys", 164 | "kind": 32768, 165 | "kindString": "Parameter", 166 | "flags": {}, 167 | "comment": { 168 | "text": "The number of keyframes to attach to the `inPoint`" 169 | }, 170 | "type": { 171 | "type": "intrinsic", 172 | "name": "number" 173 | }, 174 | "defaultValue": "2" 175 | }, 176 | { 177 | "id": 9, 178 | "name": "outKeys", 179 | "kind": 32768, 180 | "kindString": "Parameter", 181 | "flags": {}, 182 | "comment": { 183 | "text": "The number of keyframes to attach to the `outPoint`" 184 | }, 185 | "type": { 186 | "type": "intrinsic", 187 | "name": "number" 188 | }, 189 | "defaultValue": "2" 190 | } 191 | ], 192 | "type": { 193 | "type": "reference", 194 | "name": "PathValue" 195 | } 196 | } 197 | ] 198 | } 199 | } 200 | }, 201 | { 202 | "id": 10, 203 | "name": "bounceKeys", 204 | "kind": 1024, 205 | "kindString": "Property", 206 | "flags": {}, 207 | "type": { 208 | "type": "reflection", 209 | "declaration": { 210 | "id": 11, 211 | "name": "__type", 212 | "kind": 65536, 213 | "kindString": "Type literal", 214 | "flags": {}, 215 | "signatures": [ 216 | { 217 | "id": 12, 218 | "name": "__type", 219 | "kind": 4096, 220 | "kindString": "Call signature", 221 | "flags": {}, 222 | "comment": { 223 | "returns": "The property value with bounce animation between the given keyframes\n" 224 | }, 225 | "parameters": [ 226 | { 227 | "id": 13, 228 | "name": "amp", 229 | "kind": 32768, 230 | "kindString": "Parameter", 231 | "flags": {}, 232 | "comment": { 233 | "text": "The amount of swing past each value" 234 | }, 235 | "type": { 236 | "type": "intrinsic", 237 | "name": "number" 238 | }, 239 | "defaultValue": "0.12" 240 | }, 241 | { 242 | "id": 14, 243 | "name": "freq", 244 | "kind": 32768, 245 | "kindString": "Parameter", 246 | "flags": {}, 247 | "comment": { 248 | "text": "How fast the swing oscillates" 249 | }, 250 | "type": { 251 | "type": "intrinsic", 252 | "name": "number" 253 | }, 254 | "defaultValue": "2.5" 255 | }, 256 | { 257 | "id": 15, 258 | "name": "decay", 259 | "kind": 32768, 260 | "kindString": "Parameter", 261 | "flags": {}, 262 | "comment": { 263 | "text": "Hoq quickly the swings reduce in value over time" 264 | }, 265 | "type": { 266 | "type": "intrinsic", 267 | "name": "number" 268 | }, 269 | "defaultValue": "8" 270 | }, 271 | { 272 | "id": 16, 273 | "name": "keyMin", 274 | "kind": 32768, 275 | "kindString": "Parameter", 276 | "flags": {}, 277 | "comment": { 278 | "text": "Keyframes after this index will bounce" 279 | }, 280 | "type": { 281 | "type": "intrinsic", 282 | "name": "number" 283 | }, 284 | "defaultValue": "1" 285 | }, 286 | { 287 | "id": 17, 288 | "name": "keyMax", 289 | "kind": 32768, 290 | "kindString": "Parameter", 291 | "flags": {}, 292 | "comment": { 293 | "text": "Keyframe before this index will bounce" 294 | }, 295 | "type": { 296 | "type": "intrinsic", 297 | "name": "number" 298 | }, 299 | "defaultValue": "..." 300 | } 301 | ], 302 | "type": { 303 | "type": "reference", 304 | "name": "PathValue" 305 | } 306 | } 307 | ] 308 | } 309 | } 310 | }, 311 | { 312 | "id": 108, 313 | "name": "breakWithoutOrphans", 314 | "kind": 1024, 315 | "kindString": "Property", 316 | "flags": {}, 317 | "type": { 318 | "type": "reflection", 319 | "declaration": { 320 | "id": 109, 321 | "name": "__type", 322 | "kind": 65536, 323 | "kindString": "Type literal", 324 | "flags": {}, 325 | "signatures": [ 326 | { 327 | "id": 110, 328 | "name": "__type", 329 | "kind": 4096, 330 | "kindString": "Call signature", 331 | "flags": {}, 332 | "comment": { 333 | "returns": "The given string with line breaks inserted, where each line has less than `maxCharacters`. If a line has less than the `minWords`, line breaks are inserted more often to avoid short lines.\n" 334 | }, 335 | "parameters": [ 336 | { 337 | "id": 111, 338 | "name": "string", 339 | "kind": 32768, 340 | "kindString": "Parameter", 341 | "flags": {}, 342 | "comment": { 343 | "text": "The input string to add line breaks to" 344 | }, 345 | "type": { 346 | "type": "intrinsic", 347 | "name": "string" 348 | } 349 | }, 350 | { 351 | "id": 112, 352 | "name": "maxCharacters", 353 | "kind": 32768, 354 | "kindString": "Parameter", 355 | "flags": {}, 356 | "comment": { 357 | "text": "The maximum characters in each line" 358 | }, 359 | "type": { 360 | "type": "intrinsic", 361 | "name": "number" 362 | } 363 | }, 364 | { 365 | "id": 113, 366 | "name": "minWords", 367 | "kind": 32768, 368 | "kindString": "Parameter", 369 | "flags": {}, 370 | "comment": { 371 | "text": "The minimum number of words in a line" 372 | }, 373 | "type": { 374 | "type": "intrinsic", 375 | "name": "number" 376 | } 377 | }, 378 | { 379 | "id": 114, 380 | "name": "options", 381 | "kind": 32768, 382 | "kindString": "Parameter", 383 | "flags": {}, 384 | "type": { 385 | "type": "reference", 386 | "name": "textBreakOption" 387 | }, 388 | "defaultValue": "..." 389 | } 390 | ], 391 | "type": { 392 | "type": "intrinsic", 393 | "name": "string" 394 | } 395 | } 396 | ] 397 | } 398 | } 399 | }, 400 | { 401 | "id": 82, 402 | "name": "circularMotion", 403 | "kind": 1024, 404 | "kindString": "Property", 405 | "flags": {}, 406 | "type": { 407 | "type": "reflection", 408 | "declaration": { 409 | "id": 83, 410 | "name": "__type", 411 | "kind": 65536, 412 | "kindString": "Type literal", 413 | "flags": {}, 414 | "signatures": [ 415 | { 416 | "id": 84, 417 | "name": "__type", 418 | "kind": 4096, 419 | "kindString": "Call signature", 420 | "flags": {}, 421 | "comment": { 422 | "returns": "A position value that animates along the circumference of a circle\n" 423 | }, 424 | "parameters": [ 425 | { 426 | "id": 85, 427 | "name": "radius", 428 | "kind": 32768, 429 | "kindString": "Parameter", 430 | "flags": {}, 431 | "comment": { 432 | "text": "The radius of the circle" 433 | }, 434 | "type": { 435 | "type": "intrinsic", 436 | "name": "number" 437 | }, 438 | "defaultValue": "200" 439 | }, 440 | { 441 | "id": 86, 442 | "name": "revolutionTime", 443 | "kind": 32768, 444 | "kindString": "Parameter", 445 | "flags": {}, 446 | "comment": { 447 | "text": "How long it takes to complete 1 revolution" 448 | }, 449 | "type": { 450 | "type": "intrinsic", 451 | "name": "number" 452 | }, 453 | "defaultValue": "1" 454 | }, 455 | { 456 | "id": 87, 457 | "name": "startAngle", 458 | "kind": 32768, 459 | "kindString": "Parameter", 460 | "flags": {}, 461 | "comment": { 462 | "text": "The angle to start from" 463 | }, 464 | "type": { 465 | "type": "intrinsic", 466 | "name": "number" 467 | }, 468 | "defaultValue": "-90" 469 | } 470 | ], 471 | "type": { 472 | "type": "array", 473 | "elementType": { 474 | "type": "intrinsic", 475 | "name": "number" 476 | } 477 | } 478 | } 479 | ] 480 | } 481 | } 482 | }, 483 | { 484 | "id": 88, 485 | "name": "circularPosition", 486 | "kind": 1024, 487 | "kindString": "Property", 488 | "flags": {}, 489 | "type": { 490 | "type": "reflection", 491 | "declaration": { 492 | "id": 89, 493 | "name": "__type", 494 | "kind": 65536, 495 | "kindString": "Type literal", 496 | "flags": {}, 497 | "signatures": [ 498 | { 499 | "id": 90, 500 | "name": "__type", 501 | "kind": 4096, 502 | "kindString": "Call signature", 503 | "flags": {}, 504 | "comment": { 505 | "returns": "A point along the circumference of a circle\n" 506 | }, 507 | "parameters": [ 508 | { 509 | "id": 91, 510 | "name": "radius", 511 | "kind": 32768, 512 | "kindString": "Parameter", 513 | "flags": {}, 514 | "comment": { 515 | "text": "The radius of the circle" 516 | }, 517 | "type": { 518 | "type": "intrinsic", 519 | "name": "number" 520 | } 521 | }, 522 | { 523 | "id": 92, 524 | "name": "angle", 525 | "kind": 32768, 526 | "kindString": "Parameter", 527 | "flags": {}, 528 | "comment": { 529 | "text": "The angle to get the position at, in degrees" 530 | }, 531 | "type": { 532 | "type": "intrinsic", 533 | "name": "number" 534 | } 535 | } 536 | ], 537 | "type": { 538 | "type": "array", 539 | "elementType": { 540 | "type": "intrinsic", 541 | "name": "number" 542 | } 543 | } 544 | } 545 | ] 546 | } 547 | } 548 | }, 549 | { 550 | "id": 65, 551 | "name": "cleanLines", 552 | "kind": 1024, 553 | "kindString": "Property", 554 | "flags": {}, 555 | "type": { 556 | "type": "reflection", 557 | "declaration": { 558 | "id": 66, 559 | "name": "__type", 560 | "kind": 65536, 561 | "kindString": "Type literal", 562 | "flags": {}, 563 | "signatures": [ 564 | { 565 | "id": 67, 566 | "name": "__type", 567 | "kind": 4096, 568 | "kindString": "Call signature", 569 | "flags": {}, 570 | "comment": { 571 | "returns": "The given string trimmed according to the `maxLines` and `maxCharacters`\n" 572 | }, 573 | "parameters": [ 574 | { 575 | "id": 68, 576 | "name": "string", 577 | "kind": 32768, 578 | "kindString": "Parameter", 579 | "flags": {}, 580 | "comment": { 581 | "text": "The string to limit" 582 | }, 583 | "type": { 584 | "type": "intrinsic", 585 | "name": "string" 586 | } 587 | }, 588 | { 589 | "id": 69, 590 | "name": "maxLines", 591 | "kind": 32768, 592 | "kindString": "Parameter", 593 | "flags": {}, 594 | "comment": { 595 | "text": "The number of lines to limit to" 596 | }, 597 | "type": { 598 | "type": "intrinsic", 599 | "name": "number" 600 | } 601 | }, 602 | { 603 | "id": 70, 604 | "name": "maxCharacters", 605 | "kind": 32768, 606 | "kindString": "Parameter", 607 | "flags": {}, 608 | "comment": { 609 | "text": "The max characters per line" 610 | }, 611 | "type": { 612 | "type": "intrinsic", 613 | "name": "number" 614 | } 615 | } 616 | ], 617 | "type": { 618 | "type": "intrinsic", 619 | "name": "string" 620 | } 621 | } 622 | ] 623 | } 624 | } 625 | }, 626 | { 627 | "id": 61, 628 | "name": "commaNum", 629 | "kind": 1024, 630 | "kindString": "Property", 631 | "flags": {}, 632 | "type": { 633 | "type": "reflection", 634 | "declaration": { 635 | "id": 62, 636 | "name": "__type", 637 | "kind": 65536, 638 | "kindString": "Type literal", 639 | "flags": {}, 640 | "signatures": [ 641 | { 642 | "id": 63, 643 | "name": "__type", 644 | "kind": 4096, 645 | "kindString": "Call signature", 646 | "flags": {}, 647 | "comment": { 648 | "returns": "The number with commas, e.g. `10,000`\n" 649 | }, 650 | "parameters": [ 651 | { 652 | "id": 64, 653 | "name": "inputNum", 654 | "kind": 32768, 655 | "kindString": "Parameter", 656 | "flags": {}, 657 | "comment": { 658 | "text": "The number to add commas to" 659 | }, 660 | "type": { 661 | "type": "intrinsic", 662 | "name": "number" 663 | } 664 | } 665 | ], 666 | "type": { 667 | "type": "intrinsic", 668 | "name": "string" 669 | } 670 | } 671 | ] 672 | } 673 | } 674 | }, 675 | { 676 | "id": 93, 677 | "name": "countdown", 678 | "kind": 1024, 679 | "kindString": "Property", 680 | "flags": {}, 681 | "type": { 682 | "type": "reflection", 683 | "declaration": { 684 | "id": 94, 685 | "name": "__type", 686 | "kind": 65536, 687 | "kindString": "Type literal", 688 | "flags": {}, 689 | "signatures": [ 690 | { 691 | "id": 95, 692 | "name": "__type", 693 | "kind": 4096, 694 | "kindString": "Call signature", 695 | "flags": {}, 696 | "comment": { 697 | "returns": "A string of a countdown timer, .e.g. MM:SS\n" 698 | }, 699 | "parameters": [ 700 | { 701 | "id": 96, 702 | "name": "length", 703 | "kind": 32768, 704 | "kindString": "Parameter", 705 | "flags": {}, 706 | "comment": { 707 | "text": "The time to countdown from in seconds" 708 | }, 709 | "type": { 710 | "type": "intrinsic", 711 | "name": "number" 712 | }, 713 | "defaultValue": "..." 714 | }, 715 | { 716 | "id": 97, 717 | "name": "speed", 718 | "kind": 32768, 719 | "kindString": "Parameter", 720 | "flags": {}, 721 | "comment": { 722 | "text": "How fast to countdown as a multiple of time`" 723 | }, 724 | "type": { 725 | "type": "intrinsic", 726 | "name": "number" 727 | }, 728 | "defaultValue": "1" 729 | } 730 | ], 731 | "type": { 732 | "type": "intrinsic", 733 | "name": "string" 734 | } 735 | } 736 | ] 737 | } 738 | } 739 | }, 740 | { 741 | "id": 31, 742 | "name": "getIsometricPosition", 743 | "kind": 1024, 744 | "kindString": "Property", 745 | "flags": {}, 746 | "type": { 747 | "type": "reflection", 748 | "declaration": { 749 | "id": 32, 750 | "name": "__type", 751 | "kind": 65536, 752 | "kindString": "Type literal", 753 | "flags": {}, 754 | "signatures": [ 755 | { 756 | "id": 33, 757 | "name": "__type", 758 | "kind": 4096, 759 | "kindString": "Call signature", 760 | "flags": {}, 761 | "comment": { 762 | "returns": "Transforms a given position value along an isometric axis\n" 763 | }, 764 | "parameters": [ 765 | { 766 | "id": 34, 767 | "name": "position", 768 | "kind": 32768, 769 | "kindString": "Parameter", 770 | "flags": {}, 771 | "comment": { 772 | "text": "The position value to transform" 773 | }, 774 | "type": { 775 | "type": "reference", 776 | "name": "Vector2D" 777 | } 778 | }, 779 | { 780 | "id": 35, 781 | "name": "offset", 782 | "kind": 32768, 783 | "kindString": "Parameter", 784 | "flags": {}, 785 | "comment": { 786 | "text": "Offsets the given value in non-isometric space" 787 | }, 788 | "type": { 789 | "type": "reference", 790 | "name": "Vector" 791 | }, 792 | "defaultValue": "..." 793 | } 794 | ], 795 | "type": { 796 | "type": "reference", 797 | "name": "Vector" 798 | } 799 | } 800 | ] 801 | } 802 | } 803 | }, 804 | { 805 | "id": 76, 806 | "name": "getKeyframesAsArray", 807 | "kind": 1024, 808 | "kindString": "Property", 809 | "flags": {}, 810 | "type": { 811 | "type": "reflection", 812 | "declaration": { 813 | "id": 77, 814 | "name": "__type", 815 | "kind": 65536, 816 | "kindString": "Type literal", 817 | "flags": {}, 818 | "signatures": [ 819 | { 820 | "id": 78, 821 | "name": "__type", 822 | "kind": 4096, 823 | "kindString": "Call signature", 824 | "flags": {}, 825 | "comment": { 826 | "returns": "The keyframes on the current property as an array\n" 827 | }, 828 | "type": { 829 | "type": "array", 830 | "elementType": { 831 | "type": "reflection", 832 | "declaration": { 833 | "id": 79, 834 | "name": "__type", 835 | "kind": 65536, 836 | "kindString": "Type literal", 837 | "flags": {}, 838 | "children": [ 839 | { 840 | "id": 80, 841 | "name": "time", 842 | "kind": 1024, 843 | "kindString": "Property", 844 | "flags": {}, 845 | "type": { 846 | "type": "intrinsic", 847 | "name": "number" 848 | }, 849 | "defaultValue": "..." 850 | }, 851 | { 852 | "id": 81, 853 | "name": "value", 854 | "kind": 1024, 855 | "kindString": "Property", 856 | "flags": {}, 857 | "type": { 858 | "type": "reference", 859 | "name": "PathValue" 860 | }, 861 | "defaultValue": "..." 862 | } 863 | ], 864 | "groups": [ 865 | { 866 | "title": "Properties", 867 | "kind": 1024, 868 | "children": [ 869 | 80, 870 | 81 871 | ] 872 | } 873 | ] 874 | } 875 | } 876 | } 877 | } 878 | ] 879 | } 880 | } 881 | }, 882 | { 883 | "id": 36, 884 | "name": "getLayerBoundsPath", 885 | "kind": 1024, 886 | "kindString": "Property", 887 | "flags": {}, 888 | "type": { 889 | "type": "reflection", 890 | "declaration": { 891 | "id": 37, 892 | "name": "__type", 893 | "kind": 65536, 894 | "kindString": "Type literal", 895 | "flags": {}, 896 | "signatures": [ 897 | { 898 | "id": 38, 899 | "name": "__type", 900 | "kind": 4096, 901 | "kindString": "Call signature", 902 | "flags": {}, 903 | "comment": { 904 | "shortText": "For a more complicated box path setup, it's better to use our library eBox in conjunction with the `layerRect` function", 905 | "returns": "A box path that follows the layer bounds\n" 906 | }, 907 | "parameters": [ 908 | { 909 | "id": 39, 910 | "name": "buffer", 911 | "kind": 32768, 912 | "kindString": "Parameter", 913 | "flags": {}, 914 | "comment": { 915 | "text": "The space between the edge of the layer and the returned path" 916 | }, 917 | "type": { 918 | "type": "intrinsic", 919 | "name": "number" 920 | }, 921 | "defaultValue": "0" 922 | }, 923 | { 924 | "id": 40, 925 | "name": "sourceLayer", 926 | "kind": 32768, 927 | "kindString": "Parameter", 928 | "flags": {}, 929 | "comment": { 930 | "text": "The layer to get the size of" 931 | }, 932 | "type": { 933 | "type": "reference", 934 | "name": "Layer" 935 | }, 936 | "defaultValue": "..." 937 | }, 938 | { 939 | "id": 41, 940 | "name": "extend", 941 | "kind": 32768, 942 | "kindString": "Parameter", 943 | "flags": {}, 944 | "comment": { 945 | "text": "Whether to include layer extents" 946 | }, 947 | "type": { 948 | "type": "intrinsic", 949 | "name": "boolean" 950 | }, 951 | "defaultValue": "false" 952 | }, 953 | { 954 | "id": 42, 955 | "name": "sampleTime", 956 | "kind": 32768, 957 | "kindString": "Parameter", 958 | "flags": {}, 959 | "comment": { 960 | "text": "The time to sample the layer at" 961 | }, 962 | "type": { 963 | "type": "intrinsic", 964 | "name": "number" 965 | }, 966 | "defaultValue": "..." 967 | } 968 | ], 969 | "type": { 970 | "type": "reference", 971 | "name": "PathValue" 972 | } 973 | } 974 | ] 975 | } 976 | } 977 | }, 978 | { 979 | "id": 18, 980 | "name": "getPathFromPoints", 981 | "kind": 1024, 982 | "kindString": "Property", 983 | "flags": {}, 984 | "type": { 985 | "type": "reflection", 986 | "declaration": { 987 | "id": 19, 988 | "name": "__type", 989 | "kind": 65536, 990 | "kindString": "Type literal", 991 | "flags": {}, 992 | "signatures": [ 993 | { 994 | "id": 20, 995 | "name": "__type", 996 | "kind": 4096, 997 | "kindString": "Call signature", 998 | "flags": {}, 999 | "comment": { 1000 | "returns": "A path object of the given points in composition space\n" 1001 | }, 1002 | "parameters": [ 1003 | { 1004 | "id": 21, 1005 | "name": "points", 1006 | "kind": 32768, 1007 | "kindString": "Parameter", 1008 | "flags": {}, 1009 | "comment": { 1010 | "text": "The array of points to create the path from" 1011 | }, 1012 | "type": { 1013 | "type": "reference", 1014 | "name": "Points" 1015 | } 1016 | }, 1017 | { 1018 | "id": 22, 1019 | "name": "closed", 1020 | "kind": 32768, 1021 | "kindString": "Parameter", 1022 | "flags": {}, 1023 | "comment": { 1024 | "text": "Whether to close the path" 1025 | }, 1026 | "type": { 1027 | "type": "intrinsic", 1028 | "name": "boolean" 1029 | }, 1030 | "defaultValue": "true" 1031 | } 1032 | ], 1033 | "type": { 1034 | "type": "reference", 1035 | "name": "PathValue" 1036 | } 1037 | } 1038 | ] 1039 | } 1040 | } 1041 | }, 1042 | { 1043 | "id": 23, 1044 | "name": "gridPoints", 1045 | "kind": 1024, 1046 | "kindString": "Property", 1047 | "flags": {}, 1048 | "type": { 1049 | "type": "reflection", 1050 | "declaration": { 1051 | "id": 24, 1052 | "name": "__type", 1053 | "kind": 65536, 1054 | "kindString": "Type literal", 1055 | "flags": {}, 1056 | "signatures": [ 1057 | { 1058 | "id": 25, 1059 | "name": "__type", 1060 | "kind": 4096, 1061 | "kindString": "Call signature", 1062 | "flags": {}, 1063 | "comment": { 1064 | "returns": "The points of the four corners of a cell in a given grid\n" 1065 | }, 1066 | "parameters": [ 1067 | { 1068 | "id": 26, 1069 | "name": "__namedParameters", 1070 | "kind": 32768, 1071 | "kindString": "Parameter", 1072 | "flags": {}, 1073 | "type": { 1074 | "type": "intrinsic", 1075 | "name": "Object" 1076 | } 1077 | } 1078 | ], 1079 | "type": { 1080 | "type": "array", 1081 | "elementType": { 1082 | "type": "reference", 1083 | "name": "Vector2D" 1084 | } 1085 | } 1086 | } 1087 | ] 1088 | } 1089 | } 1090 | }, 1091 | { 1092 | "id": 71, 1093 | "name": "hideDescenders", 1094 | "kind": 1024, 1095 | "kindString": "Property", 1096 | "flags": {}, 1097 | "type": { 1098 | "type": "reflection", 1099 | "declaration": { 1100 | "id": 72, 1101 | "name": "__type", 1102 | "kind": 65536, 1103 | "kindString": "Type literal", 1104 | "flags": {}, 1105 | "signatures": [ 1106 | { 1107 | "id": 73, 1108 | "name": "__type", 1109 | "kind": 4096, 1110 | "kindString": "Call signature", 1111 | "flags": {}, 1112 | "comment": { 1113 | "returns": "Hides a descenderless version of the given string in negative time\n", 1114 | "tags": [ 1115 | { 1116 | "tag": "deprecated", 1117 | "text": "Use `layerRect` to get the descenderless height instead" 1118 | } 1119 | ] 1120 | }, 1121 | "parameters": [ 1122 | { 1123 | "id": 74, 1124 | "name": "string", 1125 | "kind": 32768, 1126 | "kindString": "Parameter", 1127 | "flags": {}, 1128 | "comment": {}, 1129 | "type": { 1130 | "type": "intrinsic", 1131 | "name": "string" 1132 | }, 1133 | "defaultValue": "..." 1134 | }, 1135 | { 1136 | "id": 75, 1137 | "name": "hideTime", 1138 | "kind": 32768, 1139 | "kindString": "Parameter", 1140 | "flags": {}, 1141 | "comment": { 1142 | "text": "Where to hide in time, defaulting to `-500`" 1143 | }, 1144 | "type": { 1145 | "type": "intrinsic", 1146 | "name": "number" 1147 | }, 1148 | "defaultValue": "-500" 1149 | } 1150 | ], 1151 | "type": { 1152 | "type": "intrinsic", 1153 | "name": "string" 1154 | } 1155 | } 1156 | ] 1157 | } 1158 | } 1159 | }, 1160 | { 1161 | "id": 27, 1162 | "name": "hideLayerWhenBelow", 1163 | "kind": 1024, 1164 | "kindString": "Property", 1165 | "flags": {}, 1166 | "type": { 1167 | "type": "reflection", 1168 | "declaration": { 1169 | "id": 28, 1170 | "name": "__type", 1171 | "kind": 65536, 1172 | "kindString": "Type literal", 1173 | "flags": {}, 1174 | "signatures": [ 1175 | { 1176 | "id": 29, 1177 | "name": "__type", 1178 | "kind": 4096, 1179 | "kindString": "Call signature", 1180 | "flags": {}, 1181 | "comment": { 1182 | "returns": "An opacity value that's zero when below the given layer\n" 1183 | }, 1184 | "parameters": [ 1185 | { 1186 | "id": 30, 1187 | "name": "layerIndex", 1188 | "kind": 32768, 1189 | "kindString": "Parameter", 1190 | "flags": {}, 1191 | "comment": { 1192 | "text": "Which layer to hide below, defaulting to the layer above" 1193 | }, 1194 | "type": { 1195 | "type": "intrinsic", 1196 | "name": "number" 1197 | }, 1198 | "defaultValue": "..." 1199 | } 1200 | ], 1201 | "type": { 1202 | "type": "union", 1203 | "types": [ 1204 | { 1205 | "type": "literal", 1206 | "value": 0 1207 | }, 1208 | { 1209 | "type": "literal", 1210 | "value": 100 1211 | } 1212 | ] 1213 | } 1214 | } 1215 | ] 1216 | } 1217 | } 1218 | }, 1219 | { 1220 | "id": 48, 1221 | "name": "layerRect", 1222 | "kind": 1024, 1223 | "kindString": "Property", 1224 | "flags": {}, 1225 | "type": { 1226 | "type": "reflection", 1227 | "declaration": { 1228 | "id": 49, 1229 | "name": "__type", 1230 | "kind": 65536, 1231 | "kindString": "Type literal", 1232 | "flags": {}, 1233 | "signatures": [ 1234 | { 1235 | "id": 50, 1236 | "name": "__type", 1237 | "kind": 4096, 1238 | "kindString": "Call signature", 1239 | "flags": {}, 1240 | "comment": { 1241 | "returns": "An object with the layers size and position from `sourceRectAtTime`, as well as the sourceRect itself: `{ size, position, sourceRect }`\n" 1242 | }, 1243 | "parameters": [ 1244 | { 1245 | "id": 51, 1246 | "name": "__namedParameters", 1247 | "kind": 32768, 1248 | "kindString": "Parameter", 1249 | "flags": {}, 1250 | "type": { 1251 | "type": "reference", 1252 | "name": "LayerRectProps" 1253 | } 1254 | } 1255 | ], 1256 | "type": { 1257 | "type": "reflection", 1258 | "declaration": { 1259 | "id": 52, 1260 | "name": "__type", 1261 | "kind": 65536, 1262 | "kindString": "Type literal", 1263 | "flags": {}, 1264 | "children": [ 1265 | { 1266 | "id": 53, 1267 | "name": "position", 1268 | "kind": 1024, 1269 | "kindString": "Property", 1270 | "flags": {}, 1271 | "sources": [ 1272 | { 1273 | "fileName": "index.ts", 1274 | "line": 291, 1275 | "character": 12 1276 | } 1277 | ], 1278 | "type": { 1279 | "type": "reference", 1280 | "name": "Vector" 1281 | } 1282 | }, 1283 | { 1284 | "id": 54, 1285 | "name": "size", 1286 | "kind": 1024, 1287 | "kindString": "Property", 1288 | "flags": {}, 1289 | "sources": [ 1290 | { 1291 | "fileName": "index.ts", 1292 | "line": 292, 1293 | "character": 8 1294 | } 1295 | ], 1296 | "type": { 1297 | "type": "reference", 1298 | "name": "Vector" 1299 | } 1300 | }, 1301 | { 1302 | "id": 55, 1303 | "name": "sourceRect", 1304 | "kind": 1024, 1305 | "kindString": "Property", 1306 | "flags": {}, 1307 | "sources": [ 1308 | { 1309 | "fileName": "index.ts", 1310 | "line": 293, 1311 | "character": 14 1312 | } 1313 | ], 1314 | "type": { 1315 | "type": "reference", 1316 | "name": "SourceRect" 1317 | } 1318 | } 1319 | ], 1320 | "groups": [ 1321 | { 1322 | "title": "Properties", 1323 | "kind": 1024, 1324 | "children": [ 1325 | 53, 1326 | 54, 1327 | 55 1328 | ] 1329 | } 1330 | ], 1331 | "sources": [ 1332 | { 1333 | "fileName": "index.ts", 1334 | "line": 290, 1335 | "character": 21 1336 | } 1337 | ] 1338 | } 1339 | } 1340 | } 1341 | ] 1342 | } 1343 | } 1344 | }, 1345 | { 1346 | "id": 43, 1347 | "name": "layerSize", 1348 | "kind": 1024, 1349 | "kindString": "Property", 1350 | "flags": {}, 1351 | "type": { 1352 | "type": "reflection", 1353 | "declaration": { 1354 | "id": 44, 1355 | "name": "__type", 1356 | "kind": 65536, 1357 | "kindString": "Type literal", 1358 | "flags": {}, 1359 | "signatures": [ 1360 | { 1361 | "id": 45, 1362 | "name": "__type", 1363 | "kind": 4096, 1364 | "kindString": "Call signature", 1365 | "flags": {}, 1366 | "comment": { 1367 | "returns": "The size of the layer as an array\n" 1368 | }, 1369 | "parameters": [ 1370 | { 1371 | "id": 46, 1372 | "name": "layerIndex", 1373 | "kind": 32768, 1374 | "kindString": "Parameter", 1375 | "flags": {}, 1376 | "comment": { 1377 | "text": "The index of the layer to get the size of" 1378 | }, 1379 | "type": { 1380 | "type": "intrinsic", 1381 | "name": "number" 1382 | }, 1383 | "defaultValue": "..." 1384 | }, 1385 | { 1386 | "id": 47, 1387 | "name": "sampleTime", 1388 | "kind": 32768, 1389 | "kindString": "Parameter", 1390 | "flags": {}, 1391 | "comment": { 1392 | "text": "When in time to get the size" 1393 | }, 1394 | "type": { 1395 | "type": "intrinsic", 1396 | "name": "number" 1397 | }, 1398 | "defaultValue": "..." 1399 | } 1400 | ], 1401 | "type": { 1402 | "type": "array", 1403 | "elementType": { 1404 | "type": "intrinsic", 1405 | "name": "number" 1406 | } 1407 | } 1408 | } 1409 | ] 1410 | } 1411 | } 1412 | }, 1413 | { 1414 | "id": 115, 1415 | "name": "maintainScale", 1416 | "kind": 1024, 1417 | "kindString": "Property", 1418 | "flags": {}, 1419 | "type": { 1420 | "type": "reflection", 1421 | "declaration": { 1422 | "id": 116, 1423 | "name": "__type", 1424 | "kind": 65536, 1425 | "kindString": "Type literal", 1426 | "flags": {}, 1427 | "signatures": [ 1428 | { 1429 | "id": 117, 1430 | "name": "__type", 1431 | "kind": 4096, 1432 | "kindString": "Call signature", 1433 | "flags": {}, 1434 | "comment": { 1435 | "returns": "A scale value that will stay consistent regardless of the parent layers scale\n" 1436 | }, 1437 | "parameters": [ 1438 | { 1439 | "id": 118, 1440 | "name": "parentLayer", 1441 | "kind": 32768, 1442 | "kindString": "Parameter", 1443 | "flags": {}, 1444 | "type": { 1445 | "type": "reference", 1446 | "name": "Layer" 1447 | }, 1448 | "defaultValue": "..." 1449 | } 1450 | ], 1451 | "type": { 1452 | "type": "reference", 1453 | "name": "Vector" 1454 | } 1455 | } 1456 | ] 1457 | } 1458 | } 1459 | }, 1460 | { 1461 | "id": 119, 1462 | "name": "offsetFromAnchor", 1463 | "kind": 1024, 1464 | "kindString": "Property", 1465 | "flags": {}, 1466 | "type": { 1467 | "type": "reflection", 1468 | "declaration": { 1469 | "id": 120, 1470 | "name": "__type", 1471 | "kind": 65536, 1472 | "kindString": "Type literal", 1473 | "flags": {}, 1474 | "signatures": [ 1475 | { 1476 | "id": 121, 1477 | "name": "__type", 1478 | "kind": 4096, 1479 | "kindString": "Call signature", 1480 | "flags": {}, 1481 | "comment": { 1482 | "returns": "The given position value plus the offset, in the direction away from the given `anchor`\n" 1483 | }, 1484 | "parameters": [ 1485 | { 1486 | "id": 122, 1487 | "name": "position", 1488 | "kind": 32768, 1489 | "kindString": "Parameter", 1490 | "flags": {}, 1491 | "comment": { 1492 | "text": "The position value to offset from" 1493 | }, 1494 | "type": { 1495 | "type": "reference", 1496 | "name": "Vector" 1497 | } 1498 | }, 1499 | { 1500 | "id": 123, 1501 | "name": "__namedParameters", 1502 | "kind": 32768, 1503 | "kindString": "Parameter", 1504 | "flags": {}, 1505 | "type": { 1506 | "type": "reference", 1507 | "name": "Vector" 1508 | } 1509 | }, 1510 | { 1511 | "id": 124, 1512 | "name": "anchor", 1513 | "kind": 32768, 1514 | "kindString": "Parameter", 1515 | "flags": {}, 1516 | "comment": { 1517 | "text": "The direction to offset it, e.g. an anchor of 'topLeft' will offset towards the bottom right" 1518 | }, 1519 | "type": { 1520 | "type": "reference", 1521 | "name": "Anchor" 1522 | } 1523 | } 1524 | ], 1525 | "type": { 1526 | "type": "reference", 1527 | "name": "Vector" 1528 | } 1529 | } 1530 | ] 1531 | } 1532 | } 1533 | }, 1534 | { 1535 | "id": 98, 1536 | "name": "scaleToFit", 1537 | "kind": 1024, 1538 | "kindString": "Property", 1539 | "flags": {}, 1540 | "type": { 1541 | "type": "reflection", 1542 | "declaration": { 1543 | "id": 99, 1544 | "name": "__type", 1545 | "kind": 65536, 1546 | "kindString": "Type literal", 1547 | "flags": {}, 1548 | "signatures": [ 1549 | { 1550 | "id": 100, 1551 | "name": "__type", 1552 | "kind": 4096, 1553 | "kindString": "Call signature", 1554 | "flags": {}, 1555 | "comment": { 1556 | "returns": "A scale value that will transform the `inputSize` to fit within `maxSize`\n" 1557 | }, 1558 | "parameters": [ 1559 | { 1560 | "id": 101, 1561 | "name": "inputSize", 1562 | "kind": 32768, 1563 | "kindString": "Parameter", 1564 | "flags": {}, 1565 | "comment": { 1566 | "text": "The size of the object that needs to fit into a given area" 1567 | }, 1568 | "type": { 1569 | "type": "reference", 1570 | "name": "Vector2D" 1571 | } 1572 | }, 1573 | { 1574 | "id": 102, 1575 | "name": "maxSize", 1576 | "kind": 32768, 1577 | "kindString": "Parameter", 1578 | "flags": {}, 1579 | "comment": { 1580 | "text": "The size of the area the object needs to fit into" 1581 | }, 1582 | "type": { 1583 | "type": "reference", 1584 | "name": "Vector2D" 1585 | } 1586 | }, 1587 | { 1588 | "id": 103, 1589 | "name": "toggles", 1590 | "kind": 32768, 1591 | "kindString": "Parameter", 1592 | "flags": {}, 1593 | "type": { 1594 | "type": "reflection", 1595 | "declaration": { 1596 | "id": 104, 1597 | "name": "__type", 1598 | "kind": 65536, 1599 | "kindString": "Type literal", 1600 | "flags": {}, 1601 | "children": [ 1602 | { 1603 | "id": 105, 1604 | "name": "onlyScaleDown", 1605 | "kind": 1024, 1606 | "kindString": "Property", 1607 | "flags": {}, 1608 | "comment": { 1609 | "text": "Only scale down to fit" 1610 | }, 1611 | "type": { 1612 | "type": "intrinsic", 1613 | "name": "boolean" 1614 | }, 1615 | "defaultValue": "false" 1616 | }, 1617 | { 1618 | "id": 106, 1619 | "name": "onlyScaleUp", 1620 | "kind": 1024, 1621 | "kindString": "Property", 1622 | "flags": {}, 1623 | "comment": { 1624 | "text": "Only scale up to fit" 1625 | }, 1626 | "type": { 1627 | "type": "intrinsic", 1628 | "name": "boolean" 1629 | }, 1630 | "defaultValue": "false" 1631 | }, 1632 | { 1633 | "id": 107, 1634 | "name": "uniform", 1635 | "kind": 1024, 1636 | "kindString": "Property", 1637 | "flags": {}, 1638 | "comment": { 1639 | "text": "Scale x and y axis uniformly, defaults to true" 1640 | }, 1641 | "type": { 1642 | "type": "intrinsic", 1643 | "name": "boolean" 1644 | }, 1645 | "defaultValue": "true" 1646 | } 1647 | ], 1648 | "groups": [ 1649 | { 1650 | "title": "Properties", 1651 | "kind": 1024, 1652 | "children": [ 1653 | 105, 1654 | 106, 1655 | 107 1656 | ] 1657 | } 1658 | ] 1659 | } 1660 | }, 1661 | "defaultValue": "..." 1662 | } 1663 | ], 1664 | "type": { 1665 | "type": "array", 1666 | "elementType": { 1667 | "type": "intrinsic", 1668 | "name": "number" 1669 | } 1670 | } 1671 | } 1672 | ] 1673 | } 1674 | } 1675 | }, 1676 | { 1677 | "id": 56, 1678 | "name": "textCount", 1679 | "kind": 1024, 1680 | "kindString": "Property", 1681 | "flags": {}, 1682 | "type": { 1683 | "type": "reflection", 1684 | "declaration": { 1685 | "id": 57, 1686 | "name": "__type", 1687 | "kind": 65536, 1688 | "kindString": "Type literal", 1689 | "flags": {}, 1690 | "signatures": [ 1691 | { 1692 | "id": 58, 1693 | "name": "__type", 1694 | "kind": 4096, 1695 | "kindString": "Call signature", 1696 | "flags": {}, 1697 | "comment": { 1698 | "returns": "The number of the given type\n" 1699 | }, 1700 | "parameters": [ 1701 | { 1702 | "id": 59, 1703 | "name": "sourceText", 1704 | "kind": 32768, 1705 | "kindString": "Parameter", 1706 | "flags": {}, 1707 | "comment": { 1708 | "text": "The string to count" 1709 | }, 1710 | "type": { 1711 | "type": "intrinsic", 1712 | "name": "string" 1713 | } 1714 | }, 1715 | { 1716 | "id": 60, 1717 | "name": "type", 1718 | "kind": 32768, 1719 | "kindString": "Parameter", 1720 | "flags": {}, 1721 | "comment": { 1722 | "text": "What to count, either `'word'`, `'line'`, or `'char'`" 1723 | }, 1724 | "type": { 1725 | "type": "intrinsic", 1726 | "name": "string" 1727 | }, 1728 | "defaultValue": "'word'" 1729 | } 1730 | ], 1731 | "type": { 1732 | "type": "intrinsic", 1733 | "name": "number" 1734 | } 1735 | } 1736 | ] 1737 | } 1738 | } 1739 | } 1740 | ], 1741 | "groups": [ 1742 | { 1743 | "title": "Properties", 1744 | "kind": 1024, 1745 | "children": [ 1746 | 125, 1747 | 5, 1748 | 10, 1749 | 108, 1750 | 82, 1751 | 88, 1752 | 65, 1753 | 61, 1754 | 93, 1755 | 31, 1756 | 76, 1757 | 36, 1758 | 18, 1759 | 23, 1760 | 71, 1761 | 27, 1762 | 48, 1763 | 43, 1764 | 115, 1765 | 119, 1766 | 98, 1767 | 56 1768 | ] 1769 | } 1770 | ] 1771 | } 1772 | } 1773 | } 1774 | ] 1775 | } 1776 | ], 1777 | "groups": [ 1778 | { 1779 | "title": "Variables", 1780 | "kind": 32, 1781 | "children": [ 1782 | 130 1783 | ] 1784 | }, 1785 | { 1786 | "title": "Functions", 1787 | "kind": 64, 1788 | "children": [ 1789 | 1 1790 | ] 1791 | } 1792 | ], 1793 | "sources": [ 1794 | { 1795 | "fileName": "index.ts", 1796 | "line": 1, 1797 | "character": 0 1798 | } 1799 | ] 1800 | } -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "aefunctions", 3 | "version": "2.0.3", 4 | "lockfileVersion": 2, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "version": "2.0.3", 9 | "license": "MIT", 10 | "dependencies": { 11 | "expression-globals-typescript": "^3.2.5" 12 | }, 13 | "devDependencies": { 14 | "@rollup/plugin-replace": "^2.3.3", 15 | "@rollup/plugin-typescript": "^5.0.2", 16 | "prettier": "^1.16.4", 17 | "rollup": "^2.27.1", 18 | "rollup-plugin-ae-jsx": "^2.0.0", 19 | "tslib": "^2.0.1", 20 | "typedoc": "^0.20.36", 21 | "typescript": "^4.2.4" 22 | } 23 | }, 24 | "node_modules/@rollup/plugin-replace": { 25 | "version": "2.3.3", 26 | "resolved": "https://registry.npmjs.org/@rollup/plugin-replace/-/plugin-replace-2.3.3.tgz", 27 | "integrity": "sha512-XPmVXZ7IlaoWaJLkSCDaa0Y6uVo5XQYHhiMFzOd5qSv5rE+t/UJToPIOE56flKIxBFQI27ONsxb7dqHnwSsjKQ==", 28 | "dev": true, 29 | "dependencies": { 30 | "@rollup/pluginutils": "^3.0.8", 31 | "magic-string": "^0.25.5" 32 | } 33 | }, 34 | "node_modules/@rollup/plugin-typescript": { 35 | "version": "5.0.2", 36 | "resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-5.0.2.tgz", 37 | "integrity": "sha512-CkS028Itwjqm1uLbFVfpJgtVtnNvZ+og/m6UlNRR5wOOnNTWPcVQzOu5xGdEX+WWJxdvWIqUq2uR/RBt2ZipWg==", 38 | "dev": true, 39 | "dependencies": { 40 | "@rollup/pluginutils": "^3.0.1", 41 | "resolve": "^1.14.1" 42 | }, 43 | "engines": { 44 | "node": ">=8.0.0" 45 | } 46 | }, 47 | "node_modules/@rollup/pluginutils": { 48 | "version": "3.1.0", 49 | "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz", 50 | "integrity": "sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==", 51 | "dev": true, 52 | "dependencies": { 53 | "@types/estree": "0.0.39", 54 | "estree-walker": "^1.0.1", 55 | "picomatch": "^2.2.2" 56 | }, 57 | "engines": { 58 | "node": ">= 8.0.0" 59 | } 60 | }, 61 | "node_modules/@types/estree": { 62 | "version": "0.0.39", 63 | "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", 64 | "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", 65 | "dev": true 66 | }, 67 | "node_modules/at-least-node": { 68 | "version": "1.0.0", 69 | "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", 70 | "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", 71 | "engines": { 72 | "node": ">= 4.0.0" 73 | } 74 | }, 75 | "node_modules/balanced-match": { 76 | "version": "1.0.2", 77 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", 78 | "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" 79 | }, 80 | "node_modules/brace-expansion": { 81 | "version": "1.1.11", 82 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", 83 | "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", 84 | "dependencies": { 85 | "balanced-match": "^1.0.0", 86 | "concat-map": "0.0.1" 87 | } 88 | }, 89 | "node_modules/colors": { 90 | "version": "1.4.0", 91 | "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", 92 | "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==", 93 | "engines": { 94 | "node": ">=0.1.90" 95 | } 96 | }, 97 | "node_modules/concat-map": { 98 | "version": "0.0.1", 99 | "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", 100 | "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" 101 | }, 102 | "node_modules/estree-walker": { 103 | "version": "1.0.1", 104 | "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz", 105 | "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==", 106 | "dev": true 107 | }, 108 | "node_modules/expression-globals-typescript": { 109 | "version": "3.2.5", 110 | "resolved": "https://registry.npmjs.org/expression-globals-typescript/-/expression-globals-typescript-3.2.5.tgz", 111 | "integrity": "sha512-ihtEfov+kGRMLaufssxjLnfiaLrM+WeEt9syNzHc7Z84HO2IkIxUj3Na8NBngFsGl3j2hCMJCyDtR4A1WVCtxg==", 112 | "dependencies": { 113 | "typedoc": "^0.20.34" 114 | } 115 | }, 116 | "node_modules/fs-extra": { 117 | "version": "9.1.0", 118 | "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", 119 | "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", 120 | "dependencies": { 121 | "at-least-node": "^1.0.0", 122 | "graceful-fs": "^4.2.0", 123 | "jsonfile": "^6.0.1", 124 | "universalify": "^2.0.0" 125 | }, 126 | "engines": { 127 | "node": ">=10" 128 | } 129 | }, 130 | "node_modules/fs.realpath": { 131 | "version": "1.0.0", 132 | "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", 133 | "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" 134 | }, 135 | "node_modules/fsevents": { 136 | "version": "2.1.3", 137 | "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", 138 | "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", 139 | "dev": true, 140 | "optional": true, 141 | "os": [ 142 | "darwin" 143 | ], 144 | "engines": { 145 | "node": "^8.16.0 || ^10.6.0 || >=11.0.0" 146 | } 147 | }, 148 | "node_modules/glob": { 149 | "version": "7.1.7", 150 | "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", 151 | "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", 152 | "dependencies": { 153 | "fs.realpath": "^1.0.0", 154 | "inflight": "^1.0.4", 155 | "inherits": "2", 156 | "minimatch": "^3.0.4", 157 | "once": "^1.3.0", 158 | "path-is-absolute": "^1.0.0" 159 | }, 160 | "engines": { 161 | "node": "*" 162 | }, 163 | "funding": { 164 | "url": "https://github.com/sponsors/isaacs" 165 | } 166 | }, 167 | "node_modules/graceful-fs": { 168 | "version": "4.2.6", 169 | "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz", 170 | "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==" 171 | }, 172 | "node_modules/handlebars": { 173 | "version": "4.7.7", 174 | "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", 175 | "integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==", 176 | "dependencies": { 177 | "minimist": "^1.2.5", 178 | "neo-async": "^2.6.0", 179 | "source-map": "^0.6.1", 180 | "wordwrap": "^1.0.0" 181 | }, 182 | "bin": { 183 | "handlebars": "bin/handlebars" 184 | }, 185 | "engines": { 186 | "node": ">=0.4.7" 187 | }, 188 | "optionalDependencies": { 189 | "uglify-js": "^3.1.4" 190 | } 191 | }, 192 | "node_modules/inflight": { 193 | "version": "1.0.6", 194 | "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", 195 | "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", 196 | "dependencies": { 197 | "once": "^1.3.0", 198 | "wrappy": "1" 199 | } 200 | }, 201 | "node_modules/inherits": { 202 | "version": "2.0.4", 203 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 204 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" 205 | }, 206 | "node_modules/interpret": { 207 | "version": "1.4.0", 208 | "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", 209 | "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", 210 | "engines": { 211 | "node": ">= 0.10" 212 | } 213 | }, 214 | "node_modules/jsonfile": { 215 | "version": "6.1.0", 216 | "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", 217 | "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", 218 | "dependencies": { 219 | "universalify": "^2.0.0" 220 | }, 221 | "optionalDependencies": { 222 | "graceful-fs": "^4.1.6" 223 | } 224 | }, 225 | "node_modules/lodash": { 226 | "version": "4.17.21", 227 | "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", 228 | "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" 229 | }, 230 | "node_modules/lru-cache": { 231 | "version": "5.1.1", 232 | "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", 233 | "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", 234 | "dependencies": { 235 | "yallist": "^3.0.2" 236 | } 237 | }, 238 | "node_modules/lunr": { 239 | "version": "2.3.9", 240 | "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", 241 | "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==" 242 | }, 243 | "node_modules/magic-string": { 244 | "version": "0.25.7", 245 | "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz", 246 | "integrity": "sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==", 247 | "dev": true, 248 | "dependencies": { 249 | "sourcemap-codec": "^1.4.4" 250 | } 251 | }, 252 | "node_modules/marked": { 253 | "version": "2.0.3", 254 | "resolved": "https://registry.npmjs.org/marked/-/marked-2.0.3.tgz", 255 | "integrity": "sha512-5otztIIcJfPc2qGTN8cVtOJEjNJZ0jwa46INMagrYfk0EvqtRuEHLsEe0LrFS0/q+ZRKT0+kXK7P2T1AN5lWRA==", 256 | "bin": { 257 | "marked": "bin/marked" 258 | }, 259 | "engines": { 260 | "node": ">= 8.16.2" 261 | } 262 | }, 263 | "node_modules/minimatch": { 264 | "version": "3.0.4", 265 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", 266 | "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", 267 | "dependencies": { 268 | "brace-expansion": "^1.1.7" 269 | }, 270 | "engines": { 271 | "node": "*" 272 | } 273 | }, 274 | "node_modules/minimist": { 275 | "version": "1.2.5", 276 | "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", 277 | "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" 278 | }, 279 | "node_modules/neo-async": { 280 | "version": "2.6.2", 281 | "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", 282 | "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==" 283 | }, 284 | "node_modules/once": { 285 | "version": "1.4.0", 286 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", 287 | "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", 288 | "dependencies": { 289 | "wrappy": "1" 290 | } 291 | }, 292 | "node_modules/onigasm": { 293 | "version": "2.2.5", 294 | "resolved": "https://registry.npmjs.org/onigasm/-/onigasm-2.2.5.tgz", 295 | "integrity": "sha512-F+th54mPc0l1lp1ZcFMyL/jTs2Tlq4SqIHKIXGZOR/VkHkF9A7Fr5rRr5+ZG/lWeRsyrClLYRq7s/yFQ/XhWCA==", 296 | "dependencies": { 297 | "lru-cache": "^5.1.1" 298 | } 299 | }, 300 | "node_modules/path-is-absolute": { 301 | "version": "1.0.1", 302 | "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", 303 | "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", 304 | "engines": { 305 | "node": ">=0.10.0" 306 | } 307 | }, 308 | "node_modules/path-parse": { 309 | "version": "1.0.6", 310 | "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", 311 | "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==" 312 | }, 313 | "node_modules/picomatch": { 314 | "version": "2.2.2", 315 | "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", 316 | "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", 317 | "dev": true, 318 | "engines": { 319 | "node": ">=8.6" 320 | } 321 | }, 322 | "node_modules/prettier": { 323 | "version": "1.19.1", 324 | "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz", 325 | "integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==", 326 | "dev": true, 327 | "bin": { 328 | "prettier": "bin-prettier.js" 329 | }, 330 | "engines": { 331 | "node": ">=4" 332 | } 333 | }, 334 | "node_modules/progress": { 335 | "version": "2.0.3", 336 | "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", 337 | "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", 338 | "engines": { 339 | "node": ">=0.4.0" 340 | } 341 | }, 342 | "node_modules/rechoir": { 343 | "version": "0.6.2", 344 | "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", 345 | "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", 346 | "dependencies": { 347 | "resolve": "^1.1.6" 348 | }, 349 | "engines": { 350 | "node": ">= 0.10" 351 | } 352 | }, 353 | "node_modules/resolve": { 354 | "version": "1.17.0", 355 | "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", 356 | "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", 357 | "dependencies": { 358 | "path-parse": "^1.0.6" 359 | } 360 | }, 361 | "node_modules/rollup": { 362 | "version": "2.27.1", 363 | "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.27.1.tgz", 364 | "integrity": "sha512-GiWHQvnmMgBktSpY/1+nrGpwPsTw4b9P28og2uedfeq4JZ16rzAmnQ5Pm/E0/BEmDNia1ZbY7+qu3nBgNa19Hg==", 365 | "dev": true, 366 | "bin": { 367 | "rollup": "dist/bin/rollup" 368 | }, 369 | "engines": { 370 | "node": ">=10.0.0" 371 | }, 372 | "optionalDependencies": { 373 | "fsevents": "~2.1.2" 374 | } 375 | }, 376 | "node_modules/rollup-plugin-ae-jsx": { 377 | "version": "2.0.0", 378 | "resolved": "https://registry.npmjs.org/rollup-plugin-ae-jsx/-/rollup-plugin-ae-jsx-2.0.0.tgz", 379 | "integrity": "sha512-yj29W+kNy8K7dN3PypZLps4B2pMma5TnJbS1WiLpOQzqXpXepNehhs5J6EAsAqldIiqKXFf6RpNYLNr8llo4zA==", 380 | "dev": true, 381 | "dependencies": { 382 | "estree-walker": "^2.0.1", 383 | "magic-string": "^0.25.7" 384 | } 385 | }, 386 | "node_modules/rollup-plugin-ae-jsx/node_modules/estree-walker": { 387 | "version": "2.0.1", 388 | "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.1.tgz", 389 | "integrity": "sha512-tF0hv+Yi2Ot1cwj9eYHtxC0jB9bmjacjQs6ZBTj82H8JwUywFuc+7E83NWfNMwHXZc11mjfFcVXPe9gEP4B8dg==", 390 | "dev": true 391 | }, 392 | "node_modules/shelljs": { 393 | "version": "0.8.4", 394 | "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.4.tgz", 395 | "integrity": "sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ==", 396 | "dependencies": { 397 | "glob": "^7.0.0", 398 | "interpret": "^1.0.0", 399 | "rechoir": "^0.6.2" 400 | }, 401 | "bin": { 402 | "shjs": "bin/shjs" 403 | }, 404 | "engines": { 405 | "node": ">=4" 406 | } 407 | }, 408 | "node_modules/shiki": { 409 | "version": "0.9.3", 410 | "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.9.3.tgz", 411 | "integrity": "sha512-NEjg1mVbAUrzRv2eIcUt3TG7X9svX7l3n3F5/3OdFq+/BxUdmBOeKGiH4icZJBLHy354Shnj6sfBTemea2e7XA==", 412 | "dependencies": { 413 | "onigasm": "^2.2.5", 414 | "vscode-textmate": "^5.2.0" 415 | } 416 | }, 417 | "node_modules/source-map": { 418 | "version": "0.6.1", 419 | "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", 420 | "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", 421 | "engines": { 422 | "node": ">=0.10.0" 423 | } 424 | }, 425 | "node_modules/sourcemap-codec": { 426 | "version": "1.4.8", 427 | "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", 428 | "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", 429 | "dev": true 430 | }, 431 | "node_modules/tslib": { 432 | "version": "2.0.1", 433 | "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.1.tgz", 434 | "integrity": "sha512-SgIkNheinmEBgx1IUNirK0TUD4X9yjjBRTqqjggWCU3pUEqIk3/Uwl3yRixYKT6WjQuGiwDv4NomL3wqRCj+CQ==", 435 | "dev": true 436 | }, 437 | "node_modules/typedoc": { 438 | "version": "0.20.36", 439 | "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.20.36.tgz", 440 | "integrity": "sha512-qFU+DWMV/hifQ9ZAlTjdFO9wbUIHuUBpNXzv68ZyURAP9pInjZiO4+jCPeAzHVcaBCHER9WL/+YzzTt6ZlN/Nw==", 441 | "dependencies": { 442 | "colors": "^1.4.0", 443 | "fs-extra": "^9.1.0", 444 | "handlebars": "^4.7.7", 445 | "lodash": "^4.17.21", 446 | "lunr": "^2.3.9", 447 | "marked": "^2.0.3", 448 | "minimatch": "^3.0.0", 449 | "progress": "^2.0.3", 450 | "shelljs": "^0.8.4", 451 | "shiki": "^0.9.3", 452 | "typedoc-default-themes": "^0.12.10" 453 | }, 454 | "bin": { 455 | "typedoc": "bin/typedoc" 456 | }, 457 | "engines": { 458 | "node": ">= 10.8.0" 459 | }, 460 | "peerDependencies": { 461 | "typescript": "3.9.x || 4.0.x || 4.1.x || 4.2.x" 462 | } 463 | }, 464 | "node_modules/typedoc-default-themes": { 465 | "version": "0.12.10", 466 | "resolved": "https://registry.npmjs.org/typedoc-default-themes/-/typedoc-default-themes-0.12.10.tgz", 467 | "integrity": "sha512-fIS001cAYHkyQPidWXmHuhs8usjP5XVJjWB8oZGqkTowZaz3v7g3KDZeeqE82FBrmkAnIBOY3jgy7lnPnqATbA==", 468 | "engines": { 469 | "node": ">= 8" 470 | } 471 | }, 472 | "node_modules/typescript": { 473 | "version": "4.2.4", 474 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.4.tgz", 475 | "integrity": "sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==", 476 | "bin": { 477 | "tsc": "bin/tsc", 478 | "tsserver": "bin/tsserver" 479 | }, 480 | "engines": { 481 | "node": ">=4.2.0" 482 | } 483 | }, 484 | "node_modules/uglify-js": { 485 | "version": "3.13.5", 486 | "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.13.5.tgz", 487 | "integrity": "sha512-xtB8yEqIkn7zmOyS2zUNBsYCBRhDkvlNxMMY2smuJ/qA8NCHeQvKCF3i9Z4k8FJH4+PJvZRtMrPynfZ75+CSZw==", 488 | "optional": true, 489 | "bin": { 490 | "uglifyjs": "bin/uglifyjs" 491 | }, 492 | "engines": { 493 | "node": ">=0.8.0" 494 | } 495 | }, 496 | "node_modules/universalify": { 497 | "version": "2.0.0", 498 | "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", 499 | "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", 500 | "engines": { 501 | "node": ">= 10.0.0" 502 | } 503 | }, 504 | "node_modules/vscode-textmate": { 505 | "version": "5.4.0", 506 | "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-5.4.0.tgz", 507 | "integrity": "sha512-c0Q4zYZkcLizeYJ3hNyaVUM2AA8KDhNCA3JvXY8CeZSJuBdAy3bAvSbv46RClC4P3dSO9BdwhnKEx2zOo6vP/w==" 508 | }, 509 | "node_modules/wordwrap": { 510 | "version": "1.0.0", 511 | "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", 512 | "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=" 513 | }, 514 | "node_modules/wrappy": { 515 | "version": "1.0.2", 516 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", 517 | "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" 518 | }, 519 | "node_modules/yallist": { 520 | "version": "3.1.1", 521 | "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", 522 | "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" 523 | } 524 | }, 525 | "dependencies": { 526 | "@rollup/plugin-replace": { 527 | "version": "2.3.3", 528 | "resolved": "https://registry.npmjs.org/@rollup/plugin-replace/-/plugin-replace-2.3.3.tgz", 529 | "integrity": "sha512-XPmVXZ7IlaoWaJLkSCDaa0Y6uVo5XQYHhiMFzOd5qSv5rE+t/UJToPIOE56flKIxBFQI27ONsxb7dqHnwSsjKQ==", 530 | "dev": true, 531 | "requires": { 532 | "@rollup/pluginutils": "^3.0.8", 533 | "magic-string": "^0.25.5" 534 | } 535 | }, 536 | "@rollup/plugin-typescript": { 537 | "version": "5.0.2", 538 | "resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-5.0.2.tgz", 539 | "integrity": "sha512-CkS028Itwjqm1uLbFVfpJgtVtnNvZ+og/m6UlNRR5wOOnNTWPcVQzOu5xGdEX+WWJxdvWIqUq2uR/RBt2ZipWg==", 540 | "dev": true, 541 | "requires": { 542 | "@rollup/pluginutils": "^3.0.1", 543 | "resolve": "^1.14.1" 544 | } 545 | }, 546 | "@rollup/pluginutils": { 547 | "version": "3.1.0", 548 | "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz", 549 | "integrity": "sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==", 550 | "dev": true, 551 | "requires": { 552 | "@types/estree": "0.0.39", 553 | "estree-walker": "^1.0.1", 554 | "picomatch": "^2.2.2" 555 | } 556 | }, 557 | "@types/estree": { 558 | "version": "0.0.39", 559 | "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", 560 | "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", 561 | "dev": true 562 | }, 563 | "at-least-node": { 564 | "version": "1.0.0", 565 | "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", 566 | "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==" 567 | }, 568 | "balanced-match": { 569 | "version": "1.0.2", 570 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", 571 | "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" 572 | }, 573 | "brace-expansion": { 574 | "version": "1.1.11", 575 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", 576 | "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", 577 | "requires": { 578 | "balanced-match": "^1.0.0", 579 | "concat-map": "0.0.1" 580 | } 581 | }, 582 | "colors": { 583 | "version": "1.4.0", 584 | "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", 585 | "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==" 586 | }, 587 | "concat-map": { 588 | "version": "0.0.1", 589 | "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", 590 | "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" 591 | }, 592 | "estree-walker": { 593 | "version": "1.0.1", 594 | "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz", 595 | "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==", 596 | "dev": true 597 | }, 598 | "expression-globals-typescript": { 599 | "version": "3.2.5", 600 | "resolved": "https://registry.npmjs.org/expression-globals-typescript/-/expression-globals-typescript-3.2.5.tgz", 601 | "integrity": "sha512-ihtEfov+kGRMLaufssxjLnfiaLrM+WeEt9syNzHc7Z84HO2IkIxUj3Na8NBngFsGl3j2hCMJCyDtR4A1WVCtxg==", 602 | "requires": { 603 | "typedoc": "^0.20.34" 604 | } 605 | }, 606 | "fs-extra": { 607 | "version": "9.1.0", 608 | "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", 609 | "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", 610 | "requires": { 611 | "at-least-node": "^1.0.0", 612 | "graceful-fs": "^4.2.0", 613 | "jsonfile": "^6.0.1", 614 | "universalify": "^2.0.0" 615 | } 616 | }, 617 | "fs.realpath": { 618 | "version": "1.0.0", 619 | "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", 620 | "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" 621 | }, 622 | "fsevents": { 623 | "version": "2.1.3", 624 | "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", 625 | "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", 626 | "dev": true, 627 | "optional": true 628 | }, 629 | "glob": { 630 | "version": "7.1.7", 631 | "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", 632 | "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", 633 | "requires": { 634 | "fs.realpath": "^1.0.0", 635 | "inflight": "^1.0.4", 636 | "inherits": "2", 637 | "minimatch": "^3.0.4", 638 | "once": "^1.3.0", 639 | "path-is-absolute": "^1.0.0" 640 | } 641 | }, 642 | "graceful-fs": { 643 | "version": "4.2.6", 644 | "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz", 645 | "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==" 646 | }, 647 | "handlebars": { 648 | "version": "4.7.7", 649 | "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", 650 | "integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==", 651 | "requires": { 652 | "minimist": "^1.2.5", 653 | "neo-async": "^2.6.0", 654 | "source-map": "^0.6.1", 655 | "uglify-js": "^3.1.4", 656 | "wordwrap": "^1.0.0" 657 | } 658 | }, 659 | "inflight": { 660 | "version": "1.0.6", 661 | "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", 662 | "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", 663 | "requires": { 664 | "once": "^1.3.0", 665 | "wrappy": "1" 666 | } 667 | }, 668 | "inherits": { 669 | "version": "2.0.4", 670 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 671 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" 672 | }, 673 | "interpret": { 674 | "version": "1.4.0", 675 | "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", 676 | "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==" 677 | }, 678 | "jsonfile": { 679 | "version": "6.1.0", 680 | "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", 681 | "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", 682 | "requires": { 683 | "graceful-fs": "^4.1.6", 684 | "universalify": "^2.0.0" 685 | } 686 | }, 687 | "lodash": { 688 | "version": "4.17.21", 689 | "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", 690 | "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" 691 | }, 692 | "lru-cache": { 693 | "version": "5.1.1", 694 | "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", 695 | "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", 696 | "requires": { 697 | "yallist": "^3.0.2" 698 | } 699 | }, 700 | "lunr": { 701 | "version": "2.3.9", 702 | "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", 703 | "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==" 704 | }, 705 | "magic-string": { 706 | "version": "0.25.7", 707 | "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz", 708 | "integrity": "sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==", 709 | "dev": true, 710 | "requires": { 711 | "sourcemap-codec": "^1.4.4" 712 | } 713 | }, 714 | "marked": { 715 | "version": "2.0.3", 716 | "resolved": "https://registry.npmjs.org/marked/-/marked-2.0.3.tgz", 717 | "integrity": "sha512-5otztIIcJfPc2qGTN8cVtOJEjNJZ0jwa46INMagrYfk0EvqtRuEHLsEe0LrFS0/q+ZRKT0+kXK7P2T1AN5lWRA==" 718 | }, 719 | "minimatch": { 720 | "version": "3.0.4", 721 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", 722 | "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", 723 | "requires": { 724 | "brace-expansion": "^1.1.7" 725 | } 726 | }, 727 | "minimist": { 728 | "version": "1.2.5", 729 | "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", 730 | "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" 731 | }, 732 | "neo-async": { 733 | "version": "2.6.2", 734 | "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", 735 | "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==" 736 | }, 737 | "once": { 738 | "version": "1.4.0", 739 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", 740 | "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", 741 | "requires": { 742 | "wrappy": "1" 743 | } 744 | }, 745 | "onigasm": { 746 | "version": "2.2.5", 747 | "resolved": "https://registry.npmjs.org/onigasm/-/onigasm-2.2.5.tgz", 748 | "integrity": "sha512-F+th54mPc0l1lp1ZcFMyL/jTs2Tlq4SqIHKIXGZOR/VkHkF9A7Fr5rRr5+ZG/lWeRsyrClLYRq7s/yFQ/XhWCA==", 749 | "requires": { 750 | "lru-cache": "^5.1.1" 751 | } 752 | }, 753 | "path-is-absolute": { 754 | "version": "1.0.1", 755 | "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", 756 | "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" 757 | }, 758 | "path-parse": { 759 | "version": "1.0.6", 760 | "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", 761 | "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==" 762 | }, 763 | "picomatch": { 764 | "version": "2.2.2", 765 | "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", 766 | "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", 767 | "dev": true 768 | }, 769 | "prettier": { 770 | "version": "1.19.1", 771 | "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz", 772 | "integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==", 773 | "dev": true 774 | }, 775 | "progress": { 776 | "version": "2.0.3", 777 | "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", 778 | "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==" 779 | }, 780 | "rechoir": { 781 | "version": "0.6.2", 782 | "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", 783 | "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", 784 | "requires": { 785 | "resolve": "^1.1.6" 786 | } 787 | }, 788 | "resolve": { 789 | "version": "1.17.0", 790 | "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", 791 | "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", 792 | "requires": { 793 | "path-parse": "^1.0.6" 794 | } 795 | }, 796 | "rollup": { 797 | "version": "2.27.1", 798 | "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.27.1.tgz", 799 | "integrity": "sha512-GiWHQvnmMgBktSpY/1+nrGpwPsTw4b9P28og2uedfeq4JZ16rzAmnQ5Pm/E0/BEmDNia1ZbY7+qu3nBgNa19Hg==", 800 | "dev": true, 801 | "requires": { 802 | "fsevents": "~2.1.2" 803 | } 804 | }, 805 | "rollup-plugin-ae-jsx": { 806 | "version": "2.0.0", 807 | "resolved": "https://registry.npmjs.org/rollup-plugin-ae-jsx/-/rollup-plugin-ae-jsx-2.0.0.tgz", 808 | "integrity": "sha512-yj29W+kNy8K7dN3PypZLps4B2pMma5TnJbS1WiLpOQzqXpXepNehhs5J6EAsAqldIiqKXFf6RpNYLNr8llo4zA==", 809 | "dev": true, 810 | "requires": { 811 | "estree-walker": "^2.0.1", 812 | "magic-string": "^0.25.7" 813 | }, 814 | "dependencies": { 815 | "estree-walker": { 816 | "version": "2.0.1", 817 | "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.1.tgz", 818 | "integrity": "sha512-tF0hv+Yi2Ot1cwj9eYHtxC0jB9bmjacjQs6ZBTj82H8JwUywFuc+7E83NWfNMwHXZc11mjfFcVXPe9gEP4B8dg==", 819 | "dev": true 820 | } 821 | } 822 | }, 823 | "shelljs": { 824 | "version": "0.8.4", 825 | "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.4.tgz", 826 | "integrity": "sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ==", 827 | "requires": { 828 | "glob": "^7.0.0", 829 | "interpret": "^1.0.0", 830 | "rechoir": "^0.6.2" 831 | } 832 | }, 833 | "shiki": { 834 | "version": "0.9.3", 835 | "resolved": "https://registry.npmjs.org/shiki/-/shiki-0.9.3.tgz", 836 | "integrity": "sha512-NEjg1mVbAUrzRv2eIcUt3TG7X9svX7l3n3F5/3OdFq+/BxUdmBOeKGiH4icZJBLHy354Shnj6sfBTemea2e7XA==", 837 | "requires": { 838 | "onigasm": "^2.2.5", 839 | "vscode-textmate": "^5.2.0" 840 | } 841 | }, 842 | "source-map": { 843 | "version": "0.6.1", 844 | "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", 845 | "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" 846 | }, 847 | "sourcemap-codec": { 848 | "version": "1.4.8", 849 | "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", 850 | "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", 851 | "dev": true 852 | }, 853 | "tslib": { 854 | "version": "2.0.1", 855 | "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.1.tgz", 856 | "integrity": "sha512-SgIkNheinmEBgx1IUNirK0TUD4X9yjjBRTqqjggWCU3pUEqIk3/Uwl3yRixYKT6WjQuGiwDv4NomL3wqRCj+CQ==", 857 | "dev": true 858 | }, 859 | "typedoc": { 860 | "version": "0.20.36", 861 | "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.20.36.tgz", 862 | "integrity": "sha512-qFU+DWMV/hifQ9ZAlTjdFO9wbUIHuUBpNXzv68ZyURAP9pInjZiO4+jCPeAzHVcaBCHER9WL/+YzzTt6ZlN/Nw==", 863 | "requires": { 864 | "colors": "^1.4.0", 865 | "fs-extra": "^9.1.0", 866 | "handlebars": "^4.7.7", 867 | "lodash": "^4.17.21", 868 | "lunr": "^2.3.9", 869 | "marked": "^2.0.3", 870 | "minimatch": "^3.0.0", 871 | "progress": "^2.0.3", 872 | "shelljs": "^0.8.4", 873 | "shiki": "^0.9.3", 874 | "typedoc-default-themes": "^0.12.10" 875 | } 876 | }, 877 | "typedoc-default-themes": { 878 | "version": "0.12.10", 879 | "resolved": "https://registry.npmjs.org/typedoc-default-themes/-/typedoc-default-themes-0.12.10.tgz", 880 | "integrity": "sha512-fIS001cAYHkyQPidWXmHuhs8usjP5XVJjWB8oZGqkTowZaz3v7g3KDZeeqE82FBrmkAnIBOY3jgy7lnPnqATbA==" 881 | }, 882 | "typescript": { 883 | "version": "4.2.4", 884 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.4.tgz", 885 | "integrity": "sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==" 886 | }, 887 | "uglify-js": { 888 | "version": "3.13.5", 889 | "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.13.5.tgz", 890 | "integrity": "sha512-xtB8yEqIkn7zmOyS2zUNBsYCBRhDkvlNxMMY2smuJ/qA8NCHeQvKCF3i9Z4k8FJH4+PJvZRtMrPynfZ75+CSZw==", 891 | "optional": true 892 | }, 893 | "universalify": { 894 | "version": "2.0.0", 895 | "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", 896 | "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==" 897 | }, 898 | "vscode-textmate": { 899 | "version": "5.4.0", 900 | "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-5.4.0.tgz", 901 | "integrity": "sha512-c0Q4zYZkcLizeYJ3hNyaVUM2AA8KDhNCA3JvXY8CeZSJuBdAy3bAvSbv46RClC4P3dSO9BdwhnKEx2zOo6vP/w==" 902 | }, 903 | "wordwrap": { 904 | "version": "1.0.0", 905 | "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", 906 | "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=" 907 | }, 908 | "wrappy": { 909 | "version": "1.0.2", 910 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", 911 | "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" 912 | }, 913 | "yallist": { 914 | "version": "3.1.1", 915 | "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", 916 | "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" 917 | } 918 | } 919 | } 920 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "aefunctions", 3 | "version": "2.0.3", 4 | "description": "Speed up your After Effects expression writing with a library of useful functions", 5 | "main": "dist/aefunctions.jsx", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "tsc": "tsc", 9 | "build": "rollup -c", 10 | "watch": "rollup -cw", 11 | "release": "npm run build && npm run docs && gh release create $npm_package_version $(node -pe \"require('./package.json').main\")", 12 | "docs": "typedoc --json docs/aefunctions.json src/index.ts", 13 | "log": "node -pe \"require('./package.json').main\"" 14 | }, 15 | "repository": { 16 | "type": "git", 17 | "url": "git+https://github.com/motiondeveloper/aefunctions.git" 18 | }, 19 | "author": "Tim Haywood", 20 | "license": "MIT", 21 | "bugs": { 22 | "url": "https://github.com/motiondeveloper/aefunctions/issues" 23 | }, 24 | "homepage": "https://github.com/motiondeveloper/aefunctions#readme", 25 | "devDependencies": { 26 | "@rollup/plugin-replace": "^2.3.3", 27 | "@rollup/plugin-typescript": "^5.0.2", 28 | "prettier": "^1.16.4", 29 | "rollup": "^2.27.1", 30 | "rollup-plugin-ae-jsx": "^2.0.0", 31 | "tslib": "^2.0.1", 32 | "typedoc": "^0.20.36", 33 | "typescript": "^4.2.4" 34 | }, 35 | "dependencies": { 36 | "expression-globals-typescript": "^3.2.5" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /prettier.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | trailingComma: 'es5', 3 | singleQuote: true 4 | } -------------------------------------------------------------------------------- /rollup.config.js: -------------------------------------------------------------------------------- 1 | import typescript from '@rollup/plugin-typescript'; 2 | import replace from '@rollup/plugin-replace'; 3 | import afterEffectJsx from 'rollup-plugin-ae-jsx'; 4 | import pkg from './package.json'; 5 | 6 | export default { 7 | input: 'src/index.ts', 8 | output: { 9 | file: pkg.main, 10 | format: 'es', 11 | }, 12 | external: Object.keys(pkg.dependencies), 13 | plugins: [ 14 | replace({ 15 | _npmVersion: pkg.version, 16 | }), 17 | typescript(), 18 | afterEffectJsx(), 19 | ], 20 | }; 21 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | import { 2 | PathProperty, 3 | Layer, 4 | Comp, 5 | Vector, 6 | Points, 7 | Vector2D, 8 | PathValue, 9 | Value, 10 | SourceRect, 11 | Property, 12 | } from 'expression-globals-typescript'; 13 | 14 | const thisProperty = new PathProperty([[0, 0]]); 15 | const thisLayer = new Layer(); 16 | const thisComp = new Comp(); 17 | 18 | function getFunctions(time: number = thisLayer.time) { 19 | /** 20 | * @param funcName The name of the function throwing the error 21 | * @param errors The rest of the arguments are joined as lines into the returned error string 22 | */ 23 | function funcError(funcName: string, ...errors: string[]) { 24 | return new Error(`in function ${funcName}.\n\n${errors.join('\n')}`); 25 | } 26 | function list(list: string[]) { 27 | return list.map(item => `\n- ${item}`); 28 | } 29 | /** 30 | * @param inKeys The number of keyframes to attach to the `inPoint` 31 | * @param outKeys The number of keyframes to attach to the `outPoint` 32 | * @returns A retimed version of the animation where the in and out animation move with the layer start and end times 33 | */ 34 | function attachKeys(inKeys: number = 2, outKeys: number = 2) { 35 | if (inKeys >= 1 && outKeys >= 1) { 36 | // There is in and out animation 37 | const outStart = 38 | thisLayer.outPoint - 39 | (thisProperty.key(thisProperty.numKeys).time - 40 | thisProperty.key(thisProperty.numKeys - outKeys).time); 41 | const inFinish = 42 | thisLayer.inPoint + 43 | (thisProperty.key(inKeys).time - thisProperty.key(1).time); 44 | 45 | if (time < thisLayer.inPoint) { 46 | return thisProperty.key(1).value; 47 | } else if (time < inFinish) { 48 | return thisProperty.valueAtTime( 49 | thisProperty.key(1).time + (time - thisLayer.inPoint) 50 | ); 51 | } else if (time < outStart) { 52 | return thisProperty.key(inKeys).value; 53 | } else { 54 | return thisProperty.valueAtTime( 55 | thisProperty.key(thisProperty.numKeys - outKeys).time + 56 | time - 57 | outStart 58 | ); 59 | } 60 | } else if (inKeys == 0 && outKeys >= 2) { 61 | // Animation out only 62 | const outStart = 63 | thisLayer.outPoint - 64 | (thisProperty.key(outKeys).time - thisProperty.key(1).time); 65 | 66 | if (time < outStart) { 67 | return thisProperty.key(1).value; 68 | } else { 69 | return thisProperty.valueAtTime( 70 | thisProperty.key(1).time + time - outStart 71 | ); 72 | } 73 | } else if (inKeys >= 2 && outKeys == 0) { 74 | // Animation in only 75 | const inFinish = 76 | thisLayer.inPoint + 77 | (thisProperty.key(inKeys).time - thisProperty.key(1).time); 78 | 79 | if (time < thisLayer.inPoint) { 80 | return thisProperty.key(1).value; 81 | } else if (time < inFinish) { 82 | return thisProperty.valueAtTime( 83 | thisProperty.key(1).time + (time - thisLayer.inPoint) 84 | ); 85 | } else { 86 | return thisProperty.key(inKeys).value; 87 | } 88 | } else { 89 | // Default option if no range specified 90 | return thisProperty.value; 91 | } 92 | } 93 | 94 | /** 95 | * For better bouncing, use our dedicated library eSpring: https://www.motiondeveloper.com/tools/espring 96 | * @param amp The amount of swing past each value 97 | * @param freq How fast the swing oscillates 98 | * @param decay Hoq quickly the swings reduce in value over time 99 | * @param keyMin Keyframes after this index will bounce 100 | * @param keyMax Keyframe before this index will bounce 101 | * @returns The property value with bounce animation between the given keyframes 102 | */ 103 | function bounceKeys( 104 | amp = 0.12, 105 | freq = 2.5, 106 | decay = 8, 107 | keyMin = 1, 108 | keyMax = thisProperty.numKeys 109 | ) { 110 | let curKey = 0; 111 | let t = 0; 112 | 113 | // Set curKey to the previous keyframe 114 | if (thisProperty.numKeys > 0) { 115 | curKey = thisProperty.nearestKey(time).index; 116 | if (thisProperty.key(curKey).time > time) { 117 | curKey--; 118 | } 119 | } 120 | 121 | // Set t to the time to curKey 122 | if (curKey !== 0) { 123 | t = time - thisProperty.key(curKey).time; 124 | } 125 | 126 | if (curKey > 0 && curKey >= keyMin && curKey <= keyMax && t < 3) { 127 | let velocity = thisProperty.velocityAtTime( 128 | thisProperty.key(curKey).time - thisComp.frameDuration / 10 129 | ) as Vector; 130 | return thisLayer.add( 131 | thisProperty.value as Vector, 132 | thisLayer.mul( 133 | velocity, 134 | (amp * Math.sin(freq * t * 2 * Math.PI)) / Math.exp(decay * t) 135 | ) 136 | ); 137 | } else { 138 | return thisProperty.value; 139 | } 140 | } 141 | 142 | /** 143 | * 144 | * @param points The array of points to create the path from 145 | * @param closed Whether to close the path 146 | * @returns A path object of the given points in composition space 147 | */ 148 | function getPathFromPoints(points: Points, closed = true) { 149 | const pathPoints: Points = points.map( 150 | item => thisLayer.fromCompToSurface(item) as Vector2D 151 | ); 152 | return thisProperty.createPath(pathPoints, [], [], closed); 153 | } 154 | 155 | /** 156 | * 157 | * @param options.rows The total number of rows 158 | * @param options.columns The total number of columns 159 | * @param options.rowNum Which row to get the points for, 1 indexed 160 | * @param options.columnNum Which column to get the points for, 1 indexed 161 | * @param options.gridSize The total size of the whole grid 162 | * @returns The points of the four corners of a cell in a given grid 163 | */ 164 | function gridPoints({ 165 | rows = 3, 166 | columns = 3, 167 | rowNum = 1, 168 | columnNum = 1, 169 | gridSize = [thisComp.width, thisComp.height], 170 | }) { 171 | const columnWidth = gridSize[0] / columns; 172 | const rowHeight = gridSize[1] / rows; 173 | 174 | const topLeft: Vector = [ 175 | columnWidth * (columnNum - 1), 176 | rowHeight * (rowNum - 1), 177 | ]; 178 | const topRight: Vector = thisLayer.add(topLeft, [columnWidth, 0]); 179 | 180 | const bottomLeft: Vector = thisLayer.add(topLeft, [0, rowHeight]); 181 | const bottomRight: Vector = thisLayer.add(topRight, [0, rowHeight]); 182 | 183 | return [topLeft, topRight, bottomRight, bottomLeft]; 184 | } 185 | 186 | /** 187 | * 188 | * @param layerIndex Which layer to hide below, defaulting to the layer above 189 | * @returns An opacity value that's zero when below the given layer 190 | */ 191 | function hideLayerWhenBelow(layerIndex = thisLayer.index - 1) { 192 | try { 193 | const aboveLayer = thisComp.layer(layerIndex); 194 | return time < aboveLayer.inPoint ? 100 : 0; 195 | } catch (err) { 196 | // Layer is first layer 197 | return 100; 198 | } 199 | } 200 | 201 | /** 202 | * 203 | * @param position The position value to transform 204 | * @param offset Offsets the given value in non-isometric space 205 | * @returns Transforms a given position value along an isometric axis 206 | */ 207 | function getIsometricPosition(position: Vector2D, offset: Vector = [0, 0]) { 208 | const xGrid = position[0]; 209 | const yGrid = position[1]; 210 | 211 | const x = xGrid * 1.75 - yGrid; 212 | const y = xGrid + yGrid / 1.75; 213 | 214 | return thisLayer.add(offset, [x, y]); 215 | } 216 | 217 | /** 218 | * For a more complicated box path setup, it's better to use our library eBox in conjunction with the `layerRect` function 219 | * @param buffer The space between the edge of the layer and the returned path 220 | * @param sourceLayer The layer to get the size of 221 | * @param extend Whether to include layer extents 222 | * @param sampleTime The time to sample the layer at 223 | * @returns A box path that follows the layer bounds 224 | */ 225 | function getLayerBoundsPath( 226 | buffer = 0, 227 | sourceLayer = thisLayer, 228 | extend = false, 229 | sampleTime = time 230 | ) { 231 | const layerWidth = sourceLayer.sourceRectAtTime(sampleTime, extend).width; 232 | const layerHeight = sourceLayer.sourceRectAtTime(sampleTime, extend).height; 233 | const layerTop = sourceLayer.sourceRectAtTime(sampleTime, extend).top; 234 | const layerLeft = sourceLayer.sourceRectAtTime(sampleTime, extend).left; 235 | 236 | const maskPoints: Points = [ 237 | [layerLeft - buffer, layerTop - buffer], 238 | [layerLeft + layerWidth + buffer, layerTop - buffer], 239 | [layerLeft + layerWidth + buffer, layerTop + layerHeight + buffer], 240 | [layerLeft - buffer, layerTop + layerHeight + buffer], 241 | ]; 242 | 243 | return thisProperty.createPath(maskPoints, [], [], true); 244 | } 245 | 246 | /** 247 | * 248 | * @param layerIndex The index of the layer to get the size of 249 | * @param sampleTime When in time to get the size 250 | * @returns The size of the layer as an array 251 | */ 252 | function layerSize(layerIndex: number = thisLayer.index, sampleTime = time) { 253 | const layerSize = [ 254 | thisComp.layer(layerIndex).sourceRectAtTime(sampleTime, false).width, 255 | thisComp.layer(layerIndex).sourceRectAtTime(sampleTime, false).height, 256 | ]; 257 | return layerSize; 258 | } 259 | 260 | type Anchor = 261 | | 'center' 262 | | 'topLeft' 263 | | 'topRight' 264 | | 'bottomRight' 265 | | 'bottomLeft' 266 | | 'topCenter' 267 | | 'rightCenter' 268 | | 'bottomCenter' 269 | | 'leftCenter'; 270 | 271 | type LayerRectProps = { 272 | layer: Layer; 273 | sampleTime: number; 274 | anchor: Anchor; 275 | xHeight: boolean; 276 | }; 277 | 278 | /** 279 | * 280 | * @param options.layer The layer to get the properties of, defaulting to the current layer 281 | * @param options.sampleTime When in time to get the layers properties 282 | * @param options.anchor Which point in the layer to get the position of 283 | * @param options.xHeight Whether to get the descenderless height value, defaults to true if `options.layer` is a text layer 284 | * @returns An object with the layers size and position from `sourceRectAtTime`, as well as the sourceRect itself: `{ size, position, sourceRect }` 285 | */ 286 | function layerRect({ 287 | layer = thisLayer, 288 | sampleTime = time, 289 | anchor = 'center', 290 | xHeight = true, 291 | }: LayerRectProps): { 292 | position: Vector; 293 | size: Vector; 294 | sourceRect: SourceRect; 295 | } { 296 | const sourceRect = layer.sourceRectAtTime(sampleTime, false); 297 | let { width, height, top, left } = sourceRect; 298 | let topLeft: Vector2D = [left, top]; 299 | 300 | if (layer.text && xHeight) { 301 | const { fontSize, leading, autoLeading } = layer.text.sourceText.style; 302 | const lineGap = autoLeading ? fontSize * 1.2 : leading; 303 | const textSize = fontSize / 2; 304 | const numLines = textCount(layer.text.sourceText.value, 'line'); 305 | height = lineGap * (numLines - 1) + textSize; 306 | topLeft = [left, -textSize]; 307 | } 308 | 309 | const positions: { [key in Anchor]: Vector } = { 310 | topLeft: topLeft, 311 | topRight: thisLayer.add(topLeft, [width, 0]), 312 | topCenter: thisLayer.add(topLeft, [width / 2, 0]), 313 | bottomCenter: thisLayer.add(topLeft, [width / 2, height]), 314 | bottomLeft: thisLayer.add(topLeft, [0, height]), 315 | bottomRight: thisLayer.add(topLeft, [width, height]), 316 | center: thisLayer.add(topLeft, [width / 2, height / 2]), 317 | leftCenter: thisLayer.add(topLeft, [0, height / 2]), 318 | rightCenter: thisLayer.add(topLeft, [width, height / 2]), 319 | }; 320 | 321 | const position = positions[anchor]; 322 | 323 | const onOwnLayer = layer === thisLayer; 324 | return { 325 | size: [width, height], 326 | position: onOwnLayer ? position : layer.toComp(position), 327 | sourceRect: sourceRect, 328 | }; 329 | } 330 | 331 | /** 332 | * 333 | * @param sourceText The string to count 334 | * @param type What to count, either `'word'`, `'line'`, or `'char'` 335 | * @returns The number of the given type 336 | */ 337 | function textCount(sourceText: string, type: string = 'word') { 338 | if (typeof sourceText !== 'string') { 339 | const valueHint = 340 | typeof sourceText === 'function' && 341 | `\n\nDid you mean sourceText.value?`; 342 | throw funcError( 343 | `textCount`, 344 | `Invalid value for sourceText.`, 345 | `Value must be a string, received ${typeof sourceText}.${valueHint || 346 | ''}` 347 | ); 348 | } 349 | const counts: { 350 | [key: string]: (text: string) => number; 351 | } = { 352 | word: text => text.split(' ').length, 353 | line: text => Math.max(text.split(/[^\r\n\3]*/gm).length - 1, 0), 354 | char: text => text.length, 355 | }; 356 | 357 | if (!counts[type]) { 358 | throw funcError( 359 | `textCount`, 360 | `Invalid type: ${type}.\nValid types are: word, line, char` 361 | ); 362 | } 363 | return counts[type](sourceText); 364 | } 365 | 366 | /** 367 | * 368 | * @param inputNum The number to add commas to 369 | * @returns The number with commas, e.g. `10,000` 370 | */ 371 | function commaNum(inputNum: number) { 372 | // Expression courtesy of Dab Ebberts 373 | let number = '' + Math.round(inputNum); 374 | if (number.length > 3) { 375 | const mod = number.length % 3; 376 | let output = mod > 0 ? number.substring(0, mod) : ''; 377 | for (let i = 0; i < Math.floor(number.length / 3); i++) { 378 | if (mod == 0 && i == 0) { 379 | output += number.substring(mod + 3 * i, mod + 3 * i + 3); 380 | } else { 381 | output += ',' + number.substring(mod + 3 * i, mod + 3 * i + 3); 382 | } 383 | } 384 | return output; 385 | } else { 386 | return number; 387 | } 388 | } 389 | 390 | /** 391 | * 392 | * @param string The string to limit 393 | * @param maxLines The number of lines to limit to 394 | * @param maxCharacters The max characters per line 395 | * @returns The given string trimmed according to the `maxLines` and `maxCharacters` 396 | */ 397 | function cleanLines(string: string, maxLines: number, maxCharacters: number) { 398 | const lines = string.split(/[\r\n\3]+/g); 399 | const limitedLines = lines.map(item => { 400 | return item.replace(/^\s+|\s+$/g, '').substring(0, maxCharacters); 401 | }); 402 | 403 | return limitedLines.slice(0, maxLines + 1).join('\n'); 404 | } 405 | 406 | /** 407 | * @deprecated Use `layerRect` to get the descenderless height instead 408 | * @param string 409 | * @param hideTime Where to hide in time, defaulting to `-500` 410 | * @returns Hides a descenderless version of the given string in negative time 411 | */ 412 | function hideDescenders( 413 | string: string = thisProperty.value as string, 414 | hideTime = -500 415 | ) { 416 | const numLines = textCount(string, 'line'); 417 | const descenderFreeLines = 'X\r'.repeat(numLines - 1) + 'X'; 418 | return time < hideTime ? descenderFreeLines : string; 419 | } 420 | 421 | /** 422 | * 423 | * @returns The keyframes on the current property as an array 424 | */ 425 | function getKeyframesAsArray() { 426 | let keys = []; 427 | for (let i = 1; i <= thisProperty.numKeys; i++) { 428 | const thisKey = { 429 | time: thisProperty.key(i).time, 430 | value: thisProperty.key(i).value, 431 | }; 432 | keys.push(thisKey); 433 | } 434 | return keys; 435 | } 436 | 437 | /** 438 | * 439 | * @param radius The radius of the circle 440 | * @param revolutionTime How long it takes to complete 1 revolution 441 | * @param startAngle The angle to start from 442 | * @returns A position value that animates along the circumference of a circle 443 | */ 444 | function circularMotion(radius = 200, revolutionTime = 1, startAngle = -90) { 445 | const startRadians = thisLayer.degreesToRadians(startAngle); 446 | const angularSpeed = (2 * Math.PI) / revolutionTime; 447 | const xt = radius * Math.cos(angularSpeed * time + startRadians); 448 | const yt = radius * Math.sin(angularSpeed * time + startRadians); 449 | return [xt, yt]; 450 | } 451 | 452 | /** 453 | * 454 | * @param radius The radius of the circle 455 | * @param angle The angle to get the position at, in degrees 456 | * @returns A point along the circumference of a circle 457 | */ 458 | function circularPosition(radius: number, angle: number) { 459 | // Algorithm courtesy of Xinlai Ni 460 | const startAngle = thisLayer.degreesToRadians(angle - 90); 461 | const xt = radius * Math.cos(startAngle); 462 | const yt = radius * Math.sin(startAngle); 463 | return [xt, yt]; 464 | } 465 | 466 | /** 467 | * 468 | * @param length The time to countdown from in seconds 469 | * @param speed How fast to countdown as a multiple of time` 470 | * @returns A string of a countdown timer, .e.g. MM:SS 471 | */ 472 | function countdown( 473 | length = thisLayer.outPoint - thisLayer.inPoint, 474 | speed = 1 475 | ) { 476 | const clockTime = Math.max(length - speed * (time - thisLayer.inPoint), 0); 477 | const clock = Math.floor(clockTime); 478 | const min = Math.floor((clock % 3600) / 60); 479 | const sec = Math.floor(clock % 60); 480 | return `${min}:${sec.toString().padStart(2, '0')}`; 481 | } 482 | 483 | /** 484 | * 485 | * @param inputSize The size of the object that needs to fit into a given area 486 | * @param maxSize The size of the area the object needs to fit into 487 | * @param toggles.onlyScaleDown Only scale down to fit 488 | * @param toggles.onlyScaleUp Only scale up to fit 489 | * @param toggles.uniform Scale x and y axis uniformly, defaults to true 490 | * @returns A scale value that will transform the `inputSize` to fit within `maxSize` 491 | */ 492 | function scaleToFit( 493 | inputSize: Vector2D, 494 | maxSize: Vector2D, 495 | toggles = { 496 | onlyScaleDown: false, 497 | onlyScaleUp: false, 498 | uniform: true, 499 | } 500 | ) { 501 | // Get scale needed to fit box 502 | let scaleFactorWidth = maxSize[0] / inputSize[0]; 503 | let scaleFactorHeight = maxSize[1] / inputSize[1]; 504 | 505 | // Uniform scaling 506 | let scaleFactor = Math.min(scaleFactorWidth, scaleFactorHeight); 507 | 508 | if (toggles.onlyScaleDown) { 509 | scaleFactor = Math.min(scaleFactor, 1); 510 | scaleFactorWidth = Math.min(scaleFactorWidth, 1); 511 | scaleFactorHeight = Math.min(scaleFactorHeight, 1); 512 | } 513 | 514 | if (toggles.onlyScaleUp) { 515 | scaleFactor = Math.max(scaleFactor, 1); 516 | scaleFactorWidth = Math.max(scaleFactorWidth, 1); 517 | scaleFactorHeight = Math.max(scaleFactorHeight, 1); 518 | } 519 | 520 | return toggles.uniform 521 | ? [100 * scaleFactor, 100 * scaleFactor] 522 | : [100 * scaleFactorWidth, 100 * scaleFactorHeight]; 523 | } 524 | 525 | /** 526 | * 527 | * @param string The input string to add line breaks to 528 | * @param maxCharacters The maximum number of characters per line 529 | * @returns A new string with line breaks inserted, so each line is within `maxCharacters` length 530 | */ 531 | function addLineBreaks(string: string, maxCharacters: number) { 532 | const splitRegex = new RegExp('(.{' + maxCharacters + '}[^ ]* )', 'g'); 533 | return string.replace(splitRegex, '$1\n'); 534 | } 535 | 536 | function hasAShortLine(string: string, minWords: number) { 537 | const lines = string.split('\n'); 538 | if (lines.length == 1) { 539 | return false; 540 | } 541 | for (let index = 0; index < lines.length; index++) { 542 | const line = lines[index]; 543 | const words = line.split(' '); 544 | if (words.length <= minWords) { 545 | return true; 546 | } 547 | } 548 | return false; 549 | } 550 | 551 | interface textBreakOption { 552 | minCharacters: number; 553 | characterStep: number; 554 | } 555 | 556 | /** 557 | * 558 | * @param string The input string to add line breaks to 559 | * @param maxCharacters The maximum characters in each line 560 | * @param minWords The minimum number of words in a line 561 | * @returns The given string with line breaks inserted, where each line has less than `maxCharacters`. If a line has less than the `minWords`, line breaks are inserted more often to avoid short lines. 562 | */ 563 | function breakWithoutOrphans( 564 | string: string, 565 | maxCharacters: number, 566 | minWords: number, 567 | options: textBreakOption = { 568 | minCharacters: 12, 569 | characterStep: 4, 570 | } 571 | ) { 572 | function smartBreak( 573 | string: string, 574 | maxCharacters: number, 575 | minWords: number, 576 | options: textBreakOption 577 | ): string { 578 | const brokenString = addLineBreaks(string, maxCharacters); 579 | if ( 580 | !hasAShortLine(brokenString, minWords) || 581 | maxCharacters < options.minCharacters 582 | ) { 583 | return brokenString; 584 | } 585 | return smartBreak( 586 | string, 587 | maxCharacters - options.characterStep, 588 | minWords, 589 | options 590 | ); 591 | } 592 | return smartBreak(string, maxCharacters, minWords, options); 593 | } 594 | 595 | /** 596 | * 597 | * @returns A scale value that will stay consistent regardless of the parent layers scale 598 | */ 599 | function maintainScale( 600 | parentLayer: Layer = thisLayer.parent as Layer 601 | ): Vector { 602 | if (typeof thisLayer.transform === 'undefined') { 603 | throw funcError( 604 | 'maintainScale', 605 | `Current layer (${thisLayer.name}) doesn't have transform values` 606 | ); 607 | } 608 | if (typeof parentLayer.transform === 'undefined') { 609 | throw funcError( 610 | 'maintainScale', 611 | `Parent layer (${thisLayer.name}) doesn't have transform values` 612 | ); 613 | } 614 | 615 | return thisLayer.transform.scale.value.map((scale, index) => 616 | // we need to check if scale is undefined, since typescript 617 | // doesn't know if this array element exists? 618 | scale 619 | ? (scale * 100) / (parentLayer.transform.scale.value[index] || 0) 620 | : 0 621 | ) as Vector; 622 | } 623 | 624 | /** 625 | * 626 | * @param position The position value to offset from 627 | * @param offset The amount to offset from the given `position` 628 | * @param anchor The direction to offset it, e.g. an anchor of 'topLeft' will offset towards the bottom right 629 | * @returns The given position value plus the offset, in the direction away from the given `anchor` 630 | */ 631 | function offsetFromAnchor( 632 | position: Vector2D, 633 | [offsetX, offsetY]: Vector2D, 634 | anchor: Anchor 635 | ): Vector2D { 636 | switch (anchor) { 637 | case 'topLeft': 638 | return thisLayer.add(position, [-offsetX, -offsetY]); 639 | case 'topRight': 640 | return thisLayer.add(position, [offsetX, -offsetY]); 641 | case 'bottomRight': 642 | return thisLayer.add(position, [offsetX, offsetY]); 643 | case 'bottomLeft': 644 | return thisLayer.add(position, [-offsetX, offsetY]); 645 | default: 646 | throw Error('Invalid anchor: ' + anchor); 647 | } 648 | } 649 | 650 | /** 651 | * Remaps the animation on a given property to new values and times, but keeps the easing 652 | * @param propertyWithAnimation The property that you've animated with the desired bezier curve 653 | * @param timeStart The start time of the new animaiton 654 | * @param valueStart The start value of the new animation 655 | * @param timeEnd The end time of the new animation 656 | * @param valueEnd The end value of the new animation 657 | */ 658 | function remapKeys( 659 | propertyWithAnimation: Property, 660 | timeStart: number, 661 | valueStart: number | Vector, 662 | timeEnd: number, 663 | valueEnd: number | Vector 664 | ) { 665 | // The keys of the bezier curve to use 666 | const keyOne = propertyWithAnimation.key(1); 667 | const keyTwo = propertyWithAnimation.key(2); 668 | 669 | // Get the difference in animation durations between the two 670 | // so we can match their durations 671 | const originalDuration = keyTwo.time - keyOne.time; 672 | const newDuration = timeEnd - timeStart; 673 | const speedDelta = originalDuration / newDuration; 674 | 675 | // Move the existing animation to the new one in time 676 | // And sample it at the desired speed 677 | const movedTime = Math.max(time * speedDelta - timeStart, 0); 678 | 679 | // The value that animates with the desired easing 680 | // at the desired speed, but original values 681 | const keyedAnimation = propertyWithAnimation.valueAtTime( 682 | keyOne.time + movedTime 683 | ); 684 | 685 | const valueDelta = thisLayer.sub(valueEnd, valueStart); 686 | 687 | // Animate between array values 688 | if ( 689 | Array.isArray(keyedAnimation) && 690 | Array.isArray(valueStart) && 691 | Array.isArray(valueEnd) 692 | ) { 693 | const progress = keyedAnimation.map((dimension, index) => 694 | thisLayer.linear( 695 | dimension, 696 | // We know these are vectors, since keyedAnimation 697 | // is an array 698 | (keyOne.value as Vector)[index], 699 | (keyTwo.value as Vector)[index], 700 | 0, 701 | 1 702 | ) 703 | ) as Vector; 704 | 705 | return valueStart.map( 706 | (dimension, index) => 707 | dimension + (valueDelta as Vector)[index] * progress[index] 708 | ); 709 | } 710 | 711 | // Animate between numbers 712 | 713 | if ( 714 | typeof keyedAnimation === 'number' && 715 | typeof keyOne.value === 'number' && 716 | typeof keyTwo.value === 'number' && 717 | typeof valueStart === 'number' && 718 | typeof valueEnd === 'number' && 719 | typeof valueDelta === 'number' 720 | ) { 721 | // Remap the keyed value to our new values 722 | const progress = thisLayer.linear( 723 | keyedAnimation, 724 | keyOne.value, 725 | keyTwo.value, 726 | 0, 727 | 1 728 | ) as number; 729 | 730 | return thisLayer.add(valueStart, thisLayer.mul(valueDelta, progress)); 731 | } 732 | } 733 | 734 | return { 735 | attachKeys, 736 | bounceKeys, 737 | getPathFromPoints, 738 | gridPoints, 739 | hideLayerWhenBelow, 740 | getIsometricPosition, 741 | getLayerBoundsPath, 742 | layerSize, 743 | layerRect, 744 | textCount, 745 | commaNum, 746 | cleanLines, 747 | hideDescenders, 748 | getKeyframesAsArray, 749 | circularMotion, 750 | circularPosition, 751 | countdown, 752 | scaleToFit, 753 | breakWithoutOrphans, 754 | maintainScale, 755 | offsetFromAnchor, 756 | addLineBreaks, 757 | remapKeys, 758 | }; 759 | } 760 | 761 | const version: string = '_npmVersion'; 762 | 763 | export { getFunctions, version }; 764 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "lib": "esnext", 3 | "compilerOptions": { 4 | "module": "esnext", 5 | "target": "esnext", 6 | "noImplicitAny": true, 7 | "removeComments": true, 8 | "moduleResolution": "node", 9 | "strict": true 10 | } 11 | } 12 | --------------------------------------------------------------------------------