diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000000..bf3241a2d9 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,12 @@ +# EditorConfig is awesome: http://EditorConfig.org + +root = true + +[*] +end_of_line = lf +insert_final_newline = true + +[*.{js,d.ts,json,html,md,sh}] +charset = utf-8 +indent_style = space +indent_size = 2 diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index e81efdc79b..0000000000 --- a/.eslintrc +++ /dev/null @@ -1,19 +0,0 @@ -{ - "extends": "./node_modules/fbjs-scripts/eslint/.eslintrc", - "rules": { - // These are functional errors that could either be fixed or be locally disabled in specific - // files - "no-bitwise": 0, - "constructor-super": 0, - "no-this-before-super": 0, - "no-self-compare": 0, - "operator-assignment": 0, - "consistent-return": 0, - - // These are stylistic errors that could be easily fixed - "semi": 0, - "comma-dangle": 0, - "space-before-function-paren": 0, - "curly": 0, - } -} diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 0000000000..17a489a8c3 --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1,2 @@ +# upgrade to prettier 3 +0355483c301dba5e215e2c3d113125a274444e38 diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 0000000000..936cae52b0 --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,105 @@ +# Have a question? + +Please ask questions on [Stack Overflow](https://stackoverflow.com/questions/tagged/immutable.js) instead of opening a Github Issue. There are more people on Stack Overflow who +can answer questions, and good answers can be searchable and canonical. + +# Issues + +We use GitHub issues to track bugs. Please ensure your bug description is clear +and has sufficient instructions to be able to reproduce the issue. + +The absolute best way to report a bug is to submit a pull request including a +new failing test which describes the bug. When the bug is fixed, your pull +request can then be merged! + +The next best way to report a bug is to provide a reduced test case on jsFiddle +or jsBin or produce exact code inline in the issue which will reproduce the bug. + +# Code of Conduct + +Immutable.js is maintained within the [Contributor Covenant's Code of Conduct](https://www.contributor-covenant.org/version/2/0/code_of_conduct/). + +# Pull Requests + +All active development of Immutable JS happens on GitHub. We actively welcome +your [pull requests](https://help.github.com/articles/creating-a-pull-request). + +1. Fork the repo and create your branch from `master`. +2. Install all dependencies. (`npm install`) +3. If you've added code, add tests. +4. If you've changed APIs, update the documentation. +5. Build generated JS, run tests and ensure your code passes lint. (`npm run test`) +6. If you haven't already, complete the Contributor License Agreement ("CLA"). + +## Documentation + +Documentation for Immutable.js (hosted at http://immutable-js.github.io/immutable-js) +is developed in `pages/`. Run `npm start` to get a local copy in your browser +while making edits. + +## Coding Style + +- 2 spaces for indentation (no tabs) +- 80 character line length strongly preferred. +- Prefer `'` over `"` +- ES6 Harmony when possible. +- Use semicolons; +- Trailing commas, +- Avd abbr wrds. + +# Functionality Testing + +Run the following command to build the library and test functionality: + +```bash +npm run test +``` + +## Performance Regression Testing + +Performance tests run against master and your feature branch. +Make sure to commit your changes in your local feature branch before proceeding. + +These commands assume you have a remote named `upstream` amd that you do not already have a local `master` branch: + +```bash +git fetch upstream +git checkout -b master upstream/master +``` + +These commands build `dist` and commit `dist/immutable.js` to `master` so that the regression tests can run. +```bash +npm run test +git add dist/immutable.js -f +git commit -m 'perf test prerequisite.' +``` + +Switch back to your feature branch, and run the following command to run regression tests: + +```bash +npm run test +npm run perf +``` + +Sample output: + +```bash +> immutable@4.0.0-rc.9 perf ~/github.com/immutable-js/immutable-js +> node ./resources/bench.js + +List > builds from array of 2 + Old: 678,974 683,071 687,218 ops/sec + New: 669,012 673,553 678,157 ops/sec + compare: 1 -1 + diff: -1.4% + rme: 0.64% +``` + +## TypeScript version support + +TypeScript version does support the same version as [DefinitelyTyped](https://github.com/DefinitelyTyped/DefinitelyTyped) versions. Immutable "may" work with older versions, but no support will be provided. + +## License + +By contributing to Immutable.js, you agree that your contributions will be +licensed under its MIT license. diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000000..4cf7679033 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +github: [jdeniau, Methuselah96] diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000000..3387aa797e --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,42 @@ + + +### What happened + + + +### How to reproduce + + diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000..29c1b4a5d3 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,139 @@ +name: CI + +on: + push: + branches: + - main + - 5.x + - 6.x + pull_request: ~ + +jobs: + lint: + name: 'Lint' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '20' + - uses: actions/cache@v4 + with: + path: ~/.npm + key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: ${{ runner.OS }}-node- + - run: npm ci + - run: npm run lint + - run: npm run check-git-clean + + type-check: + name: 'Type Check' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '20' + - uses: actions/cache@v4 + with: + path: ~/.npm + key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: ${{ runner.OS }}-node- + - uses: actions/cache@v4 + with: + path: ~/.dts + key: ${{ runner.OS }}-dts-${{ hashFiles('**/package-lock.json') }} + restore-keys: ${{ runner.OS }}-dts- + - run: npm ci + - run: npm run type-check + - run: npm run check-git-clean + + test: + name: 'Build & Unit Test & Type Test' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '20' + - uses: actions/cache@v4 + with: + path: ~/.npm + key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: ${{ runner.OS }}-node- + - name: 'Install dependencies' + run: npm ci + + - name: 'Build JS files' + run: npm run build + + - name: 'Ensure all files are builded' + run: npm run check-build-output + + - name: 'Run unit tests' + run: npm run test:unit + + - name: 'Test types' + run: npm run test:types -- --target 4.5,5.0,current + + - run: npx size-limit + - run: npm run check-git-clean + + website: + name: 'Build Website' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-node@v4 + with: + node-version: '20' + - uses: actions/cache@v4 + with: + path: ~/.npm + key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: ${{ runner.OS }}-node- + - run: npm ci + - run: NODE_OPTIONS=--openssl-legacy-provider npm run website:build + - run: npm run check-git-clean + + publish: + name: 'Publish' + needs: [lint, type-check, test, website] + if: github.ref == 'refs/heads/main' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-node@v4 + with: + node-version: '20' + - uses: actions/cache@v4 + with: + path: ~/.npm + key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: ${{ runner.OS }}-node- + - run: npm ci + - run: npm run build + - run: NODE_OPTIONS=--openssl-legacy-provider npm run website:build + - name: Push NPM Branch + if: github.ref == 'refs/heads/main' + uses: peaceiris/actions-gh-pages@v3 + with: + enable_jekyll: true + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./npm + publish_branch: npm + user_name: 'github-actions[bot]' + user_email: 'github-actions[bot]@users.noreply.github.com' + - name: Publish Docs + if: github.ref == 'refs/heads/main' + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./website/out + cname: immutable-js.com + user_name: 'github-actions[bot]' + user_email: 'github-actions[bot]@users.noreply.github.com' diff --git a/.github/workflows/output_diff.yml b/.github/workflows/output_diff.yml new file mode 100644 index 0000000000..74690ee3cd --- /dev/null +++ b/.github/workflows/output_diff.yml @@ -0,0 +1,62 @@ +name: CI + +on: + pull_request: + branches: + - main + - init-migrate-to-ts + # run only if there is ts files in the PR + paths: + - 'src/**/*.ts' + +jobs: + diff: + name: 'Output diff' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + path: 'pr' + + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.base.sha }} + path: 'main' + + - uses: actions/setup-node@v4 + with: + node-version: '20' + + - uses: actions/cache@v4 + with: + path: ~/.npm + key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: ${{ runner.OS }}-node- + + - name: 'Install PR branch dependencies' + run: npm ci + working-directory: pr + + - name: 'Install main branch dependencies' + run: npm ci + working-directory: main + + - name: 'Build PR branch' + run: npm run build + working-directory: pr + + - name: 'Build main branch' + run: npm run build + working-directory: main + + - name: 'Execute prettier and remove ts-expect-error on PR dist' + run: npx terser dist/immutable.es.js --comments false | npx prettier --parser=babel > dist/immutable.es.prettier.js + + working-directory: pr + + - name: 'Execute prettier main dist' + run: npx terser dist/immutable.es.js --comments false | npx prettier --parser=babel > dist/immutable.es.prettier.js + working-directory: main + + - name: 'Output diff' + run: diff --unified --ignore-blank-lines --ignore-all-space main/dist/immutable.es.prettier.js pr/dist/immutable.es.prettier.js diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000000..ad6d4d72ad --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,39 @@ +name: Release + +on: + workflow_dispatch: ~ + release: + types: [published] + +jobs: + build: + name: 'Build & Publish to NPM' + permissions: + contents: read + id-token: write + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '20' + registry-url: 'https://registry.npmjs.org' + - uses: actions/cache@v4 + with: + path: ~/.npm + key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: ${{ runner.OS }}-node- + - run: npm ci + - run: npm run build + - name: 'Determine NPM tag: latest or next depending if we are on a prerelease or not (version with hyphen should be a prerelease)' + id: npm_tag + run: | + VERSION=$(node -p "require('./package.json').version") + if [[ $VERSION == *-* ]]; then + echo "TAG=next" >> "$GITHUB_OUTPUT" + else + echo "TAG=latest" >> "$GITHUB_OUTPUT" + fi + - run: cd npm && npm publish --provenance --tag ${{ steps.npm_tag.outputs.TAG }} + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.gitignore b/.gitignore index 2180f48796..972b88d8e1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,15 +1,18 @@ .*.haste_cache.* node_modules -old npm-debug.log +yarn-error.log .DS_Store *~ *.swp +.idea +*.iml TODO -build -immutable.d.json -readme.json -/pages/out -/pages/resources/immutable.d.json -/pages/resources/readme.json -.idea \ No newline at end of file +/website/.next +/website/out +/website/public/sitemap*.xml +/website/public/robots.txt +/gh-pages +/npm +/dist +/coverage \ No newline at end of file diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000000..3b56666703 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,2 @@ +dist +type-definitions/flow-tests/ diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 0000000000..544138be45 --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,3 @@ +{ + "singleQuote": true +} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 8336eec28e..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,17 +0,0 @@ -sudo: false -language: node_js -node_js: stable - -env: - global: - - CXX=g++-4.9 - - secure: "VDsxy30sE9ivdqoXkaKXo0czbS4brNpwKEIblu7f1gVLx7OD9pjTc78cdwrVbZDBYroSiYVYuUrLDjpVjH88lL/LxRrru3V0CIlAqqa+ssXcqycCaT/6ds+ZymuTTGRh+Mf12pIKO+yc8jTov2M7AzPJdpS+ORP5dImYyE3ex9s=" - -addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-4.9 - -after_success: npm run deploy diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000000..9df8e0fce0 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,703 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +Dates are formatted as YYYY-MM-DD. + +## Unreleased + +## 5.1.2 + +- Revert previous assertion as it introduced a regression [#2102](https://github.com/immutable-js/immutable-js/pull/2102) by [@giggo1604](https://github.com/giggo1604) +- Merge should work with empty record [#2103](https://github.com/immutable-js/immutable-js/pull/2103) by [@jdeniau](https://github.com/jdeniau) + +## 5.1.1 + +- Fix type copying + +## 5.1.0 + +- Add shuffle to list [#2066](https://github.com/immutable-js/immutable-js/pull/2066) by [@mazerty](https://github.com/mazerty) +- TypeScript: Better getIn `RetrievePath` [#2070](https://github.com/immutable-js/immutable-js/pull/2070) by [@jdeniau](https://github.com/jdeniau) +- Fix #1915 "Converting a Seq to a list causes RangeError (max call size exceeded)" by @alexvictoor in [#2038](https://github.com/immutable-js/immutable-js/pull/2038) +- TypeScript: Fix proper typings for Seq.concat() [#2040](https://github.com/immutable-js/immutable-js/pull/2040) by [@alexvictoor](https://github.com/alexvictoor) +- Fix Uncaught "TypeError: keyPath.slice is not a function" for ArrayLike method [#2065](https://github.com/immutable-js/immutable-js/pull/2065) by [@jdeniau](https://github.com/jdeniau) + +### Internal + +- Upgrade typescript and typescript-eslint [#2046](https://github.com/immutable-js/immutable-js/pull/2046) by [@jdeniau](https://github.com/jdeniau) +- Upgrade to rollup 4 [#2049](https://github.com/immutable-js/immutable-js/pull/2049) by [@jdeniau](https://github.com/jdeniau) +- Start migrating codebase to TypeScript without any runtime change nor .d.ts change: + - allow TS files to be compiled in src dir [#2054](https://github.com/immutable-js/immutable-js/pull/2054) by [@jdeniau](https://github.com/jdeniau) +- add exception for code that should not happen in updateIn [#2074](https://github.com/immutable-js/immutable-js/pull/2074) by [@jdeniau](https://github.com/jdeniau) +- Reformat Range.toString for readability [#2075](https://github.com/immutable-js/immutable-js/pull/2075) by [@Ustin.Vaskin](https://github.com/ustinvaskin) + +## [5.0.3] + +- Fix List.VNode.removeAfter() / removeBefore() issue on some particular case [#2030](https://github.com/immutable-js/immutable-js/pull/2030) by [@alexvictoor](https://github.com/alexvictoor) + +## [5.0.2] + +- Fix wrong path for esm module after fix in 5.0.1 + +## [5.0.1] + +- Fix circular dependency issue with ESM build by @iambumblehead in [#2035](https://github.com/immutable-js/immutable-js/pull/2035) by [@iambumblehead](https://github.com/iambumblehead) + +## [5.0.0] + +### Breaking changes + +To sum up, the **big** change in 5.0 is a Typescript change related to `Map` that is typed closer to the JS object. This is a huge change for TS users, but do not impact the runtime behavior. (see [Improve TypeScript definition for `Map`](#typescript-break-improve-typescript-definition-for-map) for more details) + +Other breaking changes are: + +#### [BREAKING] Remove deprecated methods: + +_Released in 5.0.0-rc.1_ + +- `Map.of('k', 'v')`: use `Map([ [ 'k', 'v' ] ])` or `Map({ k: 'v' })` +- `Collection.isIterable`: use `isIterable` directly +- `Collection.isKeyed`: use `isKeyed` directly +- `Collection.isIndexed`: use `isIndexed` directly +- `Collection.isAssociative`: use `isAssociative` directly +- `Collection.isOrdered`: use `isOrdered` directly + +#### [BREAKING] `OrdererMap` and `OrderedSet` hashCode implementation has been fixed + +_Released in 5.0.0-rc.1_ + +Fix issue implementation of `hashCode` for `OrdererMap` and `OrderedSet` where equal objects might not return the same `hashCode`. + +Changed in [#2005](https://github.com/immutable-js/immutable-js/pull/2005) + +#### [BREAKING] Range function needs at least two defined parameters + +_Released in 5.0.0-beta.5_ + +Range with `undefined` would end in an infinite loop. Now, you need to define at least the start and end values. + +If you need an infinite range, you can use `Range(0, Infinity)`. + +Changed in [#1967](https://github.com/immutable-js/immutable-js/pull/1967) by [@jdeniau](https://github.com/jdeniau) + +#### [Minor BC break] Remove default export + +_Released in 5.0.0-beta.1_ + +Immutable does not export a default object containing all it's API anymore. +As a drawback, you can not `immport Immutable` directly: + +```diff +- import Immutable from 'immutable'; ++ import { List, Map } from 'immutable'; + +- const l = Immutable.List([Immutable.Map({ a: 'A' })]); ++ const l = List([Map({ a: 'A' })]); +``` + +If you want the non-recommanded, but shorter migration path, you can do this: + +```diff +- import Immutable from 'immutable'; ++ import * as Immutable from 'immutable'; + + const l = Immutable.List([Immutable.Map({ a: 'A' })]); +``` + +#### [TypeScript Break] Improve TypeScript definition for `Map` + +_Released in 5.0.0-beta.1_ + +> If you do use TypeScript, then this change does not impact you : no runtime change here. +> But if you use Map with TypeScript, this is a HUGE change ! +> Imagine the following code + +```ts +const m = Map({ length: 3, 1: 'one' }); +``` + +This was previously typed as `Map` + +and return type of `m.get('length')` or `m.get('inexistant')` was typed as `string | number | undefined`. + +This made `Map` really unusable with TypeScript. + +Now the Map is typed like this: + +```ts +MapOf<{ + length: number; + 1: string; +}>; +``` + +and the return type of `m.get('length')` is typed as `number`. + +The return of `m.get('inexistant')` throw the TypeScript error: + +> Argument of type '"inexistant"' is not assignable to parameter of type '1 | "length" + +##### If you want to keep the old definition + +**This is a minor BC for TS users**, so if you want to keep the old definition, you can declare you Map like this: + +```ts +const m = Map({ length: 3, 1: 'one' }); +``` + +##### If you need to type the Map with a larger definition + +You might want to declare a wider definition, you can type your Map like this: + +```ts +type MyMapType = { + length: number; + 1: string | null; + optionalProperty?: string; +}; +const m = Map({ length: 3, 1: 'one' }); +``` + +Keep in mind that the `MapOf` will try to be consistant with the simple TypeScript object, so you can not do this: + +```ts +Map({ a: 'a' }).set('b', 'b'); +Map({ a: 'a' }).delete('a'); +``` + +Like a simple object, it will only work if the type is forced: + +```ts +Map<{ a: string; b?: string }>({ a: 'a' }).set('b', 'b'); // b is forced in type and optional +Map<{ a?: string }>({ a: 'a' }).delete('a'); // you can only delete an optional key +``` + +##### Are all `Map` methods implemented ? + +For now, only `get`, `getIn`, `set`, `update`, `delete`, `remove`, `toJS`, `toJSON` methods are implemented. All other methods will fallback to the basic `Map` definition. Other method definition will be added later, but as some might be really complex, we prefer the progressive enhancement on the most used functions. + +### Fixes + +- Fix type inference for first() and last() [#2001](https://github.com/immutable-js/immutable-js/pull/2001) by [@butchler](https://github.com/butchler) +- Fix issue with empty list that is a singleton [#2004](https://github.com/immutable-js/immutable-js/pull/2004) by [@jdeniau](https://github.com/jdeniau) +- Map and Set sort and sortBy return type [#2013](https://github.com/immutable-js/immutable-js/pull/2013) by [@jdeniau](https://github.com/jdeniau) + +### Internal + +- [Internal] Migrating TS type tests from dtslint to [TSTyche](https://tstyche.org/) [#1988](https://github.com/immutable-js/immutable-js/pull/1988) and [#1991](https://github.com/immutable-js/immutable-js/pull/1991) by [@mrazauskas](https://github.com/mrazauskas). + Special thanks to [@arnfaldur](https://github.com/arnfaldur) that migrated every type tests to tsd just before that. +- [internal] Upgrade to rollup 3.x [#1965](https://github.com/immutable-js/immutable-js/pull/1965) by [@jdeniau](https://github.com/jdeniau) +- [internal] upgrade tooling (TS, eslint) and documentation packages: #1971, #1972, #1973, #1974, #1975, #1976, #1977, #1978, #1979, #1980, #1981 + +## [4.3.7] - 2024-07-22 + +- Fix issue with slice negative of filtered sequence [#2006](https://github.com/immutable-js/immutable-js/pull/2006) by [@jdeniau](https://github.com/jdeniau) + +## [4.3.6] - 2024-05-13 + +- Fix `Repeat().equals(undefined)` incorrectly returning true [#1994](https://github.com/immutable-js/immutable-js/pull/1994) by [@butchler](https://github.com/butchler) + +## [4.3.5] - 2024-01-16 + +- Upgrade to TS 5.1 [#1972](https://github.com/immutable-js/immutable-js/pull/1972) by [@jdeniau](https://github.com/jdeniau) +- Fix Set.fromKeys types with Map constructor in TS 5.0 [#1971](https://github.com/immutable-js/immutable-js/pull/1971) by [@jdeniau](https://github.com/jdeniau) +- Fix Read the Docs link on readme [#1970](https://github.com/immutable-js/immutable-js/pull/1970) by [@joshding](https://github.com/joshding) + +## [4.3.4] - 2023-08-25 + +- Rollback toJS type due to circular reference error [#1958](https://github.com/immutable-js/immutable-js/pull/1958) by [@jdeniau](https://github.com/jdeniau) + +## [4.3.3] - 2023-08-23 + +- [typescript] manage to handle toJS circular reference. [#1932](https://github.com/immutable-js/immutable-js/pull/1932) by [@jdeniau](https://github.com/jdeniau) +- [doc] Add install instructions for pnpm and Bun [#1952](https://github.com/immutable-js/immutable-js/pull/1952) by [@colinhacks](https://github.com/colinhacks) and [#1953](https://github.com/immutable-js/immutable-js/pull/1953) by [@menglingyu659](https://github.com/menglingyu659) + +## [4.3.2] - 2023-08-01 + +- [TypeScript] Fix isOrderedSet type [#1948](https://github.com/immutable-js/immutable-js/pull/1948) + +## [4.3.1] - 2023-07-11 + +- Faster and implementation of `some` [#1944](https://github.com/immutable-js/immutable-js/pull/1944) +- [internal] remove unused exports [#1928](https://github.com/immutable-js/immutable-js/pull/1928) + +## [4.3.0] - 2023-03-10 + +- Introduce Comparator and PairSorting [#1937](https://github.com/immutable-js/immutable-js/pull/1937) by [@https://github.com/giancosta86](https://github.com/giancosta86) +- [TypeScript] Fix fromJS declaration for greater compatibility [#1936](https://github.com/immutable-js/immutable-js/pull/1936) + +## [4.2.4] - 2023-02-06 + +- [TypeScript] Improve type infererence for from JS by [KSXGitHub](https://github.com/KSXGitHub) [#1927](https://github.com/immutable-js/immutable-js/pull/1927) + +## [4.2.3] - 2023-02-02 + +- [TypeScript] `groupBy` return either a `Map` or an `OrderedMap`: make the type more precise than base `Collection` [#1924](https://github.com/immutable-js/immutable-js/pull/1924) + +## [4.2.2] - 2023-01-02 + +- [Flow] Add type for `partition` method [#1920](https://github.com/immutable-js/immutable-js/pull/1920) by [Dagur](https://github.com/Dagur) + +## [4.2.1] - 2022-12-23 + +- [Typescript] rollback some of the change on `toJS` to avoir circular reference + +## [4.2.0] - 2022-12-22 + +- [TypeScript] Better type for toJS [#1917](https://github.com/immutable-js/immutable-js/pull/1917) by [jdeniau](https://github.com/jdeniau) + - [TS Minor Break] tests are ran with TS > 4.5 only. It was tested with TS > 2.1 previously, but we want to level up TS types with recent features. TS 4.5 has been released more than one year before this release. If it does break your implementation (it might not), you should probably consider upgrading to the latest TS version. +- Added a `partition` method to all containers [#1916](https://github.com/immutable-js/immutable-js/pull/1916) by [johnw42](https://github.com/johnw42) + +## [4.1.0] - 2022-05-23 + +- Accept Symbol as Map key. [#1859](https://github.com/immutable-js/immutable-js/pull/1859) by [jdeniau](https://github.com/jdeniau) +- Optimize contructors without arguments [#1887](https://github.com/immutable-js/immutable-js/pull/1887) by [marianoguerra](https://github.com/marianoguerra) +- Fix Flow removeIn types [#1902](https://github.com/immutable-js/immutable-js/pull/1902) by [nifgraup](https://github.com/nifgraup) +- Fix bug in Record.equals when comparing against Map [#1903](https://github.com/immutable-js/immutable-js/pull/1903) by [jmtoung](https://github.com/jmtoung) + +## [4.0.0] - 2021-09-30 + +This release brings new functionality and many fixes. + +1. [Key changes](#key-changes) +1. [Note for users of v4.0.0-rc.12](#note-for-users-of-v400-rc12) +1. [Breaking changes](#breaking) +1. [New](#new) +1. [Fixed](#fixed) + +### Key changes + +- New members have joined the team +- The project has been relicensed as MIT +- Better TypeScript and Flow type definitions +- A brand-new documentation lives at [immutable-js.com](https://immutable-js.com/) and can show multiple versions +- Behavior of `merge` and `mergeDeep` has changed +- `Iterable` is renamed to [Collection](https://immutable-js.com/docs/latest@main/Collection/) +- [Records](https://immutable-js.com/docs/latest@main/Record/) no longer extend from Collections +- All collection types now implement the [ES6 iterable protocol](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) +- New methods: + - [toJSON()]() + - [wasAltered()]() + - [Collection.Indexed.zipAll()]() + - [Map.deleteAll()]() + +
   Diff of changed API (click to expand) + +```diff ++ Collection.[Symbol.iterator] ++ Collection.toJSON ++ Collection.update ++ Collection.Indexed.[Symbol.iterator] ++ Collection.Indexed.toJSON ++ Collection.Indexed.update ++ Collection.Indexed.zipAll ++ Collection.Keyed.[Symbol.iterator] ++ Collection.Keyed.toJSON ++ Collection.Keyed.update ++ Collection.Set.[Symbol.iterator] ++ Collection.Set.toJSON ++ Collection.Set.update +- Collection.size +- Collection.Indexed.size +- Collection.Keyed.size +- Collection.Set.size + ++ List.[Symbol.iterator] ++ List.toJSON ++ List.wasAltered ++ List.zipAll +- List.mergeDeep +- List.mergeDeepWith +- List.mergeWith + ++ Map.[Symbol.iterator] ++ Map.deleteAll ++ Map.toJSON ++ Map.wasAltered + ++ OrderedMap.[Symbol.iterator] ++ OrderedMap.deleteAll ++ OrderedMap.toJSON ++ OrderedMap.wasAltered ++ OrderedSet.[Symbol.iterator] ++ OrderedSet.toJSON ++ OrderedSet.update ++ OrderedSet.wasAltered ++ OrderedSet.zip ++ OrderedSet.zipAll ++ OrderedSet.zipWith + ++ Record.[Symbol.iterator] ++ Record.asImmutable ++ Record.asMutable ++ Record.clear ++ Record.delete ++ Record.deleteIn ++ Record.merge ++ Record.mergeDeep ++ Record.mergeDeepIn ++ Record.mergeDeepWith ++ Record.mergeIn ++ Record.mergeWith ++ Record.set ++ Record.setIn ++ Record.toJSON ++ Record.update ++ Record.updateIn ++ Record.wasAltered ++ Record.withMutations ++ Record.Factory.displayName +- Record.butLast +- Record.concat +- Record.count +- Record.countBy +- Record.entries +- Record.entrySeq +- Record.every +- Record.filter +- Record.filterNot +- Record.find +- Record.findEntry +- Record.findKey +- Record.findLast +- Record.findLastEntry +- Record.findLastKey +- Record.first +- Record.flatMap +- Record.flatten +- Record.flip +- Record.forEach +- Record.groupBy +- Record.includes +- Record.isEmpty +- Record.isSubset +- Record.isSuperset +- Record.join +- Record.keyOf +- Record.keySeq +- Record.keys +- Record.last +- Record.lastKeyOf +- Record.map +- Record.mapEntries +- Record.mapKeys +- Record.max +- Record.maxBy +- Record.min +- Record.minBy +- Record.reduce +- Record.reduceRight +- Record.rest +- Record.reverse +- Record.skip +- Record.skipLast +- Record.skipUntil +- Record.skipWhile +- Record.slice +- Record.some +- Record.sort +- Record.sortBy +- Record.take +- Record.takeLast +- Record.takeUntil +- Record.takeWhile +- Record.toArray +- Record.toIndexedSeq +- Record.toKeyedSeq +- Record.toList +- Record.toMap +- Record.toOrderedMap +- Record.toOrderedSet +- Record.toSet +- Record.toSetSeq +- Record.toStack +- Record.valueSeq +- Record.values + ++ Seq.[Symbol.iterator] ++ Seq.toJSON ++ Seq.update ++ Seq.Indexed.[Symbol.iterator] ++ Seq.Indexed.toJSON ++ Seq.Indexed.update ++ Seq.Indexed.zipAll ++ Seq.Keyed.[Symbol.iterator] ++ Seq.Keyed.toJSON ++ Seq.Keyed.update ++ Seq.Set.[Symbol.iterator] ++ Seq.Set.toJSON ++ Seq.Set.update + ++ Set.[Symbol.iterator] ++ Set.toJSON ++ Set.update ++ Set.wasAltered + ++ Stack.[Symbol.iterator] ++ Stack.toJSON ++ Stack.update ++ Stack.wasAltered ++ Stack.zipAll + ++ ValueObject.equals ++ ValueObject.hashCode + +- Iterable.* +- Iterable.Indexed.* +- Iterable.Keyed.* +- Iterable.Set.* +``` + +
+ +### Note for users of v4.0.0-rc.12 + +There were mostly bugfixes and improvements since RC 12. Upgrading should be painless for most users. +However, there is **one breaking change**: The behavior of `merge` and `mergeDeep` has changed. See below for details. + +### BREAKING + +#### [merge()]() + +- No longer use value-equality within `merge()` ([#1391](https://github.com/immutable-js/immutable-js/pull/1391)) + + > This rectifies an inconsistent behavior between `x.merge(y)` and `x.mergeDeep(y)` where merge would + > use `===` on leaf values to determine return-self optimizations, while mergeDeep would use `is()`. + > This improves consistency across the library and avoids a possible performance pitfall. + +- No longer deeply coerce argument to merge() ([#1339](https://github.com/immutable-js/immutable-js/pull/1339)) + > Previously, the argument provided to `merge()` was deeply converted to Immutable collections via `fromJS()`. + > This was the only function in the library which calls `fromJS()` indirectly, + > and it was surprising and made it difficult to understand what the result of `merge()` would be. + > Now, the value provided to `merge()` is only shallowly converted to an Immutable collection, similar to + > related methods in the library. This may change the behavior of your calls to `merge()`. + +#### [mergeDeep()]() + +- Replace incompatible collections when merging nested data ([#1840](https://github.com/immutable-js/immutable-js/pull/1840)) + + > It will no longer merge lists of tuples into maps. For more information see + > [#1840](https://github.com/immutable-js/immutable-js/pull/1840) and the updated `mergeDeep()` documentation. + +- Concat Lists when merging deeply ([#1344](https://github.com/immutable-js/immutable-js/pull/1344)) + > Previously, calling `map.mergeDeep()` with a value containing a `List` would replace the values in the + > original List. This has always been confusing, and does not properly treat `List` as a monoid. + > Now, `List.merge` is simply an alias for `List.concat`, and `map.mergeDeep()` will concatenate deeply-found lists + > instead of replacing them. + +#### [Seq](https://immutable-js.com/docs/latest@main/Seq/) + +- Remove IteratorSequence. Do not attempt to detect iterators in `Seq()`. ([#1589](https://github.com/immutable-js/immutable-js/pull/1589)) + + > Iterables can still be provided to `Seq()`, and _most_ Iterators are also + > Iterables, so this change should not affect the vast majority of uses. + > For more information, see PR #1589 + +- Remove `Seq.of()` (#1311, #1310) + > This method has been removed since it cannot be correctly typed. It's recommended to convert + > `Seq.of(1, 2, 3)` to `Seq([1, 2, 3])`. + +#### [isImmutable()]() + +- `isImmutable()` now returns true for collections currently within a `withMutations()` call. ([#1374](https://github.com/immutable-js/immutable-js/pull/1374)) + + > Previously, `isImmutable()` did double-duty of both determining if a value was a Collection or Record + > from this library as well as if it was outside a `withMutations()` call. + > This latter case caused confusion and was rarely used. + +#### [toArray()]() + +- KeyedCollection.toArray() returns array of tuples. ([#1340](https://github.com/immutable-js/immutable-js/pull/1340)) + + > Previously, calling `toArray()` on a keyed collection (incl `Map` and `OrderedMap`) would + > discard keys and return an Array of values. This has always been confusing, and differs from `Array.from()`. + > Now, calling `toArray()` on a keyed collection will return an Array of `[key, value]` tuples, matching + > the behavior of `Array.from()`. + +#### [concat()]() + +- `list.concat()` now has a slightly more efficient implementation and `map.concat()` is an alias for `map.merge()`. ([#1373](https://github.com/immutable-js/immutable-js/pull/1373)) + + > In rare cases, this may affect use of `map.concat()` which expected slightly different behavior from `map.merge()`. + +#### [Collection](https://immutable-js.com/docs/latest@main/Collection/), formerly `Iterable` + +- The `Iterable` class has been renamed to `Collection`, and `isIterable()` has been renamed to `isCollection()`. + Aliases with the existing names exist to make transitioning code easier. + +#### [Record](https://immutable-js.com/docs/latest@main/Record/) + +- Record is no longer an Immutable Collection type. + - Now `isCollection(myRecord)` returns `false` instead of `true`. + - The sequence API (such as `map`, `filter`, `forEach`) no longer exist on Records. + - `delete()` and `clear()` no longer exist on Records. + +#### Other breaking changes + +- **Potentially Breaking:** Improve hash speed and avoid collision for common values ([#1629](https://github.com/immutable-js/immutable-js/pull/1629)) + + > Causes some hash values to change, which could impact the order of iteration of values in some Maps + > (which are already advertised as unordered, but highlighting just to be safe) + +- Node buffers no longer considered value-equal ([#1437](https://github.com/immutable-js/immutable-js/pull/1437)) + +- Plain Objects and Arrays are no longer considered opaque values ([#1369](https://github.com/immutable-js/immutable-js/pull/1369)) + + > This changes the behavior of a few common methods with respect to plain Objects and Arrays where these were + > previously considered opaque to `merge()` and `setIn()`, they now are treated as collections and can be merged + > into and updated (persistently). This offers an exciting alternative to small Lists and Records. + +- The "predicate" functions, `isCollection`, `isKeyed`, `isIndexed`, `isAssociative` have been moved from `Iterable.` to the top level exports. + +- The `toJSON()` method performs a shallow conversion (previously it was an alias for `toJS()`, which remains a deep conversion). + +- Some minor implementation details have changed, which may require updates to libraries which deeply integrate with Immutable.js's private APIs. + +- The Cursor API is officially deprecated. Use [immutable-cursor](https://github.com/redbadger/immutable-cursor) instead. + +- **Potentially Breaking:** [TypeScript] Remove `Iterable` as tuple from Map constructor types ([#1626](https://github.com/immutable-js/immutable-js/pull/1626)) + > Typescript allowed constructing a Map with a list of List instances, assuming each was a key, value pair. + > While this runtime behavior still works, this type led to more issues than it solved, so it has been removed. + > (Note, this may break previous v4 rcs, but is not a change against v3) + +### New + +- Update TypeScript and Flow definitions: + - The Flowtype and TypeScript type definitions have been completely rewritten with much higher quality and accuracy, + taking advantage of the latest features from both tools. + - Simplified TypeScript definition files to support all UMD use cases ([#1854](https://github.com/immutable-js/immutable-js/pull/1854)) + - Support Typescript 3 ([#1593](https://github.com/immutable-js/immutable-js/pull/1593)) + - Support Typescript strictNullChecks ([#1168](https://github.com/immutable-js/immutable-js/pull/1168)) + - Flow types to be compatible with the latest version 0.160.0 + - Enable flow strict ([#1580](https://github.com/immutable-js/immutable-js/pull/1580)) + + + +- Add "sideEffects: false" to package.json ([#1661](https://github.com/immutable-js/immutable-js/pull/1661)) + +- Use ES standard for iterator method reuse ([#1867](https://github.com/immutable-js/immutable-js/pull/1867)) + +- Generalize `fromJS()` and `Seq()` to support Sets ([#1865](https://github.com/immutable-js/immutable-js/pull/1865)) + +- Top level predicate functions ([#1600](https://github.com/immutable-js/immutable-js/pull/1600)) + + > New functions are exported from the `immutable` module: + > `isSeq()`, `isList()`, `isMap()`, `isOrderedMap()`, `isStack()`, `isSet()`, `isOrderedSet()`, and `isRecord()`. + +- Improve performance of toJS ([#1581](https://github.com/immutable-js/immutable-js/pull/1581)) + + > Cursory test is >10% faster than both v3.8.2 and v4.0.0-rc.7, + > and corrects the regression since v4.0.0-rc.9. + +- Added optional `notSetValue` in `first()` and `last()` ([#1556](https://github.com/immutable-js/immutable-js/pull/1556)) + +- Make `isArrayLike` check more precise to avoid false positives ([#1520](https://github.com/immutable-js/immutable-js/pull/1520)) + +- `map()` for List, Map, and Set returns itself for no-ops ([#1455](https://github.com/immutable-js/immutable-js/pull/1455)) (5726bd1) + +- Hash functions as objects, allowing functions as values in collections ([#1485](https://github.com/immutable-js/immutable-js/pull/1485)) + +- Functional API for `get()`, `set()`, and more which support both Immutable.js collections and plain Objects and Arrays ([#1369](https://github.com/immutable-js/immutable-js/pull/1369)) + +- Relicensed as MIT ([#1320](https://github.com/immutable-js/immutable-js/pull/1320)) + +- Support for Transducers! ([ee9c68f1](https://github.com/immutable-js/immutable-js/commit/ee9c68f1d43da426498ee009ecea37aa2ef77cb8)) + +- Add new method, `zipAll()` ([#1195](https://github.com/immutable-js/immutable-js/pull/1195)) + +- Bundle and distribute an "es module" so Webpack and Rollup can use tree-shaking for smaller builds ([#1204](https://github.com/immutable-js/immutable-js/pull/1204)) + +- Warn instead of throw when `getIn()` has a bad path ([668f2236](https://github.com/immutable-js/immutable-js/commit/668f2236642c97bd4e7d8dfbf62311f497a6ac18)) + +- A new predicate function `isValueObject()` helps to detect objects which implement `equals()` and `hashCode()`, + and type definitions now define the interface `ValueObject` which you can implement in your own code to create objects which + behave as values and can be keys in Maps or entries in Sets. + +- Using `fromJS()` with a "reviver" function now provides access to the key path to each translated value. ([#1118](https://github.com/immutable-js/immutable-js/pull/1118)) + +### Fixed + +- Fix issue with IE11 and missing Symbol.iterator ([#1850](https://github.com/immutable-js/immutable-js/pull/1850)) + +- Fix ordered set with map ([#1663](https://github.com/immutable-js/immutable-js/pull/1663)) + +- Do not modify iter during List.map and Map.map ([#1649](https://github.com/immutable-js/immutable-js/pull/1649)) + +- Fix ordered map delete all ([#1777](https://github.com/immutable-js/immutable-js/pull/1777)) + +- Hash symbols as objects ([#1753](https://github.com/immutable-js/immutable-js/pull/1753)) + +- Fix returning a Record in merge() when Record is empty ([#1785](https://github.com/immutable-js/immutable-js/pull/1785)) + +- Fix for RC~12: Records from different factories aren't equal ([#1734](https://github.com/immutable-js/immutable-js/issues/1734)) + +- "too much recursion" error when creating a Record type from an instance of another Record ([#1690](https://github.com/immutable-js/immutable-js/pull/1690)) + +- Fix glob for npm format script on Windows ([#18](https://github.com/immutable-js-oss/immutable-js/pull/18)) + +- Remove deprecated cursor API ([#13](https://github.com/immutable-js-oss/immutable-js/issues/13)) + +- Add missing es exports ([#1740](https://github.com/immutable-js/immutable-js/pull/1740)) + +- Support nulls in genTypeDefData.js ([#185](https://github.com/immutable-js/immutable-js/pull/185)) + +- Support isPlainObj in IE11 and other esoteric parameters [f3a6d5ce](https://github.com/immutable-js/immutable-js/pull/1833/commits/f3a6d5ce75bb9d60b87074240838f5429e896b60) + +- `Set.map` produces valid underlying map ([#1606](https://github.com/immutable-js/immutable-js/pull/1606)) + +- Support isPlainObj with `constructor` key ([#1627](https://github.com/immutable-js/immutable-js/pull/1627)) + +- `groupBy` no longer returns a mutable Map instance ([#1602](https://github.com/immutable-js/immutable-js/pull/1602)) + +- Fix issue where refs can recursively collide, corrupting `.size` ([#1598](https://github.com/immutable-js/immutable-js/pull/1598)) + +- Throw error in `mergeWith()` method if missing the required `merger` function ([#1543](https://github.com/immutable-js/immutable-js/pull/1543)) + +- Update `isPlainObj()` to workaround Safari bug and allow cross-realm values ([#1557](https://github.com/immutable-js/immutable-js/pull/1557)) + +- Fix missing "& T" to some methods in RecordInstance ([#1464](https://github.com/immutable-js/immutable-js/pull/1464)) + +- Make notSetValue optional for typed Records ([#1461](https://github.com/immutable-js/immutable-js/pull/1461)) (a1029bb) + +- Export type of RecordInstance ([#1434](https://github.com/immutable-js/immutable-js/pull/1434)) + +- Fix Record `size` check in merge() ([#1521](https://github.com/immutable-js/immutable-js/pull/1521)) + +- Fix Map#concat being not defined ([#1402](https://github.com/immutable-js/immutable-js/pull/1402)) + + + + + +- `getIn()` no longer throws when encountering a missing path ([#1361](https://github.com/immutable-js/immutable-js/pull/1361)) + + + +- Do not throw when printing value that cannot be coerced to primitive ([#1334](https://github.com/immutable-js/immutable-js/pull/1334)) + + + + + +- Do not throw from hasIn ([#1319](https://github.com/immutable-js/immutable-js/pull/1319)) + +- Long hash codes no longer cause an infinite loop ([#1175](https://github.com/immutable-js/immutable-js/pull/1175)) + +- `slice()` which should return an empty set could return a full set or vice versa (#1245, #1287) + +- Ensure empty slices do not throw when iterated ([#1220](https://github.com/immutable-js/immutable-js/pull/1220)) + +- Error during equals check on Record with undefined or null ([#1208](https://github.com/immutable-js/immutable-js/pull/1208)) + +- Fix size of count() after filtering or flattening ([#1171](https://github.com/immutable-js/immutable-js/pull/1171)) + +## [3.8.2] - 2017-10-05 + +Released in 2017, still the most commonly used release. + +[unreleased]: https://github.com/immutable-js/immutable-js/compare/v4.0.0-rc.15...HEAD +[4.0.0]: https://github.com/immutable-js/immutable-js/compare/v3.8.2...v4.0.0-rc.15 +[3.8.2]: https://github.com/immutable-js/immutable-js/compare/3.7.6...v3.8.2 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index fd7fcd14fa..0000000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,55 +0,0 @@ -# Have a question? - -Please ask questions on [Stack Overflow](http://stackoverflow.com/questions/tagged/immutable.js) instead of opening a Github Issue. There are more people on Stack Overflow who -can answer questions, and good answers can be searchable and canonical. - -# Issues - -We use GitHub issues to track bugs. Please ensure your bug description is clear -and has sufficient instructions to be able to reproduce the issue. - -The absolute best way to report a bug is to submit a pull request including a -new failing test which describes the bug. When the bug is fixed, your pull -request can then be merged! - -The next best way to report a bug is to provide a reduced test case on jsFiddle -or jsBin or produce exact code inline in the issue which will reproduce the bug. - -Facebook has a [bounty program](https://www.facebook.com/whitehat/) for the safe -disclosure of security bugs. In those cases, please go through the process -outlined on that page and do not file a public issue. - -# Pull Requests - -All active development of Immutable JS happens on GitHub. We actively welcome -your [pull requests](https://help.github.com/articles/creating-a-pull-request). - - 1. Fork the repo and create your branch from `master`. - 2. Install all dependencies. (`npm install`) - 3. If you've added code, add tests. - 4. If you've changed APIs, update the documentation. - 5. Build generated JS, run tests and ensure your code passes lint. (`npm run build && npm run test`) - 6. Be sure to commit the generated JS in `/dist`. - 7. If you haven't already, complete the Contributor License Agreement ("CLA"). - -## Contributor License Agreement ("CLA") - -In order to accept your pull request, we need you to submit a CLA. You only need -to do this once to work on any of Facebook's open source projects. - -Complete your CLA here: - -## Coding Style - -* 2 spaces for indentation (no tabs) -* 80 character line length strongly preferred. -* Prefer `'` over `"` -* ES6 Harmony when possible. -* Use semicolons; -* Trailing commas, -* Avd abbr wrds. - -## License - -By contributing to Immutable.js, you agree that your contributions will be -licensed under its BSD license. diff --git a/Gruntfile.js b/Gruntfile.js deleted file mode 100644 index 9e92a916a4..0000000000 --- a/Gruntfile.js +++ /dev/null @@ -1,227 +0,0 @@ -/** - * - * grunt lint Lint all source javascript - * grunt clean Clean dist folder - * grunt build Build dist javascript - * grunt test Test dist javascript - * grunt default Lint, Build then Test - * - */ -module.exports = function(grunt) { - grunt.initConfig({ - jshint: { - options: { - asi: true, - curly: false, - eqeqeq: true, - esnext: true, - expr: true, - forin: true, - freeze: false, - immed: true, - indent: 2, - iterator: true, - noarg: true, - node: true, - noempty: true, - nonstandard: true, - trailing: true, - undef: true, - unused: 'vars', - }, - all: ['src/**/*.js'] - }, - clean: { - build: ['dist/*'] - }, - bundle: { - build: { - files: [{ - src: 'src/Immutable.js', - dest: 'dist/immutable' - }] - } - }, - copy: { - build: { - files: [{ - src: 'type-definitions/Immutable.d.ts', - dest: 'dist/immutable.d.ts' - },{ - src: 'type-definitions/immutable.js.flow', - dest: 'dist/immutable.js.flow' - }] - } - }, - jest: { - options: { - testPathPattern: /.*/ - } - } - }); - - - var fs = require('fs'); - var rollup = require('rollup'); - var declassify = require('./resources/declassify'); - var stripCopyright = require('./resources/stripCopyright'); - var uglify = require('uglify-js'); - - grunt.registerMultiTask('bundle', function () { - var done = this.async(); - - this.files.map(function (file) { - rollup.rollup({ - entry: file.src[0], - plugins: [ - { - transform: function(source) { - return declassify(stripCopyright(source)); - } - } - ] - }).then(function (bundle) { - var copyright = fs.readFileSync('resources/COPYRIGHT'); - - var bundled = bundle.generate({ - format: 'umd', - banner: copyright, - moduleName: 'Immutable' - }).code; - - var es6 = require('es6-transpiler'); - - var transformResult = require("es6-transpiler").run({ - src: bundled, - disallowUnknownReferences: false, - environments: ["node", "browser"], - globals: { - define: false, - }, - }); - - if (transformResult.errors && transformResult.errors.length > 0) { - throw new Error(transformResult.errors[0]); - } - - var transformed = transformResult.src; - - fs.writeFileSync(file.dest + '.js', transformed); - - var minifyResult = uglify.minify(transformed, { - fromString: true, - mangle: { - toplevel: true - }, - compress: { - comparisons: true, - pure_getters: true, - unsafe: true - }, - output: { - max_line_len: 2048, - }, - reserved: ['module', 'define', 'Immutable'] - }); - - var minified = minifyResult.code; - - fs.writeFileSync(file.dest + '.min.js', copyright + minified); - }).then(function(){ done(); }, function(error) { - grunt.log.error(error.stack); - done(false); - }); - }); - }); - - - var Promise = require("bluebird"); - var exec = require('child_process').exec; - - function execp(cmd) { - var resolve, reject; - var promise = new Promise(function(_resolve, _reject) { - resolve = _resolve; - reject = _reject; - }); - try { - exec(cmd, function (error, out) { - if (error) { - reject(error); - } else { - resolve(out); - } - }); - } catch (error) { - reject(error); - } - return promise; - } - - grunt.registerTask('stats', function () { - Promise.all([ - execp('cat dist/immutable.js | wc -c'), - execp('git show master:dist/immutable.js | wc -c'), - execp('cat dist/immutable.min.js | wc -c'), - execp('git show master:dist/immutable.min.js | wc -c'), - execp('cat dist/immutable.min.js | gzip -c | wc -c'), - execp('git show master:dist/immutable.min.js | gzip -c | wc -c'), - ]).then(function (results) { - return results.map(function (result) { return parseInt(result); }); - }).then(function (results) { - var rawNew = results[0]; - var rawOld = results[1]; - var minNew = results[2]; - var minOld = results[3]; - var zipNew = results[4]; - var zipOld = results[5]; - - function space(n, s) { - return Array(Math.max(0, 10 + n - (s||'').length)).join(' ') + (s||''); - } - - function bytes(b) { - return b.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') + ' bytes'; - } - - function diff(n, o) { - var d = n - o; - return d === 0 ? '' : d < 0 ? (' ' + bytes(d)).green : (' +' + bytes(d)).red; - } - - function pct(s, b) { - var p = Math.floor(10000 * (1 - (s / b))) / 100; - return (' ' + p + '%').grey; - } - - console.log(' Raw: ' + - space(14, bytes(rawNew).cyan) + ' ' + space(15, diff(rawNew, rawOld)) - ); - console.log(' Min: ' + - space(14, bytes(minNew).cyan) + pct(minNew, rawNew) + space(15, diff(minNew, minOld)) - ); - console.log(' Zip: ' + - space(14, bytes(zipNew).cyan) + pct(zipNew, rawNew) + space(15, diff(zipNew, zipOld)) - ); - - }).then(this.async()).catch(function (error) { - setTimeout(function () { - throw error; - }, 0); - }); - }); - - grunt.registerTask('jest', 'Run tests with Jest.', function () { - require('jest-cli').runCLI(this.options(), process.cwd(), this.async()); - }); - - grunt.loadNpmTasks('grunt-contrib-jshint'); - grunt.loadNpmTasks('grunt-contrib-copy'); - grunt.loadNpmTasks('grunt-contrib-clean'); - grunt.loadNpmTasks('grunt-release'); - - grunt.registerTask('lint', 'Lint all source javascript', ['jshint']); - grunt.registerTask('build', 'Build distributed javascript', ['clean', 'bundle', 'copy']); - grunt.registerTask('test', 'Test built javascript', ['jest']); - grunt.registerTask('default', 'Lint, build and test.', ['lint', 'build', 'stats', 'test']); -} diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md deleted file mode 100644 index 12eb0b578a..0000000000 --- a/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,21 +0,0 @@ - - -### What happened - - - -### How to reproduce - - diff --git a/LICENSE b/LICENSE index c6a207cd5e..1e3c4f39c0 100644 --- a/LICENSE +++ b/LICENSE @@ -1,30 +1,21 @@ -BSD License +MIT License -For Immutable JS software +Copyright (c) 2014-present, Lee Byron and other contributors. -Copyright (c) 2014-2015, Facebook, Inc. All rights reserved. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - * Neither the name Facebook nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/PATENTS b/PATENTS deleted file mode 100644 index b145145264..0000000000 --- a/PATENTS +++ /dev/null @@ -1,11 +0,0 @@ -Additional Grant of Patent Rights Version 2 - -"Software" means the Immutable JS software distributed by Facebook, Inc. - -Facebook, Inc. (“Facebook”) hereby grants to each recipient of the Software (“you”) a perpetual, worldwide, royalty-free, non-exclusive, irrevocable (subject to the termination provision below) license under any Necessary Claims, to make, have made, use, sell, offer to sell, import, and otherwise transfer the Software. For avoidance of doubt, no license is granted under Facebook’s rights in any patent claims that are infringed by (i) modifications to the Software made by you or any third party or (ii) the Software in combination with any software or other technology. - -The license granted hereunder will terminate, automatically and without notice, if you (or any of your subsidiaries, corporate affiliates or agents) initiate directly or indirectly, or take a direct financial interest in, any Patent Assertion: (i) against Facebook or any of its subsidiaries or corporate affiliates, (ii) against any party if such Patent Assertion arises in whole or in part from any software, technology, product or service of Facebook or any of its subsidiaries or corporate affiliates, or (iii) against any party relating to the Software. Notwithstanding the foregoing, if Facebook or any of its subsidiaries or corporate affiliates files a lawsuit alleging patent infringement against you in the first instance, and you respond by filing a patent infringement counterclaim in that lawsuit against that party that is unrelated to the Software, the license granted hereunder will not terminate under section (i) of this paragraph due to such counterclaim. - -A “Necessary Claim” is a claim of a patent owned by Facebook that is necessarily infringed by the Software standing alone. - -A “Patent Assertion” is any lawsuit or other action alleging direct, indirect, or contributory infringement or inducement to infringe any patent, including a cross-claim or counterclaim. diff --git a/README.md b/README.md index 34ba3f8ff2..b9216576fa 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,27 @@ -Immutable collections for JavaScript -==================================== +# Immutable collections for JavaScript -[![Build Status](https://travis-ci.org/facebook/immutable-js.svg)](https://travis-ci.org/facebook/immutable-js) +[![Build Status](https://github.com/immutable-js/immutable-js/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/immutable-js/immutable-js/actions/workflows/ci.yml?query=branch%3Amain) [Chat on slack](https://immutable-js.slack.com) + +[Read the docs](https://immutable-js.com/docs/) and eat your vegetables. + +Docs are automatically generated from [README.md][] and [immutable.d.ts][]. +Please contribute! Also, don't miss the [wiki][] which contains articles on +additional specific topics. Can't find something? Open an [issue][]. + +**Table of contents:** + +- [Introduction](#introduction) +- [Getting started](#getting-started) +- [The case for Immutability](#the-case-for-immutability) +- [JavaScript-first API](#javascript-first-api) +- [Nested Structures](#nested-structures) +- [Equality treats Collections as Values](#equality-treats-collections-as-values) +- [Batching Mutations](#batching-mutations) +- [Lazy Seq](#lazy-seq) +- [Additional Tools and Resources](#additional-tools-and-resources) +- [Contributing](#contributing) + +## Introduction [Immutable][] data cannot be changed once created, leading to much simpler application development, no defensive copying, and enabling advanced memoization @@ -16,93 +36,131 @@ These data structures are highly efficient on modern JavaScript VMs by using structural sharing via [hash maps tries][] and [vector tries][] as popularized by Clojure and Scala, minimizing the need to copy or cache data. -`Immutable` also provides a lazy `Seq`, allowing efficient +Immutable.js also provides a lazy `Seq`, allowing efficient chaining of collection methods like `map` and `filter` without creating intermediate representations. Create some `Seq` with `Range` and `Repeat`. Want to hear more? Watch the presentation about Immutable.js: - +[![Immutable Data and React](website/public/Immutable-Data-and-React-YouTube.png)](https://youtu.be/I7IdS-PbEgI) -[Persistent]: http://en.wikipedia.org/wiki/Persistent_data_structure -[Immutable]: http://en.wikipedia.org/wiki/Immutable_object -[hash maps tries]: http://en.wikipedia.org/wiki/Hash_array_mapped_trie -[vector tries]: http://hypirion.com/musings/understanding-persistent-vector-pt-1 +[README.md]: https://github.com/immutable-js/immutable-js/blob/main/README.md +[immutable.d.ts]: https://github.com/immutable-js/immutable-js/blob/main/type-definitions/immutable.d.ts +[wiki]: https://github.com/immutable-js/immutable-js/wiki +[issue]: https://github.com/immutable-js/immutable-js/issues +[Persistent]: https://en.wikipedia.org/wiki/Persistent_data_structure +[Immutable]: https://en.wikipedia.org/wiki/Immutable_object +[hash maps tries]: https://en.wikipedia.org/wiki/Hash_array_mapped_trie +[vector tries]: https://hypirion.com/musings/understanding-persistent-vector-pt-1 - -Getting started ---------------- +## Getting started Install `immutable` using npm. ```shell +# using npm npm install immutable + +# using Yarn +yarn add immutable + +# using pnpm +pnpm add immutable + +# using Bun +bun add immutable ``` Then require it into any module. -```javascript -var Immutable = require('immutable'); -var map1 = Immutable.Map({a:1, b:2, c:3}); -var map2 = map1.set('b', 50); -map1.get('b'); // 2 -map2.get('b'); // 50 + + +```js +const { Map } = require('immutable'); +const map1 = Map({ a: 1, b: 2, c: 3 }); +const map2 = map1.set('b', 50); +map1.get('b') + ' vs. ' + map2.get('b'); // 2 vs. 50 ``` ### Browser -To use `immutable` from a browser, download [dist/immutable.min.js](https://github.com/facebook/immutable-js/blob/master/dist/immutable.min.js) -or use a CDN such as [CDNJS](https://cdnjs.com/libraries/immutable) -or [jsDelivr](http://www.jsdelivr.com/#!immutable.js). +Immutable.js has no dependencies, which makes it predictable to include in a Browser. + +It's highly recommended to use a module bundler like [webpack](https://webpack.js.org/), +[rollup](https://rollupjs.org/), or +[browserify](https://browserify.org/). The `immutable` npm module works +without any additional consideration. All examples throughout the documentation +will assume use of this kind of tool. -Then, add it as a script tag to your page: +Alternatively, Immutable.js may be directly included as a script tag. Download +or link to a CDN such as [CDNJS](https://cdnjs.com/libraries/immutable) +or [jsDelivr](https://www.jsdelivr.com/package/npm/immutable). + +Use a script tag to directly add `Immutable` to the global scope: ```html ``` -Or use an AMD loader (such as [RequireJS](http://requirejs.org/)): +Or use an AMD-style loader (such as [RequireJS](https://requirejs.org/)): -```javascript +```js require(['./immutable.min.js'], function (Immutable) { - var map1 = Immutable.Map({a:1, b:2, c:3}); - var map2 = map1.set('b', 50); - map1.get('b'); // 2 - map2.get('b'); // 50 + var map1 = Immutable.Map({ a: 1, b: 2, c: 3 }); + var map2 = map1.set('b', 50); + map1.get('b'); // 2 + map2.get('b'); // 50 }); ``` -If you're using [browserify](http://browserify.org/), the `immutable` npm module -also works from the browser. - -### TypeScript +### Flow & TypeScript Use these Immutable collections and sequences as you would use native -collections in your [TypeScript](http://typescriptlang.org) programs while still taking +collections in your [Flowtype](https://flowtype.org/) or [TypeScript](https://typescriptlang.org) programs while still taking advantage of type generics, error detection, and auto-complete in your IDE. -Just add a reference with a relative path to the type declarations at the top -of your file. +Installing `immutable` via npm brings with it type definitions for Flow (v0.55.0 or higher) +and TypeScript (v4.5 or higher), so you shouldn't need to do anything at all! + +#### Using TypeScript with Immutable.js v4+ + +Immutable.js type definitions embrace ES2015. While Immutable.js itself supports +legacy browsers and environments, its type definitions require TypeScript's 2015 +lib. Include either `"target": "es2015"` or `"lib": "es2015"` in your +`tsconfig.json`, or provide `--target es2015` or `--lib es2015` to the +`tsc` command. + + + +```js +const { Map } = require('immutable'); +const map1 = Map({ a: 1, b: 2, c: 3 }); +const map2 = map1.set('b', 50); +map1.get('b') + ' vs. ' + map2.get('b'); // 2 vs. 50 +``` + +#### Using TypeScript with Immutable.js v3 and earlier: -```javascript +Previous versions of Immutable.js include a reference file which you can include +via relative path to the type definitions at the top of your file. + +```js /// -import Immutable = require('immutable'); -var map1: Immutable.Map; -map1 = Immutable.Map({a:1, b:2, c:3}); +import { Map } from 'immutable'; +var map1: Map; +map1 = Map({ a: 1, b: 2, c: 3 }); var map2 = map1.set('b', 50); map1.get('b'); // 2 map2.get('b'); // 50 ``` - -The case for Immutability -------------------------- +## The case for Immutability Much of what makes application development difficult is tracking mutation and maintaining state. Developing with immutable data encourages you to think @@ -121,72 +179,88 @@ and especially well with an application designed using the ideas of [Flux][]. When data is passed from above rather than being subscribed to, and you're only interested in doing work when something has changed, you can use equality. -Immutable collections should be treated as *values* rather than *objects*. While -objects represents some thing which could change over time, a value represents +Immutable collections should be treated as _values_ rather than _objects_. While +objects represent some thing which could change over time, a value represents the state of that thing at a particular instance of time. This principle is most important to understanding the appropriate use of immutable data. In order to treat Immutable.js collections as values, it's important to use the -`Immutable.is()` function or `.equals()` method to determine value equality -instead of the `===` operator which determines object reference identity. - -```javascript -var map1 = Immutable.Map({a:1, b:2, c:3}); -var map2 = map1.set('b', 2); -assert(map1.equals(map2) === true); -var map3 = map1.set('b', 50); -assert(map1.equals(map3) === false); +`Immutable.is()` function or `.equals()` method to determine _value equality_ +instead of the `===` operator which determines object _reference identity_. + + + +```js +const { Map } = require('immutable'); +const map1 = Map({ a: 1, b: 2, c: 3 }); +const map2 = Map({ a: 1, b: 2, c: 3 }); +map1.equals(map2); // true +map1 === map2; // false ``` -Note: As a performance optimization `Immutable` attempts to return the existing +Note: As a performance optimization Immutable.js attempts to return the existing collection when an operation would result in an identical collection, allowing for using `===` reference equality to determine if something definitely has not -changed. This can be extremely useful when used within memoization function +changed. This can be extremely useful when used within a memoization function which would prefer to re-run the function if a deeper equality check could potentially be more costly. The `===` equality check is also used internally by `Immutable.is` and `.equals()` as a performance optimization. + + +```js +const { Map } = require('immutable'); +const map1 = Map({ a: 1, b: 2, c: 3 }); +const map2 = map1.set('b', 2); // Set to same value +map1 === map2; // true +``` + If an object is immutable, it can be "copied" simply by making another reference to it instead of copying the entire object. Because a reference is much smaller than the object itself, this results in memory savings and a potential boost in execution speed for programs which rely on copies (such as an undo-stack). -```javascript -var map1 = Immutable.Map({a:1, b:2, c:3}); -var clone = map1; + + +```js +const { Map } = require('immutable'); +const map = Map({ a: 1, b: 2, c: 3 }); +const mapCopy = map; // Look, "copies" are free! ``` -[React]: http://facebook.github.io/react/ -[Flux]: http://facebook.github.io/flux/docs/overview.html +[React]: https://reactjs.org/ +[Flux]: https://facebook.github.io/flux/docs/in-depth-overview/ -JavaScript-first API --------------------- +## JavaScript-first API -While `immutable` is inspired by Clojure, Scala, Haskell and other functional +While Immutable.js is inspired by Clojure, Scala, Haskell and other functional programming environments, it's designed to bring these powerful concepts to JavaScript, and therefore has an Object-Oriented API that closely mirrors that -of [ES6][] [Array][], [Map][], and [Set][]. +of [ES2015][] [Array][], [Map][], and [Set][]. -[ES6]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/New_in_JavaScript/ECMAScript_6_support_in_Mozilla -[Array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array -[Map]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map -[Set]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set +[es2015]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/New_in_JavaScript/ECMAScript_6_support_in_Mozilla +[array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array +[map]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map +[set]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set The difference for the immutable collections is that methods which would mutate -the collection, like `push`, `set`, `unshift` or `splice` instead return a new -immutable collection. Methods which return new arrays like `slice` or `concat` +the collection, like `push`, `set`, `unshift` or `splice`, instead return a new +immutable collection. Methods which return new arrays, like `slice` or `concat`, instead return new immutable collections. -```javascript -var list1 = Immutable.List.of(1, 2); -var list2 = list1.push(3, 4, 5); -var list3 = list2.unshift(0); -var list4 = list1.concat(list2, list3); -assert(list1.size === 2); -assert(list2.size === 5); -assert(list3.size === 6); -assert(list4.size === 13); -assert(list4.get(0) === 1); + + +```js +const { List } = require('immutable'); +const list1 = List([1, 2]); +const list2 = list1.push(3, 4, 5); +const list3 = list2.unshift(0); +const list4 = list1.concat(list2, list3); +assert.equal(list1.size, 2); +assert.equal(list2.size, 5); +assert.equal(list3.size, 6); +assert.equal(list4.size, 13); +assert.equal(list4.get(0), 1); ``` Almost all of the methods on [Array][] will be found in similar form on @@ -194,35 +268,51 @@ Almost all of the methods on [Array][] will be found in similar form on found on `Immutable.Set`, including collection operations like `forEach()` and `map()`. -```javascript -var alpha = Immutable.Map({a:1, b:2, c:3, d:4}); + + +```js +const { Map } = require('immutable'); +const alpha = Map({ a: 1, b: 2, c: 3, d: 4 }); alpha.map((v, k) => k.toUpperCase()).join(); // 'A,B,C,D' ``` -### Accepts raw JavaScript objects. +### Convert from raw JavaScript objects and arrays. -Designed to inter-operate with your existing JavaScript, `immutable` -accepts plain JavaScript Arrays and Objects anywhere a method expects an -`Iterable` with no performance penalty. +Designed to inter-operate with your existing JavaScript, Immutable.js +accepts plain JavaScript Arrays and Objects anywhere a method expects a +`Collection`. -```javascript -var map1 = Immutable.Map({a:1, b:2, c:3, d:4}); -var map2 = Immutable.Map({c:10, a:20, t:30}); -var obj = {d:100, o:200, g:300}; -var map3 = map1.merge(map2, obj); + + +```js +const { Map, List } = require('immutable'); +const map1 = Map({ a: 1, b: 2, c: 3, d: 4 }); +const map2 = Map({ c: 10, a: 20, t: 30 }); +const obj = { d: 100, o: 200, g: 300 }; +const map3 = map1.merge(map2, obj); // Map { a: 20, b: 2, c: 10, d: 100, t: 30, o: 200, g: 300 } +const list1 = List([1, 2, 3]); +const list2 = List([4, 5, 6]); +const array = [7, 8, 9]; +const list3 = list1.concat(list2, array); +// List [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ] ``` -This is possible because `immutable` can treat any JavaScript Array or Object -as an Iterable. You can take advantage of this in order to get sophisticated +This is possible because Immutable.js can treat any JavaScript Array or Object +as a Collection. You can take advantage of this in order to get sophisticated collection methods on JavaScript Objects, which otherwise have a very sparse native API. Because Seq evaluates lazily and does not cache intermediate results, these operations can be extremely efficient. -```javascript -var myObject = {a:1,b:2,c:3}; -Immutable.Seq(myObject).map(x => x * x).toObject(); + + +```js +const { Seq } = require('immutable'); +const myObject = { a: 1, b: 2, c: 3 }; +Seq(myObject) + .map(x => x * x) + .toObject(); // { a: 1, b: 4, c: 9 } ``` @@ -230,69 +320,92 @@ Keep in mind, when using JS objects to construct Immutable Maps, that JavaScript Object properties are always strings, even if written in a quote-less shorthand, while Immutable Maps accept keys of any type. + + ```js -var obj = { 1: "one" }; -Object.keys(obj); // [ "1" ] -obj["1"]; // "one" -obj[1]; // "one" - -var map = Immutable.fromJS(obj); -map.get("1"); // "one" -map.get(1); // undefined +const { fromJS } = require('immutable'); + +const obj = { 1: 'one' }; +console.log(Object.keys(obj)); // [ "1" ] +console.log(obj['1'], obj[1]); // "one", "one" + +const map = fromJS(obj); +console.log(map.get('1'), map.get(1)); // "one", undefined ``` Property access for JavaScript Objects first converts the key to a string, but since Immutable Map keys can be of any type the argument to `get()` is not altered. - ### Converts back to raw JavaScript objects. -All `immutable` Iterables can be converted to plain JavaScript Arrays and +All Immutable.js Collections can be converted to plain JavaScript Arrays and Objects shallowly with `toArray()` and `toObject()` or deeply with `toJS()`. -All Immutable Iterables also implement `toJSON()` allowing them to be passed to -`JSON.stringify` directly. - -```javascript -var deep = Immutable.Map({ a: 1, b: 2, c: Immutable.List.of(3, 4, 5) }); -deep.toObject() // { a: 1, b: 2, c: List [ 3, 4, 5 ] } -deep.toArray() // [ 1, 2, List [ 3, 4, 5 ] ] -deep.toJS() // { a: 1, b: 2, c: [ 3, 4, 5 ] } -JSON.stringify(deep) // '{"a":1,"b":2,"c":[3,4,5]}' +All Immutable Collections also implement `toJSON()` allowing them to be passed +to `JSON.stringify` directly. They also respect the custom `toJSON()` methods of +nested objects. + + + +```js +const { Map, List } = require('immutable'); +const deep = Map({ a: 1, b: 2, c: List([3, 4, 5]) }); +console.log(deep.toObject()); // { a: 1, b: 2, c: List [ 3, 4, 5 ] } +console.log(deep.toArray()); // [ 1, 2, List [ 3, 4, 5 ] ] +console.log(deep.toJS()); // { a: 1, b: 2, c: [ 3, 4, 5 ] } +JSON.stringify(deep); // '{"a":1,"b":2,"c":[3,4,5]}' ``` -### Embraces ES6 +### Embraces ES2015 + +Immutable.js supports all JavaScript environments, including legacy +browsers (even IE11). However it also takes advantage of features added to +JavaScript in [ES2015][], the latest standard version of JavaScript, including +[Iterators][], [Arrow Functions][], [Classes][], and [Modules][]. It's inspired +by the native [Map][] and [Set][] collections added to ES2015. + +All examples in the Documentation are presented in ES2015. To run in all +browsers, they need to be translated to ES5. + +```js +// ES2015 +const mapped = foo.map(x => x * x); +// ES5 +var mapped = foo.map(function (x) { + return x * x; +}); +``` -`Immutable` takes advantage of features added to JavaScript in [ES6][], -the latest standard version of ECMAScript (JavaScript), including [Iterators][], -[Arrow Functions][], [Classes][], and [Modules][]. It's also inspired by the -[Map][] and [Set][] collections added to ES6. The library is "transpiled" to ES3 -in order to support all modern browsers. +All Immutable.js collections are [Iterable][iterators], which allows them to be +used anywhere an Iterable is expected, such as when spreading into an Array. -All examples are presented in ES6. To run in all browsers, they need to be -translated to ES3. + ```js -// ES6 -foo.map(x => x * x); -// ES3 -foo.map(function (x) { return x * x; }); +const { List } = require('immutable'); +const aList = List([1, 2, 3]); +const anArray = [0, ...aList, 4, 5]; // [ 0, 1, 2, 3, 4, 5 ] ``` +Note: A Collection is always iterated in the same order, however that order may +not always be well defined, as is the case for the `Map` and `Set`. + [Iterators]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/The_Iterator_protocol [Arrow Functions]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions -[Classes]: http://wiki.ecmascript.org/doku.php?id=strawman:maximally_minimal_classes -[Modules]: http://www.2ality.com/2014/09/es6-modules-final.html +[Classes]: https://wiki.ecmascript.org/doku.php?id=strawman:maximally_minimal_classes +[Modules]: https://www.2ality.com/2014/09/es6-modules-final.html -Nested Structures ------------------ +## Nested Structures -The collections in `immutable` are intended to be nested, allowing for deep +The collections in Immutable.js are intended to be nested, allowing for deep trees of data, similar to JSON. -```javascript -var nested = Immutable.fromJS({a:{b:{c:[3,4,5]}}}); + + +```js +const { fromJS } = require('immutable'); +const nested = fromJS({ a: { b: { c: [3, 4, 5] } } }); // Map { a: Map { b: Map { c: List [ 3, 4, 5 ] } } } ``` @@ -300,94 +413,124 @@ A few power-tools allow for reading and operating on nested data. The most useful are `mergeDeep`, `getIn`, `setIn`, and `updateIn`, found on `List`, `Map` and `OrderedMap`. -```javascript -var nested2 = nested.mergeDeep({a:{b:{d:6}}}); + + +```js +const { fromJS } = require('immutable'); +const nested = fromJS({ a: { b: { c: [3, 4, 5] } } }); + +const nested2 = nested.mergeDeep({ a: { b: { d: 6 } } }); // Map { a: Map { b: Map { c: List [ 3, 4, 5 ], d: 6 } } } -``` -```javascript -nested2.getIn(['a', 'b', 'd']); // 6 +console.log(nested2.getIn(['a', 'b', 'd'])); // 6 -var nested3 = nested2.updateIn(['a', 'b', 'd'], value => value + 1); +const nested3 = nested2.updateIn(['a', 'b', 'd'], value => value + 1); +console.log(nested3); // Map { a: Map { b: Map { c: List [ 3, 4, 5 ], d: 7 } } } -var nested4 = nested3.updateIn(['a', 'b', 'c'], list => list.push(6)); +const nested4 = nested3.updateIn(['a', 'b', 'c'], list => list.push(6)); // Map { a: Map { b: Map { c: List [ 3, 4, 5, 6 ], d: 7 } } } ``` +## Equality treats Collections as Values -Lazy Seq --------- +Immutable.js collections are treated as pure data _values_. Two immutable +collections are considered _value equal_ (via `.equals()` or `is()`) if they +represent the same collection of values. This differs from JavaScript's typical +_reference equal_ (via `===` or `==`) for Objects and Arrays which only +determines if two variables represent references to the same object instance. -`Seq` describes a lazy operation, allowing them to efficiently chain -use of all the Iterable methods (such as `map` and `filter`). - -**Seq is immutable** — Once a Seq is created, it cannot be -changed, appended to, rearranged or otherwise modified. Instead, any mutative -method called on a Seq will return a new Seq. +Consider the example below where two identical `Map` instances are not +_reference equal_ but are _value equal_. -**Seq is lazy** — Seq does as little work as necessary to respond to any -method call. + -For example, the following does not perform any work, because the resulting -Seq is never used: - - var oddSquares = Immutable.Seq.of(1,2,3,4,5,6,7,8) - .filter(x => x % 2).map(x => x * x); - -Once the Seq is used, it performs only the work necessary. In this -example, no intermediate arrays are ever created, filter is called three times, -and map is only called twice: +```js +// First consider: +const obj1 = { a: 1, b: 2, c: 3 }; +const obj2 = { a: 1, b: 2, c: 3 }; +obj1 !== obj2; // two different instances are always not equal with === + +const { Map, is } = require('immutable'); +const map1 = Map({ a: 1, b: 2, c: 3 }); +const map2 = Map({ a: 1, b: 2, c: 3 }); +map1 !== map2; // two different instances are not reference-equal +map1.equals(map2); // but are value-equal if they have the same values +is(map1, map2); // alternatively can use the is() function +``` - console.log(oddSquares.get(1)); // 9 +Value equality allows Immutable.js collections to be used as keys in Maps or +values in Sets, and retrieved with different but equivalent collections: -Any collection can be converted to a lazy Seq with `.toSeq()`. + - var seq = Immutable.Map({a:1, b:1, c:1}).toSeq(); +```js +const { Map, Set } = require('immutable'); +const map1 = Map({ a: 1, b: 2, c: 3 }); +const map2 = Map({ a: 1, b: 2, c: 3 }); +const set = Set().add(map1); +set.has(map2); // true because these are value-equal +``` -Seq allow for the efficient chaining of sequence operations, especially when -converting to a different concrete type (such as to a JS object): +Note: `is()` uses the same measure of equality as [Object.is][] for scalar +strings and numbers, but uses value equality for Immutable collections, +determining if both are immutable and all keys and values are equal +using the same measure of equality. - seq.flip().map(key => key.toUpperCase()).flip().toObject(); - // Map { A: 1, B: 1, C: 1 } +[object.is]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is -As well as expressing logic that would otherwise seem memory-limited: +#### Performance tradeoffs - Immutable.Range(1, Infinity) - .skip(1000) - .map(n => -n) - .filter(n => n % 2 === 0) - .take(2) - .reduce((r, n) => r * n, 1); - // 1006008 +While value equality is useful in many circumstances, it has different +performance characteristics than reference equality. Understanding these +tradeoffs may help you decide which to use in each case, especially when used +to memoize some operation. -Note: An iterable is always iterated in the same order, however that order may -not always be well defined, as is the case for the `Map`. +When comparing two collections, value equality may require considering every +item in each collection, on an `O(N)` time complexity. For large collections of +values, this could become a costly operation. Though if the two are not equal +and hardly similar, the inequality is determined very quickly. In contrast, when +comparing two collections with reference equality, only the initial references +to memory need to be compared which is not based on the size of the collections, +which has an `O(1)` time complexity. Checking reference equality is always very +fast, however just because two collections are not reference-equal does not rule +out the possibility that they may be value-equal. +#### Return self on no-op optimization -Equality treats Collections as Data ------------------------------------ +When possible, Immutable.js avoids creating new objects for updates where no +change in _value_ occurred, to allow for efficient _reference equality_ checking +to quickly determine if no change occurred. -`Immutable` provides equality which treats immutable data structures as pure -data, performing a deep equality check if necessary. + -```javascript -var map1 = Immutable.Map({a:1, b:1, c:1}); -var map2 = Immutable.Map({a:1, b:1, c:1}); -assert(map1 !== map2); // two different instances -assert(Immutable.is(map1, map2)); // have equivalent values -assert(map1.equals(map2)); // alternatively use the equals method +```js +const { Map } = require('immutable'); +const originalMap = Map({ a: 1, b: 2, c: 3 }); +const updatedMap = originalMap.set('b', 2); +updatedMap === originalMap; // No-op .set() returned the original reference. ``` -`Immutable.is()` uses the same measure of equality as [Object.is][] -including if both are immutable and all keys and values are equal -using the same measure of equality. +However updates which do result in a change will return a new reference. Each +of these operations occur independently, so two similar updates will not return +the same reference: -[Object.is]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is + +```js +const { Map } = require('immutable'); +const originalMap = Map({ a: 1, b: 2, c: 3 }); +const updatedMap = originalMap.set('b', 1000); +// New instance, leaving the original immutable. +updatedMap !== originalMap; +const anotherUpdatedMap = originalMap.set('b', 1000); +// Despite both the results of the same operation, each created a new reference. +anotherUpdatedMap !== updatedMap; +// However the two are value equal. +anotherUpdatedMap.equals(updatedMap); +``` -Batching Mutations ------------------- +## Batching Mutations > If a tree falls in the woods, does it make a sound? > @@ -398,77 +541,221 @@ Batching Mutations Applying a mutation to create a new immutable object results in some overhead, which can add up to a minor performance penalty. If you need to apply a series -of mutations locally before returning, `Immutable` gives you the ability to +of mutations locally before returning, Immutable.js gives you the ability to create a temporary mutable (transient) copy of a collection and apply a batch of mutations in a performant manner by using `withMutations`. In fact, this is -exactly how `Immutable` applies complex mutations itself. +exactly how Immutable.js applies complex mutations itself. As an example, building `list2` results in the creation of 1, not 3, new immutable Lists. -```javascript -var list1 = Immutable.List.of(1,2,3); -var list2 = list1.withMutations(function (list) { + + +```js +const { List } = require('immutable'); +const list1 = List([1, 2, 3]); +const list2 = list1.withMutations(function (list) { list.push(4).push(5).push(6); }); -assert(list1.size === 3); -assert(list2.size === 6); +assert.equal(list1.size, 3); +assert.equal(list2.size, 6); ``` -Note: `immutable` also provides `asMutable` and `asImmutable`, but only +Note: Immutable.js also provides `asMutable` and `asImmutable`, but only encourages their use when `withMutations` will not suffice. Use caution to not return a mutable copy, which could result in undesired behavior. -*Important!*: Only a select few methods can be used in `withMutations` including +_Important!_: Only a select few methods can be used in `withMutations` including `set`, `push` and `pop`. These methods can be applied directly against a persistent data-structure where other methods like `map`, `filter`, `sort`, and `splice` will always return new immutable data-structures and never mutate a mutable collection. +## Lazy Seq + +`Seq` describes a lazy operation, allowing them to efficiently chain +use of all the higher-order collection methods (such as `map` and `filter`) +by not creating intermediate collections. + +**Seq is immutable** — Once a Seq is created, it cannot be +changed, appended to, rearranged or otherwise modified. Instead, any mutative +method called on a `Seq` will return a new `Seq`. + +**Seq is lazy** — `Seq` does as little work as necessary to respond to any +method call. Values are often created during iteration, including implicit +iteration when reducing or converting to a concrete data structure such as +a `List` or JavaScript `Array`. + +For example, the following performs no work, because the resulting +`Seq`'s values are never iterated: + +```js +const { Seq } = require('immutable'); +const oddSquares = Seq([1, 2, 3, 4, 5, 6, 7, 8]) + .filter(x => x % 2 !== 0) + .map(x => x * x); +``` + +Once the `Seq` is used, it performs only the work necessary. In this +example, no intermediate arrays are ever created, filter is called three +times, and map is only called once: + +```js +oddSquares.get(1); // 9 +``` + +Any collection can be converted to a lazy Seq with `Seq()`. -Documentation -------------- + -[Read the docs](http://facebook.github.io/immutable-js/docs/) and eat your vegetables. +```js +const { Map, Seq } = require('immutable'); +const map = Map({ a: 1, b: 2, c: 3 }); +const lazySeq = Seq(map); +``` + +`Seq` allows for the efficient chaining of operations, allowing for the +expression of logic that can otherwise be very tedious: + +```js +lazySeq + .flip() + .map(key => key.toUpperCase()) + .flip(); +// Seq { A: 1, B: 2, C: 3 } +``` + +As well as expressing logic that would otherwise seem memory or time +limited, for example `Range` is a special kind of Lazy sequence. + + + +```js +const { Range } = require('immutable'); +Range(1, Infinity) + .skip(1000) + .map(n => -n) + .filter(n => n % 2 === 0) + .take(2) + .reduce((r, n) => r * n, 1); +// 1006008 +``` + +## Comparison of filter(), groupBy(), and partition() + +The `filter()`, `groupBy()`, and `partition()` methods are similar in that they +all divide a collection into parts based on applying a function to each element. +All three call the predicate or grouping function once for each item in the +input collection. All three return zero or more collections of the same type as +their input. The returned collections are always distinct from the input +(according to `===`), even if the contents are identical. + +Of these methods, `filter()` is the only one that is lazy and the only one which +discards items from the input collection. It is the simplest to use, and the +fact that it returns exactly one collection makes it easy to combine with other +methods to form a pipeline of operations. + +The `partition()` method is similar to an eager version of `filter()`, but it +returns two collections; the first contains the items that would have been +discarded by `filter()`, and the second contains the items that would have been +kept. It always returns an array of exactly two collections, which can make it +easier to use than `groupBy()`. Compared to making two separate calls to +`filter()`, `partition()` makes half as many calls it the predicate passed to +it. + +The `groupBy()` method is a more generalized version of `partition()` that can +group by an arbitrary function rather than just a predicate. It returns a map +with zero or more entries, where the keys are the values returned by the +grouping function, and the values are nonempty collections of the corresponding +arguments. Although `groupBy()` is more powerful than `partition()`, it can be +harder to use because it is not always possible predict in advance how many +entries the returned map will have and what their keys will be. -Docs are automatically generated from [Immutable.d.ts](https://github.com/facebook/immutable-js/blob/master/type-definitions/Immutable.d.ts). -Please contribute! +| Summary | `filter` | `partition` | `groupBy` | +|:------------------------------|:---------|:------------|:---------------| +| ease of use | easiest | moderate | hardest | +| generality | least | moderate | most | +| laziness | lazy | eager | eager | +| # of returned sub-collections | 1 | 2 | 0 or more | +| sub-collections may be empty | yes | yes | no | +| can discard items | yes | no | no | +| wrapping container | none | array | Map/OrderedMap | -Also, don't miss the [Wiki](https://github.com/facebook/immutable-js/wiki) which -contains articles on specific topics. Can't find something? Open an [issue](https://github.com/facebook/immutable-js/issues). +## Additional Tools and Resources +- [Atom-store](https://github.com/jameshopkins/atom-store/) + - A Clojure-inspired atom implementation in Javascript with configurability + for external persistance. -Testing -------- +- [Chai Immutable](https://github.com/astorije/chai-immutable) + - If you are using the [Chai Assertion Library](https://chaijs.com/), this + provides a set of assertions to use against Immutable.js collections. -If you are using the [Chai Assertion Library](http://chaijs.com/), [Chai Immutable](https://github.com/astorije/chai-immutable) provides a set of assertions to use against `Immutable` collections. +- [Fantasy-land](https://github.com/fantasyland/fantasy-land) + - Specification for interoperability of common algebraic structures in JavaScript. +- [Immutagen](https://github.com/pelotom/immutagen) + - A library for simulating immutable generators in JavaScript. -Contribution ------------- +- [Immutable-cursor](https://github.com/redbadger/immutable-cursor) + - Immutable cursors incorporating the Immutable.js interface over + Clojure-inspired atom. -Use [Github issues](https://github.com/facebook/immutable-js/issues) for requests. +- [Immutable-ext](https://github.com/DrBoolean/immutable-ext) + - Fantasyland extensions for immutablejs -We actively welcome pull requests, learn how to [contribute](./CONTRIBUTING.md). +- [Immutable-js-tools](https://github.com/madeinfree/immutable-js-tools) + - Util tools for immutable.js +- [Immutable-Redux](https://github.com/gajus/redux-immutable) + - redux-immutable is used to create an equivalent function of Redux + combineReducers that works with Immutable.js state. -Changelog ---------- +- [Immutable-Treeutils](https://github.com/lukasbuenger/immutable-treeutils) + - Functional tree traversal helpers for ImmutableJS data structures. -Changes are tracked as [Github releases](https://github.com/facebook/immutable-js/releases). +- [Irecord](https://github.com/ericelliott/irecord) + - An immutable store that exposes an RxJS observable. Great for React. +- [Mudash](https://github.com/brianneisler/mudash) + - Lodash wrapper providing Immutable.JS support. -Thanks ------- +- [React-Immutable-PropTypes](https://github.com/HurricaneJames/react-immutable-proptypes) + - PropType validators that work with Immutable.js. + +- [Redux-Immutablejs](https://github.com/indexiatech/redux-immutablejs) + - Redux Immutable facilities. + +- [Rxstate](https://github.com/yamalight/rxstate) + - Simple opinionated state management library based on RxJS and Immutable.js. + +- [Transit-Immutable-js](https://github.com/glenjamin/transit-immutable-js) + - Transit serialisation for Immutable.js. + - See also: [Transit-js](https://github.com/cognitect/transit-js) + +Have an additional tool designed to work with Immutable.js? +Submit a PR to add it to this list in alphabetical order. + +## Contributing + +Use [Github issues](https://github.com/immutable-js/immutable-js/issues) for requests. + +We actively welcome pull requests, learn how to [contribute](https://github.com/immutable-js/immutable-js/blob/main/.github/CONTRIBUTING.md). + +Immutable.js is maintained within the [Contributor Covenant's Code of Conduct](https://www.contributor-covenant.org/version/2/0/code_of_conduct/). + +### Changelog + +Changes are tracked as [Github releases](https://github.com/immutable-js/immutable-js/releases). + +### License + +Immutable.js is [MIT-licensed](./LICENSE). + +### Thanks [Phil Bagwell](https://www.youtube.com/watch?v=K2NYwP90bNs), for his inspiration and research in persistent data structures. [Hugh Jackson](https://github.com/hughfdjackson/), for providing the npm package name. If you're looking for his unsupported package, see [this repository](https://github.com/hughfdjackson/immutable). - - -License -------- - -`Immutable` is [BSD-licensed](./LICENSE). We also provide an additional [patent grant](./PATENTS). diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000000..a1fdc82e73 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,17 @@ +# Security Policy + +## Supported Versions + +| Version | Supported | +| ------- | ------------------ | +| 5.1.x | :white_check_mark: | +| 5.0.x | :x: | +| 4.0.x | :white_check_mark: | +| < 4.0 | :x: | + +## Reporting a Vulnerability + +You can send an email to julien@deniau.me to report a security vulnerability. +Please be as specific as possible on how to reproduce and understand the issue. This way, we can fix the issue as fast as possible. + +I will try to reply to you in the following days (it might be sometime longer depending on my personal life). diff --git a/__tests__/ArraySeq.ts b/__tests__/ArraySeq.ts index a9c515ce4c..1068acb93e 100644 --- a/__tests__/ArraySeq.ts +++ b/__tests__/ArraySeq.ts @@ -1,48 +1,51 @@ -/// -/// -jest.autoMockOff(); - +import { describe, expect, it } from '@jest/globals'; import { Seq } from 'immutable'; describe('ArraySequence', () => { - it('every is true when predicate is true for all entries', () => { expect(Seq([]).every(() => false)).toBe(true); - expect(Seq([1,2,3]).every(v => v > 0)).toBe(true); - expect(Seq([1,2,3]).every(v => v < 3)).toBe(false); + expect(Seq([1, 2, 3]).every((v) => v > 0)).toBe(true); + expect(Seq([1, 2, 3]).every((v) => v < 3)).toBe(false); }); it('some is true when predicate is true for any entry', () => { expect(Seq([]).some(() => true)).toBe(false); - expect(Seq([1,2,3]).some(v => v > 0)).toBe(true); - expect(Seq([1,2,3]).some(v => v < 3)).toBe(true); - expect(Seq([1,2,3]).some(v => v > 1)).toBe(true); - expect(Seq([1,2,3]).some(v => v < 0)).toBe(false); + expect(Seq([1, 2, 3]).some((v) => v > 0)).toBe(true); + expect(Seq([1, 2, 3]).some((v) => v < 3)).toBe(true); + expect(Seq([1, 2, 3]).some((v) => v > 1)).toBe(true); + expect(Seq([1, 2, 3]).some((v) => v < 0)).toBe(false); }); it('maps', () => { - var i = Seq([1,2,3]); - var m = i.map(x => x + x).toObject(); - expect(m).toEqual([2,4,6]); + const i = Seq([1, 2, 3]); + const m = i.map((x) => x + x).toArray(); + expect(m).toEqual([2, 4, 6]); }); it('reduces', () => { - var i = Seq([1,2,3]); - var r = i.reduce((r, x) => r + x); + const i = Seq([1, 2, 3]); + const r = i.reduce((acc, x) => acc + x); expect(r).toEqual(6); }); it('efficiently chains iteration methods', () => { - var i = Seq('abcdefghijklmnopqrstuvwxyz'.split('')); + const i = Seq('abcdefghijklmnopqrstuvwxyz'.split('')); function studly(letter, index) { return index % 2 === 0 ? letter : letter.toUpperCase(); } - var result = i.reverse().take(10).reverse().take(5).map(studly).toArray().join(''); + const result = i + .reverse() + .take(10) + .reverse() + .take(5) + .map(studly) + .toArray() + .join(''); expect(result).toBe('qRsTu'); }); it('counts from the end of the sequence on negative index', () => { - var i = Seq.of(1, 2, 3, 4, 5, 6, 7); + const i = Seq([1, 2, 3, 4, 5, 6, 7]); expect(i.get(-1)).toBe(7); expect(i.get(-5)).toBe(3); expect(i.get(-9)).toBe(undefined); @@ -50,26 +53,26 @@ describe('ArraySequence', () => { }); it('handles trailing holes', () => { - var a = [1,2,3]; + const a = [1, 2, 3]; a.length = 10; - var seq = Seq(a); + const seq = Seq(a); expect(seq.size).toBe(10); expect(seq.toArray().length).toBe(10); - expect(seq.map(x => x*x).size).toBe(10); - expect(seq.map(x => x*x).toArray().length).toBe(10); + expect(seq.map((x) => x * x).size).toBe(10); + expect(seq.map((x) => x * x).toArray().length).toBe(10); expect(seq.skip(2).toArray().length).toBe(8); expect(seq.take(2).toArray().length).toBe(2); expect(seq.take(5).toArray().length).toBe(5); - expect(seq.filter(x => x%2==1).toArray().length).toBe(2); + expect(seq.filter((x) => x % 2 === 1).toArray().length).toBe(2); expect(seq.toKeyedSeq().flip().size).toBe(10); expect(seq.toKeyedSeq().flip().flip().size).toBe(10); expect(seq.toKeyedSeq().flip().flip().toArray().length).toBe(10); }); it('can be iterated', () => { - var a = [1,2,3]; - var seq = Seq(a); - var entries = seq.entries(); + const a = [1, 2, 3]; + const seq = Seq(a); + const entries = seq.entries(); expect(entries.next()).toEqual({ value: [0, 1], done: false }); expect(entries.next()).toEqual({ value: [1, 2], done: false }); expect(entries.next()).toEqual({ value: [2, 3], done: false }); @@ -77,10 +80,10 @@ describe('ArraySequence', () => { }); it('cannot be mutated after calling toArray', () => { - var seq = Seq(['A', 'B', 'C']); + const seq = Seq(['A', 'B', 'C']); - var firstReverse = Seq(seq.toArray().reverse()); - var secondReverse = Seq(seq.toArray().reverse()); + const firstReverse = Seq(seq.toArray().reverse()); + const secondReverse = Seq(seq.toArray().reverse()); expect(firstReverse.get(0)).toEqual('C'); expect(secondReverse.get(0)).toEqual('C'); diff --git a/__tests__/Comparator.ts b/__tests__/Comparator.ts new file mode 100644 index 0000000000..39ab3679fb --- /dev/null +++ b/__tests__/Comparator.ts @@ -0,0 +1,67 @@ +import { describe, expect, it } from '@jest/globals'; +import { List, OrderedSet, Seq, type Comparator, PairSorting } from 'immutable'; + +const sourceNumbers: readonly number[] = [3, 4, 5, 6, 7, 9, 10, 12, 90, 92, 95]; + +const expectedSortedNumbers: readonly number[] = [ + 7, 95, 90, 92, 3, 5, 9, 4, 6, 10, 12, +]; + +const testComparator: Comparator = (left, right) => { + //The number 7 always goes first... + if (left === 7) { + return PairSorting.LeftThenRight; + } else if (right === 7) { + return PairSorting.RightThenLeft; + } + + //...followed by numbers >= 90, then by all the others. + if (left >= 90 && right < 90) { + return PairSorting.LeftThenRight; + } else if (left < 90 && right >= 90) { + return PairSorting.RightThenLeft; + } + + //Within each group, even numbers go first... + if (left % 2 && !(right % 2)) { + return PairSorting.LeftThenRight; + } else if (!(left % 2) && right % 2) { + return PairSorting.RightThenLeft; + } + + //...and, finally, sort the numbers of each subgroup in ascending order. + return left - right; +}; + +describe.each([ + ['List', List], + ['OrderedSet', OrderedSet], + ['Seq.Indexed', Seq.Indexed], +])('Comparator applied to %s', (_collectionName, testCollectionConstructor) => { + const sourceCollection = testCollectionConstructor(sourceNumbers); + + const expectedSortedCollection = testCollectionConstructor( + expectedSortedNumbers + ); + + describe('when sorting', () => { + it('should support the enum as well as numeric return values', () => { + const actualCollection = sourceCollection.sort(testComparator); + expect(actualCollection).toEqual(expectedSortedCollection); + }); + }); + + describe('when retrieving the max value', () => { + it('should support the enum as well as numeric return values', () => { + const actualMax = sourceCollection.max(testComparator); + expect(actualMax).toBe(12); + }); + }); + + describe('when retrieving the min value', () => { + it('should support the enum as well as numeric return values', () => { + const actualMin = sourceCollection.min(testComparator); + expect(actualMin).toBe(7); + }); + }); +}); diff --git a/__tests__/Conversion.ts b/__tests__/Conversion.ts index d69a3b881f..5a008e7e55 100644 --- a/__tests__/Conversion.ts +++ b/__tests__/Conversion.ts @@ -1,150 +1,174 @@ -/// -/// - -jest.autoMockOff(); - -import * as jasmineCheck from 'jasmine-check'; -jasmineCheck.install(); - -import { Map, OrderedMap, List, Record, is, fromJS } from 'immutable'; - -declare function expect(val: any): ExpectWithIs; - -interface ExpectWithIs extends Expect { - is(expected: any): void; - not: ExpectWithIs; -} - -// Symbols -declare function Symbol(name: string): Object; +import { describe, expect, it } from '@jest/globals'; +import { fromJS, is, List, Map, OrderedMap, Record } from 'immutable'; +import fc, { type JsonValue } from 'fast-check'; describe('Conversion', () => { - - beforeEach(function () { - this.addMatchers({ - is: function(expected) { - return is(this.actual, expected); - } - }); - }); - // Note: order of keys based on Map's hashing order - var js = { + const js = { deepList: [ { - position: "first" + position: 'first', }, { - position: "second" + position: 'second', }, { - position: "third" + position: 'third', }, ], deepMap: { - a: "A", - b: "B" + a: 'A', + b: 'B', }, emptyMap: Object.create(null), - point: {x: 10, y: 20}, - string: "Hello", - list: [1, 2, 3] + point: { x: 10, y: 20 }, + string: 'Hello', + list: [1, 2, 3], }; - var Point = Record({x:0, y:0}, 'Point'); + const Point = Record({ x: 0, y: 0 }, 'Point'); - var immutableData = Map({ + const immutableData = Map({ deepList: List.of( Map({ - position: "first" + position: 'first', }), Map({ - position: "second" + position: 'second', }), Map({ - position: "third" + position: 'third', }) ), deepMap: Map({ - a: "A", - b: "B" + a: 'A', + b: 'B', }), emptyMap: Map(), - point: Map({x: 10, y: 20}), - string: "Hello", - list: List.of(1, 2, 3) + point: Map({ x: 10, y: 20 }), + string: 'Hello', + list: List.of(1, 2, 3), }); - var immutableOrderedData = OrderedMap({ + const immutableOrderedData = OrderedMap({ deepList: List.of( OrderedMap({ - position: "first" + position: 'first', }), OrderedMap({ - position: "second" + position: 'second', }), OrderedMap({ - position: "third" + position: 'third', }) ), deepMap: OrderedMap({ - a: "A", - b: "B" + a: 'A', + b: 'B', }), emptyMap: OrderedMap(), - point: new Point({x: 10, y: 20}), - string: "Hello", - list: List.of(1, 2, 3) + point: new Point({ x: 10, y: 20 }), + string: 'Hello', + list: List.of(1, 2, 3), }); - var immutableOrderedDataString = 'OrderedMap { ' + - '"deepList": List [ '+ - 'OrderedMap { '+ - '"position": "first"'+ - ' }, ' + - 'OrderedMap { '+ - '"position": "second"'+ - ' }, '+ - 'OrderedMap { '+ - '"position": "third"'+ - ' }' + - ' ], '+ - '"deepMap": OrderedMap { '+ - '"a": "A", '+ - '"b": "B"'+ - ' }, '+ + const immutableOrderedDataString = + 'OrderedMap { ' + + '"deepList": List [ ' + + 'OrderedMap { ' + + '"position": "first"' + + ' }, ' + + 'OrderedMap { ' + + '"position": "second"' + + ' }, ' + + 'OrderedMap { ' + + '"position": "third"' + + ' }' + + ' ], ' + + '"deepMap": OrderedMap { ' + + '"a": "A", ' + + '"b": "B"' + + ' }, ' + '"emptyMap": OrderedMap {}, ' + - '"point": Point { "x": 10, "y": 20 }, '+ - '"string": "Hello", '+ - '"list": List [ 1, 2, 3 ]'+ - ' }'; + '"point": Point { x: 10, y: 20 }, ' + + '"string": "Hello", ' + + '"list": List [ 1, 2, 3 ]' + + ' }'; - var nonStringKeyMap = OrderedMap().set(1, true).set(false, "foo"); - var nonStringKeyMapString = 'OrderedMap { 1: true, false: "foo" }'; + const nonStringKeyMap = OrderedMap().set(1, true).set(false, 'foo'); + const nonStringKeyMapString = 'OrderedMap { 1: true, false: "foo" }'; it('Converts deep JS to deep immutable sequences', () => { - expect(fromJS(js)).is(immutableData); + expect(fromJS(js)).toEqual(immutableData); + }); + + it('Throws when provided circular reference', () => { + type OType = { a: { b: { c: OType | null } } }; + + const o: OType = { a: { b: { c: null } } }; + o.a.b.c = o; + expect(() => fromJS(o)).toThrow( + 'Cannot convert circular structure to Immutable' + ); }); it('Converts deep JSON with custom conversion', () => { - var seq = fromJS(js, function (key, sequence) { + const seq = fromJS(js, function (key, sequence) { if (key === 'point') { + // @ts-expect-error -- to convert to real typing return new Point(sequence); } - return Array.isArray(this[key]) ? sequence.toList() : sequence.toOrderedMap(); + return Array.isArray(this[key]) + ? sequence.toList() + : sequence.toOrderedMap(); + }); + expect(seq).toEqual(immutableOrderedData); + expect(seq.toString()).toEqual(immutableOrderedDataString); + }); + + it('Converts deep JSON with custom conversion including keypath if requested', () => { + const paths: Array | undefined> = []; + // eslint-disable-next-line @typescript-eslint/no-unused-vars + const seq1 = fromJS(js, function (key, sequence, keypath) { + expect(arguments.length).toBe(3); + paths.push(keypath); + return Array.isArray(this[key]) + ? sequence.toList() + : sequence.toOrderedMap(); }); - expect(seq).is(immutableOrderedData); - expect(seq.toString()).is(immutableOrderedDataString); + expect(paths).toEqual([ + [], + ['deepList'], + ['deepList', 0], + ['deepList', 1], + ['deepList', 2], + ['deepMap'], + ['emptyMap'], + ['point'], + ['list'], + ]); + + // eslint-disable-next-line @typescript-eslint/no-unused-vars + const seq2 = fromJS(js, function (key, sequence) { + // eslint-disable-next-line prefer-rest-params + expect(arguments[2]).toBe(undefined); + }); + }); + + it('Prints keys as JS values', () => { + expect(nonStringKeyMap.toString()).toEqual(nonStringKeyMapString); }); - it('Prints keys as JSON values', () => { - expect(nonStringKeyMap.toString()).is(nonStringKeyMapString); + it('Converts deep sequences to JS', () => { + const js2 = immutableData.toJS(); + expect(is(js2, js)).toBe(false); // raw JS is not immutable. + expect(js2).toEqual(js); // but should be deep equal. }); - it('Converts deep sequences to JSON', () => { - var json = immutableData.toJS(); - expect(json).not.is(js); // raw JS is not immutable. - expect(json).toEqual(js); // but should be deep equal. + it('Converts shallowly to JS', () => { + const js2 = immutableData.toJSON(); + expect(js2).not.toEqual(js); + expect(js2.deepList).toBe(immutableData.get('deepList')); }); it('JSON.stringify() works equivalently on immutable sequences', () => { @@ -152,34 +176,43 @@ describe('Conversion', () => { }); it('JSON.stringify() respects toJSON methods on values', () => { - var Model = Record({}); - Model.prototype.toJSON = function() { return 'model'; } - expect( - Map({ a: new Model() }).toJS() - ).toEqual({ "a": {} }); - expect( - JSON.stringify(Map({ a: new Model() })) - ).toEqual('{"a":"model"}'); + const Model = Record({}); + Model.prototype.toJSON = function () { + return 'model'; + }; + expect(Map({ a: new Model() }).toJS()).toEqual({ a: {} }); + expect(JSON.stringify(Map({ a: new Model() }))).toEqual('{"a":"model"}'); }); it('is conservative with array-likes, only accepting true Arrays.', () => { - expect(fromJS({1: 2, length: 3})).is( + expect(fromJS({ 1: 2, length: 3 })).toEqual( Map().set('1', 2).set('length', 3) ); expect(fromJS('string')).toEqual('string'); }); - check.it('toJS isomorphic value', {maxSize: 30}, [gen.JSONValue], (js) => { - var imm = fromJS(js); - expect(imm && imm.toJS ? imm.toJS() : imm).toEqual(js); + it('toJS isomorphic value', () => { + fc.assert( + fc.property(fc.jsonValue(), (v: JsonValue) => { + const imm = fromJS(v); + expect( + // @ts-expect-error Property 'toJS' does not exist on type '{}'.ts(2339) + imm && imm.toJS ? imm.toJS() : imm + ).toEqual(v); + }), + { numRuns: 30 } + ); }); it('Explicitly convert values to string using String constructor', () => { - expect(() => { - fromJS({ foo: Symbol('bar') }) + ''; - Map().set('foo', Symbol('bar')) + ''; - Map().set(Symbol('bar'), 'foo') + ''; - }).not.toThrow(); + expect(() => fromJS({ foo: Symbol('bar') }) + '').not.toThrow(); + expect(() => Map().set('foo', Symbol('bar')) + '').not.toThrow(); + expect(() => Map().set(Symbol('bar'), 'foo') + '').not.toThrow(); }); + it('Converts an immutable value of an entry correctly', () => { + const arr = [{ key: 'a' }]; + const result = fromJS(arr).entrySeq().toJS(); + expect(result).toEqual([[0, { key: 'a' }]]); + }); }); diff --git a/__tests__/Equality.ts b/__tests__/Equality.ts index c870af11e2..ae95ef4a12 100644 --- a/__tests__/Equality.ts +++ b/__tests__/Equality.ts @@ -1,26 +1,19 @@ -/// -/// - -jest.autoMockOff(); - -import * as jasmineCheck from 'jasmine-check'; -jasmineCheck.install(); - -import { List, Map, Set, Seq, is } from 'immutable'; +import { describe, expect, it } from '@jest/globals'; +import { is, List, Map, Seq, Set } from 'immutable'; +import fc from 'fast-check'; describe('Equality', () => { - function expectIs(left, right) { - var comparison = is(left, right); + const comparison = is(left, right); expect(comparison).toBe(true); - var commutative = is(right, left); + const commutative = is(right, left); expect(commutative).toBe(true); } function expectIsNot(left, right) { - var comparison = is(left, right); + const comparison = is(left, right); expect(comparison).toBe(false); - var commutative = is(right, left); + const commutative = is(right, left); expect(commutative).toBe(false); } @@ -41,109 +34,127 @@ describe('Equality', () => { // Note: Unlike Object.is, is assumes 0 and -0 are the same value, // matching the behavior of ES6 Map key equality. expectIs(0, -0); - expectIs(NaN, 0/0); + expectIs(NaN, 0 / 0); - var string = "hello"; - expectIs(string, string); - expectIs(string, "hello"); - expectIsNot("hello", "HELLO"); - expectIsNot("hello", "goodbye"); + const str = 'hello'; + expectIs(str, str); + expectIs(str, 'hello'); + expectIsNot('hello', 'HELLO'); + expectIsNot('hello', 'goodbye'); - var array = [1,2,3]; + const array = [1, 2, 3]; expectIs(array, array); - expectIsNot(array, [1,2,3]); + expectIsNot(array, [1, 2, 3]); - var object = {key:'value'}; + const object = { key: 'value' }; expectIs(object, object); - expectIsNot(object, {key:'value'}); + expectIsNot(object, { key: 'value' }); }); it('dereferences things', () => { - var ptrA = {foo: 1}, ptrB = {foo: 2}; + const ptrA = { foo: 1 }; + const ptrB = { foo: 2 }; expectIsNot(ptrA, ptrB); - ptrA.valueOf = ptrB.valueOf = function() { + ptrA.valueOf = ptrB.valueOf = function () { return 5; - } + }; expectIs(ptrA, ptrB); - var object = {key:'value'}; - ptrA.valueOf = ptrB.valueOf = function() { + const object = { key: 'value' }; + ptrA.valueOf = ptrB.valueOf = function () { return object; - } + }; expectIs(ptrA, ptrB); - ptrA.valueOf = ptrB.valueOf = function() { - return null; - } + ptrA.valueOf = ptrB.valueOf = function () { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + return null as any; + }; expectIs(ptrA, ptrB); - ptrA.valueOf = ptrB.valueOf = function() { - return void 0; - } + ptrA.valueOf = ptrB.valueOf = function () { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + return undefined as any; + }; expectIs(ptrA, ptrB); - ptrA.valueOf = function() { + ptrA.valueOf = function () { return 4; - } - ptrB.valueOf = function() { + }; + ptrB.valueOf = function () { return 5; - } + }; expectIsNot(ptrA, ptrB); }); it('compares sequences', () => { - var arraySeq = Seq.of(1,2,3); - var arraySeq2 = Seq([1,2,3]); + const arraySeq = Seq([1, 2, 3]); + const arraySeq2 = Seq([1, 2, 3]); expectIs(arraySeq, arraySeq); - expectIs(arraySeq, Seq.of(1,2,3)); + expectIs(arraySeq, Seq([1, 2, 3])); expectIs(arraySeq2, arraySeq2); - expectIs(arraySeq2, Seq([1,2,3])); - expectIsNot(arraySeq, [1,2,3]); - expectIsNot(arraySeq2, [1,2,3]); + expectIs(arraySeq2, Seq([1, 2, 3])); + expectIsNot(arraySeq, [1, 2, 3]); + expectIsNot(arraySeq2, [1, 2, 3]); expectIs(arraySeq, arraySeq2); - expectIs(arraySeq, arraySeq.map(x => x)); - expectIs(arraySeq2, arraySeq2.map(x => x)); + expectIs( + arraySeq, + arraySeq.map((x) => x) + ); + expectIs( + arraySeq2, + arraySeq2.map((x) => x) + ); }); it('compares lists', () => { - var list = List.of(1,2,3); + const list = List([1, 2, 3]); expectIs(list, list); - expectIsNot(list, [1,2,3]); + expectIsNot(list, [1, 2, 3]); - expectIs(list, Seq.of(1,2,3)); - expectIs(list, List.of(1,2,3)); + expectIs(list, Seq([1, 2, 3])); + expectIs(list, List([1, 2, 3])); - var listLonger = list.push(4); + const listLonger = list.push(4); expectIsNot(list, listLonger); - var listShorter = listLonger.pop(); + const listShorter = listLonger.pop(); expect(list === listShorter).toBe(false); expectIs(list, listShorter); }); - var genSimpleVal = gen.returnOneOf(['A', 1]); - - var genVal = gen.oneOf([ - gen.map(List, gen.array(genSimpleVal, 0, 4)), - gen.map(Set, gen.array(genSimpleVal, 0, 4)), - gen.map(Map, gen.array(gen.array(genSimpleVal, 2), 0, 4)) - ]); - - check.it('has symmetric equality', {times: 1000}, [genVal, genVal], (a, b) => { - expect(is(a, b)).toBe(is(b, a)); + const genSimpleVal = fc.oneof(fc.constant('A'), fc.constant(1)); + + const genVal = fc.oneof( + fc.array(genSimpleVal, { minLength: 0, maxLength: 4 }).map(List), + fc.array(genSimpleVal, { minLength: 0, maxLength: 4 }).map(Set), + fc + .array(fc.array(genSimpleVal, { minLength: 2, maxLength: 2 }), { + minLength: 0, + maxLength: 4, + }) + .map(Map) + ); + + it('has symmetric equality', () => { + fc.assert( + fc.property(genVal, genVal, (a, b) => { + expect(is(a, b)).toBe(is(b, a)); + }), + { numRuns: 1000 } + ); }); - check.it('has hash equality', {times: 1000}, [genVal, genVal], (a, b) => { - if (is(a, b)) { - expect(a.hashCode()).toBe(b.hashCode()); - } + it('has hash symmetry', () => { + fc.assert( + fc.property(genVal, genVal, (a, b) => { + if (is(a, b)) { + // eslint-disable-next-line jest/no-conditional-expect + expect(a.hashCode()).toBe(b.hashCode()); + } + }), + { numRuns: 1000 } + ); }); describe('hash', () => { - it('differentiates decimals', () => { - expect( - Seq.of(1.5).hashCode() - ).not.toBe( - Seq.of(1.6).hashCode() - ); + expect(Seq([1.5]).hashCode()).not.toBe(Seq([1.6]).hashCode()); }); - }); - }); diff --git a/__tests__/IndexedSeq.ts b/__tests__/IndexedSeq.ts index 0d62a07256..9d33c234e0 100644 --- a/__tests__/IndexedSeq.ts +++ b/__tests__/IndexedSeq.ts @@ -1,34 +1,27 @@ -/// -/// -jest.autoMockOff(); - -import * as jasmineCheck from 'jasmine-check'; -jasmineCheck.install(); - +import { describe, expect, it } from '@jest/globals'; import { Seq } from 'immutable'; describe('IndexedSequence', () => { - it('maintains skipped offset', () => { - var seq = Seq(['A', 'B', 'C', 'D', 'E']); + const seq = Seq(['A', 'B', 'C', 'D', 'E']); // This is what we expect for IndexedSequences - var operated = seq.skip(1); + const operated = seq.skip(1); expect(operated.entrySeq().toArray()).toEqual([ [0, 'B'], [1, 'C'], [2, 'D'], - [3, 'E'] + [3, 'E'], ]); expect(operated.first()).toEqual('B'); }); it('reverses correctly', () => { - var seq = Seq(['A', 'B', 'C', 'D', 'E']); + const seq = Seq(['A', 'B', 'C', 'D', 'E']); // This is what we expect for IndexedSequences - var operated = seq.reverse(); + const operated = seq.reverse(); expect(operated.get(0)).toEqual('E'); expect(operated.get(1)).toEqual('D'); expect(operated.get(4)).toEqual('A'); @@ -38,7 +31,7 @@ describe('IndexedSequence', () => { }); it('negative indexes correctly', () => { - var seq = Seq(['A', 'B', 'C', 'D', 'E']); + const seq = Seq(['A', 'B', 'C', 'D', 'E']); expect(seq.first()).toEqual('A'); expect(seq.last()).toEqual('E'); @@ -46,7 +39,7 @@ describe('IndexedSequence', () => { expect(seq.get(2)).toEqual('C'); expect(seq.get(-2)).toEqual('D'); - var indexes = seq.keySeq(); + const indexes = seq.keySeq(); expect(indexes.first()).toEqual(0); expect(indexes.last()).toEqual(4); expect(indexes.get(-0)).toEqual(0); diff --git a/__tests__/IterableSeq.ts b/__tests__/IterableSeq.ts deleted file mode 100644 index 16ff762858..0000000000 --- a/__tests__/IterableSeq.ts +++ /dev/null @@ -1,181 +0,0 @@ -/// -/// -declare var Symbol: any; -jest.autoMockOff(); - -import { Seq } from 'immutable'; - -describe('IterableSequence', () => { - - it('creates a sequence from an iterable', () => { - var i = new SimpleIterable(); - var s = Seq(i); - expect(s.take(5).toArray()).toEqual([ 0,1,2,3,4 ]); - }) - - it('is stable', () => { - var i = new SimpleIterable(); - var s = Seq(i); - expect(s.take(5).toArray()).toEqual([ 0,1,2,3,4 ]); - expect(s.take(5).toArray()).toEqual([ 0,1,2,3,4 ]); - expect(s.take(5).take(Infinity).toArray()).toEqual([ 0,1,2,3,4 ]); - expect(s.take(5).toArray()).toEqual([ 0,1,2,3,4 ]); - }) - - it('counts iterations', () => { - var i = new SimpleIterable(10); - var s = Seq(i); - expect(s.forEach(x => x)).toEqual(10); - expect(s.take(5).forEach(x => x)).toEqual(5); - expect(s.forEach(x => x < 3)).toEqual(4); - }) - - it('creates a new iterator on every operations', () => { - var mockFn = jest.genMockFunction(); - var i = new SimpleIterable(3, mockFn); - var s = Seq(i); - expect(s.toArray()).toEqual([ 0,1,2 ]); - expect(mockFn.mock.calls).toEqual([[0],[1],[2]]); - // The iterator is recreated for the second time. - expect(s.toArray()).toEqual([ 0,1,2 ]); - expect(mockFn.mock.calls).toEqual([[0],[1],[2],[0],[1],[2]]); - }) - - it('can be iterated', () => { - var mockFn = jest.genMockFunction(); - var i = new SimpleIterable(3, mockFn); - var seq = Seq(i); - var entries = seq.entries(); - expect(entries.next()).toEqual({ value: [0, 0], done: false }); - // The iteration is lazy - expect(mockFn.mock.calls).toEqual([[0]]); - expect(entries.next()).toEqual({ value: [1, 1], done: false }); - expect(entries.next()).toEqual({ value: [2, 2], done: false }); - expect(entries.next()).toEqual({ value: undefined, done: true }); - expect(mockFn.mock.calls).toEqual([[0],[1],[2]]); - // The iterator is recreated for the second time. - entries = seq.entries(); - expect(entries.next()).toEqual({ value: [0, 0], done: false }); - expect(entries.next()).toEqual({ value: [1, 1], done: false }); - expect(entries.next()).toEqual({ value: [2, 2], done: false }); - expect(entries.next()).toEqual({ value: undefined, done: true }); - expect(mockFn.mock.calls).toEqual([[0],[1],[2],[0],[1],[2]]); - }) - - it('can be mapped and filtered', () => { - var mockFn = jest.genMockFunction(); - var i = new SimpleIterable(undefined, mockFn); // infinite - var seq = Seq(i) - .filter(x => x % 2 === 1) - .map(x => x * x); - var entries = seq.entries(); - expect(entries.next()).toEqual({ value: [0, 1], done: false }); - expect(entries.next()).toEqual({ value: [1, 9], done: false }); - expect(entries.next()).toEqual({ value: [2, 25], done: false }); - expect(mockFn.mock.calls).toEqual([[0],[1],[2],[3],[4],[5]]); - }) - - describe('IteratorSequence', () => { - - it('creates a sequence from a raw iterable', () => { - var i = new SimpleIterable(10); - var s = Seq(i[ITERATOR_SYMBOL]()); - expect(s.take(5).toArray()).toEqual([ 0,1,2,3,4 ]); - }) - - it('is stable', () => { - var i = new SimpleIterable(10); - var s = Seq(i[ITERATOR_SYMBOL]()); - expect(s.take(5).toArray()).toEqual([ 0,1,2,3,4 ]); - expect(s.take(5).toArray()).toEqual([ 0,1,2,3,4 ]); - expect(s.take(5).toArray()).toEqual([ 0,1,2,3,4 ]); - }) - - it('counts iterations', () => { - var i = new SimpleIterable(10); - var s = Seq(i[ITERATOR_SYMBOL]()); - expect(s.forEach(x => x)).toEqual(10); - expect(s.take(5).forEach(x => x)).toEqual(5); - expect(s.forEach(x => x < 3)).toEqual(4); - }) - - it('memoizes the iterator', () => { - var mockFn = jest.genMockFunction(); - var i = new SimpleIterable(10, mockFn); - var s = Seq(i[ITERATOR_SYMBOL]()); - expect(s.take(3).toArray()).toEqual([ 0,1,2 ]); - expect(mockFn.mock.calls).toEqual([[0],[1],[2]]); - - // Second call uses memoized values - expect(s.take(3).toArray()).toEqual([ 0,1,2 ]); - expect(mockFn.mock.calls).toEqual([[0],[1],[2]]); - - // Further ahead in the iterator yields more results. - expect(s.take(5).toArray()).toEqual([ 0,1,2,3,4 ]); - expect(mockFn.mock.calls).toEqual([[0],[1],[2],[3],[4]]); - }) - - it('can be iterated', () => { - var mockFn = jest.genMockFunction(); - var i = new SimpleIterable(3, mockFn); - var seq = Seq(i[ITERATOR_SYMBOL]()); - var entries = seq.entries(); - expect(entries.next()).toEqual({ value: [0, 0], done: false }); - // The iteration is lazy - expect(mockFn.mock.calls).toEqual([[0]]); - expect(entries.next()).toEqual({ value: [1, 1], done: false }); - expect(entries.next()).toEqual({ value: [2, 2], done: false }); - expect(entries.next()).toEqual({ value: undefined, done: true }); - expect(mockFn.mock.calls).toEqual([[0],[1],[2]]); - // The iterator has been memoized for the second time. - entries = seq.entries(); - expect(entries.next()).toEqual({ value: [0, 0], done: false }); - expect(entries.next()).toEqual({ value: [1, 1], done: false }); - expect(entries.next()).toEqual({ value: [2, 2], done: false }); - expect(entries.next()).toEqual({ value: undefined, done: true }); - expect(mockFn.mock.calls).toEqual([[0],[1],[2]]); - }) - - it('can iterate an skipped seq based on an iterator', () => { - var i = new SimpleIterable(4); - var seq = Seq(i[ITERATOR_SYMBOL]()); - expect(seq.size).toBe(undefined); - var skipped = seq.skip(2); - expect(skipped.size).toBe(undefined); - var iter = skipped[ITERATOR_SYMBOL](); - // The first two were skipped - expect(iter.next()).toEqual({ value: 2, done: false }); - expect(iter.next()).toEqual({ value: 3, done: false }); - expect(iter.next()).toEqual({ value: undefined, done: true }); - }) - }) - -}) - - -// Helper for this test -var ITERATOR_SYMBOL = - typeof Symbol === 'function' && Symbol.iterator || '@@iterator'; - -function SimpleIterable(max?: number, watcher?: any) { - this.max = max; - this.watcher = watcher; -} -SimpleIterable.prototype[ITERATOR_SYMBOL] = function() { - return new SimpleIterator(this); -} - -function SimpleIterator(iterable) { - this.iterable = iterable; - this.value = 0; -} -SimpleIterator.prototype.next = function() { - if (this.value >= this.iterable.max) { - return { value: undefined, done: true }; - } - this.iterable.watcher && this.iterable.watcher(this.value); - return { value: this.value++, done: false }; -} -SimpleIterator.prototype[ITERATOR_SYMBOL] = function() { - return this; -} diff --git a/__tests__/KeyedSeq.ts b/__tests__/KeyedSeq.ts index 2562262b8a..528c28f523 100644 --- a/__tests__/KeyedSeq.ts +++ b/__tests__/KeyedSeq.ts @@ -1,35 +1,34 @@ -/// -/// -jest.autoMockOff(); - -import * as jasmineCheck from 'jasmine-check'; -jasmineCheck.install(); - -import { Seq, Range } from 'immutable'; +import { describe, expect, it } from '@jest/globals'; +import { Range, Seq } from 'immutable'; +import fc from 'fast-check'; describe('KeyedSeq', () => { - - check.it('it iterates equivalently', [gen.array(gen.int)], (ints) => { - var seq = Seq(ints); - var keyed = seq.toKeyedSeq(); - - var seqEntries = seq.entries(); - var keyedEntries = keyed.entries(); - - var seqStep, keyedStep; - do { - seqStep = seqEntries.next(); - keyedStep = keyedEntries.next(); - expect(keyedStep).toEqual(seqStep); - } while (!seqStep.done); + it('iterates equivalently', () => { + fc.assert( + fc.property(fc.array(fc.integer()), (ints) => { + const seq = Seq(ints); + const keyed = seq.toKeyedSeq(); + + const seqEntries = seq.entries(); + const keyedEntries = keyed.entries(); + + let seqStep; + let keyedStep; + do { + seqStep = seqEntries.next(); + keyedStep = keyedEntries.next(); + expect(keyedStep).toEqual(seqStep); + } while (!seqStep.done); + }) + ); }); it('maintains keys', () => { - var isEven = x => x % 2 === 0; - var seq = Range(0, 100); + const isEven = (x) => x % 2 === 0; + const seq = Range(0, 100); // This is what we expect for IndexedSequences - var operated = seq.filter(isEven).skip(10).take(5); + const operated = seq.filter(isEven).skip(10).take(5); expect(operated.entrySeq().toArray()).toEqual([ [0, 20], [1, 22], @@ -37,10 +36,27 @@ describe('KeyedSeq', () => { [3, 26], [4, 28], ]); + const [indexed0, indexed1] = seq + .partition(isEven) + .map((part) => part.skip(10).take(5)); + expect(indexed0.entrySeq().toArray()).toEqual([ + [0, 21], + [1, 23], + [2, 25], + [3, 27], + [4, 29], + ]); + expect(indexed1.entrySeq().toArray()).toEqual([ + [0, 20], + [1, 22], + [2, 24], + [3, 26], + [4, 28], + ]); // Where Keyed Sequences maintain keys. - var keyed = seq.toKeyedSeq(); - var keyedOperated = keyed.filter(isEven).skip(10).take(5); + const keyed = seq.toKeyedSeq(); + const keyedOperated = keyed.filter(isEven).skip(10).take(5); expect(keyedOperated.entrySeq().toArray()).toEqual([ [20, 20], [22, 22], @@ -48,10 +64,27 @@ describe('KeyedSeq', () => { [26, 26], [28, 28], ]); + const [keyed0, keyed1] = keyed + .partition(isEven) + .map((part) => part.skip(10).take(5)); + expect(keyed0.entrySeq().toArray()).toEqual([ + [21, 21], + [23, 23], + [25, 25], + [27, 27], + [29, 29], + ]); + expect(keyed1.entrySeq().toArray()).toEqual([ + [20, 20], + [22, 22], + [24, 24], + [26, 26], + [28, 28], + ]); }); it('works with reverse', () => { - var seq = Range(0, 100); + const seq = Range(0, 100); // This is what we expect for IndexedSequences expect(seq.reverse().take(5).entrySeq().toArray()).toEqual([ @@ -73,10 +106,12 @@ describe('KeyedSeq', () => { }); it('works with double reverse', () => { - var seq = Range(0, 100); + const seq = Range(0, 100); // This is what we expect for IndexedSequences - expect(seq.reverse().skip(10).take(5).reverse().entrySeq().toArray()).toEqual([ + expect( + seq.reverse().skip(10).take(5).reverse().entrySeq().toArray() + ).toEqual([ [0, 85], [1, 86], [2, 87], @@ -85,7 +120,9 @@ describe('KeyedSeq', () => { ]); // Where Keyed Sequences maintain keys. - expect(seq.reverse().toKeyedSeq().skip(10).take(5).reverse().entrySeq().toArray()).toEqual([ + expect( + seq.reverse().toKeyedSeq().skip(10).take(5).reverse().entrySeq().toArray() + ).toEqual([ [14, 85], [13, 86], [12, 87], @@ -93,5 +130,4 @@ describe('KeyedSeq', () => { [10, 89], ]); }); - }); diff --git a/__tests__/List.ts b/__tests__/List.ts index e285367f1e..da2e9d996b 100644 --- a/__tests__/List.ts +++ b/__tests__/List.ts @@ -1,94 +1,181 @@ -/// -/// - -jest.autoMockOff(); - -import * as jasmineCheck from 'jasmine-check'; -jasmineCheck.install(); - -import { List, Range, Seq, Set, fromJS } from 'immutable'; - -function arrayOfSize(s) { - var a = new Array(s); - for (var ii = 0; ii < s; ii++) { +import { describe, expect, it } from '@jest/globals'; +import { fromJS, List, Map, Range, Seq, Set } from 'immutable'; +import fc from 'fast-check'; +import { create as createSeed } from 'random-seed'; + +function arrayOfSize(s: number) { + const a = new Array(s); + for (let ii = 0; ii < s; ii++) { a[ii] = ii; } return a; } describe('List', () => { + it('determines assignment of unspecified value types', () => { + interface Test { + list: List; + } + + const t: Test = { + list: List(), + }; + + expect(t.list.size).toBe(0); + }); it('of provides initial values', () => { - var v = List.of('a', 'b', 'c'); + const v = List.of('a', 'b', 'c'); expect(v.get(0)).toBe('a'); expect(v.get(1)).toBe('b'); expect(v.get(2)).toBe('c'); }); it('toArray provides a JS array', () => { - var v = List.of('a', 'b', 'c'); + const v = List.of('a', 'b', 'c'); expect(v.toArray()).toEqual(['a', 'b', 'c']); }); it('does not accept a scalar', () => { expect(() => { + // @ts-expect-error -- test that runtime does throw List(3); - }).toThrow('Expected Array or iterable object of values: 3'); + }).toThrow('Expected Array or collection object of values: 3'); }); it('accepts an array', () => { - var v = List(['a', 'b', 'c']); + const v = List(['a', 'b', 'c']); expect(v.get(1)).toBe('b'); expect(v.toArray()).toEqual(['a', 'b', 'c']); }); it('accepts an array-like', () => { - var v = List({ 'length': 3, '1': 'b' }); - expect(v.get(1)).toBe('b'); - expect(v.toArray()).toEqual([undefined, 'b', undefined]); + const v = List({ length: 3, 2: 'c' }); + expect(v.get(2)).toBe('c'); + expect(v.toArray()).toEqual([undefined, undefined, 'c']); }); - it('accepts any array-like iterable, including strings', () => { - var v = List('abc'); + it('accepts any array-like collection, including strings', () => { + const v = List('abc'); expect(v.get(1)).toBe('b'); expect(v.toArray()).toEqual(['a', 'b', 'c']); }); it('accepts an indexed Seq', () => { - var seq = Seq(['a', 'b', 'c']); - var v = List(seq); + const seq = Seq(['a', 'b', 'c']); + const v = List(seq); expect(v.toArray()).toEqual(['a', 'b', 'c']); }); it('accepts a keyed Seq as a list of entries', () => { - var seq = Seq({a:null, b:null, c:null}).flip(); - var v = List(seq); - expect(v.toArray()).toEqual([[null,'a'], [null,'b'], [null,'c']]); + const seq = Seq({ a: null, b: null, c: null }).flip(); + const v = List(seq); + expect(v.toArray()).toEqual([ + [null, 'a'], + [null, 'b'], + [null, 'c'], + ]); // Explicitly getting the values sequence - var v2 = List(seq.valueSeq()); - expect(v2.toArray()).toEqual(['a','b','c']); + const v2 = List(seq.valueSeq()); + expect(v2.toArray()).toEqual(['a', 'b', 'c']); // toList() does this for you. - var v3 = seq.toList(); + const v3 = seq.toList(); expect(v3.toArray()).toEqual(['a', 'b', 'c']); }); it('can set and get a value', () => { - var v = List(); + let v = List(); expect(v.get(0)).toBe(undefined); v = v.set(0, 'value'); expect(v.get(0)).toBe('value'); }); + it('can setIn and getIn a deep value', () => { + let v = List([ + Map({ + aKey: List(['bad', 'good']), + }), + ]); + expect(v.getIn([0, 'aKey', 1])).toBe('good'); + v = v.setIn([0, 'aKey', 1], 'great'); + expect(v.getIn([0, 'aKey', 1])).toBe('great'); + }); + + it('can setIn on an inexistant index', () => { + const myMap = Map<{ a: Array; b: Array; c?: List }>( + { a: [], b: [] } + ); + const out = myMap.setIn(['a', 0], 'v').setIn(['c', 0], 'v'); + + expect(out.getIn(['a', 0])).toEqual('v'); + expect(out.getIn(['c', 0])).toEqual('v'); + expect(out.get('a')).toBeInstanceOf(Array); + expect(out.get('b')).toBeInstanceOf(Array); + expect(out.get('c')).toBeInstanceOf(Map); + expect(out.get('c')?.keySeq().first()).toBe(0); + }); + + it('throw when calling setIn on a non data structure', () => { + const avengers = [ + 'ironMan', // index [0] + [ + 'captainAmerica', // index [1][0] + [ + 'blackWidow', // index [1][1][0] + ['theHulk'], // index [1][1][1][0] + ], + ], + ]; + + const avengersList = fromJS(avengers) as List; + + // change theHulk to scarletWitch + const out1 = avengersList.setIn([1, 1, 1, 0], 'scarletWitch'); + expect(out1.getIn([1, 1, 1, 0])).toEqual('scarletWitch'); + + const out2 = avengersList.setIn([1, 1, 1, 3], 'scarletWitch'); + expect(out2.getIn([1, 1, 1, 3])).toEqual('scarletWitch'); + + expect(() => { + avengersList.setIn([0, 1], 'scarletWitch'); + }).toThrow( + 'Cannot update within non-data-structure value in path [0]: ironMan' + ); + }); + + it('can update a value', () => { + const l = List.of(5); + // @ts-expect-error -- Type definition limitation + expect(l.update(0, (v) => v * v).toArray()).toEqual([25]); + }); + + it('can updateIn a deep value', () => { + let l = List([ + Map({ + aKey: List(['bad', 'good']), + }), + ]); + // @ts-expect-error -- Type definition limitation + l = l.updateIn([0, 'aKey', 1], (v) => v + v); + expect(l.toJS()).toEqual([ + { + aKey: ['bad', 'goodgood'], + }, + ]); + }); + it('returns undefined when getting a null value', () => { - var v = List([1, 2, 3]); + const v = List([1, 2, 3]); + // @ts-expect-error -- test runtime expect(v.get(null)).toBe(undefined); - var o = List([{ a: 1 },{ b: 2 }, { c: 3 }]); + const o = List([{ a: 1 }, { b: 2 }, { c: 3 }]); + // @ts-expect-error -- test runtime expect(o.get(null)).toBe(undefined); }); it('counts from the end of the list on negative index', () => { - var i = List.of(1, 2, 3, 4, 5, 6, 7); + const i = List.of(1, 2, 3, 4, 5, 6, 7); expect(i.get(-1)).toBe(7); expect(i.get(-5)).toBe(3); expect(i.get(-9)).toBe(undefined); @@ -97,7 +184,8 @@ describe('List', () => { it('coerces numeric-string keys', () => { // Of course, TypeScript protects us from this, so cast to "any" to test. - var i: any = List.of(1, 2, 3, 4, 5, 6); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const i: any = List.of(1, 2, 3, 4, 5, 6); expect(i.get('1')).toBe(2); expect(i.set('3', 10).get('3')).toBe(10); // Like array, string negative numbers do not qualify @@ -107,52 +195,67 @@ describe('List', () => { }); it('uses not set value for string index', () => { - var list: any = List(); + const list = List(); + // @ts-expect-error -- test runtime expect(list.get('stringKey', 'NOT-SET')).toBe('NOT-SET'); }); it('uses not set value for index {}', () => { - var list: any = List.of(1, 2, 3, 4, 5); + const list = List.of(1, 2, 3, 4, 5); + // @ts-expect-error -- test runtime expect(list.get({}, 'NOT-SET')).toBe('NOT-SET'); }); it('uses not set value for index void 0', () => { - var list: any = List.of(1, 2, 3, 4, 5); + const list = List.of(1, 2, 3, 4, 5); + // @ts-expect-error -- test runtime + expect(list.get(void 0, 'NOT-SET')).toBe('NOT-SET'); }); it('uses not set value for index undefined', () => { - var list: any = List.of(1, 2, 3, 4, 5); + const list = List.of(1, 2, 3, 4, 5); + // @ts-expect-error -- test runtime expect(list.get(undefined, 'NOT-SET')).toBe('NOT-SET'); }); it('doesnt coerce empty strings to index 0', () => { - var list: any = List.of(1, 2, 3); + const list = List.of(1, 2, 3); + // @ts-expect-error -- test runtime expect(list.has('')).toBe(false); }); it('doesnt contain elements at non-empty string keys', () => { - var list: any = List.of(1, 2, 3, 4, 5); + const list = List.of(1, 2, 3, 4, 5); + // @ts-expect-error -- test runtime expect(list.has('str')).toBe(false); }); it('hasIn doesnt contain elements at non-empty string keys', () => { - var list: any = List.of(1, 2, 3, 4, 5); - expect(list.hasIn(('str'))).toBe(false); + const list = List.of(1, 2, 3, 4, 5); + expect(list.hasIn(['str'])).toBe(false); + }); + + it('hasIn doesnt throw for bad key-path', () => { + const list = List.of(1, 2, 3, 4, 5); + expect(list.hasIn([1, 2, 3])).toBe(false); + + const list2 = List([{}]); + expect(list2.hasIn([0, 'bad'])).toBe(false); }); it('setting creates a new instance', () => { - var v0 = List.of('a'); - var v1 = v0.set(0, 'A'); + const v0 = List.of('a'); + const v1 = v0.set(0, 'A'); expect(v0.get(0)).toBe('a'); expect(v1.get(0)).toBe('A'); }); it('size includes the highest index', () => { - var v0 = List(); - var v1 = v0.set(0, 'a'); - var v2 = v1.set(1, 'b'); - var v3 = v2.set(2, 'c'); + const v0 = List(); + const v1 = v0.set(0, 'a'); + const v2 = v1.set(1, 'b'); + const v3 = v2.set(2, 'c'); expect(v0.size).toBe(0); expect(v1.size).toBe(1); expect(v2.size).toBe(2); @@ -160,17 +263,17 @@ describe('List', () => { }); it('get helpers make for easier to read code', () => { - var v = List.of('a', 'b', 'c'); + const v = List.of('a', 'b', 'c'); expect(v.first()).toBe('a'); expect(v.get(1)).toBe('b'); expect(v.last()).toBe('c'); }); it('slice helpers make for easier to read code', () => { - var v0 = List.of('a', 'b', 'c'); - var v1 = List.of('a', 'b'); - var v2 = List.of('a'); - var v3 = List(); + const v0 = List.of('a', 'b', 'c'); + const v1 = List.of('a', 'b'); + const v2 = List.of('a'); + const v3 = List(); expect(v0.rest().toArray()).toEqual(['b', 'c']); expect(v0.butLast().toArray()).toEqual(['a', 'b']); @@ -186,16 +289,16 @@ describe('List', () => { }); it('can set at arbitrary indices', () => { - var v0 = List.of('a', 'b', 'c'); - var v1 = v0.set(1, 'B'); // within existing tail - var v2 = v1.set(3, 'd'); // at last position - var v3 = v2.set(31, 'e'); // (testing internal guts) - var v4 = v3.set(32, 'f'); // (testing internal guts) - var v5 = v4.set(1023, 'g'); // (testing internal guts) - var v6 = v5.set(1024, 'h'); // (testing internal guts) - var v7 = v6.set(32, 'F'); // set within existing tree + const v0 = List.of('a', 'b', 'c'); + const v1 = v0.set(1, 'B'); // within existing tail + const v2 = v1.set(3, 'd'); // at last position + const v3 = v2.set(31, 'e'); // (testing internal guts) + const v4 = v3.set(32, 'f'); // (testing internal guts) + const v5 = v4.set(1023, 'g'); // (testing internal guts) + const v6 = v5.set(1024, 'h'); // (testing internal guts) + const v7 = v6.set(32, 'F'); // set within existing tree expect(v7.size).toBe(1025); - var expectedArray = ['a', 'B', 'c', 'd']; + const expectedArray = ['a', 'B', 'c', 'd']; expectedArray[31] = 'e'; expectedArray[32] = 'F'; expectedArray[1023] = 'g'; @@ -204,43 +307,52 @@ describe('List', () => { }); it('can contain a large number of indices', () => { - var v = Range(0,20000).toList(); - var iterations = 0; - v.forEach(v => { + const r = Range(0, 20000).toList(); + let iterations = 0; + r.forEach((v) => { expect(v).toBe(iterations); iterations++; }); - }) + }); it('describes a dense list', () => { - var v = List.of('a', 'b', 'c').push('d').set(14, 'o').set(6, undefined).remove(1); + const v = List.of('a', 'b', 'c') + .push('d') + .set(14, 'o') + .set(6, undefined) + .remove(1); expect(v.size).toBe(14); - expect(v.toJS()).toEqual( - ['a','c','d',,,,,,,,,,,'o'] - ); + // eslint-disable-next-line no-sparse-arrays + expect(v.toJS()).toEqual(['a', 'c', 'd', , , , , , , , , , , 'o']); }); it('iterates a dense list', () => { - var v = List().setSize(11).set(1,1).set(3,3).set(5,5).set(7,7).set(9,9); + const v = List() + .setSize(11) + .set(1, 1) + .set(3, 3) + .set(5, 5) + .set(7, 7) + .set(9, 9); expect(v.size).toBe(11); - var forEachResults = []; + const forEachResults: Array<[number, undefined | number]> = []; v.forEach((val, i) => forEachResults.push([i, val])); expect(forEachResults).toEqual([ - [0,undefined], - [1,1], - [2,undefined], - [3,3], - [4,undefined], - [5,5], - [6,undefined], - [7,7], - [8,undefined], - [9,9], - [10,undefined], + [0, undefined], + [1, 1], + [2, undefined], + [3, 3], + [4, undefined], + [5, 5], + [6, undefined], + [7, 7], + [8, undefined], + [9, 9], + [10, undefined], ]); - var arrayResults = v.toArray(); + const arrayResults = v.toArray(); expect(arrayResults).toEqual([ undefined, 1, @@ -255,55 +367,62 @@ describe('List', () => { undefined, ]); - var iteratorResults = []; - var iterator = v.entries(); - var step; + const iteratorResults: Array<[number, undefined | number]> = []; + const iterator = v.entries(); + let step; while (!(step = iterator.next()).done) { iteratorResults.push(step.value); } expect(iteratorResults).toEqual([ - [0,undefined], - [1,1], - [2,undefined], - [3,3], - [4,undefined], - [5,5], - [6,undefined], - [7,7], - [8,undefined], - [9,9], - [10,undefined], + [0, undefined], + [1, 1], + [2, undefined], + [3, 3], + [4, undefined], + [5, 5], + [6, undefined], + [7, 7], + [8, undefined], + [9, 9], + [10, undefined], ]); }); + it('has the same iterator function for values', () => { + const l = List(['a', 'b', 'c']); + expect(l[Symbol.iterator]).toBe(l.values); + }); + it('push inserts at highest index', () => { - var v0 = List.of('a', 'b', 'c'); - var v1 = v0.push('d', 'e', 'f'); + const v0 = List.of('a', 'b', 'c'); + const v1 = v0.push('d', 'e', 'f'); expect(v0.size).toBe(3); expect(v1.size).toBe(6); expect(v1.toArray()).toEqual(['a', 'b', 'c', 'd', 'e', 'f']); }); - check.it('pushes multiple values to the end', {maxSize: 2000}, - [gen.posInt, gen.posInt], (s1, s2) => { - var a1 = arrayOfSize(s1); - var a2 = arrayOfSize(s2); + it('pushes multiple values to the end', () => { + fc.assert( + fc.property(fc.nat(100), fc.nat(100), (s1, s2) => { + const a1 = arrayOfSize(s1); + const a2 = arrayOfSize(s2); - var v1 = List(a1); - var v3 = v1.push.apply(v1, a2); + const v1 = List(a1); + const v3 = v1.push.apply(v1, a2); - var a3 = a1.slice(); - a3.push.apply(a3, a2); + const a3 = a1.slice(); + a3.push.apply(a3, a2); - expect(v3.size).toEqual(a3.length); - expect(v3.toArray()).toEqual(a3); - } - ); + expect(v3.size).toEqual(a3.length); + expect(v3.toArray()).toEqual(a3); + }) + ); + }); it('pop removes the highest index, decrementing size', () => { - var v = List.of('a', 'b', 'c').pop(); + let v = List.of('a', 'b', 'c').pop(); expect(v.last()).toBe('b'); - expect(v.toArray()).toEqual(['a','b']); + expect(v.toArray()).toEqual(['a', 'b']); v = v.set(1230, 'x'); expect(v.size).toBe(1231); expect(v.last()).toBe('x'); @@ -315,40 +434,44 @@ describe('List', () => { expect(v.last()).toBe('X'); }); - check.it('pop removes the highest index, just like array', {maxSize: 2000}, - [gen.posInt], len => { - var a = arrayOfSize(len); - var v = List(a); - - while (a.length) { + it('pop removes the highest index, just like array', () => { + fc.assert( + fc.property(fc.nat(100), (len) => { + const a = arrayOfSize(len); + let v = List(a); + + while (a.length) { + expect(v.size).toBe(a.length); + expect(v.toArray()).toEqual(a); + v = v.pop(); + a.pop(); + } expect(v.size).toBe(a.length); expect(v.toArray()).toEqual(a); - v = v.pop(); - a.pop(); - } - expect(v.size).toBe(a.length); - expect(v.toArray()).toEqual(a); - } - ); - - check.it('push adds the next highest index, just like array', {maxSize: 2000}, - [gen.posInt], len => { - var a = []; - var v = List(); + }) + ); + }); - for (var ii = 0; ii < len; ii++) { + it('push adds the next highest index, just like array', () => { + fc.assert( + fc.property(fc.nat(100), (len) => { + const a: Array = []; + let v = List(); + + for (let ii = 0; ii < len; ii++) { + expect(v.size).toBe(a.length); + expect(v.toArray()).toEqual(a); + v = v.push(ii); + a.push(ii); + } expect(v.size).toBe(a.length); expect(v.toArray()).toEqual(a); - v = v.push(ii); - a.push(ii); - } - expect(v.size).toBe(a.length); - expect(v.toArray()).toEqual(a); - } - ); + }) + ); + }); it('allows popping an empty list', () => { - var v = List.of('a').pop(); + let v = List.of('a').pop(); expect(v.size).toBe(0); expect(v.toArray()).toEqual([]); v = v.pop().pop().pop().pop().pop(); @@ -356,8 +479,8 @@ describe('List', () => { expect(v.toArray()).toEqual([]); }); - it('remove removes any index', () => { - var v = List.of('a', 'b', 'c').remove(2).remove(0); + it.each(['remove', 'delete'])('remove removes any index', (fn) => { + let v = List.of('a', 'b', 'c')[fn](2)[fn](0); expect(v.size).toBe(1); expect(v.get(0)).toBe('b'); expect(v.get(1)).toBe(undefined); @@ -366,101 +489,189 @@ describe('List', () => { v = v.push('d'); expect(v.size).toBe(2); expect(v.get(1)).toBe('d'); - expect(v.toArray()).toEqual(['b','d']); + expect(v.toArray()).toEqual(['b', 'd']); }); it('shifts values from the front', () => { - var v = List.of('a', 'b', 'c').shift(); + const v = List.of('a', 'b', 'c').shift(); expect(v.first()).toBe('b'); expect(v.size).toBe(2); }); it('unshifts values to the front', () => { - var v = List.of('a', 'b', 'c').unshift('x', 'y', 'z'); + const v = List.of('a', 'b', 'c').unshift('x', 'y', 'z'); expect(v.first()).toBe('x'); expect(v.size).toBe(6); expect(v.toArray()).toEqual(['x', 'y', 'z', 'a', 'b', 'c']); }); - check.it('unshifts multiple values to the front', {maxSize: 2000}, - [gen.posInt, gen.posInt], (s1, s2) => { - var a1 = arrayOfSize(s1); - var a2 = arrayOfSize(s2); + it('unshifts multiple values to the front', () => { + fc.assert( + fc.property(fc.nat(100), fc.nat(100), (s1, s2) => { + const a1 = arrayOfSize(s1); + const a2 = arrayOfSize(s2); - var v1 = List(a1); - var v3 = v1.unshift.apply(v1, a2); + const v1 = List(a1); + const v3 = v1.unshift.apply(v1, a2); - var a3 = a1.slice(); - a3.unshift.apply(a3, a2); + const a3 = a1.slice(); + a3.unshift.apply(a3, a2); - expect(v3.size).toEqual(a3.length); - expect(v3.toArray()).toEqual(a3); - } - ); + expect(v3.size).toEqual(a3.length); + expect(v3.toArray()).toEqual(a3); + }) + ); + }); it('finds values using indexOf', () => { - var v = List.of('a', 'b', 'c', 'b', 'a'); + const v = List.of('a', 'b', 'c', 'b', 'a'); expect(v.indexOf('b')).toBe(1); expect(v.indexOf('c')).toBe(2); expect(v.indexOf('d')).toBe(-1); }); it('finds values using lastIndexOf', () => { - var v = List.of('a', 'b', 'c', 'b', 'a'); + const v = List.of('a', 'b', 'c', 'b', 'a'); expect(v.lastIndexOf('b')).toBe(3); expect(v.lastIndexOf('c')).toBe(2); expect(v.lastIndexOf('d')).toBe(-1); }); it('finds values using findIndex', () => { - var v = List.of('a', 'b', 'c', 'B', 'a'); - expect(v.findIndex(value => value.toUpperCase() === value)).toBe(3); - expect(v.findIndex(value => value.length > 1)).toBe(-1); + const v = List.of('a', 'b', 'c', 'B', 'a'); + expect(v.findIndex((value) => value.toUpperCase() === value)).toBe(3); + expect(v.findIndex((value) => value.length > 1)).toBe(-1); }); it('finds values using findEntry', () => { - var v = List.of('a', 'b', 'c', 'B', 'a'); - expect(v.findEntry(value => value.toUpperCase() === value)).toEqual([3, 'B']); - expect(v.findEntry(value => value.length > 1)).toBe(undefined); + const v = List.of('a', 'b', 'c', 'B', 'a'); + expect(v.findEntry((value) => value.toUpperCase() === value)).toEqual([ + 3, + 'B', + ]); + expect(v.findEntry((value) => value.length > 1)).toBe(undefined); }); it('maps values', () => { - var v = List.of('a', 'b', 'c'); - var r = v.map(value => value.toUpperCase()); + const v = List.of('a', 'b', 'c'); + const r = v.map((value) => value.toUpperCase()); expect(r.toArray()).toEqual(['A', 'B', 'C']); }); + it('map no-ops return the same reference', () => { + const v = List.of('a', 'b', 'c'); + const r = v.map((value) => value); + expect(r).toBe(v); + }); + + it('ensures iter is unmodified', () => { + const v = List.of(1, 2, 3); + const r = v.map((value, index, iter) => iter.get(index - 1)); + expect(r.toArray()).toEqual([3, 1, 2]); + }); + it('filters values', () => { - var v = List.of('a', 'b', 'c', 'd', 'e', 'f'); - var r = v.filter((value, index) => index % 2 === 1); + const v = List.of('a', 'b', 'c', 'd', 'e', 'f'); + const r = v.filter((value, index) => index % 2 === 1); expect(r.toArray()).toEqual(['b', 'd', 'f']); }); + it('partitions values', () => { + const v = List.of('a', 'b', 'c', 'd', 'e', 'f'); + const r = v + .partition((value, index) => index % 2 === 1) + .map((part) => part.toArray()); + expect(r).toEqual([ + ['a', 'c', 'e'], + ['b', 'd', 'f'], + ]); + }); + + it('filters values based on type', () => { + class A {} + class B extends A { + b(): void {} + } + class C extends A { + c(): void {} + } + const l1 = List([new B(), new C(), new B(), new C()]); + const l2: List = l1.filter((v): v is C => v instanceof C); + expect(l2.size).toEqual(2); + expect(l2.every((v) => v instanceof C)).toBe(true); + }); + + it('partitions values based on type', () => { + class A {} + class B extends A { + b(): void {} + } + class C extends A { + c(): void {} + } + const l1 = List([new B(), new C(), new B(), new C()]); + const [la, lc]: [List, List] = l1.partition( + (v): v is C => v instanceof C + ); + expect(la.size).toEqual(2); + expect(la.some((v) => v instanceof C)).toBe(false); + expect(lc.size).toEqual(2); + expect(lc.every((v) => v instanceof C)).toBe(true); + }); + it('reduces values', () => { - var v = List.of(1,10,100); - var r = v.reduce((reduction, value) => reduction + value); + const v = List.of(1, 10, 100); + const r = v.reduce((reduction, value) => reduction + value); expect(r).toEqual(111); + const r2 = v.reduce((reduction, value) => reduction + value, 1000); + expect(r2).toEqual(1111); }); it('reduces from the right', () => { - var v = List.of('a','b','c'); - var r = v.reduceRight((reduction, value) => reduction + value); + const v = List.of('a', 'b', 'c'); + const r = v.reduceRight((reduction, value) => reduction + value); expect(r).toEqual('cba'); + const r2 = v.reduceRight((reduction, value) => reduction + value, 'x'); + expect(r2).toEqual('xcba'); + }); + + it('takes maximum number', () => { + const v = List.of('a', 'b', 'c'); + const r = v.take(Number.MAX_SAFE_INTEGER); + expect(r).toBe(v); }); it('takes and skips values', () => { - var v = List.of('a', 'b', 'c', 'd', 'e', 'f'); - var r = v.skip(2).take(2); + const v = List.of('a', 'b', 'c', 'd', 'e', 'f'); + const r = v.skip(2).take(2); expect(r.toArray()).toEqual(['c', 'd']); }); + it('takes and skips no-ops return same reference', () => { + const v = List.of('a', 'b', 'c', 'd', 'e', 'f'); + const r = v.skip(0).take(6); + expect(r).toBe(v); + }); + + it('takeLast and skipLast values', () => { + const v = List.of('a', 'b', 'c', 'd', 'e', 'f'); + const r = v.skipLast(1).takeLast(2); + expect(r.toArray()).toEqual(['d', 'e']); + }); + + it('takeLast and skipLast no-ops return same reference', () => { + const v = List.of('a', 'b', 'c', 'd', 'e', 'f'); + const r = v.skipLast(0).takeLast(6); + expect(r).toBe(v); + }); + it('efficiently chains array methods', () => { - var v = List.of(1,2,3,4,5,6,7,8,9,10,11,12,13,14); + const v = List.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14); - var r = v - .filter(x => x % 2 == 0) + const r = v + .filter((x) => x % 2 === 0) .skip(2) - .map(x => x * x) + .map((x) => x * x) .take(3) .reduce((a: number, b: number) => a + b, 0); @@ -468,84 +679,206 @@ describe('List', () => { }); it('can convert to a map', () => { - var v = List.of('a', 'b', 'c'); - var m = v.toMap(); + const v = List.of('a', 'b', 'c'); + const m = v.toMap(); expect(m.size).toBe(3); expect(m.get(1)).toBe('b'); }); it('reverses', () => { - var v = List.of('a', 'b', 'c'); + const v = List.of('a', 'b', 'c'); expect(v.reverse().toArray()).toEqual(['c', 'b', 'a']); }); it('ensures equality', () => { // Make a sufficiently long list. - var a = Array(100).join('abcdefghijklmnopqrstuvwxyz').split(''); - var v1 = List(a); - var v2 = List(a); + const a = Array(100).join('abcdefghijklmnopqrstuvwxyz').split(''); + const v1 = List(a); + const v2 = List(a); + + // eslint-disable-next-line eqeqeq expect(v1 == v2).not.toBe(true); expect(v1 === v2).not.toBe(true); expect(v1.equals(v2)).toBe(true); }); it('works with insert', () => { - var v = List.of('a', 'b', 'c'); - var m = v.insert(1, 'd'); + const v = List.of('a', 'b', 'c'); + const m = v.insert(1, 'd'); expect(m.size).toBe(4); expect(m.get(1)).toBe('d'); - //works when index is greater than size of array - var n = v.insert(10, 'e'); + // Works when index is greater than size of array. + const n = v.insert(10, 'e'); expect(n.size).toBe(4); expect(n.get(3)).toBe('e'); - //works when index is negative - var o = v.insert(-4, 'f'); + // Works when index is negative. + const o = v.insert(-4, 'f'); expect(o.size).toBe(4); expect(o.get(0)).toBe('f'); }); + it('works with push, set and insert without phantom values', () => { + const v = List.of().set(287, 287).push(42).insert(33, 33); + expect(v.toJS().filter((item) => item === 287)).toHaveLength(1); + const v2 = List.of().push(0).unshift(-1).unshift(-2).pop().pop().set(2, 2); + expect(v2.toJS()).toEqual([-2, undefined, 2]); + const v3 = List.of().set(447, 447).push(0).insert(65, 65); + expect(v3.toJS().filter((item) => item === 447)).toHaveLength(1); + const v4 = List.of().set(-28, -28).push(0).shift().set(-30, -30); + expect(v4.toJS().filter((item) => item === -28)).toHaveLength(0); + const v5 = List.of().unshift(0).set(33, 33).shift().set(-35, -35); + expect(v5.toJS().filter((item) => item === 0)).toHaveLength(0); + + // execute the same test as `v` but for the 2000 first integers + const isOkV1 = (v) => + List.of() + .set(v, v) + .push('pushed-value') + .insert(33, 'inserted-value') + .filter((item) => item === v).size === 1; + + const arr = new Array(2000).fill(null).map((_, v) => v); + + const notOkArray = arr.filter((v) => !isOkV1(v)); + + expect(notOkArray).toHaveLength(0); + }); // TODO: assert that findIndex only calls the function as much as it needs to. - // TODO: assert that forEach iterates in the correct order and is only called as much as it needs to be. + it('forEach iterates in the correct order', () => { + let n = 0; + const a: Array = []; + const v = List.of(0, 1, 2, 3, 4); + v.forEach((x) => { + a.push(x); + n++; + }); + expect(n).toBe(5); + expect(a.length).toBe(5); + expect(a).toEqual([0, 1, 2, 3, 4]); + }); + + it('forEach iteration terminates when callback returns false', () => { + const a: Array = []; + function count(x) { + if (x > 2) { + return false; + } + a.push(x); + } + const v = List.of(0, 1, 2, 3, 4); + v.forEach(count); + expect(a).toEqual([0, 1, 2]); + }); it('concat works like Array.prototype.concat', () => { - var v1 = List.of(1, 2, 3); - var v2 = v1.concat(4, List.of(5, 6), [7, 8], Seq({a:9,b:10}), Set.of(11,12), null); + const v1 = List([1, 2, 3]); + const v2 = v1.concat( + 4, + List([5, 6]), + [7, 8], + Seq([9, 10]), + Set.of(11, 12), + null + ); expect(v1.toArray()).toEqual([1, 2, 3]); expect(v2.toArray()).toEqual([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, null]); }); + it('concat works like Array.prototype.concat even for IE11', () => { + const v1 = List([1, 2, 3]); + const a = [4]; + + // remove Symbol.iterator as IE11 does not handle it. + // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/@@iterator#browser_compatibility + // @ts-expect-error -- simulate IE11 + a[Symbol.iterator] = undefined; + + const v2 = v1.concat(a); + expect(v1.toArray()).toEqual([1, 2, 3]); + expect(v2.toArray()).toEqual([1, 2, 3, 4]); + }); + + it('concat returns self when no changes', () => { + const v1 = List([1, 2, 3]); + expect(v1.concat([])).toBe(v1); + }); + + it('concat returns arg when concat to empty', () => { + const v1 = List([1, 2, 3]); + expect(List().concat(v1)).toBe(v1); + }); + + it('concats a single value', () => { + const v1 = List([1, 2, 3]); + expect(v1.concat(4)).toEqual(List([1, 2, 3, 4])); + }); + + it('concat returns List-coerced arg when concat to empty', () => { + expect(List().concat([1, 2, 3])).toEqual(List([1, 2, 3])); + }); + + it('concat does not spread in string characters', () => { + const v1 = List([1, 2, 3]); + expect(v1.concat('abcdef')).toEqual(List([1, 2, 3, 'abcdef'])); + }); + it('allows chained mutations', () => { - var v1 = List(); - var v2 = v1.push(1); - var v3 = v2.withMutations(v => v.push(2).push(3).push(4)); - var v4 = v3.push(5); + const v1 = List(); + const v2 = v1.push(1); + const v3 = v2.withMutations((v) => v.push(2).push(3).push(4)); + const v4 = v3.push(5); expect(v1.toArray()).toEqual([]); expect(v2.toArray()).toEqual([1]); - expect(v3.toArray()).toEqual([1,2,3,4]); - expect(v4.toArray()).toEqual([1,2,3,4,5]); + expect(v3.toArray()).toEqual([1, 2, 3, 4]); + expect(v4.toArray()).toEqual([1, 2, 3, 4, 5]); }); it('allows chained mutations using alternative API', () => { - var v1 = List(); - var v2 = v1.push(1); - var v3 = v2.asMutable().push(2).push(3).push(4).asImmutable(); - var v4 = v3.push(5); + const v1 = List(); + const v2 = v1.push(1); + const v3 = v2.asMutable().push(2).push(3).push(4).asImmutable(); + const v4 = v3.push(5); expect(v1.toArray()).toEqual([]); expect(v2.toArray()).toEqual([1]); - expect(v3.toArray()).toEqual([1,2,3,4]); - expect(v4.toArray()).toEqual([1,2,3,4,5]); + expect(v3.toArray()).toEqual([1, 2, 3, 4]); + expect(v4.toArray()).toEqual([1, 2, 3, 4, 5]); + }); + + it('chained mutations does not result in new empty list instance', () => { + const v1 = List(['x']); + const v2 = v1.withMutations((v) => v.push('y').pop().pop()); + expect(v2).toEqual(List()); + }); + + it('calling `clear` and `setSize` should set all items to undefined', () => { + const l = List(['a', 'b']); + const l2 = l.clear().setSize(3); + + expect(l2.get(0)).toBeUndefined(); + expect(l2.get(1)).toBeUndefined(); + expect(l2.get(2)).toBeUndefined(); + }); + + it('calling `clear` and `setSize` while mutating should set all items to undefined', () => { + const l = List(['a', 'b']); + const l2 = l.withMutations((innerList) => { + innerList.clear().setSize(3); + }); + expect(l2.get(0)).toBeUndefined(); + expect(l2.get(1)).toBeUndefined(); + expect(l2.get(2)).toBeUndefined(); }); it('allows size to be set', () => { - var v1 = Range(0,2000).toList(); - var v2 = v1.setSize(1000); - var v3 = v2.setSize(1500); + const v1 = Range(0, 2000).toList(); + const v2 = v1.setSize(1000); + const v3 = v2.setSize(1500); expect(v1.size).toBe(2000); expect(v2.size).toBe(1000); expect(v3.size).toBe(1500); @@ -561,34 +894,34 @@ describe('List', () => { }); it('discards truncated elements when using slice', () => { - var list = [1,2,3,4,5,6]; - var v1 = fromJS(list); - var v2 = v1.slice(0,3); - var v3 = v2.setSize(6); + const list: Array = [1, 2, 3, 4, 5, 6]; + const v1 = fromJS(list) as List; + const v2 = v1.slice(0, 3); + const v3 = v2.setSize(6); - expect(v2.toArray()).toEqual(list.slice(0,3)); + expect(v2.toArray()).toEqual(list.slice(0, 3)); expect(v3.toArray()).toEqual( - list.slice(0,3).concat([undefined, undefined, undefined]) + list.slice(0, 3).concat([undefined, undefined, undefined]) ); }); it('discards truncated elements when using setSize', () => { - var list = [1,2,3,4,5,6]; - var v1 = fromJS(list); - var v2 = v1.setSize(3); - var v3 = v2.setSize(6); + const list: Array = [1, 2, 3, 4, 5, 6]; + const v1 = fromJS(list) as List; + const v2 = v1.setSize(3); + const v3 = v2.setSize(6); - expect(v2.toArray()).toEqual(list.slice(0,3)); + expect(v2.toArray()).toEqual(list.slice(0, 3)); expect(v3.toArray()).toEqual( - list.slice(0,3).concat([undefined, undefined, undefined]) + list.slice(0, 3).concat([undefined, undefined, undefined]) ); }); it('can be efficiently sliced', () => { - var v1 = Range(0,2000).toList(); - var v2 = v1.slice(100,-100).toList(); - var v3 = v2.slice(0, Infinity); - expect(v1.size).toBe(2000) + const v1 = Range(0, 2000).toList(); + const v2 = v1.slice(100, -100).toList(); + const v3 = v2.slice(0, Infinity); + expect(v1.size).toBe(2000); expect(v2.size).toBe(1800); expect(v3.size).toBe(1800); expect(v2.first()).toBe(100); @@ -599,25 +932,56 @@ describe('List', () => { [NaN, Infinity, -Infinity].forEach((zeroishValue) => { it(`treats ${zeroishValue} like zero when setting size`, () => { - var v1 = List.of('a', 'b', 'c'); - var v2 = v1.setSize(zeroishValue); + const v1 = List.of('a', 'b', 'c'); + const v2 = v1.setSize(zeroishValue); expect(v2.size).toBe(0); }); }); it('Does not infinite loop when sliced with NaN #459', () => { - var list = List([1, 2, 3, 4, 5]); - var newList = list.slice(0, NaN); + const list = List([1, 2, 3, 4, 5]); + const newList = list.slice(0, NaN); expect(newList.toJS()).toEqual([]); }); it('Accepts NaN for slice and concat #602', () => { - var list = List().slice(0, NaN).concat(NaN); + const list = List().slice(0, NaN).concat(NaN); // toEqual([ NaN ]) expect(list.size).toBe(1); expect(isNaNValue(list.get(0))).toBe(true); }); + it('return a new emptyList if the emptyList has been mutated #2003', () => { + const emptyList = List(); + + const nonEmptyList = emptyList.withMutations((l) => { + l.setSize(1); + l.set(0, 'a'); + }); + + expect(nonEmptyList.size).toBe(1); + expect(nonEmptyList).toEqual(List.of('a')); + expect(emptyList.size).toBe(0); + + const mutableList = emptyList.asMutable(); + + mutableList.setSize(1); + mutableList.set(0, 'b'); + + expect(mutableList.size).toBe(1); + expect(mutableList).toEqual(List.of('b')); + + expect(emptyList.size).toBe(0); + expect(List().size).toBe(0); + }); + + it('Mutating empty list with a JS API should not mutate new instances', () => { + Object.assign(List(), List([1, 2])); + + expect(List().size).toBe(0); + expect(List().toArray()).toEqual([]); + }); + // Note: NaN is the only value not equal to itself. The isNaN() built-in // function returns true for any non-numeric value, not just the NaN value. function isNaNValue(value) { @@ -627,56 +991,86 @@ describe('List', () => { describe('when slicing', () => { [NaN, -Infinity].forEach((zeroishValue) => { it(`considers a ${zeroishValue} begin argument to be zero`, () => { - var v1 = List.of('a', 'b', 'c'); - var v2 = v1.slice(zeroishValue, 3); + const v1 = List.of('a', 'b', 'c'); + const v2 = v1.slice(zeroishValue, 3); expect(v2.size).toBe(3); }); it(`considers a ${zeroishValue} end argument to be zero`, () => { - var v1 = List.of('a', 'b', 'c'); - var v2 = v1.slice(0, zeroishValue); + const v1 = List.of('a', 'b', 'c'); + const v2 = v1.slice(0, zeroishValue); expect(v2.size).toBe(0); }); it(`considers ${zeroishValue} begin and end arguments to be zero`, () => { - var v1 = List.of('a', 'b', 'c'); - var v2 = v1.slice(zeroishValue, zeroishValue); + const v1 = List.of('a', 'b', 'c'); + const v2 = v1.slice(zeroishValue, zeroishValue); expect(v2.size).toBe(0); }); }); }); - describe('Iterator', () => { + describe('when shuffling', () => { + const list = List.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - var pInt = gen.posInt; - - check.it('iterates through List', [pInt, pInt], (start, len) => { - var l = Range(0, start + len).toList(); - l = > l.slice(start, start + len); - expect(l.size).toBe(len); - var valueIter = l.values(); - var keyIter = l.keys(); - var entryIter = l.entries(); - for (var ii = 0; ii < len; ii++) { - expect(valueIter.next().value).toBe(start + ii); - expect(keyIter.next().value).toBe(ii); - expect(entryIter.next().value).toEqual([ii, start + ii]); - } + it('should work when empty', () => { + expect(List().shuffle()).toStrictEqual(List()); + }); + it('should work with Math.random', () => { + expect(list.shuffle().sort()).toStrictEqual(list); }); + it('should work with a pseudo random number generator', () => { + const seed = createSeed('lorem ipsum'); + const random = () => seed.random(); + + expect(list.shuffle(random)).toStrictEqual( + List.of(5, 2, 4, 7, 6, 3, 10, 1, 9, 8) + ); + expect(list.shuffle(random)).toStrictEqual( + List.of(1, 6, 2, 3, 9, 7, 4, 10, 5, 8) + ); + expect(list.shuffle(random)).toStrictEqual( + List.of(6, 1, 8, 10, 9, 5, 4, 7, 3, 2) + ); + }); + }); - check.it('iterates through List in reverse', [pInt, pInt], (start, len) => { - var l = Range(0, start + len).toList(); - l = > l.slice(start, start + len); - var s = l.toSeq().reverse(); // impl calls List.__iterator(REVERSE) - expect(s.size).toBe(len); - var valueIter = s.values(); - var keyIter = s.keys(); - var entryIter = s.entries(); - for (var ii = 0; ii < len; ii++) { - expect(valueIter.next().value).toBe(start + len - 1 - ii); - expect(keyIter.next().value).toBe(ii); - expect(entryIter.next().value).toEqual([ii, start + len - 1 - ii]); - } + describe('Iterator', () => { + const pInt = fc.nat(100); + + it('iterates through List', () => { + fc.assert( + fc.property(pInt, pInt, (start, len) => { + const l1 = Range(0, start + len).toList(); + const l2: List = l1.slice(start, start + len); + expect(l2.size).toBe(len); + const valueIter = l2.values(); + const keyIter = l2.keys(); + const entryIter = l2.entries(); + for (let ii = 0; ii < len; ii++) { + expect(valueIter.next().value).toBe(start + ii); + expect(keyIter.next().value).toBe(ii); + expect(entryIter.next().value).toEqual([ii, start + ii]); + } + }) + ); }); + it('iterates through List in reverse', () => { + fc.assert( + fc.property(pInt, pInt, (start, len) => { + const l1 = Range(0, start + len).toList(); + const l2: List = l1.slice(start, start + len); + const s = l2.toSeq().reverse(); // impl calls List.__iterator(REVERSE) + expect(s.size).toBe(len); + const valueIter = s.values(); + const keyIter = s.keys(); + const entryIter = s.entries(); + for (let ii = 0; ii < len; ii++) { + expect(valueIter.next().value).toBe(start + len - 1 - ii); + expect(keyIter.next().value).toBe(ii); + expect(entryIter.next().value).toEqual([ii, start + len - 1 - ii]); + } + }) + ); + }); }); - }); diff --git a/__tests__/ListJS.js b/__tests__/ListJS.js index 055047f935..ae18d4881d 100644 --- a/__tests__/ListJS.js +++ b/__tests__/ListJS.js @@ -1,34 +1,32 @@ -jest.autoMockOff(); +import { describe, expect, it } from '@jest/globals'; +import { List } from 'immutable'; -var Immutable = require('immutable'); -var List = Immutable.List; - -var NON_NUMBERS = { - 'array': ['not', 'a', 'number'], - 'NaN': NaN, - 'object': {not: 'a number'}, - 'string': 'not a number', +const NON_NUMBERS = { + array: ['not', 'a', 'number'], + NaN: NaN, + object: { not: 'a number' }, + string: 'not a number', }; describe('List', () => { describe('setSize()', () => { - Object.keys(NON_NUMBERS).forEach(function(type) { - var nonNumber = NON_NUMBERS[type]; + Object.keys(NON_NUMBERS).forEach((type) => { + const nonNumber = NON_NUMBERS[type]; it(`considers a size argument of type '${type}' to be zero`, () => { - var v1 = List.of(1,2,3); - var v2 = v1.setSize(nonNumber); + const v1 = List.of(1, 2, 3); + const v2 = v1.setSize(nonNumber); expect(v2.size).toBe(0); }); - }) + }); }); describe('slice()', () => { // Mimic the behavior of Array::slice() // http://www.ecma-international.org/ecma-262/6.0/#sec-array.prototype.slice - Object.keys(NON_NUMBERS).forEach(function(type) { - var nonNumber = NON_NUMBERS[type]; + Object.keys(NON_NUMBERS).forEach((type) => { + const nonNumber = NON_NUMBERS[type]; it(`considers a begin argument of type '${type}' to be zero`, () => { - var v1 = List.of('a', 'b', 'c'); - var v2 = v1.slice(nonNumber, 2); + const v1 = List.of('a', 'b', 'c'); + const v2 = v1.slice(nonNumber, 2); expect(v2.size).toBe(2); expect(v2.first()).toBe('a'); expect(v2.rest().size).toBe(1); @@ -36,8 +34,8 @@ describe('List', () => { expect(v2.butLast().size).toBe(1); }); it(`considers an end argument of type '${type}' to be zero`, () => { - var v1 = List.of('a', 'b', 'c'); - var v2 = v1.slice(0, nonNumber); + const v1 = List.of('a', 'b', 'c'); + const v2 = v1.slice(0, nonNumber); expect(v2.size).toBe(0); expect(v2.first()).toBe(undefined); expect(v2.rest().size).toBe(0); diff --git a/__tests__/Map.ts b/__tests__/Map.ts index ffffff1c0b..d8ae8b16ca 100644 --- a/__tests__/Map.ts +++ b/__tests__/Map.ts @@ -1,17 +1,25 @@ -/// -/// - -jest.autoMockOff(); - -import * as jasmineCheck from 'jasmine-check'; -jasmineCheck.install(); - -import { Map, Seq, List, Range, is } from 'immutable'; +import { describe, expect, it, jest } from '@jest/globals'; +import { fromJS, is, List, Map, Range, Record, Seq } from 'immutable'; +import fc from 'fast-check'; describe('Map', () => { - it('converts from object', () => { - var m = Map({'a': 'A', 'b': 'B', 'c': 'C'}); + const m = Map({ a: 'A', b: 'B', c: 'C' }); + expect(m.size).toBe(3); + expect(m.get('a')).toBe('A'); + expect(m.get('b')).toBe('B'); + expect(m.get('c')).toBe('C'); + }); + + it('converts from JS (global) Map', () => { + const m = Map( + new global.Map([ + ['a', 'A'], + ['b', 'B'], + ['c', 'C'], + ]) + ); + expect(Map.isMap(m)).toBe(true); expect(m.size).toBe(3); expect(m.get('a')).toBe('A'); expect(m.get('b')).toBe('B'); @@ -19,7 +27,7 @@ describe('Map', () => { }); it('constructor provides initial values', () => { - var m = Map({'a': 'A', 'b': 'B', 'c': 'C'}); + const m = Map({ a: 'A', b: 'B', c: 'C' }); expect(m.size).toBe(3); expect(m.get('a')).toBe('A'); expect(m.get('b')).toBe('B'); @@ -27,7 +35,11 @@ describe('Map', () => { }); it('constructor provides initial values as array of entries', () => { - var m = Map([['a','A'],['b','B'],['c','C']]); + const m = Map([ + ['a', 'A'], + ['b', 'B'], + ['c', 'C'], + ]); expect(m.size).toBe(3); expect(m.get('a')).toBe('A'); expect(m.get('b')).toBe('B'); @@ -35,8 +47,8 @@ describe('Map', () => { }); it('constructor provides initial values as sequence', () => { - var s = Seq({'a': 'A', 'b': 'B', 'c': 'C'}); - var m = Map(s); + const s = Seq({ a: 'A', b: 'B', c: 'C' }); + const m = Map(s); expect(m.size).toBe(3); expect(m.get('a')).toBe('A'); expect(m.get('b')).toBe('B'); @@ -44,91 +56,107 @@ describe('Map', () => { }); it('constructor provides initial values as list of lists', () => { - var l = List([ - List(['a', 'A']), - List(['b', 'B']), - List(['c', 'C']) - ]); - var m = Map(l); + const l = List([List(['a', 'A']), List(['b', 'B']), List(['c', 'C'])]); + const m = Map(l); expect(m.size).toBe(3); + // @ts-expect-error -- Not supported by typescript since 4.0.0 https://github.com/immutable-js/immutable-js/pull/1626 expect(m.get('a')).toBe('A'); + // @ts-expect-error -- Not supported by typescript since 4.0.0 https://github.com/immutable-js/immutable-js/pull/1626 expect(m.get('b')).toBe('B'); + // @ts-expect-error -- Not supported by typescript since 4.0.0 https://github.com/immutable-js/immutable-js/pull/1626 expect(m.get('c')).toBe('C'); }); it('constructor is identity when provided map', () => { - var m1 = Map({'a': 'A', 'b': 'B', 'c': 'C'}); - var m2 = Map(m1); + const m1 = Map({ a: 'A', b: 'B', c: 'C' }); + const m2 = Map(m1); expect(m2).toBe(m1); }); it('does not accept a scalar', () => { expect(() => { + // TODO: should expect error Map(3); - }).toThrow('Expected Array or iterable object of [k, v] entries, or keyed object: 3'); + }).toThrow( + 'Expected Array or collection object of [k, v] entries, or keyed object: 3' + ); }); - it('does not accept strings (iterable, but scalar)', () => { + it('does not accept strings (collection, but scalar)', () => { expect(() => { + // @ts-expect-error -- constructor does not accept strings, this is expected to throw Map('abc'); }).toThrow(); }); it('does not accept non-entries array', () => { expect(() => { - Map([1,2,3]); + // @ts-expect-error -- not an array of entries, this is expected to throw + Map([1, 2, 3]); }).toThrow('Expected [K, V] tuple: 1'); }); - it('accepts non-iterable array-like objects as keyed collections', () => { - var m = Map({ 'length': 3, '1': 'one' }); + it('accepts non-collection array-like objects as keyed collections', () => { + const m = Map({ length: 3, 1: 'one' }); expect(m.get('length')).toBe(3); + // @ts-expect-error -- type error, but the API is tolerante expect(m.get('1')).toBe('one'); - expect(m.toJS()).toEqual({ 'length': 3, '1': 'one' }); - }); - - it('accepts flattened pairs via of()', () => { - var m: Map = Map.of(1, 'a', 2, 'b', 3, 'c'); - expect(m.size).toBe(3); - expect(m.get(1)).toBe('a'); - expect(m.get(2)).toBe('b'); - expect(m.get(3)).toBe('c'); - }); - - it('does not accept mismatched flattened pairs via of()', () => { - expect(() => { - Map.of(1, 2, 3); - }).toThrow('Missing value for key: 3'); + expect(m.toJS()).toEqual({ length: 3, 1: 'one' }); }); it('converts back to JS object', () => { - var m = Map({'a': 'A', 'b': 'B', 'c': 'C'}); - expect(m.toObject()).toEqual({'a': 'A', 'b': 'B', 'c': 'C'}); + const m = Map({ a: 'A', b: 'B', c: 'C' }); + expect(m.toObject()).toEqual({ a: 'A', b: 'B', c: 'C' }); }); it('iterates values', () => { - var m = Map({'a': 'A', 'b': 'B', 'c': 'C'}); - var iterator = jest.genMockFunction(); + const m = Map({ a: 'A', b: 'B', c: 'C' }); + const iterator = jest.fn(); m.forEach(iterator); expect(iterator.mock.calls).toEqual([ ['A', 'a', m], ['B', 'b', m], - ['C', 'c', m] + ['C', 'c', m], ]); }); + it('has the same iterator function for entries', () => { + const m = Map({ a: 'A', b: 'B', c: 'C' }); + expect(m[Symbol.iterator]).toBe(m.entries); + }); + it('merges two maps', () => { - var m1 = Map({'a': 'A', 'b': 'B', 'c': 'C'}); - var m2 = Map({'wow': 'OO', 'd': 'DD', 'b': 'BB'}); - expect(m2.toObject()).toEqual({'wow': 'OO', 'd': 'DD', 'b': 'BB'}); - var m3 = m1.merge(m2); - expect(m3.toObject()).toEqual({'a': 'A', 'b': 'BB', 'c': 'C', 'wow': 'OO', 'd': 'DD'}); + const m1 = Map({ a: 'A', b: 'B', c: 'C' }); + const m2 = Map({ wow: 'OO', d: 'DD', b: 'BB' }); + expect(m2.toObject()).toEqual({ wow: 'OO', d: 'DD', b: 'BB' }); + const m3 = m1.merge(m2); + expect(m3.toObject()).toEqual({ + a: 'A', + b: 'BB', + c: 'C', + wow: 'OO', + d: 'DD', + }); + }); + + it('concatenates two maps (alias for merge)', () => { + const m1 = Map({ a: 'A', b: 'B', c: 'C' }); + const m2 = Map({ wow: 'OO', d: 'DD', b: 'BB' }); + expect(m2.toObject()).toEqual({ wow: 'OO', d: 'DD', b: 'BB' }); + const m3 = m1.concat(m2); + expect(m3.toObject()).toEqual({ + a: 'A', + b: 'BB', + c: 'C', + wow: 'OO', + d: 'DD', + }); }); it('accepts null as a key', () => { - var m1 = Map(); - var m2 = m1.set(null, 'null'); - var m3 = m2.remove(null); + const m1 = Map(); + const m2 = m1.set(null, 'null'); + const m3 = m2.remove(null); expect(m1.size).toBe(0); expect(m2.size).toBe(1); expect(m3.size).toBe(0); @@ -136,11 +164,11 @@ describe('Map', () => { }); it('is persistent to sets', () => { - var m1 = Map(); - var m2 = m1.set('a', 'Aardvark'); - var m3 = m2.set('b', 'Baboon'); - var m4 = m3.set('c', 'Canary'); - var m5 = m4.set('b', 'Bonobo'); + const m1 = Map(); + const m2 = m1.set('a', 'Aardvark'); + const m3 = m2.set('b', 'Baboon'); + const m4 = m3.set('c', 'Canary'); + const m5 = m4.set('b', 'Bonobo'); expect(m1.size).toBe(0); expect(m2.size).toBe(1); expect(m3.size).toBe(2); @@ -151,11 +179,11 @@ describe('Map', () => { }); it('is persistent to deletes', () => { - var m1 = Map(); - var m2 = m1.set('a', 'Aardvark'); - var m3 = m2.set('b', 'Baboon'); - var m4 = m3.set('c', 'Canary'); - var m5 = m4.remove('b'); + const m1 = Map(); + const m2 = m1.set('a', 'Aardvark'); + const m3 = m2.set('b', 'Baboon'); + const m4 = m3.set('c', 'Canary'); + const m5 = m4.remove('b'); expect(m1.size).toBe(0); expect(m2.size).toBe(1); expect(m3.size).toBe(2); @@ -168,31 +196,38 @@ describe('Map', () => { expect(m5.get('c')).toBe('Canary'); }); - check.it('deletes down to empty map', [gen.posInt], size => { - var m = Range(0, size).toMap(); - expect(m.size).toBe(size); - for (var ii = size - 1; ii >= 0; ii--) { - m = m.remove(ii); - expect(m.size).toBe(ii); - } - expect(m).toBe(Map()); + it('deletes down to empty map', () => { + fc.assert( + fc.property(fc.nat(100), (size) => { + let m = Range(0, size).toMap(); + expect(m.size).toBe(size); + for (let ii = size - 1; ii >= 0; ii--) { + m = m.remove(ii); + expect(m.size).toBe(ii); + } + expect(m).toBe(Map()); + }) + ); }); it('can map many items', () => { - var m = Map(); - for (var ii = 0; ii < 2000; ii++) { - m = m.set('thing:' + ii, ii); + let m = Map(); + for (let ii = 0; ii < 2000; ii++) { + m = m.set('thing:' + ii, ii); } expect(m.size).toBe(2000); expect(m.get('thing:1234')).toBe(1234); }); it('can use weird keys', () => { - var m: Map = Map() + const symbol = Symbol('A'); + const m = Map() .set(NaN, 1) .set(Infinity, 2) + .set(symbol, 'A') .set(-Infinity, 3); + expect(m.get(symbol)).toBe('A'); expect(m.get(NaN)).toBe(1); expect(m.get(Infinity)).toBe(2); expect(m.get(-Infinity)).toBe(3); @@ -200,8 +235,8 @@ describe('Map', () => { it('can map items known to hash collide', () => { // make a big map, so it hashmaps - var m: Map = Range(0, 32).toMap(); - var m = m.set('AAA', 'letters').set(64545, 'numbers'); + let m: Map = Range(0, 32).toMap(); + m = m.set('AAA', 'letters').set(64545, 'numbers'); expect(m.size).toBe(34); expect(m.get('AAA')).toEqual('letters'); expect(m.get(64545)).toEqual('numbers'); @@ -209,7 +244,7 @@ describe('Map', () => { it('can progressively add items known to collide', () => { // make a big map, so it hashmaps - var map: Map = Range(0, 32).toMap(); + let map: Map = Range(0, 32).toMap(); map = map.set('@', '@'); map = map.set(64, 64); map = map.set(96, 96); @@ -220,43 +255,76 @@ describe('Map', () => { }); it('maps values', () => { - var m = Map({a:'a', b:'b', c:'c'}); - var r = m.map(value => value.toUpperCase()); - expect(r.toObject()).toEqual({a:'A', b:'B', c:'C'}); + const m = Map({ a: 'a', b: 'b', c: 'c' }); + const r = m.map((value) => value.toUpperCase()); + expect(r.toObject()).toEqual({ a: 'A', b: 'B', c: 'C' }); }); it('maps keys', () => { - var m = Map({a:'a', b:'b', c:'c'}); - var r = m.mapKeys(key => key.toUpperCase()); - expect(r.toObject()).toEqual({A:'a', B:'b', C:'c'}); + const m = Map({ a: 'a', b: 'b', c: 'c' }); + const r = m.mapKeys((key) => key.toUpperCase()); + expect(r.toObject()).toEqual({ A: 'a', B: 'b', C: 'c' }); + }); + + it('maps no-ops return the same reference', () => { + const m = Map({ a: 'a', b: 'b', c: 'c' }); + const r = m.map((value) => value); + expect(r).toBe(m); + }); + + it('provides unmodified original collection as 3rd iter argument', () => { + const m = Map({ a: 1, b: 1 }); + const r = m.map((value, key, iter) => { + expect(iter).toEqual(m); + return 2 * (iter.get(key) as number); + }); + expect(r.toObject()).toEqual({ a: 2, b: 2 }); }); it('filters values', () => { - var m = Map({a:1, b:2, c:3, d:4, e:5, f:6}); - var r = m.filter(value => value % 2 === 1); - expect(r.toObject()).toEqual({a:1, c:3, e:5}); + const m = Map({ a: 1, b: 2, c: 3, d: 4, e: 5, f: 6 }); + const r = m.filter((value) => value % 2 === 1); + expect(r.toObject()).toEqual({ a: 1, c: 3, e: 5 }); }); it('filterNots values', () => { - var m = Map({a:1, b:2, c:3, d:4, e:5, f:6}); - var r = m.filterNot(value => value % 2 === 1); - expect(r.toObject()).toEqual({b:2, d:4, f:6}); + const m = Map({ a: 1, b: 2, c: 3, d: 4, e: 5, f: 6 }); + const r = m.filterNot((value) => value % 2 === 1); + expect(r.toObject()).toEqual({ b: 2, d: 4, f: 6 }); + }); + + it('partitions values', () => { + const m = Map({ a: 1, b: 2, c: 3, d: 4, e: 5, f: 6 }); + const r = m + .partition((value) => value % 2 === 1) + .map((part) => part.toObject()); + expect(r).toEqual([ + { b: 2, d: 4, f: 6 }, + { a: 1, c: 3, e: 5 }, + ]); }); it('derives keys', () => { - var v = Map({a:1, b:2, c:3, d:4, e:5, f:6}); + const v = Map({ a: 1, b: 2, c: 3, d: 4, e: 5, f: 6 }); expect(v.keySeq().toArray()).toEqual(['a', 'b', 'c', 'd', 'e', 'f']); }); it('flips keys and values', () => { - var v = Map({a:1, b:2, c:3, d:4, e:5, f:6}); - expect(v.flip().toObject()).toEqual({1:'a', 2:'b', 3:'c', 4:'d', 5:'e', 6:'f'}); + const v = Map({ a: 1, b: 2, c: 3, d: 4, e: 5, f: 6 }); + expect(v.flip().toObject()).toEqual({ + 1: 'a', + 2: 'b', + 3: 'c', + 4: 'd', + 5: 'e', + 6: 'f', + }); }); it('can convert to a list', () => { - var m = Map({a:1, b:2, c:3}); - var v = m.toList(); - var k = m.keySeq().toList(); + const m = Map({ a: 1, b: 2, c: 3 }); + const v = m.toList(); + const k = m.keySeq().toList(); expect(v.size).toBe(3); expect(k.size).toBe(3); // Note: Map has undefined ordering, this List may not be the same @@ -265,85 +333,261 @@ describe('Map', () => { expect(k.get(1)).toBe('b'); }); - check.it('works like an object', {maxSize: 50}, [gen.object(gen.JSONPrimitive)], obj => { - var map = Map(obj); - Object.keys(obj).forEach(key => { - expect(map.get(key)).toBe(obj[key]); - expect(map.has(key)).toBe(true); - }); - Object.keys(obj).forEach(key => { - expect(map.get(key)).toBe(obj[key]); - expect(map.has(key)).toBe(true); - map = map.remove(key); - expect(map.get(key)).toBe(undefined); - expect(map.has(key)).toBe(false); - }); + it('works like an object', () => { + fc.assert( + fc.property(fc.object({ maxKeys: 50 }), (obj) => { + let map = Map(obj); + Object.keys(obj).forEach((key) => { + expect(map.get(key)).toBe(obj[key]); + expect(map.has(key)).toBe(true); + }); + Object.keys(obj).forEach((key) => { + expect(map.get(key)).toBe(obj[key]); + expect(map.has(key)).toBe(true); + map = map.remove(key); + expect(map.get(key)).toBe(undefined); + expect(map.has(key)).toBe(false); + }); + }) + ); + }); + + it('sets', () => { + fc.assert( + fc.property(fc.nat(100), (len) => { + let map = Map(); + for (let ii = 0; ii < len; ii++) { + expect(map.size).toBe(ii); + map = map.set('' + ii, ii); + } + expect(map.size).toBe(len); + expect(is(map.toSet(), Range(0, len).toSet())).toBe(true); + }) + ); + }); + + it('has and get', () => { + fc.assert( + fc.property(fc.nat(100), (len) => { + const map = Range(0, len) + .toKeyedSeq() + .mapKeys((x) => '' + x) + .toMap(); + for (let ii = 0; ii < len; ii++) { + expect(map.get('' + ii)).toBe(ii); + expect(map.has('' + ii)).toBe(true); + } + }) + ); + }); + + it('deletes', () => { + fc.assert( + fc.property(fc.nat(100), (len) => { + let map = Range(0, len).toMap(); + for (let ii = 0; ii < len; ii++) { + expect(map.size).toBe(len - ii); + map = map.remove(ii); + } + expect(map.size).toBe(0); + expect(map.toObject()).toEqual({}); + }) + ); + }); + + it('deletes from transient', () => { + fc.assert( + fc.property(fc.nat(100), (len) => { + const map = Range(0, len).toMap().asMutable(); + for (let ii = 0; ii < len; ii++) { + expect(map.size).toBe(len - ii); + map.remove(ii); + } + expect(map.size).toBe(0); + expect(map.toObject()).toEqual({}); + }) + ); + }); + + it('iterates through all entries', () => { + fc.assert( + fc.property(fc.nat(100), (len) => { + const v = Range(0, len).toMap(); + const a = v.toArray(); + const iter = v.entries(); + for (let ii = 0; ii < len; ii++) { + delete a[iter.next().value[0]]; + } + expect(a).toEqual(new Array(len)); + }) + ); }); - check.it('sets', {maxSize: 5000}, [gen.posInt], len => { - var map = Map(); - for (var ii = 0; ii < len; ii++) { - expect(map.size).toBe(ii); - map = map.set(''+ii, ii); - } - expect(map.size).toBe(len); - expect(is(map.toSet(), Range(0, len).toSet())).toBe(true); + it('allows chained mutations', () => { + const m1 = Map(); + const m2 = m1.set('a', 1); + const m3 = m2.withMutations((m) => m.set('b', 2).set('c', 3)); + const m4 = m3.set('d', 4); + + expect(m1.toObject()).toEqual({}); + expect(m2.toObject()).toEqual({ a: 1 }); + expect(m3.toObject()).toEqual({ a: 1, b: 2, c: 3 }); + expect(m4.toObject()).toEqual({ a: 1, b: 2, c: 3, d: 4 }); }); - check.it('has and get', {maxSize: 5000}, [gen.posInt], len => { - var map = Range(0, len).toKeyedSeq().mapKeys(x => ''+x).toMap(); - for (var ii = 0; ii < len; ii++) { - expect(map.get(''+ii)).toBe(ii); - expect(map.has(''+ii)).toBe(true); - } + it('chained mutations does not result in new empty map instance', () => { + const v1 = Map<{ x?: number; y?: number }>({ x: 1 }); + const v2 = v1.withMutations((v) => v.set('y', 2).delete('x').delete('y')); + expect(v2).toBe(Map()); }); - check.it('deletes', {maxSize: 5000}, [gen.posInt], len => { - var map = Range(0, len).toMap(); - for (var ii = 0; ii < len; ii++) { - expect(map.size).toBe(len - ii); - map = map.remove(ii); - } - expect(map.size).toBe(0); - expect(map.toObject()).toEqual({}); + it('expresses value equality with unordered sequences', () => { + const m1 = Map({ A: 1, B: 2, C: 3 }); + const m2 = Map({ C: 3, B: 2, A: 1 }); + expect(is(m1, m2)).toBe(true); }); - check.it('deletes from transient', {maxSize: 5000}, [gen.posInt], len => { - var map = Range(0, len).toMap().asMutable(); - for (var ii = 0; ii < len; ii++) { - expect(map.size).toBe(len - ii); - map.remove(ii); - } - expect(map.size).toBe(0); - expect(map.toObject()).toEqual({}); + it('does not equal Record with same values', () => { + const m1 = Map({ A: 1, B: 2, C: 3 }); + const m2 = Record({ A: 1, B: 2, C: 3 }); + expect(is(m1, m2)).toBe(false); }); - check.it('iterates through all entries', [gen.posInt], len => { - var v = Range(0, len).toMap(); - var a = v.toArray(); - var iter = v.entries(); - for (var ii = 0; ii < len; ii++) { - delete a[ iter.next().value[0] ]; - } - expect(a).toEqual(new Array(len)); + it('deletes all the provided keys', () => { + const NOT_SET = undefined; + const m1 = Map({ A: 1, B: 2, C: 3 }); + const m2 = m1.deleteAll(['A', 'B']); + expect(m2.get('A')).toBe(NOT_SET); + expect(m2.get('B')).toBe(NOT_SET); + expect(m2.get('C')).toBe(3); + expect(m2.size).toBe(1); }); - it('allows chained mutations', () => { - var m1 = Map(); - var m2 = m1.set('a', 1); - var m3 = m2.withMutations(m => m.set('b', 2).set('c', 3)); - var m4 = m3.set('d', 4); + it('remains unchanged when no keys are provided', () => { + const m1 = Map({ A: 1, B: 2, C: 3 }); + const m2 = m1.deleteAll([]); + expect(m1).toBe(m2); + }); - expect(m1.toObject()).toEqual({}); - expect(m2.toObject()).toEqual({'a':1}); - expect(m3.toObject()).toEqual({'a': 1, 'b': 2, 'c': 3}); - expect(m4.toObject()).toEqual({'a': 1, 'b': 2, 'c': 3, 'd': 4}); + it('uses toString on keys and values', () => { + class A extends Record({ x: null as number | null }) { + toString() { + return this.x; + } + } + + const r = new A({ x: 2 }); + const map = Map([[r, r]]); + expect(map.toString()).toEqual('Map { 2: 2 }'); }); - it('expresses value equality with unordered sequences', () => { - var m1 = Map({ A: 1, B: 2, C: 3 }); - var m2 = Map({ C: 3, B: 2, A: 1 }); - expect(is(m1, m2)).toBe(true); + it('supports Symbols as tuple keys', () => { + const a = Symbol('a'); + const b = Symbol('b'); + const c = Symbol('c'); + const m = Map([ + [a, 'a'], + [b, 'b'], + [c, 'c'], + ]); + expect(m.size).toBe(3); + expect(m.get(a)).toBe('a'); + expect(m.get(b)).toBe('b'); + expect(m.get(c)).toBe('c'); + }); + + it('supports Symbols as object constructor keys', () => { + const a = Symbol.for('a'); + const b = Symbol('b'); + const c = Symbol('c'); + const m = Map({ + [a]: 'a', + [b]: 'b', + [c]: 'c', + }); + expect(m.size).toBe(3); + expect(m.get(a)).toBe('a'); + expect(m.get(b)).toBe('b'); + expect(m.get(c)).toBe('c'); + + const m2 = fromJS({ [a]: 'a' }) as Map; + expect(m2.size).toBe(1); + expect(m2.get(a)).toBe('a'); }); + it('Symbol keys are unique', () => { + const a = Symbol('FooBar'); + const b = Symbol('FooBar'); + const m = Map([ + [a, 'FizBuz'], + [b, 'FooBar'], + ]); + expect(m.size).toBe(2); + expect(m.get(a)).toBe('FizBuz'); + expect(m.get(b)).toBe('FooBar'); + }); + + it('mergeDeep with tuple Symbol keys', () => { + const a = Symbol('a'); + const b = Symbol('b'); + const c = Symbol('c'); + const d = Symbol('d'); + const e = Symbol('e'); + const f = Symbol('f'); + const g = Symbol('g'); + + // Note the use of nested Map constructors, Map() does not do a + // deep conversion! + const m1 = Map([ + [ + a, + Map([ + [ + b, + Map([ + [c, 1], + [d, 2], + ]), + ], + ]), + ], + ]); + const m2 = Map([ + [ + a, + Map([ + [ + b, + Map([ + [c, 10], + [e, 20], + [f, 30], + [g, 40], + ]), + ], + ]), + ], + ]); + const merged = m1.mergeDeep(m2); + + expect(merged).toEqual( + Map([ + [ + a, + Map([ + [ + b, + Map([ + [c, 10], + [d, 2], + [e, 20], + [f, 30], + [g, 40], + ]), + ], + ]), + ], + ]) + ); + }); }); diff --git a/__tests__/MultiRequire.js b/__tests__/MultiRequire.js index ebae7f3748..17c3de9472 100644 --- a/__tests__/MultiRequire.js +++ b/__tests__/MultiRequire.js @@ -1,33 +1,40 @@ -jest.autoMockOff(); +import { describe, expect, it, jest } from '@jest/globals'; +import * as Immutable1 from '../src/Immutable'; -var Immutable1 = require('../'); -jest.resetModuleRegistry(); -var Immutable2 = require('../'); +jest.resetModules(); -describe('MultiRequire', () => { +const Immutable2 = jest.requireActual('../src/Immutable'); +describe('MultiRequire', () => { it('might require two different instances of Immutable', () => { expect(Immutable1).not.toBe(Immutable2); - expect(Immutable1.Map({a: 1}).toJS()).toEqual({a: 1}); - expect(Immutable2.Map({a: 1}).toJS()).toEqual({a: 1}); + expect(Immutable1.Map({ a: 1 }).toJS()).toEqual({ a: 1 }); + expect(Immutable2.Map({ a: 1 }).toJS()).toEqual({ a: 1 }); }); it('detects sequences', () => { - var x = Immutable1.Map({a: 1}); - var y = Immutable2.Map({a: 1}); - expect(Immutable1.Iterable.isIterable(y)).toBe(true); - expect(Immutable2.Iterable.isIterable(x)).toBe(true); + const x = Immutable1.Map({ a: 1 }); + const y = Immutable2.Map({ a: 1 }); + expect(Immutable1.isCollection(y)).toBe(true); + expect(Immutable2.isCollection(x)).toBe(true); + }); + + it('detects records', () => { + const R1 = Immutable1.Record({ a: 1 }); + const R2 = Immutable2.Record({ a: 1 }); + expect(Immutable1.Record.isRecord(R2())).toBe(true); + expect(Immutable2.Record.isRecord(R1())).toBe(true); }); it('converts to JS when inter-nested', () => { - var deep = Immutable1.Map({ + const deep = Immutable1.Map({ a: 1, b: 2, c: Immutable2.Map({ x: 3, y: 4, - z: Immutable1.Map() - }) + z: Immutable1.Map(), + }), }); expect(deep.toJS()).toEqual({ @@ -36,55 +43,50 @@ describe('MultiRequire', () => { c: { x: 3, y: 4, - z: {} - } + z: {}, + }, }); }); it('compares for equality', () => { - var x = Immutable1.Map({a: 1}); - var y = Immutable2.Map({a: 1}); + const x = Immutable1.Map({ a: 1 }); + const y = Immutable2.Map({ a: 1 }); expect(Immutable1.is(x, y)).toBe(true); expect(Immutable2.is(x, y)).toBe(true); }); it('flattens nested values', () => { - var nested = Immutable1.List( - Immutable2.List( - Immutable1.List( - Immutable2.List.of(1, 2) - ) - ) + const nested = Immutable1.List( + Immutable2.List(Immutable1.List(Immutable2.List.of(1, 2))) ); - expect(nested.flatten().toJS()).toEqual([1,2]); + expect(nested.flatten().toJS()).toEqual([1, 2]); }); it('detects types', () => { - var c1 = Immutable1.Map(); - var c2 = Immutable2.Map(); + let c1 = Immutable1.Map(); + let c2 = Immutable2.Map(); expect(Immutable1.Map.isMap(c2)).toBe(true); expect(Immutable2.Map.isMap(c1)).toBe(true); - var c1 = Immutable1.OrderedMap(); - var c2 = Immutable2.OrderedMap(); + c1 = Immutable1.OrderedMap(); + c2 = Immutable2.OrderedMap(); expect(Immutable1.OrderedMap.isOrderedMap(c2)).toBe(true); expect(Immutable2.OrderedMap.isOrderedMap(c1)).toBe(true); - var c1 = Immutable1.List(); - var c2 = Immutable2.List(); + c1 = Immutable1.List(); + c2 = Immutable2.List(); expect(Immutable1.List.isList(c2)).toBe(true); expect(Immutable2.List.isList(c1)).toBe(true); - var c1 = Immutable1.Stack(); - var c2 = Immutable2.Stack(); + c1 = Immutable1.Stack(); + c2 = Immutable2.Stack(); expect(Immutable1.Stack.isStack(c2)).toBe(true); expect(Immutable2.Stack.isStack(c1)).toBe(true); - var c1 = Immutable1.Set(); - var c2 = Immutable2.Set(); + c1 = Immutable1.Set(); + c2 = Immutable2.Set(); expect(Immutable1.Set.isSet(c2)).toBe(true); expect(Immutable2.Set.isSet(c1)).toBe(true); }); - }); diff --git a/__tests__/ObjectSeq.ts b/__tests__/ObjectSeq.ts index df30d3e74a..2b10807cb5 100644 --- a/__tests__/ObjectSeq.ts +++ b/__tests__/ObjectSeq.ts @@ -1,46 +1,49 @@ -/// -/// - -jest.autoMockOff(); - +import { describe, expect, it } from '@jest/globals'; import { Seq } from 'immutable'; describe('ObjectSequence', () => { - it('maps', () => { - var i = Seq({'a': 'A', 'b': 'B', 'c': 'C'}); - var m = i.map(x => x + x).toObject(); - expect(m).toEqual({'a': 'AA', 'b': 'BB', 'c': 'CC'}); + const i = Seq({ a: 'A', b: 'B', c: 'C' }); + const m = i.map((x) => x + x).toObject(); + expect(m).toEqual({ a: 'AA', b: 'BB', c: 'CC' }); }); it('reduces', () => { - var i = Seq({'a': 'A', 'b': 'B', 'c': 'C'}); - var r = i.reduce((r, x) => r + x, ''); + const i = Seq({ a: 'A', b: 'B', c: 'C' }); + const r = i.reduce((acc, x) => acc + x, ''); expect(r).toEqual('ABC'); }); it('extracts keys', () => { - var i = Seq({'a': 'A', 'b': 'B', 'c': 'C'}); - var k = i.keySeq().toArray(); + const i = Seq({ a: 'A', b: 'B', c: 'C' }); + const k = i.keySeq().toArray(); expect(k).toEqual(['a', 'b', 'c']); }); it('is reversable', () => { - var i = Seq({'a': 'A', 'b': 'B', 'c': 'C'}); - var k = i.reverse().toArray(); - expect(k).toEqual(['C', 'B', 'A']); + const i = Seq({ a: 'A', b: 'B', c: 'C' }); + const k = i.reverse().toArray(); + expect(k).toEqual([ + ['c', 'C'], + ['b', 'B'], + ['a', 'A'], + ]); }); - it('can double reversable', () => { - var i = Seq({'a': 'A', 'b': 'B', 'c': 'C'}); - var k = i.reverse().reverse().toArray(); - expect(k).toEqual(['A', 'B', 'C']); + it('is double reversable', () => { + const i = Seq({ a: 'A', b: 'B', c: 'C' }); + const k = i.reverse().reverse().toArray(); + expect(k).toEqual([ + ['a', 'A'], + ['b', 'B'], + ['c', 'C'], + ]); }); it('can be iterated', () => { - var obj = { a: 1, b: 2, c: 3 }; - var seq = Seq(obj); - var entries = seq.entries(); + const obj = { a: 1, b: 2, c: 3 }; + const seq = Seq(obj); + const entries = seq.entries(); expect(entries.next()).toEqual({ value: ['a', 1], done: false }); expect(entries.next()).toEqual({ value: ['b', 2], done: false }); expect(entries.next()).toEqual({ value: ['c', 3], done: false }); @@ -48,11 +51,11 @@ describe('ObjectSequence', () => { }); it('cannot be mutated after calling toObject', () => { - var seq = Seq({ a: 1, b: 2, c: 3 }); + const seq = Seq({ a: 1, b: 2, c: 3 }); - var obj = seq.toObject(); - obj['c'] = 10; - var seq2 = Seq(obj); + const obj = seq.toObject(); + obj.c = 10; + const seq2 = Seq(obj); expect(seq.get('c')).toEqual(3); expect(seq2.get('c')).toEqual(10); diff --git a/__tests__/OrderedMap.ts b/__tests__/OrderedMap.ts index 8c994bb0d3..9c06a6582e 100644 --- a/__tests__/OrderedMap.ts +++ b/__tests__/OrderedMap.ts @@ -1,71 +1,88 @@ -/// -/// - -jest.autoMockOff(); - -import { OrderedMap, Seq } from 'immutable'; +import { describe, expect, it } from '@jest/globals'; +import { OrderedMap, Range, Seq } from 'immutable'; describe('OrderedMap', () => { - it('converts from object', () => { - var m = OrderedMap({'c': 'C', 'b': 'B', 'a': 'A'}); + const m = OrderedMap({ c: 'C', b: 'B', a: 'A' }); expect(m.get('a')).toBe('A'); expect(m.get('b')).toBe('B'); expect(m.get('c')).toBe('C'); - expect(m.toArray()).toEqual(['C','B','A']); + expect(m.toArray()).toEqual([ + ['c', 'C'], + ['b', 'B'], + ['a', 'A'], + ]); }); it('constructor provides initial values', () => { - var m = OrderedMap({'a': 'A', 'b': 'B', 'c': 'C'}); + const m = OrderedMap({ a: 'A', b: 'B', c: 'C' }); expect(m.get('a')).toBe('A'); expect(m.get('b')).toBe('B'); expect(m.get('c')).toBe('C'); expect(m.size).toBe(3); - expect(m.toArray()).toEqual(['A','B','C']); + expect(m.toArray()).toEqual([ + ['a', 'A'], + ['b', 'B'], + ['c', 'C'], + ]); }); it('provides initial values in a mixed order', () => { - var m = OrderedMap({'c': 'C', 'b': 'B', 'a': 'A'}); + const m = OrderedMap({ c: 'C', b: 'B', a: 'A' }); expect(m.get('a')).toBe('A'); expect(m.get('b')).toBe('B'); expect(m.get('c')).toBe('C'); expect(m.size).toBe(3); - expect(m.toArray()).toEqual(['C','B','A']); + expect(m.toArray()).toEqual([ + ['c', 'C'], + ['b', 'B'], + ['a', 'A'], + ]); }); it('constructor accepts sequences', () => { - var s = Seq({'c': 'C', 'b': 'B', 'a': 'A'}); - var m = OrderedMap(s); + const s = Seq({ c: 'C', b: 'B', a: 'A' }); + const m = OrderedMap(s); expect(m.get('a')).toBe('A'); expect(m.get('b')).toBe('B'); expect(m.get('c')).toBe('C'); expect(m.size).toBe(3); - expect(m.toArray()).toEqual(['C','B','A']); + expect(m.toArray()).toEqual([ + ['c', 'C'], + ['b', 'B'], + ['a', 'A'], + ]); }); it('maintains order when new keys are set', () => { - var m = OrderedMap() + const m = OrderedMap() .set('A', 'aardvark') .set('Z', 'zebra') .set('A', 'antelope'); expect(m.size).toBe(2); - expect(m.toArray()).toEqual(['antelope', 'zebra']); + expect(m.toArray()).toEqual([ + ['A', 'antelope'], + ['Z', 'zebra'], + ]); }); it('resets order when a keys is deleted', () => { - var m = OrderedMap() + const m = OrderedMap() .set('A', 'aardvark') .set('Z', 'zebra') .remove('A') .set('A', 'antelope'); expect(m.size).toBe(2); - expect(m.toArray()).toEqual(['zebra', 'antelope']); + expect(m.toArray()).toEqual([ + ['Z', 'zebra'], + ['A', 'antelope'], + ]); }); it('removes correctly', () => { - var m = OrderedMap({ - 'A': 'aardvark', - 'Z': 'zebra' + const m = OrderedMap({ + A: 'aardvark', + Z: 'zebra', }).remove('A'); expect(m.size).toBe(1); expect(m.get('A')).toBe(undefined); @@ -73,21 +90,53 @@ describe('OrderedMap', () => { }); it('respects order for equality', () => { - var m1 = OrderedMap().set('A', 'aardvark').set('Z', 'zebra'); - var m2 = OrderedMap().set('Z', 'zebra').set('A', 'aardvark'); + const m1 = OrderedMap().set('A', 'aardvark').set('Z', 'zebra'); + const m2 = OrderedMap().set('Z', 'zebra').set('A', 'aardvark'); expect(m1.equals(m2)).toBe(false); expect(m1.equals(m2.reverse())).toBe(true); }); it('respects order when merging', () => { - var m1 = OrderedMap({A: 'apple', B: 'banana', C: 'coconut'}); - var m2 = OrderedMap({C: 'chocolate', B: 'butter', D: 'donut'}); - expect(m1.merge(m2).entrySeq().toArray()).toEqual( - [['A','apple'],['B','butter'],['C','chocolate'],['D','donut']] - ); - expect(m2.merge(m1).entrySeq().toArray()).toEqual( - [['C','coconut'],['B','banana'],['D','donut'],['A','apple']] - ); + const m1 = OrderedMap({ A: 'apple', B: 'banana', C: 'coconut' }); + const m2 = OrderedMap({ C: 'chocolate', B: 'butter', D: 'donut' }); + expect(m1.merge(m2).entrySeq().toArray()).toEqual([ + ['A', 'apple'], + ['B', 'butter'], + ['C', 'chocolate'], + ['D', 'donut'], + ]); + expect(m2.merge(m1).entrySeq().toArray()).toEqual([ + ['C', 'coconut'], + ['B', 'banana'], + ['D', 'donut'], + ['A', 'apple'], + ]); }); + it('performs deleteAll correctly after resizing internal list', () => { + // See condition for resizing internal list here: + // https://github.com/immutable-js/immutable-js/blob/91c7c1e82ec616804768f968cc585565e855c8fd/src/OrderedMap.js#L138 + + // Create OrderedMap greater than or equal to SIZE (currently 32) + const SIZE = 32; + let map = OrderedMap(Range(0, SIZE).map((key) => [key, 0])); + + // Delete half of the keys so that internal list is twice the size of internal map + const keysToDelete = Range(0, SIZE / 2); + map = map.deleteAll(keysToDelete); + + // Delete one more key to trigger resizing + map = map.deleteAll([SIZE / 2]); + + expect(map.size).toBe(SIZE / 2 - 1); + }); + + it('hashCode should return the same value if the values are the same', () => { + const m1 = OrderedMap({ b: 'b' }); + const m2 = OrderedMap({ a: 'a', b: 'b' }).remove('a'); + const m3 = OrderedMap({ b: 'b' }).remove('b').set('b', 'b'); + + expect(m1.hashCode()).toEqual(m2.hashCode()); + expect(m1.hashCode()).toEqual(m3.hashCode()); + }); }); diff --git a/__tests__/OrderedSet.ts b/__tests__/OrderedSet.ts index 73c76d1069..12c958072d 100644 --- a/__tests__/OrderedSet.ts +++ b/__tests__/OrderedSet.ts @@ -1,59 +1,153 @@ -/// -/// - -jest.autoMockOff(); - -import { OrderedSet } from 'immutable'; +import { describe, expect, it } from '@jest/globals'; +import { OrderedSet, Map } from 'immutable'; describe('OrderedSet', () => { - it('provides initial values in a mixed order', () => { - var s = OrderedSet.of('C', 'B', 'A'); + const s = OrderedSet.of('C', 'B', 'A'); expect(s.has('A')).toBe(true); expect(s.has('B')).toBe(true); expect(s.has('C')).toBe(true); expect(s.size).toBe(3); - expect(s.toArray()).toEqual(['C','B','A']); + expect(s.toArray()).toEqual(['C', 'B', 'A']); }); it('maintains order when new values are added', () => { - var s = OrderedSet() - .add('A') - .add('Z') - .add('A'); + const s = OrderedSet().add('A').add('Z').add('A'); expect(s.size).toBe(2); expect(s.toArray()).toEqual(['A', 'Z']); }); it('resets order when a value is deleted', () => { - var s = OrderedSet() - .add('A') - .add('Z') - .remove('A') - .add('A'); + const s = OrderedSet().add('A').add('Z').remove('A').add('A'); expect(s.size).toBe(2); expect(s.toArray()).toEqual(['Z', 'A']); }); it('removes correctly', () => { - var s = OrderedSet([ 'A', 'Z' ]).remove('A'); + const s = OrderedSet(['A', 'Z']).remove('A'); expect(s.size).toBe(1); expect(s.has('A')).toBe(false); expect(s.has('Z')).toBe(true); }); it('respects order for equality', () => { - var s1 = OrderedSet.of('A', 'Z') - var s2 = OrderedSet.of('Z', 'A') + const s1 = OrderedSet.of('A', 'Z'); + const s2 = OrderedSet.of('Z', 'A'); expect(s1.equals(s2)).toBe(false); expect(s1.equals(s2.reverse())).toBe(true); }); it('respects order when unioning', () => { - var s1 = OrderedSet.of('A', 'B', 'C'); - var s2 = OrderedSet.of('C', 'B', 'D'); - expect(s1.union(s2).toArray()).toEqual(['A','B','C','D']); - expect(s2.union(s1).toArray()).toEqual(['C','B','D','A']); + const s1 = OrderedSet.of('A', 'B', 'C'); + const s2 = OrderedSet.of('C', 'B', 'D'); + expect(s1.union(s2).toArray()).toEqual(['A', 'B', 'C', 'D']); + expect(s2.union(s1).toArray()).toEqual(['C', 'B', 'D', 'A']); }); + it('can be zipped', () => { + const s1 = OrderedSet.of('A', 'B', 'C'); + const s2 = OrderedSet.of('C', 'B', 'D'); + expect(s1.zip(s2).toArray()).toEqual([ + ['A', 'C'], + ['B', 'B'], + ['C', 'D'], + ]); + expect(s1.zipWith((c1, c2) => c1 + c2, s2).toArray()).toEqual([ + 'AC', + 'BB', + 'CD', + ]); + }); + + /** + * @see https://github.com/immutable-js/immutable-js/issues/1716 + */ + it('handles `subtract` when Set contains >=32 elements', () => { + const fillArray = (nb) => + Array(nb) + .fill(1) + .map((el, i) => i + 1); + + const capacity = 32; + // items from keys 0 to 31 and values 1 to 32 + const defaultItems = fillArray(capacity); + + const allItems = OrderedSet(defaultItems); + + const partialCapacity = Math.ceil(capacity / 2) + 1; + const someOfThem = fillArray(partialCapacity); + expect(someOfThem.length).toBe(17); + + const existingItems = OrderedSet(someOfThem).intersect(allItems); + + expect(allItems.subtract(existingItems).size).toBe(15); + expect(allItems.subtract(existingItems).size + someOfThem.length).toBe(32); + }); + + /** + * @see https://github.com/immutable-js/immutable-js/issues/1603 + */ + it('handles consecutive `subtract` invocations', () => { + let a = OrderedSet(); + let b = OrderedSet(); + let c; + let d; + // Set a to 0-45 + for (let i = 0; i < 46; i++) { + a = a.add(i); + } + // Set b to 0-24 + for (let i = 0; i < 25; i++) { + b = b.add(i); + } + // Set c to 0-23 + // eslint-disable-next-line prefer-const + c = b.butLast(); + + // Set d to 0-22 + // eslint-disable-next-line prefer-const + d = c.butLast(); + + // Internal list resizing happens on the final `subtract` when subtracting d from a + const aNotB = a.subtract(b); + const aNotC = a.subtract(c); + const aNotD = a.subtract(d); + + expect(aNotB.size).toBe(21); + expect(aNotC.size).toBe(22); + expect(aNotD.size).toBe(23); + }); + + it('keeps the Set ordered when updating a value with .map()', () => { + const first = Map({ id: 1, valid: true }); + const second = Map({ id: 2, valid: true }); + const third = Map({ id: 3, valid: true }); + const initial = OrderedSet([first, second, third]); + + const out = initial.map((t) => { + if (t.get('id') === 2) { + return t.set('valid', false); + } + return t; + }); + + const expected = OrderedSet([ + Map({ id: 1, valid: true }), + Map({ id: 2, valid: false }), + Map({ id: 3, valid: true }), + ]); + + expect(out).toEqual(expected); + + expect(out.has(first)).toBe(true); + expect(out.has(second)).toBe(false); + expect(out.has(third)).toBe(true); + }); + + it('hashCode should return the same value if the values are the same', () => { + const set1 = OrderedSet(['hello']); + const set2 = OrderedSet(['goodbye', 'hello']).remove('goodbye'); + + expect(set1.hashCode()).toBe(set2.hashCode()); + }); }); diff --git a/__tests__/Predicates.ts b/__tests__/Predicates.ts new file mode 100644 index 0000000000..0ab282205b --- /dev/null +++ b/__tests__/Predicates.ts @@ -0,0 +1,61 @@ +import { describe, expect, it } from '@jest/globals'; +import { + is, + isImmutable, + isValueObject, + List, + Map, + Set, + Stack, +} from 'immutable'; + +describe('isImmutable', () => { + it('behaves as advertised', () => { + expect(isImmutable([])).toBe(false); + expect(isImmutable({})).toBe(false); + expect(isImmutable(Map())).toBe(true); + expect(isImmutable(List())).toBe(true); + expect(isImmutable(Set())).toBe(true); + expect(isImmutable(Stack())).toBe(true); + expect(isImmutable(Map().asMutable())).toBe(true); + }); +}); + +describe('isValueObject', () => { + it('behaves as advertised', () => { + expect(isValueObject(null)).toBe(false); + expect(isValueObject(123)).toBe(false); + expect(isValueObject('abc')).toBe(false); + expect(isValueObject([])).toBe(false); + expect(isValueObject({})).toBe(false); + expect(isValueObject(Map())).toBe(true); + expect(isValueObject(List())).toBe(true); + expect(isValueObject(Set())).toBe(true); + expect(isValueObject(Stack())).toBe(true); + expect(isValueObject(Map().asMutable())).toBe(true); + }); + + it('works on custom types', () => { + class MyValueType { + v: number; + + constructor(val: number) { + this.v = val; + } + + equals(other) { + return Boolean(other && this.v === other.v); + } + + hashCode() { + return this.v; + } + } + + expect(isValueObject(new MyValueType(123))).toBe(true); + expect(is(new MyValueType(123), new MyValueType(123))).toBe(true); + expect(Set().add(new MyValueType(123)).add(new MyValueType(123)).size).toBe( + 1 + ); + }); +}); diff --git a/__tests__/Range.ts b/__tests__/Range.ts index 7c6f16a551..94c096d1a8 100644 --- a/__tests__/Range.ts +++ b/__tests__/Range.ts @@ -1,58 +1,68 @@ -/// -/// - -jest.autoMockOff(); - -import * as jasmineCheck from 'jasmine-check'; -jasmineCheck.install(); - -import { Range} from 'immutable'; +import { describe, expect, it } from '@jest/globals'; +import { Range } from 'immutable'; +import fc from 'fast-check'; describe('Range', () => { - it('fixed range', () => { - var v = Range(0, 3); + const v = Range(0, 3); expect(v.size).toBe(3); expect(v.first()).toBe(0); - expect(v.rest().toArray()).toEqual([1,2]); + expect(v.rest().toArray()).toEqual([1, 2]); expect(v.last()).toBe(2); - expect(v.butLast().toArray()).toEqual([0,1]); - expect(v.toArray()).toEqual([0,1,2]); + expect(v.butLast().toArray()).toEqual([0, 1]); + expect(v.toArray()).toEqual([0, 1, 2]); }); it('stepped range', () => { - var v = Range(1, 10, 3); + const v = Range(1, 10, 3); expect(v.size).toBe(3); expect(v.first()).toBe(1); - expect(v.rest().toArray()).toEqual([4,7]); + expect(v.rest().toArray()).toEqual([4, 7]); expect(v.last()).toBe(7); - expect(v.butLast().toArray()).toEqual([1,4]); - expect(v.toArray()).toEqual([1,4,7]); + expect(v.butLast().toArray()).toEqual([1, 4]); + expect(v.toArray()).toEqual([1, 4, 7]); + }); + + it('range should contain start and end values', () => { + // @ts-expect-error -- test that runtime error is thrown + expect(() => Range()).toThrow( + 'You must define a start value when using Range' + ); + // @ts-expect-error -- test that runtime error is thrown + expect(() => Range(1)).toThrow( + 'You must define an end value when using Range' + ); }); it('open range', () => { - var v = Range(10); + const v = Range(10, Infinity); expect(v.size).toBe(Infinity); expect(v.first()).toBe(10); expect(v.rest().first()).toBe(11); expect(v.last()).toBe(Infinity); expect(v.butLast().first()).toBe(10); expect(v.butLast().last()).toBe(Infinity); - expect(() => v.rest().toArray()).toThrow('Cannot perform this action with an infinite size.'); - expect(() => v.butLast().toArray()).toThrow('Cannot perform this action with an infinite size.'); - expect(() => v.toArray()).toThrow('Cannot perform this action with an infinite size.'); + expect(() => v.rest().toArray()).toThrow( + 'Cannot perform this action with an infinite size.' + ); + expect(() => v.butLast().toArray()).toThrow( + 'Cannot perform this action with an infinite size.' + ); + expect(() => v.toArray()).toThrow( + 'Cannot perform this action with an infinite size.' + ); }); it('backwards range', () => { - var v = Range(10, 1, 3); + const v = Range(10, 1, 3); expect(v.size).toBe(3); expect(v.first()).toBe(10); expect(v.last()).toBe(4); - expect(v.toArray()).toEqual([10,7,4]); + expect(v.toArray()).toEqual([10, 7, 4]); }); it('empty range', () => { - var v = Range(10, 10); + const v = Range(10, 10); expect(v.size).toBe(0); expect(v.first()).toBe(undefined); expect(v.rest().toArray()).toEqual([]); @@ -61,127 +71,162 @@ describe('Range', () => { expect(v.toArray()).toEqual([]); }); - check.it('includes first, excludes last', [gen.int, gen.int], function (from, to) { - var isIncreasing = to >= from; - var size = isIncreasing ? to - from : from - to; - var r = Range(from, to); - var a = r.toArray(); - expect(r.size).toBe(size); - expect(a.length).toBe(size); - expect(r.get(0)).toBe(size ? from : undefined); - expect(a[0]).toBe(size ? from : undefined); - var last = to + (isIncreasing ? -1 : 1); - expect(r.last()).toBe(size ? last : undefined); - if (size) { - expect(a[a.length - 1]).toBe(last); - } - }); - - var shrinkInt = gen.shrink(gen.int); - - check.it('slices the same as array slices', - [shrinkInt, shrinkInt, shrinkInt, shrinkInt], - function (from, to, begin, end) { - var r = Range(from, to); - var a = r.toArray(); - expect(r.slice(begin, end).toArray()).toEqual(a.slice(begin, end)); - } - ); + const shrinkInt = fc.integer({ min: -1000, max: 1000 }); + + it('includes first, excludes last', () => { + fc.assert( + fc.property(shrinkInt, shrinkInt, (from, to) => { + const isIncreasing = to >= from; + const size = isIncreasing ? to - from : from - to; + const r = Range(from, to); + const a = r.toArray(); + expect(r.size).toBe(size); + expect(a.length).toBe(size); + expect(r.get(0)).toBe(size ? from : undefined); + expect(a[0]).toBe(size ? from : undefined); + const last = to + (isIncreasing ? -1 : 1); + expect(r.last()).toBe(size ? last : undefined); + if (size) { + // eslint-disable-next-line jest/no-conditional-expect + expect(a[a.length - 1]).toBe(last); + } + }) + ); + }); + + it('slices the same as array slices', () => { + fc.assert( + fc.property( + shrinkInt, + shrinkInt, + shrinkInt, + shrinkInt, + (from, to, begin, end) => { + const r = Range(from, to); + const a = r.toArray(); + expect(r.slice(begin, end).toArray()).toEqual(a.slice(begin, end)); + } + ) + ); + }); it('slices range', () => { - var v = Range(1, 11, 2); - var s = v.slice(1, -2); + const v = Range(1, 11, 2); + const s = v.slice(1, -2); expect(s.size).toBe(2); - expect(s.toArray()).toEqual([3,5]); + expect(s.toArray()).toEqual([3, 5]); }); it('empty slice of range', () => { - var v = Range(1, 11, 2); - var s = v.slice(100, 200); + const v = Range(1, 11, 2); + const s = v.slice(100, 200); expect(s.size).toBe(0); expect(s.toArray()).toEqual([]); }); it('slices empty range', () => { - var v = Range(10, 10); - var s = v.slice(1, -2); + const v = Range(10, 10); + const s = v.slice(1, -2); expect(s.size).toBe(0); expect(s.toArray()).toEqual([]); }); it('stepped range does not land on end', () => { - var v = Range(0, 7, 2); + const v = Range(0, 7, 2); expect(v.size).toBe(4); - expect(v.toArray()).toEqual([0,2,4,6]); + expect(v.toArray()).toEqual([0, 2, 4, 6]); }); it('can be float', () => { - var v = Range(0.5, 2.5, 0.5); + const v = Range(0.5, 2.5, 0.5); expect(v.size).toBe(4); expect(v.toArray()).toEqual([0.5, 1, 1.5, 2]); }); it('can be negative', () => { - var v = Range(10, -10, 5); + const v = Range(10, -10, 5); expect(v.size).toBe(4); - expect(v.toArray()).toEqual([10,5,0,-5]); + expect(v.toArray()).toEqual([10, 5, 0, -5]); }); it('can get from any index in O(1)', () => { - var v = Range(0, Infinity, 8); + const v = Range(0, Infinity, 8); expect(v.get(111)).toBe(888); }); it('can find an index in O(1)', () => { - var v = Range(0, Infinity, 8); + const v = Range(0, Infinity, 8); expect(v.indexOf(888)).toBe(111); }); it('maps values', () => { - var r = Range(0, 4).map(v => v * v); - expect(r.toArray()).toEqual([0,1,4,9]); + const r = Range(0, 4).map((v) => v * v); + expect(r.toArray()).toEqual([0, 1, 4, 9]); }); it('filters values', () => { - var r = Range(0, 10).filter(v => v % 2 == 0); - expect(r.toArray()).toEqual([0,2,4,6,8]); + const r = Range(0, 10).filter((v) => v % 2 === 0); + expect(r.toArray()).toEqual([0, 2, 4, 6, 8]); }); - it('reduces values', () => { - var v = Range(0, 10, 2); - - var r = v.reduce((a, b) => a + b, 0); + it('partitions values', () => { + const r = Range(0, 10) + .partition((v) => v % 2 === 0) + .map((part) => part.toArray()); + expect(r).toEqual([ + [1, 3, 5, 7, 9], + [0, 2, 4, 6, 8], + ]); + }); + it('reduces values', () => { + const v = Range(0, 10, 2); + const r = v.reduce((a, b) => a + b, 0); expect(r).toEqual(20); }); it('takes and skips values', () => { - var v = Range(0, 100, 3) - - var r = v.skip(2).take(2); - + const v = Range(0, 100, 3); + const r = v.skip(2).take(2); expect(r.toArray()).toEqual([6, 9]); }); it('can describe lazy operations', () => { expect( - Range(1, Infinity).map(n => -n).take(5).toArray() - ).toEqual( - [ -1, -2, -3, -4, -5 ] - ); + Range(1, Infinity) + .map((n) => -n) + .take(5) + .toArray() + ).toEqual([-1, -2, -3, -4, -5]); }); it('efficiently chains array methods', () => { - var v = Range(1, Infinity); - - var r = v - .filter(x => x % 2 == 0) + const v = Range(1, Infinity); + const r = v + .filter((x) => x % 2 === 0) .skip(2) - .map(x => x * x) + .map((x) => x * x) .take(3) .reduce((a, b) => a + b, 0); expect(r).toEqual(200); }); + it('sliced sequence works even on filtered sequence', () => { + expect(Range(0, 3).slice(-2).toArray()).toEqual([1, 2]); + + expect( + Range(0, 3) + .filter(() => true) + .slice(-2) + .toArray() + ).toEqual([1, 2]); + }); + + it('toString', () => { + expect(Range(0, 0).toString()).toBe('Range []'); + expect(Range(0, 3).toString()).toBe('Range [ 0...3 ]'); + expect(Range(0, 10, 2).toString()).toBe('Range [ 0...10 by 2 ]'); + expect(Range(10, 0, -2).toString()).toBe('Range [ 10...0 by -2 ]'); + }); }); diff --git a/__tests__/Record.ts b/__tests__/Record.ts index 1a3768e1d1..3839b6c46b 100644 --- a/__tests__/Record.ts +++ b/__tests__/Record.ts @@ -1,64 +1,59 @@ -/// -/// - -jest.autoMockOff(); - -import { Record, Seq } from 'immutable'; +import { describe, expect, it } from '@jest/globals'; +import { isKeyed, List, Map, Record, Seq } from 'immutable'; describe('Record', () => { - it('defines a constructor', () => { - var MyType = Record({a:1, b:2, c:3}); + const MyType = Record({ a: 1, b: 2, c: 3 }); - var t1 = new MyType(); - var t2 = t1.set('a', 10); - var t3 = t2.clear(); + const t1 = MyType(); + const t2 = t1.set('a', 10); expect(t1 instanceof Record).toBe(true); expect(t1 instanceof MyType).toBe(true); - expect(t3 instanceof Record).toBe(true); - expect(t3 instanceof MyType).toBe(true); + expect(t2 instanceof Record).toBe(true); + expect(t2 instanceof MyType).toBe(true); expect(t1.get('a')).toBe(1); expect(t2.get('a')).toBe(10); + }); + + it('allows for a descriptive name', () => { + const Person = Record({ name: null as string | null }, 'Person'); - expect(t1.size).toBe(3); - expect(t2.size).toBe(3); - }) + const me = Person({ name: 'My Name' }); + expect(me.toString()).toEqual('Person { name: "My Name" }'); + expect(Record.getDescriptiveName(me)).toEqual('Person'); + expect(Person.displayName).toBe('Person'); + }); it('passes through records of the same type', () => { - var P2 = Record({ x: 0, y: 0 }); - var P3 = Record({ x: 0, y: 0, z: 0 }); - var p2 = P2(); - var p3 = P3(); + const P2 = Record({ x: 0, y: 0 }); + const P3 = Record({ x: 0, y: 0, z: 0 }); + const p2 = P2(); + const p3 = P3(); expect(P3(p2) instanceof P3).toBe(true); expect(P2(p3) instanceof P2).toBe(true); expect(P2(p2)).toBe(p2); expect(P3(p3)).toBe(p3); - }) - - it('only allows setting what it knows about', () => { - var MyType = Record({a:1, b:2, c:3}); - - var t1 = new MyType({a: 10, b:20}); - expect(() => { - t1.set('d', 4); - }).toThrow('Cannot set unknown key "d" on Record'); }); - it('has a fixed size and falls back to default values', () => { - var MyType = Record({a:1, b:2, c:3}); + it('setting an unknown key is a no-op', () => { + const MyType = Record({ a: 1, b: 2, c: 3 }); - var t1 = new MyType({a: 10, b:20}); - var t2 = new MyType({b: 20}); - var t3 = t1.remove('a'); - var t4 = t3.clear(); + const t1 = MyType({ a: 10, b: 20 }); + // @ts-expect-error -- try to force an unknown value + const t2 = t1.set('d', 4); - expect(t1.size).toBe(3); - expect(t2.size).toBe(3); - expect(t3.size).toBe(3); - expect(t4.size).toBe(3); + expect(t2).toBe(t1); + }); + + it('falls back to default values when deleted or cleared', () => { + const MyType = Record({ a: 1, b: 2, c: 3 }); + const t1 = MyType({ a: 10, b: 20 }); + const t2 = MyType({ b: 20 }); + const t3 = t1.delete('a'); + const t4 = t3.clear(); expect(t1.get('a')).toBe(10); expect(t2.get('a')).toBe(1); @@ -67,51 +62,258 @@ describe('Record', () => { expect(t2.equals(t3)).toBe(true); expect(t2.equals(t4)).toBe(false); - expect(t4.equals(new MyType())).toBe(true); - }) + expect(t4.equals(MyType())).toBe(true); + }); + + it('allows deletion of values deep within a tree', () => { + const AType = Record({ a: 1 }); + const BType = Record({ b: AType({ a: 2 }) }); + const t1 = BType(); + const t2 = t1.deleteIn(['b', 'a']); + + expect(t1.get('b').get('a')).toBe(2); + expect(t2.get('b').get('a')).toBe(1); + }); + + it('is a value type and equals other similar Records', () => { + const MyType = Record({ a: 1, b: 2, c: 3 }); + const t1 = MyType({ a: 10 }); + const t2 = MyType({ a: 10, b: 2 }); + expect(t1.equals(t2)).toBe(true); + }); + + it('if compared against undefined or null should return false', () => { + const MyType = Record({ a: 1, b: 2 }); + const t1 = MyType(); + expect(t1.equals(undefined)).toBeFalsy(); + expect(t1.equals(null)).toBeFalsy(); + }); + + it('if compared against Map should return false', () => { + const MyType = Record({ a: 1, b: 2 }); + const t1 = MyType(); + expect(t1.equals(Map({ a: 1, b: 2 }))).toBeFalsy(); + }); + + it('merges in Objects and other Records', () => { + const Point2 = Record({ x: 0, y: 0 }); + const Point3 = Record({ x: 0, y: 0, z: 0 }); + + const p2 = Point2({ x: 20, y: 20 }); + const p3 = Point3({ x: 10, y: 10, z: 10 }); + + expect(p3.merge(p2).toObject()).toEqual({ x: 20, y: 20, z: 10 }); + + expect(p2.merge({ y: 30 }).toObject()).toEqual({ x: 20, y: 30 }); + expect(p3.merge({ y: 30, z: 30 }).toObject()).toEqual({ + x: 10, + y: 30, + z: 30, + }); + }); it('converts sequences to records', () => { - var MyType = Record({a:1, b:2, c:3}); - var seq = Seq({a: 10, b:20}); - var t = new MyType(seq); - expect(t.toObject()).toEqual({a:10, b:20, c:3}) - }) + const MyType = Record({ a: 1, b: 2, c: 3 }); + const seq = Seq({ a: 10, b: 20 }); + const t = MyType(seq); + expect(t.toObject()).toEqual({ a: 10, b: 20, c: 3 }); + }); it('allows for functional construction', () => { - var MyType = Record({a:1, b:2, c:3}); - var seq = Seq({a: 10, b:20}); - var t = MyType(seq); - expect(t.toObject()).toEqual({a:10, b:20, c:3}) - }) + const MyType = Record({ a: 1, b: 2, c: 3 }); + const seq = Seq({ a: 10, b: 20 }); + const t = MyType(seq); + expect(t.toObject()).toEqual({ a: 10, b: 20, c: 3 }); + }); it('skips unknown keys', () => { - var MyType = Record({a:1, b:2}); - var seq = Seq({b:20, c:30}); - var t = new MyType(seq); + const MyType = Record({ a: 1, b: 2 }); + const seq = Seq({ b: 20, c: 30 }); + const t = MyType(seq); expect(t.get('a')).toEqual(1); expect(t.get('b')).toEqual(20); + // @ts-expect-error -- unknown key should not return anything expect(t.get('c')).toBeUndefined(); - }) + }); it('returns itself when setting identical values', () => { - var MyType = Record({a:1, b:2}); - var t1 = new MyType; - var t2 = new MyType({a: 1}); - var t3 = t1.set('a', 1); - var t4 = t2.set('a', 1); + const MyType = Record({ a: 1, b: 2 }); + const t1 = MyType(); + const t2 = MyType({ a: 1 }); + const t3 = t1.set('a', 1); + const t4 = t2.set('a', 1); expect(t3).toBe(t1); expect(t4).toBe(t2); - }) - - it('returns new record when setting new values', () => { - var MyType = Record({a:1, b:2}); - var t1 = new MyType; - var t2 = new MyType({a: 1}); - var t3 = t1.set('a', 3); - var t4 = t2.set('a', 3); + }); + + it('returns record when setting values', () => { + const MyType = Record({ a: 1, b: 2 }); + const t1 = MyType(); + const t2 = MyType({ a: 1 }); + const t3 = t1.set('a', 3); + const t4 = t2.set('a', 3); expect(t3).not.toBe(t1); expect(t4).not.toBe(t2); - }) + }); + + it('allows for readonly property access', () => { + const MyType = Record({ a: 1, b: 'foo' }); + const t1 = MyType(); + const a: number = t1.a; + const b: string = t1.b; + expect(a).toEqual(1); + expect(b).toEqual('foo'); + // @ts-expect-error -- test that runtime does throw + expect(() => (t1.a = 2)).toThrow('Cannot set on an immutable record.'); + }); + + it('allows for class extension', () => { + class ABClass extends Record({ a: 1, b: 2 }) { + setA(aVal: number) { + return this.set('a', aVal); + } + + setB(bVal: number) { + return this.set('b', bVal); + } + } + + // Note: `new` is only used because of `class` + const t1 = new ABClass({ a: 1 }); + const t2 = t1.setA(3); + const t3 = t2.setB(10); + const a: number = t3.a; + expect(a).toEqual(3); + expect(t3.toObject()).toEqual({ a: 3, b: 10 }); + }); + + it('does not allow overwriting property names', () => { + const realWarn = console.warn; + + try { + const warnings: Array = []; + + console.warn = (w) => warnings.push(w); + + // size is a safe key to use + const MyType1 = Record({ size: 123 }); + const t1 = MyType1(); + expect(warnings.length).toBe(0); + expect(t1.size).toBe(123); + + // get() is not safe to use + const MyType2 = Record({ get: 0 }); + // eslint-disable-next-line @typescript-eslint/no-unused-vars + const t2 = MyType2(); + expect(warnings.length).toBe(1); + expect(warnings[0]).toBe( + 'Cannot define Record with property "get" since that property name is part of the Record API.' + ); + } finally { + console.warn = realWarn; + } + }); + + it('can be converted to a keyed sequence', () => { + const MyType = Record({ a: 0, b: 0 }); + const t1 = MyType({ a: 10, b: 20 }); + + const seq1 = t1.toSeq(); + expect(isKeyed(seq1)).toBe(true); + expect(seq1.toJS()).toEqual({ a: 10, b: 20 }); + + const seq2 = Seq(t1); + expect(isKeyed(seq2)).toBe(true); + expect(seq2.toJS()).toEqual({ a: 10, b: 20 }); + + const seq3 = Seq.Keyed(t1); + expect(isKeyed(seq3)).toBe(true); + expect(seq3.toJS()).toEqual({ a: 10, b: 20 }); + + const seq4 = Seq.Indexed(t1); + expect(isKeyed(seq4)).toBe(false); + expect(seq4.toJS()).toEqual([ + ['a', 10], + ['b', 20], + ]); + }); + + it('can be iterated over', () => { + const MyType = Record({ a: 0, b: 0 }); + const t1 = MyType({ a: 10, b: 20 }); + + const entries: Array<[string, number]> = []; + for (const entry of t1) { + entries.push(entry); + } + + expect(entries).toEqual([ + ['a', 10], + ['b', 20], + ]); + }); + + it('calling `equals` between two instance of factories with same properties and same value should return true', () => { + const factoryA = Record({ id: '' }); + const factoryB = Record({ id: '' }); + + expect(factoryA().equals(factoryA())).toBe(true); + expect(factoryA().equals(factoryB())).toBe(true); + }); + + /** + * @see https://github.com/immutable-js/immutable-js/issues/1565 + */ + it('check that reset does reset the record.', () => { + type UserType = { + name: string; + roles: List | Array; + }; + + const User = Record({ + name: 'default name', + roles: List(), + }); + + const user0 = new User({ + name: 'John', + roles: ['superuser', 'admin'], + }); + const user1 = user0.clear(); + + expect(user1.name).toBe('default name'); + expect(user1.roles).toEqual(List()); + + const user2 = user0.withMutations((mutable: Record) => { + mutable.clear(); + }); + + expect(user2.name).toBe('default name'); + expect(user2.roles).toEqual(List()); + }); + + it('does not accept a Record as constructor', () => { + const Foo = Record({ foo: 'bar' }); + const fooInstance = Foo(); + expect(() => { + Record(fooInstance); + }).toThrowErrorMatchingSnapshot(); + }); + + it('does not accept a non object as constructor', () => { + const defaultValues = null; + expect(() => { + // @ts-expect-error -- test that runtime does throw + Record(defaultValues); + }).toThrowErrorMatchingSnapshot(); + }); + + it('does not accept an immutable object that is not a Record as constructor', () => { + const defaultValues = Map({ foo: 'bar' }); + expect(() => { + Record(defaultValues); + }).toThrowErrorMatchingSnapshot(); + }); }); diff --git a/__tests__/RecordJS.js b/__tests__/RecordJS.js index c45e6b2b6d..3ae53fb878 100644 --- a/__tests__/RecordJS.js +++ b/__tests__/RecordJS.js @@ -1,28 +1,27 @@ -jest.autoMockOff(); - -var Immutable = require('immutable'); -var Record = Immutable.Record; +import { describe, expect, it } from '@jest/globals'; +import { Record } from 'immutable'; describe('Record', () => { + it('defines a record factory', () => { + const MyType = Record({ a: 1, b: 2, c: 3 }); - it('defines a constructor', () => { - var MyType = Record({a:1, b:2, c:3}); - - var t = new MyType(); - var t2 = t.set('a', 10); + const t = MyType(); + const t2 = t.set('a', 10); expect(t.a).toBe(1); expect(t2.a).toBe(10); }); it('can have mutations apply', () => { - var MyType = Record({a:1, b:2, c:3}); + const MyType = Record({ a: 1, b: 2, c: 3 }); - var t = new MyType(); + const t = MyType(); - expect(() => { t.a = 10; }).toThrow(); + expect(() => { + t.a = 10; + }).toThrow(); - var t2 = t.withMutations(mt => { + const t2 = t.withMutations((mt) => { mt.a = 10; mt.b = 20; mt.c = 30; @@ -33,32 +32,40 @@ describe('Record', () => { }); it('can be subclassed', () => { - - class Alphabet extends Record({a:1, b:2, c:3}) { + class Alphabet extends Record({ a: 1, b: 2, c: 3 }) { soup() { return this.a + this.b + this.c; } } - var t = new Alphabet(); - var t2 = t.set('b', 200); + // Note: `new` is only used because of `class` + const t = new Alphabet(); + const t2 = t.set('b', 200); - expect(t instanceof Record); - expect(t instanceof Alphabet); + expect(t instanceof Record).toBe(true); + expect(t instanceof Alphabet).toBe(true); expect(t.soup()).toBe(6); expect(t2.soup()).toBe(204); + + // Uses class name as descriptive name + expect(Record.getDescriptiveName(t)).toBe('Alphabet'); + + // Uses display name over class name + class NotADisplayName extends Record({ x: 1 }, 'DisplayName') {} + const t3 = new NotADisplayName(); + expect(Record.getDescriptiveName(t3)).toBe('DisplayName'); }); it('can be cleared', () => { - var MyType = Record({a:1, b:2, c:3}); - var t = new MyType({c:'cats'}); + const MyType = Record({ a: 1, b: 2, c: 3 }); + let t = MyType({ c: 'cats' }); expect(t.c).toBe('cats'); t = t.clear(); expect(t.c).toBe(3); - var MyType2 = Record({d:4, e:5, f:6}); - var t2 = new MyType2({d:'dogs'}); + const MyType2 = Record({ d: 4, e: 5, f: 6 }); + let t2 = MyType2({ d: 'dogs' }); expect(t2.d).toBe('dogs'); t2 = t2.clear(); diff --git a/__tests__/Repeat.ts b/__tests__/Repeat.ts index 74c6062158..1553232ba5 100644 --- a/__tests__/Repeat.ts +++ b/__tests__/Repeat.ts @@ -1,21 +1,19 @@ -/// -/// - -jest.autoMockOff(); - +import { describe, expect, it } from '@jest/globals'; import { Repeat } from 'immutable'; describe('Repeat', () => { - it('fixed repeat', () => { - var v = Repeat('wtf', 3); + const v = Repeat('wtf', 3); expect(v.size).toBe(3); expect(v.first()).toBe('wtf'); - expect(v.rest().toArray()).toEqual(['wtf','wtf']); + expect(v.rest().toArray()).toEqual(['wtf', 'wtf']); expect(v.last()).toBe('wtf'); - expect(v.butLast().toArray()).toEqual(['wtf','wtf']); - expect(v.toArray()).toEqual(['wtf','wtf','wtf']); + expect(v.butLast().toArray()).toEqual(['wtf', 'wtf']); + expect(v.toArray()).toEqual(['wtf', 'wtf', 'wtf']); expect(v.join()).toEqual('wtf,wtf,wtf'); }); + it('does not claim to be equal to undefined', () => { + expect(Repeat(1).equals(undefined)).toEqual(false); + }); }); diff --git a/__tests__/Seq.ts b/__tests__/Seq.ts index bdbb3a3487..cbb048eb8b 100644 --- a/__tests__/Seq.ts +++ b/__tests__/Seq.ts @@ -1,25 +1,40 @@ -/// -/// +import { describe, expect, it } from '@jest/globals'; +import { isCollection, isIndexed, isKeyed, Seq } from 'immutable'; -jest.autoMockOff(); +describe('Seq', () => { + it('returns undefined if empty and first is called without default argument', () => { + expect(Seq().first()).toBeUndefined(); + }); -import { Iterable, Seq } from 'immutable'; + it('returns undefined if empty and last is called without default argument', () => { + expect(Seq().last()).toBeUndefined(); + }); -describe('Seq', () => { + it('returns default value if empty and first is called with default argument', () => { + expect(Seq().first({})).toEqual({}); + }); + + it('returns default value if empty and last is called with default argument', () => { + expect(Seq().last({})).toEqual({}); + }); it('can be empty', () => { expect(Seq().size).toBe(0); }); it('accepts an array', () => { - expect(Seq([1,2,3]).size).toBe(3); + expect(Seq([1, 2, 3]).size).toBe(3); }); it('accepts an object', () => { - expect(Seq({a:1,b:2,c:3}).size).toBe(3); + expect(Seq({ a: 1, b: 2, c: 3 }).size).toBe(3); }); - it('accepts an iterable string', () => { + it('accepts an object with a next property', () => { + expect(Seq({ a: 1, b: 2, next: (_) => _ }).size).toBe(3); + }); + + it('accepts a collection string', () => { expect(Seq('foo').size).toBe(3); }); @@ -31,58 +46,97 @@ describe('Seq', () => { expect(Seq(new Foo()).size).toBe(2); }); - it('of accepts varargs', () => { - expect(Seq.of(1,2,3).size).toBe(3); - }); - it('accepts another sequence', () => { - var seq = Seq.of(1,2,3); + const seq = Seq([1, 2, 3]); expect(Seq(seq).size).toBe(3); }); it('accepts a string', () => { - var seq = Seq('abc'); + const seq = Seq('abc'); expect(seq.size).toBe(3); expect(seq.get(1)).toBe('b'); expect(seq.join('')).toBe('abc'); }); it('accepts an array-like', () => { - var alike = { length: 2, 0: 'a', 1: 'b' }; - var seq = Seq(alike); - expect(Iterable.isIndexed(seq)).toBe(true); + const seq = Seq({ length: 2, 0: 'a', 1: 'b' }); + expect(isIndexed(seq)).toBe(true); expect(seq.size).toBe(2); expect(seq.get(1)).toBe('b'); + + const map = Seq({ length: 1, foo: 'bar' }); + expect(isIndexed(map)).toBe(false); + expect(map.size).toBe(2); + expect(map.get('foo')).toBe('bar'); + + const empty = Seq({ length: 0 }); + expect(isIndexed(empty)).toBe(true); + expect(empty.size).toEqual(0); + }); + + it('accepts a JS (global) Map', () => { + const seq = Seq( + new global.Map([ + ['a', 'A'], + ['b', 'B'], + ['c', 'C'], + ]) + ); + expect(isKeyed(seq)).toBe(true); + expect(seq.size).toBe(3); + }); + + it('accepts a JS (global) Set', () => { + const seq = Seq(new global.Set(['a', 'b', 'c'])); + expect(isIndexed(seq)).toBe(false); + expect(isKeyed(seq)).toBe(false); + expect(seq.size).toBe(3); }); it('does not accept a scalar', () => { expect(() => { + // @ts-expect-error -- test that runtime does throw Seq(3); - }).toThrow('Expected Array or iterable object of values, or keyed object: 3'); + }).toThrow( + 'Expected Array or collection object of values, or keyed object: 3' + ); }); it('detects sequences', () => { - var seq = Seq.of(1,2,3); + const seq = Seq([1, 2, 3]); expect(Seq.isSeq(seq)).toBe(true); - expect(Iterable.isIterable(seq)).toBe(true); + expect(isCollection(seq)).toBe(true); }); it('Does not infinite loop when sliced with NaN', () => { - var list = Seq([1, 2, 3, 4, 5]); + const list = Seq([1, 2, 3, 4, 5]); expect(list.slice(0, NaN).toJS()).toEqual([]); expect(list.slice(NaN).toJS()).toEqual([1, 2, 3, 4, 5]); }); it('Does not infinite loop when spliced with negative number #559', () => { - var dog = Seq(['d', 'o', 'g']); - var dg = dog.filter(c => c !== 'o'); - var dig = (dg).splice(-1, 0, 'i'); + const dog = Seq(['d', 'o', 'g']); + const dg = dog.filter((c) => c !== 'o'); + const dig = dg.splice(-1, 0, 'i'); expect(dig.toJS()).toEqual(['d', 'i', 'g']); }); it('Does not infinite loop when an undefined number is passed to take', () => { - var list = Seq([1, 2, 3, 4, 5]); + const list = Seq([1, 2, 3, 4, 5]); expect(list.take(NaN).toJS()).toEqual([]); }); + it('Converts deeply toJS after converting to entries', () => { + const list = Seq([Seq([1, 2]), Seq({ a: 'z' })]); + expect(list.entrySeq().toJS()).toEqual([ + [0, [1, 2]], + [1, { a: 'z' }], + ]); + + const map = Seq({ x: Seq([1, 2]), y: Seq({ a: 'z' }) }); + expect(map.entrySeq().toJS()).toEqual([ + ['x', [1, 2]], + ['y', { a: 'z' }], + ]); + }); }); diff --git a/__tests__/Set.ts b/__tests__/Set.ts index 87622a6938..5e8f1fe5d7 100644 --- a/__tests__/Set.ts +++ b/__tests__/Set.ts @@ -1,29 +1,9 @@ -/// -/// -declare var Symbol: any; -jest.autoMockOff(); - -import { List, Map, OrderedSet, Seq, Set, is } from 'immutable'; - -declare function expect(val: any): ExpectWithIs; - -interface ExpectWithIs extends Expect { - is(expected: any): void; - not: ExpectWithIs; -} +import { describe, expect, it, jest } from '@jest/globals'; +import { fromJS, is, List, Map, OrderedSet, Seq, Set } from 'immutable'; describe('Set', () => { - - beforeEach(function () { - this.addMatchers({ - is: function(expected) { - return is(this.actual, expected); - } - }) - }) - it('accepts array of values', () => { - var s = Set([1,2,3]); + const s = Set([1, 2, 3]); expect(s.has(1)).toBe(true); expect(s.has(2)).toBe(true); expect(s.has(3)).toBe(true); @@ -31,16 +11,26 @@ describe('Set', () => { }); it('accepts array-like of values', () => { - var s = Set({ 'length': 3, '1': 2 }); - expect(s.size).toBe(2) + const s = Set({ length: 3, 2: 3 }); + expect(s.size).toBe(2); expect(s.has(undefined)).toBe(true); + expect(s.has(3)).toBe(true); + expect(s.has(2)).toBe(false); + }); + + it('accepts a JS (global) Set', () => { + const s = Set(new global.Set([1, 2, 3])); + expect(Set.isSet(s)).toBe(true); + expect(s.size).toBe(3); + expect(s.has(1)).toBe(true); expect(s.has(2)).toBe(true); - expect(s.has(1)).toBe(false); + expect(s.has(3)).toBe(true); + expect(s.has(4)).toBe(false); }); - it('accepts string, an array-like iterable', () => { - var s = Set('abc'); - expect(s.size).toBe(3) + it('accepts string, an array-like collection', () => { + const s = Set('abc'); + expect(s.size).toBe(3); expect(s.has('a')).toBe(true); expect(s.has('b')).toBe(true); expect(s.has('c')).toBe(true); @@ -48,8 +38,8 @@ describe('Set', () => { }); it('accepts sequence of values', () => { - var seq = Seq.of(1,2,3); - var s = Set(seq); + const seq = Seq([1, 2, 3]); + const s = Set(seq); expect(s.has(1)).toBe(true); expect(s.has(2)).toBe(true); expect(s.has(3)).toBe(true); @@ -57,19 +47,23 @@ describe('Set', () => { }); it('accepts a keyed Seq as a set of entries', () => { - var seq = Seq({a:null, b:null, c:null}).flip(); - var s = Set(seq); - expect(s.toArray()).toEqual([[null,'a'], [null,'b'], [null,'c']]); + const seq = Seq({ a: null, b: null, c: null }).flip(); + const s = Set(seq); + expect(s.toArray()).toEqual([ + [null, 'a'], + [null, 'b'], + [null, 'c'], + ]); // Explicitly getting the values sequence - var s2 = Set(seq.valueSeq()); - expect(s2.toArray()).toEqual(['a','b','c']); + const s2 = Set(seq.valueSeq()); + expect(s2.toArray()).toEqual(['a', 'b', 'c']); // toSet() does this for you. - var v3 = seq.toSet(); + const v3 = seq.toSet(); expect(v3.toArray()).toEqual(['a', 'b', 'c']); }); it('accepts object keys', () => { - var s = Set.fromKeys({a:null, b:null, c:null}); + const s = Set.fromKeys({ a: null, b: null, c: null }); expect(s.has('a')).toBe(true); expect(s.has('b')).toBe(true); expect(s.has('c')).toBe(true); @@ -77,8 +71,8 @@ describe('Set', () => { }); it('accepts sequence keys', () => { - var seq = Seq({a:null, b:null, c:null}); - var s = Set.fromKeys(seq); + const seq = Seq({ a: null, b: null, c: null }); + const s = Set.fromKeys(seq); expect(s.has('a')).toBe(true); expect(s.has('b')).toBe(true); expect(s.has('c')).toBe(true); @@ -86,7 +80,7 @@ describe('Set', () => { }); it('accepts explicit values', () => { - var s = Set.of(1,2,3); + const s = Set([1, 2, 3]); expect(s.has(1)).toBe(true); expect(s.has(2)).toBe(true); expect(s.has(3)).toBe(true); @@ -94,56 +88,102 @@ describe('Set', () => { }); it('converts back to JS array', () => { - var s = Set.of(1,2,3); - expect(s.toArray()).toEqual([1,2,3]); + const s = Set([1, 2, 3]); + expect(s.toArray()).toEqual([1, 2, 3]); }); it('converts back to JS object', () => { - var s = Set.of('a','b','c'); - expect(s.toObject()).toEqual({a:'a',b:'b',c:'c'}); + const s = Set.of('a', 'b', 'c'); + expect(s.toObject()).toEqual({ a: 'a', b: 'b', c: 'c' }); + }); + + it('maps no-ops return the same reference', () => { + const s = Set([1, 2, 3]); + const r = s.map((value) => value); + expect(r).toBe(s); + }); + + it('maps should produce new set if values changed', () => { + const s = Set([1, 2, 3]); + expect(s.has(4)).toBe(false); + expect(s.size).toBe(3); + + const m = s.map((v) => v + 1); + expect(m.has(1)).toBe(false); + expect(m.has(2)).toBe(true); + expect(m.has(3)).toBe(true); + expect(m.has(4)).toBe(true); + expect(m.size).toBe(3); + }); + + it('unions an unknown collection of Sets', () => { + const abc = Set(['a', 'b', 'c']); + const cat = Set(['c', 'a', 't']); + expect(Set.union([abc, cat]).toArray()).toEqual(['c', 'a', 't', 'b']); + expect(Set.union([abc])).toBe(abc); + expect(Set.union([])).toBe(Set()); + }); + + it('intersects an unknown collection of Sets', () => { + const abc = Set(['a', 'b', 'c']); + const cat = Set(['c', 'a', 't']); + expect(Set.intersect([abc, cat]).toArray()).toEqual(['c', 'a']); + expect(Set.intersect([abc])).toBe(abc); + expect(Set.intersect([])).toBe(Set()); + }); + + it('concatenates strings using union', () => { + const s = Set(['one', 'two']); + expect(s.union('three').toArray()).toEqual(['one', 'two', 'three']); }); it('iterates values', () => { - var s = Set.of(1,2,3); - var iterator = jest.genMockFunction(); + const s = Set([1, 2, 3]); + const iterator = jest.fn(); s.forEach(iterator); expect(iterator.mock.calls).toEqual([ [1, 1, s], [2, 2, s], - [3, 3, s] + [3, 3, s], ]); }); + it('has the same iterator function for keys and values', () => { + const s = Set([1, 2, 3]); + expect(s[Symbol.iterator]).toBe(s.keys); + expect(s[Symbol.iterator]).toBe(s.values); + }); + it('unions two sets', () => { - var s1 = Set.of('a', 'b', 'c'); - var s2 = Set.of('d', 'b', 'wow'); - var s3 = s1.union(s2); + const s1 = Set.of('a', 'b', 'c'); + const s2 = Set.of('d', 'b', 'wow'); + const s3 = s1.union(s2); expect(s3.toArray()).toEqual(['a', 'b', 'c', 'd', 'wow']); }); it('returns self when union results in no-op', () => { - var s1 = Set.of('a', 'b', 'c'); - var s2 = Set.of('c', 'a'); - var s3 = s1.union(s2); + const s1 = Set.of('a', 'b', 'c'); + const s2 = Set.of('c', 'a'); + const s3 = s1.union(s2); expect(s3).toBe(s1); }); it('returns arg when union results in no-op', () => { - var s1 = Set(); - var s2 = Set.of('a', 'b', 'c'); - var s3 = s1.union(s2); + const s1 = Set(); + const s2 = Set.of('a', 'b', 'c'); + const s3 = s1.union(s2); expect(s3).toBe(s2); }); - it('unions a set and an iterable and returns a set', () => { - var s1 = Set([1,2,3]); - var emptySet = Set(); - var l = List([1,2,3]); - var s2 = s1.union(l); - var s3 = emptySet.union(l); - var o = OrderedSet([1,2,3]); - var s4 = s1.union(o); - var s5 = emptySet.union(o); + it('unions a set and another collection and returns a set', () => { + const s1 = Set([1, 2, 3]); + const emptySet = Set(); + const l = List([1, 2, 3]); + const s2 = s1.union(l); + const s3 = emptySet.union(l); + const o = OrderedSet([1, 2, 3]); + const s4 = s1.union(o); + const s5 = emptySet.union(o); expect(Set.isSet(s2)).toBe(true); expect(Set.isSet(s3)).toBe(true); expect(Set.isSet(s4) && !OrderedSet.isOrderedSet(s4)).toBe(true); @@ -151,11 +191,11 @@ describe('Set', () => { }); it('is persistent to adds', () => { - var s1 = Set(); - var s2 = s1.add('a'); - var s3 = s2.add('b'); - var s4 = s3.add('c'); - var s5 = s4.add('b'); + const s1 = Set(); + const s2 = s1.add('a'); + const s3 = s2.add('b'); + const s4 = s3.add('c'); + const s5 = s4.add('b'); expect(s1.size).toBe(0); expect(s2.size).toBe(1); expect(s3.size).toBe(2); @@ -164,11 +204,11 @@ describe('Set', () => { }); it('is persistent to deletes', () => { - var s1 = Set(); - var s2 = s1.add('a'); - var s3 = s2.add('b'); - var s4 = s3.add('c'); - var s5 = s4.remove('b'); + const s1 = Set(); + const s2 = s1.add('a'); + const s3 = s2.add('b'); + const s4 = s3.add('c'); + const s5 = s4.remove('b'); expect(s1.size).toBe(0); expect(s2.size).toBe(1); expect(s3.size).toBe(2); @@ -179,90 +219,159 @@ describe('Set', () => { }); it('deletes down to empty set', () => { - var s = Set.of('A').remove('A'); + const s = Set.of('A').remove('A'); expect(s).toBe(Set()); }); it('unions multiple sets', () => { - var s = Set.of('A', 'B', 'C').union(Set.of('C', 'D', 'E'), Set.of('D', 'B', 'F')); - expect(s).is(Set.of('A','B','C','D','E','F')); + const s = Set.of('A', 'B', 'C').union( + Set.of('C', 'D', 'E'), + Set.of('D', 'B', 'F') + ); + expect(s).toEqual(Set.of('A', 'B', 'C', 'D', 'E', 'F')); }); it('intersects multiple sets', () => { - var s = Set.of('A', 'B', 'C').intersect(Set.of('B', 'C', 'D'), Set.of('A', 'C', 'E')); - expect(s).is(Set.of('C')); + const s = Set.of('A', 'B', 'C').intersect( + Set.of('B', 'C', 'D'), + Set.of('A', 'C', 'E') + ); + expect(s).toEqual(Set.of('C')); }); it('diffs multiple sets', () => { - var s = Set.of('A', 'B', 'C').subtract(Set.of('C', 'D', 'E'), Set.of('D', 'B', 'F')); - expect(s).is(Set.of('A')); + const s = Set.of('A', 'B', 'C').subtract( + Set.of('C', 'D', 'E'), + Set.of('D', 'B', 'F') + ); + expect(s).toEqual(Set.of('A')); }); it('expresses value equality with set sequences', () => { - var s1 = Set.of('A', 'B', 'C'); + const s1 = Set.of('A', 'B', 'C'); expect(s1.equals(null)).toBe(false); - var s2 = Set.of('C', 'B', 'A'); + const s2 = Set.of('C', 'B', 'A'); expect(s1 === s2).toBe(false); expect(is(s1, s2)).toBe(true); expect(s1.equals(s2)).toBe(true); // Map and Set are not the same (keyed vs unkeyed) - var v1 = Map({ A: 'A', C: 'C', B: 'B' }); + const v1 = Map({ A: 'A', C: 'C', B: 'B' }); expect(is(s1, v1)).toBe(false); }); it('can use union in a withMutation', () => { - var js = Set().withMutations(set => { - set.union([ 'a' ]); - set.add('b'); - }).toJS(); + const js = Set() + .withMutations((set) => { + set.union(['a']); + set.add('b'); + }) + .toJS(); expect(js).toEqual(['a', 'b']); }); it('can determine if an array is a subset', () => { - var s = Set.of('A', 'B', 'C'); + const s = Set.of('A', 'B', 'C'); expect(s.isSuperset(['B', 'C'])).toBe(true); expect(s.isSuperset(['B', 'C', 'D'])).toBe(false); }); describe('accepts Symbol as entry #579', () => { - if (typeof Symbol !== 'function') { - Symbol = function(key) { - return { key: key, __proto__: Symbol }; - }; - Symbol.toString = function() { - return 'Symbol(' + (this.key || '') + ')'; - } - } - it('operates on small number of symbols, preserving set uniqueness', () => { - var a = Symbol(); - var b = Symbol(); - var c = Symbol(); + const a = Symbol(); + + const b = Symbol(); + + const c = Symbol(); - var symbolSet = Set([ a, b, c, a, b, c, a, b, c, a, b, c ]); + const symbolSet = Set([a, b, c, a, b, c, a, b, c, a, b, c]); expect(symbolSet.size).toBe(3); expect(symbolSet.has(b)).toBe(true); expect(symbolSet.get(c)).toEqual(c); }); it('operates on a large number of symbols, maintaining obj uniqueness', () => { - var manySymbols = [ - Symbol('a'), Symbol('b'), Symbol('c'), - Symbol('a'), Symbol('b'), Symbol('c'), - Symbol('a'), Symbol('b'), Symbol('c'), - Symbol('a'), Symbol('b'), Symbol('c'), + const manySymbols = [ + Symbol('a'), + Symbol('b'), + Symbol('c'), + Symbol('a'), + Symbol('b'), + Symbol('c'), + Symbol('a'), + Symbol('b'), + Symbol('c'), + Symbol('a'), + Symbol('b'), + Symbol('c'), ]; - var symbolSet = Set(manySymbols); + const symbolSet = Set(manySymbols); expect(symbolSet.size).toBe(12); expect(symbolSet.has(manySymbols[10])).toBe(true); expect(symbolSet.get(manySymbols[10])).toEqual(manySymbols[10]); }); + }); + it('can use intersect after add or union in a withMutation', () => { + const set = Set(['a', 'd']).withMutations((s) => { + s.add('b'); + s.union(['c']); + s.intersect(['b', 'c', 'd']); + }); + expect(set.toArray()).toEqual(['c', 'd', 'b']); }); - // TODO: more tests + it('can count entries that satisfy a predicate', () => { + const set = Set([1, 2, 3, 4, 5]); + expect(set.size).toEqual(5); + expect(set.count()).toEqual(5); + expect(set.count((x) => x % 2 === 0)).toEqual(2); + expect(set.count(() => true)).toEqual(5); + }); + + describe('"size" should correctly reflect the number of elements in a Set', () => { + describe('deduplicating custom classes that invoke fromJS() as part of equality check', () => { + class Entity { + entityId: string; + + entityKey: string; + constructor(entityId: string, entityKey: string) { + this.entityId = entityId; + this.entityKey = entityKey; + } + + asImmutable() { + return fromJS({ + entityId: this.entityId, + entityKey: this.entityKey, + }); + } + + valueOf() { + return this.asImmutable().toString(); + } + } + it('with mutations', () => { + const testSet = Set().withMutations((mutableSet) => { + mutableSet.add(new Entity('hello', 'world')); + mutableSet.add(new Entity('testing', 'immutable')); + mutableSet.add(new Entity('hello', 'world')); + }); + expect(testSet.size).toEqual(2); + }); + it('without mutations', () => { + const testSet0 = Set(); + const testSet1 = testSet0.add(new Entity('hello', 'world')); + const testSet2 = testSet1.add(new Entity('testing', 'immutable')); + const testSet3 = testSet2.add(new Entity('hello', 'world')); + expect(testSet0.size).toEqual(0); + expect(testSet1.size).toEqual(1); + expect(testSet2.size).toEqual(2); + expect(testSet3.size).toEqual(2); + }); + }); + }); }); diff --git a/__tests__/Stack.ts b/__tests__/Stack.ts index 547e6dcaa7..f3fc3d9326 100644 --- a/__tests__/Stack.ts +++ b/__tests__/Stack.ts @@ -1,106 +1,99 @@ -/// -/// - -jest.autoMockOff(); - -import * as jasmineCheck from 'jasmine-check'; -jasmineCheck.install(); - +import { describe, expect, it } from '@jest/globals'; import { Seq, Stack } from 'immutable'; +import fc from 'fast-check'; function arrayOfSize(s) { - var a = new Array(s); - for (var ii = 0; ii < s; ii++) { + const a = new Array(s); + for (let ii = 0; ii < s; ii++) { a[ii] = ii; } return a; } describe('Stack', () => { - it('constructor provides initial values', () => { - var s = Stack.of('a', 'b', 'c'); + const s = Stack.of('a', 'b', 'c'); expect(s.get(0)).toBe('a'); expect(s.get(1)).toBe('b'); expect(s.get(2)).toBe('c'); }); it('toArray provides a JS array', () => { - var s = Stack.of('a', 'b', 'c'); + const s = Stack.of('a', 'b', 'c'); expect(s.toArray()).toEqual(['a', 'b', 'c']); }); it('accepts a JS array', () => { - var s = Stack(['a', 'b', 'c']); + const s = Stack(['a', 'b', 'c']); expect(s.toArray()).toEqual(['a', 'b', 'c']); }); it('accepts a Seq', () => { - var seq = Seq(['a', 'b', 'c']); - var s = Stack(seq); + const seq = Seq(['a', 'b', 'c']); + const s = Stack(seq); expect(s.toArray()).toEqual(['a', 'b', 'c']); }); it('accepts a keyed Seq', () => { - var seq = Seq({a:null, b:null, c:null}).flip(); - var s = Stack(seq); - expect(s.toArray()).toEqual([[null,'a'], [null,'b'], [null,'c']]); + const seq = Seq({ a: null, b: null, c: null }).flip(); + const s = Stack(seq); + expect(s.toArray()).toEqual([ + [null, 'a'], + [null, 'b'], + [null, 'c'], + ]); // Explicit values - var s2 = Stack(seq.valueSeq()); + const s2 = Stack(seq.valueSeq()); expect(s2.toArray()).toEqual(['a', 'b', 'c']); // toStack() does this for you. - var s3 = seq.toStack(); + const s3 = seq.toStack(); expect(s3.toArray()).toEqual(['a', 'b', 'c']); }); it('pushing creates a new instance', () => { - var s0 = Stack.of('a'); - var s1 = s0.push('A'); + const s0 = Stack.of('a'); + const s1 = s0.push('A'); expect(s0.get(0)).toBe('a'); expect(s1.get(0)).toBe('A'); }); it('get helpers make for easier to read code', () => { - var s = Stack.of('a', 'b', 'c'); + const s = Stack.of('a', 'b', 'c'); expect(s.first()).toBe('a'); expect(s.last()).toBe('c'); expect(s.peek()).toBe('a'); }); it('slice helpers make for easier to read code', () => { - var s = Stack.of('a', 'b', 'c'); + const s = Stack.of('a', 'b', 'c'); expect(s.rest().toArray()).toEqual(['b', 'c']); }); - it('iterable', () => { - var s = Stack.of('a', 'b', 'c'); + it('iterable in reverse order', () => { + const s = Stack.of('a', 'b', 'c'); expect(s.size).toBe(3); - var forEachResults = []; - s.forEach((val, i) => forEachResults.push([i, val])); + const forEachResults: Array<[number, string, string | undefined]> = []; + s.forEach((val, i) => forEachResults.push([i, val, s.get(i)])); expect(forEachResults).toEqual([ - [0,'a'], - [1,'b'], - [2,'c'], + [0, 'a', 'a'], + [1, 'b', 'b'], + [2, 'c', 'c'], ]); // map will cause reverse iterate - expect(s.map(val => val + val).toArray()).toEqual([ - 'aa', - 'bb', - 'cc', - ]); + expect(s.map((val) => val + val).toArray()).toEqual(['aa', 'bb', 'cc']); - var iteratorResults = []; - var iterator = s.entries(); - var step; + let iteratorResults: Array<[number, string]> = []; + let iterator = s.entries(); + let step: IteratorResult<[number, string]>; while (!(step = iterator.next()).done) { iteratorResults.push(step.value); } expect(iteratorResults).toEqual([ - [0,'a'], - [1,'b'], - [2,'c'], + [0, 'a'], + [1, 'b'], + [2, 'c'], ]); iteratorResults = []; @@ -109,79 +102,121 @@ describe('Stack', () => { iteratorResults.push(step.value); } expect(iteratorResults).toEqual([ - [0,'c'], - [1,'b'], - [2,'a'], + [0, 'c'], + [1, 'b'], + [2, 'a'], ]); }); + it('map is called in reverse order but with correct indices', () => { + const s = Stack(['a', 'b', 'c']); + const s2 = s.map((v, i, c) => v + i + c.get(i)); + expect(s2.toArray()).toEqual(['a0a', 'b1b', 'c2c']); + + const mappedSeq = s.toSeq().map((v, i, c) => v + i + c.get(i)); + const s3 = Stack(mappedSeq); + expect(s3.toArray()).toEqual(['a0a', 'b1b', 'c2c']); + }); + it('push inserts at lowest index', () => { - var s0 = Stack.of('a', 'b', 'c'); - var s1 = s0.push('d', 'e', 'f'); + const s0 = Stack.of('a', 'b', 'c'); + const s1 = s0.push('d', 'e', 'f'); expect(s0.size).toBe(3); expect(s1.size).toBe(6); expect(s1.toArray()).toEqual(['d', 'e', 'f', 'a', 'b', 'c']); }); it('pop removes the lowest index, decrementing size', () => { - var s = Stack.of('a', 'b', 'c').pop(); + const s = Stack.of('a', 'b', 'c').pop(); expect(s.peek()).toBe('b'); - expect(s.toArray()).toEqual([ 'b', 'c' ]); + expect(s.toArray()).toEqual(['b', 'c']); }); - check.it('shift removes the lowest index, just like array', {maxSize: 2000}, - [gen.posInt], len => { - var a = arrayOfSize(len); - var s = Stack(a); - - while (a.length) { + it('shift removes the lowest index, just like array', () => { + fc.assert( + fc.property(fc.nat(100), (len) => { + const a = arrayOfSize(len); + let s = Stack(a); + + while (a.length) { + expect(s.size).toBe(a.length); + expect(s.toArray()).toEqual(a); + s = s.shift(); + a.shift(); + } expect(s.size).toBe(a.length); expect(s.toArray()).toEqual(a); - s = s.shift(); - a.shift(); - } - expect(s.size).toBe(a.length); - expect(s.toArray()).toEqual(a); - } - ); - - check.it('unshift adds the next lowest index, just like array', {maxSize: 2000}, - [gen.posInt], len => { - var a = []; - var s = Stack(); + }) + ); + }); - for (var ii = 0; ii < len; ii++) { + it('unshift adds the next lowest index, just like array', () => { + fc.assert( + fc.property(fc.nat(100), (len) => { + const a: Array = []; + let s = Stack(); + + for (let ii = 0; ii < len; ii++) { + expect(s.size).toBe(a.length); + expect(s.toArray()).toEqual(a); + s = s.unshift(ii); + a.unshift(ii); + } expect(s.size).toBe(a.length); expect(s.toArray()).toEqual(a); - s = s.unshift(ii); - a.unshift(ii); - } - expect(s.size).toBe(a.length); - expect(s.toArray()).toEqual(a); - } - ); + }) + ); + }); - check.it('unshifts multiple values to the front', {maxSize: 2000}, - [gen.posInt, gen.posInt], (size1: Number, size2: Number) => { - var a1 = arrayOfSize(size1); - var a2 = arrayOfSize(size2); + it('unshifts multiple values to the front', () => { + fc.assert( + fc.property(fc.nat(100), fc.nat(100), (size1: number, size2: number) => { + const a1 = arrayOfSize(size1); + const a2 = arrayOfSize(size2); - var s1 = Stack(a1); - var s3 = s1.unshift.apply(s1, a2); + const s1 = Stack(a1); + const s3 = s1.unshift.apply(s1, a2); - var a3 = a1.slice(); - a3.unshift.apply(a3, a2); + const a3 = a1.slice(); + a3.unshift.apply(a3, a2); - expect(s3.size).toEqual(a3.length); - expect(s3.toArray()).toEqual(a3); - } - ); + expect(s3.size).toEqual(a3.length); + expect(s3.toArray()).toEqual(a3); + }) + ); + }); it('finds values using indexOf', () => { - var s = Stack.of('a', 'b', 'c', 'b', 'a'); + const s = Stack.of('a', 'b', 'c', 'b', 'a'); expect(s.indexOf('b')).toBe(1); expect(s.indexOf('c')).toBe(2); expect(s.indexOf('d')).toBe(-1); }); + it('pushes on all items in an iter', () => { + const abc = Stack(['a', 'b', 'c']); + const xyz = Stack(['x', 'y', 'z']); + const xyzSeq = Seq(['x', 'y', 'z']); + + // Push all to the front of the Stack so first item ends up first. + expect(abc.pushAll(xyz).toArray()).toEqual(['x', 'y', 'z', 'a', 'b', 'c']); + expect(abc.pushAll(xyzSeq).toArray()).toEqual([ + 'x', + 'y', + 'z', + 'a', + 'b', + 'c', + ]); + + // Pushes Seq contents into Stack + expect(Stack().pushAll(xyzSeq)).not.toBe(xyzSeq); + expect(Stack().pushAll(xyzSeq).toArray()).toEqual(['x', 'y', 'z']); + + // Pushing a Stack onto an empty Stack returns === Stack + expect(Stack().pushAll(xyz)).toBe(xyz); + + // Pushing an empty Stack onto a Stack return === Stack + expect(abc.pushAll(Stack())).toBe(abc); + }); }); diff --git a/__tests__/__snapshots__/Record.ts.snap b/__tests__/__snapshots__/Record.ts.snap new file mode 100644 index 0000000000..46daf60171 --- /dev/null +++ b/__tests__/__snapshots__/Record.ts.snap @@ -0,0 +1,7 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Record does not accept a Record as constructor 1`] = `"Can not call \`Record\` with an immutable Record as default values. Use a plain javascript object instead."`; + +exports[`Record does not accept a non object as constructor 1`] = `"Can not call \`Record\` with a non-object as default values. Use a plain javascript object instead."`; + +exports[`Record does not accept an immutable object that is not a Record as constructor 1`] = `"Can not call \`Record\` with an immutable Collection as default values. Use a plain javascript object instead."`; diff --git a/__tests__/concat.ts b/__tests__/concat.ts index b4a95a6c7c..35710a7c49 100644 --- a/__tests__/concat.ts +++ b/__tests__/concat.ts @@ -1,150 +1,222 @@ -/// -/// - -jest.autoMockOff(); - -import { Seq, Set, List, is } from 'immutable'; - -declare function expect(val: any): ExpectWithIs; - -interface ExpectWithIs extends Expect { - is(expected: any): void; - not: ExpectWithIs; -} +import { describe, expect, it } from '@jest/globals'; +import { List, Seq, Set } from 'immutable'; describe('concat', () => { - - beforeEach(function () { - this.addMatchers({ - is: function(expected) { - return is(this.actual, expected); - } - }) - }) - it('concats two sequences', () => { - var a = Seq.of(1,2,3); - var b = Seq.of(4,5,6); - expect(a.concat(b)).is(Seq.of(1,2,3,4,5,6)) + const a = Seq([1, 2, 3]); + const b = Seq([4, 5, 6]); expect(a.concat(b).size).toBe(6); - expect(a.concat(b).toArray()).toEqual([1,2,3,4,5,6]); - }) + expect(a.concat(b).toArray()).toEqual([1, 2, 3, 4, 5, 6]); + }); it('concats two object sequences', () => { - var a = Seq({a:1,b:2,c:3}); - var b = Seq({d:4,e:5,f:6}); + const a = Seq({ a: 1, b: 2, c: 3 }); + const b = Seq({ d: 4, e: 5, f: 6 }); expect(a.size).toBe(3); expect(a.concat(b).size).toBe(6); - expect(a.concat(b).toObject()).toEqual({a:1,b:2,c:3,d:4,e:5,f:6}); - }) + expect(a.concat(b).toObject()).toEqual({ + a: 1, + b: 2, + c: 3, + d: 4, + e: 5, + f: 6, + }); + }); it('concats objects to keyed seq', () => { - var a = Seq({a:1,b:2,c:3}); - var b = {d:4,e:5,f:6}; - expect(a.concat(b).toObject()).toEqual({a:1,b:2,c:3,d:4,e:5,f:6}); - }) + const a = Seq({ a: 1, b: 2, c: 3 }); + const b = { d: 4, e: 5, f: 6 }; + expect(a.concat(b).toObject()).toEqual({ + a: 1, + b: 2, + c: 3, + d: 4, + e: 5, + f: 6, + }); + }); it('doesnt concat raw arrays to keyed seq', () => { - var a = Seq({a:1,b:2,c:3}); - var b = [4,5,6]; + const a = Seq({ a: 1, b: 2, c: 3 }); + const b = [4, 5, 6]; expect(() => { + // @ts-expect-error -- test that runtime does throw a.concat(b).toJS(); }).toThrow('Expected [K, V] tuple: 4'); - }) + }); it('concats arrays to indexed seq', () => { - var a = Seq.of(1,2,3); - var b = [4,5,6]; + const a = Seq([1, 2, 3]); + const b = [4, 5, 6]; expect(a.concat(b).size).toBe(6); - expect(a.concat(b).toObject()).toEqual([1,2,3,4,5,6]); - }) + expect(a.concat(b).toArray()).toEqual([1, 2, 3, 4, 5, 6]); + }); it('concats values', () => { - var a = Seq.of(1,2,3); - expect(a.concat(4,5,6).size).toBe(6); - expect(a.concat(4,5,6).toObject()).toEqual([1,2,3,4,5,6]); - }) + const a = Seq([1, 2, 3]); + expect(a.concat(4, 5, 6).size).toBe(6); + expect(a.concat(4, 5, 6).toArray()).toEqual([1, 2, 3, 4, 5, 6]); + }); it('doesnt concat objects to indexed seq', () => { - var a = Seq.of(0,1,2,3); - var b = {4:4}; - var i = a.concat(b); + const a = Seq([0, 1, 2, 3]); + const b = { 4: 4 }; + const i = a.concat(b); expect(i.size).toBe(5); expect(i.get(4)).toBe(b); - expect(i.toArray()).toEqual([0,1,2,3,{4:4}]); - }) + expect(i.toArray()).toEqual([0, 1, 2, 3, { 4: 4 }]); + }); it('concats multiple arguments', () => { - var a = Seq.of(1,2,3); - var b = [4,5,6]; - var c = [7,8,9]; + const a = Seq([1, 2, 3]); + const b = [4, 5, 6]; + const c = [7, 8, 9]; expect(a.concat(b, c).size).toBe(9); - expect(a.concat(b, c).toObject()).toEqual([1,2,3,4,5,6,7,8,9]); - }) + expect(a.concat(b, c).toArray()).toEqual([1, 2, 3, 4, 5, 6, 7, 8, 9]); + }); it('can concat itself!', () => { - var a = Seq.of(1,2,3); + const a = Seq([1, 2, 3]); expect(a.concat(a, a).size).toBe(9); - expect(a.concat(a, a).toObject()).toEqual([1,2,3,1,2,3,1,2,3]); - }) + expect(a.concat(a, a).toArray()).toEqual([1, 2, 3, 1, 2, 3, 1, 2, 3]); + }); it('returns itself when concat does nothing', () => { - var a = Seq.of(1,2,3); - var b = Seq(); + const a = Seq([1, 2, 3]); + const b = Seq(); expect(a.concat()).toBe(a); expect(a.concat(b)).toBe(a); expect(b.concat(b)).toBe(b); - }) + }); it('returns non-empty item when concat does nothing', () => { - var a = Seq.of(1,2,3); - var b = Seq(); + const a = Seq([1, 2, 3]); + const b = Seq(); expect(a.concat(b)).toBe(a); expect(b.concat(a)).toBe(a); expect(b.concat(b, b, b, a, b, b)).toBe(a); - }) + }); it('always returns the same type', () => { - var a = Set.of(1,2,3); - var b = List(); + const a = Set([1, 2, 3]); + const b = List(); expect(b.concat(a)).not.toBe(a); expect(List.isList(b.concat(a))).toBe(true); - expect(b.concat(a)).is(List.of(1,2,3)); - }) + expect(b.concat(a)).toEqual(List([1, 2, 3])); + }); it('iterates repeated keys', () => { - var a = Seq({a:1,b:2,c:3}); - expect(a.concat(a, a).toObject()).toEqual({a:1,b:2,c:3}); - expect(a.concat(a, a).toArray()).toEqual([1,2,3,1,2,3,1,2,3]); - expect(a.concat(a, a).keySeq().toArray()).toEqual(['a','b','c','a','b','c','a','b','c']); - }) + const a = Seq({ a: 1, b: 2, c: 3 }); + expect(a.concat(a, a).toObject()).toEqual({ a: 1, b: 2, c: 3 }); + expect(a.concat(a, a).valueSeq().toArray()).toEqual([ + 1, 2, 3, 1, 2, 3, 1, 2, 3, + ]); + expect(a.concat(a, a).keySeq().toArray()).toEqual([ + 'a', + 'b', + 'c', + 'a', + 'b', + 'c', + 'a', + 'b', + 'c', + ]); + expect(a.concat(a, a).toArray()).toEqual([ + ['a', 1], + ['b', 2], + ['c', 3], + ['a', 1], + ['b', 2], + ['c', 3], + ['a', 1], + ['b', 2], + ['c', 3], + ]); + }); it('lazily reverses un-indexed sequences', () => { - var a = Seq({a:1,b:2,c:3}); - var b = Seq({d:4,e:5,f:6}); - expect(a.concat(b).reverse().keySeq().toArray()).toEqual(['f','e','d','c','b','a']); - }) + const a = Seq({ a: 1, b: 2, c: 3 }); + const b = Seq({ d: 4, e: 5, f: 6 }); + expect(a.concat(b).reverse().keySeq().toArray()).toEqual([ + 'f', + 'e', + 'd', + 'c', + 'b', + 'a', + ]); + }); it('lazily reverses indexed sequences', () => { - var a = Seq([1,2,3]); + const a = Seq([1, 2, 3]); expect(a.concat(a, a).reverse().size).toBe(9); - expect(a.concat(a, a).reverse().toArray()).toEqual([3,2,1,3,2,1,3,2,1]); - }) + expect(a.concat(a, a).reverse().toArray()).toEqual([ + 3, 2, 1, 3, 2, 1, 3, 2, 1, + ]); + }); it('lazily reverses indexed sequences with unknown size, maintaining indicies', () => { - var a = Seq([1,2,3]).filter(x=>true); + const a = Seq([1, 2, 3]).filter(() => true); + expect(a.size).toBe(undefined); // Note: lazy filter does not know what size in O(1). expect(a.concat(a, a).toKeyedSeq().reverse().size).toBe(undefined); - expect(a.concat(a, a).toKeyedSeq().reverse().entrySeq().toArray()).toEqual( - [[8,3],[7,2],[6,1],[5,3],[4,2],[3,1],[2,3],[1,2],[0,1]] - ); - }) + expect(a.concat(a, a).toKeyedSeq().reverse().toArray()).toEqual([ + [8, 3], + [7, 2], + [6, 1], + [5, 3], + [4, 2], + [3, 1], + [2, 3], + [1, 2], + [0, 1], + ]); + }); it('counts from the end of the indexed sequence on negative index', () => { - var i = List.of(9, 5, 3, 1).map(x => - x); + const i = List.of(9, 5, 3, 1).map((x) => -x); expect(i.get(0)).toBe(-9); expect(i.get(-1)).toBe(-1); expect(i.get(-4)).toBe(-9); expect(i.get(-5, 888)).toBe(888); - }) - -}) + }); + + it('should iterate on many concatenated sequences', () => { + let meta = Seq(); + + for (let i = 0; i < 10000; ++i) { + meta = meta.concat(i) as Seq; // TODO fix typing + } + + expect(meta.toList().size).toBe(10000); + }); + + it('should handle iterator on many concatenated sequences', () => { + const nbLoops = 10000; + let meta = Seq(); + for (let i = 1; i < nbLoops; i++) { + meta = meta.concat(i) as Seq; // TODO fix typing + } + const it = meta[Symbol.iterator](); + let done = false; + let i = 0; + while (!done) { + const result = it.next(); + i++; + done = !!result.done; + } + expect(i).toBe(nbLoops); + }); + + it('should iterate on reverse order on concatenated sequences', () => { + let meta = Seq([1]); + meta = meta.concat(42); + const it = meta.reverse()[Symbol.iterator](); + const result = it.next(); + expect(result).toEqual({ + done: false, + value: 42, + }); + }); +}); diff --git a/__tests__/count.ts b/__tests__/count.ts index 27055208e5..488e8d8b5d 100644 --- a/__tests__/count.ts +++ b/__tests__/count.ts @@ -1,90 +1,80 @@ -/// -/// - -jest.autoMockOff(); - -import { Seq, Range } from 'immutable'; +import { describe, expect, it } from '@jest/globals'; +import { Range, Seq } from 'immutable'; describe('count', () => { - it('counts sequences with known lengths', () => { - expect(Seq.of(1,2,3,4,5).size).toBe(5); - expect(Seq.of(1,2,3,4,5).count()).toBe(5); - }) + expect(Seq([1, 2, 3, 4, 5]).size).toBe(5); + expect(Seq([1, 2, 3, 4, 5]).count()).toBe(5); + }); it('counts sequences with unknown lengths, resulting in a cached size', () => { - var seq = Seq.of(1,2,3,4,5,6).filter(x => x % 2 === 0); + const seq = Seq([1, 2, 3, 4, 5, 6]).filter((x) => x % 2 === 0); expect(seq.size).toBe(undefined); expect(seq.count()).toBe(3); expect(seq.size).toBe(3); - }) + }); it('counts sequences with a specific predicate', () => { - var seq = Seq.of(1,2,3,4,5,6); + const seq = Seq([1, 2, 3, 4, 5, 6]); expect(seq.size).toBe(6); - expect(seq.count(x => x > 3)).toBe(3); - }) + expect(seq.count((x) => x > 3)).toBe(3); + }); describe('countBy', () => { - it('counts by keyed sequence', () => { - var grouped = Seq({a:1,b:2,c:3,d:4}).countBy(x => x % 2); - expect(grouped.toJS()).toEqual({1:2, 0:2}); + const grouped = Seq({ a: 1, b: 2, c: 3, d: 4 }).countBy((x) => x % 2); + expect(grouped.toJS()).toEqual({ 1: 2, 0: 2 }); expect(grouped.get(1)).toEqual(2); - }) + }); it('counts by indexed sequence', () => { expect( - Seq.of(1,2,3,4,5,6).countBy(x => x % 2).toJS() - ).toEqual( - {1:3, 0:3} - ); - }) + Seq([1, 2, 3, 4, 5, 6]) + .countBy((x) => x % 2) + .toJS() + ).toEqual({ 1: 3, 0: 3 }); + }); it('counts by specific keys', () => { expect( - Seq.of(1,2,3,4,5,6).countBy(x => x % 2 ? 'odd' : 'even').toJS() - ).toEqual( - {odd:3, even:3} - ); - }) - - }) + Seq([1, 2, 3, 4, 5, 6]) + .countBy((x) => (x % 2 ? 'odd' : 'even')) + .toJS() + ).toEqual({ odd: 3, even: 3 }); + }); + }); describe('isEmpty', () => { - it('is O(1) on sequences with known lengths', () => { - expect(Seq.of(1,2,3,4,5).size).toBe(5); - expect(Seq.of(1,2,3,4,5).isEmpty()).toBe(false); + expect(Seq([1, 2, 3, 4, 5]).size).toBe(5); + expect(Seq([1, 2, 3, 4, 5]).isEmpty()).toBe(false); expect(Seq().size).toBe(0); expect(Seq().isEmpty()).toBe(true); - }) + }); it('lazily evaluates Seq with unknown length', () => { - var seq = Seq.of(1,2,3,4,5,6).filter(x => x % 2 === 0); + let seq = Seq([1, 2, 3, 4, 5, 6]).filter((x) => x % 2 === 0); expect(seq.size).toBe(undefined); expect(seq.isEmpty()).toBe(false); expect(seq.size).toBe(undefined); - var seq = Seq.of(1,2,3,4,5,6).filter(x => x > 10); + seq = Seq([1, 2, 3, 4, 5, 6]).filter((x) => x > 10); expect(seq.size).toBe(undefined); expect(seq.isEmpty()).toBe(true); expect(seq.size).toBe(undefined); - }) + }); it('with infinitely long sequences of known length', () => { - var seq = Range(); + const seq = Range(0, Infinity); expect(seq.size).toBe(Infinity); expect(seq.isEmpty()).toBe(false); - }) + }); it('with infinitely long sequences of unknown length', () => { - var seq = Range().filter(x => x % 2 === 0); + const seq = Range(0, Infinity).filter((x) => x % 2 === 0); expect(seq.size).toBe(undefined); expect(seq.isEmpty()).toBe(false); expect(seq.size).toBe(undefined); - }) - - }) - -}) + }); + }); +}); diff --git a/__tests__/find.ts b/__tests__/find.ts index d879b15298..2f6f186690 100644 --- a/__tests__/find.ts +++ b/__tests__/find.ts @@ -1,31 +1,25 @@ -/// -/// - -jest.autoMockOff(); - -import * as jasmineCheck from 'jasmine-check'; -jasmineCheck.install(); - -import { List, Range, Seq } from 'immutable'; +import { describe, expect, it } from '@jest/globals'; +import { Seq } from 'immutable'; describe('find', () => { - it('find returns notSetValue when match is not found', () => { - expect(Seq.of(1,2,3,4,5,6).find(function () { - return false; - }, null, 9)).toEqual(9); - }) + expect(Seq([1, 2, 3, 4, 5, 6]).find(() => false, null, 9)).toEqual(9); + }); it('findEntry returns notSetValue when match is not found', () => { - expect(Seq.of(1,2,3,4,5,6).findEntry(function () { - return false; - }, null, 9)).toEqual(9); - }) + expect( + Seq([1, 2, 3, 4, 5, 6]).findEntry( + () => false, - it('findLastEntry returns notSetValue when match is not found', () => { - expect(Seq.of(1,2,3,4,5,6).findLastEntry(function () { - return false; - }, null, 9)).toEqual(9); - }) + null, + 9 + ) + ).toEqual(9); + }); -}) + it('findLastEntry returns notSetValue when match is not found', () => { + expect(Seq([1, 2, 3, 4, 5, 6]).findLastEntry(() => false, null, 9)).toEqual( + 9 + ); + }); +}); diff --git a/__tests__/flatten.ts b/__tests__/flatten.ts index 45e74155f5..0d5cea91e8 100644 --- a/__tests__/flatten.ts +++ b/__tests__/flatten.ts @@ -1,142 +1,143 @@ -/// -/// - -jest.autoMockOff(); - -import * as jasmineCheck from 'jasmine-check'; -jasmineCheck.install(); - -import { Iterable, Seq, Range, List, fromJS } from 'immutable'; - -type SeqType = number | number[] | Iterable; +import { describe, expect, it } from '@jest/globals'; +import { Collection, fromJS, List, Range, Seq } from 'immutable'; describe('flatten', () => { - it('flattens sequences one level deep', () => { - var nested = fromJS([[1,2],[3,4],[5,6]]); - var flat = nested.flatten(); - expect(flat.toJS()).toEqual([1,2,3,4,5,6]); - }) + const nested = fromJS([ + [1, 2], + [3, 4], + [5, 6], + ]); + const flat = nested.flatten(); + expect(flat.toJS()).toEqual([1, 2, 3, 4, 5, 6]); + }); it('flattening a List returns a List', () => { - var nested = fromJS([[1],2,3,[4,5,6]]); - var flat = nested.flatten(); - expect(flat.toString()).toEqual("List [ 1, 2, 3, 4, 5, 6 ]"); - }) + const nested = fromJS([[1], 2, 3, [4, 5, 6]]); + const flat = nested.flatten(); + expect(flat.toString()).toEqual('List [ 1, 2, 3, 4, 5, 6 ]'); + }); it('gives the correct iteration count', () => { - var nested = fromJS([[1,2,3],[4,5,6]]); - var flat = nested.flatten(); - expect(flat.forEach(x => x < 4)).toEqual(4); - }) + const nested = fromJS([ + [1, 2, 3], + [4, 5, 6], + ]); + const flat = nested.flatten(); + // @ts-expect-error -- `flatten` return type should be improved + expect(flat.forEach((x: number) => x < 4)).toEqual(4); + }); + + type SeqType = number | Array | Collection; it('flattens only Sequences (not sequenceables)', () => { - var nested = Seq.of(Range(1,3),[3,4],List.of(5,6,7),8); - var flat = nested.flatten(); - expect(flat.toJS()).toEqual([1,2,[3,4],5,6,7,8]); - }) + const nested = Seq([Range(1, 3), [3, 4], List([5, 6, 7]), 8]); + const flat = nested.flatten(); + expect(flat.toJS()).toEqual([1, 2, [3, 4], 5, 6, 7, 8]); + }); it('can be reversed', () => { - var nested = Seq.of(Range(1,3),[3,4],List.of(5,6,7),8); - var flat = nested.flatten(); - var reversed = flat.reverse(); - expect(reversed.toJS()).toEqual([8,7,6,5,[3,4],2,1]); - }) + const nested = Seq([Range(1, 3), [3, 4], List([5, 6, 7]), 8]); + const flat = nested.flatten(); + const reversed = flat.reverse(); + expect(reversed.toJS()).toEqual([8, 7, 6, 5, [3, 4], 2, 1]); + }); it('can flatten at various levels of depth', () => { - var deeplyNested = fromJS( + const deeplyNested = fromJS([ [ [ - [ - [ 'A', 'B' ], - [ 'A', 'B' ], - ], - [ - [ 'A', 'B' ], - [ 'A', 'B' ], - ], + ['A', 'B'], + ['A', 'B'], ], [ - [ - [ 'A', 'B' ], - [ 'A', 'B' ], - ], - [ - [ 'A', 'B' ], - [ 'A', 'B' ], - ] - ] - ] - ); - - // deeply flatten - expect(deeplyNested.flatten().toJS()).toEqual( - ['A','B','A','B','A','B','A','B','A','B','A','B','A','B','A','B'] - ); - - // shallow flatten - expect(deeplyNested.flatten(true).toJS()).toEqual( - [ - [ - [ 'A', 'B' ], - [ 'A', 'B' ], + ['A', 'B'], + ['A', 'B'], ], + ], + [ [ - [ 'A', 'B' ], - [ 'A', 'B' ], + ['A', 'B'], + ['A', 'B'], ], [ - [ 'A', 'B' ], - [ 'A', 'B' ], + ['A', 'B'], + ['A', 'B'], ], - [ - [ 'A', 'B' ], - [ 'A', 'B' ], - ] - ] - ); + ], + ]); - // flatten two levels - expect(deeplyNested.flatten(2).toJS()).toEqual( + // deeply flatten + expect(deeplyNested.flatten().toJS()).toEqual([ + 'A', + 'B', + 'A', + 'B', + 'A', + 'B', + 'A', + 'B', + 'A', + 'B', + 'A', + 'B', + 'A', + 'B', + 'A', + 'B', + ]); + + // shallow flatten + expect(deeplyNested.flatten(true).toJS()).toEqual([ + [ + ['A', 'B'], + ['A', 'B'], + ], + [ + ['A', 'B'], + ['A', 'B'], + ], + [ + ['A', 'B'], + ['A', 'B'], + ], [ - [ 'A', 'B' ], - [ 'A', 'B' ], - [ 'A', 'B' ], - [ 'A', 'B' ], - [ 'A', 'B' ], - [ 'A', 'B' ], - [ 'A', 'B' ], - [ 'A', 'B' ] - ] - ); + ['A', 'B'], + ['A', 'B'], + ], + ]); + + // flatten two levels + expect(deeplyNested.flatten(2).toJS()).toEqual([ + ['A', 'B'], + ['A', 'B'], + ['A', 'B'], + ['A', 'B'], + ['A', 'B'], + ['A', 'B'], + ['A', 'B'], + ['A', 'B'], + ]); }); describe('flatMap', () => { - it('first maps, then shallow flattens', () => { - var numbers = Range(97, 100); - var letters = numbers.flatMap(v => fromJS([ - String.fromCharCode(v), - String.fromCharCode(v).toUpperCase(), - ])); - expect(letters.toJS()).toEqual( - ['a','A','b','B','c','C'] - ) + const numbers = Range(97, 100); + const letters = numbers.flatMap((v) => + fromJS([String.fromCharCode(v), String.fromCharCode(v).toUpperCase()]) + ); + expect(letters.toJS()).toEqual(['a', 'A', 'b', 'B', 'c', 'C']); }); it('maps to sequenceables, not only Sequences.', () => { - var numbers = Range(97, 100); - // the map function returns an Array, rather than an Iterable. - // Array is sequenceable, so this works just fine. - var letters = numbers.flatMap(v => [ + const numbers = Range(97, 100); + // the map function returns an Array, rather than a Collection. + // Array is iterable, so this works just fine. + const letters = numbers.flatMap((v) => [ String.fromCharCode(v), - String.fromCharCode(v).toUpperCase() + String.fromCharCode(v).toUpperCase(), ]); - expect(letters.toJS()).toEqual( - ['a','A','b','B','c','C'] - ) + expect(letters.toJS()).toEqual(['a', 'A', 'b', 'B', 'c', 'C']); }); - }); - }); diff --git a/__tests__/fromJS.ts b/__tests__/fromJS.ts new file mode 100644 index 0000000000..90f70228e2 --- /dev/null +++ b/__tests__/fromJS.ts @@ -0,0 +1,81 @@ +import { describe, expect, it } from '@jest/globals'; +import { runInNewContext } from 'vm'; +import { List, Map, Set, isCollection, fromJS } from 'immutable'; + +describe('fromJS', () => { + it('convert Array to Immutable.List', () => { + const list = fromJS([1, 2, 3]); + expect(List.isList(list)).toBe(true); + expect(list.count()).toBe(3); + }); + + it('convert plain Object to Immutable.Map', () => { + const map = fromJS({ a: 'A', b: 'B', c: 'C' }); + expect(Map.isMap(map)).toBe(true); + expect(map.count()).toBe(3); + }); + + it('convert JS (global) Set to Immutable.Set', () => { + const set = fromJS(new global.Set([1, 2, 3])); + expect(Set.isSet(set)).toBe(true); + expect(set.count()).toBe(3); + }); + + it('convert JS (global) Map to Immutable.Map', () => { + const map = fromJS( + new global.Map([ + ['a', 'A'], + ['b', 'B'], + ['c', 'C'], + ]) + ); + expect(Map.isMap(map)).toBe(true); + expect(map.count()).toBe(3); + }); + + it('convert iterable to Immutable collection', () => { + function* values() { + yield 1; + yield 2; + yield 3; + } + const result = fromJS(values()); + expect(List.isList(result)).toBe(true); + expect(result.count()).toBe(3); + }); + + it('does not convert existing Immutable collections', () => { + const orderedSet = Set(['a', 'b', 'c']); + expect(fromJS(orderedSet)).toBe(orderedSet); + }); + + it('does not convert strings', () => { + expect(fromJS('abc')).toBe('abc'); + }); + + it('does not convert non-plain Objects', () => { + class Test {} + const result = fromJS(new Test()); + expect(isCollection(result)).toBe(false); + expect(result instanceof Test).toBe(true); + }); + + it('is iterable outside of a vm', () => { + expect(isCollection(fromJS({}))).toBe(true); + }); + + // eslint-disable-next-line jest/expect-expect + it('is iterable inside of a vm', () => { + runInNewContext( + ` + expect(isCollection(fromJS({}))).toBe(true); + `, + { + expect, + isCollection, + fromJS, + }, + {} + ); + }); +}); diff --git a/__tests__/functional/get.ts b/__tests__/functional/get.ts new file mode 100644 index 0000000000..901724f1c3 --- /dev/null +++ b/__tests__/functional/get.ts @@ -0,0 +1,37 @@ +import { describe, expect, it } from '@jest/globals'; +import { get, Map, List, Range } from 'immutable'; + +describe('get', () => { + it('for immutable structure', () => { + expect(get(Range(0, 100), 20)).toBe(20); + expect(get(List(['dog', 'frog', 'cat']), 1)).toBe('frog'); + expect(get(List(['dog', 'frog', 'cat']), 20)).toBeUndefined(); + expect(get(List(['dog', 'frog', 'cat']), 20, 'ifNotSet')).toBe('ifNotSet'); + + expect(get(Map({ x: 123, y: 456 }), 'x')).toBe(123); + }); + + it('for Array', () => { + expect(get(['dog', 'frog', 'cat'], 1)).toBe('frog'); + expect(get(['dog', 'frog', 'cat'], 20)).toBeUndefined(); + expect(get(['dog', 'frog', 'cat'], 20, 'ifNotSet')).toBe('ifNotSet'); + }); + + it('for plain objects', () => { + expect(get({ x: 123, y: 456 }, 'x')).toBe(123); + expect(get({ x: 123, y: 456 }, 'z', 'ifNotSet')).toBe('ifNotSet'); + + expect( + get( + { + x: 'xx', + y: 'yy', + get: function (key: string) { + return `${this[key].toUpperCase()}`; + }, + }, + 'x' + ) + ).toBe('XX'); + }); +}); diff --git a/__tests__/functional/has.ts b/__tests__/functional/has.ts new file mode 100644 index 0000000000..3d4f550dec --- /dev/null +++ b/__tests__/functional/has.ts @@ -0,0 +1,21 @@ +import { describe, expect, it } from '@jest/globals'; +import { has, Map, List, Range } from 'immutable'; + +describe('has', () => { + it('for immutable structure', () => { + expect(has(Range(0, 100), 20)).toBe(true); + expect(has(List(['dog', 'frog', 'cat']), 1)).toBe(true); + expect(has(List(['dog', 'frog', 'cat']), 20)).toBe(false); + + expect(has(Map({ x: 123, y: 456 }), 'x')).toBe(true); + }); + it('for Array', () => { + expect(has(['dog', 'frog', 'cat'], 1)).toBe(true); + expect(has(['dog', 'frog', 'cat'], 20)).toBe(false); + }); + + it('for plain objects', () => { + expect(has({ x: 123, y: 456 }, 'x')).toBe(true); + expect(has({ x: 123, y: 456 }, 'z')).toBe(false); + }); +}); diff --git a/__tests__/functional/remove.ts b/__tests__/functional/remove.ts new file mode 100644 index 0000000000..10674c695b --- /dev/null +++ b/__tests__/functional/remove.ts @@ -0,0 +1,19 @@ +import { describe, expect, it } from '@jest/globals'; +import { remove, List, Map } from 'immutable'; + +describe('remove', () => { + it('for immutable structure', () => { + expect(remove(List(['dog', 'frog', 'cat']), 1)).toEqual( + List(['dog', 'cat']) + ); + expect(remove(Map({ x: 123, y: 456 }), 'x')).toEqual(Map({ y: 456 })); + }); + + it('for Array', () => { + expect(remove(['dog', 'frog', 'cat'], 1)).toEqual(['dog', 'cat']); + }); + + it('for plain objects', () => { + expect(remove({ x: 123, y: 456 }, 'x')).toEqual({ y: 456 }); + }); +}); diff --git a/__tests__/functional/set.ts b/__tests__/functional/set.ts new file mode 100644 index 0000000000..154009880a --- /dev/null +++ b/__tests__/functional/set.ts @@ -0,0 +1,42 @@ +import { describe, expect, it } from '@jest/globals'; +import { set } from 'immutable'; + +describe('set', () => { + it('for immutable structure', () => { + const originalArray = ['dog', 'frog', 'cat']; + expect(set(originalArray, 1, 'cow')).toEqual(['dog', 'cow', 'cat']); + expect(set(originalArray, 4, 'cow')).toEqual([ + 'dog', + 'frog', + 'cat', + undefined, + 'cow', + ]); + expect(originalArray).toEqual(['dog', 'frog', 'cat']); + + const originalObject = { x: 123, y: 456 }; + expect(set(originalObject, 'x', 789)).toEqual({ x: 789, y: 456 }); + expect(set(originalObject, 'z', 789)).toEqual({ x: 123, y: 456, z: 789 }); + expect(originalObject).toEqual({ x: 123, y: 456 }); + }); + + it('for Array', () => { + const originalArray = ['dog', 'frog', 'cat']; + expect(set(originalArray, 1, 'cow')).toEqual(['dog', 'cow', 'cat']); + expect(set(originalArray, 4, 'cow')).toEqual([ + 'dog', + 'frog', + 'cat', + undefined, + 'cow', + ]); + expect(originalArray).toEqual(['dog', 'frog', 'cat']); + }); + + it('for plain objects', () => { + const originalObject = { x: 123, y: 456 }; + expect(set(originalObject, 'x', 789)).toEqual({ x: 789, y: 456 }); + expect(set(originalObject, 'z', 789)).toEqual({ x: 123, y: 456, z: 789 }); + expect(originalObject).toEqual({ x: 123, y: 456 }); + }); +}); diff --git a/__tests__/functional/update.ts b/__tests__/functional/update.ts new file mode 100644 index 0000000000..0ed9042e85 --- /dev/null +++ b/__tests__/functional/update.ts @@ -0,0 +1,40 @@ +import { describe, expect, it } from '@jest/globals'; +import { update } from 'immutable'; + +describe('update', () => { + it('for immutable structure', () => { + const originalArray = ['dog', 'frog', 'cat']; + expect(update(originalArray, 1, (val) => val?.toUpperCase())).toEqual([ + 'dog', + 'FROG', + 'cat', + ]); + expect(originalArray).toEqual(['dog', 'frog', 'cat']); + + const originalObject = { x: 123, y: 456 }; + expect(update(originalObject, 'x', (val) => val * 6)).toEqual({ + x: 738, + y: 456, + }); + expect(originalObject).toEqual({ x: 123, y: 456 }); + }); + + it('for Array', () => { + const originalArray = ['dog', 'frog', 'cat']; + expect(update(originalArray, 1, (val) => val?.toUpperCase())).toEqual([ + 'dog', + 'FROG', + 'cat', + ]); + expect(originalArray).toEqual(['dog', 'frog', 'cat']); + }); + + it('for plain objects', () => { + const originalObject = { x: 123, y: 456 }; + expect(update(originalObject, 'x', (val) => val * 6)).toEqual({ + x: 738, + y: 456, + }); + expect(originalObject).toEqual({ x: 123, y: 456 }); + }); +}); diff --git a/__tests__/get.ts b/__tests__/get.ts index a718d141b6..7853ad30ca 100644 --- a/__tests__/get.ts +++ b/__tests__/get.ts @@ -1,55 +1,49 @@ -/// -/// - -jest.autoMockOff(); - +import { describe, expect, it } from '@jest/globals'; import { Range } from 'immutable'; describe('get', () => { - it('gets any index', () => { - var seq = Range(0, 100); + const seq = Range(0, 100); expect(seq.get(20)).toBe(20); }); it('gets first', () => { - var seq = Range(0, 100); + const seq = Range(0, 100); expect(seq.first()).toBe(0); }); it('gets last', () => { - var seq = Range(0, 100); + const seq = Range(0, 100); expect(seq.last()).toBe(99); }); it('gets any index after reversing', () => { - var seq = Range(0, 100).reverse(); + const seq = Range(0, 100).reverse(); expect(seq.get(20)).toBe(79); }); it('gets first after reversing', () => { - var seq = Range(0, 100).reverse(); + const seq = Range(0, 100).reverse(); expect(seq.first()).toBe(99); }); it('gets last after reversing', () => { - var seq = Range(0, 100).reverse(); + const seq = Range(0, 100).reverse(); expect(seq.last()).toBe(0); }); it('gets any index when size is unknown', () => { - var seq = Range(0, 100).filter(x => x % 2 === 1); + const seq = Range(0, 100).filter((x) => x % 2 === 1); expect(seq.get(20)).toBe(41); }); it('gets first when size is unknown', () => { - var seq = Range(0, 100).filter(x => x % 2 === 1); + const seq = Range(0, 100).filter((x) => x % 2 === 1); expect(seq.first()).toBe(1); }); it('gets last when size is unknown', () => { - var seq = Range(0, 100).filter(x => x % 2 === 1); + const seq = Range(0, 100).filter((x) => x % 2 === 1); expect(seq.last()).toBe(99); // Note: this is O(N) }); - }); diff --git a/__tests__/getIn.ts b/__tests__/getIn.ts new file mode 100644 index 0000000000..57074034c6 --- /dev/null +++ b/__tests__/getIn.ts @@ -0,0 +1,97 @@ +import { describe, expect, it } from '@jest/globals'; +import { fromJS, getIn, List, Map } from 'immutable'; + +describe('getIn', () => { + it('deep get', () => { + const m = fromJS({ a: { b: { c: 10 } } }); + expect(m.getIn(['a', 'b', 'c'])).toEqual(10); + expect(getIn(m, ['a', 'b', 'c'])).toEqual(10); + }); + + it('deep get with list as keyPath', () => { + const m = fromJS({ a: { b: { c: 10 } } }); + expect(m.getIn(fromJS(['a', 'b', 'c']))).toEqual(10); + expect(getIn(m, fromJS(['a', 'b', 'c']))).toEqual(10); + }); + + it('deep get throws without list or array-like', () => { + // @ts-expect-error -- test that runtime does throw + expect(() => Map().getIn(undefined)).toThrow( + 'Invalid keyPath: expected Ordered Collection or Array: undefined' + ); + // @ts-expect-error -- test that runtime does throw + expect(() => Map().getIn({ a: 1, b: 2 })).toThrow( + 'Invalid keyPath: expected Ordered Collection or Array: [object Object]' + ); + // TODO: should expect error + expect(() => Map().getIn('abc')).toThrow( + 'Invalid keyPath: expected Ordered Collection or Array: abc' + ); + // TODO: should expect error + expect(() => getIn(Map(), 'abc')).toThrow( + 'Invalid keyPath: expected Ordered Collection or Array: abc' + ); + }); + + it('deep get returns not found if path does not match', () => { + const m = fromJS({ a: { b: { c: 10 } } }); + expect(m.getIn(['a', 'b', 'z'])).toEqual(undefined); + expect(m.getIn(['a', 'b', 'z'], 123)).toEqual(123); + expect(m.getIn(['a', 'y', 'z'])).toEqual(undefined); + expect(m.getIn(['a', 'y', 'z'], 123)).toEqual(123); + expect(getIn(m, ['a', 'y', 'z'])).toEqual(undefined); + expect(getIn(m, ['a', 'y', 'z'], 123)).toEqual(123); + }); + + it('does not use notSetValue when path does exist but value is nullable', () => { + const m = fromJS({ a: { b: { c: null, d: undefined } } }); + expect(m.getIn(['a', 'b', 'c'])).toEqual(null); + expect(m.getIn(['a', 'b', 'd'])).toEqual(undefined); + expect(m.getIn(['a', 'b', 'c'], 123)).toEqual(null); + expect(m.getIn(['a', 'b', 'd'], 123)).toEqual(undefined); + expect(getIn(m, ['a', 'b', 'c'], 123)).toEqual(null); + expect(getIn(m, ['a', 'b', 'd'], 123)).toEqual(undefined); + }); + + it('deep get returns not found if path encounters non-data-structure', () => { + const m = fromJS({ a: { b: { c: null, d: undefined } } }); + expect(m.getIn(['a', 'b', 'c', 'x'])).toEqual(undefined); + expect(m.getIn(['a', 'b', 'c', 'x'], 123)).toEqual(123); + expect(m.getIn(['a', 'b', 'd', 'x'])).toEqual(undefined); + expect(m.getIn(['a', 'b', 'd', 'x'], 123)).toEqual(123); + expect(getIn(m, ['a', 'b', 'd', 'x'])).toEqual(undefined); + expect(getIn(m, ['a', 'b', 'd', 'x'], 123)).toEqual(123); + + expect(getIn('a', ['length'])).toEqual(undefined); + expect(getIn(new Date(), ['getDate'])).toEqual(undefined); + }); + + it('gets in nested plain Objects and Arrays', () => { + const m = List([{ key: ['item'] }]); + expect(m.getIn([0, 'key', 0])).toEqual('item'); + }); + + it('deep get returns not found if non-existing path in nested plain Object', () => { + const deep = Map({ + key: { regular: 'jsobj' }, + list: List([Map({ num: 10 })]), + }); + expect(deep.getIn(['key', 'foo', 'item'])).toBe(undefined); + expect(deep.getIn(['key', 'foo', 'item'], 'notSet')).toBe('notSet'); + expect(deep.getIn(['list', 0, 'num', 'badKey'])).toBe(undefined); + expect(deep.getIn(['list', 0, 'num', 'badKey'], 'notSet')).toBe('notSet'); + }); + + it('gets in plain Objects and Arrays', () => { + const m = [{ key: ['item'] }]; + expect(getIn(m, [0, 'key', 0])).toEqual('item'); + }); + + it('deep get returns not found if non-existing path in plain Object', () => { + const deep = { key: { regular: 'jsobj' }, list: [{ num: 10 }] }; + expect(getIn(deep, ['key', 'foo', 'item'])).toBe(undefined); + expect(getIn(deep, ['key', 'foo', 'item'], 'notSet')).toBe('notSet'); + expect(getIn(deep, ['list', 0, 'num', 'badKey'])).toBe(undefined); + expect(getIn(deep, ['list', 0, 'num', 'badKey'], 'notSet')).toBe('notSet'); + }); +}); diff --git a/__tests__/groupBy.ts b/__tests__/groupBy.ts index 3fb9f65243..bfaba132df 100644 --- a/__tests__/groupBy.ts +++ b/__tests__/groupBy.ts @@ -1,62 +1,107 @@ -/// -/// +import { describe, expect, it } from '@jest/globals'; +import { + Collection, + Map, + Seq, + isOrdered, + OrderedMap, + List, + OrderedSet, + Set, + Stack, +} from 'immutable'; -jest.autoMockOff(); +describe('groupBy', () => { + it.each` + constructor | constructorIsOrdered | isObject + ${Collection} | ${true} | ${false} + ${List} | ${true} | ${false} + ${Seq} | ${true} | ${false} + ${Set} | ${false} | ${false} + ${Stack} | ${true} | ${false} + ${OrderedSet} | ${true} | ${false} + ${Map} | ${false} | ${true} + ${OrderedMap} | ${true} | ${true} + `( + 'groupBy returns ordered or unordered of the base type is ordered or not: $constructor.name', + ({ constructor, constructorIsOrdered, isObject }) => { + const iterableConstructor = ['a', 'b', 'a', 'c']; + const objectConstructor = { a: 1, b: 2, c: 3, d: 1 }; -import { Iterable, Seq, Map } from 'immutable'; + const col = constructor( + isObject ? objectConstructor : iterableConstructor + ); -describe('groupBy', () => { + const grouped = col.groupBy((v) => v); + + // all groupBy should be instance of Map + expect(grouped).toBeInstanceOf(Map); + + // ordered objects should be instance of OrderedMap + expect(isOrdered(col)).toBe(constructorIsOrdered); + expect(isOrdered(grouped)).toBe(constructorIsOrdered); + if (constructorIsOrdered) { + // eslint-disable-next-line jest/no-conditional-expect + expect(grouped).toBeInstanceOf(OrderedMap); + } else { + // eslint-disable-next-line jest/no-conditional-expect + expect(grouped).not.toBeInstanceOf(OrderedMap); + } + } + ); it('groups keyed sequence', () => { - var grouped = Seq({a:1,b:2,c:3,d:4}).groupBy(x => x % 2); - expect(grouped.toJS()).toEqual({1:{a:1,c:3}, 0:{b:2,d:4}}); + const grouped = Seq({ a: 1, b: 2, c: 3, d: 4 }).groupBy((x) => x % 2); + expect(grouped.toJS()).toEqual({ 1: { a: 1, c: 3 }, 0: { b: 2, d: 4 } }); // Each group should be a keyed sequence, not an indexed sequence - expect(grouped.get(1).toArray()).toEqual([1, 3]); - }) + const firstGroup = grouped.get(1); + expect(firstGroup && firstGroup.toArray()).toEqual([ + ['a', 1], + ['c', 3], + ]); + }); it('groups indexed sequence', () => { - expect( - Seq.of(1,2,3,4,5,6).groupBy(x => x % 2).toJS() - ).toEqual( - {1:[1,3,5], 0:[2,4,6]} - ); - }) + const group = Seq([1, 2, 3, 4, 5, 6]).groupBy((x) => x % 2); + + expect(group.toJS()).toEqual({ 1: [1, 3, 5], 0: [2, 4, 6] }); + }); it('groups to keys', () => { - expect( - Seq.of(1,2,3,4,5,6).groupBy(x => x % 2 ? 'odd' : 'even').toJS() - ).toEqual( - {odd:[1,3,5], even:[2,4,6]} + const group = Seq([1, 2, 3, 4, 5, 6]).groupBy((x) => + x % 2 ? 'odd' : 'even' ); - }) + expect(group.toJS()).toEqual({ odd: [1, 3, 5], even: [2, 4, 6] }); + }); - it('groups indexed sequences, maintaining indicies', () => { - expect( - Seq.of(1,2,3,4,5,6).toKeyedSeq().groupBy(x => x % 2).toJS() - ).toEqual( - {1:[1,,3,,5,,,], 0:[,2,,4,,6]} + it('allows `undefined` as a key', () => { + const group = Seq([1, 2, 3, 4, 5, 6]).groupBy((x) => + x % 2 ? undefined : 'even' ); - }) + expect(group.toJS()).toEqual({ undefined: [1, 3, 5], even: [2, 4, 6] }); + }); - it('has groups that can be mapped', () => { - expect( - Seq.of(1,2,3,4,5,6).groupBy(x => x % 2).map(group => group.map(value => value * 10)).toJS() - ).toEqual( - {1:[10,30,50], 0:[20,40,60]} - ); - }) + it('groups indexed sequences, maintaining indicies when keyed sequences', () => { + const group = Seq([1, 2, 3, 4, 5, 6]).groupBy((x) => x % 2); + + expect(group.toJS()).toEqual({ 1: [1, 3, 5], 0: [2, 4, 6] }); - it('returns an ordered map from an ordered collection', () => { - var seq = Seq.of('Z','Y','X','Z','Y','X'); - expect(Iterable.isOrdered(seq)).toBe(true); - var seqGroups = seq.groupBy(x => x); - expect(Iterable.isOrdered(seqGroups)).toBe(true); + const keyedGroup = Seq([1, 2, 3, 4, 5, 6]) + .toKeyedSeq() + .groupBy((x) => x % 2); - var map = Map({ x: 1, y: 2 }); - expect(Iterable.isOrdered(map)).toBe(false); - var mapGroups = map.groupBy(x => x); - expect(Iterable.isOrdered(mapGroups)).toBe(false); - }) + expect(keyedGroup.toJS()).toEqual({ + 1: { 0: 1, 2: 3, 4: 5 }, + 0: { 1: 2, 3: 4, 5: 6 }, + }); + }); + + it('has groups that can be mapped', () => { + const mappedGroup = Seq([1, 2, 3, 4, 5, 6]) + .groupBy((x) => x % 2) + .map((group) => group.map((value) => value * 10)); -}) + expect(mappedGroup.toJS()).toEqual({ 1: [10, 30, 50], 0: [20, 40, 60] }); + }); +}); diff --git a/__tests__/hasIn.ts b/__tests__/hasIn.ts new file mode 100644 index 0000000000..da2baa0a89 --- /dev/null +++ b/__tests__/hasIn.ts @@ -0,0 +1,63 @@ +import { describe, expect, it } from '@jest/globals'; +import { fromJS, hasIn, List, Map } from 'immutable'; + +describe('hasIn', () => { + it('deep has', () => { + const m = fromJS({ a: { b: { c: 10, d: undefined } } }); + expect(m.hasIn(['a', 'b', 'c'])).toEqual(true); + expect(m.hasIn(['a', 'b', 'd'])).toEqual(true); + expect(m.hasIn(['a', 'b', 'z'])).toEqual(false); + expect(m.hasIn(['a', 'y', 'z'])).toEqual(false); + expect(hasIn(m, ['a', 'b', 'c'])).toEqual(true); + expect(hasIn(m, ['a', 'b', 'z'])).toEqual(false); + }); + + it('deep has with list as keyPath', () => { + const m = fromJS({ a: { b: { c: 10 } } }); + expect(m.hasIn(fromJS(['a', 'b', 'c']))).toEqual(true); + expect(m.hasIn(fromJS(['a', 'b', 'z']))).toEqual(false); + expect(m.hasIn(fromJS(['a', 'y', 'z']))).toEqual(false); + expect(hasIn(m, fromJS(['a', 'b', 'c']))).toEqual(true); + expect(hasIn(m, fromJS(['a', 'y', 'z']))).toEqual(false); + }); + + it('deep has throws without list or array-like', () => { + // @ts-expect-error -- test that runtime does throw + expect(() => Map().hasIn(undefined)).toThrow( + 'Invalid keyPath: expected Ordered Collection or Array: undefined' + ); + // @ts-expect-error -- test that runtime does throw + expect(() => Map().hasIn({ a: 1, b: 2 })).toThrow( + 'Invalid keyPath: expected Ordered Collection or Array: [object Object]' + ); + // TODO: should expect error + expect(() => Map().hasIn('abc')).toThrow( + 'Invalid keyPath: expected Ordered Collection or Array: abc' + ); + // TODO: should expect error + expect(() => hasIn(Map(), 'abc')).toThrow( + 'Invalid keyPath: expected Ordered Collection or Array: abc' + ); + }); + + it('deep has does not throw if non-readable path', () => { + const deep = Map({ + key: { regular: 'jsobj' }, + list: List([Map({ num: 10 })]), + }); + expect(deep.hasIn(['key', 'foo', 'item'])).toBe(false); + expect(deep.hasIn(['list', 0, 'num', 'badKey'])).toBe(false); + expect(hasIn(deep, ['key', 'foo', 'item'])).toBe(false); + expect(hasIn(deep, ['list', 0, 'num', 'badKey'])).toBe(false); + }); + + it('deep has in plain Object and Array', () => { + const m = { a: { b: { c: [10, undefined], d: undefined } } }; + expect(hasIn(m, ['a', 'b', 'c', 0])).toEqual(true); + expect(hasIn(m, ['a', 'b', 'c', 1])).toEqual(true); + expect(hasIn(m, ['a', 'b', 'c', 2])).toEqual(false); + expect(hasIn(m, ['a', 'b', 'd'])).toEqual(true); + expect(hasIn(m, ['a', 'b', 'z'])).toEqual(false); + expect(hasIn(m, ['a', 'b', 'z'])).toEqual(false); + }); +}); diff --git a/__tests__/hash.ts b/__tests__/hash.ts new file mode 100644 index 0000000000..168ded87f1 --- /dev/null +++ b/__tests__/hash.ts @@ -0,0 +1,56 @@ +import { describe, expect, it } from '@jest/globals'; +import { hash } from 'immutable'; +import fc from 'fast-check'; + +describe('hash', () => { + it('stable hash of well known values', () => { + expect(hash(true)).toBe(0x42108421); + expect(hash(false)).toBe(0x42108420); + expect(hash(0)).toBe(0); + expect(hash(null)).toBe(0x42108422); + expect(hash(undefined)).toBe(0x42108423); + expect(hash('a')).toBe(97); + expect(hash('immutable-js')).toBe(510203252); + expect(hash(123)).toBe(123); + }); + + it('generates different hashes for decimal values', () => { + expect(hash(123.456)).toBe(884763256); + expect(hash(123.4567)).toBe(887769707); + }); + + it('generates different hashes for different objects', () => { + const objA = {}; + const objB = {}; + expect(hash(objA)).toBe(hash(objA)); + expect(hash(objA)).not.toBe(hash(objB)); + }); + + it('generates different hashes for different symbols', () => { + const symA = Symbol(); + + const symB = Symbol(); + expect(hash(symA)).toBe(hash(symA)); + expect(hash(symA)).not.toBe(hash(symB)); + }); + + it('generates different hashes for different functions', () => { + const funA = () => {}; + const funB = () => {}; + expect(hash(funA)).toBe(hash(funA)); + expect(hash(funA)).not.toBe(hash(funB)); + }); + + const genValue = fc.oneof(fc.string(), fc.integer()); + + it('generates unsigned 31-bit integers', () => { + fc.assert( + fc.property(genValue, (value) => { + const hashVal = hash(value); + expect(Number.isInteger(hashVal)).toBe(true); + expect(hashVal).toBeGreaterThan(-(2 ** 31)); + expect(hashVal).toBeLessThan(2 ** 31); + }) + ); + }); +}); diff --git a/__tests__/interpose.ts b/__tests__/interpose.ts index 3560aee107..a3698628af 100644 --- a/__tests__/interpose.ts +++ b/__tests__/interpose.ts @@ -1,24 +1,17 @@ -/// -/// - -jest.autoMockOff(); - +import { describe, expect, it } from '@jest/globals'; import { Range } from 'immutable'; describe('interpose', () => { - it('separates with a value', () => { - var range = Range(10, 15); - var interposed = range.interpose(0); - expect(interposed.toArray()).toEqual( - [ 10, 0, 11, 0, 12, 0, 13, 0, 14 ] - ); - }) + const range = Range(10, 15); + const interposed = range.interpose(0); + expect(interposed.toArray()).toEqual([10, 0, 11, 0, 12, 0, 13, 0, 14]); + }); it('can be iterated', () => { - var range = Range(10, 15); - var interposed = range.interpose(0); - var values = interposed.values(); + const range = Range(10, 15); + const interposed = range.interpose(0); + const values = interposed.values(); expect(values.next()).toEqual({ value: 10, done: false }); expect(values.next()).toEqual({ value: 0, done: false }); expect(values.next()).toEqual({ value: 11, done: false }); @@ -29,6 +22,5 @@ describe('interpose', () => { expect(values.next()).toEqual({ value: 0, done: false }); expect(values.next()).toEqual({ value: 14, done: false }); expect(values.next()).toEqual({ value: undefined, done: true }); - }) - -}) + }); +}); diff --git a/__tests__/issues.ts b/__tests__/issues.ts new file mode 100644 index 0000000000..e283378cfc --- /dev/null +++ b/__tests__/issues.ts @@ -0,0 +1,185 @@ +import { describe, expect, it } from '@jest/globals'; +import { + fromJS, + List, + Map, + OrderedMap, + OrderedSet, + Record, + Seq, + Set, +} from 'immutable'; + +describe('Issue #1175', () => { + it('invalid hashCode() response should not infinitly recurse', () => { + class BadHash { + equals() { + return false; + } + + hashCode() { + return 2 ** 32; + } + } + + const set = Set([new BadHash()]); + expect(set.size).toEqual(1); + }); +}); + +describe('Issue #1188', () => { + it('Removing items from OrderedSet should return OrderedSet', () => { + const orderedSet = OrderedSet(['one', 'two', 'three']); + const emptyOrderedSet = orderedSet.subtract(['two', 'three', 'one']); + expect(OrderedSet.isOrderedSet(emptyOrderedSet)).toBe(true); + }); +}); + +describe('Issue #1220 : Seq.rest() throws an exception when invoked on a single item sequence', () => { + it('should be iterable', () => { + // Helper for this test + const ITERATOR_SYMBOL = + (typeof Symbol === 'function' && Symbol.iterator) || '@@iterator'; + + const r = Seq([1]).rest(); + const i = r[ITERATOR_SYMBOL](); + expect(i.next()).toEqual({ value: undefined, done: true }); + }); +}); + +describe('Issue #1245', () => { + it('should return empty collection after takeLast(0)', () => { + const size = List(['a', 'b', 'c']).takeLast(0).size; + expect(size).toEqual(0); + }); +}); + +describe('Issue #1262', () => { + it('Set.subtract should accept an array', () => { + const MyType = Record({ val: 1 }); + const set1 = Set([ + MyType({ val: 1 }), + MyType({ val: 2 }), + MyType({ val: 3 }), + ]); + const set2 = set1.subtract([MyType({ val: 2 })]); + const set3 = set1.subtract(List([MyType({ val: 2 })])); + expect(set2).toEqual(set3); + }); +}); + +describe('Issue #1287', () => { + it('should skip all items in OrderedMap when skipping Infinity', () => { + const size = OrderedMap([['a', 1]]).skip(Infinity).size; + expect(size).toEqual(0); + }); +}); + +describe('Issue #1247', () => { + it('Records should not be considered altered after creation', () => { + const R = Record({ a: 1 }); + const r = new R(); + expect(r.wasAltered()).toBe(false); + }); +}); + +describe('Issue #1252', () => { + it('should be toString-able even if it contains a value which is not', () => { + const prototypelessObj = Object.create(null); + const list = List([prototypelessObj]); + expect(list.toString()).toBe('List [ {} ]'); + }); +}); + +describe('Issue #1293', () => { + it('merge() should not deeply coerce values', () => { + type StateObject = { foo: string | { qux: string }; biz?: string }; + const State = Record({ foo: 'bar', biz: 'baz' }); + const deepObject = { qux: 'quux' }; + + const firstState = State({ foo: deepObject }); + const secondState = State().merge({ foo: deepObject }); + + expect(secondState).toEqual(firstState); + }); +}); + +describe('Issue #1643', () => { + [ + ['a string', 'test'], + ['a number', 5], + ['null', null], + ['undefined', undefined], + ['a boolean', true], + ['an object', {}], + ['an array', []], + ['a function', () => null], + ].forEach(([label, value]) => { + class MyClass { + valueOf() { + return value; + } + } + + it(`Collection#hashCode() should handle objects that return ${label} for valueOf`, () => { + const set = Set().add(new MyClass()); + expect(() => set.hashCode()).not.toThrow(); + }); + }); +}); + +describe('Issue #1785', () => { + it('merge() should not return undefined', () => { + const emptyRecord = Record({})(); + + expect(emptyRecord.merge({ id: 1 })).toBe(emptyRecord); + }); +}); + +describe('Issue #1475', () => { + it('complex case should return first value on mergeDeep when types are incompatible', () => { + const a = fromJS({ + ch: [ + { + code: 8, + }, + ], + }) as Map; + const b = fromJS({ + ch: { + code: 8, + }, + }); + expect(a.mergeDeep(b).equals(b)).toBe(true); + }); + + it('simple case should return first value on mergeDeep when types are incompatible', () => { + const a = fromJS({ + ch: [], + }) as Map; + const b = fromJS({ + ch: { code: 8 }, + }); + expect(a.merge(b).equals(b)).toBe(true); + }); +}); + +describe('Issue #1719', () => { + it('mergeDeep() should overwrite when types conflict', () => { + const objWithObj = fromJS({ + items: { + '1': { + id: '1', + }, + }, + }) as Map; + const objWithArray = fromJS({ + items: [ + { + id: '1', + }, + ], + }); + expect(objWithObj.mergeDeep(objWithArray).equals(objWithArray)).toBe(true); + }); +}); diff --git a/__tests__/join.ts b/__tests__/join.ts index 11720b1819..4d6d472835 100644 --- a/__tests__/join.ts +++ b/__tests__/join.ts @@ -1,35 +1,52 @@ -/// -/// - -jest.autoMockOff(); - -import jasmineCheck = require('jasmine-check'); -jasmineCheck.install(); - +import { describe, expect, it } from '@jest/globals'; import { Seq } from 'immutable'; +import fc from 'fast-check'; describe('join', () => { - it('string-joins sequences with commas by default', () => { - expect(Seq.of(1,2,3,4,5).join()).toBe('1,2,3,4,5'); - }) + expect(Seq([1, 2, 3, 4, 5]).join()).toBe('1,2,3,4,5'); + }); it('string-joins sequences with any string', () => { - expect(Seq.of(1,2,3,4,5).join('foo')).toBe('1foo2foo3foo4foo5'); - }) + expect(Seq([1, 2, 3, 4, 5]).join('foo')).toBe('1foo2foo3foo4foo5'); + }); it('string-joins sequences with empty string', () => { - expect(Seq.of(1,2,3,4,5).join('')).toBe('12345'); - }) + expect(Seq([1, 2, 3, 4, 5]).join('')).toBe('12345'); + }); it('joins sparse-sequences like Array.join', () => { - var a = [1,,2,,3,,4,,5,,,]; + const a = [ + 1, + undefined, + 2, + undefined, + 3, + undefined, + 4, + undefined, + 5, + undefined, + undefined, + ]; expect(Seq(a).join()).toBe(a.join()); - }) - - check.it('behaves the same as Array.join', - [gen.array(gen.primitive), gen.primitive], (array, joiner) => { - expect(Seq(array).join(joiner)).toBe(array.join(joiner)); - }) - -}) + }); + + const genPrimitive = fc.oneof( + fc.string(), + fc.integer(), + fc.boolean(), + fc.constant(null), + fc.constant(undefined), + fc.constant(NaN) + ); + + it('behaves the same as Array.join', () => { + fc.assert( + fc.property(fc.array(genPrimitive), genPrimitive, (array, joiner) => { + // @ts-expect-error unexpected values for typescript joiner, but valid at runtime despite the unexpected errors + expect(Seq(array).join(joiner)).toBe(array.join(joiner)); + }) + ); + }); +}); diff --git a/__tests__/merge.ts b/__tests__/merge.ts index a59b722eaa..14e934b4c0 100644 --- a/__tests__/merge.ts +++ b/__tests__/merge.ts @@ -1,145 +1,349 @@ -/// -/// - -jest.autoMockOff(); - -import { List, Map, fromJS, is } from 'immutable'; - -declare function expect(val: any): ExpectWithIs; - -interface ExpectWithIs extends Expect { - is(expected: any): void; - not: ExpectWithIs; -} +import { describe, expect, it } from '@jest/globals'; +import { + fromJS, + List, + Map, + merge, + mergeDeep, + mergeDeepWith, + Record, + Set, +} from 'immutable'; describe('merge', () => { - - beforeEach(function () { - this.addMatchers({ - is: function(expected) { - return is(this.actual, expected); - } - }) - }) - it('merges two maps', () => { - var m1 = Map({a:1,b:2,c:3}); - var m2 = Map({d:10,b:20,e:30}); - expect(m1.merge(m2)).is(Map({a:1,b:20,c:3,d:10,e:30})); - }) + const m1 = Map({ a: 1, b: 2, c: 3 }); + const m2 = Map({ d: 10, b: 20, e: 30 }); + expect(m1.merge(m2)).toEqual(Map({ a: 1, b: 20, c: 3, d: 10, e: 30 })); + }); it('can merge in an explicitly undefined value', () => { - var m1 = Map({a:1,b:2}); - var m2 = Map({a:undefined}); - expect(m1.merge(m2)).is(Map({a:undefined,b:2})); - }) + const m1 = Map({ a: 1, b: 2 }); + const m2 = Map({ a: undefined }); + expect(m1.merge(m2)).toEqual(Map({ a: undefined, b: 2 })); + }); it('merges two maps with a merge function', () => { - var m1 = Map({a:1,b:2,c:3}); - var m2 = Map({d:10,b:20,e:30}); - expect(m1.mergeWith((a, b) => a + b, m2)).is(Map({a:1,b:22,c:3,d:10,e:30})); - }) + const m1 = Map({ a: 1, b: 2, c: 3 }); + const m2 = Map({ d: 10, b: 20, e: 30 }); + expect(m1.mergeWith((a: number, b: number) => a + b, m2)).toEqual( + Map({ a: 1, b: 22, c: 3, d: 10, e: 30 }) + ); + }); + + it('throws typeError without merge function', () => { + const m1 = Map({ a: 1, b: 2, c: 3 }); + const m2 = Map({ d: 10, b: 20, e: 30 }); + // @ts-expect-error -- test that runtime does throw + expect(() => m1.mergeWith(1, m2)).toThrow(TypeError); + }); it('provides key as the third argument of merge function', () => { - var m1 = Map({id:'temp', b:2, c:3}); - var m2 = Map({id:10, b:20, e:30}); - var add = (a, b) => a + b + const m1 = Map({ id: 'temp', b: 2, c: 3 }); + const m2 = Map({ id: 10, b: 20, e: 30 }); + const add = (a: number, b: number) => a + b; expect( - m1.mergeWith((a, b, key) => key !== 'id' ? add(a, b) : b, m2) - ).is(Map({id:10,b:22,c:3,e:30})); - }) + // @ts-expect-error -- it's difficult to type `a` not as `string | number` + m1.mergeWith((a, b, key) => (key !== 'id' ? add(a, b) : b), m2) + ).toEqual(Map({ id: 10, b: 22, c: 3, e: 30 })); + }); it('deep merges two maps', () => { - var m1 = fromJS({a:{b:{c:1,d:2}}}); - var m2 = fromJS({a:{b:{c:10,e:20},f:30},g:40}); - expect(m1.mergeDeep(m2)).is(fromJS({a:{b:{c:10,d:2,e:20},f:30},g:40})); - }) - - it('deep merge uses is() for return-self optimization', () => { - var date1 = new Date(1234567890000); - var date2 = new Date(1234567890000); - var m = Map().setIn(['a', 'b', 'c'], date1); - var m2 = m.mergeDeep({a:{b:{c: date2 }}}); - expect(m2 === m).toBe(true); - }) + const m1 = fromJS({ a: { b: { c: 1, d: 2 } } }); + const m2 = fromJS({ a: { b: { c: 10, e: 20 }, f: 30 }, g: 40 }); + expect(m1.mergeDeep(m2)).toEqual( + fromJS({ a: { b: { c: 10, d: 2, e: 20 }, f: 30 }, g: 40 }) + ); + }); + + it('merge uses === for return-self optimization', () => { + const date1 = new Date(1234567890000); + // Value equal, but different reference. + const date2 = new Date(1234567890000); + const m = Map().set('a', date1); + expect(m.merge({ a: date2 })).not.toBe(m); + expect(m.merge({ a: date1 })).toBe(m); + }); + + it('deep merge uses === for return-self optimization', () => { + const date1 = new Date(1234567890000); + // Value equal, but different reference. + const date2 = new Date(1234567890000); + const m = Map().setIn(['a', 'b', 'c'], date1); + expect(m.mergeDeep({ a: { b: { c: date2 } } })).not.toBe(m); + expect(m.mergeDeep({ a: { b: { c: date1 } } })).toBe(m); + }); it('deep merges raw JS', () => { - var m1 = fromJS({a:{b:{c:1,d:2}}}); - var js = {a:{b:{c:10,e:20},f:30},g:40}; - expect(m1.mergeDeep(js)).is(fromJS({a:{b:{c:10,d:2,e:20},f:30},g:40})); - }) + const m1 = fromJS({ a: { b: { c: 1, d: 2 } } }); + const js = { a: { b: { c: 10, e: 20 }, f: 30 }, g: 40 }; + expect(m1.mergeDeep(js)).toEqual( + fromJS({ a: { b: { c: 10, d: 2, e: 20 }, f: 30 }, g: 40 }) + ); + }); it('deep merges raw JS with a merge function', () => { - var m1 = fromJS({a:{b:{c:1,d:2}}}); - var js = {a:{b:{c:10,e:20},f:30},g:40}; - expect( - m1.mergeDeepWith((a, b) => a + b, js) - ).is(fromJS( - {a:{b:{c:11,d:2,e:20},f:30},g:40} - )); - }) + const m1 = fromJS({ a: { b: { c: 1, d: 2 } } }); + const js = { a: { b: { c: 10, e: 20 }, f: 30 }, g: 40 }; + // @ts-expect-error type of `mergeDeepWith` is too lazy for now + expect(m1.mergeDeepWith((a: number, b: number) => a + b, js)).toEqual( + fromJS({ a: { b: { c: 11, d: 2, e: 20 }, f: 30 }, g: 40 }) + ); + }); + + it('deep merges raw JS into raw JS with a merge function', () => { + const js1 = { a: { b: { c: 1, d: 2 } } }; + const js2 = { a: { b: { c: 10, e: 20 }, f: 30 }, g: 40 }; + // @ts-expect-error type of `mergeDeepWith` is too lazy for now + expect(mergeDeepWith((a: number, b: number) => a + b, js1, js2)).toEqual({ + a: { b: { c: 11, d: 2, e: 20 }, f: 30 }, + g: 40, + }); + }); + + it('deep merges collections into raw JS with a merge function', () => { + const js = { a: { b: { c: 1, d: 2 } } }; + const m = fromJS({ a: { b: { c: 10, e: 20 }, f: 30 }, g: 40 }); + // @ts-expect-error type of `mergeDeepWith` is too lazy for now + expect(mergeDeepWith((a: number, b: number) => a + b, js, m)).toEqual({ + a: { b: { c: 11, d: 2, e: 20 }, f: 30 }, + g: 40, + }); + }); it('returns self when a deep merges is a no-op', () => { - var m1 = fromJS({a:{b:{c:1,d:2}}}); - expect( - m1.mergeDeep({a:{b:{c:1}}}) - ).toBe(m1); - }) + const m1 = fromJS({ a: { b: { c: 1, d: 2 } } }); + expect(m1.mergeDeep({ a: { b: { c: 1 } } })).toBe(m1); + }); it('returns arg when a deep merges is a no-op', () => { - var m1 = fromJS({a:{b:{c:1,d:2}}}); - expect( - Map().mergeDeep(m1) - ).toBe(m1); - }) + const m1 = fromJS({ a: { b: { c: 1, d: 2 } } }); + expect(Map().mergeDeep(m1)).toBe(m1); + }); + + it('returns self when a deep merges is a no-op on raw JS', () => { + const m1 = { a: { b: { c: 1, d: 2 } } }; + expect(mergeDeep(m1, { a: { b: { c: 1 } } })).toBe(m1); + }); it('can overwrite existing maps', () => { expect( - fromJS({ a: { x: 1, y: 1 }, b: { x: 2, y: 2 } }) - .merge({ a: null, b: { x: 10 } }) - .toJS() - ).toEqual( - { a: null, b: { x: 10 } } - ); + fromJS({ a: { x: 1, y: 1 }, b: { x: 2, y: 2 } }).merge({ + a: null, + b: Map({ x: 10 }), + }) + ).toEqual(fromJS({ a: null, b: { x: 10 } })); expect( - fromJS({ a: { x: 1, y: 1 }, b: { x: 2, y: 2 } }) - .mergeDeep({ a: null, b: { x: 10 } }) - .toJS() - ).toEqual( - { a: null, b: { x: 10, y: 2 } } - ); - }) + fromJS({ a: { x: 1, y: 1 }, b: { x: 2, y: 2 } }).mergeDeep({ + a: null, + b: { x: 10 }, + }) + ).toEqual(fromJS({ a: null, b: { x: 10, y: 2 } })); + }); it('can overwrite existing maps with objects', () => { - var m1 = fromJS({ a: { x: 1, y: 1 } }); // deep conversion. - var m2 = Map({ a: { z: 10 } }); // shallow conversion to Map. + const m1 = fromJS({ a: { x: 1, y: 1 } }); // deep conversion. + const m2 = Map({ a: { z: 10 } }); // shallow conversion to Map. - // raw object simply replaces map. - expect(m1.merge(m2).get('a')).toEqual({z: 10}) // raw object. - expect(m1.mergeDeep(m2).get('a')).toEqual({z: 10}) // raw object. - }) + // Raw object simply replaces map. + expect(m1.merge(m2).get('a')).toEqual({ z: 10 }); // raw object. + // However, mergeDeep will merge that value into the inner Map. + expect(m1.mergeDeep(m2).get('a')).toEqual(Map({ x: 1, y: 1, z: 10 })); + }); - it('merges map entries with Vector values', () => { - expect( - fromJS({a:[1]}).merge({b:[2]}) - ).is(fromJS( - {a:[1], b:[2]} - )); - expect( - fromJS({a:[1]}).mergeDeep({b:[2]}) - ).is(fromJS( - {a:[1], b:[2]} - )); - }) + it('merges map entries with List and Set values', () => { + const initial = Map({ + a: Map({ x: 10, y: 20 }), + b: List([1, 2, 3]), + c: Set([1, 2, 3]), + }); + const additions = Map({ + a: Map({ y: 50, z: 100 }), + b: List([4, 5, 6]), + c: Set([4, 5, 6]), + }); + expect(initial.mergeDeep(additions)).toEqual( + Map({ + a: Map({ x: 10, y: 50, z: 100 }), + b: List([1, 2, 3, 4, 5, 6]), + c: Set([1, 2, 3, 4, 5, 6]), + }) + ); + }); + + it('merges map entries with new values', () => { + const initial = Map({ a: List([1]) }); + + // Note: merge and mergeDeep do not deeply coerce values, they only merge + // with what's there prior. + expect(initial.merge({ b: [2] })).toEqual(Map({ a: List([1]), b: [2] })); + expect(initial.mergeDeep({ b: [2] })).toEqual( + fromJS(Map({ a: List([1]), b: [2] })) + ); + }); it('maintains JS values inside immutable collections', () => { - var m1 = fromJS({a:{b:[{imm:'map'}]}}); - var m2 = m1.mergeDeep( - Map({a: Map({b: List.of( {plain:'obj'} )})}) + const m1 = fromJS({ a: { b: { imm: 'map' } } }); + const m2 = m1.mergeDeep(Map({ a: Map({ b: { plain: 'obj' } }) })); + + expect(m1.getIn(['a', 'b'])).toEqual(Map([['imm', 'map']])); + // However mergeDeep will merge that value into the inner Map + expect(m2.getIn(['a', 'b'])).toEqual(Map({ imm: 'map', plain: 'obj' })); + }); + + it('merges plain Objects', () => { + expect(merge({ x: 1, y: 1 }, { y: 2, z: 2 }, Map({ z: 3, q: 3 }))).toEqual({ + x: 1, + y: 2, + z: 3, + q: 3, + }); + }); + + it('merges plain Arrays', () => { + expect(merge([1, 2], [3, 4], List([5, 6]))).toEqual([1, 2, 3, 4, 5, 6]); + }); + + it('merging plain Array returns self after no-op', () => { + const a = [1, 2, 3]; + expect(merge(a, [], [])).toBe(a); + }); + + it('merges records with a size property set to 0', () => { + const Sizable = Record({ size: 0 }); + expect(Sizable().merge({ size: 123 }).size).toBe(123); + }); + + it('mergeDeep merges partial conflicts', () => { + const a = fromJS({ + ch: [ + { + code: 8, + }, + ], + banana: 'good', + }) as Map; + const b = fromJS({ + ch: { + code: 8, + }, + apple: 'anti-doctor', + }); + expect( + a.mergeDeep(b).equals( + fromJS({ + ch: { + code: 8, + }, + apple: 'anti-doctor', + banana: 'good', + }) + ) + ).toBe(true); + }); + + const map = { type: 'Map', value: Map({ b: 5, c: 9 }) }; + const object = { type: 'object', value: { b: 7, d: 12 } }; + const RecordFactory = Record({ a: 1, b: 2 }); + const record = { type: 'Record', value: RecordFactory({ b: 3 }) }; + const list = { type: 'List', value: List(['5']) }; + const array = { type: 'array', value: ['9'] }; + const set = { type: 'Set', value: Set('3') }; + + const incompatibleTypes = [ + [map, list], + [map, array], + [map, set], + [object, list], + [object, array], + [object, set], + [record, list], + [record, array], + [record, set], + [list, set], + ]; + + for (const [ + { type: type1, value: value1 }, + { type: type2, value: value2 }, + ] of incompatibleTypes) { + it(`mergeDeep and Map#mergeDeep replaces ${type1} and ${type2} with each other`, () => { + const aObject = { a: value1 }; + const bObject = { a: value2 }; + expect(mergeDeep(aObject, bObject)).toEqual(bObject); + expect(mergeDeep(bObject, aObject)).toEqual(aObject); + + const aMap = Map({ a: value1 }); + const bMap = Map({ a: value2 }); + expect(aMap.mergeDeep(bMap).equals(bMap)).toBe(true); + expect(bMap.mergeDeep(aMap).equals(aMap)).toBe(true); + }); + } + + const compatibleTypesAndResult = [ + [map, object, Map({ b: 7, c: 9, d: 12 })], + [map, record, Map({ a: 1, b: 3, c: 9 })], + [object, map, { b: 5, c: 9, d: 12 }], + [object, record, { a: 1, b: 3, d: 12 }], + [record, map, RecordFactory({ b: 5 })], + [record, object, RecordFactory({ b: 7 })], + [list, array, List(['5', '9'])], + [array, list, ['9', '5']], + [map, { type: 'Map', value: Map({ b: 7 }) }, Map({ b: 7, c: 9 })], + [object, { type: 'object', value: { d: 3 } }, { b: 7, d: 3 }], + [ + record, + { type: 'Record', value: RecordFactory({ a: 3 }) }, + RecordFactory({ a: 3, b: 2 }), + ], + [list, { type: 'List', value: List(['12']) }, List(['5', '12'])], + [array, { type: 'array', value: ['3'] }, ['9', '3']], + [set, { type: 'Set', value: Set(['3', '5']) }, Set(['3', '5'])], + ] as const; + + for (const [ + { type: type1, value: value1 }, + { type: type2, value: value2 }, + result, + ] of compatibleTypesAndResult) { + it(`mergeDeep and Map#mergeDeep merges ${type1} and ${type2}`, () => { + const aObject = { a: value1 }; + const bObject = { a: value2 }; + expect(mergeDeep(aObject, bObject)).toEqual({ a: result }); + + const aMap = Map({ a: value1 }); + const bMap = Map({ a: value2 }); + expect(aMap.mergeDeep(bMap)).toEqual(Map({ a: result })); + }); + } + + it('Map#mergeDeep replaces nested List with Map and Map with List', () => { + const a = Map({ a: List([Map({ x: 1 })]) }); + const b = Map({ a: Map([[0, Map({ y: 2 })]]) }); + expect(a.mergeDeep(b).equals(b)).toBe(true); + expect(b.mergeDeep(a).equals(a)).toBe(true); + }); + + it('functional mergeDeep replaces nested array with Map', () => { + const a = { a: [{ x: 1 }] }; + const b = Map({ a: Map([[0, Map({ y: 2 })]]) }); + expect(mergeDeep(a, b)).toEqual({ a: Map([[0, Map({ y: 2 })]]) }); + }); + + it('works with an empty Record', () => { + class MyRecord extends Record({ a: 1 }) {} + + const myRecord = new MyRecord(); + expect(merge(myRecord, { a: 4 })).toEqual( + new MyRecord({ + a: 4, + }) ); - expect(m1.getIn(['a', 'b', 0])).is(Map([['imm', 'map']])); - expect(m2.getIn(['a', 'b', 0])).toEqual({plain: 'obj'}); - }) + class MyEmptyRecord extends Record({}) {} -}) + const myEmptyRecord = new MyEmptyRecord(); + // merging with an empty record should return the same empty record instance + expect(merge(myEmptyRecord, { a: 4 })).toBe(myEmptyRecord); + }); +}); diff --git a/__tests__/minmax.ts b/__tests__/minmax.ts index bc6a8d4282..9a4c7a3c59 100644 --- a/__tests__/minmax.ts +++ b/__tests__/minmax.ts @@ -1,127 +1,126 @@ -/// -/// +import { describe, expect, it } from '@jest/globals'; +import { is, Seq } from 'immutable'; +import fc from 'fast-check'; -jest.autoMockOff(); - -import * as jasmineCheck from 'jasmine-check'; -jasmineCheck.install(); - -import { Seq, is } from 'immutable'; - -var genHeterogeneousishArray = gen.oneOf([ - gen.array(gen.oneOf([gen.string, gen.undefined])), - gen.array(gen.oneOf([gen.int, gen.NaN])) -]); +const genHeterogeneousishArray = fc.oneof( + fc.sparseArray(fc.string()), + fc.array(fc.oneof(fc.integer(), fc.constant(NaN))) +); describe('max', () => { - it('returns max in a sequence', () => { - expect(Seq([1,9,2,8,3,7,4,6,5]).max()).toBe(9); + expect(Seq([1, 9, 2, 8, 3, 7, 4, 6, 5]).max()).toBe(9); }); it('accepts a comparator', () => { - expect(Seq([1,9,2,8,3,7,4,6,5]).max((a, b) => b - a)).toBe(1); + expect(Seq([1, 9, 2, 8, 3, 7, 4, 6, 5]).max((a, b) => b - a)).toBe(1); }); it('by a mapper', () => { - var family = Seq([ + const family = Seq([ { name: 'Oakley', age: 7 }, { name: 'Dakota', age: 7 }, { name: 'Casey', age: 34 }, { name: 'Avery', age: 34 }, - ]) - expect(family.maxBy(p => p.age).name).toBe('Casey'); + ]); + expect(family.maxBy((p) => p.age)).toBe(family.get(2)); }); it('by a mapper and a comparator', () => { - var family = Seq([ + const family = Seq([ { name: 'Oakley', age: 7 }, { name: 'Dakota', age: 7 }, { name: 'Casey', age: 34 }, { name: 'Avery', age: 34 }, - ]) - expect(family.maxBy(p => p.age, (a, b) => b - a).name).toBe('Oakley'); + ]); + expect( + family.maxBy( + (p) => p.age, + (a, b) => b - a + ) + ).toBe(family.get(0)); }); it('surfaces NaN, null, and undefined', () => { - expect( - is(NaN, Seq.of(1, 2, 3, 4, 5, NaN).max()) - ).toBe(true); - expect( - is(NaN, Seq.of(NaN, 1, 2, 3, 4, 5).max()) - ).toBe(true); - expect( - is(null, Seq.of('A', 'B', 'C', 'D', null).max()) - ).toBe(true); - expect( - is(null, Seq.of(null, 'A', 'B', 'C', 'D').max()) - ).toBe(true); + expect(is(NaN, Seq([1, 2, 3, 4, 5, NaN]).max())).toBe(true); + expect(is(NaN, Seq([NaN, 1, 2, 3, 4, 5]).max())).toBe(true); + expect(is(null, Seq(['A', 'B', 'C', 'D', null]).max())).toBe(true); + expect(is(null, Seq([null, 'A', 'B', 'C', 'D']).max())).toBe(true); }); it('null treated as 0 in default iterator', () => { - expect( - is(2, Seq.of(-1, -2, null, 1, 2).max()) - ).toBe(true); + expect(is(2, Seq([-1, -2, null, 1, 2]).max())).toBe(true); }); - check.it('is not dependent on order', [genHeterogeneousishArray], vals => { - expect( - is( - Seq(shuffle(vals.slice())).max(), - Seq(vals).max() - ) - ).toEqual(true); + it('is not dependent on order', () => { + fc.assert( + fc.property(genHeterogeneousishArray, (vals) => { + expect( + is( + Seq(shuffle(vals.slice())).max(), + Seq(vals).max() + ) + ).toEqual(true); + }) + ); }); - }); describe('min', () => { - it('returns min in a sequence', () => { - expect(Seq([1,9,2,8,3,7,4,6,5]).min()).toBe(1); + expect(Seq([1, 9, 2, 8, 3, 7, 4, 6, 5]).min()).toBe(1); }); it('accepts a comparator', () => { - expect(Seq([1,9,2,8,3,7,4,6,5]).min((a, b) => b - a)).toBe(9); + expect(Seq([1, 9, 2, 8, 3, 7, 4, 6, 5]).min((a, b) => b - a)).toBe(9); }); it('by a mapper', () => { - var family = Seq([ + const family = Seq([ { name: 'Oakley', age: 7 }, { name: 'Dakota', age: 7 }, { name: 'Casey', age: 34 }, { name: 'Avery', age: 34 }, - ]) - expect(family.minBy(p => p.age).name).toBe('Oakley'); + ]); + expect(family.minBy((p) => p.age)).toBe(family.get(0)); }); it('by a mapper and a comparator', () => { - var family = Seq([ + const family = Seq([ { name: 'Oakley', age: 7 }, { name: 'Dakota', age: 7 }, { name: 'Casey', age: 34 }, { name: 'Avery', age: 34 }, - ]) - expect(family.minBy(p => p.age, (a, b) => b - a).name).toBe('Casey'); - }); - - check.it('is not dependent on order', [genHeterogeneousishArray], vals => { + ]); expect( - is( - Seq(shuffle(vals.slice())).min(), - Seq(vals).min() + family.minBy( + (p) => p.age, + (a, b) => b - a ) - ).toEqual(true); + ).toBe(family.get(2)); }); + it('is not dependent on order', () => { + fc.assert( + fc.property(genHeterogeneousishArray, (vals) => { + expect( + is( + Seq(shuffle(vals.slice())).min(), + Seq(vals).min() + ) + ).toEqual(true); + }) + ); + }); }); -function shuffle(array) { - var m = array.length, t, i; +function shuffle>(array: A): A { + let m = array.length; + let t; + let i; // While there remain elements to shuffle… while (m) { - // Pick a remaining element… i = Math.floor(Math.random() * m--); diff --git a/__tests__/partition.ts b/__tests__/partition.ts new file mode 100644 index 0000000000..0a59b3d8ec --- /dev/null +++ b/__tests__/partition.ts @@ -0,0 +1,102 @@ +import { beforeEach, describe, expect, it, jest } from '@jest/globals'; +import { + isAssociative, + isIndexed, + isKeyed, + isList, + isMap, + isSeq, + isSet, + List, + Map as IMap, + Seq, + Set as ISet, +} from 'immutable'; + +describe('partition', () => { + let isOdd: jest.Mock<(x: number) => number>; + + beforeEach(() => { + isOdd = jest.fn((x) => x % 2); + }); + + it('partitions keyed sequence', () => { + const parts = Seq({ a: 1, b: 2, c: 3, d: 4 }).partition(isOdd); + expect(isKeyed(parts[0])).toBe(true); + expect(isSeq(parts[0])).toBe(true); + expect(parts.map((part) => part.toJS())).toEqual([ + { b: 2, d: 4 }, + { a: 1, c: 3 }, + ]); + expect(isOdd.mock.calls.length).toBe(4); + + // Each group should be a keyed sequence, not an indexed sequence + const trueGroup = parts[1]; + expect(trueGroup && trueGroup.toArray()).toEqual([ + ['a', 1], + ['c', 3], + ]); + }); + + it('partitions indexed sequence', () => { + const parts = Seq([1, 2, 3, 4, 5, 6]).partition(isOdd); + expect(isIndexed(parts[0])).toBe(true); + expect(isSeq(parts[0])).toBe(true); + expect(parts.map((part) => part.toJS())).toEqual([ + [2, 4, 6], + [1, 3, 5], + ]); + expect(isOdd.mock.calls.length).toBe(6); + }); + + it('partitions set sequence', () => { + const parts = Seq.Set([1, 2, 3, 4, 5, 6]).partition(isOdd); + expect(isAssociative(parts[0])).toBe(false); + expect(isSeq(parts[0])).toBe(true); + expect(parts.map((part) => part.toJS())).toEqual([ + [2, 4, 6], + [1, 3, 5], + ]); + expect(isOdd.mock.calls.length).toBe(6); + }); + + it('partitions keyed collection', () => { + const parts = IMap({ a: 1, b: 2, c: 3, d: 4 }).partition(isOdd); + expect(isMap(parts[0])).toBe(true); + expect(isSeq(parts[0])).toBe(false); + expect(parts.map((part) => part.toJS())).toEqual([ + { b: 2, d: 4 }, + { a: 1, c: 3 }, + ]); + expect(isOdd.mock.calls.length).toBe(4); + + // Each group should be a keyed collection, not an indexed collection + const trueGroup = parts[1]; + expect(trueGroup && trueGroup.toArray()).toEqual([ + ['a', 1], + ['c', 3], + ]); + }); + + it('partitions indexed collection', () => { + const parts = List([1, 2, 3, 4, 5, 6]).partition(isOdd); + expect(isList(parts[0])).toBe(true); + expect(isSeq(parts[0])).toBe(false); + expect(parts.map((part) => part.toJS())).toEqual([ + [2, 4, 6], + [1, 3, 5], + ]); + expect(isOdd.mock.calls.length).toBe(6); + }); + + it('partitions set collection', () => { + const parts = ISet([1, 2, 3, 4, 5, 6]).partition(isOdd); + expect(isSet(parts[0])).toBe(true); + expect(isSeq(parts[0])).toBe(false); + expect(parts.map((part) => part.toJS().sort())).toEqual([ + [2, 4, 6], + [1, 3, 5], + ]); + expect(isOdd.mock.calls.length).toBe(6); + }); +}); diff --git a/__tests__/slice.ts b/__tests__/slice.ts index 3d0eefd2d3..07b763ff58 100644 --- a/__tests__/slice.ts +++ b/__tests__/slice.ts @@ -1,177 +1,299 @@ -/// -/// - -jest.autoMockOff(); - -import * as jasmineCheck from 'jasmine-check'; -jasmineCheck.install(); - +import { describe, expect, it } from '@jest/globals'; import { List, Range, Seq } from 'immutable'; +import fc from 'fast-check'; describe('slice', () => { - it('slices a sequence', () => { - expect(Seq.of(1,2,3,4,5,6).slice(2).toArray()).toEqual([3,4,5,6]); - expect(Seq.of(1,2,3,4,5,6).slice(2, 4).toArray()).toEqual([3,4]); - expect(Seq.of(1,2,3,4,5,6).slice(-3, -1).toArray()).toEqual([4,5]); - expect(Seq.of(1,2,3,4,5,6).slice(-1).toArray()).toEqual([6]); - expect(Seq.of(1,2,3,4,5,6).slice(0, -1).toArray()).toEqual([1,2,3,4,5]); - }) + expect(Seq([1, 2, 3, 4, 5, 6]).slice(2).toArray()).toEqual([3, 4, 5, 6]); + expect(Seq([1, 2, 3, 4, 5, 6]).slice(2, 4).toArray()).toEqual([3, 4]); + expect(Seq([1, 2, 3, 4, 5, 6]).slice(-3, -1).toArray()).toEqual([4, 5]); + expect(Seq([1, 2, 3, 4, 5, 6]).slice(-1).toArray()).toEqual([6]); + expect(Seq([1, 2, 3, 4, 5, 6]).slice(0, -1).toArray()).toEqual([ + 1, 2, 3, 4, 5, + ]); + }); it('creates an immutable stable sequence', () => { - var seq = Seq.of(1,2,3,4,5,6); - var sliced = seq.slice(2, -2); + const seq = Seq([1, 2, 3, 4, 5, 6]); + const sliced = seq.slice(2, -2); expect(sliced.toArray()).toEqual([3, 4]); expect(sliced.toArray()).toEqual([3, 4]); expect(sliced.toArray()).toEqual([3, 4]); - }) + }); it('slices a sparse indexed sequence', () => { - expect(Seq([1,,2,,3,,4,,5,,6]).slice(1).toArray()).toEqual([,2,,3,,4,,5,,6]); - expect(Seq([1,,2,,3,,4,,5,,6]).slice(2).toArray()).toEqual([2,,3,,4,,5,,6]); - expect(Seq([1,,2,,3,,4,,5,,6]).slice(3, -3).toArray()).toEqual([,3,,4,,]); // one trailing hole. - }) + expect( + Seq([ + 1, + undefined, + 2, + undefined, + 3, + undefined, + 4, + undefined, + 5, + undefined, + 6, + ]) + .slice(1) + .toArray() + ).toEqual([ + undefined, + 2, + undefined, + 3, + undefined, + 4, + undefined, + 5, + undefined, + 6, + ]); + expect( + Seq([ + 1, + undefined, + 2, + undefined, + 3, + undefined, + 4, + undefined, + 5, + undefined, + 6, + ]) + .slice(2) + .toArray() + ).toEqual([2, undefined, 3, undefined, 4, undefined, 5, undefined, 6]); + expect( + Seq([ + 1, + undefined, + 2, + undefined, + 3, + undefined, + 4, + undefined, + 5, + undefined, + 6, + ]) + .slice(3, -3) + .toArray() + ).toEqual([undefined, 3, undefined, 4, undefined]); // one trailing hole. + }); it('can maintain indices for an keyed indexed sequence', () => { - expect(Seq.of(1,2,3,4,5,6).toKeyedSeq().slice(2).entrySeq().toArray()).toEqual([ - [2,3], - [3,4], - [4,5], - [5,6], + expect( + Seq([1, 2, 3, 4, 5, 6]).toKeyedSeq().slice(2).entrySeq().toArray() + ).toEqual([ + [2, 3], + [3, 4], + [4, 5], + [5, 6], ]); - expect(Seq.of(1,2,3,4,5,6).toKeyedSeq().slice(2, 4).entrySeq().toArray()).toEqual([ - [2,3], - [3,4], + expect( + Seq([1, 2, 3, 4, 5, 6]).toKeyedSeq().slice(2, 4).entrySeq().toArray() + ).toEqual([ + [2, 3], + [3, 4], ]); - }) + }); it('slices an unindexed sequence', () => { - expect(Seq({a:1,b:2,c:3}).slice(1).toObject()).toEqual({b:2,c:3}); - expect(Seq({a:1,b:2,c:3}).slice(1, 2).toObject()).toEqual({b:2}); - expect(Seq({a:1,b:2,c:3}).slice(0, 2).toObject()).toEqual({a:1,b:2}); - expect(Seq({a:1,b:2,c:3}).slice(-1).toObject()).toEqual({c:3}); - expect(Seq({a:1,b:2,c:3}).slice(1, -1).toObject()).toEqual({b:2}); - }) + expect(Seq({ a: 1, b: 2, c: 3 }).slice(1).toObject()).toEqual({ + b: 2, + c: 3, + }); + expect(Seq({ a: 1, b: 2, c: 3 }).slice(1, 2).toObject()).toEqual({ b: 2 }); + expect(Seq({ a: 1, b: 2, c: 3 }).slice(0, 2).toObject()).toEqual({ + a: 1, + b: 2, + }); + expect(Seq({ a: 1, b: 2, c: 3 }).slice(-1).toObject()).toEqual({ c: 3 }); + expect(Seq({ a: 1, b: 2, c: 3 }).slice(1, -1).toObject()).toEqual({ b: 2 }); + }); it('is reversable', () => { - expect(Seq.of(1,2,3,4,5,6).slice(2).reverse().toArray()).toEqual([6,5,4,3]); - expect(Seq.of(1,2,3,4,5,6).slice(2, 4).reverse().toArray()).toEqual([4,3]); - expect(Seq.of(1,2,3,4,5,6).toKeyedSeq().slice(2).reverse().entrySeq().toArray()).toEqual([ - [5,6], - [4,5], - [3,4], - [2,3], + expect(Seq([1, 2, 3, 4, 5, 6]).slice(2).reverse().toArray()).toEqual([ + 6, 5, 4, 3, + ]); + expect(Seq([1, 2, 3, 4, 5, 6]).slice(2, 4).reverse().toArray()).toEqual([ + 4, 3, + ]); + expect( + Seq([1, 2, 3, 4, 5, 6]) + .toKeyedSeq() + .slice(2) + .reverse() + .entrySeq() + .toArray() + ).toEqual([ + [5, 6], + [4, 5], + [3, 4], + [2, 3], ]); - expect(Seq.of(1,2,3,4,5,6).toKeyedSeq().slice(2, 4).reverse().entrySeq().toArray()).toEqual([ - [3,4], - [2,3], + expect( + Seq([1, 2, 3, 4, 5, 6]) + .toKeyedSeq() + .slice(2, 4) + .reverse() + .entrySeq() + .toArray() + ).toEqual([ + [3, 4], + [2, 3], ]); - }) + }); it('slices a list', () => { - expect(List.of(1,2,3,4,5,6).slice(2).toArray()).toEqual([3,4,5,6]); - expect(List.of(1,2,3,4,5,6).slice(2, 4).toArray()).toEqual([3,4]); - }) + expect(List([1, 2, 3, 4, 5, 6]).slice(2).toArray()).toEqual([3, 4, 5, 6]); + expect(List([1, 2, 3, 4, 5, 6]).slice(2, 4).toArray()).toEqual([3, 4]); + }); it('returns self for whole slices', () => { - var s = Seq.of(1,2,3); + const s = Seq([1, 2, 3]); expect(s.slice(0)).toBe(s); expect(s.slice(0, 3)).toBe(s); expect(s.slice(-4, 4)).toBe(s); - var v = List.of(1,2,3); + const v = List([1, 2, 3]); expect(v.slice(-4, 4)).toBe(v); expect(v.slice(-3)).toBe(v); expect(v.slice(-4, 4).toList()).toBe(v); - }) + }); it('creates a sliced list in O(log32(n))', () => { - expect(List.of(1,2,3,4,5).slice(-3, -1).toList().toArray()).toEqual([3,4]); - }) + expect(List([1, 2, 3, 4, 5]).slice(-3, -1).toList().toArray()).toEqual([ + 3, 4, + ]); + }); it('has the same behavior as array slice in known edge cases', () => { - var a = Range(0, 33).toArray(); - var v = List(a); + const a = Range(0, 33).toArray(); + const v = List(a); expect(v.slice(31).toList().toArray()).toEqual(a.slice(31)); - }) + }); it('does not slice by floating-point numbers', () => { - var seq = Seq([0,1,2,3,4,5]); - var sliced = seq.slice(0, 2.6); + const seq = Seq([0, 1, 2, 3, 4, 5]); + const sliced = seq.slice(0, 2.6); expect(sliced.size).toEqual(2); expect(sliced.toArray()).toEqual([0, 1]); - }) + }); it('can create an iterator', () => { - var seq = Seq([0,1,2,3,4,5]); - var iterFront = seq.slice(0,2).values(); - expect(iterFront.next()).toEqual({value: 0, done: false}); - expect(iterFront.next()).toEqual({value: 1, done: false}); - expect(iterFront.next()).toEqual({value: undefined, done: true}); - - var iterMiddle = seq.slice(2,4).values(); - expect(iterMiddle.next()).toEqual({value: 2, done: false}); - expect(iterMiddle.next()).toEqual({value: 3, done: false}); - expect(iterMiddle.next()).toEqual({value: undefined, done: true}); - - var iterTail = seq.slice(4,123456).values(); - expect(iterTail.next()).toEqual({value: 4, done: false}); - expect(iterTail.next()).toEqual({value: 5, done: false}); - expect(iterTail.next()).toEqual({value: undefined, done: true}); - }) - - check.it('works like Array.prototype.slice', - [gen.int, gen.array(gen.oneOf([gen.int, gen.undefined]), 0, 3)], - (valuesLen, args) => { - var a = Range(0, valuesLen).toArray(); - var v = List(a); - var slicedV = v.slice.apply(v, args); - var slicedA = a.slice.apply(a, args); - expect(slicedV.toArray()).toEqual(slicedA); - }) - - check.it('works like Array.prototype.slice on sparse array input', - [gen.array(gen.array([gen.posInt, gen.int])), - gen.array(gen.oneOf([gen.int, gen.undefined]), 0, 3)], - (entries, args) => { - var a = []; - entries.forEach(entry => a[entry[0]] = entry[1]); - var s = Seq(a); - var slicedS = s.slice.apply(s, args); - var slicedA = a.slice.apply(a, args); - expect(slicedS.toArray()).toEqual(slicedA); - }) + const seq = Seq([0, 1, 2, 3, 4, 5]); + const iterFront = seq.slice(0, 2).values(); + expect(iterFront.next()).toEqual({ value: 0, done: false }); + expect(iterFront.next()).toEqual({ value: 1, done: false }); + expect(iterFront.next()).toEqual({ value: undefined, done: true }); - describe('take', () => { + const iterMiddle = seq.slice(2, 4).values(); + expect(iterMiddle.next()).toEqual({ value: 2, done: false }); + expect(iterMiddle.next()).toEqual({ value: 3, done: false }); + expect(iterMiddle.next()).toEqual({ value: undefined, done: true }); - check.it('takes the first n from a list', [gen.int, gen.posInt], (len, num) => { - var a = Range(0, len).toArray(); - var v = List(a); - expect(v.take(num).toArray()).toEqual(a.slice(0, num)); - }) + const iterTail = seq.slice(4, 123456).values(); + expect(iterTail.next()).toEqual({ value: 4, done: false }); + expect(iterTail.next()).toEqual({ value: 5, done: false }); + expect(iterTail.next()).toEqual({ value: undefined, done: true }); + }); + + it('stops the entries iterator when the sequence has an undefined end', () => { + let seq = Seq([0, 1, 2, 3, 4, 5]); + // flatMap is lazy and thus the resulting sequence has no size. + seq = seq.flatMap((a) => [a]); + expect(seq.size).toEqual(undefined); + + const iterFront = seq.slice(0, 2).entries(); + expect(iterFront.next()).toEqual({ value: [0, 0], done: false }); + expect(iterFront.next()).toEqual({ value: [1, 1], done: false }); + expect(iterFront.next()).toEqual({ value: undefined, done: true }); + + const iterMiddle = seq.slice(2, 4).entries(); + expect(iterMiddle.next()).toEqual({ value: [0, 2], done: false }); + expect(iterMiddle.next()).toEqual({ value: [1, 3], done: false }); + expect(iterMiddle.next()).toEqual({ value: undefined, done: true }); + + const iterTail = seq.slice(4, 123456).entries(); + expect(iterTail.next()).toEqual({ value: [0, 4], done: false }); + expect(iterTail.next()).toEqual({ value: [1, 5], done: false }); + expect(iterTail.next()).toEqual({ value: undefined, done: true }); + }); + + it('works like Array.prototype.slice', () => { + fc.assert( + fc.property( + fc.integer({ min: -1000, max: 1000 }), + fc.sparseArray(fc.integer({ min: -1000, max: 1000 }), { maxLength: 3 }), + (valuesLen, args) => { + const a = Range(0, valuesLen).toArray(); + const v = List(a); + const slicedV = v.slice.apply(v, args); + const slicedA = a.slice.apply(a, args); + expect(slicedV.toArray()).toEqual(slicedA); + } + ) + ); + }); + + it('works like Array.prototype.slice on sparse array input', () => { + fc.assert( + fc.property( + fc.array(fc.tuple(fc.nat(1000), fc.integer({ min: -1000, max: 1000 }))), + fc.sparseArray(fc.integer({ min: -1000, max: 1000 }), { maxLength: 3 }), + (entries, args) => { + const a: Array = []; + entries.forEach((entry) => (a[entry[0]] = entry[1])); + const s = Seq(a); + const slicedS = s.slice.apply(s, args); + const slicedA = a.slice.apply(a, args); + expect(slicedS.toArray()).toEqual(slicedA); + } + ) + ); + }); + + describe('take', () => { + it('takes the first n from a list', () => { + fc.assert( + fc.property( + fc.integer({ min: -1000, max: 1000 }), + fc.nat(1000), + (len, num) => { + const a = Range(0, len).toArray(); + const v = List(a); + expect(v.take(num).toArray()).toEqual(a.slice(0, num)); + } + ) + ); + }); it('creates an immutable stable sequence', () => { - var seq = Seq.of(1,2,3,4,5,6); - var sliced = seq.take(3); + const seq = Seq([1, 2, 3, 4, 5, 6]); + const sliced = seq.take(3); expect(sliced.toArray()).toEqual([1, 2, 3]); expect(sliced.toArray()).toEqual([1, 2, 3]); expect(sliced.toArray()).toEqual([1, 2, 3]); - }) + }); it('converts to array with correct length', () => { - var seq = Seq.of(1,2,3,4,5,6); - var s1 = seq.take(3); - var s2 = seq.take(10); - var sn = seq.take(Infinity); - var s3 = seq.filter((v) => v < 4).take(10); - var s4 = seq.filter((v) => v < 4).take(2); + const seq = Seq([1, 2, 3, 4, 5, 6]); + const s1 = seq.take(3); + const s2 = seq.take(10); + const sn = seq.take(Infinity); + const s3 = seq.filter((v) => v < 4).take(10); + const s4 = seq.filter((v) => v < 4).take(2); expect(s1.toArray().length).toEqual(3); expect(s2.toArray().length).toEqual(6); expect(sn.toArray().length).toEqual(6); expect(s3.toArray().length).toEqual(3); expect(s4.toArray().length).toEqual(2); - }) - - }) - -}) + }); + }); +}); diff --git a/__tests__/sort.ts b/__tests__/sort.ts index 6c9ddbc698..0a5afbf9ad 100644 --- a/__tests__/sort.ts +++ b/__tests__/sort.ts @@ -1,42 +1,78 @@ -/// -/// - -jest.autoMockOff(); - -import { Seq, List, OrderedMap, Range } from 'immutable'; +import { describe, expect, it } from '@jest/globals'; +import { List, OrderedMap, Range, Seq } from 'immutable'; describe('sort', () => { - it('sorts a sequence', () => { - expect(Seq.of(4,5,6,3,2,1).sort().toArray()).toEqual([1,2,3,4,5,6]); - }) + expect(Seq([4, 5, 6, 3, 2, 1]).sort().toArray()).toEqual([ + 1, 2, 3, 4, 5, 6, + ]); + }); it('sorts a list', () => { - expect(List.of(4,5,6,3,2,1).sort().toArray()).toEqual([1,2,3,4,5,6]); - }) + expect(List([4, 5, 6, 3, 2, 1]).sort().toArray()).toEqual([ + 1, 2, 3, 4, 5, 6, + ]); + }); + + it('sorts undefined values last', () => { + expect( + List([4, undefined, 5, 6, 3, undefined, 2, 1]).sort().toArray() + ).toEqual([1, 2, 3, 4, 5, 6, undefined, undefined]); + }); it('sorts a keyed sequence', () => { - expect(Seq({z:1,y:2,x:3,c:3,b:2,a:1}).sort().entrySeq().toArray()) - .toEqual([['z', 1],['a', 1],['y', 2],['b', 2],['x', 3],['c', 3]]); - }) + expect( + Seq({ z: 1, y: 2, x: 3, c: 3, b: 2, a: 1 }).sort().entrySeq().toArray() + ).toEqual([ + ['z', 1], + ['a', 1], + ['y', 2], + ['b', 2], + ['x', 3], + ['c', 3], + ]); + }); it('sorts an OrderedMap', () => { - expect(OrderedMap({z:1,y:2,x:3,c:3,b:2,a:1}).sort().entrySeq().toArray()) - .toEqual([['z', 1],['a', 1],['y', 2],['b', 2],['x', 3],['c', 3]]); - }) + expect( + OrderedMap({ z: 1, y: 2, x: 3, c: 3, b: 2, a: 1 }) + .sort() + .entrySeq() + .toArray() + ).toEqual([ + ['z', 1], + ['a', 1], + ['y', 2], + ['b', 2], + ['x', 3], + ['c', 3], + ]); + }); it('accepts a sort function', () => { - expect(Seq.of(4,5,6,3,2,1).sort((a, b) => b - a).toArray()).toEqual([6,5,4,3,2,1]); - }) + expect( + Seq([4, 5, 6, 3, 2, 1]) + .sort((a, b) => b - a) + .toArray() + ).toEqual([6, 5, 4, 3, 2, 1]); + }); it('sorts by using a mapper', () => { - expect(Range(1,10).sortBy(v => v % 3).toArray()) - .toEqual([3,6,9,1,4,7,2,5,8]); - }) + expect( + Range(1, 10) + .sortBy((v) => v % 3) + .toArray() + ).toEqual([3, 6, 9, 1, 4, 7, 2, 5, 8]); + }); it('sorts by using a mapper and a sort function', () => { - expect(Range(1,10).sortBy(v => v % 3, (a: number, b: number) => b - a).toArray()) - .toEqual([2,5,8,1,4,7,3,6,9]); - }) - -}) + expect( + Range(1, 10) + .sortBy( + (v) => v % 3, + (a: number, b: number) => b - a + ) + .toArray() + ).toEqual([2, 5, 8, 1, 4, 7, 3, 6, 9]); + }); +}); diff --git a/__tests__/splice.ts b/__tests__/splice.ts index 6dff66e7cf..cb90281016 100644 --- a/__tests__/splice.ts +++ b/__tests__/splice.ts @@ -1,45 +1,65 @@ -/// -/// - -jest.autoMockOff(); - -import * as jasmineCheck from 'jasmine-check'; -jasmineCheck.install(); - +import { describe, expect, it } from '@jest/globals'; import { List, Range, Seq } from 'immutable'; +import fc from 'fast-check'; describe('splice', () => { - it('splices a sequence only removing elements', () => { - expect(Seq.of(1,2,3).splice(0,1).toArray()).toEqual([2,3]); - expect(Seq.of(1,2,3).splice(1,1).toArray()).toEqual([1,3]); - expect(Seq.of(1,2,3).splice(2,1).toArray()).toEqual([1,2]); - expect(Seq.of(1,2,3).splice(3,1).toArray()).toEqual([1,2,3]); - }) + expect(Seq([1, 2, 3]).splice(0, 1).toArray()).toEqual([2, 3]); + expect(Seq([1, 2, 3]).splice(1, 1).toArray()).toEqual([1, 3]); + expect(Seq([1, 2, 3]).splice(2, 1).toArray()).toEqual([1, 2]); + expect(Seq([1, 2, 3]).splice(3, 1).toArray()).toEqual([1, 2, 3]); + }); it('splices a list only removing elements', () => { - expect(List.of(1,2,3).splice(0,1).toArray()).toEqual([2,3]); - expect(List.of(1,2,3).splice(1,1).toArray()).toEqual([1,3]); - expect(List.of(1,2,3).splice(2,1).toArray()).toEqual([1,2]); - expect(List.of(1,2,3).splice(3,1).toArray()).toEqual([1,2,3]); - }) + expect(List([1, 2, 3]).splice(0, 1).toArray()).toEqual([2, 3]); + expect(List([1, 2, 3]).splice(1, 1).toArray()).toEqual([1, 3]); + expect(List([1, 2, 3]).splice(2, 1).toArray()).toEqual([1, 2]); + expect(List([1, 2, 3]).splice(3, 1).toArray()).toEqual([1, 2, 3]); + }); + + it('splicing by infinity', () => { + const l = List(['a', 'b', 'c', 'd']); + expect(l.splice(2, Infinity, 'x').toArray()).toEqual(['a', 'b', 'x']); + expect(l.splice(Infinity, 2, 'x').toArray()).toEqual([ + 'a', + 'b', + 'c', + 'd', + 'x', + ]); + + const s = List(['a', 'b', 'c', 'd']); + expect(s.splice(2, Infinity, 'x').toArray()).toEqual(['a', 'b', 'x']); + expect(s.splice(Infinity, 2, 'x').toArray()).toEqual([ + 'a', + 'b', + 'c', + 'd', + 'x', + ]); + }); it('has the same behavior as array splice in known edge cases', () => { - // arbitary numbers that sum to 31 - var a = Range(0, 49).toArray(); - var v = List(a); + // arbitrary numbers that sum to 31 + const a = Range(0, 49).toArray(); + const v = List(a); a.splice(-18, 0, 0); expect(v.splice(-18, 0, 0).toList().toArray()).toEqual(a); - }) - - check.it('has the same behavior as array splice', - [gen.array(gen.int), gen.array(gen.oneOf([gen.int, gen.undefined]))], - (values, args) => { - var v = List(values); - var a = values.slice(); // clone - var splicedV = v.splice.apply(v, args); // persistent - a.splice.apply(a, args); // mutative - expect(splicedV.toArray()).toEqual(a); - }) + }); -}) + it('has the same behavior as array splice', () => { + fc.assert( + fc.property( + fc.array(fc.integer()), + fc.array(fc.sparseArray(fc.integer())), + (values, args) => { + const v = List(values); + const a = values.slice(); // clone + const splicedV = v.splice.apply(v, args); // persistent + a.splice.apply(a, args); // mutative + expect(splicedV.toArray()).toEqual(a); + } + ) + ); + }); +}); diff --git a/__tests__/transformerProtocol.ts b/__tests__/transformerProtocol.ts new file mode 100644 index 0000000000..c3cedb3577 --- /dev/null +++ b/__tests__/transformerProtocol.ts @@ -0,0 +1,101 @@ +import { describe, expect, it } from '@jest/globals'; +import * as t from 'transducers-js'; +import { List, Map, Set, Stack } from 'immutable'; + +describe('Transformer Protocol', () => { + it('transduces Stack without initial values', () => { + const s = Stack.of(1, 2, 3, 4); + const xform = t.comp( + t.filter((x) => x % 2 === 0), + t.map((x) => x + 1) + ); + const s2 = t.transduce(xform, Stack(), s); + expect(s.toArray()).toEqual([1, 2, 3, 4]); + expect(s2.toArray()).toEqual([5, 3]); + }); + + it('transduces Stack with initial values', () => { + const v1 = Stack.of(1, 2, 3); + const v2 = Stack.of(4, 5, 6, 7); + const xform = t.comp( + t.filter((x) => x % 2 === 0), + t.map((x) => x + 1) + ); + const r = t.transduce(xform, Stack(), v1, v2); + expect(v1.toArray()).toEqual([1, 2, 3]); + expect(v2.toArray()).toEqual([4, 5, 6, 7]); + expect(r.toArray()).toEqual([7, 5, 1, 2, 3]); + }); + + it('transduces List without initial values', () => { + const v = List.of(1, 2, 3, 4); + const xform = t.comp( + t.filter((x) => x % 2 === 0), + t.map((x) => x + 1) + ); + const r = t.transduce(xform, List(), v); + expect(v.toArray()).toEqual([1, 2, 3, 4]); + expect(r.toArray()).toEqual([3, 5]); + }); + + it('transduces List with initial values', () => { + const v1 = List.of(1, 2, 3); + const v2 = List.of(4, 5, 6, 7); + const xform = t.comp( + t.filter((x) => x % 2 === 0), + t.map((x) => x + 1) + ); + const r = t.transduce(xform, List(), v1, v2); + expect(v1.toArray()).toEqual([1, 2, 3]); + expect(v2.toArray()).toEqual([4, 5, 6, 7]); + expect(r.toArray()).toEqual([1, 2, 3, 5, 7]); + }); + + it('transduces Map without initial values', () => { + const m1 = Map({ a: 1, b: 2, c: 3, d: 4 }); + const xform = t.comp( + t.filter(([_k, v]) => v % 2 === 0), + t.map(([k, v]) => [k, v * 2]) + ); + const m2 = t.transduce(xform, Map(), m1); + expect(m1.toObject()).toEqual({ a: 1, b: 2, c: 3, d: 4 }); + expect(m2.toObject()).toEqual({ b: 4, d: 8 }); + }); + + it('transduces Map with initial values', () => { + const m1 = Map({ a: 1, b: 2, c: 3 }); + const m2 = Map({ a: 4, b: 5 }); + const xform = t.comp( + t.filter(([_k, v]) => v % 2 === 0), + t.map(([k, v]) => [k, v * 2]) + ); + const m3 = t.transduce(xform, Map(), m1, m2); + expect(m1.toObject()).toEqual({ a: 1, b: 2, c: 3 }); + expect(m2.toObject()).toEqual({ a: 4, b: 5 }); + expect(m3.toObject()).toEqual({ a: 8, b: 2, c: 3 }); + }); + + it('transduces Set without initial values', () => { + const s1 = Set.of(1, 2, 3, 4); + const xform = t.comp( + t.filter((x) => x % 2 === 0), + t.map((x) => x + 1) + ); + const s2 = t.transduce(xform, Set(), s1); + expect(s1.toArray()).toEqual([1, 2, 3, 4]); + expect(s2.toArray()).toEqual([3, 5]); + }); + + it('transduces Set with initial values', () => { + const s1 = Set.of(1, 2, 3, 4); + const s2 = Set.of(2, 3, 4, 5, 6); + const xform = t.comp( + t.filter((x) => x % 2 === 0), + t.map((x) => x + 1) + ); + const s3 = t.transduce(xform, Set(), s1, s2); + expect(s1.toArray()).toEqual([1, 2, 3, 4]); + expect(s2.toArray()).toEqual([2, 3, 4, 5, 6]); + expect(s3.toArray()).toEqual([1, 2, 3, 4, 5, 7]); + }); +}); diff --git a/__tests__/ts-utils.ts b/__tests__/ts-utils.ts new file mode 100644 index 0000000000..d4cc759e68 --- /dev/null +++ b/__tests__/ts-utils.ts @@ -0,0 +1,7 @@ +import { expect } from '@jest/globals'; + +export function expectToBeDefined( + arg: T +): asserts arg is Exclude { + expect(arg).toBeDefined(); +} diff --git a/__tests__/tsconfig.json b/__tests__/tsconfig.json new file mode 100644 index 0000000000..78742cd9bd --- /dev/null +++ b/__tests__/tsconfig.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "noEmit": true, + // TODO: add additional strictness + "strictNullChecks": true, + "strictFunctionTypes": true, + "target": "esnext", + "moduleResolution": "node", + "skipLibCheck": true, + "paths": { + "immutable": ["../type-definitions/immutable.d.ts"] + } + } +} diff --git a/__tests__/updateIn.ts b/__tests__/updateIn.ts index bf7d65f5a1..1ca054f979 100644 --- a/__tests__/updateIn.ts +++ b/__tests__/updateIn.ts @@ -1,274 +1,457 @@ -/// -/// +import { describe, expect, it } from '@jest/globals'; +import { + fromJS, + List, + Map, + MapOf, + removeIn, + Seq, + Set, + setIn, + updateIn, +} from 'immutable'; -jest.autoMockOff(); +describe('updateIn', () => { + it('deep edit', () => { + const m = fromJS({ a: { b: { c: 10 } } }); + expect( + // @ts-expect-error -- type of fromJS may return a MapOf in the future, to help `updateIn` to work, `updateIn` should copy the comportment of `getIn` + m.updateIn(['a', 'b', 'c'], (value: number) => value * 2).toJS() + ).toEqual({ + a: { b: { c: 20 } }, + }); + }); -import { Map, Set, fromJS } from 'immutable'; + it('deep edit with list as keyPath', () => { + const m = fromJS({ a: { b: { c: 10 } } }); + expect( + // @ts-expect-error -- type of fromJS may return a MapOf in the future, to help `updateIn` to work, `updateIn` should copy the comportment of `getIn` + m.updateIn(fromJS(['a', 'b', 'c']), (value: number) => value * 2).toJS() + ).toEqual({ a: { b: { c: 20 } } }); + }); -describe('updateIn', () => { + it('deep edit in raw JS', () => { + const m = { a: { b: { c: [10] } } }; + expect( + updateIn(m, ['a', 'b', 'c', 0], (value: number) => value * 2) + ).toEqual({ + a: { b: { c: [20] } }, + }); + }); - it('deep get', () => { - var m = fromJS({a: {b: {c: 10}}}); - expect(m.getIn(['a', 'b', 'c'])).toEqual(10); - }) + it('deep edit throws without list or array-like', () => { + // @ts-expect-error -- test that runtime does throw + expect(() => Map().updateIn(undefined, (x) => x)).toThrow( + 'Invalid keyPath: expected Ordered Collection or Array: undefined' + ); + // @ts-expect-error -- test that runtime does th + expect(() => Map().updateIn({ a: 1, b: 2 }, (x) => x)).toThrow( + 'Invalid keyPath: expected Ordered Collection or Array: [object Object]' + ); + expect(() => Map().updateIn('abc', (x) => x)).toThrow( + 'Invalid keyPath: expected Ordered Collection or Array: abc' + ); + }); - it('deep get with list as keyPath', () => { - var m = fromJS({a: {b: {c: 10}}}); - expect(m.getIn(fromJS(['a', 'b', 'c']))).toEqual(10); - }) + it('deep edit throws if non-editable path', () => { + const deep = Map({ key: Set([List(['item'])]) }); + expect(() => deep.updateIn(['key', 'foo', 'item'], () => 'newval')).toThrow( + 'Cannot update immutable value without .set() method: Set { List [ "item" ] }' + ); - it('deep get throws without list or array-like', () => { - // need to cast these as TypeScript first prevents us from such clownery. - expect(() => - Map().getIn(undefined) - ).toThrow('Expected iterable or array-like: undefined'); + const deepSeq = Map({ key: Seq([List(['item'])]) }); expect(() => - Map().getIn({ a: 1, b: 2 }) - ).toThrow('Expected iterable or array-like: [object Object]'); - }) + deepSeq.updateIn(['key', 'foo', 'item'], () => 'newval') + ).toThrow( + 'Cannot update immutable value without .set() method: Seq [ List [ "item" ] ]' + ); - it('deep has throws without list or array-like', () => { - // need to cast these as TypeScript first prevents us from such clownery. - expect(() => - Map().hasIn(undefined) - ).toThrow('Expected iterable or array-like: undefined'); - expect(() => - Map().hasIn({ a: 1, b: 2 }) - ).toThrow('Expected iterable or array-like: [object Object]'); - }) + const nonObj = Map({ key: 123 }); + expect(() => nonObj.updateIn(['key', 'foo'], () => 'newval')).toThrow( + 'Cannot update within non-data-structure value in path ["key"]: 123' + ); + }); - it('deep get returns not found if path does not match', () => { - var m = fromJS({a: {b: {c: 10}}}); - expect(m.getIn(['a', 'b', 'z'])).toEqual(undefined); - expect(m.getIn(['a', 'b', 'c', 'd'])).toEqual(undefined); - }) + it('handle ArrayLike objects that are nor Array not immutable Collection', () => { + class CustomArrayLike implements ArrayLike { + readonly length: number; + [n: number]: T; - it('deep edit', () => { - var m = fromJS({a: {b: {c: 10}}}); - expect( - m.updateIn(['a', 'b', 'c'], value => value * 2).toJS() - ).toEqual( - {a: {b: {c: 20}}} - ); - }) + constructor(...values: Array) { + this.length = values.length; - it('deep edit with list as keyPath', () => { - var m = fromJS({a: {b: {c: 10}}}); + for (let i = 0; i < values.length; i++) { + this[i] = values[i]; + } + } + + // Define other methods if needed, but do not include the `slice` method + // For example, you can define a method to set values + set(index: number, value: T): void { + if (index < 0 || index >= this.length) { + throw new RangeError('Index out of bounds'); + } + + this[index] = value; + } + + // Define a method to get values + get(index: number): T { + if (index < 0 || index >= this.length) { + throw new RangeError('Index out of bounds'); + } + + return this[index]; + } + } + + // create an ArrayLike + const customArray = new CustomArrayLike(10, 20); + + // code that works perfectly expect( - m.updateIn(fromJS(['a', 'b', 'c']), value => value * 2).toJS() - ).toEqual( - {a: {b: {c: 20}}} - ); - }) + updateIn({ 10: { 20: 'a' } }, customArray, (v) => + // @ts-expect-error -- `updateIn` keypath type should be `OrderedCollection | ArrayLike; + typeof v === 'string' ? v.toUpperCase() : v + ) + ).toEqual({ 10: { 20: 'A' } }); - it('deep edit throws without list or array-like', () => { - // need to cast these as TypeScript first prevents us from such clownery. - expect(() => - Map().updateIn(undefined, x => x) - ).toThrow('Expected iterable or array-like: undefined'); expect(() => - Map().updateIn({ a: 1, b: 2 }, x => x) - ).toThrow('Expected iterable or array-like: [object Object]'); - }) + updateIn({ 10: 'a' }, customArray, (v) => + // @ts-expect-error -- `updateIn` keypath type should be `OrderedCollection | ArrayLike; + typeof v === 'string' ? v.toUpperCase() : v + ) + ).toThrow('Cannot update within non-data-structure value in path [10]: a'); + }); + + it('identity with notSetValue is still identity', () => { + const m = Map({ a: { b: { c: 10 } } }); + expect(m.updateIn(['x'], 100, (id) => id)).toEqual(m); + }); + it('shallow remove', () => { + const m = Map({ a: 123 }); + expect(m.updateIn([], () => undefined)).toEqual(undefined); + }); it('deep remove', () => { - var m = fromJS({a: {b: {c: 10}}}); + const m = fromJS({ a: { b: { c: 10 } } }); expect( - m.updateIn(['a', 'b'], map => map.remove('c')).toJS() - ).toEqual( - {a: {b: {}}} - ); - }) + m + // @ts-expect-error -- type of fromJS may return a MapOf in the future, to help `updateIn` to work, `updateIn` should copy the comportment of `getIn` + .updateIn(['a', 'b'], (map: MapOf<{ c: number }>) => map.remove('c')) + .toJS() + ).toEqual({ + a: { b: {} }, + }); + }); it('deep set', () => { - var m = fromJS({a: {b: {c: 10}}}); + const m = fromJS({ a: { b: { c: 10 } } }); expect( - m.updateIn(['a', 'b'], map => map.set('d', 20)).toJS() - ).toEqual( - {a: {b: {c: 10, d: 20}}} - ); - }) + m + // @ts-expect-error -- type of fromJS may return a MapOf in the future, to help `updateIn` to work, `updateIn` should copy the comportment of `getIn` + .updateIn(['a', 'b'], (map: MapOf<{ c: number }>) => map.set('d', 20)) + .toJS() + ).toEqual({ + a: { b: { c: 10, d: 20 } }, + }); + }); it('deep push', () => { - var m = fromJS({a: {b: [1,2,3]}}); + const m = fromJS({ a: { b: [1, 2, 3] } }); expect( - m.updateIn(['a', 'b'], list => list.push(4)).toJS() - ).toEqual( - {a: {b: [1,2,3,4]}} - ); - }) + // @ts-expect-error -- type of fromJS may return a MapOf in the future, to help `updateIn` to work, `updateIn` should copy the comportment of `getIn` + m.updateIn(['a', 'b'], (list: List) => list.push(4)).toJS() + ).toEqual({ + a: { b: [1, 2, 3, 4] }, + }); + }); it('deep map', () => { - var m = fromJS({a: {b: [1,2,3]}}); + const m = fromJS({ a: { b: [1, 2, 3] } }); expect( - m.updateIn(['a', 'b'], list => list.map(value => value * 10)).toJS() - ).toEqual( - {a: {b: [10, 20, 30]}} - ); - }) + m + // @ts-expect-error -- type of fromJS may return a MapOf in the future, to help `updateIn` to work, `updateIn` should copy the comportment of `getIn` + .updateIn(['a', 'b'], (list: List) => + list.map((value) => value * 10) + ) + .toJS() + ).toEqual({ a: { b: [10, 20, 30] } }); + }); it('creates new maps if path contains gaps', () => { - var m = fromJS({a: {b: {c: 10}}}); + const m = fromJS({ a: { b: { c: 10 } } }); expect( - m.updateIn(['a', 'z'], Map(), map => map.set('d', 20)).toJS() - ).toEqual( - {a: {b: {c: 10}, z: {d: 20}}} - ); - }) + m + .updateIn( + ['a', 'q', 'z'], + Map(), + // @ts-expect-error -- updateIn should handle the `notSetValue` parameter + (map: Map) => map.set('d', 20) + ) + .toJS() + ).toEqual({ a: { b: { c: 10 }, q: { z: { d: 20 } } } }); + }); + + it('creates new objects if path contains gaps within raw JS', () => { + const m = { a: { b: { c: 10 } } }; + expect( + updateIn( + m, + ['a', 'b', 'z'], + Map(), + (map: Map) => map.set('d', 20) + ) + ).toEqual({ a: { b: { c: 10, z: Map({ d: 20 }) } } }); + }); it('throws if path cannot be set', () => { - var m = fromJS({a: {b: {c: 10}}}); + const m = fromJS({ a: { b: { c: 10 } } }); expect(() => { - m.updateIn(['a', 'b', 'c', 'd'], v => 20).toJS() - }).toThrow(); - }) + m.updateIn(['a', 'b', 'c', 'd'], () => 20).toJS(); + }).toThrow( + 'Cannot update within non-data-structure value in path ["a","b","c"]: 10' + ); + }); + + it('update with notSetValue when non-existing key', () => { + const m = Map({ a: { b: { c: 10 } } }); + // @ts-expect-error -- updateIn should handle the `notSetValue` parameter + expect(m.updateIn(['x'], 100, (map: number) => map + 1).toJS()).toEqual({ + a: { b: { c: 10 } }, + x: 101, + }); + }); + + it('update with notSetValue when non-existing key in raw JS', () => { + const m = { a: { b: { c: 10 } } }; + expect(updateIn(m, ['x'], 100, (map: number) => map + 1)).toEqual({ + a: { b: { c: 10 } }, + x: 101, + }); + }); it('updates self for empty path', () => { - var m = fromJS({a: 1, b: 2, c: 3}); - expect( - m.updateIn([], map => map.set('b', 20)).toJS() - ).toEqual( - {a: 1, b: 20, c: 3} - ) - }) + const m = fromJS({ a: 1, b: 2, c: 3 }); + // @ts-expect-error -- type of fromJS may return a MapOf in the future, to help `updateIn` to work, `updateIn` should copy the comportment of `getIn` + expect(m.updateIn([], (map: typeof m) => map.set('b', 20)).toJS()).toEqual({ + a: 1, + b: 20, + c: 3, + }); + }); it('does not perform edit when new value is the same as old value', () => { - var m = fromJS({a: {b: {c: 10}}}); - var m2 = m.updateIn(['a', 'b', 'c'], id => id); + const m = fromJS({ a: { b: { c: 10 } } }); + const m2 = m.updateIn(['a', 'b', 'c'], (id) => id); expect(m2).toBe(m); - }) + }); + + it('does not perform edit when new value is the same as old value in raw JS', () => { + const m = { a: { b: { c: 10 } } }; + const m2 = updateIn(m, ['a', 'b', 'c'], (id) => id); + expect(m2).toBe(m); + }); it('does not perform edit when notSetValue is what you return from updater', () => { - var m = Map(); - var spiedOnID; - var m2 = m.updateIn(['a', 'b', 'c'], Set(), id => (spiedOnID = id)); + const m = Map(); + let spiedOnID; + const m2 = m.updateIn(['a', 'b', 'c'], Set(), (id) => (spiedOnID = id)); expect(m2).toBe(m); expect(spiedOnID).toBe(Set()); - }) + }); it('provides default notSetValue of undefined', () => { - var m = Map(); - var spiedOnID; - var m2 = m.updateIn(['a', 'b', 'c'], id => (spiedOnID = id)); + const m = Map(); + let spiedOnID; + const m2 = m.updateIn(['a', 'b', 'c'], (id) => (spiedOnID = id)); expect(m2).toBe(m); expect(spiedOnID).toBe(undefined); - }) + }); describe('setIn', () => { - it('provides shorthand for updateIn to set a single value', () => { - var m = Map().setIn(['a','b','c'], 'X'); - expect(m.toJS()).toEqual({a:{b:{c:'X'}}}); - }) + const m = Map().setIn(['a', 'b', 'c'], 'X'); + expect(m).toEqual(fromJS({ a: { b: { c: 'X' } } })); + }); it('accepts a list as a keyPath', () => { - var m = Map().setIn(fromJS(['a','b','c']), 'X'); - expect(m.toJS()).toEqual({a:{b:{c:'X'}}}); - }) + const m = Map().setIn(fromJS(['a', 'b', 'c']), 'X'); + expect(m).toEqual(fromJS({ a: { b: { c: 'X' } } })); + }); it('returns value when setting empty path', () => { - var m = Map(); - expect(m.setIn([], 'X')).toBe('X') - }) + const m = Map(); + expect(m.setIn([], 'X')).toBe('X'); + }); it('can setIn undefined', () => { - var m = Map().setIn(['a','b','c'], undefined); - expect(m.toJS()).toEqual({a:{b:{c:undefined}}}); + const m = Map().setIn(['a', 'b', 'c'], undefined); + expect(m).toEqual(Map({ a: Map({ b: Map({ c: undefined }) }) })); }); - }) + it('returns self for a no-op', () => { + const m = fromJS({ a: { b: { c: 123 } } }); + expect(m.setIn(['a', 'b', 'c'], 123)).toBe(m); + }); - describe('removeIn', () => { + it('provides shorthand for updateIn to set a single value in raw JS', () => { + const m = setIn({}, ['a', 'b', 'c'], 'X'); + expect(m).toEqual({ a: { b: { c: 'X' } } }); + }); + + it('accepts a list as a keyPath in raw JS', () => { + const m = setIn({}, fromJS(['a', 'b', 'c']), 'X'); + expect(m).toEqual({ a: { b: { c: 'X' } } }); + }); + + it('returns value when setting empty path in raw JS', () => { + expect(setIn({}, [], 'X')).toBe('X'); + }); + it('can setIn undefined in raw JS', () => { + const m = setIn({}, ['a', 'b', 'c'], undefined); + expect(m).toEqual({ a: { b: { c: undefined } } }); + }); + + it('returns self for a no-op in raw JS', () => { + const m = { a: { b: { c: 123 } } }; + expect(setIn(m, ['a', 'b', 'c'], 123)).toBe(m); + }); + }); + + describe('removeIn', () => { it('provides shorthand for updateIn to remove a single value', () => { - var m = fromJS({a:{b:{c:'X', d:'Y'}}}); - expect(m.removeIn(['a','b','c']).toJS()).toEqual({a:{b:{d:'Y'}}}); - }) + const m = fromJS({ a: { b: { c: 'X', d: 'Y' } } }) as Map< + string, + unknown + >; + expect(m.removeIn(['a', 'b', 'c']).toJS()).toEqual({ + a: { b: { d: 'Y' } }, + }); + }); it('accepts a list as a keyPath', () => { - var m = fromJS({a:{b:{c:'X', d:'Y'}}}); - expect(m.removeIn(fromJS(['a','b','c'])).toJS()).toEqual({a:{b:{d:'Y'}}}); - }) + const m = fromJS({ a: { b: { c: 'X', d: 'Y' } } }) as Map< + string, + unknown + >; + expect(m.removeIn(fromJS(['a', 'b', 'c'])).toJS()).toEqual({ + a: { b: { d: 'Y' } }, + }); + }); it('does not create empty maps for an unset path', () => { - var m = Map(); - expect(m.removeIn(['a','b','c']).toJS()).toEqual({}); - }) + const m = Map(); + expect(m.removeIn(['a', 'b', 'c']).toJS()).toEqual({}); + }); it('removes itself when removing empty path', () => { - var m = Map(); - expect(m.removeIn([])).toBe(undefined) - }) + const m = Map(); + expect(m.removeIn([])).toBe(undefined); + }); - }) + it('removes values from a Set', () => { + const m = Map({ set: Set([1, 2, 3]) }); + const m2 = m.removeIn(['set', 2]); + expect(m2.toJS()).toEqual({ set: [1, 3] }); + }); - describe('mergeIn', () => { + it('returns undefined when removing an empty path in raw JS', () => { + expect(removeIn({}, [])).toBe(undefined); + }); + it('can removeIn in raw JS', () => { + const m = removeIn({ a: { b: { c: 123 } } }, ['a', 'b', 'c']); + expect(m).toEqual({ a: { b: { c: undefined } } }); + }); + + it('returns self for a no-op in raw JS', () => { + const m = { a: { b: { c: 123 } } }; + expect(removeIn(m, ['a', 'b', 'd'])).toBe(m); + }); + }); + + describe('mergeIn', () => { it('provides shorthand for updateIn to merge a nested value', () => { - var m1 = fromJS({x:{a:1,b:2,c:3}}); - var m2 = fromJS({d:10,b:20,e:30}); - expect(m1.mergeIn(['x'], m2).toJS()).toEqual( - {x: {a:1,b:20,c:3,d:10,e:30}} - ); - }) + const m1 = fromJS({ x: { a: 1, b: 2, c: 3 } }); + const m2 = fromJS({ d: 10, b: 20, e: 30 }); + expect(m1.mergeIn(['x'], m2).toJS()).toEqual({ + x: { a: 1, b: 20, c: 3, d: 10, e: 30 }, + }); + }); it('accepts a list as a keyPath', () => { - var m1 = fromJS({x:{a:1,b:2,c:3}}); - var m2 = fromJS({d:10,b:20,e:30}); - expect(m1.mergeIn(fromJS(['x']), m2).toJS()).toEqual( - {x: {a:1,b:20,c:3,d:10,e:30}} - ); - }) + const m1 = fromJS({ x: { a: 1, b: 2, c: 3 } }); + const m2 = fromJS({ d: 10, b: 20, e: 30 }); + expect(m1.mergeIn(fromJS(['x']), m2).toJS()).toEqual({ + x: { a: 1, b: 20, c: 3, d: 10, e: 30 }, + }); + }); it('does not create empty maps for a no-op merge', () => { - var m = Map(); - expect(m.mergeIn(['a','b','c'], Map()).toJS()).toEqual({}); - }) + const m = Map(); + expect(m.mergeIn(['a', 'b', 'c'], Map()).toJS()).toEqual({}); + }); it('merges into itself for empty path', () => { - var m = Map({a:1,b:2,c:3}); - expect( - m.mergeIn([], Map({d:10,b:20,e:30})).toJS() - ).toEqual( - {a:1,b:20,c:3,d:10,e:30} - ) - }) + const m = Map({ a: 1, b: 2, c: 3 }); + expect(m.mergeIn([], Map({ d: 10, b: 20, e: 30 })).toJS()).toEqual({ + a: 1, + b: 20, + c: 3, + d: 10, + e: 30, + }); + }); - }) + it('merges into plain JS Object and Array', () => { + const m = Map({ a: { x: [1, 2, 3] } }); + expect(m.mergeIn(['a', 'x'], [4, 5, 6])).toEqual( + Map({ a: { x: [1, 2, 3, 4, 5, 6] } }) + ); + }); + }); describe('mergeDeepIn', () => { - it('provides shorthand for updateIn to merge a nested value', () => { - var m1 = fromJS({x:{a:1,b:2,c:3}}); - var m2 = fromJS({d:10,b:20,e:30}); - expect(m1.mergeDeepIn(['x'], m2).toJS()).toEqual( - {x: {a:1,b:20,c:3,d:10,e:30}} - ); - }) + const m1 = fromJS({ x: { a: 1, b: 2, c: 3 } }); + const m2 = fromJS({ d: 10, b: 20, e: 30 }); + expect(m1.mergeDeepIn(['x'], m2).toJS()).toEqual({ + x: { a: 1, b: 20, c: 3, d: 10, e: 30 }, + }); + }); it('accepts a list as a keyPath', () => { - var m1 = fromJS({x:{a:1,b:2,c:3}}); - var m2 = fromJS({d:10,b:20,e:30}); - expect(m1.mergeDeepIn(fromJS(['x']), m2).toJS()).toEqual( - {x: {a:1,b:20,c:3,d:10,e:30}} - ); - }) + const m1 = fromJS({ x: { a: 1, b: 2, c: 3 } }); + const m2 = fromJS({ d: 10, b: 20, e: 30 }); + expect(m1.mergeDeepIn(fromJS(['x']), m2).toJS()).toEqual({ + x: { a: 1, b: 20, c: 3, d: 10, e: 30 }, + }); + }); it('does not create empty maps for a no-op merge', () => { - var m = Map(); - expect(m.mergeDeepIn(['a','b','c'], Map()).toJS()).toEqual({}); - }) + const m = Map(); + expect(m.mergeDeepIn(['a', 'b', 'c'], Map()).toJS()).toEqual({}); + }); it('merges into itself for empty path', () => { - var m = Map({a:1,b:2,c:3}); - expect( - m.mergeDeepIn([], Map({d:10,b:20,e:30})).toJS() - ).toEqual( - {a:1,b:20,c:3,d:10,e:30} - ) - }) - - }) + const m = Map({ a: 1, b: 2, c: 3 }); + expect(m.mergeDeepIn([], Map({ d: 10, b: 20, e: 30 })).toJS()).toEqual({ + a: 1, + b: 20, + c: 3, + d: 10, + e: 30, + }); + }); -}) + it('merges deep into plain JS Object and Array', () => { + const m = Map({ a: { x: [1, 2, 3] } }); + expect(m.mergeDeepIn(['a'], { x: [4, 5, 6] })).toEqual( + Map({ a: { x: [1, 2, 3, 4, 5, 6] } }) + ); + }); + }); +}); diff --git a/__tests__/utils.js b/__tests__/utils.js new file mode 100644 index 0000000000..1d1c6b0e44 --- /dev/null +++ b/__tests__/utils.js @@ -0,0 +1,62 @@ +/** + * @jest-environment jsdom + */ + +import { List, isPlainObject } from 'immutable'; + +describe('Utils', () => { + describe('isPlainObj()', function testFunc() { + const nonPlainCases = [ + ['Host object', document.createElement('div')], + ['bool primitive false', false], + ['bool primitive true', true], + ['falsy undefined', undefined], + ['falsy null', null], + ['Simple function', function () {}], + [ + 'Instance of other object', + (function () { + function Foo() {} + return new Foo(); + })(), + ], + ['Number primitive ', 5], + ['String primitive ', 'P'], + ['Number Object', Number(6)], + ['Immutable.List', new List()], + ['simple array', ['one']], + ['Error', Error], + ['Internal namespaces', Math], + ['Arguments', arguments], + ]; + const plainCases = [ + ['literal Object', {}], + // eslint-disable-next-line no-object-constructor + ['new Object', new Object()], + ['Object.create(null)', Object.create(null)], + ['nested object', { one: { prop: 'two' } }], + ['constructor prop', { constructor: 'prop' }], // shadows an object's constructor + ['constructor.name', { constructor: { name: 'two' } }], // shadows an object's constructor.name + [ + 'Fake toString', + { + toString: function () { + return '[object Object]'; + }, + }, + ], + ]; + + nonPlainCases.forEach(([name, value]) => { + it(`${name} returns false`, () => { + expect(isPlainObject(value)).toBe(false); + }); + }); + + plainCases.forEach(([name, value]) => { + it(`${name} returns true`, () => { + expect(isPlainObject(value)).toBe(true); + }); + }); + }); +}); diff --git a/__tests__/zip.ts b/__tests__/zip.ts index b3bbda35f6..4487fa1b95 100644 --- a/__tests__/zip.ts +++ b/__tests__/zip.ts @@ -1,107 +1,147 @@ -/// -/// - -jest.autoMockOff(); - -import * as jasmineCheck from 'jasmine-check'; -jasmineCheck.install(); - -import { Iterable, List, Range, Seq } from 'immutable'; +import { describe, expect, it } from '@jest/globals'; +import { List, Range, Seq } from 'immutable'; +import fc from 'fast-check'; +import { expectToBeDefined } from './ts-utils'; describe('zip', () => { - it('zips lists into a list of tuples', () => { expect( - Seq.of(1,2,3).zip(Seq.of(4,5,6)).toArray() - ).toEqual( - [[1,4],[2,5],[3,6]] + Seq([1, 2, 3]) + .zip(Seq([4, 5, 6])) + .toArray() + ).toEqual([ + [1, 4], + [2, 5], + [3, 6], + ]); + }); + + it('zip results can be converted to JS', () => { + const l1 = List([List([1]), List([2]), List([3])]); + const l2 = List([List([4]), List([5]), List([6])]); + const zipped = l1.zip(l2); + expect(zipped).toEqual( + List([ + [List([1]), List([4])], + [List([2]), List([5])], + [List([3]), List([6])], + ]) ); + expect(zipped.toJS()).toEqual([ + [[1], [4]], + [[2], [5]], + [[3], [6]], + ]); }); it('zips with infinite lists', () => { expect( - Range().zip(Seq.of('A','B','C')).toArray() - ).toEqual( - [[0,'A'],[1,'B'],[2,'C']] - ); + Range(0, Infinity) + .zip(Seq(['A', 'B', 'C'])) + .toArray() + ).toEqual([ + [0, 'A'], + [1, 'B'], + [2, 'C'], + ]); }); it('has unknown size when zipped with unknown size', () => { - var seq = Range(0, 10); - var zipped = seq.zip(seq.filter(n => n % 2 === 0)); + const seq = Range(0, 10); + const zipped = seq.zip(seq.filter((n) => n % 2 === 0)); expect(zipped.size).toBe(undefined); expect(zipped.count()).toBe(5); - }) + }); - check.it('is always the size of the smaller sequence', - [gen.notEmpty(gen.array(gen.posInt))], (lengths) => { - var ranges = lengths.map(l => Range(0, l)); - var first = ranges.shift(); - var zipped = first.zip.apply(first, ranges); - var shortestLength = Math.min.apply(Math, lengths); - expect(zipped.size).toBe(shortestLength); + it('is always the size of the smaller sequence', () => { + fc.assert( + fc.property(fc.array(fc.nat(), { minLength: 1 }), (lengths) => { + const ranges = lengths.map((l) => Range(0, l)); + const first = ranges.shift(); + expectToBeDefined(first); + const zipped = first.zip.apply(first, ranges); + const shortestLength = Math.min.apply(Math, lengths); + expect(zipped.size).toBe(shortestLength); + }) + ); }); describe('zipWith', () => { - it('zips with a custom function', () => { expect( - Seq.of(1,2,3).zipWith( - (a, b) => a + b, - Seq.of(4,5,6) - ).toArray() - ).toEqual( - [5,7,9] - ); + Seq([1, 2, 3]) + .zipWith((a, b) => a + b, Seq([4, 5, 6])) + .toArray() + ).toEqual([5, 7, 9]); }); it('can zip to create immutable collections', () => { expect( - Seq.of(1,2,3).zipWith( - function () { return List(arguments); }, - Seq.of(4,5,6), - Seq.of(7,8,9) - ).toJS() - ).toEqual( - [[1,4,7],[2,5,8],[3,6,9]] - ); + Seq([1, 2, 3]) + .zipWith( + function () { + // eslint-disable-next-line prefer-rest-params + return List(arguments); + }, + Seq([4, 5, 6]), + Seq([7, 8, 9]) + ) + .toJS() + ).toEqual([ + [1, 4, 7], + [2, 5, 8], + [3, 6, 9], + ]); }); + }); + describe('zipAll', () => { + it('fills in the empty zipped values with undefined', () => { + expect( + Seq([1, 2, 3]) + .zipAll(Seq([4])) + .toArray() + ).toEqual([ + [1, 4], + [2, undefined], + [3, undefined], + ]); + }); + + it('is always the size of the longest sequence', () => { + fc.assert( + fc.property(fc.array(fc.nat(), { minLength: 1 }), (lengths) => { + const ranges = lengths.map((l) => Range(0, l)); + const first = ranges.shift(); + expectToBeDefined(first); + const zipped = first.zipAll.apply(first, ranges); + const longestLength = Math.max.apply(Math, lengths); + expect(zipped.size).toBe(longestLength); + }) + ); + }); }); describe('interleave', () => { - it('interleaves multiple collections', () => { expect( - Seq.of(1,2,3).interleave( - Seq.of(4,5,6), - Seq.of(7,8,9) - ).toArray() - ).toEqual( - [1,4,7,2,5,8,3,6,9] - ); + Seq([1, 2, 3]) + .interleave(Seq([4, 5, 6]), Seq([7, 8, 9])) + .toArray() + ).toEqual([1, 4, 7, 2, 5, 8, 3, 6, 9]); }); it('stops at the shortest collection', () => { - var i = Seq.of(1,2,3).interleave( - Seq.of(4,5), - Seq.of(7,8,9) - ); + const i = Seq([1, 2, 3]).interleave(Seq([4, 5]), Seq([7, 8, 9])); expect(i.size).toBe(6); - expect(i.toArray()).toEqual( - [1,4,7,2,5,8] - ); + expect(i.toArray()).toEqual([1, 4, 7, 2, 5, 8]); }); it('with infinite lists', () => { - var r: Iterable.Indexed = Range(); - var i = r.interleave(Seq.of('A','B','C')); + const r: Seq.Indexed = Range(0, Infinity); + const i = r.interleave(Seq(['A', 'B', 'C'])); expect(i.size).toBe(6); - expect(i.toArray()).toEqual( - [0,'A',1,'B',2,'C'] - ); + expect(i.toArray()).toEqual([0, 'A', 1, 'B', 2, 'C']); }); - }); - }); diff --git a/bower.json b/bower.json deleted file mode 100644 index c1a3fd8284..0000000000 --- a/bower.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "immutable", - "description": "Immutable Data Collections", - "homepage": "https://github.com/facebook/immutable-js", - "author": { - "name": "Lee Byron", - "homepage": "https://github.com/leebyron" - }, - "repository": { - "type": "git", - "url": "git://github.com/facebook/immutable-js.git" - }, - "main": "dist/immutable.js", - "typescript": { - "definition": "dist/immutable.d.ts" - }, - "ignore": [ - "**/.*", - "__tests__", - "resources", - "src", - "type-definitions", - "package.json", - "Gruntfile.js" - ], - "keywords": [ - "immutable", - "persistent", - "lazy", - "data", - "datastructure", - "functional", - "collection", - "stateless", - "sequence", - "iteration" - ], - "license": "BSD" -} diff --git a/contrib/cursor/README.md b/contrib/cursor/README.md deleted file mode 100644 index 30214321d6..0000000000 --- a/contrib/cursor/README.md +++ /dev/null @@ -1,33 +0,0 @@ -Cursors -------- - -Cursors allow you to hold a reference to a path in a nested immutable data -structure, allowing you to pass smaller sections of a larger nested -collection to portions of your application while maintaining a central point -aware of changes to the entire data structure: an `onChange` function which is -called whenever a cursor or sub-cursor calls `update`. - -This is particularly useful when used in conjuction with component-based UI -libraries like [React](http://facebook.github.io/react/) or to simulate -"state" throughout an application while maintaining a single flow of logic. - - -```javascript -var Immutable = require('immutable'); -var Cursor = require('immutable/contrib/cursor'); - -var data = Immutable.fromJS({ a: { b: { c: 1 } } }); -var cursor = Cursor.from(data, ['a', 'b'], newData => { - data = newData; -}); - -// ... elsewhere ... - -cursor.get('c'); // 1 -cursor = cursor.update('c', x => x + 1); -cursor.get('c'); // 2 - -// ... back to data ... - -data.getIn(['a', 'b', 'c']); // 2 -``` diff --git a/contrib/cursor/__tests__/Cursor.ts.skip b/contrib/cursor/__tests__/Cursor.ts.skip deleted file mode 100644 index dc03acf1f0..0000000000 --- a/contrib/cursor/__tests__/Cursor.ts.skip +++ /dev/null @@ -1,393 +0,0 @@ -/// -/// -/// - -jest.autoMockOff(); - -import Immutable = require('immutable'); -import Cursor = require('immutable/contrib/cursor'); - -describe('Cursor', () => { - - beforeEach(function () { - this.addMatchers({ - toValueEqual: function (expected) { - var actual = this.actual; - if (!Immutable.is(expected, this.actual)) { - this.message = 'Expected\n' + this.actual + '\nto equal\n' + expected; - return false; - } - return true; - } - }); - }); - - var json = { a: { b: { c: 1 } } }; - - it('gets from its path', () => { - var data = Immutable.fromJS(json); - var cursor = Cursor.from(data); - - expect(cursor.deref()).toBe(data); - - var deepCursor = cursor.cursor(['a', 'b']); - expect(deepCursor.deref().toJS()).toEqual(json.a.b); - expect(deepCursor.deref()).toBe(data.getIn(['a', 'b'])); - expect(deepCursor.get('c')).toBe(1); - - var leafCursor = deepCursor.cursor('c'); - expect(leafCursor.deref()).toBe(1); - - var missCursor = leafCursor.cursor('d'); - expect(missCursor.deref()).toBe(undefined); - }); - - it('gets return new cursors', () => { - var data = Immutable.fromJS(json); - var cursor = Cursor.from(data); - var deepCursor = cursor.getIn(['a', 'b']); - expect(deepCursor.deref()).toBe(data.getIn(['a', 'b'])); - }); - - it('gets return new cursors using List', () => { - var data = Immutable.fromJS(json); - var cursor = Cursor.from(data); - var deepCursor = cursor.getIn(Immutable.fromJS(['a', 'b'])); - expect(deepCursor.deref()).toBe(data.getIn(Immutable.fromJS(['a', 'b']))); - }); - - it('cursor return new cursors of correct type', () => { - var data = Immutable.fromJS({ a: [1, 2, 3] }); - var cursor = Cursor.from(data); - var deepCursor = cursor.cursor('a'); - expect(deepCursor.findIndex).toBeDefined(); - }); - - it('can be treated as a value', () => { - var data = Immutable.fromJS(json); - var cursor = Cursor.from(data, ['a', 'b']); - expect(cursor.toJS()).toEqual(json.a.b); - expect(cursor).toValueEqual(data.getIn(['a', 'b'])); - expect(cursor.size).toBe(1); - expect(cursor.get('c')).toBe(1); - }); - - it('can be value compared to a primitive', () => { - var data = Immutable.Map({ a: 'A' }); - var aCursor = Cursor.from(data, 'a'); - expect(aCursor.size).toBe(undefined); - expect(aCursor.deref()).toBe('A'); - expect(Immutable.is(aCursor, 'A')).toBe(true); - }); - - it('updates at its path', () => { - var onChange = jest.genMockFunction(); - - var data = Immutable.fromJS(json); - var aCursor = Cursor.from(data, 'a', onChange); - - var deepCursor = aCursor.cursor(['b', 'c']); - expect(deepCursor.deref()).toBe(1); - - // cursor edits return new cursors: - var newDeepCursor = deepCursor.update(x => x + 1); - expect(newDeepCursor.deref()).toBe(2); - var call1 = onChange.mock.calls[0]; - expect(call1[0]).toValueEqual(Immutable.fromJS({a:{b:{c:2}}})); - expect(call1[1]).toBe(data); - expect(call1[2]).toEqual(['a', 'b', 'c']); - - var newestDeepCursor = newDeepCursor.update(x => x + 1); - expect(newestDeepCursor.deref()).toBe(3); - var call2 = onChange.mock.calls[1]; - expect(call2[0]).toValueEqual(Immutable.fromJS({a:{b:{c:3}}})); - expect(call2[1]).toValueEqual(Immutable.fromJS({a:{b:{c:2}}})); - expect(call2[2]).toEqual(['a', 'b', 'c']); - - // meanwhile, data is still immutable: - expect(data.toJS()).toEqual(json); - - // as is the original cursor. - expect(deepCursor.deref()).toBe(1); - var otherNewDeepCursor = deepCursor.update(x => x + 10); - expect(otherNewDeepCursor.deref()).toBe(11); - var call3 = onChange.mock.calls[2]; - expect(call3[0]).toValueEqual(Immutable.fromJS({a:{b:{c:11}}})); - expect(call3[1]).toBe(data); - expect(call3[2]).toEqual(['a', 'b', 'c']); - - // and update has been called exactly thrice. - expect(onChange.mock.calls.length).toBe(3); - }); - - it('updates with the return value of onChange', () => { - var onChange = jest.genMockFunction(); - - var data = Immutable.fromJS(json); - var deepCursor = Cursor.from(data, ['a', 'b', 'c'], onChange); - - onChange.mockReturnValueOnce(undefined); - // onChange returning undefined has no effect - var newCursor = deepCursor.update(x => x + 1); - expect(newCursor.deref()).toBe(2); - var call1 = onChange.mock.calls[0]; - expect(call1[0]).toValueEqual(Immutable.fromJS({a:{b:{c:2}}})); - expect(call1[1]).toBe(data); - expect(call1[2]).toEqual(['a', 'b', 'c']); - - onChange.mockReturnValueOnce(Immutable.fromJS({a:{b:{c:11}}})); - // onChange returning something else has an effect - newCursor = newCursor.update(x => 999); - expect(newCursor.deref()).toBe(11); - var call2 = onChange.mock.calls[1]; - expect(call2[0]).toValueEqual(Immutable.fromJS({a:{b:{c:999}}})); - expect(call2[1]).toValueEqual(Immutable.fromJS({a:{b:{c:2}}})); - expect(call2[2]).toEqual(['a', 'b', 'c']); - - // and update has been called exactly twice - expect(onChange.mock.calls.length).toBe(2); - }); - - it('has map API for update shorthand', () => { - var onChange = jest.genMockFunction(); - - var data = Immutable.fromJS(json); - var aCursor = Cursor.from(data, 'a', onChange); - var bCursor = aCursor.cursor('b'); - var cCursor = bCursor.cursor('c'); - - expect(bCursor.set('c', 10).deref()).toValueEqual( - Immutable.fromJS({ c: 10 }) - ); - - var call1 = onChange.mock.calls[0]; - expect(call1[0]).toValueEqual(Immutable.fromJS({a:{b:{c:10}}})); - expect(call1[1]).toBe(data); - expect(call1[2]).toEqual(['a', 'b', 'c']); - }); - - it('creates maps as necessary', () => { - var data = Immutable.Map(); - var cursor = Cursor.from(data, ['a', 'b', 'c']); - expect(cursor.deref()).toBe(undefined); - cursor = cursor.set('d', 3); - expect(cursor.deref()).toValueEqual(Immutable.Map({d: 3})); - }); - - it('can set undefined', () => { - var data = Immutable.Map(); - var cursor = Cursor.from(data, ['a', 'b', 'c']); - expect(cursor.deref()).toBe(undefined); - cursor = cursor.set('d', undefined); - expect(cursor.toJS()).toEqual({d: undefined}); - }); - - it('has the sequence API', () => { - var data = Immutable.Map({a: 1, b: 2, c: 3}); - var cursor = Cursor.from(data); - expect(cursor.map((x: number) => x * x)).toValueEqual(Immutable.Map({a: 1, b: 4, c: 9})); - }); - - it('can push values on a List', () => { - var onChange = jest.genMockFunction(); - var data = Immutable.fromJS({a: {b: [0, 1, 2]}}); - var cursor = Cursor.from(data, ['a', 'b'], onChange); - - expect(cursor.push(3,4)).toValueEqual(Immutable.List([0, 1, 2, 3, 4])); - - var call = onChange.mock.calls[0]; - expect(call[0]).toValueEqual(Immutable.fromJS({a: {b: [0, 1, 2, 3, 4]}})); - expect(call[1]).toBe(data); - expect(call[2]).toEqual(['a', 'b']); - }); - - it('can pop values of a List', () => { - var onChange = jest.genMockFunction(); - var data = Immutable.fromJS({a: {b: [0, 1, 2]}}); - var cursor = Cursor.from(data, ['a', 'b'], onChange); - - expect(cursor.pop()).toValueEqual(Immutable.List([0, 1])); - - var call = onChange.mock.calls[0]; - expect(call[0]).toValueEqual(Immutable.fromJS({a: {b: [0, 1]}})); - expect(call[1]).toBe(data); - expect(call[2]).toEqual(['a', 'b']); - }); - - it('can unshift values on a List', () => { - var onChange = jest.genMockFunction(); - var data = Immutable.fromJS({a: {b: [0, 1, 2]}}); - var cursor = Cursor.from(data, ['a', 'b'], onChange); - - expect(cursor.unshift(-2, -1)).toValueEqual(Immutable.List([-2, -1, 0, 1, 2])); - - var call = onChange.mock.calls[0]; - expect(call[0]).toValueEqual(Immutable.fromJS({a: {b: [-2, -1, 0, 1, 2]}})); - expect(call[1]).toBe(data); - expect(call[2]).toEqual(['a', 'b']); - }); - - it('can shift values of a List', () => { - var onChange = jest.genMockFunction(); - var data = Immutable.fromJS({a: {b: [0, 1, 2]}}); - var cursor = Cursor.from(data, ['a', 'b'], onChange); - - expect(cursor.shift()).toValueEqual(Immutable.List([1, 2])); - - var call = onChange.mock.calls[0]; - expect(call[0]).toValueEqual(Immutable.fromJS({a: {b: [1, 2]}})); - expect(call[1]).toBe(data); - expect(call[2]).toEqual(['a', 'b']); - }); - - - it('returns wrapped values for sequence API', () => { - var data = Immutable.fromJS({a: {v: 1}, b: {v: 2}, c: {v: 3}}); - var onChange = jest.genMockFunction(); - var cursor = Cursor.from(data, onChange); - - var found = cursor.find(map => map.get('v') === 2); - expect(typeof found.deref).toBe('function'); // is a cursor! - found = found.set('v', 20); - - var call = onChange.mock.calls[0]; - expect(call[0]).toValueEqual(Immutable.fromJS({a: {v: 1}, b: {v: 20}, c: {v: 3}})); - expect(call[1]).toBe(data); - expect(call[2]).toEqual(['b', 'v']); - }); - - it('returns wrapped values for iteration API', () => { - var jsData = [{val: 0}, {val: 1}, {val: 2}]; - var data = Immutable.fromJS(jsData); - var cursor = Cursor.from(data); - cursor.forEach(function (c, i) { - expect(typeof c.deref).toBe('function'); // is a cursor! - expect(c.get('val')).toBe(i); - }); - }); - - it('can map over values to get subcursors', () => { - var data = Immutable.fromJS({a: {v: 1}, b: {v: 2}, c: {v: 3}}); - var cursor = Cursor.from(data); - - var mapped = cursor.map(val => { - expect(typeof val.deref).toBe('function'); // mapped values are cursors. - return val; - }).toMap(); - // Mapped is not a cursor, but it is a sequence of cursors. - expect(typeof (mapped).deref).not.toBe('function'); - expect(typeof (mapped.get('a')).deref).toBe('function'); - - // Same for indexed cursors - var data2 = Immutable.fromJS({x: [{v: 1}, {v: 2}, {v: 3}]}); - var cursor2 = Cursor.from(data2); - - var mapped2 = cursor2.get('x').map(val => { - expect(typeof val.deref).toBe('function'); // mapped values are cursors. - return val; - }).toList(); - // Mapped is not a cursor, but it is a sequence of cursors. - expect(typeof mapped2.deref).not.toBe('function'); - expect(typeof mapped2.get(0).deref).toBe('function'); - }); - - it('can have mutations apply with a single callback', () => { - var onChange = jest.genMockFunction(); - var data = Immutable.fromJS({'a': 1}); - - var c1 = Cursor.from(data, onChange); - var c2 = c1.withMutations(m => m.set('b', 2).set('c', 3).set('d', 4)); - - expect(c1.deref().toObject()).toEqual({'a': 1}); - expect(c2.deref().toObject()).toEqual({'a': 1, 'b': 2, 'c': 3, 'd': 4}); - expect(onChange.mock.calls.length).toBe(1); - }); - - it('can use withMutations on an unfulfilled cursor', () => { - var onChange = jest.genMockFunction(); - var data = Immutable.fromJS({}); - - var c1 = Cursor.from(data, ['a', 'b', 'c'], onChange); - var c2 = c1.withMutations(m => m.set('x', 1).set('y', 2).set('z', 3)); - - expect(c1.deref()).toEqual(undefined); - expect(c2.deref()).toValueEqual(Immutable.fromJS( - { x: 1, y: 2, z: 3 } - )); - expect(onChange.mock.calls.length).toBe(1); - }); - - it('maintains indexed sequences', () => { - var data = Immutable.fromJS([]); - var c = Cursor.from(data); - expect(c.toJS()).toEqual([]); - }); - - it('properly acts as an iterable', () => { - var data = Immutable.fromJS({key: {val: 1}}); - var c = Cursor.from(data).values(); - var c1 = c.next().value.get('val'); - expect(c1).toBe(1); - }); - - it('can update deeply', () => { - var onChange = jest.genMockFunction(); - var data = Immutable.fromJS({a:{b:{c:1}}}); - var c = Cursor.from(data, ['a'], onChange); - var c1 = c.updateIn(['b', 'c'], x => x * 10); - expect(c1.getIn(['b', 'c'])).toBe(10); - - var call = onChange.mock.calls[0]; - expect(call[0]).toValueEqual(Immutable.fromJS({a:{b:{c:10}}})); - expect(call[1]).toBe(data); - expect(call[2]).toEqual(['a', 'b', 'c']); - }); - - it('can set deeply', () => { - var onChange = jest.genMockFunction(); - var data = Immutable.fromJS({a:{b:{c:1}}}); - var c = Cursor.from(data, ['a'], onChange); - var c1 = c.setIn(['b', 'c'], 10); - expect(c1.getIn(['b', 'c'])).toBe(10); - - var call = onChange.mock.calls[0]; - expect(call[0]).toValueEqual(Immutable.fromJS({a:{b:{c:10}}})); - expect(call[1]).toBe(data); - expect(call[2]).toEqual(['a', 'b', 'c']); - }); - - it('can get Record value as a property', () => { - var User = Immutable.Record({ name: 'John' }); - var users = Immutable.List.of(new User()); - var data = Immutable.Map({'users': users}); - var cursor = Cursor.from(data, ['users']); - expect(cursor.first().name).toBe('John'); - }); - - it('can set value of a cursor directly', () => { - var onChange = jest.genMockFunction(); - var data = Immutable.fromJS({a:1}); - var c = Cursor.from(data, ['a'], onChange); - var c1 = c.set(2); - expect(c1.deref()).toBe(2); - - var call = onChange.mock.calls[0]; - expect(call[0]).toValueEqual(Immutable.fromJS({a:2})); - expect(call[1]).toBe(data); - expect(call[2]).toEqual(['a']); - }); - - it('can set value of a cursor to undefined directly', () => { - var onChange = jest.genMockFunction(); - var data = Immutable.fromJS({a:1}); - var c = Cursor.from(data, ['a'], onChange); - var c1 = c.set(undefined); - expect(c1.deref()).toBe(undefined); - - var call = onChange.mock.calls[0]; - expect(call[0]).toValueEqual(Immutable.fromJS({a:undefined})); - expect(call[1]).toBe(data); - expect(call[2]).toEqual(['a']); - }); - -}); diff --git a/contrib/cursor/index.d.ts b/contrib/cursor/index.d.ts deleted file mode 100644 index 0b45ab998b..0000000000 --- a/contrib/cursor/index.d.ts +++ /dev/null @@ -1,293 +0,0 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - - -/** - * Cursors - * ------- - * - * Cursors allow you to hold a reference to a path in a nested immutable data - * structure, allowing you to pass smaller sections of a larger nested - * collection to portions of your application while maintaining a central point - * aware of changes to the entire data structure. - * - * This is particularly useful when used in conjuction with component-based UI - * libraries like [React](http://facebook.github.io/react/) or to simulate - * "state" throughout an application while maintaining a single flow of logic. - * - * Cursors provide a simple API for getting the value at that path - * (the equivalent of `this.getIn(keyPath)`), updating the value at that path - * (the equivalent of `this.updateIn(keyPath)`), and getting a sub-cursor - * starting from that path. - * - * When updated, a new root collection is created and provided to the `onChange` - * function provided to the first call to `Cursor(map, onChange)`. - * - * When this cursor's (or any of its sub-cursors') `update` method is called, - * the resulting new data structure will be provided to the `onChange` - * function. Use this callback to keep track of the most current value or - * update the rest of your application. - */ - -/// - -declare module __Cursor { - - export function from( - collection: Immutable.Collection, - onChange?: (newValue: any, oldValue?: any, keyPath?: Array) => any - ): Cursor; - export function from( - collection: Immutable.Collection, - keyPath: Array, - onChange?: (newValue: any, oldValue?: any, keyPath?: Array) => any - ): Cursor; - export function from( - collection: Immutable.Collection, - key: any, - onChange?: (newValue: any, oldValue?: any, keyPath?: Array) => any - ): Cursor; - - - export interface Cursor extends Immutable.Seq { - - /** - * Returns a sub-cursor following the key-path starting from this cursor. - */ - cursor(subKeyPath: Array): Cursor; - cursor(subKey: any): Cursor; - - /** - * Returns the value at the cursor, if the cursor path does not yet exist, - * returns `notSetValue`. - */ - deref(notSetValue?: any): any; - - /** - * Returns the value at the `key` in the cursor, or `notSetValue` if it - * does not exist. - * - * If the key would return a collection, a new Cursor is returned. - */ - get(key: any, notSetValue?: any): any; - - /** - * Returns the value at the `keyPath` in the cursor, or `notSetValue` if it - * does not exist. - * - * If the keyPath would return a collection, a new Cursor is returned. - */ - getIn(keyPath: Array, notSetValue?: any): any; - getIn(keyPath: Immutable.Iterable, notSetValue?: any): any; - - /** - * Sets `value` at `key` in the cursor, returning a new cursor to the same - * point in the new data. - * - * If only one parameter is provided, it is set directly as the cursor's value. - */ - set(key: any, value: any): Cursor; - set(value: any): Cursor; - - /** - * Deletes `key` from the cursor, returning a new cursor to the same - * point in the new data. - * - * Note: `delete` cannot be safely used in IE8 - * @alias remove - */ - delete(key: any): Cursor; - remove(key: any): Cursor; - - /** - * Clears the value at this cursor, returning a new cursor to the same - * point in the new data. - */ - clear(): Cursor; - - /** - * Updates the value in the data this cursor points to, triggering the - * callback for the root cursor and returning a new cursor pointing to the - * new data. - */ - update(updater: (value: any) => any): Cursor; - update(key: any, updater: (value: any) => any): Cursor; - update(key: any, notSetValue: any, updater: (value: any) => any): Cursor; - - /** - * @see `Map#merge` - */ - merge(...iterables: Immutable.Iterable[]): Cursor; - merge(...iterables: {[key: string]: any}[]): Cursor; - - /** - * @see `Map#mergeWith` - */ - mergeWith( - merger: (previous?: any, next?: any) => any, - ...iterables: Immutable.Iterable[] - ): Cursor; - mergeWith( - merger: (previous?: any, next?: any) => any, - ...iterables: {[key: string]: any}[] - ): Cursor; - - /** - * @see `Map#mergeDeep` - */ - mergeDeep(...iterables: Immutable.Iterable[]): Cursor; - mergeDeep(...iterables: {[key: string]: any}[]): Cursor; - - /** - * @see `Map#mergeDeepWith` - */ - mergeDeepWith( - merger: (previous?: any, next?: any) => any, - ...iterables: Immutable.Iterable[] - ): Cursor; - mergeDeepWith( - merger: (previous?: any, next?: any) => any, - ...iterables: {[key: string]: any}[] - ): Cursor; - - // Deep persistent changes - - /** - * Returns a new Cursor having set `value` at this `keyPath`. If any keys in - * `keyPath` do not exist, a new immutable Map will be created at that key. - */ - setIn(keyPath: Array, value: any): Cursor; - setIn(keyPath: Immutable.Iterable, value: any): Cursor; - - /** - * Returns a new Cursor with provided `values` appended - */ - push(...values: Array): Cursor; - - /** - * Returns a new Cursor with a size ones less than this Cursor, - * excluding the last index in this Cursor. - */ - pop(): Cursor; - - /** - * Returns a new Cursor with the provided `values` prepended, - * shifting other values ahead to higher indices. - */ - unshift(...values: Array): Cursor; - - /** - * Returns a new Cursor with a size ones less than this Cursor, excluding - * the first index in this Cursor, shifting all other values to a lower index. - */ - shift(): Cursor; - - /** - * Returns a new Cursor having removed the value at this `keyPath`. - * - * @alias removeIn - */ - deleteIn(keyPath: Array): Cursor; - deleteIn(keyPath: Immutable.Iterable): Cursor; - removeIn(keyPath: Array): Cursor; - removeIn(keyPath: Immutable.Iterable): Cursor; - - /** - * Returns a new Cursor having applied the `updater` to the value found at - * the keyPath. - * - * If any keys in `keyPath` do not exist, new Immutable `Map`s will - * be created at those keys. If the `keyPath` does not already contain a - * value, the `updater` function will be called with `notSetValue`, if - * provided, otherwise `undefined`. - * - * If the `updater` function returns the same value it was called with, then - * no change will occur. This is still true if `notSetValue` is provided. - */ - updateIn( - keyPath: Array, - updater: (value: any) => any - ): Cursor; - updateIn( - keyPath: Array, - notSetValue: any, - updater: (value: any) => any - ): Cursor; - updateIn( - keyPath: Immutable.Iterable, - updater: (value: any) => any - ): Cursor; - updateIn( - keyPath: Immutable.Iterable, - notSetValue: any, - updater: (value: any) => any - ): Cursor; - - /** - * A combination of `updateIn` and `merge`, returning a new Cursor, but - * performing the merge at a point arrived at by following the keyPath. - * In other words, these two lines are equivalent: - * - * x.updateIn(['a', 'b', 'c'], abc => abc.merge(y)); - * x.mergeIn(['a', 'b', 'c'], y); - * - */ - mergeIn( - keyPath: Immutable.Iterable, - ...iterables: Immutable.Iterable[] - ): Cursor; - mergeIn( - keyPath: Array, - ...iterables: Immutable.Iterable[] - ): Cursor; - mergeIn( - keyPath: Array, - ...iterables: {[key: string]: any}[] - ): Cursor; - - /** - * A combination of `updateIn` and `mergeDeep`, returning a new Cursor, but - * performing the deep merge at a point arrived at by following the keyPath. - * In other words, these two lines are equivalent: - * - * x.updateIn(['a', 'b', 'c'], abc => abc.mergeDeep(y)); - * x.mergeDeepIn(['a', 'b', 'c'], y); - * - */ - mergeDeepIn( - keyPath: Immutable.Iterable, - ...iterables: Immutable.Iterable[] - ): Cursor; - mergeDeepIn( - keyPath: Array, - ...iterables: Immutable.Iterable[] - ): Cursor; - mergeDeepIn( - keyPath: Array, - ...iterables: {[key: string]: any}[] - ): Cursor; - - // Transient changes - - /** - * Every time you call one of the above functions, a new immutable value is - * created and the callback is triggered. If you need to apply a series of - * mutations to a Cursor without triggering the callback repeatedly, - * `withMutations()` creates a temporary mutable copy of the value which - * can apply mutations in a highly performant manner. Afterwards the - * callback is triggered with the final value. - */ - withMutations(mutator: (mutable: any) => any): Cursor; - } - -} - -declare module 'immutable/contrib/cursor' { - export = __Cursor -} \ No newline at end of file diff --git a/contrib/cursor/index.js b/contrib/cursor/index.js deleted file mode 100644 index 727536719e..0000000000 --- a/contrib/cursor/index.js +++ /dev/null @@ -1,343 +0,0 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -/** - * Cursor is expected to be required in a node or other CommonJS context: - * - * var Cursor = require('immutable/contrib/cursor'); - * - * If you wish to use it in the browser, please check out Browserify or WebPack! - */ - -var Immutable = require('../../'); -var Iterable = Immutable.Iterable; -var Iterator = Iterable.Iterator; -var Seq = Immutable.Seq; -var Map = Immutable.Map; -var Record = Immutable.Record; - - -function cursorFrom(rootData, keyPath, onChange) { - if (arguments.length === 1) { - keyPath = []; - } else if (typeof keyPath === 'function') { - onChange = keyPath; - keyPath = []; - } else { - keyPath = valToKeyPath(keyPath); - } - return makeCursor(rootData, keyPath, onChange); -} - - -var KeyedCursorPrototype = Object.create(Seq.Keyed.prototype); -var IndexedCursorPrototype = Object.create(Seq.Indexed.prototype); - -function KeyedCursor(rootData, keyPath, onChange, size) { - this.size = size; - this._rootData = rootData; - this._keyPath = keyPath; - this._onChange = onChange; -} -KeyedCursorPrototype.constructor = KeyedCursor; - -function IndexedCursor(rootData, keyPath, onChange, size) { - this.size = size; - this._rootData = rootData; - this._keyPath = keyPath; - this._onChange = onChange; -} -IndexedCursorPrototype.constructor = IndexedCursor; - -KeyedCursorPrototype.toString = function() { - return this.__toString('Cursor {', '}'); -} -IndexedCursorPrototype.toString = function() { - return this.__toString('Cursor [', ']'); -} - -KeyedCursorPrototype.deref = -KeyedCursorPrototype.valueOf = -IndexedCursorPrototype.deref = -IndexedCursorPrototype.valueOf = function(notSetValue) { - return this._rootData.getIn(this._keyPath, notSetValue); -} - -KeyedCursorPrototype.get = -IndexedCursorPrototype.get = function(key, notSetValue) { - return this.getIn([key], notSetValue); -} - -KeyedCursorPrototype.getIn = -IndexedCursorPrototype.getIn = function(keyPath, notSetValue) { - keyPath = listToKeyPath(keyPath); - if (keyPath.length === 0) { - return this; - } - var value = this._rootData.getIn(newKeyPath(this._keyPath, keyPath), NOT_SET); - return value === NOT_SET ? notSetValue : wrappedValue(this, keyPath, value); -} - -IndexedCursorPrototype.set = -KeyedCursorPrototype.set = function(key, value) { - if(arguments.length === 1) { - return updateCursor(this, function() { return key; }, []); - } else { - return updateCursor(this, function (m) { return m.set(key, value); }, [key]); - } -} - -IndexedCursorPrototype.push = function(/* values */) { - var args = arguments; - return updateCursor(this, function (m) { - return m.push.apply(m, args); - }); -} - -IndexedCursorPrototype.pop = function() { - return updateCursor(this, function (m) { - return m.pop(); - }); -} - -IndexedCursorPrototype.unshift = function(/* values */) { - var args = arguments; - return updateCursor(this, function (m) { - return m.unshift.apply(m, args); - }); -} - -IndexedCursorPrototype.shift = function() { - return updateCursor(this, function (m) { - return m.shift(); - }); -} - -IndexedCursorPrototype.setIn = -KeyedCursorPrototype.setIn = Map.prototype.setIn; - -KeyedCursorPrototype.remove = -KeyedCursorPrototype['delete'] = -IndexedCursorPrototype.remove = -IndexedCursorPrototype['delete'] = function(key) { - return updateCursor(this, function (m) { return m.remove(key); }, [key]); -} - -IndexedCursorPrototype.removeIn = -IndexedCursorPrototype.deleteIn = -KeyedCursorPrototype.removeIn = -KeyedCursorPrototype.deleteIn = Map.prototype.deleteIn; - -KeyedCursorPrototype.clear = -IndexedCursorPrototype.clear = function() { - return updateCursor(this, function (m) { return m.clear(); }); -} - -IndexedCursorPrototype.update = -KeyedCursorPrototype.update = function(keyOrFn, notSetValue, updater) { - return arguments.length === 1 ? - updateCursor(this, keyOrFn) : - this.updateIn([keyOrFn], notSetValue, updater); -} - -IndexedCursorPrototype.updateIn = -KeyedCursorPrototype.updateIn = function(keyPath, notSetValue, updater) { - return updateCursor(this, function (m) { - return m.updateIn(keyPath, notSetValue, updater); - }, keyPath); -} - -IndexedCursorPrototype.merge = -KeyedCursorPrototype.merge = function(/*...iters*/) { - var args = arguments; - return updateCursor(this, function (m) { - return m.merge.apply(m, args); - }); -} - -IndexedCursorPrototype.mergeWith = -KeyedCursorPrototype.mergeWith = function(merger/*, ...iters*/) { - var args = arguments; - return updateCursor(this, function (m) { - return m.mergeWith.apply(m, args); - }); -} - -IndexedCursorPrototype.mergeIn = -KeyedCursorPrototype.mergeIn = Map.prototype.mergeIn; - -IndexedCursorPrototype.mergeDeep = -KeyedCursorPrototype.mergeDeep = function(/*...iters*/) { - var args = arguments; - return updateCursor(this, function (m) { - return m.mergeDeep.apply(m, args); - }); -} - -IndexedCursorPrototype.mergeDeepWith = -KeyedCursorPrototype.mergeDeepWith = function(merger/*, ...iters*/) { - var args = arguments; - return updateCursor(this, function (m) { - return m.mergeDeepWith.apply(m, args); - }); -} - -IndexedCursorPrototype.mergeDeepIn = -KeyedCursorPrototype.mergeDeepIn = Map.prototype.mergeDeepIn; - -KeyedCursorPrototype.withMutations = -IndexedCursorPrototype.withMutations = function(fn) { - return updateCursor(this, function (m) { - return (m || Map()).withMutations(fn); - }); -} - -KeyedCursorPrototype.cursor = -IndexedCursorPrototype.cursor = function(subKeyPath) { - subKeyPath = valToKeyPath(subKeyPath); - return subKeyPath.length === 0 ? this : subCursor(this, subKeyPath); -} - -/** - * All iterables need to implement __iterate - */ -KeyedCursorPrototype.__iterate = -IndexedCursorPrototype.__iterate = function(fn, reverse) { - var cursor = this; - var deref = cursor.deref(); - return deref && deref.__iterate ? deref.__iterate( - function (v, k) { return fn(wrappedValue(cursor, [k], v), k, cursor); }, - reverse - ) : 0; -} - -/** - * All iterables need to implement __iterator - */ -KeyedCursorPrototype.__iterator = -IndexedCursorPrototype.__iterator = function(type, reverse) { - var deref = this.deref(); - var cursor = this; - var iterator = deref && deref.__iterator && - deref.__iterator(Iterator.ENTRIES, reverse); - return new Iterator(function () { - if (!iterator) { - return { value: undefined, done: true }; - } - var step = iterator.next(); - if (step.done) { - return step; - } - var entry = step.value; - var k = entry[0]; - var v = wrappedValue(cursor, [k], entry[1]); - return { - value: type === Iterator.KEYS ? k : type === Iterator.VALUES ? v : [k, v], - done: false - }; - }); -} - -KeyedCursor.prototype = KeyedCursorPrototype; -IndexedCursor.prototype = IndexedCursorPrototype; - - -var NOT_SET = {}; // Sentinel value - -function makeCursor(rootData, keyPath, onChange, value) { - if (arguments.length < 4) { - value = rootData.getIn(keyPath); - } - var size = value && value.size; - var CursorClass = Iterable.isIndexed(value) ? IndexedCursor : KeyedCursor; - var cursor = new CursorClass(rootData, keyPath, onChange, size); - - if (value instanceof Record) { - defineRecordProperties(cursor, value); - } - - return cursor; -} - -function defineRecordProperties(cursor, value) { - try { - value._keys.forEach(setProp.bind(undefined, cursor)); - } catch (error) { - // Object.defineProperty failed. Probably IE8. - } -} - -function setProp(prototype, name) { - Object.defineProperty(prototype, name, { - get: function() { - return this.get(name); - }, - set: function(value) { - if (!this.__ownerID) { - throw new Error('Cannot set on an immutable record.'); - } - } - }); -} - -function wrappedValue(cursor, keyPath, value) { - return Iterable.isIterable(value) ? subCursor(cursor, keyPath, value) : value; -} - -function subCursor(cursor, keyPath, value) { - if (arguments.length < 3) { - return makeCursor( // call without value - cursor._rootData, - newKeyPath(cursor._keyPath, keyPath), - cursor._onChange - ); - } - return makeCursor( - cursor._rootData, - newKeyPath(cursor._keyPath, keyPath), - cursor._onChange, - value - ); -} - -function updateCursor(cursor, changeFn, changeKeyPath) { - var deepChange = arguments.length > 2; - var newRootData = cursor._rootData.updateIn( - cursor._keyPath, - deepChange ? Map() : undefined, - changeFn - ); - var keyPath = cursor._keyPath || []; - var result = cursor._onChange && cursor._onChange.call( - undefined, - newRootData, - cursor._rootData, - deepChange ? newKeyPath(keyPath, changeKeyPath) : keyPath - ); - if (result !== undefined) { - newRootData = result; - } - return makeCursor(newRootData, cursor._keyPath, cursor._onChange); -} - -function newKeyPath(head, tail) { - return head.concat(listToKeyPath(tail)); -} - -function listToKeyPath(list) { - return Array.isArray(list) ? list : Immutable.Iterable(list).toArray(); -} - -function valToKeyPath(val) { - return Array.isArray(val) ? val : - Iterable.isIterable(val) ? val.toArray() : - [val]; -} - -exports.from = cursorFrom; diff --git a/dist/immutable-nonambient.d.ts b/dist/immutable-nonambient.d.ts deleted file mode 100644 index 92ec354405..0000000000 --- a/dist/immutable-nonambient.d.ts +++ /dev/null @@ -1,2535 +0,0 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -/** - * Immutable data encourages pure functions (data-in, data-out) and lends itself - * to much simpler application development and enabling techniques from - * functional programming such as lazy evaluation. - * - * While designed to bring these powerful functional concepts to JavaScript, it - * presents an Object-Oriented API familiar to Javascript engineers and closely - * mirroring that of Array, Map, and Set. It is easy and efficient to convert to - * and from plain Javascript types. - - * Note: all examples are presented in [ES6][]. To run in all browsers, they - * need to be translated to ES3. For example: - * - * // ES6 - * foo.map(x => x * x); - * // ES3 - * foo.map(function (x) { return x * x; }); - * - * [ES6]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/New_in_JavaScript/ECMAScript_6_support_in_Mozilla - */ - - - - /** - * Deeply converts plain JS objects and arrays to Immutable Maps and Lists. - * - * If a `reviver` is optionally provided, it will be called with every - * collection as a Seq (beginning with the most nested collections - * and proceeding to the top-level collection itself), along with the key - * refering to each collection and the parent JS object provided as `this`. - * For the top level, object, the key will be `""`. This `reviver` is expected - * to return a new Immutable Iterable, allowing for custom conversions from - * deep JS objects. - * - * This example converts JSON to List and OrderedMap: - * - * Immutable.fromJS({a: {b: [10, 20, 30]}, c: 40}, function (key, value) { - * var isIndexed = Immutable.Iterable.isIndexed(value); - * return isIndexed ? value.toList() : value.toOrderedMap(); - * }); - * - * // true, "b", {b: [10, 20, 30]} - * // false, "a", {a: {b: [10, 20, 30]}, c: 40} - * // false, "", {"": {a: {b: [10, 20, 30]}, c: 40}} - * - * If `reviver` is not provided, the default behavior will convert Arrays into - * Lists and Objects into Maps. - * - * `reviver` acts similarly to the [same parameter in `JSON.parse`][1]. - * - * `Immutable.fromJS` is conservative in its conversion. It will only convert - * arrays which pass `Array.isArray` to Lists, and only raw objects (no custom - * prototype) to Map. - * - * Keep in mind, when using JS objects to construct Immutable Maps, that - * JavaScript Object properties are always strings, even if written in a - * quote-less shorthand, while Immutable Maps accept keys of any type. - * - * ```js - * var obj = { 1: "one" }; - * Object.keys(obj); // [ "1" ] - * obj["1"]; // "one" - * obj[1]; // "one" - * - * var map = Map(obj); - * map.get("1"); // "one" - * map.get(1); // undefined - * ``` - * - * Property access for JavaScript Objects first converts the key to a string, - * but since Immutable Map keys can be of any type the argument to `get()` is - * not altered. - * - * [1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#Example.3A_Using_the_reviver_parameter - * "Using the reviver parameter" - */ - export function fromJS( - json: any, - reviver?: (k: any, v: Iterable) => any - ): any; - - - /** - * Value equality check with semantics similar to `Object.is`, but treats - * Immutable `Iterable`s as values, equal if the second `Iterable` includes - * equivalent values. - * - * It's used throughout Immutable when checking for equality, including `Map` - * key equality and `Set` membership. - * - * var map1 = Immutable.Map({a:1, b:1, c:1}); - * var map2 = Immutable.Map({a:1, b:1, c:1}); - * assert(map1 !== map2); - * assert(Object.is(map1, map2) === false); - * assert(Immutable.is(map1, map2) === true); - * - * Note: Unlike `Object.is`, `Immutable.is` assumes `0` and `-0` are the same - * value, matching the behavior of ES6 Map key equality. - */ - export function is(first: any, second: any): boolean; - - - /** - * Lists are ordered indexed dense collections, much like a JavaScript - * Array. - * - * Lists are immutable and fully persistent with O(log32 N) gets and sets, - * and O(1) push and pop. - * - * Lists implement Deque, with efficient addition and removal from both the - * end (`push`, `pop`) and beginning (`unshift`, `shift`). - * - * Unlike a JavaScript Array, there is no distinction between an - * "unset" index and an index set to `undefined`. `List#forEach` visits all - * indices from 0 to size, regardless of whether they were explicitly defined. - */ - export module List { - - /** - * True if the provided value is a List - */ - function isList(maybeList: any): boolean; - - /** - * Creates a new List containing `values`. - */ - function of(...values: T[]): List; - } - - /** - * Create a new immutable List containing the values of the provided - * iterable-like. - */ - export function List(): List; - export function List(iter: Iterable.Indexed): List; - export function List(iter: Iterable.Set): List; - export function List(iter: Iterable.Keyed): List; - export function List(array: Array): List; - export function List(iterator: Iterator): List; - export function List(iterable: /*Iterable*/Object): List; - - - export interface List extends Collection.Indexed { - - // Persistent changes - - /** - * Returns a new List which includes `value` at `index`. If `index` already - * exists in this List, it will be replaced. - * - * `index` may be a negative number, which indexes back from the end of the - * List. `v.set(-1, "value")` sets the last item in the List. - * - * If `index` larger than `size`, the returned List's `size` will be large - * enough to include the `index`. - */ - set(index: number, value: T): List; - - /** - * Returns a new List which excludes this `index` and with a size 1 less - * than this List. Values at indices above `index` are shifted down by 1 to - * fill the position. - * - * This is synonymous with `list.splice(index, 1)`. - * - * `index` may be a negative number, which indexes back from the end of the - * List. `v.delete(-1)` deletes the last item in the List. - * - * Note: `delete` cannot be safely used in IE8 - * @alias remove - */ - delete(index: number): List; - remove(index: number): List; - - /** - * Returns a new List with `value` at `index` with a size 1 more than this - * List. Values at indices above `index` are shifted over by 1. - * - * This is synonymous with `list.splice(index, 0, value) - */ - insert(index: number, value: T): List; - - /** - * Returns a new List with 0 size and no values. - */ - clear(): List; - - /** - * Returns a new List with the provided `values` appended, starting at this - * List's `size`. - */ - push(...values: T[]): List; - - /** - * Returns a new List with a size ones less than this List, excluding - * the last index in this List. - * - * Note: this differs from `Array#pop` because it returns a new - * List rather than the removed value. Use `last()` to get the last value - * in this List. - */ - pop(): List; - - /** - * Returns a new List with the provided `values` prepended, shifting other - * values ahead to higher indices. - */ - unshift(...values: T[]): List; - - /** - * Returns a new List with a size ones less than this List, excluding - * the first index in this List, shifting all other values to a lower index. - * - * Note: this differs from `Array#shift` because it returns a new - * List rather than the removed value. Use `first()` to get the first - * value in this List. - */ - shift(): List; - - /** - * Returns a new List with an updated value at `index` with the return - * value of calling `updater` with the existing value, or `notSetValue` if - * `index` was not set. If called with a single argument, `updater` is - * called with the List itself. - * - * `index` may be a negative number, which indexes back from the end of the - * List. `v.update(-1)` updates the last item in the List. - * - * @see `Map#update` - */ - update(updater: (value: List) => List): List; - update(index: number, updater: (value: T) => T): List; - update(index: number, notSetValue: T, updater: (value: T) => T): List; - - /** - * @see `Map#merge` - */ - merge(...iterables: Iterable.Indexed[]): List; - merge(...iterables: Array[]): List; - - /** - * @see `Map#mergeWith` - */ - mergeWith( - merger: (previous?: T, next?: T, key?: number) => T, - ...iterables: Iterable.Indexed[] - ): List; - mergeWith( - merger: (previous?: T, next?: T, key?: number) => T, - ...iterables: Array[] - ): List; - - /** - * @see `Map#mergeDeep` - */ - mergeDeep(...iterables: Iterable.Indexed[]): List; - mergeDeep(...iterables: Array[]): List; - - /** - * @see `Map#mergeDeepWith` - */ - mergeDeepWith( - merger: (previous?: T, next?: T, key?: number) => T, - ...iterables: Iterable.Indexed[] - ): List; - mergeDeepWith( - merger: (previous?: T, next?: T, key?: number) => T, - ...iterables: Array[] - ): List; - - /** - * Returns a new List with size `size`. If `size` is less than this - * List's size, the new List will exclude values at the higher indices. - * If `size` is greater than this List's size, the new List will have - * undefined values for the newly available indices. - * - * When building a new List and the final size is known up front, `setSize` - * used in conjunction with `withMutations` may result in the more - * performant construction. - */ - setSize(size: number): List; - - - // Deep persistent changes - - /** - * Returns a new List having set `value` at this `keyPath`. If any keys in - * `keyPath` do not exist, a new immutable Map will be created at that key. - * - * Index numbers are used as keys to determine the path to follow in - * the List. - */ - setIn(keyPath: Array, value: any): List; - setIn(keyPath: Iterable, value: any): List; - - /** - * Returns a new List having removed the value at this `keyPath`. If any - * keys in `keyPath` do not exist, no change will occur. - * - * @alias removeIn - */ - deleteIn(keyPath: Array): List; - deleteIn(keyPath: Iterable): List; - removeIn(keyPath: Array): List; - removeIn(keyPath: Iterable): List; - - /** - * @see `Map#updateIn` - */ - updateIn( - keyPath: Array, - updater: (value: any) => any - ): List; - updateIn( - keyPath: Array, - notSetValue: any, - updater: (value: any) => any - ): List; - updateIn( - keyPath: Iterable, - updater: (value: any) => any - ): List; - updateIn( - keyPath: Iterable, - notSetValue: any, - updater: (value: any) => any - ): List; - - /** - * @see `Map#mergeIn` - */ - mergeIn( - keyPath: Iterable, - ...iterables: Iterable.Indexed[] - ): List; - mergeIn( - keyPath: Array, - ...iterables: Iterable.Indexed[] - ): List; - mergeIn( - keyPath: Array, - ...iterables: Array[] - ): List; - - /** - * @see `Map#mergeDeepIn` - */ - mergeDeepIn( - keyPath: Iterable, - ...iterables: Iterable.Indexed[] - ): List; - mergeDeepIn( - keyPath: Array, - ...iterables: Iterable.Indexed[] - ): List; - mergeDeepIn( - keyPath: Array, - ...iterables: Array[] - ): List; - - - // Transient changes - - /** - * Note: Not all methods can be used on a mutable collection or within - * `withMutations`! Only `set`, `push`, `pop`, `shift`, `unshift` and - * `merge` may be used mutatively. - * - * @see `Map#withMutations` - */ - withMutations(mutator: (mutable: List) => any): List; - - /** - * @see `Map#asMutable` - */ - asMutable(): List; - - /** - * @see `Map#asImmutable` - */ - asImmutable(): List; - } - - - /** - * Immutable Map is an unordered Iterable.Keyed of (key, value) pairs with - * `O(log32 N)` gets and `O(log32 N)` persistent sets. - * - * Iteration order of a Map is undefined, however is stable. Multiple - * iterations of the same Map will iterate in the same order. - * - * Map's keys can be of any type, and use `Immutable.is` to determine key - * equality. This allows the use of any value (including NaN) as a key. - * - * Because `Immutable.is` returns equality based on value semantics, and - * Immutable collections are treated as values, any Immutable collection may - * be used as a key. - * - * Map().set(List.of(1), 'listofone').get(List.of(1)); - * // 'listofone' - * - * Any JavaScript object may be used as a key, however strict identity is used - * to evaluate key equality. Two similar looking objects will represent two - * different keys. - * - * Implemented by a hash-array mapped trie. - */ - export module Map { - - /** - * True if the provided value is a Map - */ - function isMap(maybeMap: any): boolean; - - /** - * Creates a new Map from alternating keys and values - */ - function of(...keyValues: any[]): Map; - } - - /** - * Creates a new Immutable Map. - * - * Created with the same key value pairs as the provided Iterable.Keyed or - * JavaScript Object or expects an Iterable of [K, V] tuple entries. - * - * var newMap = Map({key: "value"}); - * var newMap = Map([["key", "value"]]); - * - * Keep in mind, when using JS objects to construct Immutable Maps, that - * JavaScript Object properties are always strings, even if written in a - * quote-less shorthand, while Immutable Maps accept keys of any type. - * - * ```js - * var obj = { 1: "one" }; - * Object.keys(obj); // [ "1" ] - * obj["1"]; // "one" - * obj[1]; // "one" - * - * var map = Map(obj); - * map.get("1"); // "one" - * map.get(1); // undefined - * ``` - * - * Property access for JavaScript Objects first converts the key to a string, - * but since Immutable Map keys can be of any type the argument to `get()` is - * not altered. - */ - export function Map(): Map; - export function Map(iter: Iterable.Keyed): Map; - export function Map(iter: Iterable>): Map; - export function Map(array: Array>): Map; - export function Map(obj: {[key: string]: V}): Map; - export function Map(iterator: Iterator>): Map; - export function Map(iterable: /*Iterable<[K,V]>*/Object): Map; - - export interface Map extends Collection.Keyed { - - // Persistent changes - - /** - * Returns a new Map also containing the new key, value pair. If an equivalent - * key already exists in this Map, it will be replaced. - */ - set(key: K, value: V): Map; - - /** - * Returns a new Map which excludes this `key`. - * - * Note: `delete` cannot be safely used in IE8, but is provided to mirror - * the ES6 collection API. - * @alias remove - */ - delete(key: K): Map; - remove(key: K): Map; - - /** - * Returns a new Map containing no keys or values. - */ - clear(): Map; - - /** - * Returns a new Map having updated the value at this `key` with the return - * value of calling `updater` with the existing value, or `notSetValue` if - * the key was not set. If called with only a single argument, `updater` is - * called with the Map itself. - * - * Equivalent to: `map.set(key, updater(map.get(key, notSetValue)))`. - */ - update(updater: (value: Map) => Map): Map; - update(key: K, updater: (value: V) => V): Map; - update(key: K, notSetValue: V, updater: (value: V) => V): Map; - - /** - * Returns a new Map resulting from merging the provided Iterables - * (or JS objects) into this Map. In other words, this takes each entry of - * each iterable and sets it on this Map. - * - * If any of the values provided to `merge` are not Iterable (would return - * false for `Immutable.Iterable.isIterable`) then they are deeply converted - * via `Immutable.fromJS` before being merged. However, if the value is an - * Iterable but includes non-iterable JS objects or arrays, those nested - * values will be preserved. - * - * var x = Immutable.Map({a: 10, b: 20, c: 30}); - * var y = Immutable.Map({b: 40, a: 50, d: 60}); - * x.merge(y) // { a: 50, b: 40, c: 30, d: 60 } - * y.merge(x) // { b: 20, a: 10, d: 60, c: 30 } - * - */ - merge(...iterables: Iterable[]): Map; - merge(...iterables: {[key: string]: V}[]): Map; - - /** - * Like `merge()`, `mergeWith()` returns a new Map resulting from merging - * the provided Iterables (or JS objects) into this Map, but uses the - * `merger` function for dealing with conflicts. - * - * var x = Immutable.Map({a: 10, b: 20, c: 30}); - * var y = Immutable.Map({b: 40, a: 50, d: 60}); - * x.mergeWith((prev, next) => prev / next, y) // { a: 0.2, b: 0.5, c: 30, d: 60 } - * y.mergeWith((prev, next) => prev / next, x) // { b: 2, a: 5, d: 60, c: 30 } - * - */ - mergeWith( - merger: (previous?: V, next?: V, key?: K) => V, - ...iterables: Iterable[] - ): Map; - mergeWith( - merger: (previous?: V, next?: V, key?: K) => V, - ...iterables: {[key: string]: V}[] - ): Map; - - /** - * Like `merge()`, but when two Iterables conflict, it merges them as well, - * recursing deeply through the nested data. - * - * var x = Immutable.fromJS({a: { x: 10, y: 10 }, b: { x: 20, y: 50 } }); - * var y = Immutable.fromJS({a: { x: 2 }, b: { y: 5 }, c: { z: 3 } }); - * x.mergeDeep(y) // {a: { x: 2, y: 10 }, b: { x: 20, y: 5 }, c: { z: 3 } } - * - */ - mergeDeep(...iterables: Iterable[]): Map; - mergeDeep(...iterables: {[key: string]: V}[]): Map; - - /** - * Like `mergeDeep()`, but when two non-Iterables conflict, it uses the - * `merger` function to determine the resulting value. - * - * var x = Immutable.fromJS({a: { x: 10, y: 10 }, b: { x: 20, y: 50 } }); - * var y = Immutable.fromJS({a: { x: 2 }, b: { y: 5 }, c: { z: 3 } }); - * x.mergeDeepWith((prev, next) => prev / next, y) - * // {a: { x: 5, y: 10 }, b: { x: 20, y: 10 }, c: { z: 3 } } - * - */ - mergeDeepWith( - merger: (previous?: V, next?: V, key?: K) => V, - ...iterables: Iterable[] - ): Map; - mergeDeepWith( - merger: (previous?: V, next?: V, key?: K) => V, - ...iterables: {[key: string]: V}[] - ): Map; - - - // Deep persistent changes - - /** - * Returns a new Map having set `value` at this `keyPath`. If any keys in - * `keyPath` do not exist, a new immutable Map will be created at that key. - */ - setIn(keyPath: Array, value: any): Map; - setIn(KeyPath: Iterable, value: any): Map; - - /** - * Returns a new Map having removed the value at this `keyPath`. If any keys - * in `keyPath` do not exist, no change will occur. - * - * @alias removeIn - */ - deleteIn(keyPath: Array): Map; - deleteIn(keyPath: Iterable): Map; - removeIn(keyPath: Array): Map; - removeIn(keyPath: Iterable): Map; - - /** - * Returns a new Map having applied the `updater` to the entry found at the - * keyPath. - * - * If any keys in `keyPath` do not exist, new Immutable `Map`s will - * be created at those keys. If the `keyPath` does not already contain a - * value, the `updater` function will be called with `notSetValue`, if - * provided, otherwise `undefined`. - * - * var data = Immutable.fromJS({ a: { b: { c: 10 } } }); - * data = data.updateIn(['a', 'b', 'c'], val => val * 2); - * // { a: { b: { c: 20 } } } - * - * If the `updater` function returns the same value it was called with, then - * no change will occur. This is still true if `notSetValue` is provided. - * - * var data1 = Immutable.fromJS({ a: { b: { c: 10 } } }); - * data2 = data1.updateIn(['x', 'y', 'z'], 100, val => val); - * assert(data2 === data1); - * - */ - updateIn( - keyPath: Array, - updater: (value: any) => any - ): Map; - updateIn( - keyPath: Array, - notSetValue: any, - updater: (value: any) => any - ): Map; - updateIn( - keyPath: Iterable, - updater: (value: any) => any - ): Map; - updateIn( - keyPath: Iterable, - notSetValue: any, - updater: (value: any) => any - ): Map; - - /** - * A combination of `updateIn` and `merge`, returning a new Map, but - * performing the merge at a point arrived at by following the keyPath. - * In other words, these two lines are equivalent: - * - * x.updateIn(['a', 'b', 'c'], abc => abc.merge(y)); - * x.mergeIn(['a', 'b', 'c'], y); - * - */ - mergeIn( - keyPath: Iterable, - ...iterables: Iterable[] - ): Map; - mergeIn( - keyPath: Array, - ...iterables: Iterable[] - ): Map; - mergeIn( - keyPath: Array, - ...iterables: {[key: string]: V}[] - ): Map; - - /** - * A combination of `updateIn` and `mergeDeep`, returning a new Map, but - * performing the deep merge at a point arrived at by following the keyPath. - * In other words, these two lines are equivalent: - * - * x.updateIn(['a', 'b', 'c'], abc => abc.mergeDeep(y)); - * x.mergeDeepIn(['a', 'b', 'c'], y); - * - */ - mergeDeepIn( - keyPath: Iterable, - ...iterables: Iterable[] - ): Map; - mergeDeepIn( - keyPath: Array, - ...iterables: Iterable[] - ): Map; - mergeDeepIn( - keyPath: Array, - ...iterables: {[key: string]: V}[] - ): Map; - - - // Transient changes - - /** - * Every time you call one of the above functions, a new immutable Map is - * created. If a pure function calls a number of these to produce a final - * return value, then a penalty on performance and memory has been paid by - * creating all of the intermediate immutable Maps. - * - * If you need to apply a series of mutations to produce a new immutable - * Map, `withMutations()` creates a temporary mutable copy of the Map which - * can apply mutations in a highly performant manner. In fact, this is - * exactly how complex mutations like `merge` are done. - * - * As an example, this results in the creation of 2, not 4, new Maps: - * - * var map1 = Immutable.Map(); - * var map2 = map1.withMutations(map => { - * map.set('a', 1).set('b', 2).set('c', 3); - * }); - * assert(map1.size === 0); - * assert(map2.size === 3); - * - * Note: Not all methods can be used on a mutable collection or within - * `withMutations`! Only `set` and `merge` may be used mutatively. - * - */ - withMutations(mutator: (mutable: Map) => any): Map; - - /** - * Another way to avoid creation of intermediate Immutable maps is to create - * a mutable copy of this collection. Mutable copies *always* return `this`, - * and thus shouldn't be used for equality. Your function should never return - * a mutable copy of a collection, only use it internally to create a new - * collection. If possible, use `withMutations` as it provides an easier to - * use API. - * - * Note: if the collection is already mutable, `asMutable` returns itself. - * - * Note: Not all methods can be used on a mutable collection or within - * `withMutations`! Only `set` and `merge` may be used mutatively. - */ - asMutable(): Map; - - /** - * The yin to `asMutable`'s yang. Because it applies to mutable collections, - * this operation is *mutable* and returns itself. Once performed, the mutable - * copy has become immutable and can be safely returned from a function. - */ - asImmutable(): Map; - } - - - /** - * A type of Map that has the additional guarantee that the iteration order of - * entries will be the order in which they were set(). - * - * The iteration behavior of OrderedMap is the same as native ES6 Map and - * JavaScript Object. - * - * Note that `OrderedMap` are more expensive than non-ordered `Map` and may - * consume more memory. `OrderedMap#set` is amortized O(log32 N), but not - * stable. - */ - - export module OrderedMap { - - /** - * True if the provided value is an OrderedMap. - */ - function isOrderedMap(maybeOrderedMap: any): boolean; - } - - /** - * Creates a new Immutable OrderedMap. - * - * Created with the same key value pairs as the provided Iterable.Keyed or - * JavaScript Object or expects an Iterable of [K, V] tuple entries. - * - * The iteration order of key-value pairs provided to this constructor will - * be preserved in the OrderedMap. - * - * var newOrderedMap = OrderedMap({key: "value"}); - * var newOrderedMap = OrderedMap([["key", "value"]]); - * - */ - export function OrderedMap(): OrderedMap; - export function OrderedMap(iter: Iterable.Keyed): OrderedMap; - export function OrderedMap(iter: Iterable>): OrderedMap; - export function OrderedMap(array: Array>): OrderedMap; - export function OrderedMap(obj: {[key: string]: V}): OrderedMap; - export function OrderedMap(iterator: Iterator>): OrderedMap; - export function OrderedMap(iterable: /*Iterable<[K,V]>*/Object): OrderedMap; - - export interface OrderedMap extends Map {} - - - /** - * A Collection of unique values with `O(log32 N)` adds and has. - * - * When iterating a Set, the entries will be (value, value) pairs. Iteration - * order of a Set is undefined, however is stable. Multiple iterations of the - * same Set will iterate in the same order. - * - * Set values, like Map keys, may be of any type. Equality is determined using - * `Immutable.is`, enabling Sets to uniquely include other Immutable - * collections, custom value types, and NaN. - */ - export module Set { - - /** - * True if the provided value is a Set - */ - function isSet(maybeSet: any): boolean; - - /** - * Creates a new Set containing `values`. - */ - function of(...values: T[]): Set; - - /** - * `Set.fromKeys()` creates a new immutable Set containing the keys from - * this Iterable or JavaScript Object. - */ - function fromKeys(iter: Iterable): Set; - function fromKeys(obj: {[key: string]: any}): Set; - } - - /** - * Create a new immutable Set containing the values of the provided - * iterable-like. - */ - export function Set(): Set; - export function Set(iter: Iterable.Set): Set; - export function Set(iter: Iterable.Indexed): Set; - export function Set(iter: Iterable.Keyed): Set; - export function Set(array: Array): Set; - export function Set(iterator: Iterator): Set; - export function Set(iterable: /*Iterable*/Object): Set; - - export interface Set extends Collection.Set { - - // Persistent changes - - /** - * Returns a new Set which also includes this value. - */ - add(value: T): Set; - - /** - * Returns a new Set which excludes this value. - * - * Note: `delete` cannot be safely used in IE8 - * @alias remove - */ - delete(value: T): Set; - remove(value: T): Set; - - /** - * Returns a new Set containing no values. - */ - clear(): Set; - - /** - * Returns a Set including any value from `iterables` that does not already - * exist in this Set. - * @alias merge - */ - union(...iterables: Iterable[]): Set; - union(...iterables: Array[]): Set; - merge(...iterables: Iterable[]): Set; - merge(...iterables: Array[]): Set; - - - /** - * Returns a Set which has removed any values not also contained - * within `iterables`. - */ - intersect(...iterables: Iterable[]): Set; - intersect(...iterables: Array[]): Set; - - /** - * Returns a Set excluding any values contained within `iterables`. - */ - subtract(...iterables: Iterable[]): Set; - subtract(...iterables: Array[]): Set; - - - // Transient changes - - /** - * Note: Not all methods can be used on a mutable collection or within - * `withMutations`! Only `add` may be used mutatively. - * - * @see `Map#withMutations` - */ - withMutations(mutator: (mutable: Set) => any): Set; - - /** - * @see `Map#asMutable` - */ - asMutable(): Set; - - /** - * @see `Map#asImmutable` - */ - asImmutable(): Set; - } - - - /** - * A type of Set that has the additional guarantee that the iteration order of - * values will be the order in which they were `add`ed. - * - * The iteration behavior of OrderedSet is the same as native ES6 Set. - * - * Note that `OrderedSet` are more expensive than non-ordered `Set` and may - * consume more memory. `OrderedSet#add` is amortized O(log32 N), but not - * stable. - */ - export module OrderedSet { - - /** - * True if the provided value is an OrderedSet. - */ - function isOrderedSet(maybeOrderedSet: any): boolean; - - /** - * Creates a new OrderedSet containing `values`. - */ - function of(...values: T[]): OrderedSet; - - /** - * `OrderedSet.fromKeys()` creates a new immutable OrderedSet containing - * the keys from this Iterable or JavaScript Object. - */ - function fromKeys(iter: Iterable): OrderedSet; - function fromKeys(obj: {[key: string]: any}): OrderedSet; - } - - /** - * Create a new immutable OrderedSet containing the values of the provided - * iterable-like. - */ - export function OrderedSet(): OrderedSet; - export function OrderedSet(iter: Iterable.Set): OrderedSet; - export function OrderedSet(iter: Iterable.Indexed): OrderedSet; - export function OrderedSet(iter: Iterable.Keyed): OrderedSet; - export function OrderedSet(array: Array): OrderedSet; - export function OrderedSet(iterator: Iterator): OrderedSet; - export function OrderedSet(iterable: /*Iterable*/Object): OrderedSet; - - export interface OrderedSet extends Set {} - - - /** - * Stacks are indexed collections which support very efficient O(1) addition - * and removal from the front using `unshift(v)` and `shift()`. - * - * For familiarity, Stack also provides `push(v)`, `pop()`, and `peek()`, but - * be aware that they also operate on the front of the list, unlike List or - * a JavaScript Array. - * - * Note: `reverse()` or any inherent reverse traversal (`reduceRight`, - * `lastIndexOf`, etc.) is not efficient with a Stack. - * - * Stack is implemented with a Single-Linked List. - */ - export module Stack { - - /** - * True if the provided value is a Stack - */ - function isStack(maybeStack: any): boolean; - - /** - * Creates a new Stack containing `values`. - */ - function of(...values: T[]): Stack; - } - - /** - * Create a new immutable Stack containing the values of the provided - * iterable-like. - * - * The iteration order of the provided iterable is preserved in the - * resulting `Stack`. - */ - export function Stack(): Stack; - export function Stack(iter: Iterable.Indexed): Stack; - export function Stack(iter: Iterable.Set): Stack; - export function Stack(iter: Iterable.Keyed): Stack; - export function Stack(array: Array): Stack; - export function Stack(iterator: Iterator): Stack; - export function Stack(iterable: /*Iterable*/Object): Stack; - - export interface Stack extends Collection.Indexed { - - // Reading values - - /** - * Alias for `Stack.first()`. - */ - peek(): T; - - - // Persistent changes - - /** - * Returns a new Stack with 0 size and no values. - */ - clear(): Stack; - - /** - * Returns a new Stack with the provided `values` prepended, shifting other - * values ahead to higher indices. - * - * This is very efficient for Stack. - */ - unshift(...values: T[]): Stack; - - /** - * Like `Stack#unshift`, but accepts a iterable rather than varargs. - */ - unshiftAll(iter: Iterable): Stack; - unshiftAll(iter: Array): Stack; - - /** - * Returns a new Stack with a size ones less than this Stack, excluding - * the first item in this Stack, shifting all other values to a lower index. - * - * Note: this differs from `Array#shift` because it returns a new - * Stack rather than the removed value. Use `first()` or `peek()` to get the - * first value in this Stack. - */ - shift(): Stack; - - /** - * Alias for `Stack#unshift` and is not equivalent to `List#push`. - */ - push(...values: T[]): Stack; - - /** - * Alias for `Stack#unshiftAll`. - */ - pushAll(iter: Iterable): Stack; - pushAll(iter: Array): Stack; - - /** - * Alias for `Stack#shift` and is not equivalent to `List#pop`. - */ - pop(): Stack; - - - // Transient changes - - /** - * Note: Not all methods can be used on a mutable collection or within - * `withMutations`! Only `set`, `push`, and `pop` may be used mutatively. - * - * @see `Map#withMutations` - */ - withMutations(mutator: (mutable: Stack) => any): Stack; - - /** - * @see `Map#asMutable` - */ - asMutable(): Stack; - - /** - * @see `Map#asImmutable` - */ - asImmutable(): Stack; - } - - - /** - * Returns a Seq.Indexed of numbers from `start` (inclusive) to `end` - * (exclusive), by `step`, where `start` defaults to 0, `step` to 1, and `end` to - * infinity. When `start` is equal to `end`, returns empty range. - * - * Range() // [0,1,2,3,...] - * Range(10) // [10,11,12,13,...] - * Range(10,15) // [10,11,12,13,14] - * Range(10,30,5) // [10,15,20,25] - * Range(30,10,5) // [30,25,20,15] - * Range(30,30,5) // [] - * - */ - export function Range(start?: number, end?: number, step?: number): Seq.Indexed; - - - /** - * Returns a Seq.Indexed of `value` repeated `times` times. When `times` is - * not defined, returns an infinite `Seq` of `value`. - * - * Repeat('foo') // ['foo','foo','foo',...] - * Repeat('bar',4) // ['bar','bar','bar','bar'] - * - */ - export function Repeat(value: T, times?: number): Seq.Indexed; - - - /** - * Creates a new Class which produces Record instances. A record is similar to - * a JS object, but enforce a specific set of allowed string keys, and have - * default values. - * - * var ABRecord = Record({a:1, b:2}) - * var myRecord = new ABRecord({b:3}) - * - * Records always have a value for the keys they define. `remove`ing a key - * from a record simply resets it to the default value for that key. - * - * myRecord.size // 2 - * myRecord.get('a') // 1 - * myRecord.get('b') // 3 - * myRecordWithoutB = myRecord.remove('b') - * myRecordWithoutB.get('b') // 2 - * myRecordWithoutB.size // 2 - * - * Values provided to the constructor not found in the Record type will - * be ignored. For example, in this case, ABRecord is provided a key "x" even - * though only "a" and "b" have been defined. The value for "x" will be - * ignored for this record. - * - * var myRecord = new ABRecord({b:3, x:10}) - * myRecord.get('x') // undefined - * - * Because Records have a known set of string keys, property get access works - * as expected, however property sets will throw an Error. - * - * Note: IE8 does not support property access. Only use `get()` when - * supporting IE8. - * - * myRecord.b // 3 - * myRecord.b = 5 // throws Error - * - * Record Classes can be extended as well, allowing for custom methods on your - * Record. This is not a common pattern in functional environments, but is in - * many JS programs. - * - * Note: TypeScript does not support this type of subclassing. - * - * class ABRecord extends Record({a:1,b:2}) { - * getAB() { - * return this.a + this.b; - * } - * } - * - * var myRecord = new ABRecord({b: 3}) - * myRecord.getAB() // 4 - * - */ - export module Record { - export interface Class { - new (): Map; - new (values: {[key: string]: any}): Map; - new (values: Iterable): Map; // deprecated - - (): Map; - (values: {[key: string]: any}): Map; - (values: Iterable): Map; // deprecated - } - } - - export function Record( - defaultValues: {[key: string]: any}, name?: string - ): Record.Class; - - - /** - * Represents a sequence of values, but may not be backed by a concrete data - * structure. - * - * **Seq is immutable** — Once a Seq is created, it cannot be - * changed, appended to, rearranged or otherwise modified. Instead, any - * mutative method called on a `Seq` will return a new `Seq`. - * - * **Seq is lazy** — Seq does as little work as necessary to respond to any - * method call. Values are often created during iteration, including implicit - * iteration when reducing or converting to a concrete data structure such as - * a `List` or JavaScript `Array`. - * - * For example, the following performs no work, because the resulting - * Seq's values are never iterated: - * - * var oddSquares = Immutable.Seq.of(1,2,3,4,5,6,7,8) - * .filter(x => x % 2).map(x => x * x); - * - * Once the Seq is used, it performs only the work necessary. In this - * example, no intermediate data structures are ever created, filter is only - * called three times, and map is only called once: - * - * console.log(oddSquares.get(1)); // 9 - * - * Seq allows for the efficient chaining of operations, - * allowing for the expression of logic that can otherwise be very tedious: - * - * Immutable.Seq({a:1, b:1, c:1}) - * .flip().map(key => key.toUpperCase()).flip().toObject(); - * // Map { A: 1, B: 1, C: 1 } - * - * As well as expressing logic that would otherwise be memory or time limited: - * - * Immutable.Range(1, Infinity) - * .skip(1000) - * .map(n => -n) - * .filter(n => n % 2 === 0) - * .take(2) - * .reduce((r, n) => r * n, 1); - * // 1006008 - * - * Seq is often used to provide a rich collection API to JavaScript Object. - * - * Immutable.Seq({ x: 0, y: 1, z: 2 }).map(v => v * 2).toObject(); - * // { x: 0, y: 2, z: 4 } - */ - - export module Seq { - /** - * True if `maybeSeq` is a Seq, it is not backed by a concrete - * structure such as Map, List, or Set. - */ - function isSeq(maybeSeq: any): boolean; - - /** - * Returns a Seq of the values provided. Alias for `Seq.Indexed.of()`. - */ - function of(...values: T[]): Seq.Indexed; - - - /** - * `Seq` which represents key-value pairs. - */ - export module Keyed {} - - /** - * Always returns a Seq.Keyed, if input is not keyed, expects an - * iterable of [K, V] tuples. - */ - export function Keyed(): Seq.Keyed; - export function Keyed(seq: Iterable.Keyed): Seq.Keyed; - export function Keyed(seq: Iterable): Seq.Keyed; - export function Keyed(array: Array): Seq.Keyed; - export function Keyed(obj: {[key: string]: V}): Seq.Keyed; - export function Keyed(iterator: Iterator): Seq.Keyed; - export function Keyed(iterable: /*Iterable<[K,V]>*/Object): Seq.Keyed; - - export interface Keyed extends Seq, Iterable.Keyed { - - /** - * Returns itself - */ - toSeq(): /*this*/Seq.Keyed - } - - - /** - * `Seq` which represents an ordered indexed list of values. - */ - module Indexed { - - /** - * Provides an Seq.Indexed of the values provided. - */ - function of(...values: T[]): Seq.Indexed; - } - - /** - * Always returns Seq.Indexed, discarding associated keys and - * supplying incrementing indices. - */ - export function Indexed(): Seq.Indexed; - export function Indexed(seq: Iterable.Indexed): Seq.Indexed; - export function Indexed(seq: Iterable.Set): Seq.Indexed; - export function Indexed(seq: Iterable.Keyed): Seq.Indexed; - export function Indexed(array: Array): Seq.Indexed; - export function Indexed(iterator: Iterator): Seq.Indexed; - export function Indexed(iterable: /*Iterable*/Object): Seq.Indexed; - - export interface Indexed extends Seq, Iterable.Indexed { - - /** - * Returns itself - */ - toSeq(): /*this*/Seq.Indexed - } - - - /** - * `Seq` which represents a set of values. - * - * Because `Seq` are often lazy, `Seq.Set` does not provide the same guarantee - * of value uniqueness as the concrete `Set`. - */ - export module Set { - - /** - * Returns a Seq.Set of the provided values - */ - function of(...values: T[]): Seq.Set; - } - - /** - * Always returns a Seq.Set, discarding associated indices or keys. - */ - export function Set(): Seq.Set; - export function Set(seq: Iterable.Set): Seq.Set; - export function Set(seq: Iterable.Indexed): Seq.Set; - export function Set(seq: Iterable.Keyed): Seq.Set; - export function Set(array: Array): Seq.Set; - export function Set(iterator: Iterator): Seq.Set; - export function Set(iterable: /*Iterable*/Object): Seq.Set; - - export interface Set extends Seq, Iterable.Set { - - /** - * Returns itself - */ - toSeq(): /*this*/Seq.Set - } - - } - - /** - * Creates a Seq. - * - * Returns a particular kind of `Seq` based on the input. - * - * * If a `Seq`, that same `Seq`. - * * If an `Iterable`, a `Seq` of the same kind (Keyed, Indexed, or Set). - * * If an Array-like, an `Seq.Indexed`. - * * If an Object with an Iterator, an `Seq.Indexed`. - * * If an Iterator, an `Seq.Indexed`. - * * If an Object, a `Seq.Keyed`. - * - */ - export function Seq(): Seq; - export function Seq(seq: Seq): Seq; - export function Seq(iterable: Iterable): Seq; - export function Seq(array: Array): Seq.Indexed; - export function Seq(obj: {[key: string]: V}): Seq.Keyed; - export function Seq(iterator: Iterator): Seq.Indexed; - export function Seq(iterable: /*ES6Iterable*/Object): Seq.Indexed; - - export interface Seq extends Iterable { - - /** - * Some Seqs can describe their size lazily. When this is the case, - * size will be an integer. Otherwise it will be undefined. - * - * For example, Seqs returned from `map()` or `reverse()` - * preserve the size of the original `Seq` while `filter()` does not. - * - * Note: `Range`, `Repeat` and `Seq`s made from `Array`s and `Object`s will - * always have a size. - */ - size: number/*?*/; - - - // Force evaluation - - /** - * Because Sequences are lazy and designed to be chained together, they do - * not cache their results. For example, this map function is called a total - * of 6 times, as each `join` iterates the Seq of three values. - * - * var squares = Seq.of(1,2,3).map(x => x * x); - * squares.join() + squares.join(); - * - * If you know a `Seq` will be used multiple times, it may be more - * efficient to first cache it in memory. Here, the map function is called - * only 3 times. - * - * var squares = Seq.of(1,2,3).map(x => x * x).cacheResult(); - * squares.join() + squares.join(); - * - * Use this method judiciously, as it must fully evaluate a Seq which can be - * a burden on memory and possibly performance. - * - * Note: after calling `cacheResult`, a Seq will always have a `size`. - */ - cacheResult(): /*this*/Seq; - } - - /** - * The `Iterable` is a set of (key, value) entries which can be iterated, and - * is the base class for all collections in `immutable`, allowing them to - * make use of all the Iterable methods (such as `map` and `filter`). - * - * Note: An iterable is always iterated in the same order, however that order - * may not always be well defined, as is the case for the `Map` and `Set`. - */ - export module Iterable { - /** - * True if `maybeIterable` is an Iterable, or any of its subclasses. - */ - function isIterable(maybeIterable: any): boolean; - - /** - * True if `maybeKeyed` is an Iterable.Keyed, or any of its subclasses. - */ - function isKeyed(maybeKeyed: any): boolean; - - /** - * True if `maybeIndexed` is a Iterable.Indexed, or any of its subclasses. - */ - function isIndexed(maybeIndexed: any): boolean; - - /** - * True if `maybeAssociative` is either a keyed or indexed Iterable. - */ - function isAssociative(maybeAssociative: any): boolean; - - /** - * True if `maybeOrdered` is an Iterable where iteration order is well - * defined. True for Iterable.Indexed as well as OrderedMap and OrderedSet. - */ - function isOrdered(maybeOrdered: any): boolean; - - - /** - * Keyed Iterables have discrete keys tied to each value. - * - * When iterating `Iterable.Keyed`, each iteration will yield a `[K, V]` - * tuple, in other words, `Iterable#entries` is the default iterator for - * Keyed Iterables. - */ - export module Keyed {} - - /** - * Creates an Iterable.Keyed - * - * Similar to `Iterable()`, however it expects iterable-likes of [K, V] - * tuples if not constructed from a Iterable.Keyed or JS Object. - */ - export function Keyed(iter: Iterable.Keyed): Iterable.Keyed; - export function Keyed(iter: Iterable): Iterable.Keyed; - export function Keyed(array: Array): Iterable.Keyed; - export function Keyed(obj: {[key: string]: V}): Iterable.Keyed; - export function Keyed(iterator: Iterator): Iterable.Keyed; - export function Keyed(iterable: /*Iterable<[K,V]>*/Object): Iterable.Keyed; - - export interface Keyed extends Iterable { - - /** - * Returns Seq.Keyed. - * @override - */ - toSeq(): Seq.Keyed; - - - // Sequence functions - - /** - * Returns a new Iterable.Keyed of the same type where the keys and values - * have been flipped. - * - * Seq({ a: 'z', b: 'y' }).flip() // { z: 'a', y: 'b' } - * - */ - flip(): /*this*/Iterable.Keyed; - - /** - * Returns a new Iterable.Keyed of the same type with keys passed through - * a `mapper` function. - * - * Seq({ a: 1, b: 2 }) - * .mapKeys(x => x.toUpperCase()) - * // Seq { A: 1, B: 2 } - * - */ - mapKeys( - mapper: (key?: K, value?: V, iter?: /*this*/Iterable.Keyed) => M, - context?: any - ): /*this*/Iterable.Keyed; - - /** - * Returns a new Iterable.Keyed of the same type with entries - * ([key, value] tuples) passed through a `mapper` function. - * - * Seq({ a: 1, b: 2 }) - * .mapEntries(([k, v]) => [k.toUpperCase(), v * 2]) - * // Seq { A: 2, B: 4 } - * - */ - mapEntries( - mapper: ( - entry?: /*(K, V)*/Array, - index?: number, - iter?: /*this*/Iterable.Keyed - ) => /*[KM, VM]*/Array, - context?: any - ): /*this*/Iterable.Keyed; - } - - - /** - * Indexed Iterables have incrementing numeric keys. They exhibit - * slightly different behavior than `Iterable.Keyed` for some methods in order - * to better mirror the behavior of JavaScript's `Array`, and add methods - * which do not make sense on non-indexed Iterables such as `indexOf`. - * - * Unlike JavaScript arrays, `Iterable.Indexed`s are always dense. "Unset" - * indices and `undefined` indices are indistinguishable, and all indices from - * 0 to `size` are visited when iterated. - * - * All Iterable.Indexed methods return re-indexed Iterables. In other words, - * indices always start at 0 and increment until size. If you wish to - * preserve indices, using them as keys, convert to a Iterable.Keyed by - * calling `toKeyedSeq`. - */ - export module Indexed {} - - /** - * Creates a new Iterable.Indexed. - */ - export function Indexed(iter: Iterable.Indexed): Iterable.Indexed; - export function Indexed(iter: Iterable.Set): Iterable.Indexed; - export function Indexed(iter: Iterable.Keyed): Iterable.Indexed; - export function Indexed(array: Array): Iterable.Indexed; - export function Indexed(iterator: Iterator): Iterable.Indexed; - export function Indexed(iterable: /*Iterable*/Object): Iterable.Indexed; - - export interface Indexed extends Iterable { - - // Reading values - - /** - * Returns the value associated with the provided index, or notSetValue if - * the index is beyond the bounds of the Iterable. - * - * `index` may be a negative number, which indexes back from the end of the - * Iterable. `s.get(-1)` gets the last item in the Iterable. - */ - get(index: number, notSetValue?: T): T; - - - // Conversion to Seq - - /** - * Returns Seq.Indexed. - * @override - */ - toSeq(): Seq.Indexed; - - /** - * If this is an iterable of [key, value] entry tuples, it will return a - * Seq.Keyed of those entries. - */ - fromEntrySeq(): Seq.Keyed; - - - // Combination - - /** - * Returns an Iterable of the same type with `separator` between each item - * in this Iterable. - */ - interpose(separator: T): /*this*/Iterable.Indexed; - - /** - * Returns an Iterable of the same type with the provided `iterables` - * interleaved into this iterable. - * - * The resulting Iterable includes the first item from each, then the - * second from each, etc. - * - * I.Seq.of(1,2,3).interleave(I.Seq.of('A','B','C')) - * // Seq [ 1, 'A', 2, 'B', 3, 'C' ] - * - * The shortest Iterable stops interleave. - * - * I.Seq.of(1,2,3).interleave( - * I.Seq.of('A','B'), - * I.Seq.of('X','Y','Z') - * ) - * // Seq [ 1, 'A', 'X', 2, 'B', 'Y' ] - */ - interleave(...iterables: Array>): /*this*/Iterable.Indexed; - - /** - * Splice returns a new indexed Iterable by replacing a region of this - * Iterable with new values. If values are not provided, it only skips the - * region to be removed. - * - * `index` may be a negative number, which indexes back from the end of the - * Iterable. `s.splice(-2)` splices after the second to last item. - * - * Seq(['a','b','c','d']).splice(1, 2, 'q', 'r', 's') - * // Seq ['a', 'q', 'r', 's', 'd'] - * - */ - splice( - index: number, - removeNum: number, - ...values: /*Array | T>*/any[] - ): /*this*/Iterable.Indexed; - - /** - * Returns an Iterable of the same type "zipped" with the provided - * iterables. - * - * Like `zipWith`, but using the default `zipper`: creating an `Array`. - * - * var a = Seq.of(1, 2, 3); - * var b = Seq.of(4, 5, 6); - * var c = a.zip(b); // Seq [ [ 1, 4 ], [ 2, 5 ], [ 3, 6 ] ] - * - */ - zip(...iterables: Array>): /*this*/Iterable.Indexed; - - /** - * Returns an Iterable of the same type "zipped" with the provided - * iterables by using a custom `zipper` function. - * - * var a = Seq.of(1, 2, 3); - * var b = Seq.of(4, 5, 6); - * var c = a.zipWith((a, b) => a + b, b); // Seq [ 5, 7, 9 ] - * - */ - zipWith( - zipper: (value: T, otherValue: U) => Z, - otherIterable: Iterable - ): Iterable.Indexed; - zipWith( - zipper: (value: T, otherValue: U, thirdValue: V) => Z, - otherIterable: Iterable, - thirdIterable: Iterable - ): Iterable.Indexed; - zipWith( - zipper: (...any: Array) => Z, - ...iterables: Array> - ): Iterable.Indexed; - - - // Search for value - - /** - * Returns the first index at which a given value can be found in the - * Iterable, or -1 if it is not present. - */ - indexOf(searchValue: T): number; - - /** - * Returns the last index at which a given value can be found in the - * Iterable, or -1 if it is not present. - */ - lastIndexOf(searchValue: T): number; - - /** - * Returns the first index in the Iterable where a value satisfies the - * provided predicate function. Otherwise -1 is returned. - */ - findIndex( - predicate: (value?: T, index?: number, iter?: /*this*/Iterable.Indexed) => boolean, - context?: any - ): number; - - /** - * Returns the last index in the Iterable where a value satisfies the - * provided predicate function. Otherwise -1 is returned. - */ - findLastIndex( - predicate: (value?: T, index?: number, iter?: /*this*/Iterable.Indexed) => boolean, - context?: any - ): number; - } - - - /** - * Set Iterables only represent values. They have no associated keys or - * indices. Duplicate values are possible in Seq.Sets, however the - * concrete `Set` does not allow duplicate values. - * - * Iterable methods on Iterable.Set such as `map` and `forEach` will provide - * the value as both the first and second arguments to the provided function. - * - * var seq = Seq.Set.of('A', 'B', 'C'); - * assert.equal(seq.every((v, k) => v === k), true); - * - */ - export module Set {} - - /** - * Similar to `Iterable()`, but always returns a Iterable.Set. - */ - export function Set(iter: Iterable.Set): Iterable.Set; - export function Set(iter: Iterable.Indexed): Iterable.Set; - export function Set(iter: Iterable.Keyed): Iterable.Set; - export function Set(array: Array): Iterable.Set; - export function Set(iterator: Iterator): Iterable.Set; - export function Set(iterable: /*Iterable*/Object): Iterable.Set; - - export interface Set extends Iterable { - - /** - * Returns Seq.Set. - * @override - */ - toSeq(): Seq.Set; - } - - } - - /** - * Creates an Iterable. - * - * The type of Iterable created is based on the input. - * - * * If an `Iterable`, that same `Iterable`. - * * If an Array-like, an `Iterable.Indexed`. - * * If an Object with an Iterator, an `Iterable.Indexed`. - * * If an Iterator, an `Iterable.Indexed`. - * * If an Object, an `Iterable.Keyed`. - * - * This methods forces the conversion of Objects and Strings to Iterables. - * If you want to ensure that a Iterable of one item is returned, use - * `Seq.of`. - */ - export function Iterable(iterable: Iterable): Iterable; - export function Iterable(array: Array): Iterable.Indexed; - export function Iterable(obj: {[key: string]: V}): Iterable.Keyed; - export function Iterable(iterator: Iterator): Iterable.Indexed; - export function Iterable(iterable: /*ES6Iterable*/Object): Iterable.Indexed; - export function Iterable(value: V): Iterable.Indexed; - - export interface Iterable { - - // Value equality - - /** - * True if this and the other Iterable have value equality, as defined - * by `Immutable.is()`. - * - * Note: This is equivalent to `Immutable.is(this, other)`, but provided to - * allow for chained expressions. - */ - equals(other: Iterable): boolean; - - /** - * Computes and returns the hashed identity for this Iterable. - * - * The `hashCode` of an Iterable is used to determine potential equality, - * and is used when adding this to a `Set` or as a key in a `Map`, enabling - * lookup via a different instance. - * - * var a = List.of(1, 2, 3); - * var b = List.of(1, 2, 3); - * assert(a !== b); // different instances - * var set = Set.of(a); - * assert(set.has(b) === true); - * - * If two values have the same `hashCode`, they are [not guaranteed - * to be equal][Hash Collision]. If two values have different `hashCode`s, - * they must not be equal. - * - * [Hash Collision]: http://en.wikipedia.org/wiki/Collision_(computer_science) - */ - hashCode(): number; - - - // Reading values - - /** - * Returns the value associated with the provided key, or notSetValue if - * the Iterable does not contain this key. - * - * Note: it is possible a key may be associated with an `undefined` value, - * so if `notSetValue` is not provided and this method returns `undefined`, - * that does not guarantee the key was not found. - */ - get(key: K, notSetValue?: V): V; - - /** - * True if a key exists within this `Iterable`, using `Immutable.is` to determine equality - */ - has(key: K): boolean; - - /** - * True if a value exists within this `Iterable`, using `Immutable.is` to determine equality - * @alias contains - */ - includes(value: V): boolean; - contains(value: V): boolean; - - /** - * The first value in the Iterable. - */ - first(): V; - - /** - * The last value in the Iterable. - */ - last(): V; - - - // Reading deep values - - /** - * Returns the value found by following a path of keys or indices through - * nested Iterables. - */ - getIn(searchKeyPath: Array, notSetValue?: any): any; - getIn(searchKeyPath: Iterable, notSetValue?: any): any; - - /** - * True if the result of following a path of keys or indices through nested - * Iterables results in a set value. - */ - hasIn(searchKeyPath: Array): boolean; - hasIn(searchKeyPath: Iterable): boolean; - - - // Conversion to JavaScript types - - /** - * Deeply converts this Iterable to equivalent JS. - * - * `Iterable.Indexeds`, and `Iterable.Sets` become Arrays, while - * `Iterable.Keyeds` become Objects. - * - * @alias toJSON - */ - toJS(): any; - - /** - * Shallowly converts this iterable to an Array, discarding keys. - */ - toArray(): Array; - - /** - * Shallowly converts this Iterable to an Object. - * - * Throws if keys are not strings. - */ - toObject(): { [key: string]: V }; - - - // Conversion to Collections - - /** - * Converts this Iterable to a Map, Throws if keys are not hashable. - * - * Note: This is equivalent to `Map(this.toKeyedSeq())`, but provided - * for convenience and to allow for chained expressions. - */ - toMap(): Map; - - /** - * Converts this Iterable to a Map, maintaining the order of iteration. - * - * Note: This is equivalent to `OrderedMap(this.toKeyedSeq())`, but - * provided for convenience and to allow for chained expressions. - */ - toOrderedMap(): OrderedMap; - - /** - * Converts this Iterable to a Set, discarding keys. Throws if values - * are not hashable. - * - * Note: This is equivalent to `Set(this)`, but provided to allow for - * chained expressions. - */ - toSet(): Set; - - /** - * Converts this Iterable to a Set, maintaining the order of iteration and - * discarding keys. - * - * Note: This is equivalent to `OrderedSet(this.valueSeq())`, but provided - * for convenience and to allow for chained expressions. - */ - toOrderedSet(): OrderedSet; - - /** - * Converts this Iterable to a List, discarding keys. - * - * Note: This is equivalent to `List(this)`, but provided to allow - * for chained expressions. - */ - toList(): List; - - /** - * Converts this Iterable to a Stack, discarding keys. Throws if values - * are not hashable. - * - * Note: This is equivalent to `Stack(this)`, but provided to allow for - * chained expressions. - */ - toStack(): Stack; - - - // Conversion to Seq - - /** - * Converts this Iterable to a Seq of the same kind (indexed, - * keyed, or set). - */ - toSeq(): Seq; - - /** - * Returns a Seq.Keyed from this Iterable where indices are treated as keys. - * - * This is useful if you want to operate on an - * Iterable.Indexed and preserve the [index, value] pairs. - * - * The returned Seq will have identical iteration order as - * this Iterable. - * - * Example: - * - * var indexedSeq = Immutable.Seq.of('A', 'B', 'C'); - * indexedSeq.filter(v => v === 'B').toString() // Seq [ 'B' ] - * var keyedSeq = indexedSeq.toKeyedSeq(); - * keyedSeq.filter(v => v === 'B').toString() // Seq { 1: 'B' } - * - */ - toKeyedSeq(): Seq.Keyed; - - /** - * Returns an Seq.Indexed of the values of this Iterable, discarding keys. - */ - toIndexedSeq(): Seq.Indexed; - - /** - * Returns a Seq.Set of the values of this Iterable, discarding keys. - */ - toSetSeq(): Seq.Set; - - - // Iterators - - /** - * An iterator of this `Iterable`'s keys. - * - * Note: this will return an ES6 iterator which does not support Immutable JS sequence algorithms. Use `keySeq` instead, if this is what you want. - */ - keys(): Iterator; - - /** - * An iterator of this `Iterable`'s values. - * - * Note: this will return an ES6 iterator which does not support Immutable JS sequence algorithms. Use `valueSeq` instead, if this is what you want. - */ - values(): Iterator; - - /** - * An iterator of this `Iterable`'s entries as `[key, value]` tuples. - * - * Note: this will return an ES6 iterator which does not support Immutable JS sequence algorithms. Use `entrySeq` instead, if this is what you want. - */ - entries(): Iterator>; - - - // Iterables (Seq) - - /** - * Returns a new Seq.Indexed of the keys of this Iterable, - * discarding values. - */ - keySeq(): Seq.Indexed; - - /** - * Returns an Seq.Indexed of the values of this Iterable, discarding keys. - */ - valueSeq(): Seq.Indexed; - - /** - * Returns a new Seq.Indexed of [key, value] tuples. - */ - entrySeq(): Seq.Indexed>; - - - // Sequence algorithms - - /** - * Returns a new Iterable of the same type with values passed through a - * `mapper` function. - * - * Seq({ a: 1, b: 2 }).map(x => 10 * x) - * // Seq { a: 10, b: 20 } - * - */ - map( - mapper: (value?: V, key?: K, iter?: /*this*/Iterable) => M, - context?: any - ): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type with only the entries for which - * the `predicate` function returns true. - * - * Seq({a:1,b:2,c:3,d:4}).filter(x => x % 2 === 0) - * // Seq { b: 2, d: 4 } - * - */ - filter( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any - ): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type with only the entries for which - * the `predicate` function returns false. - * - * Seq({a:1,b:2,c:3,d:4}).filterNot(x => x % 2 === 0) - * // Seq { a: 1, c: 3 } - * - */ - filterNot( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any - ): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type in reverse order. - */ - reverse(): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type which includes the same entries, - * stably sorted by using a `comparator`. - * - * If a `comparator` is not provided, a default comparator uses `<` and `>`. - * - * `comparator(valueA, valueB)`: - * - * * Returns `0` if the elements should not be swapped. - * * Returns `-1` (or any negative number) if `valueA` comes before `valueB` - * * Returns `1` (or any positive number) if `valueA` comes after `valueB` - * * Is pure, i.e. it must always return the same value for the same pair - * of values. - * - * When sorting collections which have no defined order, their ordered - * equivalents will be returned. e.g. `map.sort()` returns OrderedMap. - */ - sort(comparator?: (valueA: V, valueB: V) => number): /*this*/Iterable; - - /** - * Like `sort`, but also accepts a `comparatorValueMapper` which allows for - * sorting by more sophisticated means: - * - * hitters.sortBy(hitter => hitter.avgHits); - * - */ - sortBy( - comparatorValueMapper: (value?: V, key?: K, iter?: /*this*/Iterable) => C, - comparator?: (valueA: C, valueB: C) => number - ): /*this*/Iterable; - - /** - * Returns a `Iterable.Keyed` of `Iterable.Keyeds`, grouped by the return - * value of the `grouper` function. - * - * Note: This is always an eager operation. - */ - groupBy( - grouper: (value?: V, key?: K, iter?: /*this*/Iterable) => G, - context?: any - ): /*Map*/Seq.Keyed>; - - - // Side effects - - /** - * The `sideEffect` is executed for every entry in the Iterable. - * - * Unlike `Array#forEach`, if any call of `sideEffect` returns - * `false`, the iteration will stop. Returns the number of entries iterated - * (including the last iteration which returned false). - */ - forEach( - sideEffect: (value?: V, key?: K, iter?: /*this*/Iterable) => any, - context?: any - ): number; - - - // Creating subsets - - /** - * Returns a new Iterable of the same type representing a portion of this - * Iterable from start up to but not including end. - * - * If begin is negative, it is offset from the end of the Iterable. e.g. - * `slice(-2)` returns a Iterable of the last two entries. If it is not - * provided the new Iterable will begin at the beginning of this Iterable. - * - * If end is negative, it is offset from the end of the Iterable. e.g. - * `slice(0, -1)` returns an Iterable of everything but the last entry. If - * it is not provided, the new Iterable will continue through the end of - * this Iterable. - * - * If the requested slice is equivalent to the current Iterable, then it - * will return itself. - */ - slice(begin?: number, end?: number): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type containing all entries except - * the first. - */ - rest(): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type containing all entries except - * the last. - */ - butLast(): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type which excludes the first `amount` - * entries from this Iterable. - */ - skip(amount: number): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type which excludes the last `amount` - * entries from this Iterable. - */ - skipLast(amount: number): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type which includes entries starting - * from when `predicate` first returns false. - * - * Seq.of('dog','frog','cat','hat','god') - * .skipWhile(x => x.match(/g/)) - * // Seq [ 'cat', 'hat', 'god' ] - * - */ - skipWhile( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any - ): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type which includes entries starting - * from when `predicate` first returns true. - * - * Seq.of('dog','frog','cat','hat','god') - * .skipUntil(x => x.match(/hat/)) - * // Seq [ 'hat', 'god' ] - * - */ - skipUntil( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any - ): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type which includes the first `amount` - * entries from this Iterable. - */ - take(amount: number): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type which includes the last `amount` - * entries from this Iterable. - */ - takeLast(amount: number): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type which includes entries from this - * Iterable as long as the `predicate` returns true. - * - * Seq.of('dog','frog','cat','hat','god') - * .takeWhile(x => x.match(/o/)) - * // Seq [ 'dog', 'frog' ] - * - */ - takeWhile( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any - ): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type which includes entries from this - * Iterable as long as the `predicate` returns false. - * - * Seq.of('dog','frog','cat','hat','god').takeUntil(x => x.match(/at/)) - * // ['dog', 'frog'] - * - */ - takeUntil( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any - ): /*this*/Iterable; - - - // Combination - - /** - * Returns a new Iterable of the same type with other values and - * iterable-like concatenated to this one. - * - * For Seqs, all entries will be present in - * the resulting iterable, even if they have the same key. - */ - concat(...valuesOrIterables: /*Array|V*/any[]): /*this*/Iterable; - - /** - * Flattens nested Iterables. - * - * Will deeply flatten the Iterable by default, returning an Iterable of the - * same type, but a `depth` can be provided in the form of a number or - * boolean (where true means to shallowly flatten one level). A depth of 0 - * (or shallow: false) will deeply flatten. - * - * Flattens only others Iterable, not Arrays or Objects. - * - * Note: `flatten(true)` operates on Iterable> and - * returns Iterable - */ - flatten(depth?: number): /*this*/Iterable; - flatten(shallow?: boolean): /*this*/Iterable; - - /** - * Flat-maps the Iterable, returning an Iterable of the same type. - * - * Similar to `iter.map(...).flatten(true)`. - */ - flatMap( - mapper: (value?: V, key?: K, iter?: /*this*/Iterable) => Iterable, - context?: any - ): /*this*/Iterable; - flatMap( - mapper: (value?: V, key?: K, iter?: /*this*/Iterable) => /*iterable-like*/any, - context?: any - ): /*this*/Iterable; - - - // Reducing a value - - /** - * Reduces the Iterable to a value by calling the `reducer` for every entry - * in the Iterable and passing along the reduced value. - * - * If `initialReduction` is not provided, or is null, the first item in the - * Iterable will be used. - * - * @see `Array#reduce`. - */ - reduce( - reducer: (reduction?: R, value?: V, key?: K, iter?: /*this*/Iterable) => R, - initialReduction?: R, - context?: any - ): R; - - /** - * Reduces the Iterable in reverse (from the right side). - * - * Note: Similar to this.reverse().reduce(), and provided for parity - * with `Array#reduceRight`. - */ - reduceRight( - reducer: (reduction?: R, value?: V, key?: K, iter?: /*this*/Iterable) => R, - initialReduction?: R, - context?: any - ): R; - - /** - * True if `predicate` returns true for all entries in the Iterable. - */ - every( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any - ): boolean; - - /** - * True if `predicate` returns true for any entry in the Iterable. - */ - some( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any - ): boolean; - - /** - * Joins values together as a string, inserting a separator between each. - * The default separator is `","`. - */ - join(separator?: string): string; - - /** - * Returns true if this Iterable includes no values. - * - * For some lazy `Seq`, `isEmpty` might need to iterate to determine - * emptiness. At most one iteration will occur. - */ - isEmpty(): boolean; - - /** - * Returns the size of this Iterable. - * - * Regardless of if this Iterable can describe its size lazily (some Seqs - * cannot), this method will always return the correct size. E.g. it - * evaluates a lazy `Seq` if necessary. - * - * If `predicate` is provided, then this returns the count of entries in the - * Iterable for which the `predicate` returns true. - */ - count(): number; - count( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any - ): number; - - /** - * Returns a `Seq.Keyed` of counts, grouped by the return value of - * the `grouper` function. - * - * Note: This is not a lazy operation. - */ - countBy( - grouper: (value?: V, key?: K, iter?: /*this*/Iterable) => G, - context?: any - ): Map; - - - // Search for value - - /** - * Returns the first value for which the `predicate` returns true. - */ - find( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any, - notSetValue?: V - ): V; - - /** - * Returns the last value for which the `predicate` returns true. - * - * Note: `predicate` will be called for each entry in reverse. - */ - findLast( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any, - notSetValue?: V - ): V; - - /** - * Returns the first [key, value] entry for which the `predicate` returns true. - */ - findEntry( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any, - notSetValue?: V - ): /*[K, V]*/Array; - - /** - * Returns the last [key, value] entry for which the `predicate` - * returns true. - * - * Note: `predicate` will be called for each entry in reverse. - */ - findLastEntry( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any, - notSetValue?: V - ): /*[K, V]*/Array; - - /** - * Returns the key for which the `predicate` returns true. - */ - findKey( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable.Keyed) => boolean, - context?: any - ): K; - - /** - * Returns the last key for which the `predicate` returns true. - * - * Note: `predicate` will be called for each entry in reverse. - */ - findLastKey( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable.Keyed) => boolean, - context?: any - ): K; - - /** - * Returns the key associated with the search value, or undefined. - */ - keyOf(searchValue: V): K; - - /** - * Returns the last key associated with the search value, or undefined. - */ - lastKeyOf(searchValue: V): K; - - /** - * Returns the maximum value in this collection. If any values are - * comparatively equivalent, the first one found will be returned. - * - * The `comparator` is used in the same way as `Iterable#sort`. If it is not - * provided, the default comparator is `>`. - * - * When two values are considered equivalent, the first encountered will be - * returned. Otherwise, `max` will operate independent of the order of input - * as long as the comparator is commutative. The default comparator `>` is - * commutative *only* when types do not differ. - * - * If `comparator` returns 0 and either value is NaN, undefined, or null, - * that value will be returned. - */ - max(comparator?: (valueA: V, valueB: V) => number): V; - - /** - * Like `max`, but also accepts a `comparatorValueMapper` which allows for - * comparing by more sophisticated means: - * - * hitters.maxBy(hitter => hitter.avgHits); - * - */ - maxBy( - comparatorValueMapper: (value?: V, key?: K, iter?: /*this*/Iterable) => C, - comparator?: (valueA: C, valueB: C) => number - ): V; - - /** - * Returns the minimum value in this collection. If any values are - * comparatively equivalent, the first one found will be returned. - * - * The `comparator` is used in the same way as `Iterable#sort`. If it is not - * provided, the default comparator is `<`. - * - * When two values are considered equivalent, the first encountered will be - * returned. Otherwise, `min` will operate independent of the order of input - * as long as the comparator is commutative. The default comparator `<` is - * commutative *only* when types do not differ. - * - * If `comparator` returns 0 and either value is NaN, undefined, or null, - * that value will be returned. - */ - min(comparator?: (valueA: V, valueB: V) => number): V; - - /** - * Like `min`, but also accepts a `comparatorValueMapper` which allows for - * comparing by more sophisticated means: - * - * hitters.minBy(hitter => hitter.avgHits); - * - */ - minBy( - comparatorValueMapper: (value?: V, key?: K, iter?: /*this*/Iterable) => C, - comparator?: (valueA: C, valueB: C) => number - ): V; - - - // Comparison - - /** - * True if `iter` includes every value in this Iterable. - */ - isSubset(iter: Iterable): boolean; - isSubset(iter: Array): boolean; - - /** - * True if this Iterable includes every value in `iter`. - */ - isSuperset(iter: Iterable): boolean; - isSuperset(iter: Array): boolean; - - - /** - * Note: this is here as a convenience to work around an issue with - * TypeScript https://github.com/Microsoft/TypeScript/issues/285, but - * Iterable does not define `size`, instead `Seq` defines `size` as - * nullable number, and `Collection` defines `size` as always a number. - * - * @ignore - */ - size: number; - } - - - /** - * Collection is the abstract base class for concrete data structures. It - * cannot be constructed directly. - * - * Implementations should extend one of the subclasses, `Collection.Keyed`, - * `Collection.Indexed`, or `Collection.Set`. - */ - export module Collection { - - - /** - * `Collection` which represents key-value pairs. - */ - export module Keyed {} - - export interface Keyed extends Collection, Iterable.Keyed { - - /** - * Returns Seq.Keyed. - * @override - */ - toSeq(): Seq.Keyed; - } - - - /** - * `Collection` which represents ordered indexed values. - */ - export module Indexed {} - - export interface Indexed extends Collection, Iterable.Indexed { - - /** - * Returns Seq.Indexed. - * @override - */ - toSeq(): Seq.Indexed; - } - - - /** - * `Collection` which represents values, unassociated with keys or indices. - * - * `Collection.Set` implementations should guarantee value uniqueness. - */ - export module Set {} - - export interface Set extends Collection, Iterable.Set { - - /** - * Returns Seq.Set. - * @override - */ - toSeq(): Seq.Set; - } - - } - - export interface Collection extends Iterable { - - /** - * All collections maintain their current `size` as an integer. - */ - size: number; - } - - - /** - * ES6 Iterator. - * - * This is not part of the Immutable library, but a common interface used by - * many types in ES6 JavaScript. - * - * @ignore - */ - export interface Iterator { - next(): { value: T; done: boolean; } - } - - diff --git a/dist/immutable.d.ts b/dist/immutable.d.ts deleted file mode 100644 index e1fc668153..0000000000 --- a/dist/immutable.d.ts +++ /dev/null @@ -1,2539 +0,0 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -/** - * Immutable data encourages pure functions (data-in, data-out) and lends itself - * to much simpler application development and enabling techniques from - * functional programming such as lazy evaluation. - * - * While designed to bring these powerful functional concepts to JavaScript, it - * presents an Object-Oriented API familiar to Javascript engineers and closely - * mirroring that of Array, Map, and Set. It is easy and efficient to convert to - * and from plain Javascript types. - - * Note: all examples are presented in [ES6][]. To run in all browsers, they - * need to be translated to ES3. For example: - * - * // ES6 - * foo.map(x => x * x); - * // ES3 - * foo.map(function (x) { return x * x; }); - * - * [ES6]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/New_in_JavaScript/ECMAScript_6_support_in_Mozilla - */ - -declare module Immutable { - - /** - * Deeply converts plain JS objects and arrays to Immutable Maps and Lists. - * - * If a `reviver` is optionally provided, it will be called with every - * collection as a Seq (beginning with the most nested collections - * and proceeding to the top-level collection itself), along with the key - * refering to each collection and the parent JS object provided as `this`. - * For the top level, object, the key will be `""`. This `reviver` is expected - * to return a new Immutable Iterable, allowing for custom conversions from - * deep JS objects. - * - * This example converts JSON to List and OrderedMap: - * - * Immutable.fromJS({a: {b: [10, 20, 30]}, c: 40}, function (key, value) { - * var isIndexed = Immutable.Iterable.isIndexed(value); - * return isIndexed ? value.toList() : value.toOrderedMap(); - * }); - * - * // true, "b", {b: [10, 20, 30]} - * // false, "a", {a: {b: [10, 20, 30]}, c: 40} - * // false, "", {"": {a: {b: [10, 20, 30]}, c: 40}} - * - * If `reviver` is not provided, the default behavior will convert Arrays into - * Lists and Objects into Maps. - * - * `reviver` acts similarly to the [same parameter in `JSON.parse`][1]. - * - * `Immutable.fromJS` is conservative in its conversion. It will only convert - * arrays which pass `Array.isArray` to Lists, and only raw objects (no custom - * prototype) to Map. - * - * Keep in mind, when using JS objects to construct Immutable Maps, that - * JavaScript Object properties are always strings, even if written in a - * quote-less shorthand, while Immutable Maps accept keys of any type. - * - * ```js - * var obj = { 1: "one" }; - * Object.keys(obj); // [ "1" ] - * obj["1"]; // "one" - * obj[1]; // "one" - * - * var map = Map(obj); - * map.get("1"); // "one" - * map.get(1); // undefined - * ``` - * - * Property access for JavaScript Objects first converts the key to a string, - * but since Immutable Map keys can be of any type the argument to `get()` is - * not altered. - * - * [1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#Example.3A_Using_the_reviver_parameter - * "Using the reviver parameter" - */ - export function fromJS( - json: any, - reviver?: (k: any, v: Iterable) => any - ): any; - - - /** - * Value equality check with semantics similar to `Object.is`, but treats - * Immutable `Iterable`s as values, equal if the second `Iterable` includes - * equivalent values. - * - * It's used throughout Immutable when checking for equality, including `Map` - * key equality and `Set` membership. - * - * var map1 = Immutable.Map({a:1, b:1, c:1}); - * var map2 = Immutable.Map({a:1, b:1, c:1}); - * assert(map1 !== map2); - * assert(Object.is(map1, map2) === false); - * assert(Immutable.is(map1, map2) === true); - * - * Note: Unlike `Object.is`, `Immutable.is` assumes `0` and `-0` are the same - * value, matching the behavior of ES6 Map key equality. - */ - export function is(first: any, second: any): boolean; - - - /** - * Lists are ordered indexed dense collections, much like a JavaScript - * Array. - * - * Lists are immutable and fully persistent with O(log32 N) gets and sets, - * and O(1) push and pop. - * - * Lists implement Deque, with efficient addition and removal from both the - * end (`push`, `pop`) and beginning (`unshift`, `shift`). - * - * Unlike a JavaScript Array, there is no distinction between an - * "unset" index and an index set to `undefined`. `List#forEach` visits all - * indices from 0 to size, regardless of whether they were explicitly defined. - */ - export module List { - - /** - * True if the provided value is a List - */ - function isList(maybeList: any): boolean; - - /** - * Creates a new List containing `values`. - */ - function of(...values: T[]): List; - } - - /** - * Create a new immutable List containing the values of the provided - * iterable-like. - */ - export function List(): List; - export function List(iter: Iterable.Indexed): List; - export function List(iter: Iterable.Set): List; - export function List(iter: Iterable.Keyed): List; - export function List(array: Array): List; - export function List(iterator: Iterator): List; - export function List(iterable: /*Iterable*/Object): List; - - - export interface List extends Collection.Indexed { - - // Persistent changes - - /** - * Returns a new List which includes `value` at `index`. If `index` already - * exists in this List, it will be replaced. - * - * `index` may be a negative number, which indexes back from the end of the - * List. `v.set(-1, "value")` sets the last item in the List. - * - * If `index` larger than `size`, the returned List's `size` will be large - * enough to include the `index`. - */ - set(index: number, value: T): List; - - /** - * Returns a new List which excludes this `index` and with a size 1 less - * than this List. Values at indices above `index` are shifted down by 1 to - * fill the position. - * - * This is synonymous with `list.splice(index, 1)`. - * - * `index` may be a negative number, which indexes back from the end of the - * List. `v.delete(-1)` deletes the last item in the List. - * - * Note: `delete` cannot be safely used in IE8 - * @alias remove - */ - delete(index: number): List; - remove(index: number): List; - - /** - * Returns a new List with `value` at `index` with a size 1 more than this - * List. Values at indices above `index` are shifted over by 1. - * - * This is synonymous with `list.splice(index, 0, value) - */ - insert(index: number, value: T): List; - - /** - * Returns a new List with 0 size and no values. - */ - clear(): List; - - /** - * Returns a new List with the provided `values` appended, starting at this - * List's `size`. - */ - push(...values: T[]): List; - - /** - * Returns a new List with a size ones less than this List, excluding - * the last index in this List. - * - * Note: this differs from `Array#pop` because it returns a new - * List rather than the removed value. Use `last()` to get the last value - * in this List. - */ - pop(): List; - - /** - * Returns a new List with the provided `values` prepended, shifting other - * values ahead to higher indices. - */ - unshift(...values: T[]): List; - - /** - * Returns a new List with a size ones less than this List, excluding - * the first index in this List, shifting all other values to a lower index. - * - * Note: this differs from `Array#shift` because it returns a new - * List rather than the removed value. Use `first()` to get the first - * value in this List. - */ - shift(): List; - - /** - * Returns a new List with an updated value at `index` with the return - * value of calling `updater` with the existing value, or `notSetValue` if - * `index` was not set. If called with a single argument, `updater` is - * called with the List itself. - * - * `index` may be a negative number, which indexes back from the end of the - * List. `v.update(-1)` updates the last item in the List. - * - * @see `Map#update` - */ - update(updater: (value: List) => List): List; - update(index: number, updater: (value: T) => T): List; - update(index: number, notSetValue: T, updater: (value: T) => T): List; - - /** - * @see `Map#merge` - */ - merge(...iterables: Iterable.Indexed[]): List; - merge(...iterables: Array[]): List; - - /** - * @see `Map#mergeWith` - */ - mergeWith( - merger: (previous?: T, next?: T, key?: number) => T, - ...iterables: Iterable.Indexed[] - ): List; - mergeWith( - merger: (previous?: T, next?: T, key?: number) => T, - ...iterables: Array[] - ): List; - - /** - * @see `Map#mergeDeep` - */ - mergeDeep(...iterables: Iterable.Indexed[]): List; - mergeDeep(...iterables: Array[]): List; - - /** - * @see `Map#mergeDeepWith` - */ - mergeDeepWith( - merger: (previous?: T, next?: T, key?: number) => T, - ...iterables: Iterable.Indexed[] - ): List; - mergeDeepWith( - merger: (previous?: T, next?: T, key?: number) => T, - ...iterables: Array[] - ): List; - - /** - * Returns a new List with size `size`. If `size` is less than this - * List's size, the new List will exclude values at the higher indices. - * If `size` is greater than this List's size, the new List will have - * undefined values for the newly available indices. - * - * When building a new List and the final size is known up front, `setSize` - * used in conjunction with `withMutations` may result in the more - * performant construction. - */ - setSize(size: number): List; - - - // Deep persistent changes - - /** - * Returns a new List having set `value` at this `keyPath`. If any keys in - * `keyPath` do not exist, a new immutable Map will be created at that key. - * - * Index numbers are used as keys to determine the path to follow in - * the List. - */ - setIn(keyPath: Array, value: any): List; - setIn(keyPath: Iterable, value: any): List; - - /** - * Returns a new List having removed the value at this `keyPath`. If any - * keys in `keyPath` do not exist, no change will occur. - * - * @alias removeIn - */ - deleteIn(keyPath: Array): List; - deleteIn(keyPath: Iterable): List; - removeIn(keyPath: Array): List; - removeIn(keyPath: Iterable): List; - - /** - * @see `Map#updateIn` - */ - updateIn( - keyPath: Array, - updater: (value: any) => any - ): List; - updateIn( - keyPath: Array, - notSetValue: any, - updater: (value: any) => any - ): List; - updateIn( - keyPath: Iterable, - updater: (value: any) => any - ): List; - updateIn( - keyPath: Iterable, - notSetValue: any, - updater: (value: any) => any - ): List; - - /** - * @see `Map#mergeIn` - */ - mergeIn( - keyPath: Iterable, - ...iterables: Iterable.Indexed[] - ): List; - mergeIn( - keyPath: Array, - ...iterables: Iterable.Indexed[] - ): List; - mergeIn( - keyPath: Array, - ...iterables: Array[] - ): List; - - /** - * @see `Map#mergeDeepIn` - */ - mergeDeepIn( - keyPath: Iterable, - ...iterables: Iterable.Indexed[] - ): List; - mergeDeepIn( - keyPath: Array, - ...iterables: Iterable.Indexed[] - ): List; - mergeDeepIn( - keyPath: Array, - ...iterables: Array[] - ): List; - - - // Transient changes - - /** - * Note: Not all methods can be used on a mutable collection or within - * `withMutations`! Only `set`, `push`, `pop`, `shift`, `unshift` and - * `merge` may be used mutatively. - * - * @see `Map#withMutations` - */ - withMutations(mutator: (mutable: List) => any): List; - - /** - * @see `Map#asMutable` - */ - asMutable(): List; - - /** - * @see `Map#asImmutable` - */ - asImmutable(): List; - } - - - /** - * Immutable Map is an unordered Iterable.Keyed of (key, value) pairs with - * `O(log32 N)` gets and `O(log32 N)` persistent sets. - * - * Iteration order of a Map is undefined, however is stable. Multiple - * iterations of the same Map will iterate in the same order. - * - * Map's keys can be of any type, and use `Immutable.is` to determine key - * equality. This allows the use of any value (including NaN) as a key. - * - * Because `Immutable.is` returns equality based on value semantics, and - * Immutable collections are treated as values, any Immutable collection may - * be used as a key. - * - * Map().set(List.of(1), 'listofone').get(List.of(1)); - * // 'listofone' - * - * Any JavaScript object may be used as a key, however strict identity is used - * to evaluate key equality. Two similar looking objects will represent two - * different keys. - * - * Implemented by a hash-array mapped trie. - */ - export module Map { - - /** - * True if the provided value is a Map - */ - function isMap(maybeMap: any): boolean; - - /** - * Creates a new Map from alternating keys and values - */ - function of(...keyValues: any[]): Map; - } - - /** - * Creates a new Immutable Map. - * - * Created with the same key value pairs as the provided Iterable.Keyed or - * JavaScript Object or expects an Iterable of [K, V] tuple entries. - * - * var newMap = Map({key: "value"}); - * var newMap = Map([["key", "value"]]); - * - * Keep in mind, when using JS objects to construct Immutable Maps, that - * JavaScript Object properties are always strings, even if written in a - * quote-less shorthand, while Immutable Maps accept keys of any type. - * - * ```js - * var obj = { 1: "one" }; - * Object.keys(obj); // [ "1" ] - * obj["1"]; // "one" - * obj[1]; // "one" - * - * var map = Map(obj); - * map.get("1"); // "one" - * map.get(1); // undefined - * ``` - * - * Property access for JavaScript Objects first converts the key to a string, - * but since Immutable Map keys can be of any type the argument to `get()` is - * not altered. - */ - export function Map(): Map; - export function Map(iter: Iterable.Keyed): Map; - export function Map(iter: Iterable>): Map; - export function Map(array: Array>): Map; - export function Map(obj: {[key: string]: V}): Map; - export function Map(iterator: Iterator>): Map; - export function Map(iterable: /*Iterable<[K,V]>*/Object): Map; - - export interface Map extends Collection.Keyed { - - // Persistent changes - - /** - * Returns a new Map also containing the new key, value pair. If an equivalent - * key already exists in this Map, it will be replaced. - */ - set(key: K, value: V): Map; - - /** - * Returns a new Map which excludes this `key`. - * - * Note: `delete` cannot be safely used in IE8, but is provided to mirror - * the ES6 collection API. - * @alias remove - */ - delete(key: K): Map; - remove(key: K): Map; - - /** - * Returns a new Map containing no keys or values. - */ - clear(): Map; - - /** - * Returns a new Map having updated the value at this `key` with the return - * value of calling `updater` with the existing value, or `notSetValue` if - * the key was not set. If called with only a single argument, `updater` is - * called with the Map itself. - * - * Equivalent to: `map.set(key, updater(map.get(key, notSetValue)))`. - */ - update(updater: (value: Map) => Map): Map; - update(key: K, updater: (value: V) => V): Map; - update(key: K, notSetValue: V, updater: (value: V) => V): Map; - - /** - * Returns a new Map resulting from merging the provided Iterables - * (or JS objects) into this Map. In other words, this takes each entry of - * each iterable and sets it on this Map. - * - * If any of the values provided to `merge` are not Iterable (would return - * false for `Immutable.Iterable.isIterable`) then they are deeply converted - * via `Immutable.fromJS` before being merged. However, if the value is an - * Iterable but includes non-iterable JS objects or arrays, those nested - * values will be preserved. - * - * var x = Immutable.Map({a: 10, b: 20, c: 30}); - * var y = Immutable.Map({b: 40, a: 50, d: 60}); - * x.merge(y) // { a: 50, b: 40, c: 30, d: 60 } - * y.merge(x) // { b: 20, a: 10, d: 60, c: 30 } - * - */ - merge(...iterables: Iterable[]): Map; - merge(...iterables: {[key: string]: V}[]): Map; - - /** - * Like `merge()`, `mergeWith()` returns a new Map resulting from merging - * the provided Iterables (or JS objects) into this Map, but uses the - * `merger` function for dealing with conflicts. - * - * var x = Immutable.Map({a: 10, b: 20, c: 30}); - * var y = Immutable.Map({b: 40, a: 50, d: 60}); - * x.mergeWith((prev, next) => prev / next, y) // { a: 0.2, b: 0.5, c: 30, d: 60 } - * y.mergeWith((prev, next) => prev / next, x) // { b: 2, a: 5, d: 60, c: 30 } - * - */ - mergeWith( - merger: (previous?: V, next?: V, key?: K) => V, - ...iterables: Iterable[] - ): Map; - mergeWith( - merger: (previous?: V, next?: V, key?: K) => V, - ...iterables: {[key: string]: V}[] - ): Map; - - /** - * Like `merge()`, but when two Iterables conflict, it merges them as well, - * recursing deeply through the nested data. - * - * var x = Immutable.fromJS({a: { x: 10, y: 10 }, b: { x: 20, y: 50 } }); - * var y = Immutable.fromJS({a: { x: 2 }, b: { y: 5 }, c: { z: 3 } }); - * x.mergeDeep(y) // {a: { x: 2, y: 10 }, b: { x: 20, y: 5 }, c: { z: 3 } } - * - */ - mergeDeep(...iterables: Iterable[]): Map; - mergeDeep(...iterables: {[key: string]: V}[]): Map; - - /** - * Like `mergeDeep()`, but when two non-Iterables conflict, it uses the - * `merger` function to determine the resulting value. - * - * var x = Immutable.fromJS({a: { x: 10, y: 10 }, b: { x: 20, y: 50 } }); - * var y = Immutable.fromJS({a: { x: 2 }, b: { y: 5 }, c: { z: 3 } }); - * x.mergeDeepWith((prev, next) => prev / next, y) - * // {a: { x: 5, y: 10 }, b: { x: 20, y: 10 }, c: { z: 3 } } - * - */ - mergeDeepWith( - merger: (previous?: V, next?: V, key?: K) => V, - ...iterables: Iterable[] - ): Map; - mergeDeepWith( - merger: (previous?: V, next?: V, key?: K) => V, - ...iterables: {[key: string]: V}[] - ): Map; - - - // Deep persistent changes - - /** - * Returns a new Map having set `value` at this `keyPath`. If any keys in - * `keyPath` do not exist, a new immutable Map will be created at that key. - */ - setIn(keyPath: Array, value: any): Map; - setIn(KeyPath: Iterable, value: any): Map; - - /** - * Returns a new Map having removed the value at this `keyPath`. If any keys - * in `keyPath` do not exist, no change will occur. - * - * @alias removeIn - */ - deleteIn(keyPath: Array): Map; - deleteIn(keyPath: Iterable): Map; - removeIn(keyPath: Array): Map; - removeIn(keyPath: Iterable): Map; - - /** - * Returns a new Map having applied the `updater` to the entry found at the - * keyPath. - * - * If any keys in `keyPath` do not exist, new Immutable `Map`s will - * be created at those keys. If the `keyPath` does not already contain a - * value, the `updater` function will be called with `notSetValue`, if - * provided, otherwise `undefined`. - * - * var data = Immutable.fromJS({ a: { b: { c: 10 } } }); - * data = data.updateIn(['a', 'b', 'c'], val => val * 2); - * // { a: { b: { c: 20 } } } - * - * If the `updater` function returns the same value it was called with, then - * no change will occur. This is still true if `notSetValue` is provided. - * - * var data1 = Immutable.fromJS({ a: { b: { c: 10 } } }); - * data2 = data1.updateIn(['x', 'y', 'z'], 100, val => val); - * assert(data2 === data1); - * - */ - updateIn( - keyPath: Array, - updater: (value: any) => any - ): Map; - updateIn( - keyPath: Array, - notSetValue: any, - updater: (value: any) => any - ): Map; - updateIn( - keyPath: Iterable, - updater: (value: any) => any - ): Map; - updateIn( - keyPath: Iterable, - notSetValue: any, - updater: (value: any) => any - ): Map; - - /** - * A combination of `updateIn` and `merge`, returning a new Map, but - * performing the merge at a point arrived at by following the keyPath. - * In other words, these two lines are equivalent: - * - * x.updateIn(['a', 'b', 'c'], abc => abc.merge(y)); - * x.mergeIn(['a', 'b', 'c'], y); - * - */ - mergeIn( - keyPath: Iterable, - ...iterables: Iterable[] - ): Map; - mergeIn( - keyPath: Array, - ...iterables: Iterable[] - ): Map; - mergeIn( - keyPath: Array, - ...iterables: {[key: string]: V}[] - ): Map; - - /** - * A combination of `updateIn` and `mergeDeep`, returning a new Map, but - * performing the deep merge at a point arrived at by following the keyPath. - * In other words, these two lines are equivalent: - * - * x.updateIn(['a', 'b', 'c'], abc => abc.mergeDeep(y)); - * x.mergeDeepIn(['a', 'b', 'c'], y); - * - */ - mergeDeepIn( - keyPath: Iterable, - ...iterables: Iterable[] - ): Map; - mergeDeepIn( - keyPath: Array, - ...iterables: Iterable[] - ): Map; - mergeDeepIn( - keyPath: Array, - ...iterables: {[key: string]: V}[] - ): Map; - - - // Transient changes - - /** - * Every time you call one of the above functions, a new immutable Map is - * created. If a pure function calls a number of these to produce a final - * return value, then a penalty on performance and memory has been paid by - * creating all of the intermediate immutable Maps. - * - * If you need to apply a series of mutations to produce a new immutable - * Map, `withMutations()` creates a temporary mutable copy of the Map which - * can apply mutations in a highly performant manner. In fact, this is - * exactly how complex mutations like `merge` are done. - * - * As an example, this results in the creation of 2, not 4, new Maps: - * - * var map1 = Immutable.Map(); - * var map2 = map1.withMutations(map => { - * map.set('a', 1).set('b', 2).set('c', 3); - * }); - * assert(map1.size === 0); - * assert(map2.size === 3); - * - * Note: Not all methods can be used on a mutable collection or within - * `withMutations`! Only `set` and `merge` may be used mutatively. - * - */ - withMutations(mutator: (mutable: Map) => any): Map; - - /** - * Another way to avoid creation of intermediate Immutable maps is to create - * a mutable copy of this collection. Mutable copies *always* return `this`, - * and thus shouldn't be used for equality. Your function should never return - * a mutable copy of a collection, only use it internally to create a new - * collection. If possible, use `withMutations` as it provides an easier to - * use API. - * - * Note: if the collection is already mutable, `asMutable` returns itself. - * - * Note: Not all methods can be used on a mutable collection or within - * `withMutations`! Only `set` and `merge` may be used mutatively. - */ - asMutable(): Map; - - /** - * The yin to `asMutable`'s yang. Because it applies to mutable collections, - * this operation is *mutable* and returns itself. Once performed, the mutable - * copy has become immutable and can be safely returned from a function. - */ - asImmutable(): Map; - } - - - /** - * A type of Map that has the additional guarantee that the iteration order of - * entries will be the order in which they were set(). - * - * The iteration behavior of OrderedMap is the same as native ES6 Map and - * JavaScript Object. - * - * Note that `OrderedMap` are more expensive than non-ordered `Map` and may - * consume more memory. `OrderedMap#set` is amortized O(log32 N), but not - * stable. - */ - - export module OrderedMap { - - /** - * True if the provided value is an OrderedMap. - */ - function isOrderedMap(maybeOrderedMap: any): boolean; - } - - /** - * Creates a new Immutable OrderedMap. - * - * Created with the same key value pairs as the provided Iterable.Keyed or - * JavaScript Object or expects an Iterable of [K, V] tuple entries. - * - * The iteration order of key-value pairs provided to this constructor will - * be preserved in the OrderedMap. - * - * var newOrderedMap = OrderedMap({key: "value"}); - * var newOrderedMap = OrderedMap([["key", "value"]]); - * - */ - export function OrderedMap(): OrderedMap; - export function OrderedMap(iter: Iterable.Keyed): OrderedMap; - export function OrderedMap(iter: Iterable>): OrderedMap; - export function OrderedMap(array: Array>): OrderedMap; - export function OrderedMap(obj: {[key: string]: V}): OrderedMap; - export function OrderedMap(iterator: Iterator>): OrderedMap; - export function OrderedMap(iterable: /*Iterable<[K,V]>*/Object): OrderedMap; - - export interface OrderedMap extends Map {} - - - /** - * A Collection of unique values with `O(log32 N)` adds and has. - * - * When iterating a Set, the entries will be (value, value) pairs. Iteration - * order of a Set is undefined, however is stable. Multiple iterations of the - * same Set will iterate in the same order. - * - * Set values, like Map keys, may be of any type. Equality is determined using - * `Immutable.is`, enabling Sets to uniquely include other Immutable - * collections, custom value types, and NaN. - */ - export module Set { - - /** - * True if the provided value is a Set - */ - function isSet(maybeSet: any): boolean; - - /** - * Creates a new Set containing `values`. - */ - function of(...values: T[]): Set; - - /** - * `Set.fromKeys()` creates a new immutable Set containing the keys from - * this Iterable or JavaScript Object. - */ - function fromKeys(iter: Iterable): Set; - function fromKeys(obj: {[key: string]: any}): Set; - } - - /** - * Create a new immutable Set containing the values of the provided - * iterable-like. - */ - export function Set(): Set; - export function Set(iter: Iterable.Set): Set; - export function Set(iter: Iterable.Indexed): Set; - export function Set(iter: Iterable.Keyed): Set; - export function Set(array: Array): Set; - export function Set(iterator: Iterator): Set; - export function Set(iterable: /*Iterable*/Object): Set; - - export interface Set extends Collection.Set { - - // Persistent changes - - /** - * Returns a new Set which also includes this value. - */ - add(value: T): Set; - - /** - * Returns a new Set which excludes this value. - * - * Note: `delete` cannot be safely used in IE8 - * @alias remove - */ - delete(value: T): Set; - remove(value: T): Set; - - /** - * Returns a new Set containing no values. - */ - clear(): Set; - - /** - * Returns a Set including any value from `iterables` that does not already - * exist in this Set. - * @alias merge - */ - union(...iterables: Iterable[]): Set; - union(...iterables: Array[]): Set; - merge(...iterables: Iterable[]): Set; - merge(...iterables: Array[]): Set; - - - /** - * Returns a Set which has removed any values not also contained - * within `iterables`. - */ - intersect(...iterables: Iterable[]): Set; - intersect(...iterables: Array[]): Set; - - /** - * Returns a Set excluding any values contained within `iterables`. - */ - subtract(...iterables: Iterable[]): Set; - subtract(...iterables: Array[]): Set; - - - // Transient changes - - /** - * Note: Not all methods can be used on a mutable collection or within - * `withMutations`! Only `add` may be used mutatively. - * - * @see `Map#withMutations` - */ - withMutations(mutator: (mutable: Set) => any): Set; - - /** - * @see `Map#asMutable` - */ - asMutable(): Set; - - /** - * @see `Map#asImmutable` - */ - asImmutable(): Set; - } - - - /** - * A type of Set that has the additional guarantee that the iteration order of - * values will be the order in which they were `add`ed. - * - * The iteration behavior of OrderedSet is the same as native ES6 Set. - * - * Note that `OrderedSet` are more expensive than non-ordered `Set` and may - * consume more memory. `OrderedSet#add` is amortized O(log32 N), but not - * stable. - */ - export module OrderedSet { - - /** - * True if the provided value is an OrderedSet. - */ - function isOrderedSet(maybeOrderedSet: any): boolean; - - /** - * Creates a new OrderedSet containing `values`. - */ - function of(...values: T[]): OrderedSet; - - /** - * `OrderedSet.fromKeys()` creates a new immutable OrderedSet containing - * the keys from this Iterable or JavaScript Object. - */ - function fromKeys(iter: Iterable): OrderedSet; - function fromKeys(obj: {[key: string]: any}): OrderedSet; - } - - /** - * Create a new immutable OrderedSet containing the values of the provided - * iterable-like. - */ - export function OrderedSet(): OrderedSet; - export function OrderedSet(iter: Iterable.Set): OrderedSet; - export function OrderedSet(iter: Iterable.Indexed): OrderedSet; - export function OrderedSet(iter: Iterable.Keyed): OrderedSet; - export function OrderedSet(array: Array): OrderedSet; - export function OrderedSet(iterator: Iterator): OrderedSet; - export function OrderedSet(iterable: /*Iterable*/Object): OrderedSet; - - export interface OrderedSet extends Set {} - - - /** - * Stacks are indexed collections which support very efficient O(1) addition - * and removal from the front using `unshift(v)` and `shift()`. - * - * For familiarity, Stack also provides `push(v)`, `pop()`, and `peek()`, but - * be aware that they also operate on the front of the list, unlike List or - * a JavaScript Array. - * - * Note: `reverse()` or any inherent reverse traversal (`reduceRight`, - * `lastIndexOf`, etc.) is not efficient with a Stack. - * - * Stack is implemented with a Single-Linked List. - */ - export module Stack { - - /** - * True if the provided value is a Stack - */ - function isStack(maybeStack: any): boolean; - - /** - * Creates a new Stack containing `values`. - */ - function of(...values: T[]): Stack; - } - - /** - * Create a new immutable Stack containing the values of the provided - * iterable-like. - * - * The iteration order of the provided iterable is preserved in the - * resulting `Stack`. - */ - export function Stack(): Stack; - export function Stack(iter: Iterable.Indexed): Stack; - export function Stack(iter: Iterable.Set): Stack; - export function Stack(iter: Iterable.Keyed): Stack; - export function Stack(array: Array): Stack; - export function Stack(iterator: Iterator): Stack; - export function Stack(iterable: /*Iterable*/Object): Stack; - - export interface Stack extends Collection.Indexed { - - // Reading values - - /** - * Alias for `Stack.first()`. - */ - peek(): T; - - - // Persistent changes - - /** - * Returns a new Stack with 0 size and no values. - */ - clear(): Stack; - - /** - * Returns a new Stack with the provided `values` prepended, shifting other - * values ahead to higher indices. - * - * This is very efficient for Stack. - */ - unshift(...values: T[]): Stack; - - /** - * Like `Stack#unshift`, but accepts a iterable rather than varargs. - */ - unshiftAll(iter: Iterable): Stack; - unshiftAll(iter: Array): Stack; - - /** - * Returns a new Stack with a size ones less than this Stack, excluding - * the first item in this Stack, shifting all other values to a lower index. - * - * Note: this differs from `Array#shift` because it returns a new - * Stack rather than the removed value. Use `first()` or `peek()` to get the - * first value in this Stack. - */ - shift(): Stack; - - /** - * Alias for `Stack#unshift` and is not equivalent to `List#push`. - */ - push(...values: T[]): Stack; - - /** - * Alias for `Stack#unshiftAll`. - */ - pushAll(iter: Iterable): Stack; - pushAll(iter: Array): Stack; - - /** - * Alias for `Stack#shift` and is not equivalent to `List#pop`. - */ - pop(): Stack; - - - // Transient changes - - /** - * Note: Not all methods can be used on a mutable collection or within - * `withMutations`! Only `set`, `push`, and `pop` may be used mutatively. - * - * @see `Map#withMutations` - */ - withMutations(mutator: (mutable: Stack) => any): Stack; - - /** - * @see `Map#asMutable` - */ - asMutable(): Stack; - - /** - * @see `Map#asImmutable` - */ - asImmutable(): Stack; - } - - - /** - * Returns a Seq.Indexed of numbers from `start` (inclusive) to `end` - * (exclusive), by `step`, where `start` defaults to 0, `step` to 1, and `end` to - * infinity. When `start` is equal to `end`, returns empty range. - * - * Range() // [0,1,2,3,...] - * Range(10) // [10,11,12,13,...] - * Range(10,15) // [10,11,12,13,14] - * Range(10,30,5) // [10,15,20,25] - * Range(30,10,5) // [30,25,20,15] - * Range(30,30,5) // [] - * - */ - export function Range(start?: number, end?: number, step?: number): Seq.Indexed; - - - /** - * Returns a Seq.Indexed of `value` repeated `times` times. When `times` is - * not defined, returns an infinite `Seq` of `value`. - * - * Repeat('foo') // ['foo','foo','foo',...] - * Repeat('bar',4) // ['bar','bar','bar','bar'] - * - */ - export function Repeat(value: T, times?: number): Seq.Indexed; - - - /** - * Creates a new Class which produces Record instances. A record is similar to - * a JS object, but enforce a specific set of allowed string keys, and have - * default values. - * - * var ABRecord = Record({a:1, b:2}) - * var myRecord = new ABRecord({b:3}) - * - * Records always have a value for the keys they define. `remove`ing a key - * from a record simply resets it to the default value for that key. - * - * myRecord.size // 2 - * myRecord.get('a') // 1 - * myRecord.get('b') // 3 - * myRecordWithoutB = myRecord.remove('b') - * myRecordWithoutB.get('b') // 2 - * myRecordWithoutB.size // 2 - * - * Values provided to the constructor not found in the Record type will - * be ignored. For example, in this case, ABRecord is provided a key "x" even - * though only "a" and "b" have been defined. The value for "x" will be - * ignored for this record. - * - * var myRecord = new ABRecord({b:3, x:10}) - * myRecord.get('x') // undefined - * - * Because Records have a known set of string keys, property get access works - * as expected, however property sets will throw an Error. - * - * Note: IE8 does not support property access. Only use `get()` when - * supporting IE8. - * - * myRecord.b // 3 - * myRecord.b = 5 // throws Error - * - * Record Classes can be extended as well, allowing for custom methods on your - * Record. This is not a common pattern in functional environments, but is in - * many JS programs. - * - * Note: TypeScript does not support this type of subclassing. - * - * class ABRecord extends Record({a:1,b:2}) { - * getAB() { - * return this.a + this.b; - * } - * } - * - * var myRecord = new ABRecord({b: 3}) - * myRecord.getAB() // 4 - * - */ - export module Record { - export interface Class { - new (): Map; - new (values: {[key: string]: any}): Map; - new (values: Iterable): Map; // deprecated - - (): Map; - (values: {[key: string]: any}): Map; - (values: Iterable): Map; // deprecated - } - } - - export function Record( - defaultValues: {[key: string]: any}, name?: string - ): Record.Class; - - - /** - * Represents a sequence of values, but may not be backed by a concrete data - * structure. - * - * **Seq is immutable** — Once a Seq is created, it cannot be - * changed, appended to, rearranged or otherwise modified. Instead, any - * mutative method called on a `Seq` will return a new `Seq`. - * - * **Seq is lazy** — Seq does as little work as necessary to respond to any - * method call. Values are often created during iteration, including implicit - * iteration when reducing or converting to a concrete data structure such as - * a `List` or JavaScript `Array`. - * - * For example, the following performs no work, because the resulting - * Seq's values are never iterated: - * - * var oddSquares = Immutable.Seq.of(1,2,3,4,5,6,7,8) - * .filter(x => x % 2).map(x => x * x); - * - * Once the Seq is used, it performs only the work necessary. In this - * example, no intermediate data structures are ever created, filter is only - * called three times, and map is only called once: - * - * console.log(oddSquares.get(1)); // 9 - * - * Seq allows for the efficient chaining of operations, - * allowing for the expression of logic that can otherwise be very tedious: - * - * Immutable.Seq({a:1, b:1, c:1}) - * .flip().map(key => key.toUpperCase()).flip().toObject(); - * // Map { A: 1, B: 1, C: 1 } - * - * As well as expressing logic that would otherwise be memory or time limited: - * - * Immutable.Range(1, Infinity) - * .skip(1000) - * .map(n => -n) - * .filter(n => n % 2 === 0) - * .take(2) - * .reduce((r, n) => r * n, 1); - * // 1006008 - * - * Seq is often used to provide a rich collection API to JavaScript Object. - * - * Immutable.Seq({ x: 0, y: 1, z: 2 }).map(v => v * 2).toObject(); - * // { x: 0, y: 2, z: 4 } - */ - - export module Seq { - /** - * True if `maybeSeq` is a Seq, it is not backed by a concrete - * structure such as Map, List, or Set. - */ - function isSeq(maybeSeq: any): boolean; - - /** - * Returns a Seq of the values provided. Alias for `Seq.Indexed.of()`. - */ - function of(...values: T[]): Seq.Indexed; - - - /** - * `Seq` which represents key-value pairs. - */ - export module Keyed {} - - /** - * Always returns a Seq.Keyed, if input is not keyed, expects an - * iterable of [K, V] tuples. - */ - export function Keyed(): Seq.Keyed; - export function Keyed(seq: Iterable.Keyed): Seq.Keyed; - export function Keyed(seq: Iterable): Seq.Keyed; - export function Keyed(array: Array): Seq.Keyed; - export function Keyed(obj: {[key: string]: V}): Seq.Keyed; - export function Keyed(iterator: Iterator): Seq.Keyed; - export function Keyed(iterable: /*Iterable<[K,V]>*/Object): Seq.Keyed; - - export interface Keyed extends Seq, Iterable.Keyed { - - /** - * Returns itself - */ - toSeq(): /*this*/Seq.Keyed - } - - - /** - * `Seq` which represents an ordered indexed list of values. - */ - module Indexed { - - /** - * Provides an Seq.Indexed of the values provided. - */ - function of(...values: T[]): Seq.Indexed; - } - - /** - * Always returns Seq.Indexed, discarding associated keys and - * supplying incrementing indices. - */ - export function Indexed(): Seq.Indexed; - export function Indexed(seq: Iterable.Indexed): Seq.Indexed; - export function Indexed(seq: Iterable.Set): Seq.Indexed; - export function Indexed(seq: Iterable.Keyed): Seq.Indexed; - export function Indexed(array: Array): Seq.Indexed; - export function Indexed(iterator: Iterator): Seq.Indexed; - export function Indexed(iterable: /*Iterable*/Object): Seq.Indexed; - - export interface Indexed extends Seq, Iterable.Indexed { - - /** - * Returns itself - */ - toSeq(): /*this*/Seq.Indexed - } - - - /** - * `Seq` which represents a set of values. - * - * Because `Seq` are often lazy, `Seq.Set` does not provide the same guarantee - * of value uniqueness as the concrete `Set`. - */ - export module Set { - - /** - * Returns a Seq.Set of the provided values - */ - function of(...values: T[]): Seq.Set; - } - - /** - * Always returns a Seq.Set, discarding associated indices or keys. - */ - export function Set(): Seq.Set; - export function Set(seq: Iterable.Set): Seq.Set; - export function Set(seq: Iterable.Indexed): Seq.Set; - export function Set(seq: Iterable.Keyed): Seq.Set; - export function Set(array: Array): Seq.Set; - export function Set(iterator: Iterator): Seq.Set; - export function Set(iterable: /*Iterable*/Object): Seq.Set; - - export interface Set extends Seq, Iterable.Set { - - /** - * Returns itself - */ - toSeq(): /*this*/Seq.Set - } - - } - - /** - * Creates a Seq. - * - * Returns a particular kind of `Seq` based on the input. - * - * * If a `Seq`, that same `Seq`. - * * If an `Iterable`, a `Seq` of the same kind (Keyed, Indexed, or Set). - * * If an Array-like, an `Seq.Indexed`. - * * If an Object with an Iterator, an `Seq.Indexed`. - * * If an Iterator, an `Seq.Indexed`. - * * If an Object, a `Seq.Keyed`. - * - */ - export function Seq(): Seq; - export function Seq(seq: Seq): Seq; - export function Seq(iterable: Iterable): Seq; - export function Seq(array: Array): Seq.Indexed; - export function Seq(obj: {[key: string]: V}): Seq.Keyed; - export function Seq(iterator: Iterator): Seq.Indexed; - export function Seq(iterable: /*ES6Iterable*/Object): Seq.Indexed; - - export interface Seq extends Iterable { - - /** - * Some Seqs can describe their size lazily. When this is the case, - * size will be an integer. Otherwise it will be undefined. - * - * For example, Seqs returned from `map()` or `reverse()` - * preserve the size of the original `Seq` while `filter()` does not. - * - * Note: `Range`, `Repeat` and `Seq`s made from `Array`s and `Object`s will - * always have a size. - */ - size: number/*?*/; - - - // Force evaluation - - /** - * Because Sequences are lazy and designed to be chained together, they do - * not cache their results. For example, this map function is called a total - * of 6 times, as each `join` iterates the Seq of three values. - * - * var squares = Seq.of(1,2,3).map(x => x * x); - * squares.join() + squares.join(); - * - * If you know a `Seq` will be used multiple times, it may be more - * efficient to first cache it in memory. Here, the map function is called - * only 3 times. - * - * var squares = Seq.of(1,2,3).map(x => x * x).cacheResult(); - * squares.join() + squares.join(); - * - * Use this method judiciously, as it must fully evaluate a Seq which can be - * a burden on memory and possibly performance. - * - * Note: after calling `cacheResult`, a Seq will always have a `size`. - */ - cacheResult(): /*this*/Seq; - } - - /** - * The `Iterable` is a set of (key, value) entries which can be iterated, and - * is the base class for all collections in `immutable`, allowing them to - * make use of all the Iterable methods (such as `map` and `filter`). - * - * Note: An iterable is always iterated in the same order, however that order - * may not always be well defined, as is the case for the `Map` and `Set`. - */ - export module Iterable { - /** - * True if `maybeIterable` is an Iterable, or any of its subclasses. - */ - function isIterable(maybeIterable: any): boolean; - - /** - * True if `maybeKeyed` is an Iterable.Keyed, or any of its subclasses. - */ - function isKeyed(maybeKeyed: any): boolean; - - /** - * True if `maybeIndexed` is a Iterable.Indexed, or any of its subclasses. - */ - function isIndexed(maybeIndexed: any): boolean; - - /** - * True if `maybeAssociative` is either a keyed or indexed Iterable. - */ - function isAssociative(maybeAssociative: any): boolean; - - /** - * True if `maybeOrdered` is an Iterable where iteration order is well - * defined. True for Iterable.Indexed as well as OrderedMap and OrderedSet. - */ - function isOrdered(maybeOrdered: any): boolean; - - - /** - * Keyed Iterables have discrete keys tied to each value. - * - * When iterating `Iterable.Keyed`, each iteration will yield a `[K, V]` - * tuple, in other words, `Iterable#entries` is the default iterator for - * Keyed Iterables. - */ - export module Keyed {} - - /** - * Creates an Iterable.Keyed - * - * Similar to `Iterable()`, however it expects iterable-likes of [K, V] - * tuples if not constructed from a Iterable.Keyed or JS Object. - */ - export function Keyed(iter: Iterable.Keyed): Iterable.Keyed; - export function Keyed(iter: Iterable): Iterable.Keyed; - export function Keyed(array: Array): Iterable.Keyed; - export function Keyed(obj: {[key: string]: V}): Iterable.Keyed; - export function Keyed(iterator: Iterator): Iterable.Keyed; - export function Keyed(iterable: /*Iterable<[K,V]>*/Object): Iterable.Keyed; - - export interface Keyed extends Iterable { - - /** - * Returns Seq.Keyed. - * @override - */ - toSeq(): Seq.Keyed; - - - // Sequence functions - - /** - * Returns a new Iterable.Keyed of the same type where the keys and values - * have been flipped. - * - * Seq({ a: 'z', b: 'y' }).flip() // { z: 'a', y: 'b' } - * - */ - flip(): /*this*/Iterable.Keyed; - - /** - * Returns a new Iterable.Keyed of the same type with keys passed through - * a `mapper` function. - * - * Seq({ a: 1, b: 2 }) - * .mapKeys(x => x.toUpperCase()) - * // Seq { A: 1, B: 2 } - * - */ - mapKeys( - mapper: (key?: K, value?: V, iter?: /*this*/Iterable.Keyed) => M, - context?: any - ): /*this*/Iterable.Keyed; - - /** - * Returns a new Iterable.Keyed of the same type with entries - * ([key, value] tuples) passed through a `mapper` function. - * - * Seq({ a: 1, b: 2 }) - * .mapEntries(([k, v]) => [k.toUpperCase(), v * 2]) - * // Seq { A: 2, B: 4 } - * - */ - mapEntries( - mapper: ( - entry?: /*(K, V)*/Array, - index?: number, - iter?: /*this*/Iterable.Keyed - ) => /*[KM, VM]*/Array, - context?: any - ): /*this*/Iterable.Keyed; - } - - - /** - * Indexed Iterables have incrementing numeric keys. They exhibit - * slightly different behavior than `Iterable.Keyed` for some methods in order - * to better mirror the behavior of JavaScript's `Array`, and add methods - * which do not make sense on non-indexed Iterables such as `indexOf`. - * - * Unlike JavaScript arrays, `Iterable.Indexed`s are always dense. "Unset" - * indices and `undefined` indices are indistinguishable, and all indices from - * 0 to `size` are visited when iterated. - * - * All Iterable.Indexed methods return re-indexed Iterables. In other words, - * indices always start at 0 and increment until size. If you wish to - * preserve indices, using them as keys, convert to a Iterable.Keyed by - * calling `toKeyedSeq`. - */ - export module Indexed {} - - /** - * Creates a new Iterable.Indexed. - */ - export function Indexed(iter: Iterable.Indexed): Iterable.Indexed; - export function Indexed(iter: Iterable.Set): Iterable.Indexed; - export function Indexed(iter: Iterable.Keyed): Iterable.Indexed; - export function Indexed(array: Array): Iterable.Indexed; - export function Indexed(iterator: Iterator): Iterable.Indexed; - export function Indexed(iterable: /*Iterable*/Object): Iterable.Indexed; - - export interface Indexed extends Iterable { - - // Reading values - - /** - * Returns the value associated with the provided index, or notSetValue if - * the index is beyond the bounds of the Iterable. - * - * `index` may be a negative number, which indexes back from the end of the - * Iterable. `s.get(-1)` gets the last item in the Iterable. - */ - get(index: number, notSetValue?: T): T; - - - // Conversion to Seq - - /** - * Returns Seq.Indexed. - * @override - */ - toSeq(): Seq.Indexed; - - /** - * If this is an iterable of [key, value] entry tuples, it will return a - * Seq.Keyed of those entries. - */ - fromEntrySeq(): Seq.Keyed; - - - // Combination - - /** - * Returns an Iterable of the same type with `separator` between each item - * in this Iterable. - */ - interpose(separator: T): /*this*/Iterable.Indexed; - - /** - * Returns an Iterable of the same type with the provided `iterables` - * interleaved into this iterable. - * - * The resulting Iterable includes the first item from each, then the - * second from each, etc. - * - * I.Seq.of(1,2,3).interleave(I.Seq.of('A','B','C')) - * // Seq [ 1, 'A', 2, 'B', 3, 'C' ] - * - * The shortest Iterable stops interleave. - * - * I.Seq.of(1,2,3).interleave( - * I.Seq.of('A','B'), - * I.Seq.of('X','Y','Z') - * ) - * // Seq [ 1, 'A', 'X', 2, 'B', 'Y' ] - */ - interleave(...iterables: Array>): /*this*/Iterable.Indexed; - - /** - * Splice returns a new indexed Iterable by replacing a region of this - * Iterable with new values. If values are not provided, it only skips the - * region to be removed. - * - * `index` may be a negative number, which indexes back from the end of the - * Iterable. `s.splice(-2)` splices after the second to last item. - * - * Seq(['a','b','c','d']).splice(1, 2, 'q', 'r', 's') - * // Seq ['a', 'q', 'r', 's', 'd'] - * - */ - splice( - index: number, - removeNum: number, - ...values: /*Array | T>*/any[] - ): /*this*/Iterable.Indexed; - - /** - * Returns an Iterable of the same type "zipped" with the provided - * iterables. - * - * Like `zipWith`, but using the default `zipper`: creating an `Array`. - * - * var a = Seq.of(1, 2, 3); - * var b = Seq.of(4, 5, 6); - * var c = a.zip(b); // Seq [ [ 1, 4 ], [ 2, 5 ], [ 3, 6 ] ] - * - */ - zip(...iterables: Array>): /*this*/Iterable.Indexed; - - /** - * Returns an Iterable of the same type "zipped" with the provided - * iterables by using a custom `zipper` function. - * - * var a = Seq.of(1, 2, 3); - * var b = Seq.of(4, 5, 6); - * var c = a.zipWith((a, b) => a + b, b); // Seq [ 5, 7, 9 ] - * - */ - zipWith( - zipper: (value: T, otherValue: U) => Z, - otherIterable: Iterable - ): Iterable.Indexed; - zipWith( - zipper: (value: T, otherValue: U, thirdValue: V) => Z, - otherIterable: Iterable, - thirdIterable: Iterable - ): Iterable.Indexed; - zipWith( - zipper: (...any: Array) => Z, - ...iterables: Array> - ): Iterable.Indexed; - - - // Search for value - - /** - * Returns the first index at which a given value can be found in the - * Iterable, or -1 if it is not present. - */ - indexOf(searchValue: T): number; - - /** - * Returns the last index at which a given value can be found in the - * Iterable, or -1 if it is not present. - */ - lastIndexOf(searchValue: T): number; - - /** - * Returns the first index in the Iterable where a value satisfies the - * provided predicate function. Otherwise -1 is returned. - */ - findIndex( - predicate: (value?: T, index?: number, iter?: /*this*/Iterable.Indexed) => boolean, - context?: any - ): number; - - /** - * Returns the last index in the Iterable where a value satisfies the - * provided predicate function. Otherwise -1 is returned. - */ - findLastIndex( - predicate: (value?: T, index?: number, iter?: /*this*/Iterable.Indexed) => boolean, - context?: any - ): number; - } - - - /** - * Set Iterables only represent values. They have no associated keys or - * indices. Duplicate values are possible in Seq.Sets, however the - * concrete `Set` does not allow duplicate values. - * - * Iterable methods on Iterable.Set such as `map` and `forEach` will provide - * the value as both the first and second arguments to the provided function. - * - * var seq = Seq.Set.of('A', 'B', 'C'); - * assert.equal(seq.every((v, k) => v === k), true); - * - */ - export module Set {} - - /** - * Similar to `Iterable()`, but always returns a Iterable.Set. - */ - export function Set(iter: Iterable.Set): Iterable.Set; - export function Set(iter: Iterable.Indexed): Iterable.Set; - export function Set(iter: Iterable.Keyed): Iterable.Set; - export function Set(array: Array): Iterable.Set; - export function Set(iterator: Iterator): Iterable.Set; - export function Set(iterable: /*Iterable*/Object): Iterable.Set; - - export interface Set extends Iterable { - - /** - * Returns Seq.Set. - * @override - */ - toSeq(): Seq.Set; - } - - } - - /** - * Creates an Iterable. - * - * The type of Iterable created is based on the input. - * - * * If an `Iterable`, that same `Iterable`. - * * If an Array-like, an `Iterable.Indexed`. - * * If an Object with an Iterator, an `Iterable.Indexed`. - * * If an Iterator, an `Iterable.Indexed`. - * * If an Object, an `Iterable.Keyed`. - * - * This methods forces the conversion of Objects and Strings to Iterables. - * If you want to ensure that a Iterable of one item is returned, use - * `Seq.of`. - */ - export function Iterable(iterable: Iterable): Iterable; - export function Iterable(array: Array): Iterable.Indexed; - export function Iterable(obj: {[key: string]: V}): Iterable.Keyed; - export function Iterable(iterator: Iterator): Iterable.Indexed; - export function Iterable(iterable: /*ES6Iterable*/Object): Iterable.Indexed; - export function Iterable(value: V): Iterable.Indexed; - - export interface Iterable { - - // Value equality - - /** - * True if this and the other Iterable have value equality, as defined - * by `Immutable.is()`. - * - * Note: This is equivalent to `Immutable.is(this, other)`, but provided to - * allow for chained expressions. - */ - equals(other: Iterable): boolean; - - /** - * Computes and returns the hashed identity for this Iterable. - * - * The `hashCode` of an Iterable is used to determine potential equality, - * and is used when adding this to a `Set` or as a key in a `Map`, enabling - * lookup via a different instance. - * - * var a = List.of(1, 2, 3); - * var b = List.of(1, 2, 3); - * assert(a !== b); // different instances - * var set = Set.of(a); - * assert(set.has(b) === true); - * - * If two values have the same `hashCode`, they are [not guaranteed - * to be equal][Hash Collision]. If two values have different `hashCode`s, - * they must not be equal. - * - * [Hash Collision]: http://en.wikipedia.org/wiki/Collision_(computer_science) - */ - hashCode(): number; - - - // Reading values - - /** - * Returns the value associated with the provided key, or notSetValue if - * the Iterable does not contain this key. - * - * Note: it is possible a key may be associated with an `undefined` value, - * so if `notSetValue` is not provided and this method returns `undefined`, - * that does not guarantee the key was not found. - */ - get(key: K, notSetValue?: V): V; - - /** - * True if a key exists within this `Iterable`, using `Immutable.is` to determine equality - */ - has(key: K): boolean; - - /** - * True if a value exists within this `Iterable`, using `Immutable.is` to determine equality - * @alias contains - */ - includes(value: V): boolean; - contains(value: V): boolean; - - /** - * The first value in the Iterable. - */ - first(): V; - - /** - * The last value in the Iterable. - */ - last(): V; - - - // Reading deep values - - /** - * Returns the value found by following a path of keys or indices through - * nested Iterables. - */ - getIn(searchKeyPath: Array, notSetValue?: any): any; - getIn(searchKeyPath: Iterable, notSetValue?: any): any; - - /** - * True if the result of following a path of keys or indices through nested - * Iterables results in a set value. - */ - hasIn(searchKeyPath: Array): boolean; - hasIn(searchKeyPath: Iterable): boolean; - - - // Conversion to JavaScript types - - /** - * Deeply converts this Iterable to equivalent JS. - * - * `Iterable.Indexeds`, and `Iterable.Sets` become Arrays, while - * `Iterable.Keyeds` become Objects. - * - * @alias toJSON - */ - toJS(): any; - - /** - * Shallowly converts this iterable to an Array, discarding keys. - */ - toArray(): Array; - - /** - * Shallowly converts this Iterable to an Object. - * - * Throws if keys are not strings. - */ - toObject(): { [key: string]: V }; - - - // Conversion to Collections - - /** - * Converts this Iterable to a Map, Throws if keys are not hashable. - * - * Note: This is equivalent to `Map(this.toKeyedSeq())`, but provided - * for convenience and to allow for chained expressions. - */ - toMap(): Map; - - /** - * Converts this Iterable to a Map, maintaining the order of iteration. - * - * Note: This is equivalent to `OrderedMap(this.toKeyedSeq())`, but - * provided for convenience and to allow for chained expressions. - */ - toOrderedMap(): OrderedMap; - - /** - * Converts this Iterable to a Set, discarding keys. Throws if values - * are not hashable. - * - * Note: This is equivalent to `Set(this)`, but provided to allow for - * chained expressions. - */ - toSet(): Set; - - /** - * Converts this Iterable to a Set, maintaining the order of iteration and - * discarding keys. - * - * Note: This is equivalent to `OrderedSet(this.valueSeq())`, but provided - * for convenience and to allow for chained expressions. - */ - toOrderedSet(): OrderedSet; - - /** - * Converts this Iterable to a List, discarding keys. - * - * Note: This is equivalent to `List(this)`, but provided to allow - * for chained expressions. - */ - toList(): List; - - /** - * Converts this Iterable to a Stack, discarding keys. Throws if values - * are not hashable. - * - * Note: This is equivalent to `Stack(this)`, but provided to allow for - * chained expressions. - */ - toStack(): Stack; - - - // Conversion to Seq - - /** - * Converts this Iterable to a Seq of the same kind (indexed, - * keyed, or set). - */ - toSeq(): Seq; - - /** - * Returns a Seq.Keyed from this Iterable where indices are treated as keys. - * - * This is useful if you want to operate on an - * Iterable.Indexed and preserve the [index, value] pairs. - * - * The returned Seq will have identical iteration order as - * this Iterable. - * - * Example: - * - * var indexedSeq = Immutable.Seq.of('A', 'B', 'C'); - * indexedSeq.filter(v => v === 'B').toString() // Seq [ 'B' ] - * var keyedSeq = indexedSeq.toKeyedSeq(); - * keyedSeq.filter(v => v === 'B').toString() // Seq { 1: 'B' } - * - */ - toKeyedSeq(): Seq.Keyed; - - /** - * Returns an Seq.Indexed of the values of this Iterable, discarding keys. - */ - toIndexedSeq(): Seq.Indexed; - - /** - * Returns a Seq.Set of the values of this Iterable, discarding keys. - */ - toSetSeq(): Seq.Set; - - - // Iterators - - /** - * An iterator of this `Iterable`'s keys. - * - * Note: this will return an ES6 iterator which does not support Immutable JS sequence algorithms. Use `keySeq` instead, if this is what you want. - */ - keys(): Iterator; - - /** - * An iterator of this `Iterable`'s values. - * - * Note: this will return an ES6 iterator which does not support Immutable JS sequence algorithms. Use `valueSeq` instead, if this is what you want. - */ - values(): Iterator; - - /** - * An iterator of this `Iterable`'s entries as `[key, value]` tuples. - * - * Note: this will return an ES6 iterator which does not support Immutable JS sequence algorithms. Use `entrySeq` instead, if this is what you want. - */ - entries(): Iterator>; - - - // Iterables (Seq) - - /** - * Returns a new Seq.Indexed of the keys of this Iterable, - * discarding values. - */ - keySeq(): Seq.Indexed; - - /** - * Returns an Seq.Indexed of the values of this Iterable, discarding keys. - */ - valueSeq(): Seq.Indexed; - - /** - * Returns a new Seq.Indexed of [key, value] tuples. - */ - entrySeq(): Seq.Indexed>; - - - // Sequence algorithms - - /** - * Returns a new Iterable of the same type with values passed through a - * `mapper` function. - * - * Seq({ a: 1, b: 2 }).map(x => 10 * x) - * // Seq { a: 10, b: 20 } - * - */ - map( - mapper: (value?: V, key?: K, iter?: /*this*/Iterable) => M, - context?: any - ): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type with only the entries for which - * the `predicate` function returns true. - * - * Seq({a:1,b:2,c:3,d:4}).filter(x => x % 2 === 0) - * // Seq { b: 2, d: 4 } - * - */ - filter( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any - ): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type with only the entries for which - * the `predicate` function returns false. - * - * Seq({a:1,b:2,c:3,d:4}).filterNot(x => x % 2 === 0) - * // Seq { a: 1, c: 3 } - * - */ - filterNot( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any - ): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type in reverse order. - */ - reverse(): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type which includes the same entries, - * stably sorted by using a `comparator`. - * - * If a `comparator` is not provided, a default comparator uses `<` and `>`. - * - * `comparator(valueA, valueB)`: - * - * * Returns `0` if the elements should not be swapped. - * * Returns `-1` (or any negative number) if `valueA` comes before `valueB` - * * Returns `1` (or any positive number) if `valueA` comes after `valueB` - * * Is pure, i.e. it must always return the same value for the same pair - * of values. - * - * When sorting collections which have no defined order, their ordered - * equivalents will be returned. e.g. `map.sort()` returns OrderedMap. - */ - sort(comparator?: (valueA: V, valueB: V) => number): /*this*/Iterable; - - /** - * Like `sort`, but also accepts a `comparatorValueMapper` which allows for - * sorting by more sophisticated means: - * - * hitters.sortBy(hitter => hitter.avgHits); - * - */ - sortBy( - comparatorValueMapper: (value?: V, key?: K, iter?: /*this*/Iterable) => C, - comparator?: (valueA: C, valueB: C) => number - ): /*this*/Iterable; - - /** - * Returns a `Iterable.Keyed` of `Iterable.Keyeds`, grouped by the return - * value of the `grouper` function. - * - * Note: This is always an eager operation. - */ - groupBy( - grouper: (value?: V, key?: K, iter?: /*this*/Iterable) => G, - context?: any - ): /*Map*/Seq.Keyed>; - - - // Side effects - - /** - * The `sideEffect` is executed for every entry in the Iterable. - * - * Unlike `Array#forEach`, if any call of `sideEffect` returns - * `false`, the iteration will stop. Returns the number of entries iterated - * (including the last iteration which returned false). - */ - forEach( - sideEffect: (value?: V, key?: K, iter?: /*this*/Iterable) => any, - context?: any - ): number; - - - // Creating subsets - - /** - * Returns a new Iterable of the same type representing a portion of this - * Iterable from start up to but not including end. - * - * If begin is negative, it is offset from the end of the Iterable. e.g. - * `slice(-2)` returns a Iterable of the last two entries. If it is not - * provided the new Iterable will begin at the beginning of this Iterable. - * - * If end is negative, it is offset from the end of the Iterable. e.g. - * `slice(0, -1)` returns an Iterable of everything but the last entry. If - * it is not provided, the new Iterable will continue through the end of - * this Iterable. - * - * If the requested slice is equivalent to the current Iterable, then it - * will return itself. - */ - slice(begin?: number, end?: number): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type containing all entries except - * the first. - */ - rest(): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type containing all entries except - * the last. - */ - butLast(): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type which excludes the first `amount` - * entries from this Iterable. - */ - skip(amount: number): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type which excludes the last `amount` - * entries from this Iterable. - */ - skipLast(amount: number): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type which includes entries starting - * from when `predicate` first returns false. - * - * Seq.of('dog','frog','cat','hat','god') - * .skipWhile(x => x.match(/g/)) - * // Seq [ 'cat', 'hat', 'god' ] - * - */ - skipWhile( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any - ): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type which includes entries starting - * from when `predicate` first returns true. - * - * Seq.of('dog','frog','cat','hat','god') - * .skipUntil(x => x.match(/hat/)) - * // Seq [ 'hat', 'god' ] - * - */ - skipUntil( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any - ): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type which includes the first `amount` - * entries from this Iterable. - */ - take(amount: number): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type which includes the last `amount` - * entries from this Iterable. - */ - takeLast(amount: number): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type which includes entries from this - * Iterable as long as the `predicate` returns true. - * - * Seq.of('dog','frog','cat','hat','god') - * .takeWhile(x => x.match(/o/)) - * // Seq [ 'dog', 'frog' ] - * - */ - takeWhile( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any - ): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type which includes entries from this - * Iterable as long as the `predicate` returns false. - * - * Seq.of('dog','frog','cat','hat','god').takeUntil(x => x.match(/at/)) - * // ['dog', 'frog'] - * - */ - takeUntil( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any - ): /*this*/Iterable; - - - // Combination - - /** - * Returns a new Iterable of the same type with other values and - * iterable-like concatenated to this one. - * - * For Seqs, all entries will be present in - * the resulting iterable, even if they have the same key. - */ - concat(...valuesOrIterables: /*Array|V*/any[]): /*this*/Iterable; - - /** - * Flattens nested Iterables. - * - * Will deeply flatten the Iterable by default, returning an Iterable of the - * same type, but a `depth` can be provided in the form of a number or - * boolean (where true means to shallowly flatten one level). A depth of 0 - * (or shallow: false) will deeply flatten. - * - * Flattens only others Iterable, not Arrays or Objects. - * - * Note: `flatten(true)` operates on Iterable> and - * returns Iterable - */ - flatten(depth?: number): /*this*/Iterable; - flatten(shallow?: boolean): /*this*/Iterable; - - /** - * Flat-maps the Iterable, returning an Iterable of the same type. - * - * Similar to `iter.map(...).flatten(true)`. - */ - flatMap( - mapper: (value?: V, key?: K, iter?: /*this*/Iterable) => Iterable, - context?: any - ): /*this*/Iterable; - flatMap( - mapper: (value?: V, key?: K, iter?: /*this*/Iterable) => /*iterable-like*/any, - context?: any - ): /*this*/Iterable; - - - // Reducing a value - - /** - * Reduces the Iterable to a value by calling the `reducer` for every entry - * in the Iterable and passing along the reduced value. - * - * If `initialReduction` is not provided, or is null, the first item in the - * Iterable will be used. - * - * @see `Array#reduce`. - */ - reduce( - reducer: (reduction?: R, value?: V, key?: K, iter?: /*this*/Iterable) => R, - initialReduction?: R, - context?: any - ): R; - - /** - * Reduces the Iterable in reverse (from the right side). - * - * Note: Similar to this.reverse().reduce(), and provided for parity - * with `Array#reduceRight`. - */ - reduceRight( - reducer: (reduction?: R, value?: V, key?: K, iter?: /*this*/Iterable) => R, - initialReduction?: R, - context?: any - ): R; - - /** - * True if `predicate` returns true for all entries in the Iterable. - */ - every( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any - ): boolean; - - /** - * True if `predicate` returns true for any entry in the Iterable. - */ - some( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any - ): boolean; - - /** - * Joins values together as a string, inserting a separator between each. - * The default separator is `","`. - */ - join(separator?: string): string; - - /** - * Returns true if this Iterable includes no values. - * - * For some lazy `Seq`, `isEmpty` might need to iterate to determine - * emptiness. At most one iteration will occur. - */ - isEmpty(): boolean; - - /** - * Returns the size of this Iterable. - * - * Regardless of if this Iterable can describe its size lazily (some Seqs - * cannot), this method will always return the correct size. E.g. it - * evaluates a lazy `Seq` if necessary. - * - * If `predicate` is provided, then this returns the count of entries in the - * Iterable for which the `predicate` returns true. - */ - count(): number; - count( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any - ): number; - - /** - * Returns a `Seq.Keyed` of counts, grouped by the return value of - * the `grouper` function. - * - * Note: This is not a lazy operation. - */ - countBy( - grouper: (value?: V, key?: K, iter?: /*this*/Iterable) => G, - context?: any - ): Map; - - - // Search for value - - /** - * Returns the first value for which the `predicate` returns true. - */ - find( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any, - notSetValue?: V - ): V; - - /** - * Returns the last value for which the `predicate` returns true. - * - * Note: `predicate` will be called for each entry in reverse. - */ - findLast( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any, - notSetValue?: V - ): V; - - /** - * Returns the first [key, value] entry for which the `predicate` returns true. - */ - findEntry( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any, - notSetValue?: V - ): /*[K, V]*/Array; - - /** - * Returns the last [key, value] entry for which the `predicate` - * returns true. - * - * Note: `predicate` will be called for each entry in reverse. - */ - findLastEntry( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any, - notSetValue?: V - ): /*[K, V]*/Array; - - /** - * Returns the key for which the `predicate` returns true. - */ - findKey( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable.Keyed) => boolean, - context?: any - ): K; - - /** - * Returns the last key for which the `predicate` returns true. - * - * Note: `predicate` will be called for each entry in reverse. - */ - findLastKey( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable.Keyed) => boolean, - context?: any - ): K; - - /** - * Returns the key associated with the search value, or undefined. - */ - keyOf(searchValue: V): K; - - /** - * Returns the last key associated with the search value, or undefined. - */ - lastKeyOf(searchValue: V): K; - - /** - * Returns the maximum value in this collection. If any values are - * comparatively equivalent, the first one found will be returned. - * - * The `comparator` is used in the same way as `Iterable#sort`. If it is not - * provided, the default comparator is `>`. - * - * When two values are considered equivalent, the first encountered will be - * returned. Otherwise, `max` will operate independent of the order of input - * as long as the comparator is commutative. The default comparator `>` is - * commutative *only* when types do not differ. - * - * If `comparator` returns 0 and either value is NaN, undefined, or null, - * that value will be returned. - */ - max(comparator?: (valueA: V, valueB: V) => number): V; - - /** - * Like `max`, but also accepts a `comparatorValueMapper` which allows for - * comparing by more sophisticated means: - * - * hitters.maxBy(hitter => hitter.avgHits); - * - */ - maxBy( - comparatorValueMapper: (value?: V, key?: K, iter?: /*this*/Iterable) => C, - comparator?: (valueA: C, valueB: C) => number - ): V; - - /** - * Returns the minimum value in this collection. If any values are - * comparatively equivalent, the first one found will be returned. - * - * The `comparator` is used in the same way as `Iterable#sort`. If it is not - * provided, the default comparator is `<`. - * - * When two values are considered equivalent, the first encountered will be - * returned. Otherwise, `min` will operate independent of the order of input - * as long as the comparator is commutative. The default comparator `<` is - * commutative *only* when types do not differ. - * - * If `comparator` returns 0 and either value is NaN, undefined, or null, - * that value will be returned. - */ - min(comparator?: (valueA: V, valueB: V) => number): V; - - /** - * Like `min`, but also accepts a `comparatorValueMapper` which allows for - * comparing by more sophisticated means: - * - * hitters.minBy(hitter => hitter.avgHits); - * - */ - minBy( - comparatorValueMapper: (value?: V, key?: K, iter?: /*this*/Iterable) => C, - comparator?: (valueA: C, valueB: C) => number - ): V; - - - // Comparison - - /** - * True if `iter` includes every value in this Iterable. - */ - isSubset(iter: Iterable): boolean; - isSubset(iter: Array): boolean; - - /** - * True if this Iterable includes every value in `iter`. - */ - isSuperset(iter: Iterable): boolean; - isSuperset(iter: Array): boolean; - - - /** - * Note: this is here as a convenience to work around an issue with - * TypeScript https://github.com/Microsoft/TypeScript/issues/285, but - * Iterable does not define `size`, instead `Seq` defines `size` as - * nullable number, and `Collection` defines `size` as always a number. - * - * @ignore - */ - size: number; - } - - - /** - * Collection is the abstract base class for concrete data structures. It - * cannot be constructed directly. - * - * Implementations should extend one of the subclasses, `Collection.Keyed`, - * `Collection.Indexed`, or `Collection.Set`. - */ - export module Collection { - - - /** - * `Collection` which represents key-value pairs. - */ - export module Keyed {} - - export interface Keyed extends Collection, Iterable.Keyed { - - /** - * Returns Seq.Keyed. - * @override - */ - toSeq(): Seq.Keyed; - } - - - /** - * `Collection` which represents ordered indexed values. - */ - export module Indexed {} - - export interface Indexed extends Collection, Iterable.Indexed { - - /** - * Returns Seq.Indexed. - * @override - */ - toSeq(): Seq.Indexed; - } - - - /** - * `Collection` which represents values, unassociated with keys or indices. - * - * `Collection.Set` implementations should guarantee value uniqueness. - */ - export module Set {} - - export interface Set extends Collection, Iterable.Set { - - /** - * Returns Seq.Set. - * @override - */ - toSeq(): Seq.Set; - } - - } - - export interface Collection extends Iterable { - - /** - * All collections maintain their current `size` as an integer. - */ - size: number; - } - - - /** - * ES6 Iterator. - * - * This is not part of the Immutable library, but a common interface used by - * many types in ES6 JavaScript. - * - * @ignore - */ - export interface Iterator { - next(): { value: T; done: boolean; } - } - -} - -declare module "immutable" { - export = Immutable -} diff --git a/dist/immutable.js b/dist/immutable.js deleted file mode 100644 index a66de65674..0000000000 --- a/dist/immutable.js +++ /dev/null @@ -1,4979 +0,0 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : - typeof define === 'function' && define.amd ? define(factory) : - (global.Immutable = factory()); -}(this, function () { 'use strict';var SLICE$0 = Array.prototype.slice; - - function createClass(ctor, superClass) { - if (superClass) { - ctor.prototype = Object.create(superClass.prototype); - } - ctor.prototype.constructor = ctor; - } - - function Iterable(value) { - return isIterable(value) ? value : Seq(value); - } - - - createClass(KeyedIterable, Iterable); - function KeyedIterable(value) { - return isKeyed(value) ? value : KeyedSeq(value); - } - - - createClass(IndexedIterable, Iterable); - function IndexedIterable(value) { - return isIndexed(value) ? value : IndexedSeq(value); - } - - - createClass(SetIterable, Iterable); - function SetIterable(value) { - return isIterable(value) && !isAssociative(value) ? value : SetSeq(value); - } - - - - function isIterable(maybeIterable) { - return !!(maybeIterable && maybeIterable[IS_ITERABLE_SENTINEL]); - } - - function isKeyed(maybeKeyed) { - return !!(maybeKeyed && maybeKeyed[IS_KEYED_SENTINEL]); - } - - function isIndexed(maybeIndexed) { - return !!(maybeIndexed && maybeIndexed[IS_INDEXED_SENTINEL]); - } - - function isAssociative(maybeAssociative) { - return isKeyed(maybeAssociative) || isIndexed(maybeAssociative); - } - - function isOrdered(maybeOrdered) { - return !!(maybeOrdered && maybeOrdered[IS_ORDERED_SENTINEL]); - } - - Iterable.isIterable = isIterable; - Iterable.isKeyed = isKeyed; - Iterable.isIndexed = isIndexed; - Iterable.isAssociative = isAssociative; - Iterable.isOrdered = isOrdered; - - Iterable.Keyed = KeyedIterable; - Iterable.Indexed = IndexedIterable; - Iterable.Set = SetIterable; - - - var IS_ITERABLE_SENTINEL = '@@__IMMUTABLE_ITERABLE__@@'; - var IS_KEYED_SENTINEL = '@@__IMMUTABLE_KEYED__@@'; - var IS_INDEXED_SENTINEL = '@@__IMMUTABLE_INDEXED__@@'; - var IS_ORDERED_SENTINEL = '@@__IMMUTABLE_ORDERED__@@'; - - // Used for setting prototype methods that IE8 chokes on. - var DELETE = 'delete'; - - // Constants describing the size of trie nodes. - var SHIFT = 5; // Resulted in best performance after ______? - var SIZE = 1 << SHIFT; - var MASK = SIZE - 1; - - // A consistent shared value representing "not set" which equals nothing other - // than itself, and nothing that could be provided externally. - var NOT_SET = {}; - - // Boolean references, Rough equivalent of `bool &`. - var CHANGE_LENGTH = { value: false }; - var DID_ALTER = { value: false }; - - function MakeRef(ref) { - ref.value = false; - return ref; - } - - function SetRef(ref) { - ref && (ref.value = true); - } - - // A function which returns a value representing an "owner" for transient writes - // to tries. The return value will only ever equal itself, and will not equal - // the return of any subsequent call of this function. - function OwnerID() {} - - // http://jsperf.com/copy-array-inline - function arrCopy(arr, offset) { - offset = offset || 0; - var len = Math.max(0, arr.length - offset); - var newArr = new Array(len); - for (var ii = 0; ii < len; ii++) { - newArr[ii] = arr[ii + offset]; - } - return newArr; - } - - function ensureSize(iter) { - if (iter.size === undefined) { - iter.size = iter.__iterate(returnTrue); - } - return iter.size; - } - - function wrapIndex(iter, index) { - // This implements "is array index" which the ECMAString spec defines as: - // - // A String property name P is an array index if and only if - // ToString(ToUint32(P)) is equal to P and ToUint32(P) is not equal - // to 2^32−1. - // - // http://www.ecma-international.org/ecma-262/6.0/#sec-array-exotic-objects - if (typeof index !== 'number') { - var uint32Index = index >>> 0; // N >>> 0 is shorthand for ToUint32 - if ('' + uint32Index !== index || uint32Index === 4294967295) { - return NaN; - } - index = uint32Index; - } - return index < 0 ? ensureSize(iter) + index : index; - } - - function returnTrue() { - return true; - } - - function wholeSlice(begin, end, size) { - return (begin === 0 || (size !== undefined && begin <= -size)) && - (end === undefined || (size !== undefined && end >= size)); - } - - function resolveBegin(begin, size) { - return resolveIndex(begin, size, 0); - } - - function resolveEnd(end, size) { - return resolveIndex(end, size, size); - } - - function resolveIndex(index, size, defaultIndex) { - return index === undefined ? - defaultIndex : - index < 0 ? - Math.max(0, size + index) : - size === undefined ? - index : - Math.min(size, index); - } - - /* global Symbol */ - - var ITERATE_KEYS = 0; - var ITERATE_VALUES = 1; - var ITERATE_ENTRIES = 2; - - var REAL_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; - var FAUX_ITERATOR_SYMBOL = '@@iterator'; - - var ITERATOR_SYMBOL = REAL_ITERATOR_SYMBOL || FAUX_ITERATOR_SYMBOL; - - - function Iterator(next) { - this.next = next; - } - - Iterator.prototype.toString = function() { - return '[Iterator]'; - }; - - - Iterator.KEYS = ITERATE_KEYS; - Iterator.VALUES = ITERATE_VALUES; - Iterator.ENTRIES = ITERATE_ENTRIES; - - Iterator.prototype.inspect = - Iterator.prototype.toSource = function () { return this.toString(); } - Iterator.prototype[ITERATOR_SYMBOL] = function () { - return this; - }; - - - function iteratorValue(type, k, v, iteratorResult) { - var value = type === 0 ? k : type === 1 ? v : [k, v]; - iteratorResult ? (iteratorResult.value = value) : (iteratorResult = { - value: value, done: false - }); - return iteratorResult; - } - - function iteratorDone() { - return { value: undefined, done: true }; - } - - function hasIterator(maybeIterable) { - return !!getIteratorFn(maybeIterable); - } - - function isIterator(maybeIterator) { - return maybeIterator && typeof maybeIterator.next === 'function'; - } - - function getIterator(iterable) { - var iteratorFn = getIteratorFn(iterable); - return iteratorFn && iteratorFn.call(iterable); - } - - function getIteratorFn(iterable) { - var iteratorFn = iterable && ( - (REAL_ITERATOR_SYMBOL && iterable[REAL_ITERATOR_SYMBOL]) || - iterable[FAUX_ITERATOR_SYMBOL] - ); - if (typeof iteratorFn === 'function') { - return iteratorFn; - } - } - - function isArrayLike(value) { - return value && typeof value.length === 'number'; - } - - createClass(Seq, Iterable); - function Seq(value) { - return value === null || value === undefined ? emptySequence() : - isIterable(value) ? value.toSeq() : seqFromValue(value); - } - - Seq.of = function(/*...values*/) { - return Seq(arguments); - }; - - Seq.prototype.toSeq = function() { - return this; - }; - - Seq.prototype.toString = function() { - return this.__toString('Seq {', '}'); - }; - - Seq.prototype.cacheResult = function() { - if (!this._cache && this.__iterateUncached) { - this._cache = this.entrySeq().toArray(); - this.size = this._cache.length; - } - return this; - }; - - // abstract __iterateUncached(fn, reverse) - - Seq.prototype.__iterate = function(fn, reverse) { - return seqIterate(this, fn, reverse, true); - }; - - // abstract __iteratorUncached(type, reverse) - - Seq.prototype.__iterator = function(type, reverse) { - return seqIterator(this, type, reverse, true); - }; - - - - createClass(KeyedSeq, Seq); - function KeyedSeq(value) { - return value === null || value === undefined ? - emptySequence().toKeyedSeq() : - isIterable(value) ? - (isKeyed(value) ? value.toSeq() : value.fromEntrySeq()) : - keyedSeqFromValue(value); - } - - KeyedSeq.prototype.toKeyedSeq = function() { - return this; - }; - - - - createClass(IndexedSeq, Seq); - function IndexedSeq(value) { - return value === null || value === undefined ? emptySequence() : - !isIterable(value) ? indexedSeqFromValue(value) : - isKeyed(value) ? value.entrySeq() : value.toIndexedSeq(); - } - - IndexedSeq.of = function(/*...values*/) { - return IndexedSeq(arguments); - }; - - IndexedSeq.prototype.toIndexedSeq = function() { - return this; - }; - - IndexedSeq.prototype.toString = function() { - return this.__toString('Seq [', ']'); - }; - - IndexedSeq.prototype.__iterate = function(fn, reverse) { - return seqIterate(this, fn, reverse, false); - }; - - IndexedSeq.prototype.__iterator = function(type, reverse) { - return seqIterator(this, type, reverse, false); - }; - - - - createClass(SetSeq, Seq); - function SetSeq(value) { - return ( - value === null || value === undefined ? emptySequence() : - !isIterable(value) ? indexedSeqFromValue(value) : - isKeyed(value) ? value.entrySeq() : value - ).toSetSeq(); - } - - SetSeq.of = function(/*...values*/) { - return SetSeq(arguments); - }; - - SetSeq.prototype.toSetSeq = function() { - return this; - }; - - - - Seq.isSeq = isSeq; - Seq.Keyed = KeyedSeq; - Seq.Set = SetSeq; - Seq.Indexed = IndexedSeq; - - var IS_SEQ_SENTINEL = '@@__IMMUTABLE_SEQ__@@'; - - Seq.prototype[IS_SEQ_SENTINEL] = true; - - - - createClass(ArraySeq, IndexedSeq); - function ArraySeq(array) { - this._array = array; - this.size = array.length; - } - - ArraySeq.prototype.get = function(index, notSetValue) { - return this.has(index) ? this._array[wrapIndex(this, index)] : notSetValue; - }; - - ArraySeq.prototype.__iterate = function(fn, reverse) { - var array = this._array; - var maxIndex = array.length - 1; - for (var ii = 0; ii <= maxIndex; ii++) { - if (fn(array[reverse ? maxIndex - ii : ii], ii, this) === false) { - return ii + 1; - } - } - return ii; - }; - - ArraySeq.prototype.__iterator = function(type, reverse) { - var array = this._array; - var maxIndex = array.length - 1; - var ii = 0; - return new Iterator(function() - {return ii > maxIndex ? - iteratorDone() : - iteratorValue(type, ii, array[reverse ? maxIndex - ii++ : ii++])} - ); - }; - - - - createClass(ObjectSeq, KeyedSeq); - function ObjectSeq(object) { - var keys = Object.keys(object); - this._object = object; - this._keys = keys; - this.size = keys.length; - } - - ObjectSeq.prototype.get = function(key, notSetValue) { - if (notSetValue !== undefined && !this.has(key)) { - return notSetValue; - } - return this._object[key]; - }; - - ObjectSeq.prototype.has = function(key) { - return this._object.hasOwnProperty(key); - }; - - ObjectSeq.prototype.__iterate = function(fn, reverse) { - var object = this._object; - var keys = this._keys; - var maxIndex = keys.length - 1; - for (var ii = 0; ii <= maxIndex; ii++) { - var key = keys[reverse ? maxIndex - ii : ii]; - if (fn(object[key], key, this) === false) { - return ii + 1; - } - } - return ii; - }; - - ObjectSeq.prototype.__iterator = function(type, reverse) { - var object = this._object; - var keys = this._keys; - var maxIndex = keys.length - 1; - var ii = 0; - return new Iterator(function() { - var key = keys[reverse ? maxIndex - ii : ii]; - return ii++ > maxIndex ? - iteratorDone() : - iteratorValue(type, key, object[key]); - }); - }; - - ObjectSeq.prototype[IS_ORDERED_SENTINEL] = true; - - - createClass(IterableSeq, IndexedSeq); - function IterableSeq(iterable) { - this._iterable = iterable; - this.size = iterable.length || iterable.size; - } - - IterableSeq.prototype.__iterateUncached = function(fn, reverse) { - if (reverse) { - return this.cacheResult().__iterate(fn, reverse); - } - var iterable = this._iterable; - var iterator = getIterator(iterable); - var iterations = 0; - if (isIterator(iterator)) { - var step; - while (!(step = iterator.next()).done) { - if (fn(step.value, iterations++, this) === false) { - break; - } - } - } - return iterations; - }; - - IterableSeq.prototype.__iteratorUncached = function(type, reverse) { - if (reverse) { - return this.cacheResult().__iterator(type, reverse); - } - var iterable = this._iterable; - var iterator = getIterator(iterable); - if (!isIterator(iterator)) { - return new Iterator(iteratorDone); - } - var iterations = 0; - return new Iterator(function() { - var step = iterator.next(); - return step.done ? step : iteratorValue(type, iterations++, step.value); - }); - }; - - - - createClass(IteratorSeq, IndexedSeq); - function IteratorSeq(iterator) { - this._iterator = iterator; - this._iteratorCache = []; - } - - IteratorSeq.prototype.__iterateUncached = function(fn, reverse) { - if (reverse) { - return this.cacheResult().__iterate(fn, reverse); - } - var iterator = this._iterator; - var cache = this._iteratorCache; - var iterations = 0; - while (iterations < cache.length) { - if (fn(cache[iterations], iterations++, this) === false) { - return iterations; - } - } - var step; - while (!(step = iterator.next()).done) { - var val = step.value; - cache[iterations] = val; - if (fn(val, iterations++, this) === false) { - break; - } - } - return iterations; - }; - - IteratorSeq.prototype.__iteratorUncached = function(type, reverse) { - if (reverse) { - return this.cacheResult().__iterator(type, reverse); - } - var iterator = this._iterator; - var cache = this._iteratorCache; - var iterations = 0; - return new Iterator(function() { - if (iterations >= cache.length) { - var step = iterator.next(); - if (step.done) { - return step; - } - cache[iterations] = step.value; - } - return iteratorValue(type, iterations, cache[iterations++]); - }); - }; - - - - - // # pragma Helper functions - - function isSeq(maybeSeq) { - return !!(maybeSeq && maybeSeq[IS_SEQ_SENTINEL]); - } - - var EMPTY_SEQ; - - function emptySequence() { - return EMPTY_SEQ || (EMPTY_SEQ = new ArraySeq([])); - } - - function keyedSeqFromValue(value) { - var seq = - Array.isArray(value) ? new ArraySeq(value).fromEntrySeq() : - isIterator(value) ? new IteratorSeq(value).fromEntrySeq() : - hasIterator(value) ? new IterableSeq(value).fromEntrySeq() : - typeof value === 'object' ? new ObjectSeq(value) : - undefined; - if (!seq) { - throw new TypeError( - 'Expected Array or iterable object of [k, v] entries, '+ - 'or keyed object: ' + value - ); - } - return seq; - } - - function indexedSeqFromValue(value) { - var seq = maybeIndexedSeqFromValue(value); - if (!seq) { - throw new TypeError( - 'Expected Array or iterable object of values: ' + value - ); - } - return seq; - } - - function seqFromValue(value) { - var seq = maybeIndexedSeqFromValue(value) || - (typeof value === 'object' && new ObjectSeq(value)); - if (!seq) { - throw new TypeError( - 'Expected Array or iterable object of values, or keyed object: ' + value - ); - } - return seq; - } - - function maybeIndexedSeqFromValue(value) { - return ( - isArrayLike(value) ? new ArraySeq(value) : - isIterator(value) ? new IteratorSeq(value) : - hasIterator(value) ? new IterableSeq(value) : - undefined - ); - } - - function seqIterate(seq, fn, reverse, useKeys) { - var cache = seq._cache; - if (cache) { - var maxIndex = cache.length - 1; - for (var ii = 0; ii <= maxIndex; ii++) { - var entry = cache[reverse ? maxIndex - ii : ii]; - if (fn(entry[1], useKeys ? entry[0] : ii, seq) === false) { - return ii + 1; - } - } - return ii; - } - return seq.__iterateUncached(fn, reverse); - } - - function seqIterator(seq, type, reverse, useKeys) { - var cache = seq._cache; - if (cache) { - var maxIndex = cache.length - 1; - var ii = 0; - return new Iterator(function() { - var entry = cache[reverse ? maxIndex - ii : ii]; - return ii++ > maxIndex ? - iteratorDone() : - iteratorValue(type, useKeys ? entry[0] : ii - 1, entry[1]); - }); - } - return seq.__iteratorUncached(type, reverse); - } - - function fromJS(json, converter) { - return converter ? - fromJSWith(converter, json, '', {'': json}) : - fromJSDefault(json); - } - - function fromJSWith(converter, json, key, parentJSON) { - if (Array.isArray(json)) { - return converter.call(parentJSON, key, IndexedSeq(json).map(function(v, k) {return fromJSWith(converter, v, k, json)})); - } - if (isPlainObj(json)) { - return converter.call(parentJSON, key, KeyedSeq(json).map(function(v, k) {return fromJSWith(converter, v, k, json)})); - } - return json; - } - - function fromJSDefault(json) { - if (Array.isArray(json)) { - return IndexedSeq(json).map(fromJSDefault).toList(); - } - if (isPlainObj(json)) { - return KeyedSeq(json).map(fromJSDefault).toMap(); - } - return json; - } - - function isPlainObj(value) { - return value && (value.constructor === Object || value.constructor === undefined); - } - - /** - * An extension of the "same-value" algorithm as [described for use by ES6 Map - * and Set](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map#Key_equality) - * - * NaN is considered the same as NaN, however -0 and 0 are considered the same - * value, which is different from the algorithm described by - * [`Object.is`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is). - * - * This is extended further to allow Objects to describe the values they - * represent, by way of `valueOf` or `equals` (and `hashCode`). - * - * Note: because of this extension, the key equality of Immutable.Map and the - * value equality of Immutable.Set will differ from ES6 Map and Set. - * - * ### Defining custom values - * - * The easiest way to describe the value an object represents is by implementing - * `valueOf`. For example, `Date` represents a value by returning a unix - * timestamp for `valueOf`: - * - * var date1 = new Date(1234567890000); // Fri Feb 13 2009 ... - * var date2 = new Date(1234567890000); - * date1.valueOf(); // 1234567890000 - * assert( date1 !== date2 ); - * assert( Immutable.is( date1, date2 ) ); - * - * Note: overriding `valueOf` may have other implications if you use this object - * where JavaScript expects a primitive, such as implicit string coercion. - * - * For more complex types, especially collections, implementing `valueOf` may - * not be performant. An alternative is to implement `equals` and `hashCode`. - * - * `equals` takes another object, presumably of similar type, and returns true - * if the it is equal. Equality is symmetrical, so the same result should be - * returned if this and the argument are flipped. - * - * assert( a.equals(b) === b.equals(a) ); - * - * `hashCode` returns a 32bit integer number representing the object which will - * be used to determine how to store the value object in a Map or Set. You must - * provide both or neither methods, one must not exist without the other. - * - * Also, an important relationship between these methods must be upheld: if two - * values are equal, they *must* return the same hashCode. If the values are not - * equal, they might have the same hashCode; this is called a hash collision, - * and while undesirable for performance reasons, it is acceptable. - * - * if (a.equals(b)) { - * assert( a.hashCode() === b.hashCode() ); - * } - * - * All Immutable collections implement `equals` and `hashCode`. - * - */ - function is(valueA, valueB) { - if (valueA === valueB || (valueA !== valueA && valueB !== valueB)) { - return true; - } - if (!valueA || !valueB) { - return false; - } - if (typeof valueA.valueOf === 'function' && - typeof valueB.valueOf === 'function') { - valueA = valueA.valueOf(); - valueB = valueB.valueOf(); - if (valueA === valueB || (valueA !== valueA && valueB !== valueB)) { - return true; - } - if (!valueA || !valueB) { - return false; - } - } - if (typeof valueA.equals === 'function' && - typeof valueB.equals === 'function' && - valueA.equals(valueB)) { - return true; - } - return false; - } - - function deepEqual(a, b) { - if (a === b) { - return true; - } - - if ( - !isIterable(b) || - a.size !== undefined && b.size !== undefined && a.size !== b.size || - a.__hash !== undefined && b.__hash !== undefined && a.__hash !== b.__hash || - isKeyed(a) !== isKeyed(b) || - isIndexed(a) !== isIndexed(b) || - isOrdered(a) !== isOrdered(b) - ) { - return false; - } - - if (a.size === 0 && b.size === 0) { - return true; - } - - var notAssociative = !isAssociative(a); - - if (isOrdered(a)) { - var entries = a.entries(); - return b.every(function(v, k) { - var entry = entries.next().value; - return entry && is(entry[1], v) && (notAssociative || is(entry[0], k)); - }) && entries.next().done; - } - - var flipped = false; - - if (a.size === undefined) { - if (b.size === undefined) { - if (typeof a.cacheResult === 'function') { - a.cacheResult(); - } - } else { - flipped = true; - var _ = a; - a = b; - b = _; - } - } - - var allEqual = true; - var bSize = b.__iterate(function(v, k) { - if (notAssociative ? !a.has(v) : - flipped ? !is(v, a.get(k, NOT_SET)) : !is(a.get(k, NOT_SET), v)) { - allEqual = false; - return false; - } - }); - - return allEqual && a.size === bSize; - } - - createClass(Repeat, IndexedSeq); - - function Repeat(value, times) { - if (!(this instanceof Repeat)) { - return new Repeat(value, times); - } - this._value = value; - this.size = times === undefined ? Infinity : Math.max(0, times); - if (this.size === 0) { - if (EMPTY_REPEAT) { - return EMPTY_REPEAT; - } - EMPTY_REPEAT = this; - } - } - - Repeat.prototype.toString = function() { - if (this.size === 0) { - return 'Repeat []'; - } - return 'Repeat [ ' + this._value + ' ' + this.size + ' times ]'; - }; - - Repeat.prototype.get = function(index, notSetValue) { - return this.has(index) ? this._value : notSetValue; - }; - - Repeat.prototype.includes = function(searchValue) { - return is(this._value, searchValue); - }; - - Repeat.prototype.slice = function(begin, end) { - var size = this.size; - return wholeSlice(begin, end, size) ? this : - new Repeat(this._value, resolveEnd(end, size) - resolveBegin(begin, size)); - }; - - Repeat.prototype.reverse = function() { - return this; - }; - - Repeat.prototype.indexOf = function(searchValue) { - if (is(this._value, searchValue)) { - return 0; - } - return -1; - }; - - Repeat.prototype.lastIndexOf = function(searchValue) { - if (is(this._value, searchValue)) { - return this.size; - } - return -1; - }; - - Repeat.prototype.__iterate = function(fn, reverse) { - for (var ii = 0; ii < this.size; ii++) { - if (fn(this._value, ii, this) === false) { - return ii + 1; - } - } - return ii; - }; - - Repeat.prototype.__iterator = function(type, reverse) {var this$0 = this; - var ii = 0; - return new Iterator(function() - {return ii < this$0.size ? iteratorValue(type, ii++, this$0._value) : iteratorDone()} - ); - }; - - Repeat.prototype.equals = function(other) { - return other instanceof Repeat ? - is(this._value, other._value) : - deepEqual(other); - }; - - - var EMPTY_REPEAT; - - function invariant(condition, error) { - if (!condition) throw new Error(error); - } - - createClass(Range, IndexedSeq); - - function Range(start, end, step) { - if (!(this instanceof Range)) { - return new Range(start, end, step); - } - invariant(step !== 0, 'Cannot step a Range by 0'); - start = start || 0; - if (end === undefined) { - end = Infinity; - } - step = step === undefined ? 1 : Math.abs(step); - if (end < start) { - step = -step; - } - this._start = start; - this._end = end; - this._step = step; - this.size = Math.max(0, Math.ceil((end - start) / step - 1) + 1); - if (this.size === 0) { - if (EMPTY_RANGE) { - return EMPTY_RANGE; - } - EMPTY_RANGE = this; - } - } - - Range.prototype.toString = function() { - if (this.size === 0) { - return 'Range []'; - } - return 'Range [ ' + - this._start + '...' + this._end + - (this._step !== 1 ? ' by ' + this._step : '') + - ' ]'; - }; - - Range.prototype.get = function(index, notSetValue) { - return this.has(index) ? - this._start + wrapIndex(this, index) * this._step : - notSetValue; - }; - - Range.prototype.includes = function(searchValue) { - var possibleIndex = (searchValue - this._start) / this._step; - return possibleIndex >= 0 && - possibleIndex < this.size && - possibleIndex === Math.floor(possibleIndex); - }; - - Range.prototype.slice = function(begin, end) { - if (wholeSlice(begin, end, this.size)) { - return this; - } - begin = resolveBegin(begin, this.size); - end = resolveEnd(end, this.size); - if (end <= begin) { - return new Range(0, 0); - } - return new Range(this.get(begin, this._end), this.get(end, this._end), this._step); - }; - - Range.prototype.indexOf = function(searchValue) { - var offsetValue = searchValue - this._start; - if (offsetValue % this._step === 0) { - var index = offsetValue / this._step; - if (index >= 0 && index < this.size) { - return index - } - } - return -1; - }; - - Range.prototype.lastIndexOf = function(searchValue) { - return this.indexOf(searchValue); - }; - - Range.prototype.__iterate = function(fn, reverse) { - var maxIndex = this.size - 1; - var step = this._step; - var value = reverse ? this._start + maxIndex * step : this._start; - for (var ii = 0; ii <= maxIndex; ii++) { - if (fn(value, ii, this) === false) { - return ii + 1; - } - value += reverse ? -step : step; - } - return ii; - }; - - Range.prototype.__iterator = function(type, reverse) { - var maxIndex = this.size - 1; - var step = this._step; - var value = reverse ? this._start + maxIndex * step : this._start; - var ii = 0; - return new Iterator(function() { - var v = value; - value += reverse ? -step : step; - return ii > maxIndex ? iteratorDone() : iteratorValue(type, ii++, v); - }); - }; - - Range.prototype.equals = function(other) { - return other instanceof Range ? - this._start === other._start && - this._end === other._end && - this._step === other._step : - deepEqual(this, other); - }; - - - var EMPTY_RANGE; - - createClass(Collection, Iterable); - function Collection() { - throw TypeError('Abstract'); - } - - - createClass(KeyedCollection, Collection);function KeyedCollection() {} - - createClass(IndexedCollection, Collection);function IndexedCollection() {} - - createClass(SetCollection, Collection);function SetCollection() {} - - - Collection.Keyed = KeyedCollection; - Collection.Indexed = IndexedCollection; - Collection.Set = SetCollection; - - var imul = - typeof Math.imul === 'function' && Math.imul(0xffffffff, 2) === -2 ? - Math.imul : - function imul(a, b) { - a = a | 0; // int - b = b | 0; // int - var c = a & 0xffff; - var d = b & 0xffff; - // Shift by 0 fixes the sign on the high part. - return (c * d) + ((((a >>> 16) * d + c * (b >>> 16)) << 16) >>> 0) | 0; // int - }; - - // v8 has an optimization for storing 31-bit signed numbers. - // Values which have either 00 or 11 as the high order bits qualify. - // This function drops the highest order bit in a signed number, maintaining - // the sign bit. - function smi(i32) { - return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF); - } - - function hash(o) { - if (o === false || o === null || o === undefined) { - return 0; - } - if (typeof o.valueOf === 'function') { - o = o.valueOf(); - if (o === false || o === null || o === undefined) { - return 0; - } - } - if (o === true) { - return 1; - } - var type = typeof o; - if (type === 'number') { - if (o !== o || o === Infinity) { - return 0; - } - var h = o | 0; - if (h !== o) { - h ^= o * 0xFFFFFFFF; - } - while (o > 0xFFFFFFFF) { - o /= 0xFFFFFFFF; - h ^= o; - } - return smi(h); - } - if (type === 'string') { - return o.length > STRING_HASH_CACHE_MIN_STRLEN ? cachedHashString(o) : hashString(o); - } - if (typeof o.hashCode === 'function') { - return o.hashCode(); - } - if (type === 'object') { - return hashJSObj(o); - } - if (typeof o.toString === 'function') { - return hashString(o.toString()); - } - throw new Error('Value type ' + type + ' cannot be hashed.'); - } - - function cachedHashString(string) { - var hash = stringHashCache[string]; - if (hash === undefined) { - hash = hashString(string); - if (STRING_HASH_CACHE_SIZE === STRING_HASH_CACHE_MAX_SIZE) { - STRING_HASH_CACHE_SIZE = 0; - stringHashCache = {}; - } - STRING_HASH_CACHE_SIZE++; - stringHashCache[string] = hash; - } - return hash; - } - - // http://jsperf.com/hashing-strings - function hashString(string) { - // This is the hash from JVM - // The hash code for a string is computed as - // s[0] * 31 ^ (n - 1) + s[1] * 31 ^ (n - 2) + ... + s[n - 1], - // where s[i] is the ith character of the string and n is the length of - // the string. We "mod" the result to make it between 0 (inclusive) and 2^31 - // (exclusive) by dropping high bits. - var hash = 0; - for (var ii = 0; ii < string.length; ii++) { - hash = 31 * hash + string.charCodeAt(ii) | 0; - } - return smi(hash); - } - - function hashJSObj(obj) { - var hash; - if (usingWeakMap) { - hash = weakMap.get(obj); - if (hash !== undefined) { - return hash; - } - } - - hash = obj[UID_HASH_KEY]; - if (hash !== undefined) { - return hash; - } - - if (!canDefineProperty) { - hash = obj.propertyIsEnumerable && obj.propertyIsEnumerable[UID_HASH_KEY]; - if (hash !== undefined) { - return hash; - } - - hash = getIENodeHash(obj); - if (hash !== undefined) { - return hash; - } - } - - hash = ++objHashUID; - if (objHashUID & 0x40000000) { - objHashUID = 0; - } - - if (usingWeakMap) { - weakMap.set(obj, hash); - } else if (isExtensible !== undefined && isExtensible(obj) === false) { - throw new Error('Non-extensible objects are not allowed as keys.'); - } else if (canDefineProperty) { - Object.defineProperty(obj, UID_HASH_KEY, { - 'enumerable': false, - 'configurable': false, - 'writable': false, - 'value': hash - }); - } else if (obj.propertyIsEnumerable !== undefined && - obj.propertyIsEnumerable === obj.constructor.prototype.propertyIsEnumerable) { - // Since we can't define a non-enumerable property on the object - // we'll hijack one of the less-used non-enumerable properties to - // save our hash on it. Since this is a function it will not show up in - // `JSON.stringify` which is what we want. - obj.propertyIsEnumerable = function() { - return this.constructor.prototype.propertyIsEnumerable.apply(this, arguments); - }; - obj.propertyIsEnumerable[UID_HASH_KEY] = hash; - } else if (obj.nodeType !== undefined) { - // At this point we couldn't get the IE `uniqueID` to use as a hash - // and we couldn't use a non-enumerable property to exploit the - // dontEnum bug so we simply add the `UID_HASH_KEY` on the node - // itself. - obj[UID_HASH_KEY] = hash; - } else { - throw new Error('Unable to set a non-enumerable property on object.'); - } - - return hash; - } - - // Get references to ES5 object methods. - var isExtensible = Object.isExtensible; - - // True if Object.defineProperty works as expected. IE8 fails this test. - var canDefineProperty = (function() { - try { - Object.defineProperty({}, '@', {}); - return true; - } catch (e) { - return false; - } - }()); - - // IE has a `uniqueID` property on DOM nodes. We can construct the hash from it - // and avoid memory leaks from the IE cloneNode bug. - function getIENodeHash(node) { - if (node && node.nodeType > 0) { - switch (node.nodeType) { - case 1: // Element - return node.uniqueID; - case 9: // Document - return node.documentElement && node.documentElement.uniqueID; - } - } - } - - // If possible, use a WeakMap. - var usingWeakMap = typeof WeakMap === 'function'; - var weakMap; - if (usingWeakMap) { - weakMap = new WeakMap(); - } - - var objHashUID = 0; - - var UID_HASH_KEY = '__immutablehash__'; - if (typeof Symbol === 'function') { - UID_HASH_KEY = Symbol(UID_HASH_KEY); - } - - var STRING_HASH_CACHE_MIN_STRLEN = 16; - var STRING_HASH_CACHE_MAX_SIZE = 255; - var STRING_HASH_CACHE_SIZE = 0; - var stringHashCache = {}; - - function assertNotInfinite(size) { - invariant( - size !== Infinity, - 'Cannot perform this action with an infinite size.' - ); - } - - createClass(Map, KeyedCollection); - - // @pragma Construction - - function Map(value) { - return value === null || value === undefined ? emptyMap() : - isMap(value) && !isOrdered(value) ? value : - emptyMap().withMutations(function(map ) { - var iter = KeyedIterable(value); - assertNotInfinite(iter.size); - iter.forEach(function(v, k) {return map.set(k, v)}); - }); - } - - Map.of = function() {var keyValues = SLICE$0.call(arguments, 0); - return emptyMap().withMutations(function(map ) { - for (var i = 0; i < keyValues.length; i += 2) { - if (i + 1 >= keyValues.length) { - throw new Error('Missing value for key: ' + keyValues[i]); - } - map.set(keyValues[i], keyValues[i + 1]); - } - }); - }; - - Map.prototype.toString = function() { - return this.__toString('Map {', '}'); - }; - - // @pragma Access - - Map.prototype.get = function(k, notSetValue) { - return this._root ? - this._root.get(0, undefined, k, notSetValue) : - notSetValue; - }; - - // @pragma Modification - - Map.prototype.set = function(k, v) { - return updateMap(this, k, v); - }; - - Map.prototype.setIn = function(keyPath, v) { - return this.updateIn(keyPath, NOT_SET, function() {return v}); - }; - - Map.prototype.remove = function(k) { - return updateMap(this, k, NOT_SET); - }; - - Map.prototype.deleteIn = function(keyPath) { - return this.updateIn(keyPath, function() {return NOT_SET}); - }; - - Map.prototype.update = function(k, notSetValue, updater) { - return arguments.length === 1 ? - k(this) : - this.updateIn([k], notSetValue, updater); - }; - - Map.prototype.updateIn = function(keyPath, notSetValue, updater) { - if (!updater) { - updater = notSetValue; - notSetValue = undefined; - } - var updatedValue = updateInDeepMap( - this, - forceIterator(keyPath), - notSetValue, - updater - ); - return updatedValue === NOT_SET ? undefined : updatedValue; - }; - - Map.prototype.clear = function() { - if (this.size === 0) { - return this; - } - if (this.__ownerID) { - this.size = 0; - this._root = null; - this.__hash = undefined; - this.__altered = true; - return this; - } - return emptyMap(); - }; - - // @pragma Composition - - Map.prototype.merge = function(/*...iters*/) { - return mergeIntoMapWith(this, undefined, arguments); - }; - - Map.prototype.mergeWith = function(merger) {var iters = SLICE$0.call(arguments, 1); - return mergeIntoMapWith(this, merger, iters); - }; - - Map.prototype.mergeIn = function(keyPath) {var iters = SLICE$0.call(arguments, 1); - return this.updateIn( - keyPath, - emptyMap(), - function(m ) {return typeof m.merge === 'function' ? - m.merge.apply(m, iters) : - iters[iters.length - 1]} - ); - }; - - Map.prototype.mergeDeep = function(/*...iters*/) { - return mergeIntoMapWith(this, deepMerger, arguments); - }; - - Map.prototype.mergeDeepWith = function(merger) {var iters = SLICE$0.call(arguments, 1); - return mergeIntoMapWith(this, deepMergerWith(merger), iters); - }; - - Map.prototype.mergeDeepIn = function(keyPath) {var iters = SLICE$0.call(arguments, 1); - return this.updateIn( - keyPath, - emptyMap(), - function(m ) {return typeof m.mergeDeep === 'function' ? - m.mergeDeep.apply(m, iters) : - iters[iters.length - 1]} - ); - }; - - Map.prototype.sort = function(comparator) { - // Late binding - return OrderedMap(sortFactory(this, comparator)); - }; - - Map.prototype.sortBy = function(mapper, comparator) { - // Late binding - return OrderedMap(sortFactory(this, comparator, mapper)); - }; - - // @pragma Mutability - - Map.prototype.withMutations = function(fn) { - var mutable = this.asMutable(); - fn(mutable); - return mutable.wasAltered() ? mutable.__ensureOwner(this.__ownerID) : this; - }; - - Map.prototype.asMutable = function() { - return this.__ownerID ? this : this.__ensureOwner(new OwnerID()); - }; - - Map.prototype.asImmutable = function() { - return this.__ensureOwner(); - }; - - Map.prototype.wasAltered = function() { - return this.__altered; - }; - - Map.prototype.__iterator = function(type, reverse) { - return new MapIterator(this, type, reverse); - }; - - Map.prototype.__iterate = function(fn, reverse) {var this$0 = this; - var iterations = 0; - this._root && this._root.iterate(function(entry ) { - iterations++; - return fn(entry[1], entry[0], this$0); - }, reverse); - return iterations; - }; - - Map.prototype.__ensureOwner = function(ownerID) { - if (ownerID === this.__ownerID) { - return this; - } - if (!ownerID) { - this.__ownerID = ownerID; - this.__altered = false; - return this; - } - return makeMap(this.size, this._root, ownerID, this.__hash); - }; - - - function isMap(maybeMap) { - return !!(maybeMap && maybeMap[IS_MAP_SENTINEL]); - } - - Map.isMap = isMap; - - var IS_MAP_SENTINEL = '@@__IMMUTABLE_MAP__@@'; - - var MapPrototype = Map.prototype; - MapPrototype[IS_MAP_SENTINEL] = true; - MapPrototype[DELETE] = MapPrototype.remove; - MapPrototype.removeIn = MapPrototype.deleteIn; - - - // #pragma Trie Nodes - - - - function ArrayMapNode(ownerID, entries) { - this.ownerID = ownerID; - this.entries = entries; - } - - ArrayMapNode.prototype.get = function(shift, keyHash, key, notSetValue) { - var entries = this.entries; - for (var ii = 0, len = entries.length; ii < len; ii++) { - if (is(key, entries[ii][0])) { - return entries[ii][1]; - } - } - return notSetValue; - }; - - ArrayMapNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { - var removed = value === NOT_SET; - - var entries = this.entries; - var idx = 0; - for (var len = entries.length; idx < len; idx++) { - if (is(key, entries[idx][0])) { - break; - } - } - var exists = idx < len; - - if (exists ? entries[idx][1] === value : removed) { - return this; - } - - SetRef(didAlter); - (removed || !exists) && SetRef(didChangeSize); - - if (removed && entries.length === 1) { - return; // undefined - } - - if (!exists && !removed && entries.length >= MAX_ARRAY_MAP_SIZE) { - return createNodes(ownerID, entries, key, value); - } - - var isEditable = ownerID && ownerID === this.ownerID; - var newEntries = isEditable ? entries : arrCopy(entries); - - if (exists) { - if (removed) { - idx === len - 1 ? newEntries.pop() : (newEntries[idx] = newEntries.pop()); - } else { - newEntries[idx] = [key, value]; - } - } else { - newEntries.push([key, value]); - } - - if (isEditable) { - this.entries = newEntries; - return this; - } - - return new ArrayMapNode(ownerID, newEntries); - }; - - - - - function BitmapIndexedNode(ownerID, bitmap, nodes) { - this.ownerID = ownerID; - this.bitmap = bitmap; - this.nodes = nodes; - } - - BitmapIndexedNode.prototype.get = function(shift, keyHash, key, notSetValue) { - if (keyHash === undefined) { - keyHash = hash(key); - } - var bit = (1 << ((shift === 0 ? keyHash : keyHash >>> shift) & MASK)); - var bitmap = this.bitmap; - return (bitmap & bit) === 0 ? notSetValue : - this.nodes[popCount(bitmap & (bit - 1))].get(shift + SHIFT, keyHash, key, notSetValue); - }; - - BitmapIndexedNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { - if (keyHash === undefined) { - keyHash = hash(key); - } - var keyHashFrag = (shift === 0 ? keyHash : keyHash >>> shift) & MASK; - var bit = 1 << keyHashFrag; - var bitmap = this.bitmap; - var exists = (bitmap & bit) !== 0; - - if (!exists && value === NOT_SET) { - return this; - } - - var idx = popCount(bitmap & (bit - 1)); - var nodes = this.nodes; - var node = exists ? nodes[idx] : undefined; - var newNode = updateNode(node, ownerID, shift + SHIFT, keyHash, key, value, didChangeSize, didAlter); - - if (newNode === node) { - return this; - } - - if (!exists && newNode && nodes.length >= MAX_BITMAP_INDEXED_SIZE) { - return expandNodes(ownerID, nodes, bitmap, keyHashFrag, newNode); - } - - if (exists && !newNode && nodes.length === 2 && isLeafNode(nodes[idx ^ 1])) { - return nodes[idx ^ 1]; - } - - if (exists && newNode && nodes.length === 1 && isLeafNode(newNode)) { - return newNode; - } - - var isEditable = ownerID && ownerID === this.ownerID; - var newBitmap = exists ? newNode ? bitmap : bitmap ^ bit : bitmap | bit; - var newNodes = exists ? newNode ? - setIn(nodes, idx, newNode, isEditable) : - spliceOut(nodes, idx, isEditable) : - spliceIn(nodes, idx, newNode, isEditable); - - if (isEditable) { - this.bitmap = newBitmap; - this.nodes = newNodes; - return this; - } - - return new BitmapIndexedNode(ownerID, newBitmap, newNodes); - }; - - - - - function HashArrayMapNode(ownerID, count, nodes) { - this.ownerID = ownerID; - this.count = count; - this.nodes = nodes; - } - - HashArrayMapNode.prototype.get = function(shift, keyHash, key, notSetValue) { - if (keyHash === undefined) { - keyHash = hash(key); - } - var idx = (shift === 0 ? keyHash : keyHash >>> shift) & MASK; - var node = this.nodes[idx]; - return node ? node.get(shift + SHIFT, keyHash, key, notSetValue) : notSetValue; - }; - - HashArrayMapNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { - if (keyHash === undefined) { - keyHash = hash(key); - } - var idx = (shift === 0 ? keyHash : keyHash >>> shift) & MASK; - var removed = value === NOT_SET; - var nodes = this.nodes; - var node = nodes[idx]; - - if (removed && !node) { - return this; - } - - var newNode = updateNode(node, ownerID, shift + SHIFT, keyHash, key, value, didChangeSize, didAlter); - if (newNode === node) { - return this; - } - - var newCount = this.count; - if (!node) { - newCount++; - } else if (!newNode) { - newCount--; - if (newCount < MIN_HASH_ARRAY_MAP_SIZE) { - return packNodes(ownerID, nodes, newCount, idx); - } - } - - var isEditable = ownerID && ownerID === this.ownerID; - var newNodes = setIn(nodes, idx, newNode, isEditable); - - if (isEditable) { - this.count = newCount; - this.nodes = newNodes; - return this; - } - - return new HashArrayMapNode(ownerID, newCount, newNodes); - }; - - - - - function HashCollisionNode(ownerID, keyHash, entries) { - this.ownerID = ownerID; - this.keyHash = keyHash; - this.entries = entries; - } - - HashCollisionNode.prototype.get = function(shift, keyHash, key, notSetValue) { - var entries = this.entries; - for (var ii = 0, len = entries.length; ii < len; ii++) { - if (is(key, entries[ii][0])) { - return entries[ii][1]; - } - } - return notSetValue; - }; - - HashCollisionNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { - if (keyHash === undefined) { - keyHash = hash(key); - } - - var removed = value === NOT_SET; - - if (keyHash !== this.keyHash) { - if (removed) { - return this; - } - SetRef(didAlter); - SetRef(didChangeSize); - return mergeIntoNode(this, ownerID, shift, keyHash, [key, value]); - } - - var entries = this.entries; - var idx = 0; - for (var len = entries.length; idx < len; idx++) { - if (is(key, entries[idx][0])) { - break; - } - } - var exists = idx < len; - - if (exists ? entries[idx][1] === value : removed) { - return this; - } - - SetRef(didAlter); - (removed || !exists) && SetRef(didChangeSize); - - if (removed && len === 2) { - return new ValueNode(ownerID, this.keyHash, entries[idx ^ 1]); - } - - var isEditable = ownerID && ownerID === this.ownerID; - var newEntries = isEditable ? entries : arrCopy(entries); - - if (exists) { - if (removed) { - idx === len - 1 ? newEntries.pop() : (newEntries[idx] = newEntries.pop()); - } else { - newEntries[idx] = [key, value]; - } - } else { - newEntries.push([key, value]); - } - - if (isEditable) { - this.entries = newEntries; - return this; - } - - return new HashCollisionNode(ownerID, this.keyHash, newEntries); - }; - - - - - function ValueNode(ownerID, keyHash, entry) { - this.ownerID = ownerID; - this.keyHash = keyHash; - this.entry = entry; - } - - ValueNode.prototype.get = function(shift, keyHash, key, notSetValue) { - return is(key, this.entry[0]) ? this.entry[1] : notSetValue; - }; - - ValueNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { - var removed = value === NOT_SET; - var keyMatch = is(key, this.entry[0]); - if (keyMatch ? value === this.entry[1] : removed) { - return this; - } - - SetRef(didAlter); - - if (removed) { - SetRef(didChangeSize); - return; // undefined - } - - if (keyMatch) { - if (ownerID && ownerID === this.ownerID) { - this.entry[1] = value; - return this; - } - return new ValueNode(ownerID, this.keyHash, [key, value]); - } - - SetRef(didChangeSize); - return mergeIntoNode(this, ownerID, shift, hash(key), [key, value]); - }; - - - - // #pragma Iterators - - ArrayMapNode.prototype.iterate = - HashCollisionNode.prototype.iterate = function (fn, reverse) { - var entries = this.entries; - for (var ii = 0, maxIndex = entries.length - 1; ii <= maxIndex; ii++) { - if (fn(entries[reverse ? maxIndex - ii : ii]) === false) { - return false; - } - } - } - - BitmapIndexedNode.prototype.iterate = - HashArrayMapNode.prototype.iterate = function (fn, reverse) { - var nodes = this.nodes; - for (var ii = 0, maxIndex = nodes.length - 1; ii <= maxIndex; ii++) { - var node = nodes[reverse ? maxIndex - ii : ii]; - if (node && node.iterate(fn, reverse) === false) { - return false; - } - } - } - - ValueNode.prototype.iterate = function (fn, reverse) { - return fn(this.entry); - } - - createClass(MapIterator, Iterator); - - function MapIterator(map, type, reverse) { - this._type = type; - this._reverse = reverse; - this._stack = map._root && mapIteratorFrame(map._root); - } - - MapIterator.prototype.next = function() { - var type = this._type; - var stack = this._stack; - while (stack) { - var node = stack.node; - var index = stack.index++; - var maxIndex; - if (node.entry) { - if (index === 0) { - return mapIteratorValue(type, node.entry); - } - } else if (node.entries) { - maxIndex = node.entries.length - 1; - if (index <= maxIndex) { - return mapIteratorValue(type, node.entries[this._reverse ? maxIndex - index : index]); - } - } else { - maxIndex = node.nodes.length - 1; - if (index <= maxIndex) { - var subNode = node.nodes[this._reverse ? maxIndex - index : index]; - if (subNode) { - if (subNode.entry) { - return mapIteratorValue(type, subNode.entry); - } - stack = this._stack = mapIteratorFrame(subNode, stack); - } - continue; - } - } - stack = this._stack = this._stack.__prev; - } - return iteratorDone(); - }; - - - function mapIteratorValue(type, entry) { - return iteratorValue(type, entry[0], entry[1]); - } - - function mapIteratorFrame(node, prev) { - return { - node: node, - index: 0, - __prev: prev - }; - } - - function makeMap(size, root, ownerID, hash) { - var map = Object.create(MapPrototype); - map.size = size; - map._root = root; - map.__ownerID = ownerID; - map.__hash = hash; - map.__altered = false; - return map; - } - - var EMPTY_MAP; - function emptyMap() { - return EMPTY_MAP || (EMPTY_MAP = makeMap(0)); - } - - function updateMap(map, k, v) { - var newRoot; - var newSize; - if (!map._root) { - if (v === NOT_SET) { - return map; - } - newSize = 1; - newRoot = new ArrayMapNode(map.__ownerID, [[k, v]]); - } else { - var didChangeSize = MakeRef(CHANGE_LENGTH); - var didAlter = MakeRef(DID_ALTER); - newRoot = updateNode(map._root, map.__ownerID, 0, undefined, k, v, didChangeSize, didAlter); - if (!didAlter.value) { - return map; - } - newSize = map.size + (didChangeSize.value ? v === NOT_SET ? -1 : 1 : 0); - } - if (map.__ownerID) { - map.size = newSize; - map._root = newRoot; - map.__hash = undefined; - map.__altered = true; - return map; - } - return newRoot ? makeMap(newSize, newRoot) : emptyMap(); - } - - function updateNode(node, ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { - if (!node) { - if (value === NOT_SET) { - return node; - } - SetRef(didAlter); - SetRef(didChangeSize); - return new ValueNode(ownerID, keyHash, [key, value]); - } - return node.update(ownerID, shift, keyHash, key, value, didChangeSize, didAlter); - } - - function isLeafNode(node) { - return node.constructor === ValueNode || node.constructor === HashCollisionNode; - } - - function mergeIntoNode(node, ownerID, shift, keyHash, entry) { - if (node.keyHash === keyHash) { - return new HashCollisionNode(ownerID, keyHash, [node.entry, entry]); - } - - var idx1 = (shift === 0 ? node.keyHash : node.keyHash >>> shift) & MASK; - var idx2 = (shift === 0 ? keyHash : keyHash >>> shift) & MASK; - - var newNode; - var nodes = idx1 === idx2 ? - [mergeIntoNode(node, ownerID, shift + SHIFT, keyHash, entry)] : - ((newNode = new ValueNode(ownerID, keyHash, entry)), idx1 < idx2 ? [node, newNode] : [newNode, node]); - - return new BitmapIndexedNode(ownerID, (1 << idx1) | (1 << idx2), nodes); - } - - function createNodes(ownerID, entries, key, value) { - if (!ownerID) { - ownerID = new OwnerID(); - } - var node = new ValueNode(ownerID, hash(key), [key, value]); - for (var ii = 0; ii < entries.length; ii++) { - var entry = entries[ii]; - node = node.update(ownerID, 0, undefined, entry[0], entry[1]); - } - return node; - } - - function packNodes(ownerID, nodes, count, excluding) { - var bitmap = 0; - var packedII = 0; - var packedNodes = new Array(count); - for (var ii = 0, bit = 1, len = nodes.length; ii < len; ii++, bit <<= 1) { - var node = nodes[ii]; - if (node !== undefined && ii !== excluding) { - bitmap |= bit; - packedNodes[packedII++] = node; - } - } - return new BitmapIndexedNode(ownerID, bitmap, packedNodes); - } - - function expandNodes(ownerID, nodes, bitmap, including, node) { - var count = 0; - var expandedNodes = new Array(SIZE); - for (var ii = 0; bitmap !== 0; ii++, bitmap >>>= 1) { - expandedNodes[ii] = bitmap & 1 ? nodes[count++] : undefined; - } - expandedNodes[including] = node; - return new HashArrayMapNode(ownerID, count + 1, expandedNodes); - } - - function mergeIntoMapWith(map, merger, iterables) { - var iters = []; - for (var ii = 0; ii < iterables.length; ii++) { - var value = iterables[ii]; - var iter = KeyedIterable(value); - if (!isIterable(value)) { - iter = iter.map(function(v ) {return fromJS(v)}); - } - iters.push(iter); - } - return mergeIntoCollectionWith(map, merger, iters); - } - - function deepMerger(existing, value, key) { - return existing && existing.mergeDeep && isIterable(value) ? - existing.mergeDeep(value) : - is(existing, value) ? existing : value; - } - - function deepMergerWith(merger) { - return function(existing, value, key) { - if (existing && existing.mergeDeepWith && isIterable(value)) { - return existing.mergeDeepWith(merger, value); - } - var nextValue = merger(existing, value, key); - return is(existing, nextValue) ? existing : nextValue; - }; - } - - function mergeIntoCollectionWith(collection, merger, iters) { - iters = iters.filter(function(x ) {return x.size !== 0}); - if (iters.length === 0) { - return collection; - } - if (collection.size === 0 && !collection.__ownerID && iters.length === 1) { - return collection.constructor(iters[0]); - } - return collection.withMutations(function(collection ) { - var mergeIntoMap = merger ? - function(value, key) { - collection.update(key, NOT_SET, function(existing ) - {return existing === NOT_SET ? value : merger(existing, value, key)} - ); - } : - function(value, key) { - collection.set(key, value); - } - for (var ii = 0; ii < iters.length; ii++) { - iters[ii].forEach(mergeIntoMap); - } - }); - } - - function updateInDeepMap(existing, keyPathIter, notSetValue, updater) { - var isNotSet = existing === NOT_SET; - var step = keyPathIter.next(); - if (step.done) { - var existingValue = isNotSet ? notSetValue : existing; - var newValue = updater(existingValue); - return newValue === existingValue ? existing : newValue; - } - invariant( - isNotSet || (existing && existing.set), - 'invalid keyPath' - ); - var key = step.value; - var nextExisting = isNotSet ? NOT_SET : existing.get(key, NOT_SET); - var nextUpdated = updateInDeepMap( - nextExisting, - keyPathIter, - notSetValue, - updater - ); - return nextUpdated === nextExisting ? existing : - nextUpdated === NOT_SET ? existing.remove(key) : - (isNotSet ? emptyMap() : existing).set(key, nextUpdated); - } - - function popCount(x) { - x = x - ((x >> 1) & 0x55555555); - x = (x & 0x33333333) + ((x >> 2) & 0x33333333); - x = (x + (x >> 4)) & 0x0f0f0f0f; - x = x + (x >> 8); - x = x + (x >> 16); - return x & 0x7f; - } - - function setIn(array, idx, val, canEdit) { - var newArray = canEdit ? array : arrCopy(array); - newArray[idx] = val; - return newArray; - } - - function spliceIn(array, idx, val, canEdit) { - var newLen = array.length + 1; - if (canEdit && idx + 1 === newLen) { - array[idx] = val; - return array; - } - var newArray = new Array(newLen); - var after = 0; - for (var ii = 0; ii < newLen; ii++) { - if (ii === idx) { - newArray[ii] = val; - after = -1; - } else { - newArray[ii] = array[ii + after]; - } - } - return newArray; - } - - function spliceOut(array, idx, canEdit) { - var newLen = array.length - 1; - if (canEdit && idx === newLen) { - array.pop(); - return array; - } - var newArray = new Array(newLen); - var after = 0; - for (var ii = 0; ii < newLen; ii++) { - if (ii === idx) { - after = 1; - } - newArray[ii] = array[ii + after]; - } - return newArray; - } - - var MAX_ARRAY_MAP_SIZE = SIZE / 4; - var MAX_BITMAP_INDEXED_SIZE = SIZE / 2; - var MIN_HASH_ARRAY_MAP_SIZE = SIZE / 4; - - createClass(List, IndexedCollection); - - // @pragma Construction - - function List(value) { - var empty = emptyList(); - if (value === null || value === undefined) { - return empty; - } - if (isList(value)) { - return value; - } - var iter = IndexedIterable(value); - var size = iter.size; - if (size === 0) { - return empty; - } - assertNotInfinite(size); - if (size > 0 && size < SIZE) { - return makeList(0, size, SHIFT, null, new VNode(iter.toArray())); - } - return empty.withMutations(function(list ) { - list.setSize(size); - iter.forEach(function(v, i) {return list.set(i, v)}); - }); - } - - List.of = function(/*...values*/) { - return this(arguments); - }; - - List.prototype.toString = function() { - return this.__toString('List [', ']'); - }; - - // @pragma Access - - List.prototype.get = function(index, notSetValue) { - index = wrapIndex(this, index); - if (index >= 0 && index < this.size) { - index += this._origin; - var node = listNodeFor(this, index); - return node && node.array[index & MASK]; - } - return notSetValue; - }; - - // @pragma Modification - - List.prototype.set = function(index, value) { - return updateList(this, index, value); - }; - - List.prototype.remove = function(index) { - return !this.has(index) ? this : - index === 0 ? this.shift() : - index === this.size - 1 ? this.pop() : - this.splice(index, 1); - }; - - List.prototype.insert = function(index, value) { - return this.splice(index, 0, value); - }; - - List.prototype.clear = function() { - if (this.size === 0) { - return this; - } - if (this.__ownerID) { - this.size = this._origin = this._capacity = 0; - this._level = SHIFT; - this._root = this._tail = null; - this.__hash = undefined; - this.__altered = true; - return this; - } - return emptyList(); - }; - - List.prototype.push = function(/*...values*/) { - var values = arguments; - var oldSize = this.size; - return this.withMutations(function(list ) { - setListBounds(list, 0, oldSize + values.length); - for (var ii = 0; ii < values.length; ii++) { - list.set(oldSize + ii, values[ii]); - } - }); - }; - - List.prototype.pop = function() { - return setListBounds(this, 0, -1); - }; - - List.prototype.unshift = function(/*...values*/) { - var values = arguments; - return this.withMutations(function(list ) { - setListBounds(list, -values.length); - for (var ii = 0; ii < values.length; ii++) { - list.set(ii, values[ii]); - } - }); - }; - - List.prototype.shift = function() { - return setListBounds(this, 1); - }; - - // @pragma Composition - - List.prototype.merge = function(/*...iters*/) { - return mergeIntoListWith(this, undefined, arguments); - }; - - List.prototype.mergeWith = function(merger) {var iters = SLICE$0.call(arguments, 1); - return mergeIntoListWith(this, merger, iters); - }; - - List.prototype.mergeDeep = function(/*...iters*/) { - return mergeIntoListWith(this, deepMerger, arguments); - }; - - List.prototype.mergeDeepWith = function(merger) {var iters = SLICE$0.call(arguments, 1); - return mergeIntoListWith(this, deepMergerWith(merger), iters); - }; - - List.prototype.setSize = function(size) { - return setListBounds(this, 0, size); - }; - - // @pragma Iteration - - List.prototype.slice = function(begin, end) { - var size = this.size; - if (wholeSlice(begin, end, size)) { - return this; - } - return setListBounds( - this, - resolveBegin(begin, size), - resolveEnd(end, size) - ); - }; - - List.prototype.__iterator = function(type, reverse) { - var index = 0; - var values = iterateList(this, reverse); - return new Iterator(function() { - var value = values(); - return value === DONE ? - iteratorDone() : - iteratorValue(type, index++, value); - }); - }; - - List.prototype.__iterate = function(fn, reverse) { - var index = 0; - var values = iterateList(this, reverse); - var value; - while ((value = values()) !== DONE) { - if (fn(value, index++, this) === false) { - break; - } - } - return index; - }; - - List.prototype.__ensureOwner = function(ownerID) { - if (ownerID === this.__ownerID) { - return this; - } - if (!ownerID) { - this.__ownerID = ownerID; - return this; - } - return makeList(this._origin, this._capacity, this._level, this._root, this._tail, ownerID, this.__hash); - }; - - - function isList(maybeList) { - return !!(maybeList && maybeList[IS_LIST_SENTINEL]); - } - - List.isList = isList; - - var IS_LIST_SENTINEL = '@@__IMMUTABLE_LIST__@@'; - - var ListPrototype = List.prototype; - ListPrototype[IS_LIST_SENTINEL] = true; - ListPrototype[DELETE] = ListPrototype.remove; - ListPrototype.setIn = MapPrototype.setIn; - ListPrototype.deleteIn = - ListPrototype.removeIn = MapPrototype.removeIn; - ListPrototype.update = MapPrototype.update; - ListPrototype.updateIn = MapPrototype.updateIn; - ListPrototype.mergeIn = MapPrototype.mergeIn; - ListPrototype.mergeDeepIn = MapPrototype.mergeDeepIn; - ListPrototype.withMutations = MapPrototype.withMutations; - ListPrototype.asMutable = MapPrototype.asMutable; - ListPrototype.asImmutable = MapPrototype.asImmutable; - ListPrototype.wasAltered = MapPrototype.wasAltered; - - - - function VNode(array, ownerID) { - this.array = array; - this.ownerID = ownerID; - } - - // TODO: seems like these methods are very similar - - VNode.prototype.removeBefore = function(ownerID, level, index) { - if (index === level ? 1 << level : 0 || this.array.length === 0) { - return this; - } - var originIndex = (index >>> level) & MASK; - if (originIndex >= this.array.length) { - return new VNode([], ownerID); - } - var removingFirst = originIndex === 0; - var newChild; - if (level > 0) { - var oldChild = this.array[originIndex]; - newChild = oldChild && oldChild.removeBefore(ownerID, level - SHIFT, index); - if (newChild === oldChild && removingFirst) { - return this; - } - } - if (removingFirst && !newChild) { - return this; - } - var editable = editableVNode(this, ownerID); - if (!removingFirst) { - for (var ii = 0; ii < originIndex; ii++) { - editable.array[ii] = undefined; - } - } - if (newChild) { - editable.array[originIndex] = newChild; - } - return editable; - }; - - VNode.prototype.removeAfter = function(ownerID, level, index) { - if (index === (level ? 1 << level : 0) || this.array.length === 0) { - return this; - } - var sizeIndex = ((index - 1) >>> level) & MASK; - if (sizeIndex >= this.array.length) { - return this; - } - - var newChild; - if (level > 0) { - var oldChild = this.array[sizeIndex]; - newChild = oldChild && oldChild.removeAfter(ownerID, level - SHIFT, index); - if (newChild === oldChild && sizeIndex === this.array.length - 1) { - return this; - } - } - - var editable = editableVNode(this, ownerID); - editable.array.splice(sizeIndex + 1); - if (newChild) { - editable.array[sizeIndex] = newChild; - } - return editable; - }; - - - - var DONE = {}; - - function iterateList(list, reverse) { - var left = list._origin; - var right = list._capacity; - var tailPos = getTailOffset(right); - var tail = list._tail; - - return iterateNodeOrLeaf(list._root, list._level, 0); - - function iterateNodeOrLeaf(node, level, offset) { - return level === 0 ? - iterateLeaf(node, offset) : - iterateNode(node, level, offset); - } - - function iterateLeaf(node, offset) { - var array = offset === tailPos ? tail && tail.array : node && node.array; - var from = offset > left ? 0 : left - offset; - var to = right - offset; - if (to > SIZE) { - to = SIZE; - } - return function() { - if (from === to) { - return DONE; - } - var idx = reverse ? --to : from++; - return array && array[idx]; - }; - } - - function iterateNode(node, level, offset) { - var values; - var array = node && node.array; - var from = offset > left ? 0 : (left - offset) >> level; - var to = ((right - offset) >> level) + 1; - if (to > SIZE) { - to = SIZE; - } - return function() { - do { - if (values) { - var value = values(); - if (value !== DONE) { - return value; - } - values = null; - } - if (from === to) { - return DONE; - } - var idx = reverse ? --to : from++; - values = iterateNodeOrLeaf( - array && array[idx], level - SHIFT, offset + (idx << level) - ); - } while (true); - }; - } - } - - function makeList(origin, capacity, level, root, tail, ownerID, hash) { - var list = Object.create(ListPrototype); - list.size = capacity - origin; - list._origin = origin; - list._capacity = capacity; - list._level = level; - list._root = root; - list._tail = tail; - list.__ownerID = ownerID; - list.__hash = hash; - list.__altered = false; - return list; - } - - var EMPTY_LIST; - function emptyList() { - return EMPTY_LIST || (EMPTY_LIST = makeList(0, 0, SHIFT)); - } - - function updateList(list, index, value) { - index = wrapIndex(list, index); - - if (index !== index) { - return list; - } - - if (index >= list.size || index < 0) { - return list.withMutations(function(list ) { - index < 0 ? - setListBounds(list, index).set(0, value) : - setListBounds(list, 0, index + 1).set(index, value) - }); - } - - index += list._origin; - - var newTail = list._tail; - var newRoot = list._root; - var didAlter = MakeRef(DID_ALTER); - if (index >= getTailOffset(list._capacity)) { - newTail = updateVNode(newTail, list.__ownerID, 0, index, value, didAlter); - } else { - newRoot = updateVNode(newRoot, list.__ownerID, list._level, index, value, didAlter); - } - - if (!didAlter.value) { - return list; - } - - if (list.__ownerID) { - list._root = newRoot; - list._tail = newTail; - list.__hash = undefined; - list.__altered = true; - return list; - } - return makeList(list._origin, list._capacity, list._level, newRoot, newTail); - } - - function updateVNode(node, ownerID, level, index, value, didAlter) { - var idx = (index >>> level) & MASK; - var nodeHas = node && idx < node.array.length; - if (!nodeHas && value === undefined) { - return node; - } - - var newNode; - - if (level > 0) { - var lowerNode = node && node.array[idx]; - var newLowerNode = updateVNode(lowerNode, ownerID, level - SHIFT, index, value, didAlter); - if (newLowerNode === lowerNode) { - return node; - } - newNode = editableVNode(node, ownerID); - newNode.array[idx] = newLowerNode; - return newNode; - } - - if (nodeHas && node.array[idx] === value) { - return node; - } - - SetRef(didAlter); - - newNode = editableVNode(node, ownerID); - if (value === undefined && idx === newNode.array.length - 1) { - newNode.array.pop(); - } else { - newNode.array[idx] = value; - } - return newNode; - } - - function editableVNode(node, ownerID) { - if (ownerID && node && ownerID === node.ownerID) { - return node; - } - return new VNode(node ? node.array.slice() : [], ownerID); - } - - function listNodeFor(list, rawIndex) { - if (rawIndex >= getTailOffset(list._capacity)) { - return list._tail; - } - if (rawIndex < 1 << (list._level + SHIFT)) { - var node = list._root; - var level = list._level; - while (node && level > 0) { - node = node.array[(rawIndex >>> level) & MASK]; - level -= SHIFT; - } - return node; - } - } - - function setListBounds(list, begin, end) { - // Sanitize begin & end using this shorthand for ToInt32(argument) - // http://www.ecma-international.org/ecma-262/6.0/#sec-toint32 - if (begin !== undefined) { - begin = begin | 0; - } - if (end !== undefined) { - end = end | 0; - } - var owner = list.__ownerID || new OwnerID(); - var oldOrigin = list._origin; - var oldCapacity = list._capacity; - var newOrigin = oldOrigin + begin; - var newCapacity = end === undefined ? oldCapacity : end < 0 ? oldCapacity + end : oldOrigin + end; - if (newOrigin === oldOrigin && newCapacity === oldCapacity) { - return list; - } - - // If it's going to end after it starts, it's empty. - if (newOrigin >= newCapacity) { - return list.clear(); - } - - var newLevel = list._level; - var newRoot = list._root; - - // New origin might need creating a higher root. - var offsetShift = 0; - while (newOrigin + offsetShift < 0) { - newRoot = new VNode(newRoot && newRoot.array.length ? [undefined, newRoot] : [], owner); - newLevel += SHIFT; - offsetShift += 1 << newLevel; - } - if (offsetShift) { - newOrigin += offsetShift; - oldOrigin += offsetShift; - newCapacity += offsetShift; - oldCapacity += offsetShift; - } - - var oldTailOffset = getTailOffset(oldCapacity); - var newTailOffset = getTailOffset(newCapacity); - - // New size might need creating a higher root. - while (newTailOffset >= 1 << (newLevel + SHIFT)) { - newRoot = new VNode(newRoot && newRoot.array.length ? [newRoot] : [], owner); - newLevel += SHIFT; - } - - // Locate or create the new tail. - var oldTail = list._tail; - var newTail = newTailOffset < oldTailOffset ? - listNodeFor(list, newCapacity - 1) : - newTailOffset > oldTailOffset ? new VNode([], owner) : oldTail; - - // Merge Tail into tree. - if (oldTail && newTailOffset > oldTailOffset && newOrigin < oldCapacity && oldTail.array.length) { - newRoot = editableVNode(newRoot, owner); - var node = newRoot; - for (var level = newLevel; level > SHIFT; level -= SHIFT) { - var idx = (oldTailOffset >>> level) & MASK; - node = node.array[idx] = editableVNode(node.array[idx], owner); - } - node.array[(oldTailOffset >>> SHIFT) & MASK] = oldTail; - } - - // If the size has been reduced, there's a chance the tail needs to be trimmed. - if (newCapacity < oldCapacity) { - newTail = newTail && newTail.removeAfter(owner, 0, newCapacity); - } - - // If the new origin is within the tail, then we do not need a root. - if (newOrigin >= newTailOffset) { - newOrigin -= newTailOffset; - newCapacity -= newTailOffset; - newLevel = SHIFT; - newRoot = null; - newTail = newTail && newTail.removeBefore(owner, 0, newOrigin); - - // Otherwise, if the root has been trimmed, garbage collect. - } else if (newOrigin > oldOrigin || newTailOffset < oldTailOffset) { - offsetShift = 0; - - // Identify the new top root node of the subtree of the old root. - while (newRoot) { - var beginIndex = (newOrigin >>> newLevel) & MASK; - if (beginIndex !== (newTailOffset >>> newLevel) & MASK) { - break; - } - if (beginIndex) { - offsetShift += (1 << newLevel) * beginIndex; - } - newLevel -= SHIFT; - newRoot = newRoot.array[beginIndex]; - } - - // Trim the new sides of the new root. - if (newRoot && newOrigin > oldOrigin) { - newRoot = newRoot.removeBefore(owner, newLevel, newOrigin - offsetShift); - } - if (newRoot && newTailOffset < oldTailOffset) { - newRoot = newRoot.removeAfter(owner, newLevel, newTailOffset - offsetShift); - } - if (offsetShift) { - newOrigin -= offsetShift; - newCapacity -= offsetShift; - } - } - - if (list.__ownerID) { - list.size = newCapacity - newOrigin; - list._origin = newOrigin; - list._capacity = newCapacity; - list._level = newLevel; - list._root = newRoot; - list._tail = newTail; - list.__hash = undefined; - list.__altered = true; - return list; - } - return makeList(newOrigin, newCapacity, newLevel, newRoot, newTail); - } - - function mergeIntoListWith(list, merger, iterables) { - var iters = []; - var maxSize = 0; - for (var ii = 0; ii < iterables.length; ii++) { - var value = iterables[ii]; - var iter = IndexedIterable(value); - if (iter.size > maxSize) { - maxSize = iter.size; - } - if (!isIterable(value)) { - iter = iter.map(function(v ) {return fromJS(v)}); - } - iters.push(iter); - } - if (maxSize > list.size) { - list = list.setSize(maxSize); - } - return mergeIntoCollectionWith(list, merger, iters); - } - - function getTailOffset(size) { - return size < SIZE ? 0 : (((size - 1) >>> SHIFT) << SHIFT); - } - - createClass(OrderedMap, Map); - - // @pragma Construction - - function OrderedMap(value) { - return value === null || value === undefined ? emptyOrderedMap() : - isOrderedMap(value) ? value : - emptyOrderedMap().withMutations(function(map ) { - var iter = KeyedIterable(value); - assertNotInfinite(iter.size); - iter.forEach(function(v, k) {return map.set(k, v)}); - }); - } - - OrderedMap.of = function(/*...values*/) { - return this(arguments); - }; - - OrderedMap.prototype.toString = function() { - return this.__toString('OrderedMap {', '}'); - }; - - // @pragma Access - - OrderedMap.prototype.get = function(k, notSetValue) { - var index = this._map.get(k); - return index !== undefined ? this._list.get(index)[1] : notSetValue; - }; - - // @pragma Modification - - OrderedMap.prototype.clear = function() { - if (this.size === 0) { - return this; - } - if (this.__ownerID) { - this.size = 0; - this._map.clear(); - this._list.clear(); - return this; - } - return emptyOrderedMap(); - }; - - OrderedMap.prototype.set = function(k, v) { - return updateOrderedMap(this, k, v); - }; - - OrderedMap.prototype.remove = function(k) { - return updateOrderedMap(this, k, NOT_SET); - }; - - OrderedMap.prototype.wasAltered = function() { - return this._map.wasAltered() || this._list.wasAltered(); - }; - - OrderedMap.prototype.__iterate = function(fn, reverse) {var this$0 = this; - return this._list.__iterate( - function(entry ) {return entry && fn(entry[1], entry[0], this$0)}, - reverse - ); - }; - - OrderedMap.prototype.__iterator = function(type, reverse) { - return this._list.fromEntrySeq().__iterator(type, reverse); - }; - - OrderedMap.prototype.__ensureOwner = function(ownerID) { - if (ownerID === this.__ownerID) { - return this; - } - var newMap = this._map.__ensureOwner(ownerID); - var newList = this._list.__ensureOwner(ownerID); - if (!ownerID) { - this.__ownerID = ownerID; - this._map = newMap; - this._list = newList; - return this; - } - return makeOrderedMap(newMap, newList, ownerID, this.__hash); - }; - - - function isOrderedMap(maybeOrderedMap) { - return isMap(maybeOrderedMap) && isOrdered(maybeOrderedMap); - } - - OrderedMap.isOrderedMap = isOrderedMap; - - OrderedMap.prototype[IS_ORDERED_SENTINEL] = true; - OrderedMap.prototype[DELETE] = OrderedMap.prototype.remove; - - - - function makeOrderedMap(map, list, ownerID, hash) { - var omap = Object.create(OrderedMap.prototype); - omap.size = map ? map.size : 0; - omap._map = map; - omap._list = list; - omap.__ownerID = ownerID; - omap.__hash = hash; - return omap; - } - - var EMPTY_ORDERED_MAP; - function emptyOrderedMap() { - return EMPTY_ORDERED_MAP || (EMPTY_ORDERED_MAP = makeOrderedMap(emptyMap(), emptyList())); - } - - function updateOrderedMap(omap, k, v) { - var map = omap._map; - var list = omap._list; - var i = map.get(k); - var has = i !== undefined; - var newMap; - var newList; - if (v === NOT_SET) { // removed - if (!has) { - return omap; - } - if (list.size >= SIZE && list.size >= map.size * 2) { - newList = list.filter(function(entry, idx) {return entry !== undefined && i !== idx}); - newMap = newList.toKeyedSeq().map(function(entry ) {return entry[0]}).flip().toMap(); - if (omap.__ownerID) { - newMap.__ownerID = newList.__ownerID = omap.__ownerID; - } - } else { - newMap = map.remove(k); - newList = i === list.size - 1 ? list.pop() : list.set(i, undefined); - } - } else { - if (has) { - if (v === list.get(i)[1]) { - return omap; - } - newMap = map; - newList = list.set(i, [k, v]); - } else { - newMap = map.set(k, list.size); - newList = list.set(list.size, [k, v]); - } - } - if (omap.__ownerID) { - omap.size = newMap.size; - omap._map = newMap; - omap._list = newList; - omap.__hash = undefined; - return omap; - } - return makeOrderedMap(newMap, newList); - } - - createClass(ToKeyedSequence, KeyedSeq); - function ToKeyedSequence(indexed, useKeys) { - this._iter = indexed; - this._useKeys = useKeys; - this.size = indexed.size; - } - - ToKeyedSequence.prototype.get = function(key, notSetValue) { - return this._iter.get(key, notSetValue); - }; - - ToKeyedSequence.prototype.has = function(key) { - return this._iter.has(key); - }; - - ToKeyedSequence.prototype.valueSeq = function() { - return this._iter.valueSeq(); - }; - - ToKeyedSequence.prototype.reverse = function() {var this$0 = this; - var reversedSequence = reverseFactory(this, true); - if (!this._useKeys) { - reversedSequence.valueSeq = function() {return this$0._iter.toSeq().reverse()}; - } - return reversedSequence; - }; - - ToKeyedSequence.prototype.map = function(mapper, context) {var this$0 = this; - var mappedSequence = mapFactory(this, mapper, context); - if (!this._useKeys) { - mappedSequence.valueSeq = function() {return this$0._iter.toSeq().map(mapper, context)}; - } - return mappedSequence; - }; - - ToKeyedSequence.prototype.__iterate = function(fn, reverse) {var this$0 = this; - var ii; - return this._iter.__iterate( - this._useKeys ? - function(v, k) {return fn(v, k, this$0)} : - ((ii = reverse ? resolveSize(this) : 0), - function(v ) {return fn(v, reverse ? --ii : ii++, this$0)}), - reverse - ); - }; - - ToKeyedSequence.prototype.__iterator = function(type, reverse) { - if (this._useKeys) { - return this._iter.__iterator(type, reverse); - } - var iterator = this._iter.__iterator(ITERATE_VALUES, reverse); - var ii = reverse ? resolveSize(this) : 0; - return new Iterator(function() { - var step = iterator.next(); - return step.done ? step : - iteratorValue(type, reverse ? --ii : ii++, step.value, step); - }); - }; - - ToKeyedSequence.prototype[IS_ORDERED_SENTINEL] = true; - - - createClass(ToIndexedSequence, IndexedSeq); - function ToIndexedSequence(iter) { - this._iter = iter; - this.size = iter.size; - } - - ToIndexedSequence.prototype.includes = function(value) { - return this._iter.includes(value); - }; - - ToIndexedSequence.prototype.__iterate = function(fn, reverse) {var this$0 = this; - var iterations = 0; - return this._iter.__iterate(function(v ) {return fn(v, iterations++, this$0)}, reverse); - }; - - ToIndexedSequence.prototype.__iterator = function(type, reverse) { - var iterator = this._iter.__iterator(ITERATE_VALUES, reverse); - var iterations = 0; - return new Iterator(function() { - var step = iterator.next(); - return step.done ? step : - iteratorValue(type, iterations++, step.value, step) - }); - }; - - - - createClass(ToSetSequence, SetSeq); - function ToSetSequence(iter) { - this._iter = iter; - this.size = iter.size; - } - - ToSetSequence.prototype.has = function(key) { - return this._iter.includes(key); - }; - - ToSetSequence.prototype.__iterate = function(fn, reverse) {var this$0 = this; - return this._iter.__iterate(function(v ) {return fn(v, v, this$0)}, reverse); - }; - - ToSetSequence.prototype.__iterator = function(type, reverse) { - var iterator = this._iter.__iterator(ITERATE_VALUES, reverse); - return new Iterator(function() { - var step = iterator.next(); - return step.done ? step : - iteratorValue(type, step.value, step.value, step); - }); - }; - - - - createClass(FromEntriesSequence, KeyedSeq); - function FromEntriesSequence(entries) { - this._iter = entries; - this.size = entries.size; - } - - FromEntriesSequence.prototype.entrySeq = function() { - return this._iter.toSeq(); - }; - - FromEntriesSequence.prototype.__iterate = function(fn, reverse) {var this$0 = this; - return this._iter.__iterate(function(entry ) { - // Check if entry exists first so array access doesn't throw for holes - // in the parent iteration. - if (entry) { - validateEntry(entry); - var indexedIterable = isIterable(entry); - return fn( - indexedIterable ? entry.get(1) : entry[1], - indexedIterable ? entry.get(0) : entry[0], - this$0 - ); - } - }, reverse); - }; - - FromEntriesSequence.prototype.__iterator = function(type, reverse) { - var iterator = this._iter.__iterator(ITERATE_VALUES, reverse); - return new Iterator(function() { - while (true) { - var step = iterator.next(); - if (step.done) { - return step; - } - var entry = step.value; - // Check if entry exists first so array access doesn't throw for holes - // in the parent iteration. - if (entry) { - validateEntry(entry); - var indexedIterable = isIterable(entry); - return iteratorValue( - type, - indexedIterable ? entry.get(0) : entry[0], - indexedIterable ? entry.get(1) : entry[1], - step - ); - } - } - }); - }; - - - ToIndexedSequence.prototype.cacheResult = - ToKeyedSequence.prototype.cacheResult = - ToSetSequence.prototype.cacheResult = - FromEntriesSequence.prototype.cacheResult = - cacheResultThrough; - - - function flipFactory(iterable) { - var flipSequence = makeSequence(iterable); - flipSequence._iter = iterable; - flipSequence.size = iterable.size; - flipSequence.flip = function() {return iterable}; - flipSequence.reverse = function () { - var reversedSequence = iterable.reverse.apply(this); // super.reverse() - reversedSequence.flip = function() {return iterable.reverse()}; - return reversedSequence; - }; - flipSequence.has = function(key ) {return iterable.includes(key)}; - flipSequence.includes = function(key ) {return iterable.has(key)}; - flipSequence.cacheResult = cacheResultThrough; - flipSequence.__iterateUncached = function (fn, reverse) {var this$0 = this; - return iterable.__iterate(function(v, k) {return fn(k, v, this$0) !== false}, reverse); - } - flipSequence.__iteratorUncached = function(type, reverse) { - if (type === ITERATE_ENTRIES) { - var iterator = iterable.__iterator(type, reverse); - return new Iterator(function() { - var step = iterator.next(); - if (!step.done) { - var k = step.value[0]; - step.value[0] = step.value[1]; - step.value[1] = k; - } - return step; - }); - } - return iterable.__iterator( - type === ITERATE_VALUES ? ITERATE_KEYS : ITERATE_VALUES, - reverse - ); - } - return flipSequence; - } - - - function mapFactory(iterable, mapper, context) { - var mappedSequence = makeSequence(iterable); - mappedSequence.size = iterable.size; - mappedSequence.has = function(key ) {return iterable.has(key)}; - mappedSequence.get = function(key, notSetValue) { - var v = iterable.get(key, NOT_SET); - return v === NOT_SET ? - notSetValue : - mapper.call(context, v, key, iterable); - }; - mappedSequence.__iterateUncached = function (fn, reverse) {var this$0 = this; - return iterable.__iterate( - function(v, k, c) {return fn(mapper.call(context, v, k, c), k, this$0) !== false}, - reverse - ); - } - mappedSequence.__iteratorUncached = function (type, reverse) { - var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse); - return new Iterator(function() { - var step = iterator.next(); - if (step.done) { - return step; - } - var entry = step.value; - var key = entry[0]; - return iteratorValue( - type, - key, - mapper.call(context, entry[1], key, iterable), - step - ); - }); - } - return mappedSequence; - } - - - function reverseFactory(iterable, useKeys) { - var reversedSequence = makeSequence(iterable); - reversedSequence._iter = iterable; - reversedSequence.size = iterable.size; - reversedSequence.reverse = function() {return iterable}; - if (iterable.flip) { - reversedSequence.flip = function () { - var flipSequence = flipFactory(iterable); - flipSequence.reverse = function() {return iterable.flip()}; - return flipSequence; - }; - } - reversedSequence.get = function(key, notSetValue) - {return iterable.get(useKeys ? key : -1 - key, notSetValue)}; - reversedSequence.has = function(key ) - {return iterable.has(useKeys ? key : -1 - key)}; - reversedSequence.includes = function(value ) {return iterable.includes(value)}; - reversedSequence.cacheResult = cacheResultThrough; - reversedSequence.__iterate = function (fn, reverse) {var this$0 = this; - return iterable.__iterate(function(v, k) {return fn(v, k, this$0)}, !reverse); - }; - reversedSequence.__iterator = - function(type, reverse) {return iterable.__iterator(type, !reverse)}; - return reversedSequence; - } - - - function filterFactory(iterable, predicate, context, useKeys) { - var filterSequence = makeSequence(iterable); - if (useKeys) { - filterSequence.has = function(key ) { - var v = iterable.get(key, NOT_SET); - return v !== NOT_SET && !!predicate.call(context, v, key, iterable); - }; - filterSequence.get = function(key, notSetValue) { - var v = iterable.get(key, NOT_SET); - return v !== NOT_SET && predicate.call(context, v, key, iterable) ? - v : notSetValue; - }; - } - filterSequence.__iterateUncached = function (fn, reverse) {var this$0 = this; - var iterations = 0; - iterable.__iterate(function(v, k, c) { - if (predicate.call(context, v, k, c)) { - iterations++; - return fn(v, useKeys ? k : iterations - 1, this$0); - } - }, reverse); - return iterations; - }; - filterSequence.__iteratorUncached = function (type, reverse) { - var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse); - var iterations = 0; - return new Iterator(function() { - while (true) { - var step = iterator.next(); - if (step.done) { - return step; - } - var entry = step.value; - var key = entry[0]; - var value = entry[1]; - if (predicate.call(context, value, key, iterable)) { - return iteratorValue(type, useKeys ? key : iterations++, value, step); - } - } - }); - } - return filterSequence; - } - - - function countByFactory(iterable, grouper, context) { - var groups = Map().asMutable(); - iterable.__iterate(function(v, k) { - groups.update( - grouper.call(context, v, k, iterable), - 0, - function(a ) {return a + 1} - ); - }); - return groups.asImmutable(); - } - - - function groupByFactory(iterable, grouper, context) { - var isKeyedIter = isKeyed(iterable); - var groups = (isOrdered(iterable) ? OrderedMap() : Map()).asMutable(); - iterable.__iterate(function(v, k) { - groups.update( - grouper.call(context, v, k, iterable), - function(a ) {return (a = a || [], a.push(isKeyedIter ? [k, v] : v), a)} - ); - }); - var coerce = iterableClass(iterable); - return groups.map(function(arr ) {return reify(iterable, coerce(arr))}); - } - - - function sliceFactory(iterable, begin, end, useKeys) { - var originalSize = iterable.size; - - // Sanitize begin & end using this shorthand for ToInt32(argument) - // http://www.ecma-international.org/ecma-262/6.0/#sec-toint32 - if (begin !== undefined) { - begin = begin | 0; - } - if (end !== undefined) { - if (end === Infinity) { - end = originalSize; - } else { - end = end | 0; - } - } - - if (wholeSlice(begin, end, originalSize)) { - return iterable; - } - - var resolvedBegin = resolveBegin(begin, originalSize); - var resolvedEnd = resolveEnd(end, originalSize); - - // begin or end will be NaN if they were provided as negative numbers and - // this iterable's size is unknown. In that case, cache first so there is - // a known size and these do not resolve to NaN. - if (resolvedBegin !== resolvedBegin || resolvedEnd !== resolvedEnd) { - return sliceFactory(iterable.toSeq().cacheResult(), begin, end, useKeys); - } - - // Note: resolvedEnd is undefined when the original sequence's length is - // unknown and this slice did not supply an end and should contain all - // elements after resolvedBegin. - // In that case, resolvedSize will be NaN and sliceSize will remain undefined. - var resolvedSize = resolvedEnd - resolvedBegin; - var sliceSize; - if (resolvedSize === resolvedSize) { - sliceSize = resolvedSize < 0 ? 0 : resolvedSize; - } - - var sliceSeq = makeSequence(iterable); - - // If iterable.size is undefined, the size of the realized sliceSeq is - // unknown at this point unless the number of items to slice is 0 - sliceSeq.size = sliceSize === 0 ? sliceSize : iterable.size && sliceSize || undefined; - - if (!useKeys && isSeq(iterable) && sliceSize >= 0) { - sliceSeq.get = function (index, notSetValue) { - index = wrapIndex(this, index); - return index >= 0 && index < sliceSize ? - iterable.get(index + resolvedBegin, notSetValue) : - notSetValue; - } - } - - sliceSeq.__iterateUncached = function(fn, reverse) {var this$0 = this; - if (sliceSize === 0) { - return 0; - } - if (reverse) { - return this.cacheResult().__iterate(fn, reverse); - } - var skipped = 0; - var isSkipping = true; - var iterations = 0; - iterable.__iterate(function(v, k) { - if (!(isSkipping && (isSkipping = skipped++ < resolvedBegin))) { - iterations++; - return fn(v, useKeys ? k : iterations - 1, this$0) !== false && - iterations !== sliceSize; - } - }); - return iterations; - }; - - sliceSeq.__iteratorUncached = function(type, reverse) { - if (sliceSize !== 0 && reverse) { - return this.cacheResult().__iterator(type, reverse); - } - // Don't bother instantiating parent iterator if taking 0. - var iterator = sliceSize !== 0 && iterable.__iterator(type, reverse); - var skipped = 0; - var iterations = 0; - return new Iterator(function() { - while (skipped++ < resolvedBegin) { - iterator.next(); - } - if (++iterations > sliceSize) { - return iteratorDone(); - } - var step = iterator.next(); - if (useKeys || type === ITERATE_VALUES) { - return step; - } else if (type === ITERATE_KEYS) { - return iteratorValue(type, iterations - 1, undefined, step); - } else { - return iteratorValue(type, iterations - 1, step.value[1], step); - } - }); - } - - return sliceSeq; - } - - - function takeWhileFactory(iterable, predicate, context) { - var takeSequence = makeSequence(iterable); - takeSequence.__iterateUncached = function(fn, reverse) {var this$0 = this; - if (reverse) { - return this.cacheResult().__iterate(fn, reverse); - } - var iterations = 0; - iterable.__iterate(function(v, k, c) - {return predicate.call(context, v, k, c) && ++iterations && fn(v, k, this$0)} - ); - return iterations; - }; - takeSequence.__iteratorUncached = function(type, reverse) {var this$0 = this; - if (reverse) { - return this.cacheResult().__iterator(type, reverse); - } - var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse); - var iterating = true; - return new Iterator(function() { - if (!iterating) { - return iteratorDone(); - } - var step = iterator.next(); - if (step.done) { - return step; - } - var entry = step.value; - var k = entry[0]; - var v = entry[1]; - if (!predicate.call(context, v, k, this$0)) { - iterating = false; - return iteratorDone(); - } - return type === ITERATE_ENTRIES ? step : - iteratorValue(type, k, v, step); - }); - }; - return takeSequence; - } - - - function skipWhileFactory(iterable, predicate, context, useKeys) { - var skipSequence = makeSequence(iterable); - skipSequence.__iterateUncached = function (fn, reverse) {var this$0 = this; - if (reverse) { - return this.cacheResult().__iterate(fn, reverse); - } - var isSkipping = true; - var iterations = 0; - iterable.__iterate(function(v, k, c) { - if (!(isSkipping && (isSkipping = predicate.call(context, v, k, c)))) { - iterations++; - return fn(v, useKeys ? k : iterations - 1, this$0); - } - }); - return iterations; - }; - skipSequence.__iteratorUncached = function(type, reverse) {var this$0 = this; - if (reverse) { - return this.cacheResult().__iterator(type, reverse); - } - var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse); - var skipping = true; - var iterations = 0; - return new Iterator(function() { - var step, k, v; - do { - step = iterator.next(); - if (step.done) { - if (useKeys || type === ITERATE_VALUES) { - return step; - } else if (type === ITERATE_KEYS) { - return iteratorValue(type, iterations++, undefined, step); - } else { - return iteratorValue(type, iterations++, step.value[1], step); - } - } - var entry = step.value; - k = entry[0]; - v = entry[1]; - skipping && (skipping = predicate.call(context, v, k, this$0)); - } while (skipping); - return type === ITERATE_ENTRIES ? step : - iteratorValue(type, k, v, step); - }); - }; - return skipSequence; - } - - - function concatFactory(iterable, values) { - var isKeyedIterable = isKeyed(iterable); - var iters = [iterable].concat(values).map(function(v ) { - if (!isIterable(v)) { - v = isKeyedIterable ? - keyedSeqFromValue(v) : - indexedSeqFromValue(Array.isArray(v) ? v : [v]); - } else if (isKeyedIterable) { - v = KeyedIterable(v); - } - return v; - }).filter(function(v ) {return v.size !== 0}); - - if (iters.length === 0) { - return iterable; - } - - if (iters.length === 1) { - var singleton = iters[0]; - if (singleton === iterable || - isKeyedIterable && isKeyed(singleton) || - isIndexed(iterable) && isIndexed(singleton)) { - return singleton; - } - } - - var concatSeq = new ArraySeq(iters); - if (isKeyedIterable) { - concatSeq = concatSeq.toKeyedSeq(); - } else if (!isIndexed(iterable)) { - concatSeq = concatSeq.toSetSeq(); - } - concatSeq = concatSeq.flatten(true); - concatSeq.size = iters.reduce( - function(sum, seq) { - if (sum !== undefined) { - var size = seq.size; - if (size !== undefined) { - return sum + size; - } - } - }, - 0 - ); - return concatSeq; - } - - - function flattenFactory(iterable, depth, useKeys) { - var flatSequence = makeSequence(iterable); - flatSequence.__iterateUncached = function(fn, reverse) { - var iterations = 0; - var stopped = false; - function flatDeep(iter, currentDepth) {var this$0 = this; - iter.__iterate(function(v, k) { - if ((!depth || currentDepth < depth) && isIterable(v)) { - flatDeep(v, currentDepth + 1); - } else if (fn(v, useKeys ? k : iterations++, this$0) === false) { - stopped = true; - } - return !stopped; - }, reverse); - } - flatDeep(iterable, 0); - return iterations; - } - flatSequence.__iteratorUncached = function(type, reverse) { - var iterator = iterable.__iterator(type, reverse); - var stack = []; - var iterations = 0; - return new Iterator(function() { - while (iterator) { - var step = iterator.next(); - if (step.done !== false) { - iterator = stack.pop(); - continue; - } - var v = step.value; - if (type === ITERATE_ENTRIES) { - v = v[1]; - } - if ((!depth || stack.length < depth) && isIterable(v)) { - stack.push(iterator); - iterator = v.__iterator(type, reverse); - } else { - return useKeys ? step : iteratorValue(type, iterations++, v, step); - } - } - return iteratorDone(); - }); - } - return flatSequence; - } - - - function flatMapFactory(iterable, mapper, context) { - var coerce = iterableClass(iterable); - return iterable.toSeq().map( - function(v, k) {return coerce(mapper.call(context, v, k, iterable))} - ).flatten(true); - } - - - function interposeFactory(iterable, separator) { - var interposedSequence = makeSequence(iterable); - interposedSequence.size = iterable.size && iterable.size * 2 -1; - interposedSequence.__iterateUncached = function(fn, reverse) {var this$0 = this; - var iterations = 0; - iterable.__iterate(function(v, k) - {return (!iterations || fn(separator, iterations++, this$0) !== false) && - fn(v, iterations++, this$0) !== false}, - reverse - ); - return iterations; - }; - interposedSequence.__iteratorUncached = function(type, reverse) { - var iterator = iterable.__iterator(ITERATE_VALUES, reverse); - var iterations = 0; - var step; - return new Iterator(function() { - if (!step || iterations % 2) { - step = iterator.next(); - if (step.done) { - return step; - } - } - return iterations % 2 ? - iteratorValue(type, iterations++, separator) : - iteratorValue(type, iterations++, step.value, step); - }); - }; - return interposedSequence; - } - - - function sortFactory(iterable, comparator, mapper) { - if (!comparator) { - comparator = defaultComparator; - } - var isKeyedIterable = isKeyed(iterable); - var index = 0; - var entries = iterable.toSeq().map( - function(v, k) {return [k, v, index++, mapper ? mapper(v, k, iterable) : v]} - ).toArray(); - entries.sort(function(a, b) {return comparator(a[3], b[3]) || a[2] - b[2]}).forEach( - isKeyedIterable ? - function(v, i) { entries[i].length = 2; } : - function(v, i) { entries[i] = v[1]; } - ); - return isKeyedIterable ? KeyedSeq(entries) : - isIndexed(iterable) ? IndexedSeq(entries) : - SetSeq(entries); - } - - - function maxFactory(iterable, comparator, mapper) { - if (!comparator) { - comparator = defaultComparator; - } - if (mapper) { - var entry = iterable.toSeq() - .map(function(v, k) {return [v, mapper(v, k, iterable)]}) - .reduce(function(a, b) {return maxCompare(comparator, a[1], b[1]) ? b : a}); - return entry && entry[0]; - } else { - return iterable.reduce(function(a, b) {return maxCompare(comparator, a, b) ? b : a}); - } - } - - function maxCompare(comparator, a, b) { - var comp = comparator(b, a); - // b is considered the new max if the comparator declares them equal, but - // they are not equal and b is in fact a nullish value. - return (comp === 0 && b !== a && (b === undefined || b === null || b !== b)) || comp > 0; - } - - - function zipWithFactory(keyIter, zipper, iters) { - var zipSequence = makeSequence(keyIter); - zipSequence.size = new ArraySeq(iters).map(function(i ) {return i.size}).min(); - // Note: this a generic base implementation of __iterate in terms of - // __iterator which may be more generically useful in the future. - zipSequence.__iterate = function(fn, reverse) { - /* generic: - var iterator = this.__iterator(ITERATE_ENTRIES, reverse); - var step; - var iterations = 0; - while (!(step = iterator.next()).done) { - iterations++; - if (fn(step.value[1], step.value[0], this) === false) { - break; - } - } - return iterations; - */ - // indexed: - var iterator = this.__iterator(ITERATE_VALUES, reverse); - var step; - var iterations = 0; - while (!(step = iterator.next()).done) { - if (fn(step.value, iterations++, this) === false) { - break; - } - } - return iterations; - }; - zipSequence.__iteratorUncached = function(type, reverse) { - var iterators = iters.map(function(i ) - {return (i = Iterable(i), getIterator(reverse ? i.reverse() : i))} - ); - var iterations = 0; - var isDone = false; - return new Iterator(function() { - var steps; - if (!isDone) { - steps = iterators.map(function(i ) {return i.next()}); - isDone = steps.some(function(s ) {return s.done}); - } - if (isDone) { - return iteratorDone(); - } - return iteratorValue( - type, - iterations++, - zipper.apply(null, steps.map(function(s ) {return s.value})) - ); - }); - }; - return zipSequence - } - - - // #pragma Helper Functions - - function reify(iter, seq) { - return isSeq(iter) ? seq : iter.constructor(seq); - } - - function validateEntry(entry) { - if (entry !== Object(entry)) { - throw new TypeError('Expected [K, V] tuple: ' + entry); - } - } - - function resolveSize(iter) { - assertNotInfinite(iter.size); - return ensureSize(iter); - } - - function iterableClass(iterable) { - return isKeyed(iterable) ? KeyedIterable : - isIndexed(iterable) ? IndexedIterable : - SetIterable; - } - - function makeSequence(iterable) { - return Object.create( - ( - isKeyed(iterable) ? KeyedSeq : - isIndexed(iterable) ? IndexedSeq : - SetSeq - ).prototype - ); - } - - function cacheResultThrough() { - if (this._iter.cacheResult) { - this._iter.cacheResult(); - this.size = this._iter.size; - return this; - } else { - return Seq.prototype.cacheResult.call(this); - } - } - - function defaultComparator(a, b) { - return a > b ? 1 : a < b ? -1 : 0; - } - - function forceIterator(keyPath) { - var iter = getIterator(keyPath); - if (!iter) { - // Array might not be iterable in this environment, so we need a fallback - // to our wrapped type. - if (!isArrayLike(keyPath)) { - throw new TypeError('Expected iterable or array-like: ' + keyPath); - } - iter = getIterator(Iterable(keyPath)); - } - return iter; - } - - createClass(Record, KeyedCollection); - - function Record(defaultValues, name) { - var hasInitialized; - - var RecordType = function Record(values) { - if (values instanceof RecordType) { - return values; - } - if (!(this instanceof RecordType)) { - return new RecordType(values); - } - if (!hasInitialized) { - hasInitialized = true; - var keys = Object.keys(defaultValues); - setProps(RecordTypePrototype, keys); - RecordTypePrototype.size = keys.length; - RecordTypePrototype._name = name; - RecordTypePrototype._keys = keys; - RecordTypePrototype._defaultValues = defaultValues; - } - this._map = Map(values); - }; - - var RecordTypePrototype = RecordType.prototype = Object.create(RecordPrototype); - RecordTypePrototype.constructor = RecordType; - - return RecordType; - } - - Record.prototype.toString = function() { - return this.__toString(recordName(this) + ' {', '}'); - }; - - // @pragma Access - - Record.prototype.has = function(k) { - return this._defaultValues.hasOwnProperty(k); - }; - - Record.prototype.get = function(k, notSetValue) { - if (!this.has(k)) { - return notSetValue; - } - var defaultVal = this._defaultValues[k]; - return this._map ? this._map.get(k, defaultVal) : defaultVal; - }; - - // @pragma Modification - - Record.prototype.clear = function() { - if (this.__ownerID) { - this._map && this._map.clear(); - return this; - } - var RecordType = this.constructor; - return RecordType._empty || (RecordType._empty = makeRecord(this, emptyMap())); - }; - - Record.prototype.set = function(k, v) { - if (!this.has(k)) { - throw new Error('Cannot set unknown key "' + k + '" on ' + recordName(this)); - } - if (this._map && !this._map.has(k)) { - var defaultVal = this._defaultValues[k]; - if (v === defaultVal) { - return this; - } - } - var newMap = this._map && this._map.set(k, v); - if (this.__ownerID || newMap === this._map) { - return this; - } - return makeRecord(this, newMap); - }; - - Record.prototype.remove = function(k) { - if (!this.has(k)) { - return this; - } - var newMap = this._map && this._map.remove(k); - if (this.__ownerID || newMap === this._map) { - return this; - } - return makeRecord(this, newMap); - }; - - Record.prototype.wasAltered = function() { - return this._map.wasAltered(); - }; - - Record.prototype.__iterator = function(type, reverse) {var this$0 = this; - return KeyedIterable(this._defaultValues).map(function(_, k) {return this$0.get(k)}).__iterator(type, reverse); - }; - - Record.prototype.__iterate = function(fn, reverse) {var this$0 = this; - return KeyedIterable(this._defaultValues).map(function(_, k) {return this$0.get(k)}).__iterate(fn, reverse); - }; - - Record.prototype.__ensureOwner = function(ownerID) { - if (ownerID === this.__ownerID) { - return this; - } - var newMap = this._map && this._map.__ensureOwner(ownerID); - if (!ownerID) { - this.__ownerID = ownerID; - this._map = newMap; - return this; - } - return makeRecord(this, newMap, ownerID); - }; - - - var RecordPrototype = Record.prototype; - RecordPrototype[DELETE] = RecordPrototype.remove; - RecordPrototype.deleteIn = - RecordPrototype.removeIn = MapPrototype.removeIn; - RecordPrototype.merge = MapPrototype.merge; - RecordPrototype.mergeWith = MapPrototype.mergeWith; - RecordPrototype.mergeIn = MapPrototype.mergeIn; - RecordPrototype.mergeDeep = MapPrototype.mergeDeep; - RecordPrototype.mergeDeepWith = MapPrototype.mergeDeepWith; - RecordPrototype.mergeDeepIn = MapPrototype.mergeDeepIn; - RecordPrototype.setIn = MapPrototype.setIn; - RecordPrototype.update = MapPrototype.update; - RecordPrototype.updateIn = MapPrototype.updateIn; - RecordPrototype.withMutations = MapPrototype.withMutations; - RecordPrototype.asMutable = MapPrototype.asMutable; - RecordPrototype.asImmutable = MapPrototype.asImmutable; - - - function makeRecord(likeRecord, map, ownerID) { - var record = Object.create(Object.getPrototypeOf(likeRecord)); - record._map = map; - record.__ownerID = ownerID; - return record; - } - - function recordName(record) { - return record._name || record.constructor.name || 'Record'; - } - - function setProps(prototype, names) { - try { - names.forEach(setProp.bind(undefined, prototype)); - } catch (error) { - // Object.defineProperty failed. Probably IE8. - } - } - - function setProp(prototype, name) { - Object.defineProperty(prototype, name, { - get: function() { - return this.get(name); - }, - set: function(value) { - invariant(this.__ownerID, 'Cannot set on an immutable record.'); - this.set(name, value); - } - }); - } - - createClass(Set, SetCollection); - - // @pragma Construction - - function Set(value) { - return value === null || value === undefined ? emptySet() : - isSet(value) && !isOrdered(value) ? value : - emptySet().withMutations(function(set ) { - var iter = SetIterable(value); - assertNotInfinite(iter.size); - iter.forEach(function(v ) {return set.add(v)}); - }); - } - - Set.of = function(/*...values*/) { - return this(arguments); - }; - - Set.fromKeys = function(value) { - return this(KeyedIterable(value).keySeq()); - }; - - Set.prototype.toString = function() { - return this.__toString('Set {', '}'); - }; - - // @pragma Access - - Set.prototype.has = function(value) { - return this._map.has(value); - }; - - // @pragma Modification - - Set.prototype.add = function(value) { - return updateSet(this, this._map.set(value, true)); - }; - - Set.prototype.remove = function(value) { - return updateSet(this, this._map.remove(value)); - }; - - Set.prototype.clear = function() { - return updateSet(this, this._map.clear()); - }; - - // @pragma Composition - - Set.prototype.union = function() {var iters = SLICE$0.call(arguments, 0); - iters = iters.filter(function(x ) {return x.size !== 0}); - if (iters.length === 0) { - return this; - } - if (this.size === 0 && !this.__ownerID && iters.length === 1) { - return this.constructor(iters[0]); - } - return this.withMutations(function(set ) { - for (var ii = 0; ii < iters.length; ii++) { - SetIterable(iters[ii]).forEach(function(value ) {return set.add(value)}); - } - }); - }; - - Set.prototype.intersect = function() {var iters = SLICE$0.call(arguments, 0); - if (iters.length === 0) { - return this; - } - iters = iters.map(function(iter ) {return SetIterable(iter)}); - var originalSet = this; - return this.withMutations(function(set ) { - originalSet.forEach(function(value ) { - if (!iters.every(function(iter ) {return iter.includes(value)})) { - set.remove(value); - } - }); - }); - }; - - Set.prototype.subtract = function() {var iters = SLICE$0.call(arguments, 0); - if (iters.length === 0) { - return this; - } - iters = iters.map(function(iter ) {return SetIterable(iter)}); - var originalSet = this; - return this.withMutations(function(set ) { - originalSet.forEach(function(value ) { - if (iters.some(function(iter ) {return iter.includes(value)})) { - set.remove(value); - } - }); - }); - }; - - Set.prototype.merge = function() { - return this.union.apply(this, arguments); - }; - - Set.prototype.mergeWith = function(merger) {var iters = SLICE$0.call(arguments, 1); - return this.union.apply(this, iters); - }; - - Set.prototype.sort = function(comparator) { - // Late binding - return OrderedSet(sortFactory(this, comparator)); - }; - - Set.prototype.sortBy = function(mapper, comparator) { - // Late binding - return OrderedSet(sortFactory(this, comparator, mapper)); - }; - - Set.prototype.wasAltered = function() { - return this._map.wasAltered(); - }; - - Set.prototype.__iterate = function(fn, reverse) {var this$0 = this; - return this._map.__iterate(function(_, k) {return fn(k, k, this$0)}, reverse); - }; - - Set.prototype.__iterator = function(type, reverse) { - return this._map.map(function(_, k) {return k}).__iterator(type, reverse); - }; - - Set.prototype.__ensureOwner = function(ownerID) { - if (ownerID === this.__ownerID) { - return this; - } - var newMap = this._map.__ensureOwner(ownerID); - if (!ownerID) { - this.__ownerID = ownerID; - this._map = newMap; - return this; - } - return this.__make(newMap, ownerID); - }; - - - function isSet(maybeSet) { - return !!(maybeSet && maybeSet[IS_SET_SENTINEL]); - } - - Set.isSet = isSet; - - var IS_SET_SENTINEL = '@@__IMMUTABLE_SET__@@'; - - var SetPrototype = Set.prototype; - SetPrototype[IS_SET_SENTINEL] = true; - SetPrototype[DELETE] = SetPrototype.remove; - SetPrototype.mergeDeep = SetPrototype.merge; - SetPrototype.mergeDeepWith = SetPrototype.mergeWith; - SetPrototype.withMutations = MapPrototype.withMutations; - SetPrototype.asMutable = MapPrototype.asMutable; - SetPrototype.asImmutable = MapPrototype.asImmutable; - - SetPrototype.__empty = emptySet; - SetPrototype.__make = makeSet; - - function updateSet(set, newMap) { - if (set.__ownerID) { - set.size = newMap.size; - set._map = newMap; - return set; - } - return newMap === set._map ? set : - newMap.size === 0 ? set.__empty() : - set.__make(newMap); - } - - function makeSet(map, ownerID) { - var set = Object.create(SetPrototype); - set.size = map ? map.size : 0; - set._map = map; - set.__ownerID = ownerID; - return set; - } - - var EMPTY_SET; - function emptySet() { - return EMPTY_SET || (EMPTY_SET = makeSet(emptyMap())); - } - - createClass(OrderedSet, Set); - - // @pragma Construction - - function OrderedSet(value) { - return value === null || value === undefined ? emptyOrderedSet() : - isOrderedSet(value) ? value : - emptyOrderedSet().withMutations(function(set ) { - var iter = SetIterable(value); - assertNotInfinite(iter.size); - iter.forEach(function(v ) {return set.add(v)}); - }); - } - - OrderedSet.of = function(/*...values*/) { - return this(arguments); - }; - - OrderedSet.fromKeys = function(value) { - return this(KeyedIterable(value).keySeq()); - }; - - OrderedSet.prototype.toString = function() { - return this.__toString('OrderedSet {', '}'); - }; - - - function isOrderedSet(maybeOrderedSet) { - return isSet(maybeOrderedSet) && isOrdered(maybeOrderedSet); - } - - OrderedSet.isOrderedSet = isOrderedSet; - - var OrderedSetPrototype = OrderedSet.prototype; - OrderedSetPrototype[IS_ORDERED_SENTINEL] = true; - - OrderedSetPrototype.__empty = emptyOrderedSet; - OrderedSetPrototype.__make = makeOrderedSet; - - function makeOrderedSet(map, ownerID) { - var set = Object.create(OrderedSetPrototype); - set.size = map ? map.size : 0; - set._map = map; - set.__ownerID = ownerID; - return set; - } - - var EMPTY_ORDERED_SET; - function emptyOrderedSet() { - return EMPTY_ORDERED_SET || (EMPTY_ORDERED_SET = makeOrderedSet(emptyOrderedMap())); - } - - createClass(Stack, IndexedCollection); - - // @pragma Construction - - function Stack(value) { - return value === null || value === undefined ? emptyStack() : - isStack(value) ? value : - emptyStack().unshiftAll(value); - } - - Stack.of = function(/*...values*/) { - return this(arguments); - }; - - Stack.prototype.toString = function() { - return this.__toString('Stack [', ']'); - }; - - // @pragma Access - - Stack.prototype.get = function(index, notSetValue) { - var head = this._head; - index = wrapIndex(this, index); - while (head && index--) { - head = head.next; - } - return head ? head.value : notSetValue; - }; - - Stack.prototype.peek = function() { - return this._head && this._head.value; - }; - - // @pragma Modification - - Stack.prototype.push = function(/*...values*/) { - if (arguments.length === 0) { - return this; - } - var newSize = this.size + arguments.length; - var head = this._head; - for (var ii = arguments.length - 1; ii >= 0; ii--) { - head = { - value: arguments[ii], - next: head - }; - } - if (this.__ownerID) { - this.size = newSize; - this._head = head; - this.__hash = undefined; - this.__altered = true; - return this; - } - return makeStack(newSize, head); - }; - - Stack.prototype.pushAll = function(iter) { - iter = IndexedIterable(iter); - if (iter.size === 0) { - return this; - } - assertNotInfinite(iter.size); - var newSize = this.size; - var head = this._head; - iter.reverse().forEach(function(value ) { - newSize++; - head = { - value: value, - next: head - }; - }); - if (this.__ownerID) { - this.size = newSize; - this._head = head; - this.__hash = undefined; - this.__altered = true; - return this; - } - return makeStack(newSize, head); - }; - - Stack.prototype.pop = function() { - return this.slice(1); - }; - - Stack.prototype.unshift = function(/*...values*/) { - return this.push.apply(this, arguments); - }; - - Stack.prototype.unshiftAll = function(iter) { - return this.pushAll(iter); - }; - - Stack.prototype.shift = function() { - return this.pop.apply(this, arguments); - }; - - Stack.prototype.clear = function() { - if (this.size === 0) { - return this; - } - if (this.__ownerID) { - this.size = 0; - this._head = undefined; - this.__hash = undefined; - this.__altered = true; - return this; - } - return emptyStack(); - }; - - Stack.prototype.slice = function(begin, end) { - if (wholeSlice(begin, end, this.size)) { - return this; - } - var resolvedBegin = resolveBegin(begin, this.size); - var resolvedEnd = resolveEnd(end, this.size); - if (resolvedEnd !== this.size) { - // super.slice(begin, end); - return IndexedCollection.prototype.slice.call(this, begin, end); - } - var newSize = this.size - resolvedBegin; - var head = this._head; - while (resolvedBegin--) { - head = head.next; - } - if (this.__ownerID) { - this.size = newSize; - this._head = head; - this.__hash = undefined; - this.__altered = true; - return this; - } - return makeStack(newSize, head); - }; - - // @pragma Mutability - - Stack.prototype.__ensureOwner = function(ownerID) { - if (ownerID === this.__ownerID) { - return this; - } - if (!ownerID) { - this.__ownerID = ownerID; - this.__altered = false; - return this; - } - return makeStack(this.size, this._head, ownerID, this.__hash); - }; - - // @pragma Iteration - - Stack.prototype.__iterate = function(fn, reverse) { - if (reverse) { - return this.reverse().__iterate(fn); - } - var iterations = 0; - var node = this._head; - while (node) { - if (fn(node.value, iterations++, this) === false) { - break; - } - node = node.next; - } - return iterations; - }; - - Stack.prototype.__iterator = function(type, reverse) { - if (reverse) { - return this.reverse().__iterator(type); - } - var iterations = 0; - var node = this._head; - return new Iterator(function() { - if (node) { - var value = node.value; - node = node.next; - return iteratorValue(type, iterations++, value); - } - return iteratorDone(); - }); - }; - - - function isStack(maybeStack) { - return !!(maybeStack && maybeStack[IS_STACK_SENTINEL]); - } - - Stack.isStack = isStack; - - var IS_STACK_SENTINEL = '@@__IMMUTABLE_STACK__@@'; - - var StackPrototype = Stack.prototype; - StackPrototype[IS_STACK_SENTINEL] = true; - StackPrototype.withMutations = MapPrototype.withMutations; - StackPrototype.asMutable = MapPrototype.asMutable; - StackPrototype.asImmutable = MapPrototype.asImmutable; - StackPrototype.wasAltered = MapPrototype.wasAltered; - - - function makeStack(size, head, ownerID, hash) { - var map = Object.create(StackPrototype); - map.size = size; - map._head = head; - map.__ownerID = ownerID; - map.__hash = hash; - map.__altered = false; - return map; - } - - var EMPTY_STACK; - function emptyStack() { - return EMPTY_STACK || (EMPTY_STACK = makeStack(0)); - } - - /** - * Contributes additional methods to a constructor - */ - function mixin(ctor, methods) { - var keyCopier = function(key ) { ctor.prototype[key] = methods[key]; }; - Object.keys(methods).forEach(keyCopier); - Object.getOwnPropertySymbols && - Object.getOwnPropertySymbols(methods).forEach(keyCopier); - return ctor; - } - - Iterable.Iterator = Iterator; - - mixin(Iterable, { - - // ### Conversion to other types - - toArray: function() { - assertNotInfinite(this.size); - var array = new Array(this.size || 0); - this.valueSeq().__iterate(function(v, i) { array[i] = v; }); - return array; - }, - - toIndexedSeq: function() { - return new ToIndexedSequence(this); - }, - - toJS: function() { - return this.toSeq().map( - function(value ) {return value && typeof value.toJS === 'function' ? value.toJS() : value} - ).__toJS(); - }, - - toJSON: function() { - return this.toSeq().map( - function(value ) {return value && typeof value.toJSON === 'function' ? value.toJSON() : value} - ).__toJS(); - }, - - toKeyedSeq: function() { - return new ToKeyedSequence(this, true); - }, - - toMap: function() { - // Use Late Binding here to solve the circular dependency. - return Map(this.toKeyedSeq()); - }, - - toObject: function() { - assertNotInfinite(this.size); - var object = {}; - this.__iterate(function(v, k) { object[k] = v; }); - return object; - }, - - toOrderedMap: function() { - // Use Late Binding here to solve the circular dependency. - return OrderedMap(this.toKeyedSeq()); - }, - - toOrderedSet: function() { - // Use Late Binding here to solve the circular dependency. - return OrderedSet(isKeyed(this) ? this.valueSeq() : this); - }, - - toSet: function() { - // Use Late Binding here to solve the circular dependency. - return Set(isKeyed(this) ? this.valueSeq() : this); - }, - - toSetSeq: function() { - return new ToSetSequence(this); - }, - - toSeq: function() { - return isIndexed(this) ? this.toIndexedSeq() : - isKeyed(this) ? this.toKeyedSeq() : - this.toSetSeq(); - }, - - toStack: function() { - // Use Late Binding here to solve the circular dependency. - return Stack(isKeyed(this) ? this.valueSeq() : this); - }, - - toList: function() { - // Use Late Binding here to solve the circular dependency. - return List(isKeyed(this) ? this.valueSeq() : this); - }, - - - // ### Common JavaScript methods and properties - - toString: function() { - return '[Iterable]'; - }, - - __toString: function(head, tail) { - if (this.size === 0) { - return head + tail; - } - return head + ' ' + this.toSeq().map(this.__toStringMapper).join(', ') + ' ' + tail; - }, - - - // ### ES6 Collection methods (ES6 Array and Map) - - concat: function() {var values = SLICE$0.call(arguments, 0); - return reify(this, concatFactory(this, values)); - }, - - includes: function(searchValue) { - return this.some(function(value ) {return is(value, searchValue)}); - }, - - entries: function() { - return this.__iterator(ITERATE_ENTRIES); - }, - - every: function(predicate, context) { - assertNotInfinite(this.size); - var returnValue = true; - this.__iterate(function(v, k, c) { - if (!predicate.call(context, v, k, c)) { - returnValue = false; - return false; - } - }); - return returnValue; - }, - - filter: function(predicate, context) { - return reify(this, filterFactory(this, predicate, context, true)); - }, - - find: function(predicate, context, notSetValue) { - var entry = this.findEntry(predicate, context); - return entry ? entry[1] : notSetValue; - }, - - forEach: function(sideEffect, context) { - assertNotInfinite(this.size); - return this.__iterate(context ? sideEffect.bind(context) : sideEffect); - }, - - join: function(separator) { - assertNotInfinite(this.size); - separator = separator !== undefined ? '' + separator : ','; - var joined = ''; - var isFirst = true; - this.__iterate(function(v ) { - isFirst ? (isFirst = false) : (joined += separator); - joined += v !== null && v !== undefined ? v.toString() : ''; - }); - return joined; - }, - - keys: function() { - return this.__iterator(ITERATE_KEYS); - }, - - map: function(mapper, context) { - return reify(this, mapFactory(this, mapper, context)); - }, - - reduce: function(reducer, initialReduction, context) { - assertNotInfinite(this.size); - var reduction; - var useFirst; - if (arguments.length < 2) { - useFirst = true; - } else { - reduction = initialReduction; - } - this.__iterate(function(v, k, c) { - if (useFirst) { - useFirst = false; - reduction = v; - } else { - reduction = reducer.call(context, reduction, v, k, c); - } - }); - return reduction; - }, - - reduceRight: function(reducer, initialReduction, context) { - var reversed = this.toKeyedSeq().reverse(); - return reversed.reduce.apply(reversed, arguments); - }, - - reverse: function() { - return reify(this, reverseFactory(this, true)); - }, - - slice: function(begin, end) { - return reify(this, sliceFactory(this, begin, end, true)); - }, - - some: function(predicate, context) { - return !this.every(not(predicate), context); - }, - - sort: function(comparator) { - return reify(this, sortFactory(this, comparator)); - }, - - values: function() { - return this.__iterator(ITERATE_VALUES); - }, - - - // ### More sequential methods - - butLast: function() { - return this.slice(0, -1); - }, - - isEmpty: function() { - return this.size !== undefined ? this.size === 0 : !this.some(function() {return true}); - }, - - count: function(predicate, context) { - return ensureSize( - predicate ? this.toSeq().filter(predicate, context) : this - ); - }, - - countBy: function(grouper, context) { - return countByFactory(this, grouper, context); - }, - - equals: function(other) { - return deepEqual(this, other); - }, - - entrySeq: function() { - var iterable = this; - if (iterable._cache) { - // We cache as an entries array, so we can just return the cache! - return new ArraySeq(iterable._cache); - } - var entriesSequence = iterable.toSeq().map(entryMapper).toIndexedSeq(); - entriesSequence.fromEntrySeq = function() {return iterable.toSeq()}; - return entriesSequence; - }, - - filterNot: function(predicate, context) { - return this.filter(not(predicate), context); - }, - - findEntry: function(predicate, context, notSetValue) { - var found = notSetValue; - this.__iterate(function(v, k, c) { - if (predicate.call(context, v, k, c)) { - found = [k, v]; - return false; - } - }); - return found; - }, - - findKey: function(predicate, context) { - var entry = this.findEntry(predicate, context); - return entry && entry[0]; - }, - - findLast: function(predicate, context, notSetValue) { - return this.toKeyedSeq().reverse().find(predicate, context, notSetValue); - }, - - findLastEntry: function(predicate, context, notSetValue) { - return this.toKeyedSeq().reverse().findEntry(predicate, context, notSetValue); - }, - - findLastKey: function(predicate, context) { - return this.toKeyedSeq().reverse().findKey(predicate, context); - }, - - first: function() { - return this.find(returnTrue); - }, - - flatMap: function(mapper, context) { - return reify(this, flatMapFactory(this, mapper, context)); - }, - - flatten: function(depth) { - return reify(this, flattenFactory(this, depth, true)); - }, - - fromEntrySeq: function() { - return new FromEntriesSequence(this); - }, - - get: function(searchKey, notSetValue) { - return this.find(function(_, key) {return is(key, searchKey)}, undefined, notSetValue); - }, - - getIn: function(searchKeyPath, notSetValue) { - var nested = this; - // Note: in an ES6 environment, we would prefer: - // for (var key of searchKeyPath) { - var iter = forceIterator(searchKeyPath); - var step; - while (!(step = iter.next()).done) { - var key = step.value; - nested = nested && nested.get ? nested.get(key, NOT_SET) : NOT_SET; - if (nested === NOT_SET) { - return notSetValue; - } - } - return nested; - }, - - groupBy: function(grouper, context) { - return groupByFactory(this, grouper, context); - }, - - has: function(searchKey) { - return this.get(searchKey, NOT_SET) !== NOT_SET; - }, - - hasIn: function(searchKeyPath) { - return this.getIn(searchKeyPath, NOT_SET) !== NOT_SET; - }, - - isSubset: function(iter) { - iter = typeof iter.includes === 'function' ? iter : Iterable(iter); - return this.every(function(value ) {return iter.includes(value)}); - }, - - isSuperset: function(iter) { - iter = typeof iter.isSubset === 'function' ? iter : Iterable(iter); - return iter.isSubset(this); - }, - - keyOf: function(searchValue) { - return this.findKey(function(value ) {return is(value, searchValue)}); - }, - - keySeq: function() { - return this.toSeq().map(keyMapper).toIndexedSeq(); - }, - - last: function() { - return this.toSeq().reverse().first(); - }, - - lastKeyOf: function(searchValue) { - return this.toKeyedSeq().reverse().keyOf(searchValue); - }, - - max: function(comparator) { - return maxFactory(this, comparator); - }, - - maxBy: function(mapper, comparator) { - return maxFactory(this, comparator, mapper); - }, - - min: function(comparator) { - return maxFactory(this, comparator ? neg(comparator) : defaultNegComparator); - }, - - minBy: function(mapper, comparator) { - return maxFactory(this, comparator ? neg(comparator) : defaultNegComparator, mapper); - }, - - rest: function() { - return this.slice(1); - }, - - skip: function(amount) { - return this.slice(Math.max(0, amount)); - }, - - skipLast: function(amount) { - return reify(this, this.toSeq().reverse().skip(amount).reverse()); - }, - - skipWhile: function(predicate, context) { - return reify(this, skipWhileFactory(this, predicate, context, true)); - }, - - skipUntil: function(predicate, context) { - return this.skipWhile(not(predicate), context); - }, - - sortBy: function(mapper, comparator) { - return reify(this, sortFactory(this, comparator, mapper)); - }, - - take: function(amount) { - return this.slice(0, Math.max(0, amount)); - }, - - takeLast: function(amount) { - return reify(this, this.toSeq().reverse().take(amount).reverse()); - }, - - takeWhile: function(predicate, context) { - return reify(this, takeWhileFactory(this, predicate, context)); - }, - - takeUntil: function(predicate, context) { - return this.takeWhile(not(predicate), context); - }, - - valueSeq: function() { - return this.toIndexedSeq(); - }, - - - // ### Hashable Object - - hashCode: function() { - return this.__hash || (this.__hash = hashIterable(this)); - } - - - // ### Internal - - // abstract __iterate(fn, reverse) - - // abstract __iterator(type, reverse) - }); - - // var IS_ITERABLE_SENTINEL = '@@__IMMUTABLE_ITERABLE__@@'; - // var IS_KEYED_SENTINEL = '@@__IMMUTABLE_KEYED__@@'; - // var IS_INDEXED_SENTINEL = '@@__IMMUTABLE_INDEXED__@@'; - // var IS_ORDERED_SENTINEL = '@@__IMMUTABLE_ORDERED__@@'; - - var IterablePrototype = Iterable.prototype; - IterablePrototype[IS_ITERABLE_SENTINEL] = true; - IterablePrototype[ITERATOR_SYMBOL] = IterablePrototype.values; - IterablePrototype.__toJS = IterablePrototype.toArray; - IterablePrototype.__toStringMapper = quoteString; - IterablePrototype.inspect = - IterablePrototype.toSource = function() { return this.toString(); }; - IterablePrototype.chain = IterablePrototype.flatMap; - IterablePrototype.contains = IterablePrototype.includes; - - mixin(KeyedIterable, { - - // ### More sequential methods - - flip: function() { - return reify(this, flipFactory(this)); - }, - - mapEntries: function(mapper, context) {var this$0 = this; - var iterations = 0; - return reify(this, - this.toSeq().map( - function(v, k) {return mapper.call(context, [k, v], iterations++, this$0)} - ).fromEntrySeq() - ); - }, - - mapKeys: function(mapper, context) {var this$0 = this; - return reify(this, - this.toSeq().flip().map( - function(k, v) {return mapper.call(context, k, v, this$0)} - ).flip() - ); - } - - }); - - var KeyedIterablePrototype = KeyedIterable.prototype; - KeyedIterablePrototype[IS_KEYED_SENTINEL] = true; - KeyedIterablePrototype[ITERATOR_SYMBOL] = IterablePrototype.entries; - KeyedIterablePrototype.__toJS = IterablePrototype.toObject; - KeyedIterablePrototype.__toStringMapper = function(v, k) {return JSON.stringify(k) + ': ' + quoteString(v)}; - - - - mixin(IndexedIterable, { - - // ### Conversion to other types - - toKeyedSeq: function() { - return new ToKeyedSequence(this, false); - }, - - - // ### ES6 Collection methods (ES6 Array and Map) - - filter: function(predicate, context) { - return reify(this, filterFactory(this, predicate, context, false)); - }, - - findIndex: function(predicate, context) { - var entry = this.findEntry(predicate, context); - return entry ? entry[0] : -1; - }, - - indexOf: function(searchValue) { - var key = this.keyOf(searchValue); - return key === undefined ? -1 : key; - }, - - lastIndexOf: function(searchValue) { - var key = this.lastKeyOf(searchValue); - return key === undefined ? -1 : key; - }, - - reverse: function() { - return reify(this, reverseFactory(this, false)); - }, - - slice: function(begin, end) { - return reify(this, sliceFactory(this, begin, end, false)); - }, - - splice: function(index, removeNum /*, ...values*/) { - var numArgs = arguments.length; - removeNum = Math.max(removeNum | 0, 0); - if (numArgs === 0 || (numArgs === 2 && !removeNum)) { - return this; - } - // If index is negative, it should resolve relative to the size of the - // collection. However size may be expensive to compute if not cached, so - // only call count() if the number is in fact negative. - index = resolveBegin(index, index < 0 ? this.count() : this.size); - var spliced = this.slice(0, index); - return reify( - this, - numArgs === 1 ? - spliced : - spliced.concat(arrCopy(arguments, 2), this.slice(index + removeNum)) - ); - }, - - - // ### More collection methods - - findLastIndex: function(predicate, context) { - var entry = this.findLastEntry(predicate, context); - return entry ? entry[0] : -1; - }, - - first: function() { - return this.get(0); - }, - - flatten: function(depth) { - return reify(this, flattenFactory(this, depth, false)); - }, - - get: function(index, notSetValue) { - index = wrapIndex(this, index); - return (index < 0 || (this.size === Infinity || - (this.size !== undefined && index > this.size))) ? - notSetValue : - this.find(function(_, key) {return key === index}, undefined, notSetValue); - }, - - has: function(index) { - index = wrapIndex(this, index); - return index >= 0 && (this.size !== undefined ? - this.size === Infinity || index < this.size : - this.indexOf(index) !== -1 - ); - }, - - interpose: function(separator) { - return reify(this, interposeFactory(this, separator)); - }, - - interleave: function(/*...iterables*/) { - var iterables = [this].concat(arrCopy(arguments)); - var zipped = zipWithFactory(this.toSeq(), IndexedSeq.of, iterables); - var interleaved = zipped.flatten(true); - if (zipped.size) { - interleaved.size = zipped.size * iterables.length; - } - return reify(this, interleaved); - }, - - keySeq: function() { - return Range(0, this.size); - }, - - last: function() { - return this.get(-1); - }, - - skipWhile: function(predicate, context) { - return reify(this, skipWhileFactory(this, predicate, context, false)); - }, - - zip: function(/*, ...iterables */) { - var iterables = [this].concat(arrCopy(arguments)); - return reify(this, zipWithFactory(this, defaultZipper, iterables)); - }, - - zipWith: function(zipper/*, ...iterables */) { - var iterables = arrCopy(arguments); - iterables[0] = this; - return reify(this, zipWithFactory(this, zipper, iterables)); - } - - }); - - IndexedIterable.prototype[IS_INDEXED_SENTINEL] = true; - IndexedIterable.prototype[IS_ORDERED_SENTINEL] = true; - - - - mixin(SetIterable, { - - // ### ES6 Collection methods (ES6 Array and Map) - - get: function(value, notSetValue) { - return this.has(value) ? value : notSetValue; - }, - - includes: function(value) { - return this.has(value); - }, - - - // ### More sequential methods - - keySeq: function() { - return this.valueSeq(); - } - - }); - - SetIterable.prototype.has = IterablePrototype.includes; - SetIterable.prototype.contains = SetIterable.prototype.includes; - - - // Mixin subclasses - - mixin(KeyedSeq, KeyedIterable.prototype); - mixin(IndexedSeq, IndexedIterable.prototype); - mixin(SetSeq, SetIterable.prototype); - - mixin(KeyedCollection, KeyedIterable.prototype); - mixin(IndexedCollection, IndexedIterable.prototype); - mixin(SetCollection, SetIterable.prototype); - - - // #pragma Helper functions - - function keyMapper(v, k) { - return k; - } - - function entryMapper(v, k) { - return [k, v]; - } - - function not(predicate) { - return function() { - return !predicate.apply(this, arguments); - } - } - - function neg(predicate) { - return function() { - return -predicate.apply(this, arguments); - } - } - - function quoteString(value) { - return typeof value === 'string' ? JSON.stringify(value) : String(value); - } - - function defaultZipper() { - return arrCopy(arguments); - } - - function defaultNegComparator(a, b) { - return a < b ? 1 : a > b ? -1 : 0; - } - - function hashIterable(iterable) { - if (iterable.size === Infinity) { - return 0; - } - var ordered = isOrdered(iterable); - var keyed = isKeyed(iterable); - var h = ordered ? 1 : 0; - var size = iterable.__iterate( - keyed ? - ordered ? - function(v, k) { h = 31 * h + hashMerge(hash(v), hash(k)) | 0; } : - function(v, k) { h = h + hashMerge(hash(v), hash(k)) | 0; } : - ordered ? - function(v ) { h = 31 * h + hash(v) | 0; } : - function(v ) { h = h + hash(v) | 0; } - ); - return murmurHashOfSize(size, h); - } - - function murmurHashOfSize(size, h) { - h = imul(h, 0xCC9E2D51); - h = imul(h << 15 | h >>> -15, 0x1B873593); - h = imul(h << 13 | h >>> -13, 5); - h = (h + 0xE6546B64 | 0) ^ size; - h = imul(h ^ h >>> 16, 0x85EBCA6B); - h = imul(h ^ h >>> 13, 0xC2B2AE35); - h = smi(h ^ h >>> 16); - return h; - } - - function hashMerge(a, b) { - return a ^ b + 0x9E3779B9 + (a << 6) + (a >> 2) | 0; // int - } - - var Immutable = { - - Iterable: Iterable, - - Seq: Seq, - Collection: Collection, - Map: Map, - OrderedMap: OrderedMap, - List: List, - Stack: Stack, - Set: Set, - OrderedSet: OrderedSet, - - Record: Record, - Range: Range, - Repeat: Repeat, - - is: is, - fromJS: fromJS - - }; - - return Immutable; - -})); \ No newline at end of file diff --git a/dist/immutable.js.flow b/dist/immutable.js.flow deleted file mode 100644 index 3cb6844961..0000000000 --- a/dist/immutable.js.flow +++ /dev/null @@ -1,663 +0,0 @@ -/** - * This file provides type definitions for use with the Flow type checker. - * - * An important caveat when using these definitions is that the types for - * `Iterable.Keyed`, `Iterable.Indexed`, `Seq.Keyed`, and so on are stubs. - * When referring to those types, you can get the proper definitions by - * importing the types `KeyedIterable`, `IndexedIterable`, `KeyedSeq`, etc. - * For example, - * - * import { Seq } from 'immutable' - * import type { IndexedIterable, IndexedSeq } from 'immutable' - * - * const someSeq: IndexedSeq = Seq.Indexed.of(1, 2, 3) - * - * function takesASeq>(iter: TS): TS { - * return iter.butLast() - * } - * - * takesASeq(someSeq) - * - * @flow - */ - -/* - * Alias for ECMAScript `Iterable` type, declared in - * https://github.com/facebook/flow/blob/master/lib/core.js - * - * Note that Immutable values implement the `ESIterable` interface. - */ -type ESIterable = $Iterable; - -declare class Iterable extends _Iterable {} - -declare class _Iterable { - static Keyed: KI; - static Indexed: II; - static Set: SI; - - static isIterable(maybeIterable: any): boolean; - static isKeyed(maybeKeyed: any): boolean; - static isIndexed(maybeIndexed: any): boolean; - static isAssociative(maybeAssociative: any): boolean; - static isOrdered(maybeOrdered: any): boolean; - - equals(other: Iterable): boolean; - hashCode(): number; - get(key: K): V; - get(key: K, notSetValue: V_): V|V_; - has(key: K): boolean; - includes(value: V): boolean; - contains(value: V): boolean; - first(): V; - last(): V; - - getIn(searchKeyPath: ESIterable, notSetValue: T): T; - getIn(searchKeyPath: ESIterable): T; - hasIn(searchKeyPath: ESIterable): boolean; - - toJS(): any; - toArray(): V[]; - toObject(): { [key: string]: V }; - toMap(): Map; - toOrderedMap(): Map; - toSet(): Set; - toOrderedSet(): Set; - toList(): List; - toStack(): Stack; - toSeq(): Seq; - toKeyedSeq(): KeyedSeq; - toIndexedSeq(): IndexedSeq; - toSetSeq(): SetSeq; - - keys(): Iterator; - values(): Iterator; - entries(): Iterator<[K,V]>; - - keySeq(): IndexedSeq; - valueSeq(): IndexedSeq; - entrySeq(): IndexedSeq<[K,V]>; - - reverse(): this; - sort(comparator?: (valueA: V, valueB: V) => number): this; - - sortBy( - comparatorValueMapper: (value: V, key: K, iter: this) => C, - comparator?: (valueA: C, valueB: C) => number - ): this; - - groupBy( - grouper: (value: V, key: K, iter: this) => G, - context?: any - ): KeyedSeq; - - forEach( - sideEffect: (value: V, key: K, iter: this) => any, - context?: any - ): number; - - slice(begin?: number, end?: number): this; - rest(): this; - butLast(): this; - skip(amount: number): this; - skipLast(amount: number): this; - skipWhile(predicate: (value: V, key: K, iter: this) => mixed, context?: any): this; - skipUntil(predicate: (value: V, key: K, iter: this) => mixed, context?: any): this; - take(amount: number): this; - takeLast(amount: number): this; - takeWhile(predicate: (value: V, key: K, iter: this) => mixed, context?: any): this; - takeUntil(predicate: (value: V, key: K, iter: this) => mixed, context?: any): this; - flatten(depth?: number): /*this*/Iterable; - flatten(shallow?: boolean): /*this*/Iterable; - - filter( - predicate: (value: V, key: K, iter: this) => mixed, - context?: any - ): this; - - filterNot( - predicate: (value: V, key: K, iter: this) => mixed, - context?: any - ): this; - - reduce( - reducer: (reduction: R, value: V, key: K, iter: this) => R, - initialReduction?: R, - context?: any, - ): R; - - reduceRight( - reducer: (reduction: R, value: V, key: K, iter: this) => R, - initialReduction?: R, - context?: any, - ): R; - - every(predicate: (value: V, key: K, iter: this) => mixed, context?: any): boolean; - some(predicate: (value: V, key: K, iter: this) => mixed, context?: any): boolean; - join(separator?: string): string; - isEmpty(): boolean; - count(predicate?: (value: V, key: K, iter: this) => mixed, context?: any): number; - countBy(grouper: (value: V, key: K, iter: this) => G, context?: any): Map; - - find( - predicate: (value: V, key: K, iter: this) => mixed, - context?: any, - ): ?V; - find( - predicate: (value: V, key: K, iter: this) => mixed, - context: any, - notSetValue: V_ - ): V|V_; - - findLast( - predicate: (value: V, key: K, iter: this) => mixed, - context?: any, - ): ?V; - findLast( - predicate: (value: V, key: K, iter: this) => mixed, - context: any, - notSetValue: V_ - ): V|V_; - - - findEntry(predicate: (value: V, key: K, iter: this) => mixed): ?[K,V]; - findLastEntry(predicate: (value: V, key: K, iter: this) => mixed): ?[K,V]; - - findKey(predicate: (value: V, key: K, iter: this) => mixed, context?: any): ?K; - findLastKey(predicate: (value: V, key: K, iter: this) => mixed, context?: any): ?K; - - keyOf(searchValue: V): ?K; - lastKeyOf(searchValue: V): ?K; - - max(comparator?: (valueA: V, valueB: V) => number): V; - maxBy( - comparatorValueMapper: (value: V, key: K, iter: this) => C, - comparator?: (valueA: C, valueB: C) => number - ): V; - min(comparator?: (valueA: V, valueB: V) => number): V; - minBy( - comparatorValueMapper: (value: V, key: K, iter: this) => C, - comparator?: (valueA: C, valueB: C) => number - ): V; - - isSubset(iter: Iterable): boolean; - isSubset(iter: ESIterable): boolean; - isSuperset(iter: Iterable): boolean; - isSuperset(iter: ESIterable): boolean; -} - -declare class KeyedIterable extends Iterable { - static (iter?: ESIterable<[K,V]>): KeyedIterable; - static (obj?: { [key: K]: V }): KeyedIterable; - - @@iterator(): Iterator<[K,V]>; - toSeq(): KeyedSeq; - flip(): /*this*/KeyedIterable; - - mapKeys( - mapper: (key: K, value: V, iter: this) => K_, - context?: any - ): /*this*/KeyedIterable; - - mapEntries( - mapper: (entry: [K,V], index: number, iter: this) => [K_,V_], - context?: any - ): /*this*/KeyedIterable; - - concat(...iters: ESIterable<[K,V]>[]): this; - - map( - mapper: (value: V, key: K, iter: this) => V_, - context?: any - ): /*this*/KeyedIterable; - - flatMap( - mapper: (value: V, key: K, iter: this) => ESIterable<[K_,V_]>, - context?: any - ): /*this*/KeyedIterable; - - flatten(depth?: number): /*this*/KeyedIterable; - flatten(shallow?: boolean): /*this*/KeyedIterable; -} - -declare class IndexedIterable extends Iterable { - static (iter?: ESIterable): IndexedIterable; - - @@iterator(): Iterator; - toSeq(): IndexedSeq; - fromEntrySeq(): KeyedSeq; - interpose(separator: T): this; - interleave(...iterables: ESIterable[]): this; - splice( - index: number, - removeNum: number, - ...values: T[] - ): this; - - zip( - a: ESIterable, - $?: null - ): IndexedIterable<[T,A]>; - zip( - a: ESIterable, - b: ESIterable, - $?: null - ): IndexedIterable<[T,A,B]>; - zip( - a: ESIterable, - b: ESIterable, - c: ESIterable, - $?: null - ): IndexedIterable<[T,A,B,C]>; - zip( - a: ESIterable, - b: ESIterable, - c: ESIterable, - d: ESIterable, - $?: null - ): IndexedIterable<[T,A,B,C,D]>; - zip( - a: ESIterable, - b: ESIterable, - c: ESIterable, - d: ESIterable, - e: ESIterable, - $?: null - ): IndexedIterable<[T,A,B,C,D,E]>; - - zipWith( - zipper: (value: T, a: A) => R, - a: ESIterable, - $?: null - ): IndexedIterable; - zipWith( - zipper: (value: T, a: A, b: B) => R, - a: ESIterable, - b: ESIterable, - $?: null - ): IndexedIterable; - zipWith( - zipper: (value: T, a: A, b: B, c: C) => R, - a: ESIterable, - b: ESIterable, - c: ESIterable, - $?: null - ): IndexedIterable; - zipWith( - zipper: (value: T, a: A, b: B, c: C, d: D) => R, - a: ESIterable, - b: ESIterable, - c: ESIterable, - d: ESIterable, - $?: null - ): IndexedIterable; - zipWith( - zipper: (value: T, a: A, b: B, c: C, d: D, e: E) => R, - a: ESIterable, - b: ESIterable, - c: ESIterable, - d: ESIterable, - e: ESIterable, - $?: null - ): IndexedIterable; - - indexOf(searchValue: T): number; - lastIndexOf(searchValue: T): number; - findIndex( - predicate: (value: T, index: number, iter: this) => mixed, - context?: any - ): number; - findLastIndex( - predicate: (value: T, index: number, iter: this) => mixed, - context?: any - ): number; - - concat(...iters: ESIterable[]): this; - - map( - mapper: (value: T, index: number, iter: this) => U, - context?: any - ): /*this*/IndexedIterable; - - flatMap( - mapper: (value: T, index: number, iter: this) => ESIterable, - context?: any - ): /*this*/IndexedIterable; - - flatten(depth?: number): /*this*/IndexedIterable; - flatten(shallow?: boolean): /*this*/IndexedIterable; -} - -declare class SetIterable extends Iterable { - static (iter?: ESIterable): SetIterable; - - @@iterator(): Iterator; - toSeq(): SetSeq; - - concat(...iters: ESIterable[]): this; - - // `map` and `flatMap` cannot be defined further up the hiearchy, because the - // implementation for `KeyedIterable` allows the value type to change without - // constraining the key type. That does not work for `SetIterable` - the value - // and key types *must* match. - map( - mapper: (value: T, value: T, iter: this) => U, - context?: any - ): /*this*/SetIterable; - - flatMap( - mapper: (value: T, value: T, iter: this) => ESIterable, - context?: any - ): /*this*/SetIterable; - - flatten(depth?: number): /*this*/SetIterable; - flatten(shallow?: boolean): /*this*/SetIterable; -} - -declare class Collection extends _Iterable { - size: number; -} - -declare class KeyedCollection extends Collection mixins KeyedIterable { - toSeq(): KeyedSeq; -} - -declare class IndexedCollection extends Collection mixins IndexedIterable { - toSeq(): IndexedSeq; -} - -declare class SetCollection extends Collection mixins SetIterable { - toSeq(): SetSeq; -} - -declare class Seq extends _Iterable { - static (iter: KeyedSeq): KeyedSeq; - static (iter: SetSeq): SetSeq; - static (iter?: ESIterable): IndexedSeq; - static (iter: { [key: K]: V }): KeyedSeq; - - static isSeq(maybeSeq: any): boolean; - static of(...values: T[]): IndexedSeq; - - size: ?number; - cacheResult(): this; - toSeq(): this; -} - -declare class KeyedSeq extends Seq mixins KeyedIterable { - static (iter?: ESIterable<[K,V]>): KeyedSeq; - static (iter?: { [key: K]: V }): KeyedSeq; -} - -declare class IndexedSeq extends Seq mixins IndexedIterable { - static (iter?: ESIterable): IndexedSeq; - static of(...values: T[]): IndexedSeq; -} - -declare class SetSeq extends Seq mixins SetIterable { - static (iter?: ESIterable): IndexedSeq; - static of(...values: T[]): SetSeq; -} - -declare class List extends IndexedCollection { - static (iterable?: ESIterable): List; - - static isList(maybeList: any): boolean; - static of(...values: T[]): List; - - set(index: number, value: U): List; - delete(index: number): this; - remove(index: number): this; - insert(index: number, value: U): List; - clear(): this; - push(...values: U[]): List; - pop(): this; - unshift(...values: U[]): List; - shift(): this; - - update(updater: (value: this) => List): List; - update(index: number, updater: (value: T) => U): List; - update(index: number, notSetValue: U, updater: (value: T) => U): List; - - merge(...iterables: ESIterable[]): List; - - mergeWith( - merger: (previous: T, next: U, key: number) => V, - ...iterables: ESIterable[] - ): List; - - mergeDeep(...iterables: ESIterable[]): List; - - mergeDeepWith( - merger: (previous: T, next: U, key: number) => V, - ...iterables: ESIterable[] - ): List; - - setSize(size: number): List; - setIn(keyPath: ESIterable, value: any): List; - deleteIn(keyPath: ESIterable, value: any): this; - removeIn(keyPath: ESIterable, value: any): this; - - updateIn(keyPath: ESIterable, notSetValue: any, value: any): List; - updateIn(keyPath: ESIterable, value: any): List; - - mergeIn(keyPath: ESIterable, ...iterables: ESIterable[]): List; - mergeDeepIn(keyPath: ESIterable, ...iterables: ESIterable[]): List; - - withMutations(mutator: (mutable: this) => any): this; - asMutable(): this; - asImmutable(): this; - - // Overrides that specialize return types - map( - mapper: (value: T, index: number, iter: this) => M, - context?: any - ): List; - - flatMap( - mapper: (value: T, index: number, iter: this) => ESIterable, - context?: any - ): List; - - flatten(depth?: number): /*this*/List; - flatten(shallow?: boolean): /*this*/List; -} - -declare class Map extends KeyedCollection { - static (): Map; - static (obj?: {[key: string]: V}): Map; - static (iterable?: ESIterable<[K,V]>): Map; - - static isMap(maybeMap: any): boolean; - - set(key: K_, value: V_): Map; - delete(key: K): this; - remove(key: K): this; - clear(): this; - - update(updater: (value: this) => Map): Map; - update(key: K, updater: (value: V) => V_): Map; - update(key: K, notSetValue: V_, updater: (value: V) => V_): Map; - - merge( - ...iterables: (ESIterable<[K_,V_]> | { [key: K_]: V_ })[] - ): Map; - - mergeWith( - merger: (previous: V, next: W, key: number) => X, - ...iterables: ESIterable[] - ): Map; - - mergeDeep( - ...iterables: (ESIterable<[K_,V_]> | { [key: K_]: V_ })[] - ): Map; - - mergeDeepWith( - merger: (previous: V, next: W, key: number) => X, - ...iterables: ESIterable[] - ): Map; - - setIn(keyPath: ESIterable, value: any): Map; - deleteIn(keyPath: ESIterable, value: any): this; - removeIn(keyPath: ESIterable, value: any): this; - - updateIn(keyPath: ESIterable, notSetValue: any, value: any): Map; - updateIn(keyPath: ESIterable, value: any): Map; - - mergeIn(keyPath: ESIterable, ...iterables: ESIterable[]): Map; - mergeDeepIn(keyPath: ESIterable, ...iterables: ESIterable[]): Map; - - withMutations(mutator: (mutable: this) => any): this; - asMutable(): this; - asImmutable(): this; - - // Overrides that specialize return types - - map( - mapper: (value: V, key: K, iter: this) => V_, - context?: any - ): Map; - - flatMap( - mapper: (value: V, key: K, iter: this) => ESIterable<[K_,V_]>, - context?: any - ): Map; - - flip(): Map; - - mapKeys( - mapper: (key: K, value: V, iter: this) => K_, - context?: any - ): Map; - - flatten(depth?: number): /*this*/Map; - flatten(shallow?: boolean): /*this*/Map; -} - -// OrderedMaps have nothing that Maps do not have. We do not need to override constructor & other statics -declare class OrderedMap extends Map { - static isOrderedMap(maybeOrderedMap: any): bool; -} - -declare class Set extends SetCollection { - static (iterable?: ESIterable): Set; - - static isSet(maybeSet: any): boolean; - static of(...values: T[]): Set; - static fromKeys(iter: ESIterable<[T,any]>): Set; - static fromKeys(iter: { [key: string]: any }): Set; - - add(value: U): Set; - delete(value: T): this; - remove(value: T): this; - clear(): this; - union(...iterables: ESIterable[]): Set; - merge(...iterables: ESIterable[]): Set; - intersect(...iterables: ESIterable[]): Set; - subtract(...iterables: ESIterable[]): Set; - - withMutations(mutator: (mutable: this) => any): this; - asMutable(): this; - asImmutable(): this; - - // Overrides that specialize return types - - map( - mapper: (value: T, value: T, iter: this) => M, - context?: any - ): Set; - - flatMap( - mapper: (value: T, value: T, iter: this) => ESIterable, - context?: any - ): Set; - - flatten(depth?: number): /*this*/Set; - flatten(shallow?: boolean): /*this*/Set; -} - -// OrderedSets have nothing that Sets do not have. We do not need to override constructor & other statics -declare class OrderedSet extends Set { - static isOrderedSet(maybeOrderedSet: any): bool; -} - -declare class Stack extends IndexedCollection { - static (iterable?: ESIterable): Stack; - - static isStack(maybeStack: any): boolean; - static of(...values: T[]): Stack; - - peek(): T; - clear(): this; - unshift(...values: U[]): Stack; - unshiftAll(iter: ESIterable): Stack; - shift(): this; - push(...values: U[]): Stack; - pushAll(iter: ESIterable): Stack; - pop(): this; - - withMutations(mutator: (mutable: this) => any): this; - asMutable(): this; - asImmutable(): this; - - // Overrides that specialize return types - - map( - mapper: (value: T, index: number, iter: this) => U, - context?: any - ): Stack; - - flatMap( - mapper: (value: T, index: number, iter: this) => ESIterable, - context?: any - ): Stack; - - flatten(depth?: number): /*this*/Stack; - flatten(shallow?: boolean): /*this*/Stack; -} - -declare function Range(start?: number, end?: number, step?: number): IndexedSeq; -declare function Repeat(value: T, times?: number): IndexedSeq; - -//TODO: Once flow can extend normal Objects we can change this back to actually reflect Record behavior. -// For now fallback to any to not break existing Code -declare class Record { - static (spec: T, name?: string): /*T & Record*/any; - get(key: $Keys): A; - set(key: $Keys, value: A): /*T & Record*/this; - remove(key: $Keys): /*T & Record*/this; -} - -declare function fromJS(json: any, reviver?: (k: any, v: Iterable) => any): any; -declare function is(first: any, second: any): boolean; - -export { - Iterable, - Collection, - Seq, - - // These classes do not actually exist under these names. But it is useful to - // have the types available. - KeyedIterable, - IndexedIterable, - SetIterable, - KeyedCollection, - IndexedCollection, - SetCollection, - KeyedSeq, - IndexedSeq, - SetSeq, - - List, - Map, - OrderedMap, - OrderedSet, - Range, - Repeat, - Record, - Set, - Stack, - - fromJS, - is, -} diff --git a/dist/immutable.min.js b/dist/immutable.min.js deleted file mode 100644 index 18ffb77bb1..0000000000 --- a/dist/immutable.min.js +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.Immutable=e()}(this,function(){"use strict";function t(t,e){e&&(t.prototype=Object.create(e.prototype)),t.prototype.constructor=t}function e(t){return o(t)?t:O(t)}function r(t){return u(t)?t:x(t)}function n(t){return s(t)?t:k(t)}function i(t){return o(t)&&!a(t)?t:A(t)}function o(t){return!(!t||!t[ar])}function u(t){return!(!t||!t[hr])}function s(t){return!(!t||!t[fr])}function a(t){return u(t)||s(t)}function h(t){return!(!t||!t[cr])}function f(t){return t.value=!1,t}function c(t){t&&(t.value=!0)}function _(){}function p(t,e){e=e||0;for(var r=Math.max(0,t.length-e),n=Array(r),i=0;r>i;i++)n[i]=t[i+e];return n}function v(t){return void 0===t.size&&(t.size=t.__iterate(y)),t.size}function l(t,e){if("number"!=typeof e){var r=e>>>0;if(""+r!==e||4294967295===r)return NaN;e=r}return 0>e?v(t)+e:e}function y(){return!0}function d(t,e,r){return(0===t||void 0!==r&&-r>=t)&&(void 0===e||void 0!==r&&e>=r)}function m(t,e){return w(t,e,0)}function g(t,e){return w(t,e,e)}function w(t,e,r){return void 0===t?r:0>t?Math.max(0,e+t):void 0===e?t:Math.min(e,t)}function S(t){this.next=t}function z(t,e,r,n){var i=0===t?e:1===t?r:[e,r];return n?n.value=i:n={value:i,done:!1},n}function I(){return{value:void 0,done:!0}}function b(t){return!!M(t)}function q(t){return t&&"function"==typeof t.next}function D(t){var e=M(t);return e&&e.call(t)}function M(t){var e=t&&(zr&&t[zr]||t[Ir]);return"function"==typeof e?e:void 0}function E(t){return t&&"number"==typeof t.length}function O(t){return null===t||void 0===t?T():o(t)?t.toSeq():C(t)}function x(t){return null===t||void 0===t?T().toKeyedSeq():o(t)?u(t)?t.toSeq():t.fromEntrySeq():B(t)}function k(t){return null===t||void 0===t?T():o(t)?u(t)?t.entrySeq():t.toIndexedSeq():W(t)}function A(t){return(null===t||void 0===t?T():o(t)?u(t)?t.entrySeq():t:W(t)).toSetSeq()}function j(t){this._array=t,this.size=t.length}function R(t){var e=Object.keys(t);this._object=t,this._keys=e, -this.size=e.length}function U(t){this._iterable=t,this.size=t.length||t.size}function K(t){this._iterator=t,this._iteratorCache=[]}function L(t){return!(!t||!t[qr])}function T(){return Dr||(Dr=new j([]))}function B(t){var e=Array.isArray(t)?new j(t).fromEntrySeq():q(t)?new K(t).fromEntrySeq():b(t)?new U(t).fromEntrySeq():"object"==typeof t?new R(t):void 0;if(!e)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+t);return e}function W(t){var e=J(t);if(!e)throw new TypeError("Expected Array or iterable object of values: "+t);return e}function C(t){var e=J(t)||"object"==typeof t&&new R(t);if(!e)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+t);return e}function J(t){return E(t)?new j(t):q(t)?new K(t):b(t)?new U(t):void 0}function N(t,e,r,n){var i=t._cache;if(i){for(var o=i.length-1,u=0;o>=u;u++){var s=i[r?o-u:u];if(e(s[1],n?s[0]:u,t)===!1)return u+1}return u}return t.__iterateUncached(e,r)}function P(t,e,r,n){var i=t._cache;if(i){var o=i.length-1,u=0;return new S(function(){var t=i[r?o-u:u];return u++>o?I():z(e,n?t[0]:u-1,t[1])})}return t.__iteratorUncached(e,r)}function H(t,e){return e?V(e,t,"",{"":t}):Y(t)}function V(t,e,r,n){return Array.isArray(e)?t.call(n,r,k(e).map(function(r,n){return V(t,r,n,e)})):Q(e)?t.call(n,r,x(e).map(function(r,n){return V(t,r,n,e)})):e}function Y(t){return Array.isArray(t)?k(t).map(Y).toList():Q(t)?x(t).map(Y).toMap():t}function Q(t){return t&&(t.constructor===Object||void 0===t.constructor)}function X(t,e){if(t===e||t!==t&&e!==e)return!0;if(!t||!e)return!1;if("function"==typeof t.valueOf&&"function"==typeof e.valueOf){if(t=t.valueOf(),e=e.valueOf(),t===e||t!==t&&e!==e)return!0;if(!t||!e)return!1}return"function"==typeof t.equals&&"function"==typeof e.equals&&t.equals(e)?!0:!1}function F(t,e){if(t===e)return!0;if(!o(e)||void 0!==t.size&&void 0!==e.size&&t.size!==e.size||void 0!==t.__hash&&void 0!==e.__hash&&t.__hash!==e.__hash||u(t)!==u(e)||s(t)!==s(e)||h(t)!==h(e))return!1;if(0===t.size&&0===e.size)return!0; -var r=!a(t);if(h(t)){var n=t.entries();return e.every(function(t,e){var i=n.next().value;return i&&X(i[1],t)&&(r||X(i[0],e))})&&n.next().done}var i=!1;if(void 0===t.size)if(void 0===e.size)"function"==typeof t.cacheResult&&t.cacheResult();else{i=!0;var f=t;t=e,e=f}var c=!0,_=e.__iterate(function(e,n){return(r?t.has(e):i?X(e,t.get(n,yr)):X(t.get(n,yr),e))?void 0:(c=!1,!1)});return c&&t.size===_}function G(t,e){if(!(this instanceof G))return new G(t,e);if(this._value=t,this.size=void 0===e?1/0:Math.max(0,e),0===this.size){if(Mr)return Mr;Mr=this}}function Z(t,e){if(!t)throw Error(e)}function $(t,e,r){if(!(this instanceof $))return new $(t,e,r);if(Z(0!==r,"Cannot step a Range by 0"),t=t||0,void 0===e&&(e=1/0),r=void 0===r?1:Math.abs(r),t>e&&(r=-r),this._start=t,this._end=e,this._step=r,this.size=Math.max(0,Math.ceil((e-t)/r-1)+1),0===this.size){if(Er)return Er;Er=this}}function tt(){throw TypeError("Abstract")}function et(){}function rt(){}function nt(){}function it(t){return t>>>1&1073741824|3221225471&t}function ot(t){if(t===!1||null===t||void 0===t)return 0;if("function"==typeof t.valueOf&&(t=t.valueOf(),t===!1||null===t||void 0===t))return 0;if(t===!0)return 1;var e=typeof t;if("number"===e){if(t!==t||t===1/0)return 0;var r=0|t;for(r!==t&&(r^=4294967295*t);t>4294967295;)t/=4294967295,r^=t;return it(r)}if("string"===e)return t.length>Kr?ut(t):st(t);if("function"==typeof t.hashCode)return t.hashCode();if("object"===e)return at(t);if("function"==typeof t.toString)return st(""+t);throw Error("Value type "+e+" cannot be hashed.")}function ut(t){var e=Br[t];return void 0===e&&(e=st(t),Tr===Lr&&(Tr=0,Br={}),Tr++,Br[t]=e),e}function st(t){for(var e=0,r=0;t.length>r;r++)e=31*e+t.charCodeAt(r)|0;return it(e)}function at(t){var e;if(jr&&(e=Or.get(t),void 0!==e))return e;if(e=t[Ur],void 0!==e)return e;if(!Ar){if(e=t.propertyIsEnumerable&&t.propertyIsEnumerable[Ur],void 0!==e)return e;if(e=ht(t),void 0!==e)return e}if(e=++Rr,1073741824&Rr&&(Rr=0),jr)Or.set(t,e);else{if(void 0!==kr&&kr(t)===!1)throw Error("Non-extensible objects are not allowed as keys."); -if(Ar)Object.defineProperty(t,Ur,{enumerable:!1,configurable:!1,writable:!1,value:e});else if(void 0!==t.propertyIsEnumerable&&t.propertyIsEnumerable===t.constructor.prototype.propertyIsEnumerable)t.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},t.propertyIsEnumerable[Ur]=e;else{if(void 0===t.nodeType)throw Error("Unable to set a non-enumerable property on object.");t[Ur]=e}}return e}function ht(t){if(t&&t.nodeType>0)switch(t.nodeType){case 1:return t.uniqueID;case 9:return t.documentElement&&t.documentElement.uniqueID}}function ft(t){Z(t!==1/0,"Cannot perform this action with an infinite size.")}function ct(t){return null===t||void 0===t?zt():_t(t)&&!h(t)?t:zt().withMutations(function(e){var n=r(t);ft(n.size),n.forEach(function(t,r){return e.set(r,t)})})}function _t(t){return!(!t||!t[Wr])}function pt(t,e){this.ownerID=t,this.entries=e}function vt(t,e,r){this.ownerID=t,this.bitmap=e,this.nodes=r}function lt(t,e,r){this.ownerID=t,this.count=e,this.nodes=r}function yt(t,e,r){this.ownerID=t,this.keyHash=e,this.entries=r}function dt(t,e,r){this.ownerID=t,this.keyHash=e,this.entry=r}function mt(t,e,r){this._type=e,this._reverse=r,this._stack=t._root&&wt(t._root)}function gt(t,e){return z(t,e[0],e[1])}function wt(t,e){return{node:t,index:0,__prev:e}}function St(t,e,r,n){var i=Object.create(Cr);return i.size=t,i._root=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function zt(){return Jr||(Jr=St(0))}function It(t,e,r){var n,i;if(t._root){var o=f(dr),u=f(mr);if(n=bt(t._root,t.__ownerID,0,void 0,e,r,o,u),!u.value)return t;i=t.size+(o.value?r===yr?-1:1:0)}else{if(r===yr)return t;i=1,n=new pt(t.__ownerID,[[e,r]])}return t.__ownerID?(t.size=i,t._root=n,t.__hash=void 0,t.__altered=!0,t):n?St(i,n):zt()}function bt(t,e,r,n,i,o,u,s){return t?t.update(e,r,n,i,o,u,s):o===yr?t:(c(s),c(u),new dt(e,n,[i,o]))}function qt(t){return t.constructor===dt||t.constructor===yt}function Dt(t,e,r,n,i){if(t.keyHash===n)return new yt(e,n,[t.entry,i]);var o,u=(0===r?t.keyHash:t.keyHash>>>r)&lr,s=(0===r?n:n>>>r)&lr,a=u===s?[Dt(t,e,r+pr,n,i)]:(o=new dt(e,n,i), -s>u?[t,o]:[o,t]);return new vt(e,1<o;o++){var u=e[o];i=i.update(t,0,void 0,u[0],u[1])}return i}function Et(t,e,r,n){for(var i=0,o=0,u=Array(r),s=0,a=1,h=e.length;h>s;s++,a<<=1){var f=e[s];void 0!==f&&s!==n&&(i|=a,u[o++]=f)}return new vt(t,i,u)}function Ot(t,e,r,n,i){for(var o=0,u=Array(vr),s=0;0!==r;s++,r>>>=1)u[s]=1&r?e[o++]:void 0;return u[n]=i,new lt(t,o+1,u)}function xt(t,e,n){for(var i=[],u=0;n.length>u;u++){var s=n[u],a=r(s);o(s)||(a=a.map(function(t){return H(t)})),i.push(a)}return jt(t,e,i)}function kt(t,e,r){return t&&t.mergeDeep&&o(e)?t.mergeDeep(e):X(t,e)?t:e}function At(t){return function(e,r,n){if(e&&e.mergeDeepWith&&o(r))return e.mergeDeepWith(t,r);var i=t(e,r,n);return X(e,i)?e:i}}function jt(t,e,r){return r=r.filter(function(t){return 0!==t.size}),0===r.length?t:0!==t.size||t.__ownerID||1!==r.length?t.withMutations(function(t){for(var n=e?function(r,n){t.update(n,yr,function(t){return t===yr?r:e(t,r,n)})}:function(e,r){t.set(r,e)},i=0;r.length>i;i++)r[i].forEach(n)}):t.constructor(r[0])}function Rt(t,e,r,n){var i=t===yr,o=e.next();if(o.done){var u=i?r:t,s=n(u);return s===u?t:s}Z(i||t&&t.set,"invalid keyPath");var a=o.value,h=i?yr:t.get(a,yr),f=Rt(h,e,r,n);return f===h?t:f===yr?t.remove(a):(i?zt():t).set(a,f)}function Ut(t){return t-=t>>1&1431655765,t=(858993459&t)+(t>>2&858993459),t=t+(t>>4)&252645135,t+=t>>8,t+=t>>16,127&t}function Kt(t,e,r,n){var i=n?t:p(t);return i[e]=r,i}function Lt(t,e,r,n){var i=t.length+1;if(n&&e+1===i)return t[e]=r,t;for(var o=Array(i),u=0,s=0;i>s;s++)s===e?(o[s]=r,u=-1):o[s]=t[s+u];return o}function Tt(t,e,r){var n=t.length-1;if(r&&e===n)return t.pop(),t;for(var i=Array(n),o=0,u=0;n>u;u++)u===e&&(o=1),i[u]=t[u+o];return i}function Bt(t){var e=Pt();if(null===t||void 0===t)return e;if(Wt(t))return t;var r=n(t),i=r.size;return 0===i?e:(ft(i),i>0&&vr>i?Nt(0,i,pr,null,new Ct(r.toArray())):e.withMutations(function(t){t.setSize(i),r.forEach(function(e,r){return t.set(r,e)})}))}function Wt(t){ -return!(!t||!t[Vr])}function Ct(t,e){this.array=t,this.ownerID=e}function Jt(t,e){function r(t,e,r){return 0===e?n(t,r):i(t,e,r)}function n(t,r){var n=r===s?a&&a.array:t&&t.array,i=r>o?0:o-r,h=u-r;return h>vr&&(h=vr),function(){if(i===h)return Xr;var t=e?--h:i++;return n&&n[t]}}function i(t,n,i){var s,a=t&&t.array,h=i>o?0:o-i>>n,f=(u-i>>n)+1;return f>vr&&(f=vr),function(){for(;;){if(s){var t=s();if(t!==Xr)return t;s=null}if(h===f)return Xr;var o=e?--f:h++;s=r(a&&a[o],n-pr,i+(o<=t.size||0>e)return t.withMutations(function(t){0>e?Xt(t,e).set(0,r):Xt(t,0,e+1).set(e,r)});e+=t._origin;var n=t._tail,i=t._root,o=f(mr);return e>=Gt(t._capacity)?n=Vt(n,t.__ownerID,0,e,r,o):i=Vt(i,t.__ownerID,t._level,e,r,o),o.value?t.__ownerID?(t._root=i,t._tail=n,t.__hash=void 0,t.__altered=!0,t):Nt(t._origin,t._capacity,t._level,i,n):t}function Vt(t,e,r,n,i,o){var u=n>>>r&lr,s=t&&t.array.length>u;if(!s&&void 0===i)return t;var a;if(r>0){var h=t&&t.array[u],f=Vt(h,e,r-pr,n,i,o);return f===h?t:(a=Yt(t,e),a.array[u]=f,a)}return s&&t.array[u]===i?t:(c(o),a=Yt(t,e),void 0===i&&u===a.array.length-1?a.array.pop():a.array[u]=i,a)}function Yt(t,e){return e&&t&&e===t.ownerID?t:new Ct(t?t.array.slice():[],e)}function Qt(t,e){if(e>=Gt(t._capacity))return t._tail;if(1<e){for(var r=t._root,n=t._level;r&&n>0;)r=r.array[e>>>n&lr],n-=pr;return r}}function Xt(t,e,r){void 0!==e&&(e=0|e),void 0!==r&&(r=0|r);var n=t.__ownerID||new _,i=t._origin,o=t._capacity,u=i+e,s=void 0===r?o:0>r?o+r:i+r;if(u===i&&s===o)return t;if(u>=s)return t.clear();for(var a=t._level,h=t._root,f=0;0>u+f;)h=new Ct(h&&h.array.length?[void 0,h]:[],n),a+=pr,f+=1<=1<p?Qt(t,s-1):p>c?new Ct([],n):v;if(v&&p>c&&o>u&&v.array.length){h=Yt(h,n);for(var y=h,d=a;d>pr;d-=pr){var m=c>>>d&lr;y=y.array[m]=Yt(y.array[m],n)}y.array[c>>>pr&lr]=v}if(o>s&&(l=l&&l.removeAfter(n,0,s)),u>=p)u-=p,s-=p,a=pr,h=null,l=l&&l.removeBefore(n,0,u);else if(u>i||c>p){for(f=0;h;){var g=u>>>a&lr;if(g!==p>>>a&lr)break;g&&(f+=(1<i&&(h=h.removeBefore(n,a,u-f)),h&&c>p&&(h=h.removeAfter(n,a,p-f)),f&&(u-=f,s-=f)}return t.__ownerID?(t.size=s-u,t._origin=u,t._capacity=s,t._level=a,t._root=h,t._tail=l,t.__hash=void 0,t.__altered=!0,t):Nt(u,s,a,h,l)}function Ft(t,e,r){for(var i=[],u=0,s=0;r.length>s;s++){var a=r[s],h=n(a);h.size>u&&(u=h.size),o(a)||(h=h.map(function(t){return H(t)})),i.push(h)}return u>t.size&&(t=t.setSize(u)),jt(t,e,i)}function Gt(t){return vr>t?0:t-1>>>pr<=vr&&u.size>=2*o.size?(i=u.filter(function(t,e){return void 0!==t&&s!==e}),n=i.toKeyedSeq().map(function(t){return t[0]}).flip().toMap(),t.__ownerID&&(n.__ownerID=i.__ownerID=t.__ownerID)):(n=o.remove(e),i=s===u.size-1?u.pop():u.set(s,void 0))}else if(a){if(r===u.get(s)[1])return t;n=o,i=u.set(s,[e,r])}else n=o.set(e,u.size),i=u.set(u.size,[e,r]);return t.__ownerID?(t.size=n.size,t._map=n,t._list=i,t.__hash=void 0,t):te(n,i)}function ne(t,e){this._iter=t,this._useKeys=e,this.size=t.size}function ie(t){this._iter=t,this.size=t.size}function oe(t){this._iter=t,this.size=t.size}function ue(t){this._iter=t,this.size=t.size}function se(t){var e=Ee(t);return e._iter=t,e.size=t.size,e.flip=function(){return t},e.reverse=function(){var e=t.reverse.apply(this); -return e.flip=function(){return t.reverse()},e},e.has=function(e){return t.includes(e)},e.includes=function(e){return t.has(e)},e.cacheResult=Oe,e.__iterateUncached=function(e,r){var n=this;return t.__iterate(function(t,r){return e(r,t,n)!==!1},r)},e.__iteratorUncached=function(e,r){if(e===Sr){var n=t.__iterator(e,r);return new S(function(){var t=n.next();if(!t.done){var e=t.value[0];t.value[0]=t.value[1],t.value[1]=e}return t})}return t.__iterator(e===wr?gr:wr,r)},e}function ae(t,e,r){var n=Ee(t);return n.size=t.size,n.has=function(e){return t.has(e)},n.get=function(n,i){var o=t.get(n,yr);return o===yr?i:e.call(r,o,n,t)},n.__iterateUncached=function(n,i){var o=this;return t.__iterate(function(t,i,u){return n(e.call(r,t,i,u),i,o)!==!1},i)},n.__iteratorUncached=function(n,i){var o=t.__iterator(Sr,i);return new S(function(){var i=o.next();if(i.done)return i;var u=i.value,s=u[0];return z(n,s,e.call(r,u[1],s,t),i)})},n}function he(t,e){var r=Ee(t);return r._iter=t,r.size=t.size,r.reverse=function(){return t},t.flip&&(r.flip=function(){var e=se(t);return e.reverse=function(){return t.flip()},e}),r.get=function(r,n){return t.get(e?r:-1-r,n)},r.has=function(r){return t.has(e?r:-1-r)},r.includes=function(e){return t.includes(e)},r.cacheResult=Oe,r.__iterate=function(e,r){var n=this;return t.__iterate(function(t,r){return e(t,r,n)},!r)},r.__iterator=function(e,r){return t.__iterator(e,!r)},r}function fe(t,e,r,n){var i=Ee(t);return n&&(i.has=function(n){var i=t.get(n,yr);return i!==yr&&!!e.call(r,i,n,t)},i.get=function(n,i){var o=t.get(n,yr);return o!==yr&&e.call(r,o,n,t)?o:i}),i.__iterateUncached=function(i,o){var u=this,s=0;return t.__iterate(function(t,o,a){return e.call(r,t,o,a)?(s++,i(t,n?o:s-1,u)):void 0},o),s},i.__iteratorUncached=function(i,o){var u=t.__iterator(Sr,o),s=0;return new S(function(){for(;;){var o=u.next();if(o.done)return o;var a=o.value,h=a[0],f=a[1];if(e.call(r,f,h,t))return z(i,n?h:s++,f,o)}})},i}function ce(t,e,r){var n=ct().asMutable();return t.__iterate(function(i,o){n.update(e.call(r,i,o,t),0,function(t){ -return t+1})}),n.asImmutable()}function _e(t,e,r){var n=u(t),i=(h(t)?Zt():ct()).asMutable();t.__iterate(function(o,u){i.update(e.call(r,o,u,t),function(t){return t=t||[],t.push(n?[u,o]:o),t})});var o=Me(t);return i.map(function(e){return be(t,o(e))})}function pe(t,e,r,n){var i=t.size;if(void 0!==e&&(e=0|e),void 0!==r&&(r=r===1/0?i:0|r),d(e,r,i))return t;var o=m(e,i),u=g(r,i);if(o!==o||u!==u)return pe(t.toSeq().cacheResult(),e,r,n);var s,a=u-o;a===a&&(s=0>a?0:a);var h=Ee(t);return h.size=0===s?s:t.size&&s||void 0,!n&&L(t)&&s>=0&&(h.get=function(e,r){return e=l(this,e),e>=0&&s>e?t.get(e+o,r):r}),h.__iterateUncached=function(e,r){var i=this;if(0===s)return 0;if(r)return this.cacheResult().__iterate(e,r);var u=0,a=!0,h=0;return t.__iterate(function(t,r){return a&&(a=u++s)return I();var t=i.next();return n||e===wr?t:e===gr?z(e,a-1,void 0,t):z(e,a-1,t.value[1],t)})},h}function ve(t,e,r){var n=Ee(t);return n.__iterateUncached=function(n,i){var o=this;if(i)return this.cacheResult().__iterate(n,i);var u=0;return t.__iterate(function(t,i,s){return e.call(r,t,i,s)&&++u&&n(t,i,o)}),u},n.__iteratorUncached=function(n,i){var o=this;if(i)return this.cacheResult().__iterator(n,i);var u=t.__iterator(Sr,i),s=!0;return new S(function(){if(!s)return I();var t=u.next();if(t.done)return t;var i=t.value,a=i[0],h=i[1];return e.call(r,h,a,o)?n===Sr?t:z(n,a,h,t):(s=!1,I())})},n}function le(t,e,r,n){var i=Ee(t);return i.__iterateUncached=function(i,o){var u=this;if(o)return this.cacheResult().__iterate(i,o);var s=!0,a=0;return t.__iterate(function(t,o,h){return s&&(s=e.call(r,t,o,h))?void 0:(a++,i(t,n?o:a-1,u))}),a},i.__iteratorUncached=function(i,o){var u=this;if(o)return this.cacheResult().__iterator(i,o);var s=t.__iterator(Sr,o),a=!0,h=0;return new S(function(){var t,o,f;do{if(t=s.next(),t.done)return n||i===wr?t:i===gr?z(i,h++,void 0,t):z(i,h++,t.value[1],t); -var c=t.value;o=c[0],f=c[1],a&&(a=e.call(r,f,o,u))}while(a);return i===Sr?t:z(i,o,f,t)})},i}function ye(t,e){var n=u(t),i=[t].concat(e).map(function(t){return o(t)?n&&(t=r(t)):t=n?B(t):W(Array.isArray(t)?t:[t]),t}).filter(function(t){return 0!==t.size});if(0===i.length)return t;if(1===i.length){var a=i[0];if(a===t||n&&u(a)||s(t)&&s(a))return a}var h=new j(i);return n?h=h.toKeyedSeq():s(t)||(h=h.toSetSeq()),h=h.flatten(!0),h.size=i.reduce(function(t,e){if(void 0!==t){var r=e.size;if(void 0!==r)return t+r}},0),h}function de(t,e,r){var n=Ee(t);return n.__iterateUncached=function(n,i){function u(t,h){var f=this;t.__iterate(function(t,i){return(!e||e>h)&&o(t)?u(t,h+1):n(t,r?i:s++,f)===!1&&(a=!0),!a},i)}var s=0,a=!1;return u(t,0),s},n.__iteratorUncached=function(n,i){var u=t.__iterator(n,i),s=[],a=0;return new S(function(){for(;u;){var t=u.next();if(t.done===!1){var h=t.value;if(n===Sr&&(h=h[1]),e&&!(e>s.length)||!o(h))return r?t:z(n,a++,h,t);s.push(u),u=h.__iterator(n,i)}else u=s.pop()}return I()})},n}function me(t,e,r){var n=Me(t);return t.toSeq().map(function(i,o){return n(e.call(r,i,o,t))}).flatten(!0)}function ge(t,e){var r=Ee(t);return r.size=t.size&&2*t.size-1,r.__iterateUncached=function(r,n){var i=this,o=0;return t.__iterate(function(t,n){return(!o||r(e,o++,i)!==!1)&&r(t,o++,i)!==!1},n),o},r.__iteratorUncached=function(r,n){var i,o=t.__iterator(wr,n),u=0;return new S(function(){return(!i||u%2)&&(i=o.next(),i.done)?i:u%2?z(r,u++,e):z(r,u++,i.value,i)})},r}function we(t,e,r){e||(e=xe);var n=u(t),i=0,o=t.toSeq().map(function(e,n){return[n,e,i++,r?r(e,n,t):e]}).toArray();return o.sort(function(t,r){return e(t[3],r[3])||t[2]-r[2]}).forEach(n?function(t,e){o[e].length=2}:function(t,e){o[e]=t[1]}),n?x(o):s(t)?k(o):A(o)}function Se(t,e,r){if(e||(e=xe),r){var n=t.toSeq().map(function(e,n){return[e,r(e,n,t)]}).reduce(function(t,r){return ze(e,t[1],r[1])?r:t});return n&&n[0]}return t.reduce(function(t,r){return ze(e,t,r)?r:t})}function ze(t,e,r){var n=t(r,e);return 0===n&&r!==e&&(void 0===r||null===r||r!==r)||n>0}function Ie(t,r,n){ -var i=Ee(t);return i.size=new j(n).map(function(t){return t.size}).min(),i.__iterate=function(t,e){for(var r,n=this.__iterator(wr,e),i=0;!(r=n.next()).done&&t(r.value,i++,this)!==!1;);return i},i.__iteratorUncached=function(t,i){var o=n.map(function(t){return t=e(t),D(i?t.reverse():t)}),u=0,s=!1;return new S(function(){var e;return s||(e=o.map(function(t){return t.next()}),s=e.some(function(t){return t.done})),s?I():z(t,u++,r.apply(null,e.map(function(t){return t.value})))})},i}function be(t,e){return L(t)?e:t.constructor(e)}function qe(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function De(t){return ft(t.size),v(t)}function Me(t){return u(t)?r:s(t)?n:i}function Ee(t){return Object.create((u(t)?x:s(t)?k:A).prototype)}function Oe(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):O.prototype.cacheResult.call(this)}function xe(t,e){return t>e?1:e>t?-1:0}function ke(t){var r=D(t);if(!r){if(!E(t))throw new TypeError("Expected iterable or array-like: "+t);r=D(e(t))}return r}function Ae(t,e){var r,n=function(o){if(o instanceof n)return o;if(!(this instanceof n))return new n(o);if(!r){r=!0;var u=Object.keys(t);Ue(i,u),i.size=u.length,i._name=e,i._keys=u,i._defaultValues=t}this._map=ct(o)},i=n.prototype=Object.create(Gr);return i.constructor=n,n}function je(t,e,r){var n=Object.create(Object.getPrototypeOf(t));return n._map=e,n.__ownerID=r,n}function Re(t){return t._name||t.constructor.name||"Record"}function Ue(t,e){try{e.forEach(Ke.bind(void 0,t))}catch(r){}}function Ke(t,e){Object.defineProperty(t,e,{get:function(){return this.get(e)},set:function(t){Z(this.__ownerID,"Cannot set on an immutable record."),this.set(e,t)}})}function Le(t){return null===t||void 0===t?Ce():Te(t)&&!h(t)?t:Ce().withMutations(function(e){var r=i(t);ft(r.size),r.forEach(function(t){return e.add(t)})})}function Te(t){return!(!t||!t[Zr])}function Be(t,e){return t.__ownerID?(t.size=e.size,t._map=e,t):e===t._map?t:0===e.size?t.__empty():t.__make(e)}function We(t,e){var r=Object.create($r); -return r.size=t?t.size:0,r._map=t,r.__ownerID=e,r}function Ce(){return tn||(tn=We(zt()))}function Je(t){return null===t||void 0===t?He():Ne(t)?t:He().withMutations(function(e){var r=i(t);ft(r.size),r.forEach(function(t){return e.add(t)})})}function Ne(t){return Te(t)&&h(t)}function Pe(t,e){var r=Object.create(en);return r.size=t?t.size:0,r._map=t,r.__ownerID=e,r}function He(){return rn||(rn=Pe(ee()))}function Ve(t){return null===t||void 0===t?Xe():Ye(t)?t:Xe().unshiftAll(t)}function Ye(t){return!(!t||!t[nn])}function Qe(t,e,r,n){var i=Object.create(on);return i.size=t,i._head=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function Xe(){return un||(un=Qe(0))}function Fe(t,e){var r=function(r){t.prototype[r]=e[r]};return Object.keys(e).forEach(r),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(e).forEach(r),t}function Ge(t,e){return e}function Ze(t,e){return[e,t]}function $e(t){return function(){return!t.apply(this,arguments)}}function tr(t){return function(){return-t.apply(this,arguments)}}function er(t){return"string"==typeof t?JSON.stringify(t):t+""}function rr(){return p(arguments)}function nr(t,e){return e>t?1:t>e?-1:0}function ir(t){if(t.size===1/0)return 0;var e=h(t),r=u(t),n=e?1:0,i=t.__iterate(r?e?function(t,e){n=31*n+ur(ot(t),ot(e))|0}:function(t,e){n=n+ur(ot(t),ot(e))|0}:e?function(t){n=31*n+ot(t)|0}:function(t){n=n+ot(t)|0});return or(i,n)}function or(t,e){return e=xr(e,3432918353),e=xr(e<<15|e>>>-15,461845907),e=xr(e<<13|e>>>-13,5),e=(e+3864292196|0)^t,e=xr(e^e>>>16,2246822507),e=xr(e^e>>>13,3266489909),e=it(e^e>>>16)}function ur(t,e){return t^e+2654435769+(t<<6)+(t>>2)|0}var sr=Array.prototype.slice;t(r,e),t(n,e),t(i,e),e.isIterable=o,e.isKeyed=u,e.isIndexed=s,e.isAssociative=a,e.isOrdered=h,e.Keyed=r,e.Indexed=n,e.Set=i;var ar="@@__IMMUTABLE_ITERABLE__@@",hr="@@__IMMUTABLE_KEYED__@@",fr="@@__IMMUTABLE_INDEXED__@@",cr="@@__IMMUTABLE_ORDERED__@@",_r="delete",pr=5,vr=1<=i;i++)if(t(r[e?n-i:i],i,this)===!1)return i+1;return i},j.prototype.__iterator=function(t,e){var r=this._array,n=r.length-1,i=0;return new S(function(){return i>n?I():z(t,i,r[e?n-i++:i++])})},t(R,x),R.prototype.get=function(t,e){return void 0===e||this.has(t)?this._object[t]:e},R.prototype.has=function(t){return this._object.hasOwnProperty(t)},R.prototype.__iterate=function(t,e){for(var r=this._object,n=this._keys,i=n.length-1,o=0;i>=o;o++){var u=n[e?i-o:o];if(t(r[u],u,this)===!1)return o+1}return o},R.prototype.__iterator=function(t,e){var r=this._object,n=this._keys,i=n.length-1,o=0;return new S(function(){var u=n[e?i-o:o];return o++>i?I():z(t,u,r[u])})},R.prototype[cr]=!0,t(U,k),U.prototype.__iterateUncached=function(t,e){if(e)return this.cacheResult().__iterate(t,e); -var r=this._iterable,n=D(r),i=0;if(q(n))for(var o;!(o=n.next()).done&&t(o.value,i++,this)!==!1;);return i},U.prototype.__iteratorUncached=function(t,e){if(e)return this.cacheResult().__iterator(t,e);var r=this._iterable,n=D(r);if(!q(n))return new S(I);var i=0;return new S(function(){var e=n.next();return e.done?e:z(t,i++,e.value)})},t(K,k),K.prototype.__iterateUncached=function(t,e){if(e)return this.cacheResult().__iterate(t,e);for(var r=this._iterator,n=this._iteratorCache,i=0;n.length>i;)if(t(n[i],i++,this)===!1)return i;for(var o;!(o=r.next()).done;){var u=o.value;if(n[i]=u,t(u,i++,this)===!1)break}return i},K.prototype.__iteratorUncached=function(t,e){if(e)return this.cacheResult().__iterator(t,e);var r=this._iterator,n=this._iteratorCache,i=0;return new S(function(){if(i>=n.length){var e=r.next();if(e.done)return e;n[i]=e.value}return z(t,i,n[i++])})};var Dr;t(G,k),G.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},G.prototype.get=function(t,e){return this.has(t)?this._value:e},G.prototype.includes=function(t){return X(this._value,t)},G.prototype.slice=function(t,e){var r=this.size;return d(t,e,r)?this:new G(this._value,g(e,r)-m(t,r))},G.prototype.reverse=function(){return this},G.prototype.indexOf=function(t){return X(this._value,t)?0:-1},G.prototype.lastIndexOf=function(t){return X(this._value,t)?this.size:-1},G.prototype.__iterate=function(t,e){for(var r=0;this.size>r;r++)if(t(this._value,r,this)===!1)return r+1;return r},G.prototype.__iterator=function(t,e){var r=this,n=0;return new S(function(){return r.size>n?z(t,n++,r._value):I()})},G.prototype.equals=function(t){return t instanceof G?X(this._value,t._value):F(t)};var Mr;t($,k),$.prototype.toString=function(){return 0===this.size?"Range []":"Range [ "+this._start+"..."+this._end+(1!==this._step?" by "+this._step:"")+" ]"},$.prototype.get=function(t,e){return this.has(t)?this._start+l(this,t)*this._step:e},$.prototype.includes=function(t){var e=(t-this._start)/this._step;return e>=0&&this.size>e&&e===Math.floor(e); -},$.prototype.slice=function(t,e){return d(t,e,this.size)?this:(t=m(t,this.size),e=g(e,this.size),t>=e?new $(0,0):new $(this.get(t,this._end),this.get(e,this._end),this._step))},$.prototype.indexOf=function(t){var e=t-this._start;if(e%this._step===0){var r=e/this._step;if(r>=0&&this.size>r)return r}return-1},$.prototype.lastIndexOf=function(t){return this.indexOf(t)},$.prototype.__iterate=function(t,e){for(var r=this.size-1,n=this._step,i=e?this._start+r*n:this._start,o=0;r>=o;o++){if(t(i,o,this)===!1)return o+1;i+=e?-n:n}return o},$.prototype.__iterator=function(t,e){var r=this.size-1,n=this._step,i=e?this._start+r*n:this._start,o=0;return new S(function(){var u=i;return i+=e?-n:n,o>r?I():z(t,o++,u)})},$.prototype.equals=function(t){return t instanceof $?this._start===t._start&&this._end===t._end&&this._step===t._step:F(this,t)};var Er;t(tt,e),t(et,tt),t(rt,tt),t(nt,tt),tt.Keyed=et,tt.Indexed=rt,tt.Set=nt;var Or,xr="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(t,e){t=0|t,e=0|e;var r=65535&t,n=65535&e;return r*n+((t>>>16)*n+r*(e>>>16)<<16>>>0)|0},kr=Object.isExtensible,Ar=function(){try{return Object.defineProperty({},"@",{}),!0}catch(t){return!1}}(),jr="function"==typeof WeakMap;jr&&(Or=new WeakMap);var Rr=0,Ur="__immutablehash__";"function"==typeof Symbol&&(Ur=Symbol(Ur));var Kr=16,Lr=255,Tr=0,Br={};t(ct,et),ct.of=function(){var t=sr.call(arguments,0);return zt().withMutations(function(e){for(var r=0;t.length>r;r+=2){if(r+1>=t.length)throw Error("Missing value for key: "+t[r]);e.set(t[r],t[r+1])}})},ct.prototype.toString=function(){return this.__toString("Map {","}")},ct.prototype.get=function(t,e){return this._root?this._root.get(0,void 0,t,e):e},ct.prototype.set=function(t,e){return It(this,t,e)},ct.prototype.setIn=function(t,e){return this.updateIn(t,yr,function(){return e})},ct.prototype.remove=function(t){return It(this,t,yr)},ct.prototype.deleteIn=function(t){return this.updateIn(t,function(){return yr})},ct.prototype.update=function(t,e,r){return 1===arguments.length?t(this):this.updateIn([t],e,r); -},ct.prototype.updateIn=function(t,e,r){r||(r=e,e=void 0);var n=Rt(this,ke(t),e,r);return n===yr?void 0:n},ct.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):zt()},ct.prototype.merge=function(){return xt(this,void 0,arguments)},ct.prototype.mergeWith=function(t){var e=sr.call(arguments,1);return xt(this,t,e)},ct.prototype.mergeIn=function(t){var e=sr.call(arguments,1);return this.updateIn(t,zt(),function(t){return"function"==typeof t.merge?t.merge.apply(t,e):e[e.length-1]})},ct.prototype.mergeDeep=function(){return xt(this,kt,arguments)},ct.prototype.mergeDeepWith=function(t){var e=sr.call(arguments,1);return xt(this,At(t),e)},ct.prototype.mergeDeepIn=function(t){var e=sr.call(arguments,1);return this.updateIn(t,zt(),function(t){return"function"==typeof t.mergeDeep?t.mergeDeep.apply(t,e):e[e.length-1]})},ct.prototype.sort=function(t){return Zt(we(this,t))},ct.prototype.sortBy=function(t,e){return Zt(we(this,e,t))},ct.prototype.withMutations=function(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this},ct.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new _)},ct.prototype.asImmutable=function(){return this.__ensureOwner()},ct.prototype.wasAltered=function(){return this.__altered},ct.prototype.__iterator=function(t,e){return new mt(this,t,e)},ct.prototype.__iterate=function(t,e){var r=this,n=0;return this._root&&this._root.iterate(function(e){return n++,t(e[1],e[0],r)},e),n},ct.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?St(this.size,this._root,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)},ct.isMap=_t;var Wr="@@__IMMUTABLE_MAP__@@",Cr=ct.prototype;Cr[Wr]=!0,Cr[_r]=Cr.remove,Cr.removeIn=Cr.deleteIn,pt.prototype.get=function(t,e,r,n){for(var i=this.entries,o=0,u=i.length;u>o;o++)if(X(r,i[o][0]))return i[o][1];return n},pt.prototype.update=function(t,e,r,n,i,o,u){for(var s=i===yr,a=this.entries,h=0,f=a.length;f>h&&!X(n,a[h][0]);h++); -var _=f>h;if(_?a[h][1]===i:s)return this;if(c(u),(s||!_)&&c(o),!s||1!==a.length){if(!_&&!s&&a.length>=Nr)return Mt(t,a,n,i);var v=t&&t===this.ownerID,l=v?a:p(a);return _?s?h===f-1?l.pop():l[h]=l.pop():l[h]=[n,i]:l.push([n,i]),v?(this.entries=l,this):new pt(t,l)}},vt.prototype.get=function(t,e,r,n){void 0===e&&(e=ot(r));var i=1<<((0===t?e:e>>>t)&lr),o=this.bitmap;return 0===(o&i)?n:this.nodes[Ut(o&i-1)].get(t+pr,e,r,n)},vt.prototype.update=function(t,e,r,n,i,o,u){void 0===r&&(r=ot(n));var s=(0===e?r:r>>>e)&lr,a=1<=Pr)return Ot(t,_,h,s,v);if(f&&!v&&2===_.length&&qt(_[1^c]))return _[1^c];if(f&&v&&1===_.length&&qt(v))return v;var l=t&&t===this.ownerID,y=f?v?h:h^a:h|a,d=f?v?Kt(_,c,v,l):Tt(_,c,l):Lt(_,c,v,l);return l?(this.bitmap=y,this.nodes=d,this):new vt(t,y,d)},lt.prototype.get=function(t,e,r,n){void 0===e&&(e=ot(r));var i=(0===t?e:e>>>t)&lr,o=this.nodes[i];return o?o.get(t+pr,e,r,n):n},lt.prototype.update=function(t,e,r,n,i,o,u){void 0===r&&(r=ot(n));var s=(0===e?r:r>>>e)&lr,a=i===yr,h=this.nodes,f=h[s];if(a&&!f)return this;var c=bt(f,t,e+pr,r,n,i,o,u);if(c===f)return this;var _=this.count;if(f){if(!c&&(_--,Hr>_))return Et(t,h,_,s)}else _++;var p=t&&t===this.ownerID,v=Kt(h,s,c,p);return p?(this.count=_,this.nodes=v,this):new lt(t,_,v)},yt.prototype.get=function(t,e,r,n){for(var i=this.entries,o=0,u=i.length;u>o;o++)if(X(r,i[o][0]))return i[o][1];return n},yt.prototype.update=function(t,e,r,n,i,o,u){void 0===r&&(r=ot(n));var s=i===yr;if(r!==this.keyHash)return s?this:(c(u),c(o),Dt(this,t,e,r,[n,i]));for(var a=this.entries,h=0,f=a.length;f>h&&!X(n,a[h][0]);h++);var _=f>h;if(_?a[h][1]===i:s)return this;if(c(u),(s||!_)&&c(o),s&&2===f)return new dt(t,this.keyHash,a[1^h]);var v=t&&t===this.ownerID,l=v?a:p(a);return _?s?h===f-1?l.pop():l[h]=l.pop():l[h]=[n,i]:l.push([n,i]),v?(this.entries=l,this):new yt(t,this.keyHash,l)},dt.prototype.get=function(t,e,r,n){return X(r,this.entry[0])?this.entry[1]:n; -},dt.prototype.update=function(t,e,r,n,i,o,u){var s=i===yr,a=X(n,this.entry[0]);return(a?i===this.entry[1]:s)?this:(c(u),s?void c(o):a?t&&t===this.ownerID?(this.entry[1]=i,this):new dt(t,this.keyHash,[n,i]):(c(o),Dt(this,t,e,ot(n),[n,i])))},pt.prototype.iterate=yt.prototype.iterate=function(t,e){for(var r=this.entries,n=0,i=r.length-1;i>=n;n++)if(t(r[e?i-n:n])===!1)return!1},vt.prototype.iterate=lt.prototype.iterate=function(t,e){for(var r=this.nodes,n=0,i=r.length-1;i>=n;n++){var o=r[e?i-n:n];if(o&&o.iterate(t,e)===!1)return!1}},dt.prototype.iterate=function(t,e){return t(this.entry)},t(mt,S),mt.prototype.next=function(){for(var t=this._type,e=this._stack;e;){var r,n=e.node,i=e.index++;if(n.entry){if(0===i)return gt(t,n.entry)}else if(n.entries){if(r=n.entries.length-1,r>=i)return gt(t,n.entries[this._reverse?r-i:i])}else if(r=n.nodes.length-1,r>=i){var o=n.nodes[this._reverse?r-i:i];if(o){if(o.entry)return gt(t,o.entry);e=this._stack=wt(o,e)}continue}e=this._stack=this._stack.__prev}return I()};var Jr,Nr=vr/4,Pr=vr/2,Hr=vr/4;t(Bt,rt),Bt.of=function(){return this(arguments)},Bt.prototype.toString=function(){return this.__toString("List [","]")},Bt.prototype.get=function(t,e){if(t=l(this,t),t>=0&&this.size>t){t+=this._origin;var r=Qt(this,t);return r&&r.array[t&lr]}return e},Bt.prototype.set=function(t,e){return Ht(this,t,e)},Bt.prototype.remove=function(t){return this.has(t)?0===t?this.shift():t===this.size-1?this.pop():this.splice(t,1):this},Bt.prototype.insert=function(t,e){return this.splice(t,0,e)},Bt.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=pr,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):Pt()},Bt.prototype.push=function(){var t=arguments,e=this.size;return this.withMutations(function(r){Xt(r,0,e+t.length);for(var n=0;t.length>n;n++)r.set(e+n,t[n])})},Bt.prototype.pop=function(){return Xt(this,0,-1)},Bt.prototype.unshift=function(){var t=arguments;return this.withMutations(function(e){Xt(e,-t.length);for(var r=0;t.length>r;r++)e.set(r,t[r]); -})},Bt.prototype.shift=function(){return Xt(this,1)},Bt.prototype.merge=function(){return Ft(this,void 0,arguments)},Bt.prototype.mergeWith=function(t){var e=sr.call(arguments,1);return Ft(this,t,e)},Bt.prototype.mergeDeep=function(){return Ft(this,kt,arguments)},Bt.prototype.mergeDeepWith=function(t){var e=sr.call(arguments,1);return Ft(this,At(t),e)},Bt.prototype.setSize=function(t){return Xt(this,0,t)},Bt.prototype.slice=function(t,e){var r=this.size;return d(t,e,r)?this:Xt(this,m(t,r),g(e,r))},Bt.prototype.__iterator=function(t,e){var r=0,n=Jt(this,e);return new S(function(){var e=n();return e===Xr?I():z(t,r++,e)})},Bt.prototype.__iterate=function(t,e){for(var r,n=0,i=Jt(this,e);(r=i())!==Xr&&t(r,n++,this)!==!1;);return n},Bt.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Nt(this._origin,this._capacity,this._level,this._root,this._tail,t,this.__hash):(this.__ownerID=t,this)},Bt.isList=Wt;var Vr="@@__IMMUTABLE_LIST__@@",Yr=Bt.prototype;Yr[Vr]=!0,Yr[_r]=Yr.remove,Yr.setIn=Cr.setIn,Yr.deleteIn=Yr.removeIn=Cr.removeIn,Yr.update=Cr.update,Yr.updateIn=Cr.updateIn,Yr.mergeIn=Cr.mergeIn,Yr.mergeDeepIn=Cr.mergeDeepIn,Yr.withMutations=Cr.withMutations,Yr.asMutable=Cr.asMutable,Yr.asImmutable=Cr.asImmutable,Yr.wasAltered=Cr.wasAltered,Ct.prototype.removeBefore=function(t,e,r){if(r===e?1<>>e&lr;if(n>=this.array.length)return new Ct([],t);var i,o=0===n;if(e>0){var u=this.array[n];if(i=u&&u.removeBefore(t,e-pr,r),i===u&&o)return this}if(o&&!i)return this;var s=Yt(this,t);if(!o)for(var a=0;n>a;a++)s.array[a]=void 0;return i&&(s.array[n]=i),s},Ct.prototype.removeAfter=function(t,e,r){if(r===(e?1<>>e&lr;if(n>=this.array.length)return this;var i;if(e>0){var o=this.array[n];if(i=o&&o.removeAfter(t,e-pr,r),i===o&&n===this.array.length-1)return this}var u=Yt(this,t);return u.array.splice(n+1),i&&(u.array[n]=i),u};var Qr,Xr={};t(Zt,ct),Zt.of=function(){return this(arguments)},Zt.prototype.toString=function(){return this.__toString("OrderedMap {","}"); -},Zt.prototype.get=function(t,e){var r=this._map.get(t);return void 0!==r?this._list.get(r)[1]:e},Zt.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):ee()},Zt.prototype.set=function(t,e){return re(this,t,e)},Zt.prototype.remove=function(t){return re(this,t,yr)},Zt.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},Zt.prototype.__iterate=function(t,e){var r=this;return this._list.__iterate(function(e){return e&&t(e[1],e[0],r)},e)},Zt.prototype.__iterator=function(t,e){return this._list.fromEntrySeq().__iterator(t,e)},Zt.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t),r=this._list.__ensureOwner(t);return t?te(e,r,t,this.__hash):(this.__ownerID=t,this._map=e,this._list=r,this)},Zt.isOrderedMap=$t,Zt.prototype[cr]=!0,Zt.prototype[_r]=Zt.prototype.remove;var Fr;t(ne,x),ne.prototype.get=function(t,e){return this._iter.get(t,e)},ne.prototype.has=function(t){return this._iter.has(t)},ne.prototype.valueSeq=function(){return this._iter.valueSeq()},ne.prototype.reverse=function(){var t=this,e=he(this,!0);return this._useKeys||(e.valueSeq=function(){return t._iter.toSeq().reverse()}),e},ne.prototype.map=function(t,e){var r=this,n=ae(this,t,e);return this._useKeys||(n.valueSeq=function(){return r._iter.toSeq().map(t,e)}),n},ne.prototype.__iterate=function(t,e){var r,n=this;return this._iter.__iterate(this._useKeys?function(e,r){return t(e,r,n)}:(r=e?De(this):0,function(i){return t(i,e?--r:r++,n)}),e)},ne.prototype.__iterator=function(t,e){if(this._useKeys)return this._iter.__iterator(t,e);var r=this._iter.__iterator(wr,e),n=e?De(this):0;return new S(function(){var i=r.next();return i.done?i:z(t,e?--n:n++,i.value,i)})},ne.prototype[cr]=!0,t(ie,k),ie.prototype.includes=function(t){return this._iter.includes(t)},ie.prototype.__iterate=function(t,e){var r=this,n=0;return this._iter.__iterate(function(e){return t(e,n++,r)},e)},ie.prototype.__iterator=function(t,e){var r=this._iter.__iterator(wr,e),n=0; -return new S(function(){var e=r.next();return e.done?e:z(t,n++,e.value,e)})},t(oe,A),oe.prototype.has=function(t){return this._iter.includes(t)},oe.prototype.__iterate=function(t,e){var r=this;return this._iter.__iterate(function(e){return t(e,e,r)},e)},oe.prototype.__iterator=function(t,e){var r=this._iter.__iterator(wr,e);return new S(function(){var e=r.next();return e.done?e:z(t,e.value,e.value,e)})},t(ue,x),ue.prototype.entrySeq=function(){return this._iter.toSeq()},ue.prototype.__iterate=function(t,e){var r=this;return this._iter.__iterate(function(e){if(e){qe(e);var n=o(e);return t(n?e.get(1):e[1],n?e.get(0):e[0],r)}},e)},ue.prototype.__iterator=function(t,e){var r=this._iter.__iterator(wr,e);return new S(function(){for(;;){var e=r.next();if(e.done)return e;var n=e.value;if(n){qe(n);var i=o(n);return z(t,i?n.get(0):n[0],i?n.get(1):n[1],e)}}})},ie.prototype.cacheResult=ne.prototype.cacheResult=oe.prototype.cacheResult=ue.prototype.cacheResult=Oe,t(Ae,et),Ae.prototype.toString=function(){return this.__toString(Re(this)+" {","}")},Ae.prototype.has=function(t){return this._defaultValues.hasOwnProperty(t)},Ae.prototype.get=function(t,e){if(!this.has(t))return e;var r=this._defaultValues[t];return this._map?this._map.get(t,r):r},Ae.prototype.clear=function(){if(this.__ownerID)return this._map&&this._map.clear(),this;var t=this.constructor;return t._empty||(t._empty=je(this,zt()))},Ae.prototype.set=function(t,e){if(!this.has(t))throw Error('Cannot set unknown key "'+t+'" on '+Re(this));if(this._map&&!this._map.has(t)){var r=this._defaultValues[t];if(e===r)return this}var n=this._map&&this._map.set(t,e);return this.__ownerID||n===this._map?this:je(this,n)},Ae.prototype.remove=function(t){if(!this.has(t))return this;var e=this._map&&this._map.remove(t);return this.__ownerID||e===this._map?this:je(this,e)},Ae.prototype.wasAltered=function(){return this._map.wasAltered()},Ae.prototype.__iterator=function(t,e){var n=this;return r(this._defaultValues).map(function(t,e){return n.get(e)}).__iterator(t,e)},Ae.prototype.__iterate=function(t,e){ -var n=this;return r(this._defaultValues).map(function(t,e){return n.get(e)}).__iterate(t,e)},Ae.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map&&this._map.__ensureOwner(t);return t?je(this,e,t):(this.__ownerID=t,this._map=e,this)};var Gr=Ae.prototype;Gr[_r]=Gr.remove,Gr.deleteIn=Gr.removeIn=Cr.removeIn,Gr.merge=Cr.merge,Gr.mergeWith=Cr.mergeWith,Gr.mergeIn=Cr.mergeIn,Gr.mergeDeep=Cr.mergeDeep,Gr.mergeDeepWith=Cr.mergeDeepWith,Gr.mergeDeepIn=Cr.mergeDeepIn,Gr.setIn=Cr.setIn,Gr.update=Cr.update,Gr.updateIn=Cr.updateIn,Gr.withMutations=Cr.withMutations,Gr.asMutable=Cr.asMutable,Gr.asImmutable=Cr.asImmutable,t(Le,nt),Le.of=function(){return this(arguments)},Le.fromKeys=function(t){return this(r(t).keySeq())},Le.prototype.toString=function(){return this.__toString("Set {","}")},Le.prototype.has=function(t){return this._map.has(t)},Le.prototype.add=function(t){return Be(this,this._map.set(t,!0))},Le.prototype.remove=function(t){return Be(this,this._map.remove(t))},Le.prototype.clear=function(){return Be(this,this._map.clear())},Le.prototype.union=function(){var t=sr.call(arguments,0);return t=t.filter(function(t){return 0!==t.size}),0===t.length?this:0!==this.size||this.__ownerID||1!==t.length?this.withMutations(function(e){for(var r=0;t.length>r;r++)i(t[r]).forEach(function(t){return e.add(t)})}):this.constructor(t[0])},Le.prototype.intersect=function(){var t=sr.call(arguments,0);if(0===t.length)return this;t=t.map(function(t){return i(t)});var e=this;return this.withMutations(function(r){e.forEach(function(e){t.every(function(t){return t.includes(e)})||r.remove(e)})})},Le.prototype.subtract=function(){var t=sr.call(arguments,0);if(0===t.length)return this;t=t.map(function(t){return i(t)});var e=this;return this.withMutations(function(r){e.forEach(function(e){t.some(function(t){return t.includes(e)})&&r.remove(e)})})},Le.prototype.merge=function(){return this.union.apply(this,arguments)},Le.prototype.mergeWith=function(t){var e=sr.call(arguments,1);return this.union.apply(this,e)}, -Le.prototype.sort=function(t){return Je(we(this,t))},Le.prototype.sortBy=function(t,e){return Je(we(this,e,t))},Le.prototype.wasAltered=function(){return this._map.wasAltered()},Le.prototype.__iterate=function(t,e){var r=this;return this._map.__iterate(function(e,n){return t(n,n,r)},e)},Le.prototype.__iterator=function(t,e){return this._map.map(function(t,e){return e}).__iterator(t,e)},Le.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t);return t?this.__make(e,t):(this.__ownerID=t,this._map=e,this)},Le.isSet=Te;var Zr="@@__IMMUTABLE_SET__@@",$r=Le.prototype;$r[Zr]=!0,$r[_r]=$r.remove,$r.mergeDeep=$r.merge,$r.mergeDeepWith=$r.mergeWith,$r.withMutations=Cr.withMutations,$r.asMutable=Cr.asMutable,$r.asImmutable=Cr.asImmutable,$r.__empty=Ce,$r.__make=We;var tn;t(Je,Le),Je.of=function(){return this(arguments)},Je.fromKeys=function(t){return this(r(t).keySeq())},Je.prototype.toString=function(){return this.__toString("OrderedSet {","}")},Je.isOrderedSet=Ne;var en=Je.prototype;en[cr]=!0,en.__empty=He,en.__make=Pe;var rn;t(Ve,rt),Ve.of=function(){return this(arguments)},Ve.prototype.toString=function(){return this.__toString("Stack [","]")},Ve.prototype.get=function(t,e){var r=this._head;for(t=l(this,t);r&&t--;)r=r.next;return r?r.value:e},Ve.prototype.peek=function(){return this._head&&this._head.value},Ve.prototype.push=function(){if(0===arguments.length)return this;for(var t=this.size+arguments.length,e=this._head,r=arguments.length-1;r>=0;r--)e={value:arguments[r],next:e};return this.__ownerID?(this.size=t,this._head=e,this.__hash=void 0,this.__altered=!0,this):Qe(t,e)},Ve.prototype.pushAll=function(t){if(t=n(t),0===t.size)return this;ft(t.size);var e=this.size,r=this._head;return t.reverse().forEach(function(t){e++,r={value:t,next:r}}),this.__ownerID?(this.size=e,this._head=r,this.__hash=void 0,this.__altered=!0,this):Qe(e,r)},Ve.prototype.pop=function(){return this.slice(1)},Ve.prototype.unshift=function(){return this.push.apply(this,arguments)},Ve.prototype.unshiftAll=function(t){ -return this.pushAll(t)},Ve.prototype.shift=function(){return this.pop.apply(this,arguments)},Ve.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):Xe()},Ve.prototype.slice=function(t,e){if(d(t,e,this.size))return this;var r=m(t,this.size),n=g(e,this.size);if(n!==this.size)return rt.prototype.slice.call(this,t,e);for(var i=this.size-r,o=this._head;r--;)o=o.next;return this.__ownerID?(this.size=i,this._head=o,this.__hash=void 0,this.__altered=!0,this):Qe(i,o)},Ve.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Qe(this.size,this._head,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)},Ve.prototype.__iterate=function(t,e){if(e)return this.reverse().__iterate(t);for(var r=0,n=this._head;n&&t(n.value,r++,this)!==!1;)n=n.next;return r},Ve.prototype.__iterator=function(t,e){if(e)return this.reverse().__iterator(t);var r=0,n=this._head;return new S(function(){if(n){var e=n.value;return n=n.next,z(t,r++,e)}return I()})},Ve.isStack=Ye;var nn="@@__IMMUTABLE_STACK__@@",on=Ve.prototype;on[nn]=!0,on.withMutations=Cr.withMutations,on.asMutable=Cr.asMutable,on.asImmutable=Cr.asImmutable,on.wasAltered=Cr.wasAltered;var un;e.Iterator=S,Fe(e,{toArray:function(){ft(this.size);var t=Array(this.size||0);return this.valueSeq().__iterate(function(e,r){t[r]=e}),t},toIndexedSeq:function(){return new ie(this)},toJS:function(){return this.toSeq().map(function(t){return t&&"function"==typeof t.toJS?t.toJS():t}).__toJS()},toJSON:function(){return this.toSeq().map(function(t){return t&&"function"==typeof t.toJSON?t.toJSON():t}).__toJS()},toKeyedSeq:function(){return new ne(this,!0)},toMap:function(){return ct(this.toKeyedSeq())},toObject:function(){ft(this.size);var t={};return this.__iterate(function(e,r){t[r]=e}),t},toOrderedMap:function(){return Zt(this.toKeyedSeq())},toOrderedSet:function(){return Je(u(this)?this.valueSeq():this)},toSet:function(){return Le(u(this)?this.valueSeq():this)},toSetSeq:function(){return new oe(this); -},toSeq:function(){return s(this)?this.toIndexedSeq():u(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return Ve(u(this)?this.valueSeq():this)},toList:function(){return Bt(u(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(t,e){return 0===this.size?t+e:t+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+e},concat:function(){var t=sr.call(arguments,0);return be(this,ye(this,t))},includes:function(t){return this.some(function(e){return X(e,t)})},entries:function(){return this.__iterator(Sr)},every:function(t,e){ft(this.size);var r=!0;return this.__iterate(function(n,i,o){return t.call(e,n,i,o)?void 0:(r=!1,!1)}),r},filter:function(t,e){return be(this,fe(this,t,e,!0))},find:function(t,e,r){var n=this.findEntry(t,e);return n?n[1]:r},forEach:function(t,e){return ft(this.size),this.__iterate(e?t.bind(e):t)},join:function(t){ft(this.size),t=void 0!==t?""+t:",";var e="",r=!0;return this.__iterate(function(n){r?r=!1:e+=t,e+=null!==n&&void 0!==n?""+n:""}),e},keys:function(){return this.__iterator(gr)},map:function(t,e){return be(this,ae(this,t,e))},reduce:function(t,e,r){ft(this.size);var n,i;return arguments.length<2?i=!0:n=e,this.__iterate(function(e,o,u){i?(i=!1,n=e):n=t.call(r,n,e,o,u)}),n},reduceRight:function(t,e,r){var n=this.toKeyedSeq().reverse();return n.reduce.apply(n,arguments)},reverse:function(){return be(this,he(this,!0))},slice:function(t,e){return be(this,pe(this,t,e,!0))},some:function(t,e){return!this.every($e(t),e)},sort:function(t){return be(this,we(this,t))},values:function(){return this.__iterator(wr)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some(function(){return!0})},count:function(t,e){return v(t?this.toSeq().filter(t,e):this)},countBy:function(t,e){return ce(this,t,e)},equals:function(t){return F(this,t)},entrySeq:function(){var t=this;if(t._cache)return new j(t._cache);var e=t.toSeq().map(Ze).toIndexedSeq();return e.fromEntrySeq=function(){return t.toSeq()},e},filterNot:function(t,e){ -return this.filter($e(t),e)},findEntry:function(t,e,r){var n=r;return this.__iterate(function(r,i,o){return t.call(e,r,i,o)?(n=[i,r],!1):void 0}),n},findKey:function(t,e){var r=this.findEntry(t,e);return r&&r[0]},findLast:function(t,e,r){return this.toKeyedSeq().reverse().find(t,e,r)},findLastEntry:function(t,e,r){return this.toKeyedSeq().reverse().findEntry(t,e,r)},findLastKey:function(t,e){return this.toKeyedSeq().reverse().findKey(t,e)},first:function(){return this.find(y)},flatMap:function(t,e){return be(this,me(this,t,e))},flatten:function(t){return be(this,de(this,t,!0))},fromEntrySeq:function(){return new ue(this)},get:function(t,e){return this.find(function(e,r){return X(r,t)},void 0,e)},getIn:function(t,e){for(var r,n=this,i=ke(t);!(r=i.next()).done;){var o=r.value;if(n=n&&n.get?n.get(o,yr):yr,n===yr)return e}return n},groupBy:function(t,e){return _e(this,t,e)},has:function(t){return this.get(t,yr)!==yr},hasIn:function(t){return this.getIn(t,yr)!==yr},isSubset:function(t){return t="function"==typeof t.includes?t:e(t),this.every(function(e){return t.includes(e)})},isSuperset:function(t){return t="function"==typeof t.isSubset?t:e(t),t.isSubset(this)},keyOf:function(t){return this.findKey(function(e){return X(e,t)})},keySeq:function(){return this.toSeq().map(Ge).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},lastKeyOf:function(t){return this.toKeyedSeq().reverse().keyOf(t)},max:function(t){return Se(this,t)},maxBy:function(t,e){return Se(this,e,t)},min:function(t){return Se(this,t?tr(t):nr)},minBy:function(t,e){return Se(this,e?tr(e):nr,t)},rest:function(){return this.slice(1)},skip:function(t){return this.slice(Math.max(0,t))},skipLast:function(t){return be(this,this.toSeq().reverse().skip(t).reverse())},skipWhile:function(t,e){return be(this,le(this,t,e,!0))},skipUntil:function(t,e){return this.skipWhile($e(t),e)},sortBy:function(t,e){return be(this,we(this,e,t))},take:function(t){return this.slice(0,Math.max(0,t))},takeLast:function(t){return be(this,this.toSeq().reverse().take(t).reverse()); -},takeWhile:function(t,e){return be(this,ve(this,t,e))},takeUntil:function(t,e){return this.takeWhile($e(t),e)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=ir(this))}});var sn=e.prototype;sn[ar]=!0,sn[br]=sn.values,sn.__toJS=sn.toArray,sn.__toStringMapper=er,sn.inspect=sn.toSource=function(){return""+this},sn.chain=sn.flatMap,sn.contains=sn.includes,Fe(r,{flip:function(){return be(this,se(this))},mapEntries:function(t,e){var r=this,n=0;return be(this,this.toSeq().map(function(i,o){return t.call(e,[o,i],n++,r)}).fromEntrySeq())},mapKeys:function(t,e){var r=this;return be(this,this.toSeq().flip().map(function(n,i){return t.call(e,n,i,r)}).flip())}});var an=r.prototype;an[hr]=!0,an[br]=sn.entries,an.__toJS=sn.toObject,an.__toStringMapper=function(t,e){return JSON.stringify(e)+": "+er(t)},Fe(n,{toKeyedSeq:function(){return new ne(this,!1)},filter:function(t,e){return be(this,fe(this,t,e,!1))},findIndex:function(t,e){var r=this.findEntry(t,e);return r?r[0]:-1},indexOf:function(t){var e=this.keyOf(t);return void 0===e?-1:e},lastIndexOf:function(t){var e=this.lastKeyOf(t);return void 0===e?-1:e},reverse:function(){return be(this,he(this,!1))},slice:function(t,e){return be(this,pe(this,t,e,!1))},splice:function(t,e){var r=arguments.length;if(e=Math.max(0|e,0),0===r||2===r&&!e)return this;t=m(t,0>t?this.count():this.size);var n=this.slice(0,t);return be(this,1===r?n:n.concat(p(arguments,2),this.slice(t+e)))},findLastIndex:function(t,e){var r=this.findLastEntry(t,e);return r?r[0]:-1},first:function(){return this.get(0)},flatten:function(t){return be(this,de(this,t,!1))},get:function(t,e){return t=l(this,t),0>t||this.size===1/0||void 0!==this.size&&t>this.size?e:this.find(function(e,r){return r===t},void 0,e)},has:function(t){return t=l(this,t),t>=0&&(void 0!==this.size?this.size===1/0||this.size>t:-1!==this.indexOf(t))},interpose:function(t){return be(this,ge(this,t))},interleave:function(){var t=[this].concat(p(arguments)),e=Ie(this.toSeq(),k.of,t),r=e.flatten(!0);return e.size&&(r.size=e.size*t.length), -be(this,r)},keySeq:function(){return $(0,this.size)},last:function(){return this.get(-1)},skipWhile:function(t,e){return be(this,le(this,t,e,!1))},zip:function(){var t=[this].concat(p(arguments));return be(this,Ie(this,rr,t))},zipWith:function(t){var e=p(arguments);return e[0]=this,be(this,Ie(this,t,e))}}),n.prototype[fr]=!0,n.prototype[cr]=!0,Fe(i,{get:function(t,e){return this.has(t)?t:e},includes:function(t){return this.has(t)},keySeq:function(){return this.valueSeq()}}),i.prototype.has=sn.includes,i.prototype.contains=i.prototype.includes,Fe(x,r.prototype),Fe(k,n.prototype),Fe(A,i.prototype),Fe(et,r.prototype),Fe(rt,n.prototype),Fe(nt,i.prototype);var hn={Iterable:e,Seq:O,Collection:tt,Map:ct,OrderedMap:Zt,List:Bt,Stack:Ve,Set:Le,OrderedSet:Je,Record:Ae,Range:$,Repeat:G,is:X,fromJS:H};return hn}); \ No newline at end of file diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000000..f75f25580e --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,160 @@ +import pluginJs from '@eslint/js'; +import globals from 'globals'; +import pluginJest from 'eslint-plugin-jest'; +import importPlugin from 'eslint-plugin-import'; +import pluginReact from 'eslint-plugin-react'; +// eslint-disable-next-line import/no-unresolved +import tseslint from 'typescript-eslint'; + +/** @type {import('eslint').Linter.Config[]} */ +export default tseslint.config( + { files: ['**/*.{js,mjs,cjs,ts,jsx,tsx}'] }, + { + ignores: [ + 'npm/', + 'dist/', + 'type-definitions/flow-tests', + 'website/out/', + 'website/.next/', + ], + }, + { + languageOptions: { + globals: globals.browser, + + // parserOptions: { + // projectService: true, + // tsconfigRootDir: import.meta.dirname, + // }, + }, + }, + pluginJs.configs.recommended, + importPlugin.flatConfigs.recommended, + importPlugin.flatConfigs.typescript, + ...tseslint.configs.recommended, + + { + rules: { + eqeqeq: 'error', + 'constructor-super': 'off', + 'no-constructor-return': 'error', + 'no-else-return': 'error', + 'no-lonely-if': 'error', + 'no-object-constructor': 'error', + 'no-prototype-builtins': 'off', + 'no-this-before-super': 'off', + 'no-useless-concat': 'error', + 'no-var': 'error', + 'operator-assignment': 'error', + 'prefer-arrow-callback': 'error', + 'prefer-spread': 'off', + + '@typescript-eslint/no-unused-vars': [ + 'error', + { + argsIgnorePattern: '^_', + }, + ], + }, + }, + + { + files: ['src/*'], + rules: { + 'no-console': 'error', + }, + }, + + { + files: ['website/'], + ...pluginReact.configs.flat.recommended, + ...pluginReact.configs.flat['jsx-runtime'], + + rules: { + 'react/destructuring-assignment': 'off', + 'react/jsx-boolean-value': 'off', + 'react/jsx-curly-brace-presence': 'off', + 'react/jsx-filename-extension': 'off', + 'react/no-array-index-key': 'off', + 'react/no-danger': 'off', + 'react/no-multi-comp': 'off', + 'react/prefer-es6-class': 'off', + 'react/prefer-stateless-function': 'off', + 'react/prop-types': 'off', + 'react/self-closing-comp': 'error', + 'react/sort-comp': 'off', + 'react/jsx-props-no-spreading': 'off', + + 'react/require-default-props': [ + 'error', + { + functions: 'ignore', + }, + ], + + 'jsx-a11y/no-static-element-interactions': 'off', + }, + }, + + { + files: ['type-definitions/ts-tests/*'], + + rules: { + '@typescript-eslint/no-unused-vars': 'off', + + 'import/no-unresolved': [ + 'error', + { + ignore: ['immutable'], + }, + ], + }, + }, + + { + files: ['__tests__/**/*', 'website/**/*.test.ts', 'perf/*'], + languageOptions: { + globals: pluginJest.environments.globals.globals, + }, + ...pluginJest.configs['flat/recommended'], + ...pluginJest.configs['flat/style'], + plugins: { jest: pluginJest }, + rules: { + ...pluginJest.configs['flat/recommended'].rules, + // TODO activate style rules later + // ...pluginJest.configs['jest/style'].rules, + 'jest/expect-expect': [ + 'error', + { + assertFunctionNames: ['expect', 'expectIs', 'expectIsNot'], + additionalTestBlockFunctions: [], + }, + ], + 'import/no-unresolved': [ + 'error', + { + ignore: ['immutable'], + }, + ], + }, + }, + { + files: ['perf/*'], + rules: { + 'jest/expect-expect': 'off', + 'no-redeclare': 'off', + 'no-var': 'off', + 'prefer-arrow-callback': 'off', + }, + }, + { + files: ['resources/*'], + rules: { + 'no-undef': 'off', + 'no-redeclare': 'off', + 'no-var': 'off', + 'prefer-arrow-callback': 'off', + '@typescript-eslint/no-require-imports': 'off', + }, + } +); diff --git a/gulpfile.js b/gulpfile.js deleted file mode 100644 index 5fd7657119..0000000000 --- a/gulpfile.js +++ /dev/null @@ -1,362 +0,0 @@ -require("harmonize")(); - -var browserify = require('browserify'); -var browserSync = require('browser-sync'); -var buffer = require('vinyl-buffer'); -var child_process = require('child_process'); -var concat = require('gulp-concat'); -var del = require('del'); -var filter = require('gulp-filter'); -var fs = require('fs'); -var gulp = require('gulp'); -var gutil = require('gulp-util'); -var header = require('gulp-header'); -var Immutable = require('./'); -var jest = require('gulp-jest'); -var jshint = require('gulp-jshint'); -var less = require('gulp-less'); -var path = require('path'); -var React = require('react/addons'); -var reactTools = require('react-tools'); -var sequence = require('run-sequence'); -var size = require('gulp-size'); -var source = require('vinyl-source-stream'); -var sourcemaps = require('gulp-sourcemaps'); -var stylish = require('jshint-stylish'); -var through = require('through2'); -var uglify = require('gulp-uglify'); -var vm = require('vm'); - - -var SRC_DIR = './pages/src/'; -var BUILD_DIR = './pages/out/'; - -gulp.task('clean', function (done) { - return del([ - BUILD_DIR, - ], {force: true}); -}); - -gulp.task('readme', function() { - var genMarkdownDoc = require('./pages/lib/genMarkdownDoc'); - - var readmePath = path.join(__dirname, './README.md'); - - var fileContents = fs.readFileSync(readmePath, 'utf8'); - - var writePath = path.join(__dirname, './pages/resources/readme.json'); - var contents = JSON.stringify(genMarkdownDoc(fileContents)); - - fs.writeFileSync(writePath, contents); -}); - -gulp.task('typedefs', function() { - var genTypeDefData = require('./pages/lib/genTypeDefData'); - - var typeDefPath = path.join(__dirname, './type-definitions/Immutable.d.ts'); - - var fileContents = fs.readFileSync(typeDefPath, 'utf8'); - - var fileSource = fileContents.replace( - 'module \'immutable\'', - 'module Immutable' - ); - - var writePath = path.join(__dirname, './pages/resources/immutable.d.json'); - var contents = JSON.stringify(genTypeDefData(typeDefPath, fileSource)); - - fs.writeFileSync(writePath, contents); - - var nonAmbientSource = fileContents - .replace( - /declare\s+module\s+Immutable\s*\{/, - '') - .replace( - /\}[\s\n\r]*declare\s+module\s*.immutable.[\s\n\r]*{[\s\n\r]*export\s*=\s*Immutable[\s\n\r]*\}/m, - ''); - var distPath = path.join(__dirname, 'dist'); - try { fs.mkdirSync(distPath); } catch (x) { } - var nonAmbientPath = path.join(distPath, 'immutable-nonambient.d.ts'); - fs.writeFileSync(nonAmbientPath, nonAmbientSource); - -}); - -gulp.task('lint', function() { - return gulp.src('./app/**/*.js') - .pipe(reactTransform()) - .on('error', handleError) - .pipe(jshint({ - asi: true, - browser: true, - curly: false, - eqeqeq: true, - eqnull: true, - esnext: true, - expr: true, - forin: true, - freeze: true, - immed: true, - indent: 2, - iterator: true, - newcap: false, - noarg: true, - node: true, - noempty: true, - nonstandard: true, - trailing: true, - undef: true, - unused: 'vars', - })) - .pipe(jshint.reporter(stylish)) - .pipe(jshint.reporter('fail')) - .on('error', handleError); -}); - -gulp.task('test', function () { - return gulp.src('./') - .pipe(jest({ - scriptPreprocessor: './resources/jestPreprocessor.js', - unmockedModulePathPatterns: ['./node_modules/react'], - })) - .on('error', handleError); -}); - -gulp.task('js', gulpJS('')); -gulp.task('js-docs', gulpJS('docs/')); - -function gulpJS(subDir) { - var reactGlobalModulePath = path.relative( - path.resolve(SRC_DIR+subDir), - path.resolve('./resources/react-global.js') - ); - var immutableGlobalModulePath = path.relative( - path.resolve(SRC_DIR+subDir), - path.resolve('./resources/immutable-global.js') - ); - return function() { - return browserify({ - debug: true, - basedir: SRC_DIR+subDir, - }) - .add('./src/index.js') - .require('./src/index.js') - .require(reactGlobalModulePath, { expose: 'react' }) - .require(immutableGlobalModulePath, { expose: 'immutable' }) - // Helpful when developing with no wifi - // .require('react', { expose: 'react' }) - // .require('immutable', { expose: 'immutable' }) - .transform(reactTransformify) - .bundle() - .on('error', handleError) - .pipe(source('bundle.js')) - .pipe(buffer()) - .pipe(sourcemaps.init({ - loadMaps: true, - })) - .pipe(uglify()) - .pipe(sourcemaps.write('./maps')) - .pipe(gulp.dest(BUILD_DIR+subDir)) - .pipe(filter('**/*.js')) - .pipe(size({ showFiles: true })) - .on('error', handleError); - } -} - -gulp.task('pre-render', gulpPreRender('')); -gulp.task('pre-render-docs', gulpPreRender('docs/')); - -function gulpPreRender(subDir) { - return function () { - return gulp.src(SRC_DIR+subDir+'index.html') - .pipe(preRender(subDir)) - .pipe(size({ showFiles: true })) - .pipe(gulp.dest(BUILD_DIR+subDir)) - .on('error', handleError); - } -} - -gulp.task('less', gulpLess('')); -gulp.task('less-docs', gulpLess('docs/')); - -function gulpLess(subDir) { - return function () { - return gulp.src(SRC_DIR+subDir+'src/*.less') - .pipe(sourcemaps.init()) - .pipe(less({ - compress: true - })) - .on('error', handleError) - .pipe(concat('bundle.css')) - .pipe(sourcemaps.write('./maps')) - .pipe(gulp.dest(BUILD_DIR+subDir)) - .pipe(filter('**/*.css')) - .pipe(size({ showFiles: true })) - .pipe(browserSync.reload({ stream:true })) - .on('error', handleError); - } -} - -gulp.task('statics', gulpStatics('')); -gulp.task('statics-docs', gulpStatics('docs/')); - -function gulpStatics(subDir) { - return function() { - return gulp.src(SRC_DIR+subDir+'static/**/*') - .pipe(gulp.dest(BUILD_DIR+subDir+'static')) - .on('error', handleError) - .pipe(browserSync.reload({ stream:true })) - .on('error', handleError); - } -} - -gulp.task('build', function (done) { - sequence( - ['typedefs'], - ['readme'], - ['js', 'js-docs', 'less', 'less-docs', 'statics', 'statics-docs'], - ['pre-render', 'pre-render-docs'], - done - ); -}); - -gulp.task('default', function (done) { - sequence('clean', 'lint', /*'test',*/ 'build', done); -}); - -// watch files for changes and reload -gulp.task('dev', ['default'], function() { - browserSync({ - port: 8040, - server: { - baseDir: BUILD_DIR - } - }); - - gulp.watch('./app/**/*.less', ['less', 'less-docs']); - gulp.watch('./app/src/**/*.js', ['rebuild-js']); - gulp.watch('./app/docs/src/**/*.js', ['rebuild-js-docs']); - gulp.watch('./app/**/*.html', ['pre-render', 'pre-render-docs']); - gulp.watch('./app/static/**/*', ['statics', 'statics-docs']); -}); - -gulp.task('rebuild-js', function (done) { - sequence('lint', 'js', /*'test',*/ ['pre-render'], function () { - browserSync.reload(); - done(); - }); -}); - -gulp.task('rebuild-js-docs', function (done) { - sequence('lint', 'js-docs', /*'test',*/ ['pre-render-docs'], function () { - browserSync.reload(); - done(); - }); -}); - -function handleError(error) { - gutil.log(error.message); -} - -function preRender(subDir) { - return through.obj(function(file, enc, cb) { - var src = file.contents.toString(enc); - var components = []; - src = src.replace( - //g, - function (_, component) { - var id = 'r' + components.length; - components.push(component); - try { - return ( - '
'+ - vm.runInNewContext( - fs.readFileSync(BUILD_DIR+subDir+'bundle.js') + // ugly - '\nrequire("react").renderToString('+ - 'require("react").createElement(require(component)))', - { - global: { - React: React, - Immutable: Immutable - }, - window: {}, - component: component, - console: console, - } - ) + - '
' - ); - } catch (error) { - return '
' + error.message + '
'; - } - } - ); - if (components.length) { - src = src.replace( - //g, - '' - ); - } - file.contents = new Buffer(src, enc); - this.push(file); - cb(); - }); -} - -function reactTransform() { - var parseError; - return through.obj(function(file, enc, cb) { - if (path.extname(file.path) !== '.js') { - this.push(file); - return cb(); - } - try { - file.contents = new Buffer(reactTools.transform( - file.contents.toString(enc), - {harmony: true} - ), enc); - this.push(file); - cb(); - } catch (error) { - parseError = new gutil.PluginError('transform', { - message: file.relative + ' : ' + error.message, - showStack: false - }); - cb(); - } - }, function (done) { - parseError && this.emit('error', parseError); - done(); - }); -} - - -function reactTransformify(filePath) { - if (path.extname(filePath) !== '.js') { - return through(); - } - var code = ''; - var parseError; - return through.obj(function(file, enc, cb) { - code += file; - cb(); - }, function (done) { - try { - this.push(reactTools.transform(code, {harmony:true})); - } catch (error) { - parseError = new gutil.PluginError('transform', { - message: error.message, - showStack: false - }); - } - parseError && this.emit('error', parseError); - done(); - }); -} diff --git a/jest.config.mjs b/jest.config.mjs new file mode 100644 index 0000000000..4bbd44198b --- /dev/null +++ b/jest.config.mjs @@ -0,0 +1,12 @@ +/** @type {import('jest').Config} */ +const config = { + moduleFileExtensions: ['js', 'ts'], + resolver: '/resources/jestResolver.js', + transform: { + '^.+\\.(js|ts)$': '/resources/jestPreprocessor.js', + }, + testRegex: ['/__tests__/.*\\.(ts|js)$', '/website/.*\\.test\\.(ts|js)$'], + testPathIgnorePatterns: ['/__tests__/ts-utils.ts'], +}; + +export default config; diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000000..8e728752a6 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,19705 @@ +{ + "name": "immutable", + "version": "5.1.2", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "immutable", + "version": "5.1.2", + "license": "MIT", + "devDependencies": { + "@codemirror/commands": "^6.8.1", + "@codemirror/lang-javascript": "^6.2.3", + "@codemirror/state": "^6.5.2", + "@codemirror/theme-one-dark": "^6.1.2", + "@codemirror/view": "^6.36.5", + "@eslint/js": "^9.20.0", + "@jdeniau/immutable-devtools": "^0.2.0", + "@jest/globals": "^29.7.0", + "@rollup/plugin-buble": "1.0.3", + "@rollup/plugin-commonjs": "28.0.2", + "@rollup/plugin-json": "6.1.0", + "@rollup/plugin-terser": "^0.4.4", + "@rollup/plugin-typescript": "^12.1.2", + "@size-limit/esbuild-why": "^11.2.0", + "@size-limit/preset-small-lib": "^11.2.0", + "@types/prismjs": "^1.26.3", + "@types/random-seed": "0.3.5", + "@types/react": "19.1.0", + "benchmark": "2.1.4", + "codemirror": "^6.0.1", + "colors": "1.4.0", + "cpy-cli": "^5.0.0", + "eslint": "^9.20.1", + "eslint-import-resolver-typescript": "^3.7.0", + "eslint-plugin-import": "^2.31.0", + "eslint-plugin-jest": "^28.11.0", + "eslint-plugin-react": "^7.37.4", + "fast-check": "^4.0.0", + "flow-bin": "0.160.0", + "globals": "^15.15.0", + "jest": "^29.0.0", + "jest-environment-jsdom": "^29.6.4", + "jsonml-html": "^1.2.0", + "make-synchronous": "0.1.1", + "marked": "^11.2.0", + "marked-highlight": "^2.1.0", + "microtime": "3.1.1", + "next": "15.2.4", + "next-sitemap": "4.2.3", + "npm-run-all": "4.1.5", + "prettier": "^3.5.0", + "prismjs": "^1.29.0", + "random-seed": "0.3.0", + "react": "19.1.0", + "react-dom": "19.1.0", + "rimraf": "2.7.1", + "rollup": "4.34.8", + "size-limit": "^11.2.0", + "transducers-js": "0.4.174", + "ts-node": "^10.9.2", + "tslib": "^2.8.1", + "tstyche": "^3.5", + "typescript": "5.7", + "typescript-eslint": "^8.24.0" + }, + "engines": { + "npm": ">=7.0.0" + } + }, + "node_modules/@ampproject/remapping": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz", + "integrity": "sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==", + "dev": true, + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.0", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.26.2", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz", + "integrity": "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.25.9", + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.26.8", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.8.tgz", + "integrity": "sha512-oH5UPLMWR3L2wEFLnFJ1TZXqHufiTKAiLfqw5zkhS4dKXLJ10yVztfil/twG8EDTA4F/tvVNw9nOl4ZMslB8rQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.26.8", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.26.8.tgz", + "integrity": "sha512-l+lkXCHS6tQEc5oUpK28xBOZ6+HwaH7YwoYQbLFiYb4nS2/l1tKnZEtEWkD0GuiYdvArf9qBS0XlQGXzPMsNqQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@ampproject/remapping": "^2.2.0", + "@babel/code-frame": "^7.26.2", + "@babel/generator": "^7.26.8", + "@babel/helper-compilation-targets": "^7.26.5", + "@babel/helper-module-transforms": "^7.26.0", + "@babel/helpers": "^7.26.7", + "@babel/parser": "^7.26.8", + "@babel/template": "^7.26.8", + "@babel/traverse": "^7.26.8", + "@babel/types": "^7.26.8", + "@types/gensync": "^1.0.0", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/core/node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@babel/core/node_modules/debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@babel/core/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@babel/generator": { + "version": "7.26.8", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.26.8.tgz", + "integrity": "sha512-ef383X5++iZHWAXX0SXQR6ZyQhw/0KtTkrTz61WXRhFM6dhpHulO/RJz79L8S6ugZHJkOOkUrUdxgdF2YiPFnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.26.8", + "@babel/types": "^7.26.8", + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25", + "jsesc": "^3.0.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.26.5", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.26.5.tgz", + "integrity": "sha512-IXuyn5EkouFJscIDuFF5EsiSolseme1s0CZB+QxVugqJLYmKdxI1VfIBOst0SUu4rnk2Z7kqTwmoO1lp3HIfnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.26.5", + "@babel/helper-validator-option": "^7.25.9", + "browserslist": "^4.24.0", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets/node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/@babel/helper-compilation-targets/node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true, + "license": "ISC" + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.25.9.tgz", + "integrity": "sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.25.9", + "@babel/types": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.26.0.tgz", + "integrity": "sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9", + "@babel/traverse": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-plugin-utils": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz", + "integrity": "sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz", + "integrity": "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", + "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.25.9.tgz", + "integrity": "sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.26.10", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.26.10.tgz", + "integrity": "sha512-UPYc3SauzZ3JGgj87GgZ89JVdC5dj0AoetR5Bw6wj4niittNyFh6+eOGonYvJ1ao6B8lEa3Q3klS7ADZ53bc5g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/template": "^7.26.9", + "@babel/types": "^7.26.10" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.26.10", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.10.tgz", + "integrity": "sha512-6aQR2zGE/QFi8JpDLjUZEPYOs7+mhKXm86VaKFiLP35JQwQb6bwUE+XbvkH0EptsYhbNBSUGaUBLKqxH1xSgsA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.26.10" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-syntax-async-generators": { + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", + "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-bigint": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz", + "integrity": "sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-class-properties": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz", + "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.12.13" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-import-meta": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", + "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-json-strings": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", + "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-jsx": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.22.5.tgz", + "integrity": "sha512-gvyP4hZrgrs/wWMaocvxZ44Hw0b3W8Pe+cMxc8V1ULQ07oh8VNbIRaoD1LRZVTvD+0nieDKjfgKg89sD7rrKrg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-logical-assignment-operators": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", + "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-nullish-coalescing-operator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", + "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-numeric-separator": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", + "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-object-rest-spread": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", + "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-optional-catch-binding": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", + "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-optional-chaining": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", + "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-top-level-await": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", + "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-typescript": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.22.5.tgz", + "integrity": "sha512-1mS2o03i7t1c6VzH6fdQ3OA8tcEIxwG18zIPRp+UY1Ihv6W+XZzBCVxExF9upussPXJ0xE9XRHwMoNs1ep/nRQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/template": { + "version": "7.26.9", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.26.9.tgz", + "integrity": "sha512-qyRplbeIpNZhmzOysF/wFMuP9sctmh2cFzRAZOn1YapxBsE1i9bJIY586R/WBLfLcmcBlM8ROBiQURnnNy+zfA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.26.2", + "@babel/parser": "^7.26.9", + "@babel/types": "^7.26.9" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.26.8", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.26.8.tgz", + "integrity": "sha512-nic9tRkjYH0oB2dzr/JoGIm+4Q6SuYeLEiIiZDwBscRMYFJ+tMAz98fuel9ZnbXViA2I0HVSSRRK8DW5fjXStA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.26.2", + "@babel/generator": "^7.26.8", + "@babel/parser": "^7.26.8", + "@babel/template": "^7.26.8", + "@babel/types": "^7.26.8", + "debug": "^4.3.1", + "globals": "^11.1.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse/node_modules/debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@babel/traverse/node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/traverse/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@babel/types": { + "version": "7.26.10", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.10.tgz", + "integrity": "sha512-emqcG3vHrpxUKTrxcblR36dcrcoRDvKmnL/dCL6ZsHaShW80qxCAcNhzQZrpeM765VzEos+xOi4s+r4IXzTwdQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@bcoe/v8-coverage": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", + "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", + "dev": true + }, + "node_modules/@codemirror/autocomplete": { + "version": "6.18.6", + "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.18.6.tgz", + "integrity": "sha512-PHHBXFomUs5DF+9tCOM/UoW6XQ4R44lLNNhRaW9PKPTU0D7lIjRg3ElxaJnTwsl/oHiR93WSXDBrekhoUGCPtg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@codemirror/language": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.17.0", + "@lezer/common": "^1.0.0" + } + }, + "node_modules/@codemirror/commands": { + "version": "6.8.1", + "resolved": "https://registry.npmjs.org/@codemirror/commands/-/commands-6.8.1.tgz", + "integrity": "sha512-KlGVYufHMQzxbdQONiLyGQDUW0itrLZwq3CcY7xpv9ZLRHqzkBSoteocBHtMCoY7/Ci4xhzSrToIeLg7FxHuaw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@codemirror/language": "^6.0.0", + "@codemirror/state": "^6.4.0", + "@codemirror/view": "^6.27.0", + "@lezer/common": "^1.1.0" + } + }, + "node_modules/@codemirror/lang-javascript": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/@codemirror/lang-javascript/-/lang-javascript-6.2.3.tgz", + "integrity": "sha512-8PR3vIWg7pSu7ur8A07pGiYHgy3hHj+mRYRCSG8q+mPIrl0F02rgpGv+DsQTHRTc30rydOsf5PZ7yjKFg2Ackw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@codemirror/autocomplete": "^6.0.0", + "@codemirror/language": "^6.6.0", + "@codemirror/lint": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.17.0", + "@lezer/common": "^1.0.0", + "@lezer/javascript": "^1.0.0" + } + }, + "node_modules/@codemirror/language": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/@codemirror/language/-/language-6.11.0.tgz", + "integrity": "sha512-A7+f++LodNNc1wGgoRDTt78cOwWm9KVezApgjOMp1W4hM0898nsqBXwF+sbePE7ZRcjN7Sa1Z5m2oN27XkmEjQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.23.0", + "@lezer/common": "^1.1.0", + "@lezer/highlight": "^1.0.0", + "@lezer/lr": "^1.0.0", + "style-mod": "^4.0.0" + } + }, + "node_modules/@codemirror/lint": { + "version": "6.8.5", + "resolved": "https://registry.npmjs.org/@codemirror/lint/-/lint-6.8.5.tgz", + "integrity": "sha512-s3n3KisH7dx3vsoeGMxsbRAgKe4O1vbrnKBClm99PU0fWxmxsx5rR2PfqQgIt+2MMJBHbiJ5rfIdLYfB9NNvsA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.35.0", + "crelt": "^1.0.5" + } + }, + "node_modules/@codemirror/search": { + "version": "6.5.10", + "resolved": "https://registry.npmjs.org/@codemirror/search/-/search-6.5.10.tgz", + "integrity": "sha512-RMdPdmsrUf53pb2VwflKGHEe1XVM07hI7vV2ntgw1dmqhimpatSJKva4VA9h4TLUDOD4EIF02201oZurpnEFsg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0", + "crelt": "^1.0.5" + } + }, + "node_modules/@codemirror/state": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.5.2.tgz", + "integrity": "sha512-FVqsPqtPWKVVL3dPSxy8wEF/ymIEuVzF1PK3VbUgrxXpJUSHQWWZz4JMToquRxnkw+36LTamCZG2iua2Ptq0fA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@marijn/find-cluster-break": "^1.0.0" + } + }, + "node_modules/@codemirror/theme-one-dark": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/@codemirror/theme-one-dark/-/theme-one-dark-6.1.2.tgz", + "integrity": "sha512-F+sH0X16j/qFLMAfbciKTxVOwkdAS336b7AXTKOZhy8BR3eH/RelsnLgLFINrpST63mmN2OuwUt0W2ndUgYwUA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@codemirror/language": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0", + "@lezer/highlight": "^1.0.0" + } + }, + "node_modules/@codemirror/view": { + "version": "6.36.5", + "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.36.5.tgz", + "integrity": "sha512-cd+FZEUlu3GQCYnguYm3EkhJ8KJVisqqUsCOKedBoAt/d9c76JUUap6U0UrpElln5k6VyrEOYliMuDAKIeDQLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@codemirror/state": "^6.5.0", + "style-mod": "^4.1.0", + "w3c-keyname": "^2.2.4" + } + }, + "node_modules/@corex/deepmerge": { + "version": "4.0.43", + "resolved": "https://registry.npmjs.org/@corex/deepmerge/-/deepmerge-4.0.43.tgz", + "integrity": "sha512-N8uEMrMPL0cu/bdboEWpQYb/0i2K5Qn8eCsxzOmxSggJbbQte7ljMRoXm917AbntqTGOzdTu+vP3KOOzoC70HQ==", + "dev": true + }, + "node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "node_modules/@emnapi/runtime": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.4.0.tgz", + "integrity": "sha512-64WYIf4UYcdLnbKn/umDlNjQDSS8AgZrI/R9+x5ilkUVFxXcA1Ebl+gQLc/6mERA4407Xof0R7wEyEuj091CVw==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.1.tgz", + "integrity": "sha512-kfYGy8IdzTGy+z0vFGvExZtxkFlA4zAxgKEahG9KE1ScBjpQnFsNOX8KTU5ojNru5ed5CVoJYXFtoxaq5nFbjQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.1.tgz", + "integrity": "sha512-dp+MshLYux6j/JjdqVLnMglQlFu+MuVeNrmT5nk6q07wNhCdSnB7QZj+7G8VMUGh1q+vj2Bq8kRsuyA00I/k+Q==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.1.tgz", + "integrity": "sha512-50tM0zCJW5kGqgG7fQ7IHvQOcAn9TKiVRuQ/lN0xR+T2lzEFvAi1ZcS8DiksFcEpf1t/GYOeOfCAgDHFpkiSmA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.1.tgz", + "integrity": "sha512-GCj6WfUtNldqUzYkN/ITtlhwQqGWu9S45vUXs7EIYf+7rCiiqH9bCloatO9VhxsL0Pji+PF4Lz2XXCES+Q8hDw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.1.tgz", + "integrity": "sha512-5hEZKPf+nQjYoSr/elb62U19/l1mZDdqidGfmFutVUjjUZrOazAtwK+Kr+3y0C/oeJfLlxo9fXb1w7L+P7E4FQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.1.tgz", + "integrity": "sha512-hxVnwL2Dqs3fM1IWq8Iezh0cX7ZGdVhbTfnOy5uURtao5OIVCEyj9xIzemDi7sRvKsuSdtCAhMKarxqtlyVyfA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.1.tgz", + "integrity": "sha512-1MrCZs0fZa2g8E+FUo2ipw6jw5qqQiH+tERoS5fAfKnRx6NXH31tXBKI3VpmLijLH6yriMZsxJtaXUyFt/8Y4A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.1.tgz", + "integrity": "sha512-0IZWLiTyz7nm0xuIs0q1Y3QWJC52R8aSXxe40VUxm6BB1RNmkODtW6LHvWRrGiICulcX7ZvyH6h5fqdLu4gkww==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.1.tgz", + "integrity": "sha512-NdKOhS4u7JhDKw9G3cY6sWqFcnLITn6SqivVArbzIaf3cemShqfLGHYMx8Xlm/lBit3/5d7kXvriTUGa5YViuQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.1.tgz", + "integrity": "sha512-jaN3dHi0/DDPelk0nLcXRm1q7DNJpjXy7yWaWvbfkPvI+7XNSc/lDOnCLN7gzsyzgu6qSAmgSvP9oXAhP973uQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.1.tgz", + "integrity": "sha512-OJykPaF4v8JidKNGz8c/q1lBO44sQNUQtq1KktJXdBLn1hPod5rE/Hko5ugKKZd+D2+o1a9MFGUEIUwO2YfgkQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.1.tgz", + "integrity": "sha512-nGfornQj4dzcq5Vp835oM/o21UMlXzn79KobKlcs3Wz9smwiifknLy4xDCLUU0BWp7b/houtdrgUz7nOGnfIYg==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.1.tgz", + "integrity": "sha512-1osBbPEFYwIE5IVB/0g2X6i1qInZa1aIoj1TdL4AaAb55xIIgbg8Doq6a5BzYWgr+tEcDzYH67XVnTmUzL+nXg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.1.tgz", + "integrity": "sha512-/6VBJOwUf3TdTvJZ82qF3tbLuWsscd7/1w+D9LH0W/SqUgM5/JJD0lrJ1fVIfZsqB6RFmLCe0Xz3fmZc3WtyVg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.1.tgz", + "integrity": "sha512-nSut/Mx5gnilhcq2yIMLMe3Wl4FK5wx/o0QuuCLMtmJn+WeWYoEGDN1ipcN72g1WHsnIbxGXd4i/MF0gTcuAjQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.1.tgz", + "integrity": "sha512-cEECeLlJNfT8kZHqLarDBQso9a27o2Zd2AQ8USAEoGtejOrCYHNtKP8XQhMDJMtthdF4GBmjR2au3x1udADQQQ==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.1.tgz", + "integrity": "sha512-xbfUhu/gnvSEg+EGovRc+kjBAkrvtk38RlerAzQxvMzlB4fXpCFCeUAYzJvrnhFtdeyVCDANSjJvOvGYoeKzFA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.1.tgz", + "integrity": "sha512-O96poM2XGhLtpTh+s4+nP7YCCAfb4tJNRVZHfIE7dgmax+yMP2WgMd2OecBuaATHKTHsLWHQeuaxMRnCsH8+5g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.1.tgz", + "integrity": "sha512-X53z6uXip6KFXBQ+Krbx25XHV/NCbzryM6ehOAeAil7X7oa4XIq+394PWGnwaSQ2WRA0KI6PUO6hTO5zeF5ijA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.1.tgz", + "integrity": "sha512-Na9T3szbXezdzM/Kfs3GcRQNjHzM6GzFBeU1/6IV/npKP5ORtp9zbQjvkDJ47s6BCgaAZnnnu/cY1x342+MvZg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.1.tgz", + "integrity": "sha512-T3H78X2h1tszfRSf+txbt5aOp/e7TAz3ptVKu9Oyir3IAOFPGV6O9c2naym5TOriy1l0nNf6a4X5UXRZSGX/dw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.1.tgz", + "integrity": "sha512-2H3RUvcmULO7dIE5EWJH8eubZAI4xw54H1ilJnRNZdeo8dTADEZ21w6J22XBkXqGJbe0+wnNJtw3UXRoLJnFEg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.1.tgz", + "integrity": "sha512-GE7XvrdOzrb+yVKB9KsRMq+7a2U/K5Cf/8grVFRAGJmfADr/e/ODQ134RK2/eeHqYV5eQRFxb1hY7Nr15fv1NQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.1.tgz", + "integrity": "sha512-uOxSJCIcavSiT6UnBhBzE8wy3n0hOkJsBOzy7HDAuTDE++1DJMRRVCPGisULScHL+a/ZwdXPpXD3IyFKjA7K8A==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.1.tgz", + "integrity": "sha512-Y1EQdcfwMSeQN/ujR5VayLOJ1BHaK+ssyk0AEzPjC+t1lITgsnccPqFjb6V+LsTp/9Iov4ysfjxLaGJ9RPtkVg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.1.tgz", + "integrity": "sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", + "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/config-array": { + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.19.2.tgz", + "integrity": "sha512-GNKqxfHG2ySmJOBSHg7LxeUx4xpuCoFjacmlCoYWEbaPXLwvfIjixRI12xCQZeULksQb23uiA8F40w5TojpV7w==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/object-schema": "^2.1.6", + "debug": "^4.3.1", + "minimatch": "^3.1.2" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/config-array/node_modules/debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@eslint/config-array/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@eslint/core": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.11.0.tgz", + "integrity": "sha512-DWUB2pksgNEb6Bz2fggIy1wh6fGgZP4Xyy/Mt0QZPiloKKXerbqq9D3SBQTlCRYOrcRPu4vuz+CGjwdfqxnoWA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@types/json-schema": "^7.0.15" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.2.0.tgz", + "integrity": "sha512-grOjVNN8P3hjJn/eIETF1wwd12DdnwFDoyceUJLYYdkpbwq3nLi+4fqrTAONx7XDALqlL220wC/RHSC/QTI/0w==", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^10.0.1", + "globals": "^14.0.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "license": "Python-2.0" + }, + "node_modules/@eslint/eslintrc/node_modules/debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@eslint/eslintrc/node_modules/globals": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@eslint/eslintrc/node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/@eslint/eslintrc/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@eslint/js": { + "version": "9.20.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.20.0.tgz", + "integrity": "sha512-iZA07H9io9Wn836aVTytRaNqh00Sad+EamwOVJT12GTLw1VGMFV/4JaME+JjLtr9fiGaoWgYnS54wrfWsSs4oQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/object-schema": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.6.tgz", + "integrity": "sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/plugin-kit": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.5.tgz", + "integrity": "sha512-lB05FkqEdUg2AA0xEbUz0SnkXT1LcCTa438W4IWTUh4hdOnVbQyOJ81OrDXsJk/LSiJHubgGEFoR5EHq1NsH1A==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^0.10.0", + "levn": "^0.4.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/plugin-kit/node_modules/@eslint/core": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.10.0.tgz", + "integrity": "sha512-gFHJ+xBOo4G3WRlR1e/3G8A6/KZAH6zcE/hkLRCZTi/B9avAG365QhFA8uOGzTMqgTghpn7/fSnscW++dpMSAw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@types/json-schema": "^7.0.15" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@humanfs/core": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", + "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node": { + "version": "0.16.6", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.6.tgz", + "integrity": "sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanfs/core": "^0.19.1", + "@humanwhocodes/retry": "^0.3.0" + }, + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node/node_modules/@humanwhocodes/retry": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.1.tgz", + "integrity": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/retry": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.1.tgz", + "integrity": "sha512-c7hNEllBlenFTHBky65mhq8WD2kbN9Q6gk0bTk8lSBvc554jpXSkST1iePudpt7+A/AQvuHs9EMqjHDXMY1lrA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@img/sharp-darwin-arm64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.33.5.tgz", + "integrity": "sha512-UT4p+iz/2H4twwAoLCqfA9UH5pI6DggwKEGuaPy7nCVQ8ZsiY5PIcrRvD1DzuY3qYL07NtIQcWnBSY/heikIFQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-arm64": "1.0.4" + } + }, + "node_modules/@img/sharp-darwin-x64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.33.5.tgz", + "integrity": "sha512-fyHac4jIc1ANYGRDxtiqelIbdWkIuQaI84Mv45KvGRRxSAa7o7d1ZKAOBaYbnepLC1WqxfpimdeWfvqqSGwR2Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-x64": "1.0.4" + } + }, + "node_modules/@img/sharp-libvips-darwin-arm64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.0.4.tgz", + "integrity": "sha512-XblONe153h0O2zuFfTAbQYAX2JhYmDHeWikp1LM9Hul9gVPjFY427k6dFEcOL72O01QxQsWi761svJ/ev9xEDg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "darwin" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-darwin-x64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.0.4.tgz", + "integrity": "sha512-xnGR8YuZYfJGmWPvmlunFaWJsb9T/AO2ykoP3Fz/0X5XV2aoYBPkX6xqCQvUTKKiLddarLaxpzNe+b1hjeWHAQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "darwin" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.0.5.tgz", + "integrity": "sha512-gvcC4ACAOPRNATg/ov8/MnbxFDJqf/pDePbBnuBDcjsI8PssmjoKMAz4LtLaVi+OnSb5FK/yIOamqDwGmXW32g==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.0.4.tgz", + "integrity": "sha512-9B+taZ8DlyyqzZQnoeIvDVR/2F4EbMepXMc/NdVbkzsJbzkUjhXv/70GQJ7tdLA4YJgNP25zukcxpX2/SueNrA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-s390x": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.0.4.tgz", + "integrity": "sha512-u7Wz6ntiSSgGSGcjZ55im6uvTrOxSIS8/dgoVMoiGE9I6JAfU50yH5BoDlYA1tcuGS7g/QNtetJnxA6QEsCVTA==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-x64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.0.4.tgz", + "integrity": "sha512-MmWmQ3iPFZr0Iev+BAgVMb3ZyC4KeFc3jFxnNbEPas60e1cIfevbtuyf9nDGIzOaW9PdnDciJm+wFFaTlj5xYw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-arm64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.0.4.tgz", + "integrity": "sha512-9Ti+BbTYDcsbp4wfYib8Ctm1ilkugkA/uscUn6UXK1ldpC1JjiXbLfFZtRlBhjPZ5o1NCLiDbg8fhUPKStHoTA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-x64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.0.4.tgz", + "integrity": "sha512-viYN1KX9m+/hGkJtvYYp+CCLgnJXwiQB39damAO7WMdKWlIhmYTfHjwSbQeUK/20vY154mwezd9HflVFM1wVSw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-linux-arm": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.33.5.tgz", + "integrity": "sha512-JTS1eldqZbJxjvKaAkxhZmBqPRGmxgu+qFKSInv8moZ2AmT5Yib3EQ1c6gp493HvrvV8QgdOXdyaIBrhvFhBMQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm": "1.0.5" + } + }, + "node_modules/@img/sharp-linux-arm64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.33.5.tgz", + "integrity": "sha512-JMVv+AMRyGOHtO1RFBiJy/MBsgz0x4AWrT6QoEVVTyh1E39TrCUpTRI7mx9VksGX4awWASxqCYLCV4wBZHAYxA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm64": "1.0.4" + } + }, + "node_modules/@img/sharp-linux-s390x": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.33.5.tgz", + "integrity": "sha512-y/5PCd+mP4CA/sPDKl2961b+C9d+vPAveS33s6Z3zfASk2j5upL6fXVPZi7ztePZ5CuH+1kW8JtvxgbuXHRa4Q==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-s390x": "1.0.4" + } + }, + "node_modules/@img/sharp-linux-x64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.33.5.tgz", + "integrity": "sha512-opC+Ok5pRNAzuvq1AG0ar+1owsu842/Ab+4qvU879ippJBHvyY5n2mxF1izXqkPYlGuP/M556uh53jRLJmzTWA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-x64": "1.0.4" + } + }, + "node_modules/@img/sharp-linuxmusl-arm64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.33.5.tgz", + "integrity": "sha512-XrHMZwGQGvJg2V/oRSUfSAfjfPxO+4DkiRh6p2AFjLQztWUuY/o8Mq0eMQVIY7HJ1CDQUJlxGGZRw1a5bqmd1g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-arm64": "1.0.4" + } + }, + "node_modules/@img/sharp-linuxmusl-x64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.33.5.tgz", + "integrity": "sha512-WT+d/cgqKkkKySYmqoZ8y3pxx7lx9vVejxW/W4DOFMYVSkErR+w7mf2u8m/y4+xHe7yY9DAXQMWQhpnMuFfScw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-x64": "1.0.4" + } + }, + "node_modules/@img/sharp-wasm32": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.33.5.tgz", + "integrity": "sha512-ykUW4LVGaMcU9lu9thv85CbRMAwfeadCJHRsg2GmeRa/cJxsVY9Rbd57JcMxBkKHag5U/x7TSBpScF4U8ElVzg==", + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT", + "optional": true, + "dependencies": { + "@emnapi/runtime": "^1.2.0" + }, + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-ia32": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.33.5.tgz", + "integrity": "sha512-T36PblLaTwuVJ/zw/LaH0PdZkRz5rd3SmMHX8GSmR7vtNSP5Z6bQkExdSK7xGWyxLw4sUknBuugTelgw2faBbQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-x64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.33.5.tgz", + "integrity": "sha512-MpY/o8/8kj+EcnxwvrP4aTJSWw/aZ7JIGR4aBeZkZw5B7/Jn+tY9/VNwtcoGmdT7GfggGIU4kygOMSbYnOrAbg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@istanbuljs/load-nyc-config": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", + "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", + "dev": true, + "dependencies": { + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "get-package-type": "^0.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@jdeniau/immutable-devtools": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@jdeniau/immutable-devtools/-/immutable-devtools-0.2.0.tgz", + "integrity": "sha512-kncZLhyszWkGz0wAr8eoHFvhczuZz5Ud71OiLIhe5PFQ05nnLgsFdr520Qy+eHhMSL6roJYFrZ73ZJTv48/fUg==", + "dev": true, + "license": "BSD" + }, + "node_modules/@jest/console": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.6.4.tgz", + "integrity": "sha512-wNK6gC0Ha9QeEPSkeJedQuTQqxZYnDPuDcDhVuVatRvMkL4D0VTvFVZj+Yuh6caG2aOfzkUZ36KtCmLNtR02hw==", + "dev": true, + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "jest-message-util": "^29.6.3", + "jest-util": "^29.6.3", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/core": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.6.4.tgz", + "integrity": "sha512-U/vq5ccNTSVgYH7mHnodHmCffGWHJnz/E1BEWlLuK5pM4FZmGfBn/nrJGLjUsSmyx3otCeqc1T31F4y08AMDLg==", + "dev": true, + "dependencies": { + "@jest/console": "^29.6.4", + "@jest/reporters": "^29.6.4", + "@jest/test-result": "^29.6.4", + "@jest/transform": "^29.6.4", + "@jest/types": "^29.6.3", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "jest-changed-files": "^29.6.3", + "jest-config": "^29.6.4", + "jest-haste-map": "^29.6.4", + "jest-message-util": "^29.6.3", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.6.4", + "jest-resolve-dependencies": "^29.6.4", + "jest-runner": "^29.6.4", + "jest-runtime": "^29.6.4", + "jest-snapshot": "^29.6.4", + "jest-util": "^29.6.3", + "jest-validate": "^29.6.3", + "jest-watcher": "^29.6.4", + "micromatch": "^4.0.4", + "pretty-format": "^29.6.3", + "slash": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/@jest/environment": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz", + "integrity": "sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-mock": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/expect": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "expect": "^29.7.0", + "jest-snapshot": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/expect-utils": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.7.0.tgz", + "integrity": "sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==", + "dev": true, + "license": "MIT", + "dependencies": { + "jest-get-type": "^29.6.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/fake-timers": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.7.0.tgz", + "integrity": "sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@sinonjs/fake-timers": "^10.0.2", + "@types/node": "*", + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/globals": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.7.0.tgz", + "integrity": "sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/types": "^29.6.3", + "jest-mock": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/reporters": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.6.4.tgz", + "integrity": "sha512-sxUjWxm7QdchdrD3NfWKrL8FBsortZeibSJv4XLjESOOjSUOkjQcb0ZHJwfhEGIvBvTluTzfG2yZWZhkrXJu8g==", + "dev": true, + "dependencies": { + "@bcoe/v8-coverage": "^0.2.3", + "@jest/console": "^29.6.4", + "@jest/test-result": "^29.6.4", + "@jest/transform": "^29.6.4", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", + "@types/node": "*", + "chalk": "^4.0.0", + "collect-v8-coverage": "^1.0.0", + "exit": "^0.1.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-instrument": "^6.0.0", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.1.3", + "jest-message-util": "^29.6.3", + "jest-util": "^29.6.3", + "jest-worker": "^29.6.4", + "slash": "^3.0.0", + "string-length": "^4.0.1", + "strip-ansi": "^6.0.0", + "v8-to-istanbul": "^9.0.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/@jest/reporters/node_modules/istanbul-lib-instrument": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.3.tgz", + "integrity": "sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@babel/core": "^7.23.9", + "@babel/parser": "^7.23.9", + "@istanbuljs/schema": "^0.1.3", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^7.5.4" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@jest/reporters/node_modules/semver": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@jest/schemas": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", + "dev": true, + "dependencies": { + "@sinclair/typebox": "^0.27.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/source-map": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.3.tgz", + "integrity": "sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.18", + "callsites": "^3.0.0", + "graceful-fs": "^4.2.9" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/test-result": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.6.4.tgz", + "integrity": "sha512-uQ1C0AUEN90/dsyEirgMLlouROgSY+Wc/JanVVk0OiUKa5UFh7sJpMEM3aoUBAz2BRNvUJ8j3d294WFuRxSyOQ==", + "dev": true, + "dependencies": { + "@jest/console": "^29.6.4", + "@jest/types": "^29.6.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "collect-v8-coverage": "^1.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/test-sequencer": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.6.4.tgz", + "integrity": "sha512-E84M6LbpcRq3fT4ckfKs9ryVanwkaIB0Ws9bw3/yP4seRLg/VaCZ/LgW0MCq5wwk4/iP/qnilD41aj2fsw2RMg==", + "dev": true, + "dependencies": { + "@jest/test-result": "^29.6.4", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.6.4", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/transform": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz", + "integrity": "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.11.6", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", + "babel-plugin-istanbul": "^6.1.1", + "chalk": "^4.0.0", + "convert-source-map": "^2.0.0", + "fast-json-stable-stringify": "^2.1.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "micromatch": "^4.0.4", + "pirates": "^4.0.4", + "slash": "^3.0.0", + "write-file-atomic": "^4.0.2" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/transform/node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true + }, + "node_modules/@jest/types": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", + "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", + "dev": true, + "dependencies": { + "@jest/schemas": "^29.6.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^17.0.8", + "chalk": "^4.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz", + "integrity": "sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/set-array": "^1.2.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", + "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/source-map": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.5.tgz", + "integrity": "sha512-UTYAUj/wviwdsMfzoSJspJxbkH5o1snzwX0//0ENX1u/55kkZZkcTZP6u9bwKGkv+dkk9at4m1Cpt0uY80kcpQ==", + "dev": true, + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.0", + "@jridgewell/trace-mapping": "^0.3.9" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@lezer/common": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.2.3.tgz", + "integrity": "sha512-w7ojc8ejBqr2REPsWxJjrMFsA/ysDCFICn8zEOR9mrqzOu2amhITYuLD8ag6XZf0CFXDrhKqw7+tW8cX66NaDA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@lezer/highlight": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@lezer/highlight/-/highlight-1.2.1.tgz", + "integrity": "sha512-Z5duk4RN/3zuVO7Jq0pGLJ3qynpxUVsh7IbUbGj88+uV2ApSAn6kWg2au3iJb+0Zi7kKtqffIESgNcRXWZWmSA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@lezer/common": "^1.0.0" + } + }, + "node_modules/@lezer/javascript": { + "version": "1.4.21", + "resolved": "https://registry.npmjs.org/@lezer/javascript/-/javascript-1.4.21.tgz", + "integrity": "sha512-lL+1fcuxWYPURMM/oFZLEDm0XuLN128QPV+VuGtKpeaOGdcl9F2LYC3nh1S9LkPqx9M0mndZFdXCipNAZpzIkQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@lezer/common": "^1.2.0", + "@lezer/highlight": "^1.1.3", + "@lezer/lr": "^1.3.0" + } + }, + "node_modules/@lezer/lr": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/@lezer/lr/-/lr-1.4.2.tgz", + "integrity": "sha512-pu0K1jCIdnQ12aWNaAVU5bzi7Bd1w54J3ECgANPmYLtQKP0HBj2cE/5coBD66MT10xbtIuUr7tg0Shbsvk0mDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@lezer/common": "^1.0.0" + } + }, + "node_modules/@marijn/find-cluster-break": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@marijn/find-cluster-break/-/find-cluster-break-1.0.2.tgz", + "integrity": "sha512-l0h88YhZFyKdXIFNfSWpyjStDjGHwZ/U7iobcK1cQQD8sejsONdQtTVU+1wVN1PBw40PiiHB1vA5S7VTfQiP9g==", + "dev": true, + "license": "MIT" + }, + "node_modules/@next/env": { + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/@next/env/-/env-15.2.4.tgz", + "integrity": "sha512-+SFtMgoiYP3WoSswuNmxJOCwi06TdWE733D+WPjpXIe4LXGULwEaofiiAy6kbS0+XjM5xF5n3lKuBwN2SnqD9g==", + "dev": true, + "license": "MIT" + }, + "node_modules/@next/swc-darwin-arm64": { + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-15.2.4.tgz", + "integrity": "sha512-1AnMfs655ipJEDC/FHkSr0r3lXBgpqKo4K1kiwfUf3iE68rDFXZ1TtHdMvf7D0hMItgDZ7Vuq3JgNMbt/+3bYw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-darwin-x64": { + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-15.2.4.tgz", + "integrity": "sha512-3qK2zb5EwCwxnO2HeO+TRqCubeI/NgCe+kL5dTJlPldV/uwCnUgC7VbEzgmxbfrkbjehL4H9BPztWOEtsoMwew==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-arm64-gnu": { + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-15.2.4.tgz", + "integrity": "sha512-HFN6GKUcrTWvem8AZN7tT95zPb0GUGv9v0d0iyuTb303vbXkkbHDp/DxufB04jNVD+IN9yHy7y/6Mqq0h0YVaQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-arm64-musl": { + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-15.2.4.tgz", + "integrity": "sha512-Oioa0SORWLwi35/kVB8aCk5Uq+5/ZIumMK1kJV+jSdazFm2NzPDztsefzdmzzpx5oGCJ6FkUC7vkaUseNTStNA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-x64-gnu": { + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-15.2.4.tgz", + "integrity": "sha512-yb5WTRaHdkgOqFOZiu6rHV1fAEK0flVpaIN2HB6kxHVSy/dIajWbThS7qON3W9/SNOH2JWkVCyulgGYekMePuw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-x64-musl": { + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-15.2.4.tgz", + "integrity": "sha512-Dcdv/ix6srhkM25fgXiyOieFUkz+fOYkHlydWCtB0xMST6X9XYI3yPDKBZt1xuhOytONsIFJFB08xXYsxUwJLw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-win32-arm64-msvc": { + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-15.2.4.tgz", + "integrity": "sha512-dW0i7eukvDxtIhCYkMrZNQfNicPDExt2jPb9AZPpL7cfyUo7QSNl1DjsHjmmKp6qNAqUESyT8YFl/Aw91cNJJg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-win32-x64-msvc": { + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-15.2.4.tgz", + "integrity": "sha512-SbnWkJmkS7Xl3kre8SdMF6F/XDh1DTFEhp0jRTj/uB8iPKoU2bb2NDfcu+iifv1+mxQEd1g2vvSxcZbXSKyWiQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nolyfill/is-core-module": { + "version": "1.0.39", + "resolved": "https://registry.npmjs.org/@nolyfill/is-core-module/-/is-core-module-1.0.39.tgz", + "integrity": "sha512-nn5ozdjYQpUCZlWGuxcJY/KpxkWQs4DcbMCmKojjyrYDEAGy4Ce19NN4v5MduafTwJlbKc99UA8YhSVqq9yPZA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.4.0" + } + }, + "node_modules/@rollup/plugin-buble": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@rollup/plugin-buble/-/plugin-buble-1.0.3.tgz", + "integrity": "sha512-QYD9BKkJoof0FdCFeSYYhF6/Y8e0Mnf+098xGgmWOFJ4UPHlWujjqOYeVwEm2hJPOmlR5k7HPUdAjqtOWhN64Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rollup/pluginutils": "^5.0.1", + "@types/buble": "^0.19.2", + "buble": "^0.20.0" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/plugin-buble/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@rollup/plugin-buble/node_modules/buble": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/buble/-/buble-0.20.0.tgz", + "integrity": "sha512-/1gnaMQE8xvd5qsNBl+iTuyjJ9XxeaVxAMF86dQ4EyxFJOZtsgOS8Ra+7WHgZTam5IFDtt4BguN0sH0tVTKrOw==", + "dev": true, + "dependencies": { + "acorn": "^6.4.1", + "acorn-dynamic-import": "^4.0.0", + "acorn-jsx": "^5.2.0", + "chalk": "^2.4.2", + "magic-string": "^0.25.7", + "minimist": "^1.2.5", + "regexpu-core": "4.5.4" + }, + "bin": { + "buble": "bin/buble" + } + }, + "node_modules/@rollup/plugin-buble/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@rollup/plugin-buble/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/@rollup/plugin-buble/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "node_modules/@rollup/plugin-buble/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/@rollup/plugin-buble/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/@rollup/plugin-buble/node_modules/regexpu-core": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.5.4.tgz", + "integrity": "sha512-BtizvGtFQKGPUcTy56o3nk1bGRp4SZOTYrDtGNlqCQufptV5IkkLN6Emw+yunAJjzf+C9FQFtvq7IoA3+oMYHQ==", + "dev": true, + "dependencies": { + "regenerate": "^1.4.0", + "regenerate-unicode-properties": "^8.0.2", + "regjsgen": "^0.5.0", + "regjsparser": "^0.6.0", + "unicode-match-property-ecmascript": "^1.0.4", + "unicode-match-property-value-ecmascript": "^1.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@rollup/plugin-buble/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@rollup/plugin-commonjs": { + "version": "28.0.2", + "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-28.0.2.tgz", + "integrity": "sha512-BEFI2EDqzl+vA1rl97IDRZ61AIwGH093d9nz8+dThxJNH8oSoB7MjWvPCX3dkaK1/RCJ/1v/R1XB15FuSs0fQw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rollup/pluginutils": "^5.0.1", + "commondir": "^1.0.1", + "estree-walker": "^2.0.2", + "fdir": "^6.2.0", + "is-reference": "1.2.1", + "magic-string": "^0.30.3", + "picomatch": "^4.0.2" + }, + "engines": { + "node": ">=16.0.0 || 14 >= 14.17" + }, + "peerDependencies": { + "rollup": "^2.68.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/plugin-commonjs/node_modules/fdir": { + "version": "6.4.3", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.3.tgz", + "integrity": "sha512-PMXmW2y1hDDfTSRc9gaXIuCCRpuoz3Kaz8cUelp3smouvfT632ozg2vrT6lJsHKKOF59YLbOGfAWGUcKEfRMQw==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/@rollup/plugin-commonjs/node_modules/magic-string": { + "version": "0.30.17", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.17.tgz", + "integrity": "sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0" + } + }, + "node_modules/@rollup/plugin-commonjs/node_modules/picomatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/@rollup/plugin-json": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-json/-/plugin-json-6.1.0.tgz", + "integrity": "sha512-EGI2te5ENk1coGeADSIwZ7G2Q8CJS2sF120T7jLw4xFw9n7wIOXHo+kIYRAoVpJAN+kmqZSoO3Fp4JtoNF4ReA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rollup/pluginutils": "^5.1.0" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/plugin-terser": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/@rollup/plugin-terser/-/plugin-terser-0.4.4.tgz", + "integrity": "sha512-XHeJC5Bgvs8LfukDwWZp7yeqin6ns8RTl2B9avbejt6tZqsqvVoWI7ZTQrcNsfKEDWBTnTxM8nMDkO2IFFbd0A==", + "dev": true, + "license": "MIT", + "dependencies": { + "serialize-javascript": "^6.0.1", + "smob": "^1.0.0", + "terser": "^5.17.4" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^2.0.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/plugin-typescript": { + "version": "12.1.2", + "resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-12.1.2.tgz", + "integrity": "sha512-cdtSp154H5sv637uMr1a8OTWB0L1SWDSm1rDGiyfcGcvQ6cuTs4MDk2BVEBGysUWago4OJN4EQZqOTl/QY3Jgg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rollup/pluginutils": "^5.1.0", + "resolve": "^1.22.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^2.14.0||^3.0.0||^4.0.0", + "tslib": "*", + "typescript": ">=3.7.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + }, + "tslib": { + "optional": true + } + } + }, + "node_modules/@rollup/pluginutils": { + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.4.tgz", + "integrity": "sha512-USm05zrsFxYLPdWWq+K3STlWiT/3ELn3RcV5hJMghpeAIhxfsUIg6mt12CBJBInWMV4VneoV7SfGv8xIwo2qNQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "estree-walker": "^2.0.2", + "picomatch": "^4.0.2" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/pluginutils/node_modules/picomatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.34.8.tgz", + "integrity": "sha512-q217OSE8DTp8AFHuNHXo0Y86e1wtlfVrXiAlwkIvGRQv9zbc6mE3sjIVfwI8sYUyNxwOg0j/Vm1RKM04JcWLJw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.34.8.tgz", + "integrity": "sha512-Gigjz7mNWaOL9wCggvoK3jEIUUbGul656opstjaUSGC3eT0BM7PofdAJaBfPFWWkXNVAXbaQtC99OCg4sJv70Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.34.8.tgz", + "integrity": "sha512-02rVdZ5tgdUNRxIUrFdcMBZQoaPMrxtwSb+/hOfBdqkatYHR3lZ2A2EGyHq2sGOd0Owk80oV3snlDASC24He3Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.34.8.tgz", + "integrity": "sha512-qIP/elwR/tq/dYRx3lgwK31jkZvMiD6qUtOycLhTzCvrjbZ3LjQnEM9rNhSGpbLXVJYQ3rq39A6Re0h9tU2ynw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.34.8.tgz", + "integrity": "sha512-IQNVXL9iY6NniYbTaOKdrlVP3XIqazBgJOVkddzJlqnCpRi/yAeSOa8PLcECFSQochzqApIOE1GHNu3pCz+BDA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.34.8.tgz", + "integrity": "sha512-TYXcHghgnCqYFiE3FT5QwXtOZqDj5GmaFNTNt3jNC+vh22dc/ukG2cG+pi75QO4kACohZzidsq7yKTKwq/Jq7Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.34.8.tgz", + "integrity": "sha512-A4iphFGNkWRd+5m3VIGuqHnG3MVnqKe7Al57u9mwgbyZ2/xF9Jio72MaY7xxh+Y87VAHmGQr73qoKL9HPbXj1g==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.34.8.tgz", + "integrity": "sha512-S0lqKLfTm5u+QTxlFiAnb2J/2dgQqRy/XvziPtDd1rKZFXHTyYLoVL58M/XFwDI01AQCDIevGLbQrMAtdyanpA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.34.8.tgz", + "integrity": "sha512-jpz9YOuPiSkL4G4pqKrus0pn9aYwpImGkosRKwNi+sJSkz+WU3anZe6hi73StLOQdfXYXC7hUfsQlTnjMd3s1A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.34.8.tgz", + "integrity": "sha512-KdSfaROOUJXgTVxJNAZ3KwkRc5nggDk+06P6lgi1HLv1hskgvxHUKZ4xtwHkVYJ1Rep4GNo+uEfycCRRxht7+Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loongarch64-gnu": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.34.8.tgz", + "integrity": "sha512-NyF4gcxwkMFRjgXBM6g2lkT58OWztZvw5KkV2K0qqSnUEqCVcqdh2jN4gQrTn/YUpAcNKyFHfoOZEer9nwo6uQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.34.8.tgz", + "integrity": "sha512-LMJc999GkhGvktHU85zNTDImZVUCJ1z/MbAJTnviiWmmjyckP5aQsHtcujMjpNdMZPT2rQEDBlJfubhs3jsMfw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.34.8.tgz", + "integrity": "sha512-xAQCAHPj8nJq1PI3z8CIZzXuXCstquz7cIOL73HHdXiRcKk8Ywwqtx2wrIy23EcTn4aZ2fLJNBB8d0tQENPCmw==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.34.8.tgz", + "integrity": "sha512-DdePVk1NDEuc3fOe3dPPTb+rjMtuFw89gw6gVWxQFAuEqqSdDKnrwzZHrUYdac7A7dXl9Q2Vflxpme15gUWQFA==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.34.8.tgz", + "integrity": "sha512-8y7ED8gjxITUltTUEJLQdgpbPh1sUQ0kMTmufRF/Ns5tI9TNMNlhWtmPKKHCU0SilX+3MJkZ0zERYYGIVBYHIA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.34.8.tgz", + "integrity": "sha512-SCXcP0ZpGFIe7Ge+McxY5zKxiEI5ra+GT3QRxL0pMMtxPfpyLAKleZODi1zdRHkz5/BhueUrYtYVgubqe9JBNQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.34.8.tgz", + "integrity": "sha512-YHYsgzZgFJzTRbth4h7Or0m5O74Yda+hLin0irAIobkLQFRQd1qWmnoVfwmKm9TXIZVAD0nZ+GEb2ICicLyCnQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.34.8.tgz", + "integrity": "sha512-r3NRQrXkHr4uWy5TOjTpTYojR9XmF0j/RYgKCef+Ag46FWUTltm5ziticv8LdNsDMehjJ543x/+TJAek/xBA2w==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.34.8.tgz", + "integrity": "sha512-U0FaE5O1BCpZSeE6gBl3c5ObhePQSfk9vDRToMmTkbhCOgW4jqvtS5LGyQ76L1fH8sM0keRp4uDTsbjiUyjk0g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rtsao/scc": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@rtsao/scc/-/scc-1.1.0.tgz", + "integrity": "sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==", + "dev": true, + "license": "MIT" + }, + "node_modules/@sinclair/typebox": { + "version": "0.27.8", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", + "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "dev": true + }, + "node_modules/@sinonjs/commons": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.0.tgz", + "integrity": "sha512-jXBtWAF4vmdNmZgD5FoKsVLv3rPgDnLgPbU84LIJ3otV44vJlDRokVng5v8NFJdCf/da9legHcKaRuZs4L7faA==", + "dev": true, + "dependencies": { + "type-detect": "4.0.8" + } + }, + "node_modules/@sinonjs/fake-timers": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz", + "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==", + "dev": true, + "dependencies": { + "@sinonjs/commons": "^3.0.0" + } + }, + "node_modules/@size-limit/esbuild-why": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/@size-limit/esbuild-why/-/esbuild-why-11.2.0.tgz", + "integrity": "sha512-VtoQbbkvFbF314LWEaEp1+IjG0DH+9w6nP//D6Gd48SEAPLoBgqk287mjYTF9WYxg9N5lo8KjpXxEFk4gOXNpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild-visualizer": "^0.7.0", + "open": "^10.1.0" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "peerDependencies": { + "size-limit": "11.2.0" + } + }, + "node_modules/@size-limit/preset-small-lib": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/@size-limit/preset-small-lib/-/preset-small-lib-11.2.0.tgz", + "integrity": "sha512-RFbbIVfv8/QDgTPyXzjo5NKO6CYyK5Uq5xtNLHLbw5RgSKrgo8WpiB/fNivZuNd/5Wk0s91PtaJ9ThNcnFuI3g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@size-limit/esbuild": "11.2.0", + "@size-limit/file": "11.2.0", + "size-limit": "11.2.0" + }, + "peerDependencies": { + "size-limit": "11.2.0" + } + }, + "node_modules/@size-limit/preset-small-lib/node_modules/@size-limit/esbuild": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/@size-limit/esbuild/-/esbuild-11.2.0.tgz", + "integrity": "sha512-vSg9H0WxGQPRzDnBzeDyD9XT0Zdq0L+AI3+77/JhxznbSCMJMMr8ndaWVQRhOsixl97N0oD4pRFw2+R1Lcvi6A==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "^0.25.0", + "nanoid": "^5.1.0" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "peerDependencies": { + "size-limit": "11.2.0" + } + }, + "node_modules/@size-limit/preset-small-lib/node_modules/@size-limit/file": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/@size-limit/file/-/file-11.2.0.tgz", + "integrity": "sha512-OZHE3putEkQ/fgzz3Tp/0hSmfVo3wyTpOJSRNm6AmcwX4Nm9YtTfbQQ/hZRwbBFR23S7x2Sd9EbqYzngKwbRoA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "peerDependencies": { + "size-limit": "11.2.0" + } + }, + "node_modules/@size-limit/preset-small-lib/node_modules/nanoid": { + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-5.1.4.tgz", + "integrity": "sha512-GTFcMIDgR7tqji/LpSY8rtg464VnJl/j6ypoehYnuGb+Y8qZUdtKB8WVCXon0UEZgFDbuUxpIl//6FHLHgXSNA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.js" + }, + "engines": { + "node": "^18 || >=20" + } + }, + "node_modules/@swc/counter": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@swc/counter/-/counter-0.1.3.tgz", + "integrity": "sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/@swc/helpers": { + "version": "0.5.15", + "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.15.tgz", + "integrity": "sha512-JQ5TuMi45Owi4/BIMAJBoSQoOJu12oOk/gADqlcUL9JEdHB8vyjUSsxqeNXnmXHjYKMi2WcYtezGEEhqUI/E2g==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.8.0" + } + }, + "node_modules/@tootallnate/once": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", + "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", + "dev": true, + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tsconfig/node10": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.11.tgz", + "integrity": "sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@tsconfig/node12": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", + "dev": true, + "license": "MIT" + }, + "node_modules/@tsconfig/node14": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", + "dev": true, + "license": "MIT" + }, + "node_modules/@tsconfig/node16": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", + "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/babel__core": { + "version": "7.20.1", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.1.tgz", + "integrity": "sha512-aACu/U/omhdk15O4Nfb+fHgH/z3QsfQzpnvRZhYhThms83ZnAOZz7zZAWO7mn2yyNQaA4xTO8GLK3uqFU4bYYw==", + "dev": true, + "dependencies": { + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" + } + }, + "node_modules/@types/babel__generator": { + "version": "7.6.4", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.4.tgz", + "integrity": "sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__template": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.1.tgz", + "integrity": "sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==", + "dev": true, + "dependencies": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__traverse": { + "version": "7.20.1", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.1.tgz", + "integrity": "sha512-MitHFXnhtgwsGZWtT68URpOvLN4EREih1u3QtQiN4VdAxWKRVvGCSvw/Qth0M0Qq3pJpnGOu5JaM/ydK7OGbqg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.20.7" + } + }, + "node_modules/@types/buble": { + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/@types/buble/-/buble-0.19.2.tgz", + "integrity": "sha512-uUD8zIfXMKThmFkahTXDGI3CthFH1kMg2dOm3KLi4GlC5cbARA64bEcUMbbWdWdE73eoc/iBB9PiTMqH0dNS2Q==", + "dev": true, + "dependencies": { + "magic-string": "^0.25.0" + } + }, + "node_modules/@types/estree": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", + "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/gensync": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@types/gensync/-/gensync-1.0.4.tgz", + "integrity": "sha512-C3YYeRQWp2fmq9OryX+FoDy8nXS6scQ7dPptD8LnFDAUNcKWJjXQKDNJD3HVm+kOUsXhTOkpi69vI4EuAr95bA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/graceful-fs": { + "version": "4.1.6", + "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.6.tgz", + "integrity": "sha512-Sig0SNORX9fdW+bQuTEovKj3uHcUL6LQKbCrrqb1X7J6/ReAbhCXRAhc+SMejhLELFj2QcyuxmUooZ4bt5ReSw==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/istanbul-lib-coverage": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz", + "integrity": "sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==", + "dev": true + }, + "node_modules/@types/istanbul-lib-report": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", + "integrity": "sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg==", + "dev": true, + "dependencies": { + "@types/istanbul-lib-coverage": "*" + } + }, + "node_modules/@types/istanbul-reports": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", + "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", + "dev": true, + "dependencies": { + "@types/istanbul-lib-report": "*" + } + }, + "node_modules/@types/jsdom": { + "version": "20.0.1", + "resolved": "https://registry.npmjs.org/@types/jsdom/-/jsdom-20.0.1.tgz", + "integrity": "sha512-d0r18sZPmMQr1eG35u12FZfhIXNrnsPU/g5wvRKCUf/tOGilKKwYMYGqh33BNR6ba+2gkHw1EUiHoN3mn7E5IQ==", + "dev": true, + "dependencies": { + "@types/node": "*", + "@types/tough-cookie": "*", + "parse5": "^7.0.0" + } + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/json5": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "14.17.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.3.tgz", + "integrity": "sha512-e6ZowgGJmTuXa3GyaPbTGxX17tnThl2aSSizrFthQ7m9uLGZBXiGhgE55cjRZTF5kjZvYn9EOPOMljdjwbflxw==", + "dev": true + }, + "node_modules/@types/prismjs": { + "version": "1.26.3", + "resolved": "https://registry.npmjs.org/@types/prismjs/-/prismjs-1.26.3.tgz", + "integrity": "sha512-A0D0aTXvjlqJ5ZILMz3rNfDBOx9hHxLZYv2by47Sm/pqW35zzjusrZTryatjN/Rf8Us2gZrJD+KeHbUSTux1Cw==", + "dev": true + }, + "node_modules/@types/random-seed": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@types/random-seed/-/random-seed-0.3.5.tgz", + "integrity": "sha512-CftxcDPAHgs0SLHU2dt+ZlDPJfGqLW3sZlC/ATr5vJDSe5tRLeOne7HMvCOJnFyF8e1U41wqzs3h6AMC613xtA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/react": { + "version": "19.1.0", + "resolved": "https://registry.npmjs.org/@types/react/-/react-19.1.0.tgz", + "integrity": "sha512-UaicktuQI+9UKyA4njtDOGBD/67t8YEBt2xdfqu8+gP9hqPUPsiXlNPcpS2gVdjmis5GKPG3fCxbQLVgxsQZ8w==", + "dev": true, + "license": "MIT", + "dependencies": { + "csstype": "^3.0.2" + } + }, + "node_modules/@types/stack-utils": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz", + "integrity": "sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==", + "dev": true + }, + "node_modules/@types/tough-cookie": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.2.tgz", + "integrity": "sha512-Q5vtl1W5ue16D+nIaW8JWebSSraJVlK+EthKn7e7UcD4KWsaSJ8BqGPXNaPghgtcn/fhvrN17Tv8ksUsQpiplw==", + "dev": true + }, + "node_modules/@types/yargs": { + "version": "17.0.24", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.24.tgz", + "integrity": "sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw==", + "dev": true, + "dependencies": { + "@types/yargs-parser": "*" + } + }, + "node_modules/@types/yargs-parser": { + "version": "21.0.0", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.0.tgz", + "integrity": "sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==", + "dev": true + }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "8.24.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.24.0.tgz", + "integrity": "sha512-aFcXEJJCI4gUdXgoo/j9udUYIHgF23MFkg09LFz2dzEmU0+1Plk4rQWv/IYKvPHAtlkkGoB3m5e6oUp+JPsNaQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/regexpp": "^4.10.0", + "@typescript-eslint/scope-manager": "8.24.0", + "@typescript-eslint/type-utils": "8.24.0", + "@typescript-eslint/utils": "8.24.0", + "@typescript-eslint/visitor-keys": "8.24.0", + "graphemer": "^1.4.0", + "ignore": "^5.3.1", + "natural-compare": "^1.4.0", + "ts-api-utils": "^2.0.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0", + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "8.24.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.24.0.tgz", + "integrity": "sha512-MFDaO9CYiard9j9VepMNa9MTcqVvSny2N4hkY6roquzj8pdCBRENhErrteaQuu7Yjn1ppk0v1/ZF9CG3KIlrTA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/scope-manager": "8.24.0", + "@typescript-eslint/types": "8.24.0", + "@typescript-eslint/typescript-estree": "8.24.0", + "@typescript-eslint/visitor-keys": "8.24.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" + } + }, + "node_modules/@typescript-eslint/parser/node_modules/debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/parser/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "8.24.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.24.0.tgz", + "integrity": "sha512-HZIX0UByphEtdVBKaQBgTDdn9z16l4aTUz8e8zPQnyxwHBtf5vtl1L+OhH+m1FGV9DrRmoDuYKqzVrvWDcDozw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.24.0", + "@typescript-eslint/visitor-keys": "8.24.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "8.24.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.24.0.tgz", + "integrity": "sha512-8fitJudrnY8aq0F1wMiPM1UUgiXQRJ5i8tFjq9kGfRajU+dbPyOuHbl0qRopLEidy0MwqgTHDt6CnSeXanNIwA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/typescript-estree": "8.24.0", + "@typescript-eslint/utils": "8.24.0", + "debug": "^4.3.4", + "ts-api-utils": "^2.0.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" + } + }, + "node_modules/@typescript-eslint/type-utils/node_modules/debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/type-utils/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@typescript-eslint/types": { + "version": "8.24.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.24.0.tgz", + "integrity": "sha512-VacJCBTyje7HGAw7xp11q439A+zeGG0p0/p2zsZwpnMzjPB5WteaWqt4g2iysgGFafrqvyLWqq6ZPZAOCoefCw==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "8.24.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.24.0.tgz", + "integrity": "sha512-ITjYcP0+8kbsvT9bysygfIfb+hBj6koDsu37JZG7xrCiy3fPJyNmfVtaGsgTUSEuTzcvME5YI5uyL5LD1EV5ZQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.24.0", + "@typescript-eslint/visitor-keys": "8.24.0", + "debug": "^4.3.4", + "fast-glob": "^3.3.2", + "is-glob": "^4.0.3", + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^2.0.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <5.8.0" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "8.24.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.24.0.tgz", + "integrity": "sha512-07rLuUBElvvEb1ICnafYWr4hk8/U7X9RDCOqd9JcAMtjh/9oRmcfN4yGzbPVirgMR0+HLVHehmu19CWeh7fsmQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@typescript-eslint/scope-manager": "8.24.0", + "@typescript-eslint/types": "8.24.0", + "@typescript-eslint/typescript-estree": "8.24.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "8.24.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.24.0.tgz", + "integrity": "sha512-kArLq83QxGLbuHrTMoOEWO+l2MwsNS2TGISEdx8xgqpkbytB07XmlQyQdNDrCc1ecSqx0cnmhGvpX+VBwqqSkg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.24.0", + "eslint-visitor-keys": "^4.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/abab": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", + "integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==", + "dev": true + }, + "node_modules/acorn": { + "version": "6.4.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz", + "integrity": "sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-dynamic-import": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/acorn-dynamic-import/-/acorn-dynamic-import-4.0.0.tgz", + "integrity": "sha512-d3OEjQV4ROpoflsnUA8HozoIR504TFxNivYEUi6uwz0IYhBkTDXGuWlNdMtybRt3nqVx/L6XqMt0FxkXuWKZhw==", + "dev": true, + "peerDependencies": { + "acorn": "^6.0.0" + } + }, + "node_modules/acorn-globals": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-7.0.1.tgz", + "integrity": "sha512-umOSDSDrfHbTNPuNpC2NSnnA3LUrqpevPb4T9jRx4MagXNS0rs+gwiTcAvqCRmsD6utzsrzNt+ebm00SNWiC3Q==", + "dev": true, + "dependencies": { + "acorn": "^8.1.0", + "acorn-walk": "^8.0.2" + } + }, + "node_modules/acorn-globals/node_modules/acorn": { + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/acorn-walk": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", + "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dev": true, + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/agent-base/node_modules/debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/agent-base/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/aggregate-error": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-4.0.1.tgz", + "integrity": "sha512-0poP0T7el6Vq3rstR8Mn4V/IQrpBLO6POkUSrN7RhyY+GF/InCFShQzsQ39T25gkHhLgSLByyAz+Kjb+c2L98w==", + "dev": true, + "license": "MIT", + "dependencies": { + "clean-stack": "^4.0.0", + "indent-string": "^5.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dev": true, + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-escapes/node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/anymatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", + "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", + "dev": true, + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true, + "license": "MIT" + }, + "node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/array-buffer-byte-length": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.2.tgz", + "integrity": "sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "is-array-buffer": "^3.0.5" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array-includes": { + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.8.tgz", + "integrity": "sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.4", + "is-string": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.findlast": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/array.prototype.findlast/-/array.prototype.findlast-1.2.5.tgz", + "integrity": "sha512-CVvd6FHg1Z3POpBLxO6E6zr+rSKEQ9L6rZHAaY7lLfhKsWYUBBOuMs0e9o24oopj6H+geRCX0YJ+TJLBK2eHyQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.findlastindex": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.5.tgz", + "integrity": "sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.flat": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.3.tgz", + "integrity": "sha512-rwG/ja1neyLqCuGZ5YYrznA62D4mZXg0i1cIskIUKSiqF3Cje9/wXAls9B9s1Wa2fomMsIv8czB8jZcPmxCXFg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.flatmap": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.3.tgz", + "integrity": "sha512-Y7Wt51eKJSyi80hFrJCePGGNo5ktJCslFuboqJsbf57CCPcm5zztluPlc4/aD8sWsKvlwatezpV4U1efk8kpjg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.tosorted": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/array.prototype.tosorted/-/array.prototype.tosorted-1.1.4.tgz", + "integrity": "sha512-p6Fx8B7b7ZhL/gmUsAy0D15WhvDccw3mnGNbZpi3pmeJdxtWsj2jEaI4Y6oo3XiHfzuSgPwKc04MYt6KgvC/wA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.3", + "es-errors": "^1.3.0", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/arraybuffer.prototype.slice": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.4.tgz", + "integrity": "sha512-BNoCY6SXXPQ7gF2opIP4GBE+Xw7U+pHMYKuzjgCN3GwiaIR09UUeKfheyIry77QtrCBlC0KK0q5/TER/tYh3PQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-buffer-byte-length": "^1.0.1", + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "is-array-buffer": "^3.0.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/arrify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-3.0.0.tgz", + "integrity": "sha512-tLkvA81vQG/XqE2mjDkGQHoOINtMHtysSnemrmoGe6PydDPMRbVugqyk4A6V/WDWEfm3l+0d8anA9r8cv/5Jaw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/async-function": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/async-function/-/async-function-1.0.0.tgz", + "integrity": "sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true + }, + "node_modules/available-typed-arrays": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/babel-jest": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.6.4.tgz", + "integrity": "sha512-meLj23UlSLddj6PC+YTOFRgDAtjnZom8w/ACsrx0gtPtv5cJZk0A5Unk5bV4wixD7XaPCN1fQvpww8czkZURmw==", + "dev": true, + "dependencies": { + "@jest/transform": "^29.6.4", + "@types/babel__core": "^7.1.14", + "babel-plugin-istanbul": "^6.1.1", + "babel-preset-jest": "^29.6.3", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.8.0" + } + }, + "node_modules/babel-plugin-istanbul": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", + "integrity": "sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.0.0", + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-instrument": "^5.0.4", + "test-exclude": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/babel-plugin-jest-hoist": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz", + "integrity": "sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==", + "dev": true, + "dependencies": { + "@babel/template": "^7.3.3", + "@babel/types": "^7.3.3", + "@types/babel__core": "^7.1.14", + "@types/babel__traverse": "^7.0.6" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/babel-preset-current-node-syntax": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz", + "integrity": "sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==", + "dev": true, + "dependencies": { + "@babel/plugin-syntax-async-generators": "^7.8.4", + "@babel/plugin-syntax-bigint": "^7.8.3", + "@babel/plugin-syntax-class-properties": "^7.8.3", + "@babel/plugin-syntax-import-meta": "^7.8.3", + "@babel/plugin-syntax-json-strings": "^7.8.3", + "@babel/plugin-syntax-logical-assignment-operators": "^7.8.3", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", + "@babel/plugin-syntax-numeric-separator": "^7.8.3", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", + "@babel/plugin-syntax-optional-chaining": "^7.8.3", + "@babel/plugin-syntax-top-level-await": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/babel-preset-jest": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz", + "integrity": "sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==", + "dev": true, + "dependencies": { + "babel-plugin-jest-hoist": "^29.6.3", + "babel-preset-current-node-syntax": "^1.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/benchmark": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/benchmark/-/benchmark-2.1.4.tgz", + "integrity": "sha1-CfPeMckWQl1JjMLuVloOvzwqVik=", + "dev": true, + "dependencies": { + "lodash": "^4.17.4", + "platform": "^1.3.3" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browserslist": { + "version": "4.24.4", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.4.tgz", + "integrity": "sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "caniuse-lite": "^1.0.30001688", + "electron-to-chromium": "^1.5.73", + "node-releases": "^2.0.19", + "update-browserslist-db": "^1.1.1" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/bser": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", + "integrity": "sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==", + "dev": true, + "dependencies": { + "node-int64": "^0.4.0" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true + }, + "node_modules/bundle-name": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bundle-name/-/bundle-name-4.1.0.tgz", + "integrity": "sha512-tjwM5exMg6BGRI+kNmTntNsvdZS1X8BFYS6tnJ2hdH0kVxM6/eVZ2xy+FqStSWvYmtfFMDLIxurorHwDKfDz5Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "run-applescript": "^7.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/busboy": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", + "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==", + "dev": true, + "dependencies": { + "streamsearch": "^1.1.0" + }, + "engines": { + "node": ">=10.16.0" + } + }, + "node_modules/bytes-iec": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/bytes-iec/-/bytes-iec-3.1.1.tgz", + "integrity": "sha512-fey6+4jDK7TFtFg/klGSvNKJctyU7n2aQdnM+CO0ruLPbqqMOM8Tio0Pc+deqUeVKX1tL5DQep1zQ7+37aTAsA==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", + "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.0", + "es-define-property": "^1.0.0", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz", + "integrity": "sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.3.tgz", + "integrity": "sha512-YTd+6wGlNlPxSuri7Y6X8tY2dmm12UMH66RpKMhiX6rsk5wXXnYgbUcOt8kiS31/AjfoTOvCsE+w8nZQLQnzHA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "get-intrinsic": "^1.2.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001699", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001699.tgz", + "integrity": "sha512-b+uH5BakXZ9Do9iK+CkDmctUSEqZl+SP056vc5usa0PL+ev5OHw003rZXcnjNDv3L8P5j6rwT6C0BPKSikW08w==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0" + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/char-regex": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", + "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/chokidar": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "readdirp": "^4.0.1" + }, + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/ci-info": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.8.0.tgz", + "integrity": "sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "engines": { + "node": ">=8" + } + }, + "node_modules/cjs-module-lexer": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.3.tgz", + "integrity": "sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ==", + "dev": true + }, + "node_modules/clean-stack": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-4.2.0.tgz", + "integrity": "sha512-LYv6XPxoyODi36Dp976riBtSY27VmFo+MKqEU9QCCWyTrdEPDog+RWA7xQWHi6Vbp61j5c4cdzzX1NidnwtUWg==", + "dev": true, + "license": "MIT", + "dependencies": { + "escape-string-regexp": "5.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/clean-stack/node_modules/escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/client-only": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/client-only/-/client-only-0.0.1.tgz", + "integrity": "sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==", + "dev": true, + "license": "MIT" + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/cliui/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/cliui/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", + "dev": true, + "engines": { + "iojs": ">= 1.0.0", + "node": ">= 0.12.0" + } + }, + "node_modules/codemirror": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-6.0.1.tgz", + "integrity": "sha512-J8j+nZ+CdWmIeFIGXEFbFPtpiYacFMDR8GlHK3IyHQJMCaVRfGx9NT+Hxivv1ckLWPvNdZqndbr/7lVhrf/Svg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@codemirror/autocomplete": "^6.0.0", + "@codemirror/commands": "^6.0.0", + "@codemirror/language": "^6.0.0", + "@codemirror/lint": "^6.0.0", + "@codemirror/search": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0" + } + }, + "node_modules/collect-v8-coverage": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz", + "integrity": "sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==", + "dev": true + }, + "node_modules/color": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz", + "integrity": "sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "color-convert": "^2.0.1", + "color-string": "^1.9.0" + }, + "engines": { + "node": ">=12.5.0" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/color-string": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz", + "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "color-name": "^1.0.0", + "simple-swizzle": "^0.2.2" + } + }, + "node_modules/colors": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", + "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==", + "dev": true, + "engines": { + "node": ">=0.1.90" + } + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, + "node_modules/commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "dev": true + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "node_modules/convert-source-map": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", + "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", + "dev": true + }, + "node_modules/cp-file": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/cp-file/-/cp-file-10.0.0.tgz", + "integrity": "sha512-vy2Vi1r2epK5WqxOLnskeKeZkdZvTKfFZQCplE3XWsP+SUJyd5XAUFC9lFgTjjXJF2GMne/UML14iEmkAaDfFg==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.10", + "nested-error-stacks": "^2.1.1", + "p-event": "^5.0.1" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cpy": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/cpy/-/cpy-10.1.0.tgz", + "integrity": "sha512-VC2Gs20JcTyeQob6UViBLnyP0bYHkBh6EiKzot9vi2DmeGlFT9Wd7VG3NBrkNx/jYvFBeyDOMMHdHQhbtKLgHQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "arrify": "^3.0.0", + "cp-file": "^10.0.0", + "globby": "^13.1.4", + "junk": "^4.0.1", + "micromatch": "^4.0.5", + "nested-error-stacks": "^2.1.1", + "p-filter": "^3.0.0", + "p-map": "^6.0.0" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cpy-cli": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cpy-cli/-/cpy-cli-5.0.0.tgz", + "integrity": "sha512-fb+DZYbL9KHc0BC4NYqGRrDIJZPXUmjjtqdw4XRRg8iV8dIfghUX/WiL+q4/B/KFTy3sK6jsbUhBaz0/Hxg7IQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "cpy": "^10.1.0", + "meow": "^12.0.1" + }, + "bin": { + "cpy": "cli.js" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cpy/node_modules/globby": { + "version": "13.2.2", + "resolved": "https://registry.npmjs.org/globby/-/globby-13.2.2.tgz", + "integrity": "sha512-Y1zNGV+pzQdh7H39l9zgB4PJqjRNqydvdYCDG4HFXM4XuvSaQQlEc91IU1yALL8gUTDomgBAfz3XJdmUS+oo0w==", + "dev": true, + "license": "MIT", + "dependencies": { + "dir-glob": "^3.0.1", + "fast-glob": "^3.3.0", + "ignore": "^5.2.4", + "merge2": "^1.4.1", + "slash": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cpy/node_modules/slash": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", + "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/crelt": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/crelt/-/crelt-1.0.6.tgz", + "integrity": "sha512-VQ2MBenTq1fWZUH9DJNGti7kKv6EeAuYr3cLwxUWhIu1baTaXh4Ib5W2CqHVqib4/MqbYGJqiL3Zb8GJZr3l4g==", + "dev": true, + "license": "MIT" + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/crypto-random-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz", + "integrity": "sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/cssom": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.5.0.tgz", + "integrity": "sha512-iKuQcq+NdHqlAcwUY0o/HL69XQrUaQdMjmStJ8JFmUaiiQErlhrmuigkg/CU4E2J0IyUKUrMAgl36TvN67MqTw==", + "dev": true + }, + "node_modules/cssstyle": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz", + "integrity": "sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A==", + "dev": true, + "dependencies": { + "cssom": "~0.3.6" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cssstyle/node_modules/cssom": { + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz", + "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==", + "dev": true + }, + "node_modules/csstype": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.0.8.tgz", + "integrity": "sha512-jXKhWqXPmlUeoQnF/EhTtTl4C9SnrxSH/jZUih3jmO6lBKr99rP3/+FmrMj4EFpOXzMtXHAZkd3x0E6h6Fgflw==", + "dev": true + }, + "node_modules/data-urls": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-3.0.2.tgz", + "integrity": "sha512-Jy/tj3ldjZJo63sVAvg6LHt2mHvl4V6AgRAmNDtLdm7faqtsx+aJG42rsyCo9JCoRVKwPFzKlIPx3DIibwSIaQ==", + "dev": true, + "dependencies": { + "abab": "^2.0.6", + "whatwg-mimetype": "^3.0.0", + "whatwg-url": "^11.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/data-view-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.2.tgz", + "integrity": "sha512-EmKO5V3OLXh1rtK2wgXRansaK1/mtVdTUEiEI0W8RkvgT05kfxaH29PliLnpLP73yYO6142Q72QNa8Wx/A5CqQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-length": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.2.tgz", + "integrity": "sha512-tuhGbE6CfTM9+5ANGf+oQb72Ky/0+s3xKUpHvShfiz2RxMFgFPjsXuRLBVMtvMs15awe45SRb83D6wH4ew6wlQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/inspect-js" + } + }, + "node_modules/data-view-byte-offset": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.1.tgz", + "integrity": "sha512-BS8PfmtDGnrgYdOonGZQdLZslWIeCGFP9tpan0hi1Co2Zr2NKADsvGYA8XxuG/4UWgJ6Cjtv+YJnB6MM69QGlQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/decimal.js": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz", + "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==", + "dev": true + }, + "node_modules/dedent": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.5.1.tgz", + "integrity": "sha512-+LxW+KLWxu3HW3M2w2ympwtqPrqYRzU8fqi6Fhd18fBALe15blJPI/I4+UHveMVG6lJqB4JNd4UG0S5cnVHwIg==", + "dev": true, + "peerDependencies": { + "babel-plugin-macros": "^3.1.0" + }, + "peerDependenciesMeta": { + "babel-plugin-macros": { + "optional": true + } + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/deepmerge": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/default-browser": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/default-browser/-/default-browser-5.2.1.tgz", + "integrity": "sha512-WY/3TUME0x3KPYdRRxEJJvXRHV4PyPoUsxtZa78lwItwRQRHhd2U9xOscaT/YTf8uCXIAjeJOFBVEh/7FtD8Xg==", + "dev": true, + "license": "MIT", + "dependencies": { + "bundle-name": "^4.1.0", + "default-browser-id": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/default-browser-id": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/default-browser-id/-/default-browser-id-5.0.0.tgz", + "integrity": "sha512-A6p/pu/6fyBcA1TRz/GqWYPViplrftcW2gZC9q79ngNCKAeR/X3gcEdXQHl4KNXV+3wgIJ1CPkJQ3IHM6lcsyA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/define-lazy-prop": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-3.0.0.tgz", + "integrity": "sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "dev": true, + "dependencies": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/detect-libc": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.3.tgz", + "integrity": "sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==", + "dev": true, + "license": "Apache-2.0", + "optional": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/detect-newline": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", + "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/diff-sequences": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", + "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/domexception": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz", + "integrity": "sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==", + "dev": true, + "dependencies": { + "webidl-conversions": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/electron-to-chromium": { + "version": "1.5.97", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.97.tgz", + "integrity": "sha512-HKLtaH02augM7ZOdYRuO19rWDeY+QSJ1VxnXFa/XDFLf07HvM90pALIJFgrO+UVaajI3+aJMMpojoUTLZyQ7JQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/emittery": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz", + "integrity": "sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sindresorhus/emittery?sponsor=1" + } + }, + "node_modules/enhanced-resolve": { + "version": "5.18.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.18.1.tgz", + "integrity": "sha512-ZSW3ma5GkcQBIpwZTSRAI8N71Uuwgs93IezB7mf7R60tC8ZbJideoDNKjHn2O9KIlx6rkGTTEk1xUCK2E1Y2Yg==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.2.0" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "dev": true, + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/es-abstract": { + "version": "1.23.9", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.9.tgz", + "integrity": "sha512-py07lI0wjxAC/DcfK1S6G7iANonniZwTISvdPzk9hzeH0IZIshbuuFxLIU96OyF89Yb9hiqWn8M/bY83KY5vzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-buffer-byte-length": "^1.0.2", + "arraybuffer.prototype.slice": "^1.0.4", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "data-view-buffer": "^1.0.2", + "data-view-byte-length": "^1.0.2", + "data-view-byte-offset": "^1.0.1", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-set-tostringtag": "^2.1.0", + "es-to-primitive": "^1.3.0", + "function.prototype.name": "^1.1.8", + "get-intrinsic": "^1.2.7", + "get-proto": "^1.0.0", + "get-symbol-description": "^1.1.0", + "globalthis": "^1.0.4", + "gopd": "^1.2.0", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "internal-slot": "^1.1.0", + "is-array-buffer": "^3.0.5", + "is-callable": "^1.2.7", + "is-data-view": "^1.0.2", + "is-regex": "^1.2.1", + "is-shared-array-buffer": "^1.0.4", + "is-string": "^1.1.1", + "is-typed-array": "^1.1.15", + "is-weakref": "^1.1.0", + "math-intrinsics": "^1.1.0", + "object-inspect": "^1.13.3", + "object-keys": "^1.1.1", + "object.assign": "^4.1.7", + "own-keys": "^1.0.1", + "regexp.prototype.flags": "^1.5.3", + "safe-array-concat": "^1.1.3", + "safe-push-apply": "^1.0.0", + "safe-regex-test": "^1.1.0", + "set-proto": "^1.0.0", + "string.prototype.trim": "^1.2.10", + "string.prototype.trimend": "^1.0.9", + "string.prototype.trimstart": "^1.0.8", + "typed-array-buffer": "^1.0.3", + "typed-array-byte-length": "^1.0.3", + "typed-array-byte-offset": "^1.0.4", + "typed-array-length": "^1.0.7", + "unbox-primitive": "^1.1.0", + "which-typed-array": "^1.1.18" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-iterator-helpers": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-iterator-helpers/-/es-iterator-helpers-1.2.1.tgz", + "integrity": "sha512-uDn+FE1yrDzyC0pCo961B2IHbdM8y/ACZsKD4dG6WqrjV53BADjwa7D+1aom2rsNVfLyDgU/eigvlJGJ08OQ4w==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.6", + "es-errors": "^1.3.0", + "es-set-tostringtag": "^2.0.3", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.6", + "globalthis": "^1.0.4", + "gopd": "^1.2.0", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.2.0", + "has-symbols": "^1.1.0", + "internal-slot": "^1.1.0", + "iterator.prototype": "^1.1.4", + "safe-array-concat": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-shim-unscopables": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.1.0.tgz", + "integrity": "sha512-d9T8ucsEhh8Bi1woXCf+TIKDIROLG5WCkxg8geBCbvk22kzwC5G2OnXVMO6FUsvQlgUUXQ2itephWDLqDzbeCw==", + "dev": true, + "license": "MIT", + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-to-primitive": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.3.0.tgz", + "integrity": "sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-callable": "^1.2.7", + "is-date-object": "^1.0.5", + "is-symbol": "^1.0.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/esbuild": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.1.tgz", + "integrity": "sha512-BGO5LtrGC7vxnqucAe/rmvKdJllfGaYWdyABvyMoXQlfYMb2bbRuReWR5tEGE//4LcNJj9XrkovTqNYRFZHAMQ==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.25.1", + "@esbuild/android-arm": "0.25.1", + "@esbuild/android-arm64": "0.25.1", + "@esbuild/android-x64": "0.25.1", + "@esbuild/darwin-arm64": "0.25.1", + "@esbuild/darwin-x64": "0.25.1", + "@esbuild/freebsd-arm64": "0.25.1", + "@esbuild/freebsd-x64": "0.25.1", + "@esbuild/linux-arm": "0.25.1", + "@esbuild/linux-arm64": "0.25.1", + "@esbuild/linux-ia32": "0.25.1", + "@esbuild/linux-loong64": "0.25.1", + "@esbuild/linux-mips64el": "0.25.1", + "@esbuild/linux-ppc64": "0.25.1", + "@esbuild/linux-riscv64": "0.25.1", + "@esbuild/linux-s390x": "0.25.1", + "@esbuild/linux-x64": "0.25.1", + "@esbuild/netbsd-arm64": "0.25.1", + "@esbuild/netbsd-x64": "0.25.1", + "@esbuild/openbsd-arm64": "0.25.1", + "@esbuild/openbsd-x64": "0.25.1", + "@esbuild/sunos-x64": "0.25.1", + "@esbuild/win32-arm64": "0.25.1", + "@esbuild/win32-ia32": "0.25.1", + "@esbuild/win32-x64": "0.25.1" + } + }, + "node_modules/esbuild-visualizer": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/esbuild-visualizer/-/esbuild-visualizer-0.7.0.tgz", + "integrity": "sha512-Vz22k+G2WT7GuCo7rbhaQwGbZ26lEhwzsctkEdQlu2SVrshoM4hzQeRpu/3DP596a9+9K2JyYsinuC6AC896Og==", + "dev": true, + "license": "MIT", + "dependencies": { + "open": "^8.4.0", + "picomatch": "^4.0.0", + "yargs": "^17.6.2" + }, + "bin": { + "esbuild-visualizer": "dist/bin/cli.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/esbuild-visualizer/node_modules/define-lazy-prop": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz", + "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/esbuild-visualizer/node_modules/is-docker": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", + "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", + "dev": true, + "license": "MIT", + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/esbuild-visualizer/node_modules/is-wsl": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", + "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-docker": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/esbuild-visualizer/node_modules/open": { + "version": "8.4.2", + "resolved": "https://registry.npmjs.org/open/-/open-8.4.2.tgz", + "integrity": "sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-lazy-prop": "^2.0.0", + "is-docker": "^2.1.1", + "is-wsl": "^2.2.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/esbuild-visualizer/node_modules/picomatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/escodegen": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz", + "integrity": "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==", + "dev": true, + "dependencies": { + "esprima": "^4.0.1", + "estraverse": "^5.2.0", + "esutils": "^2.0.2" + }, + "bin": { + "escodegen": "bin/escodegen.js", + "esgenerate": "bin/esgenerate.js" + }, + "engines": { + "node": ">=6.0" + }, + "optionalDependencies": { + "source-map": "~0.6.1" + } + }, + "node_modules/eslint": { + "version": "9.20.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.20.1.tgz", + "integrity": "sha512-m1mM33o6dBUjxl2qb6wv6nGNwCAsns1eKtaQ4l/NPHeTvhiUPbtdfMyktxN4B3fgHIgsYh1VT3V9txblpQHq+g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.12.1", + "@eslint/config-array": "^0.19.0", + "@eslint/core": "^0.11.0", + "@eslint/eslintrc": "^3.2.0", + "@eslint/js": "9.20.0", + "@eslint/plugin-kit": "^0.2.5", + "@humanfs/node": "^0.16.6", + "@humanwhocodes/module-importer": "^1.0.1", + "@humanwhocodes/retry": "^0.4.1", + "@types/estree": "^1.0.6", + "@types/json-schema": "^7.0.15", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.6", + "debug": "^4.3.2", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^8.2.0", + "eslint-visitor-keys": "^4.2.0", + "espree": "^10.3.0", + "esquery": "^1.5.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^8.0.0", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } + } + }, + "node_modules/eslint-import-resolver-node": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", + "integrity": "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^3.2.7", + "is-core-module": "^2.13.0", + "resolve": "^1.22.4" + } + }, + "node_modules/eslint-import-resolver-node/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-import-resolver-node/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/eslint-import-resolver-typescript": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-3.7.0.tgz", + "integrity": "sha512-Vrwyi8HHxY97K5ebydMtffsWAn1SCR9eol49eCd5fJS4O1WV7PaAjbcjmbfJJSMz/t4Mal212Uz/fQZrOB8mow==", + "dev": true, + "license": "ISC", + "dependencies": { + "@nolyfill/is-core-module": "1.0.39", + "debug": "^4.3.7", + "enhanced-resolve": "^5.15.0", + "fast-glob": "^3.3.2", + "get-tsconfig": "^4.7.5", + "is-bun-module": "^1.0.2", + "is-glob": "^4.0.3", + "stable-hash": "^0.0.4" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts/projects/eslint-import-resolver-ts" + }, + "peerDependencies": { + "eslint": "*", + "eslint-plugin-import": "*", + "eslint-plugin-import-x": "*" + }, + "peerDependenciesMeta": { + "eslint-plugin-import": { + "optional": true + }, + "eslint-plugin-import-x": { + "optional": true + } + } + }, + "node_modules/eslint-import-resolver-typescript/node_modules/debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/eslint-import-resolver-typescript/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/eslint-module-utils": { + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.12.0.tgz", + "integrity": "sha512-wALZ0HFoytlyh/1+4wuZ9FJCD/leWHQzzrxJ8+rebyReSLk7LApMyd3WJaLVoN+D5+WIdJyDK1c6JnE65V4Zyg==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^3.2.7" + }, + "engines": { + "node": ">=4" + }, + "peerDependenciesMeta": { + "eslint": { + "optional": true + } + } + }, + "node_modules/eslint-module-utils/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-module-utils/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/eslint-plugin-import": { + "version": "2.31.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.31.0.tgz", + "integrity": "sha512-ixmkI62Rbc2/w8Vfxyh1jQRTdRTF52VxwRVHl/ykPAmqG+Nb7/kNn+byLP0LxPgI7zWA16Jt82SybJInmMia3A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rtsao/scc": "^1.1.0", + "array-includes": "^3.1.8", + "array.prototype.findlastindex": "^1.2.5", + "array.prototype.flat": "^1.3.2", + "array.prototype.flatmap": "^1.3.2", + "debug": "^3.2.7", + "doctrine": "^2.1.0", + "eslint-import-resolver-node": "^0.3.9", + "eslint-module-utils": "^2.12.0", + "hasown": "^2.0.2", + "is-core-module": "^2.15.1", + "is-glob": "^4.0.3", + "minimatch": "^3.1.2", + "object.fromentries": "^2.0.8", + "object.groupby": "^1.0.3", + "object.values": "^1.2.0", + "semver": "^6.3.1", + "string.prototype.trimend": "^1.0.8", + "tsconfig-paths": "^3.15.0" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 || ^9" + } + }, + "node_modules/eslint-plugin-import/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-plugin-import/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/eslint-plugin-jest": { + "version": "28.11.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-28.11.0.tgz", + "integrity": "sha512-QAfipLcNCWLVocVbZW8GimKn5p5iiMcgGbRzz8z/P5q7xw+cNEpYqyzFMtIF/ZgF2HLOyy+dYBut+DoYolvqig==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/utils": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "engines": { + "node": "^16.10.0 || ^18.12.0 || >=20.0.0" + }, + "peerDependencies": { + "@typescript-eslint/eslint-plugin": "^6.0.0 || ^7.0.0 || ^8.0.0", + "eslint": "^7.0.0 || ^8.0.0 || ^9.0.0", + "jest": "*" + }, + "peerDependenciesMeta": { + "@typescript-eslint/eslint-plugin": { + "optional": true + }, + "jest": { + "optional": true + } + } + }, + "node_modules/eslint-plugin-react": { + "version": "7.37.4", + "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.37.4.tgz", + "integrity": "sha512-BGP0jRmfYyvOyvMoRX/uoUeW+GqNj9y16bPQzqAHf3AYII/tDs+jMN0dBVkl88/OZwNGwrVFxE7riHsXVfy/LQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-includes": "^3.1.8", + "array.prototype.findlast": "^1.2.5", + "array.prototype.flatmap": "^1.3.3", + "array.prototype.tosorted": "^1.1.4", + "doctrine": "^2.1.0", + "es-iterator-helpers": "^1.2.1", + "estraverse": "^5.3.0", + "hasown": "^2.0.2", + "jsx-ast-utils": "^2.4.1 || ^3.0.0", + "minimatch": "^3.1.2", + "object.entries": "^1.1.8", + "object.fromentries": "^2.0.8", + "object.values": "^1.2.1", + "prop-types": "^15.8.1", + "resolve": "^2.0.0-next.5", + "semver": "^6.3.1", + "string.prototype.matchall": "^4.0.12", + "string.prototype.repeat": "^1.0.0" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9.7" + } + }, + "node_modules/eslint-plugin-react/node_modules/resolve": { + "version": "2.0.0-next.5", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.5.tgz", + "integrity": "sha512-U7WjGVG9sH8tvjW5SmGbQuui75FiyjAX72HX15DwBBwF9dNiQZRQAg9nnPhYy+TUnE0+VcrttuvNI8oSxZcocA==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/eslint-scope": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.2.0.tgz", + "integrity": "sha512-PHlWUfG6lvPc3yvP5A4PNyBL1W8fkDUccmI21JUu/+GKZBoH/W5u6usENXUrWFRsyoW5ACUjFGgAFQp5gUlb/A==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/eslint/node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/eslint/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/espree": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz", + "integrity": "sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.14.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^4.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/espree/node_modules/acorn": { + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/esquery": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", + "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "dev": true, + "license": "MIT" + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/execa": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/exit": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/expect": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/expect-utils": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/fast-check": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fast-check/-/fast-check-4.0.0.tgz", + "integrity": "sha512-aXLyLemZ7qhLNn2oq+YpjT2Xed21+i29WGAYuyrGbU4r8oinB3i4XR4e62O3NY6qmm5qHEDoc/7d+gMsri3AfA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/dubzzz" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fast-check" + } + ], + "license": "MIT", + "dependencies": { + "pure-rand": "^7.0.0" + }, + "engines": { + "node": ">=12.17.0" + } + }, + "node_modules/fast-check/node_modules/pure-rand": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-7.0.1.tgz", + "integrity": "sha512-oTUZM/NAZS8p7ANR3SHh30kXB+zK2r2BPcEn/awJIbOvq82WoMN4p62AWWp3Hhw50G0xMsw1mhIBLqHw64EcNQ==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/dubzzz" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fast-check" + } + ], + "license": "MIT" + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-glob": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", + "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.8" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fastq": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", + "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "dev": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/fb-watchman": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", + "integrity": "sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==", + "dev": true, + "dependencies": { + "bser": "2.1.1" + } + }, + "node_modules/file-entry-cache": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "flat-cache": "^4.0.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", + "dev": true, + "license": "MIT", + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.4" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/flatted": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.2.tgz", + "integrity": "sha512-AiwGJM8YcNOaobumgtng+6NHuOqC3A7MixFeDafM3X9cIUM+xUXoS5Vfgf+OihAYe20fxqNM9yPBXJzRtZ/4eA==", + "dev": true, + "license": "ISC" + }, + "node_modules/flow-bin": { + "version": "0.160.0", + "resolved": "https://registry.npmjs.org/flow-bin/-/flow-bin-0.160.0.tgz", + "integrity": "sha512-hqb/1z7U9Jv+2hDdslAgdab6D4AUDrYIcF2zH/CKx9YgQtCeHfnzCcypzCNU7xmBm2+Mi9+1hqeB4OQX2adh0A==", + "dev": true, + "bin": { + "flow": "cli.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dev": true, + "dependencies": { + "is-callable": "^1.1.3" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/function.prototype.name": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.8.tgz", + "integrity": "sha512-e5iwyodOHhbMr/yNrc7fDYG4qlbIvI5gajyzPnb5TCwyhjApznQh1BMFou9b30SevY43gCJKXycoCBjMbsuW0Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "functions-have-names": "^1.2.3", + "hasown": "^2.0.2", + "is-callable": "^1.2.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.7.tgz", + "integrity": "sha512-VW6Pxhsrk0KAOqs3WEd0klDiF/+V7gQOpAvY1jVU/LHmaD/kQO4523aiJuikX/QAKYiW6x8Jh+RJej1almdtCA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "function-bind": "^1.1.2", + "get-proto": "^1.0.0", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "dev": true, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "dev": true, + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/get-symbol-description": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.1.0.tgz", + "integrity": "sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-tsconfig": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.10.0.tgz", + "integrity": "sha512-kGzZ3LWWQcGIAmg6iWvXn0ei6WDtV26wzHRMwDSzmAbcXrTEXxHy6IehI6/4eT6VRKyMP1eF1VqwrVUmE/LR7A==", + "dev": true, + "license": "MIT", + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/globals": { + "version": "15.15.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-15.15.0.tgz", + "integrity": "sha512-7ACyT3wmyp3I61S4fG682L0VA2RGD9otkqGJIwNUMF1SWUombIIk+af1unuDYgMm082aHYwD+mzJvv9Iu8dsgg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globalthis": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", + "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-properties": "^1.2.1", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true + }, + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true, + "license": "MIT" + }, + "node_modules/has-bigints": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.2.0.tgz", + "integrity": "sha512-KIL7eQPfHQRC8+XluaIw7BHUwwqL19bQn4hzNgdr+1wXoU0KKj6rufu47lhY7KbJR2C6T6+PfyN0Ea7wkSS+qQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "dev": true + }, + "node_modules/html-encoding-sniffer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", + "integrity": "sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA==", + "dev": true, + "dependencies": { + "whatwg-encoding": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true + }, + "node_modules/http-proxy-agent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", + "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", + "dev": true, + "dependencies": { + "@tootallnate/once": "2", + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/http-proxy-agent/node_modules/debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/http-proxy-agent/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "dev": true, + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/https-proxy-agent/node_modules/debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/https-proxy-agent/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "dev": true, + "engines": { + "node": ">=10.17.0" + } + }, + "node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dev": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", + "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/import-local": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz", + "integrity": "sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==", + "dev": true, + "dependencies": { + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" + }, + "bin": { + "import-local-fixture": "fixtures/cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/import-local/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/import-local/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/import-local/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/import-local/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/import-local/node_modules/pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "dependencies": { + "find-up": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true, + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/indent-string": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", + "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "node_modules/internal-slot": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.1.0.tgz", + "integrity": "sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "hasown": "^2.0.2", + "side-channel": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/is-array-buffer": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.5.tgz", + "integrity": "sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "get-intrinsic": "^1.2.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "node_modules/is-async-function": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-async-function/-/is-async-function-2.1.1.tgz", + "integrity": "sha512-9dgM/cZBnNvjzaMYHVoxxfPj2QXt22Ev7SuuPrs+xav0ukGB0S6d4ydZdEiM48kLx5kDV+QBPrpVnFyefL8kkQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "async-function": "^1.0.0", + "call-bound": "^1.0.3", + "get-proto": "^1.0.1", + "has-tostringtag": "^1.0.2", + "safe-regex-test": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-bigint": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.1.0.tgz", + "integrity": "sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-bigints": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-boolean-object": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.2.2.tgz", + "integrity": "sha512-wa56o2/ElJMYqjCjGkXri7it5FbebW5usLw/nPmCMs5DeZ7eziSYZhSmPRn0txqeW4LnAmQQU7FgqLpsEFKM4A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-bun-module": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/is-bun-module/-/is-bun-module-1.3.0.tgz", + "integrity": "sha512-DgXeu5UWI0IsMQundYb5UAOzm6G2eVnarJ0byP6Tm55iZNKceD59LNPA2L4VvsScTtHcw0yEkVwSf7PC+QoLSA==", + "dev": true, + "license": "MIT", + "dependencies": { + "semver": "^7.6.3" + } + }, + "node_modules/is-bun-module/node_modules/semver": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-core-module": { + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", + "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", + "dev": true, + "license": "MIT", + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-data-view": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.2.tgz", + "integrity": "sha512-RKtWF8pGmS87i2D6gqQu/l7EYRlVdfzemCJN/P3UOs//x1QE7mfhvzHIApBTRf7axvT6DMGwSwBXYCT0nfB9xw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "get-intrinsic": "^1.2.6", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-date-object": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.1.0.tgz", + "integrity": "sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-docker": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz", + "integrity": "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==", + "dev": true, + "license": "MIT", + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-finalizationregistry": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-finalizationregistry/-/is-finalizationregistry-1.1.1.tgz", + "integrity": "sha512-1pC6N8qWJbWoPtEjgcL2xyhQOP491EQjeUo3qTKcmV8YSDDJrOepfG8pcC7h/QgnQHYSv0mJ3Z/ZWxmatVrysg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-generator-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", + "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/is-generator-function": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.1.0.tgz", + "integrity": "sha512-nPUB5km40q9e8UfN/Zc24eLlzdSf9OfKByBw9CIdw4H1giPMeA0OIJvbchsCu4npfI2QcMVBsGEBHKZ7wLTWmQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "get-proto": "^1.0.0", + "has-tostringtag": "^1.0.2", + "safe-regex-test": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-inside-container": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz", + "integrity": "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-docker": "^3.0.0" + }, + "bin": { + "is-inside-container": "cli.js" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-map": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.3.tgz", + "integrity": "sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-number-object": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.1.1.tgz", + "integrity": "sha512-lZhclumE1G6VYD8VHe35wFaIif+CTy5SJIi5+3y4psDgWu4wPDoBhF8NxUOinEc7pHgiTsT6MaBb92rKhhD+Xw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-potential-custom-element-name": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", + "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", + "dev": true + }, + "node_modules/is-reference": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", + "integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==", + "dev": true, + "dependencies": { + "@types/estree": "*" + } + }, + "node_modules/is-regex": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", + "integrity": "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-set": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.3.tgz", + "integrity": "sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-shared-array-buffer": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.4.tgz", + "integrity": "sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-string": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.1.1.tgz", + "integrity": "sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-symbol": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.1.1.tgz", + "integrity": "sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "has-symbols": "^1.1.0", + "safe-regex-test": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-typed-array": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.15.tgz", + "integrity": "sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "which-typed-array": "^1.1.16" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakmap": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz", + "integrity": "sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakref": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.1.1.tgz", + "integrity": "sha512-6i9mGWSlqzNMEqpCp93KwRS1uUOodk2OJ6b+sq7ZPDSy2WuI5NFIxp/254TytR8ftefexkWn5xNiHUNpPOfSew==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakset": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.4.tgz", + "integrity": "sha512-mfcwb6IzQyOKTs84CQMrOwW4gQcaTOAWJ0zzJCl2WSPDrWk/OzDaImWFH3djXhb24g4eudZfLRozAvPGw4d9hQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "get-intrinsic": "^1.2.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-wsl": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-3.1.0.tgz", + "integrity": "sha512-UcVfVfaK4Sc4m7X3dUSoHoozQGBEFeDC+zVo06t98xe8CzHSZZBekNXH+tu0NalHolcJ/QAGqS46Hef7QXBIMw==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-inside-container": "^1.0.0" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "node_modules/istanbul-lib-coverage": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", + "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-instrument": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz", + "integrity": "sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==", + "dev": true, + "dependencies": { + "@babel/core": "^7.12.3", + "@babel/parser": "^7.14.7", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-report": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", + "dev": true, + "dependencies": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^4.0.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-report/node_modules/make-dir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", + "dev": true, + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/istanbul-lib-report/node_modules/semver": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-source-maps": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", + "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", + "dev": true, + "dependencies": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-source-maps/node_modules/debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/istanbul-lib-source-maps/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/istanbul-reports": { + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.6.tgz", + "integrity": "sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==", + "dev": true, + "dependencies": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/iterator.prototype": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/iterator.prototype/-/iterator.prototype-1.1.5.tgz", + "integrity": "sha512-H0dkQoCa3b2VEeKQBOxFph+JAbcrQdE7KC0UkqwpLmv2EC4P41QXP+rqo9wYodACiG5/WM5s9oDApTU8utwj9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.6", + "get-proto": "^1.0.0", + "has-symbols": "^1.1.0", + "set-function-name": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/jest": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest/-/jest-29.6.4.tgz", + "integrity": "sha512-tEFhVQFF/bzoYV1YuGyzLPZ6vlPrdfvDmmAxudA1dLEuiztqg2Rkx20vkKY32xiDROcD2KXlgZ7Cu8RPeEHRKw==", + "dev": true, + "dependencies": { + "@jest/core": "^29.6.4", + "@jest/types": "^29.6.3", + "import-local": "^3.0.2", + "jest-cli": "^29.6.4" + }, + "bin": { + "jest": "bin/jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/jest-changed-files": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.6.3.tgz", + "integrity": "sha512-G5wDnElqLa4/c66ma5PG9eRjE342lIbF6SUnTJi26C3J28Fv2TVY2rOyKB9YGbSA5ogwevgmxc4j4aVjrEK6Yg==", + "dev": true, + "dependencies": { + "execa": "^5.0.0", + "jest-util": "^29.6.3", + "p-limit": "^3.1.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-circus": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.6.4.tgz", + "integrity": "sha512-YXNrRyntVUgDfZbjXWBMPslX1mQ8MrSG0oM/Y06j9EYubODIyHWP8hMUbjbZ19M3M+zamqEur7O80HODwACoJw==", + "dev": true, + "dependencies": { + "@jest/environment": "^29.6.4", + "@jest/expect": "^29.6.4", + "@jest/test-result": "^29.6.4", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "co": "^4.6.0", + "dedent": "^1.0.0", + "is-generator-fn": "^2.0.0", + "jest-each": "^29.6.3", + "jest-matcher-utils": "^29.6.4", + "jest-message-util": "^29.6.3", + "jest-runtime": "^29.6.4", + "jest-snapshot": "^29.6.4", + "jest-util": "^29.6.3", + "p-limit": "^3.1.0", + "pretty-format": "^29.6.3", + "pure-rand": "^6.0.0", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-cli": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.6.4.tgz", + "integrity": "sha512-+uMCQ7oizMmh8ZwRfZzKIEszFY9ksjjEQnTEMTaL7fYiL3Kw4XhqT9bYh+A4DQKUb67hZn2KbtEnDuHvcgK4pQ==", + "dev": true, + "dependencies": { + "@jest/core": "^29.6.4", + "@jest/test-result": "^29.6.4", + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "import-local": "^3.0.2", + "jest-config": "^29.6.4", + "jest-util": "^29.6.3", + "jest-validate": "^29.6.3", + "prompts": "^2.0.1", + "yargs": "^17.3.1" + }, + "bin": { + "jest": "bin/jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/jest-config": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.6.4.tgz", + "integrity": "sha512-JWohr3i9m2cVpBumQFv2akMEnFEPVOh+9L2xIBJhJ0zOaci2ZXuKJj0tgMKQCBZAKA09H049IR4HVS/43Qb19A==", + "dev": true, + "dependencies": { + "@babel/core": "^7.11.6", + "@jest/test-sequencer": "^29.6.4", + "@jest/types": "^29.6.3", + "babel-jest": "^29.6.4", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "deepmerge": "^4.2.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-circus": "^29.6.4", + "jest-environment-node": "^29.6.4", + "jest-get-type": "^29.6.3", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.6.4", + "jest-runner": "^29.6.4", + "jest-util": "^29.6.3", + "jest-validate": "^29.6.3", + "micromatch": "^4.0.4", + "parse-json": "^5.2.0", + "pretty-format": "^29.6.3", + "slash": "^3.0.0", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@types/node": "*", + "ts-node": ">=9.0.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "ts-node": { + "optional": true + } + } + }, + "node_modules/jest-config/node_modules/parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/jest-diff": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", + "integrity": "sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.0.0", + "diff-sequences": "^29.6.3", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-docblock": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.6.3.tgz", + "integrity": "sha512-2+H+GOTQBEm2+qFSQ7Ma+BvyV+waiIFxmZF5LdpBsAEjWX8QYjSCa4FrkIYtbfXUJJJnFCYrOtt6TZ+IAiTjBQ==", + "dev": true, + "dependencies": { + "detect-newline": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-each": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.6.3.tgz", + "integrity": "sha512-KoXfJ42k8cqbkfshW7sSHcdfnv5agDdHCPA87ZBdmHP+zJstTJc0ttQaJ/x7zK6noAL76hOuTIJ6ZkQRS5dcyg==", + "dev": true, + "dependencies": { + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "jest-util": "^29.6.3", + "pretty-format": "^29.6.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-environment-jsdom": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-29.6.4.tgz", + "integrity": "sha512-K6wfgUJ16DoMs02JYFid9lOsqfpoVtyJxpRlnTxUHzvZWBnnh2VNGRB9EC1Cro96TQdq5TtSjb3qUjNaJP9IyA==", + "dev": true, + "dependencies": { + "@jest/environment": "^29.6.4", + "@jest/fake-timers": "^29.6.4", + "@jest/types": "^29.6.3", + "@types/jsdom": "^20.0.0", + "@types/node": "*", + "jest-mock": "^29.6.3", + "jest-util": "^29.6.3", + "jsdom": "^20.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "canvas": "^2.5.0" + }, + "peerDependenciesMeta": { + "canvas": { + "optional": true + } + } + }, + "node_modules/jest-environment-node": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.6.4.tgz", + "integrity": "sha512-i7SbpH2dEIFGNmxGCpSc2w9cA4qVD+wfvg2ZnfQ7XVrKL0NA5uDVBIiGH8SR4F0dKEv/0qI5r+aDomDf04DpEQ==", + "dev": true, + "dependencies": { + "@jest/environment": "^29.6.4", + "@jest/fake-timers": "^29.6.4", + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-mock": "^29.6.3", + "jest-util": "^29.6.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-get-type": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz", + "integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==", + "dev": true, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-haste-map": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz", + "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@types/graceful-fs": "^4.1.3", + "@types/node": "*", + "anymatch": "^3.0.3", + "fb-watchman": "^2.0.0", + "graceful-fs": "^4.2.9", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", + "micromatch": "^4.0.4", + "walker": "^1.0.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "optionalDependencies": { + "fsevents": "^2.3.2" + } + }, + "node_modules/jest-leak-detector": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.6.3.tgz", + "integrity": "sha512-0kfbESIHXYdhAdpLsW7xdwmYhLf1BRu4AA118/OxFm0Ho1b2RcTmO4oF6aAMaxpxdxnJ3zve2rgwzNBD4Zbm7Q==", + "dev": true, + "dependencies": { + "jest-get-type": "^29.6.3", + "pretty-format": "^29.6.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-matcher-utils": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz", + "integrity": "sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.0.0", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-message-util": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.7.0.tgz", + "integrity": "sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.12.13", + "@jest/types": "^29.6.3", + "@types/stack-utils": "^2.0.0", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "micromatch": "^4.0.4", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-mock": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz", + "integrity": "sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-pnp-resolver": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz", + "integrity": "sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==", + "dev": true, + "engines": { + "node": ">=6" + }, + "peerDependencies": { + "jest-resolve": "*" + }, + "peerDependenciesMeta": { + "jest-resolve": { + "optional": true + } + } + }, + "node_modules/jest-regex-util": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", + "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", + "dev": true, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-resolve": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.6.4.tgz", + "integrity": "sha512-fPRq+0vcxsuGlG0O3gyoqGTAxasagOxEuyoxHeyxaZbc9QNek0AmJWSkhjlMG+mTsj+8knc/mWb3fXlRNVih7Q==", + "dev": true, + "dependencies": { + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.6.4", + "jest-pnp-resolver": "^1.2.2", + "jest-util": "^29.6.3", + "jest-validate": "^29.6.3", + "resolve": "^1.20.0", + "resolve.exports": "^2.0.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-resolve-dependencies": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.6.4.tgz", + "integrity": "sha512-7+6eAmr1ZBF3vOAJVsfLj1QdqeXG+WYhidfLHBRZqGN24MFRIiKG20ItpLw2qRAsW/D2ZUUmCNf6irUr/v6KHA==", + "dev": true, + "dependencies": { + "jest-regex-util": "^29.6.3", + "jest-snapshot": "^29.6.4" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-runner": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.6.4.tgz", + "integrity": "sha512-SDaLrMmtVlQYDuG0iSPYLycG8P9jLI+fRm8AF/xPKhYDB2g6xDWjXBrR5M8gEWsK6KVFlebpZ4QsrxdyIX1Jaw==", + "dev": true, + "dependencies": { + "@jest/console": "^29.6.4", + "@jest/environment": "^29.6.4", + "@jest/test-result": "^29.6.4", + "@jest/transform": "^29.6.4", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "emittery": "^0.13.1", + "graceful-fs": "^4.2.9", + "jest-docblock": "^29.6.3", + "jest-environment-node": "^29.6.4", + "jest-haste-map": "^29.6.4", + "jest-leak-detector": "^29.6.3", + "jest-message-util": "^29.6.3", + "jest-resolve": "^29.6.4", + "jest-runtime": "^29.6.4", + "jest-util": "^29.6.3", + "jest-watcher": "^29.6.4", + "jest-worker": "^29.6.4", + "p-limit": "^3.1.0", + "source-map-support": "0.5.13" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-runner/node_modules/source-map-support": { + "version": "0.5.13", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", + "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", + "dev": true, + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/jest-runtime": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.6.4.tgz", + "integrity": "sha512-s/QxMBLvmwLdchKEjcLfwzP7h+jsHvNEtxGP5P+Fl1FMaJX2jMiIqe4rJw4tFprzCwuSvVUo9bn0uj4gNRXsbA==", + "dev": true, + "dependencies": { + "@jest/environment": "^29.6.4", + "@jest/fake-timers": "^29.6.4", + "@jest/globals": "^29.6.4", + "@jest/source-map": "^29.6.3", + "@jest/test-result": "^29.6.4", + "@jest/transform": "^29.6.4", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "cjs-module-lexer": "^1.0.0", + "collect-v8-coverage": "^1.0.0", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.6.4", + "jest-message-util": "^29.6.3", + "jest-mock": "^29.6.3", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.6.4", + "jest-snapshot": "^29.6.4", + "jest-util": "^29.6.3", + "slash": "^3.0.0", + "strip-bom": "^4.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-snapshot": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz", + "integrity": "sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.11.6", + "@babel/generator": "^7.7.2", + "@babel/plugin-syntax-jsx": "^7.7.2", + "@babel/plugin-syntax-typescript": "^7.7.2", + "@babel/types": "^7.3.3", + "@jest/expect-utils": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "babel-preset-current-node-syntax": "^1.0.0", + "chalk": "^4.0.0", + "expect": "^29.7.0", + "graceful-fs": "^4.2.9", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "natural-compare": "^1.4.0", + "pretty-format": "^29.7.0", + "semver": "^7.5.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-snapshot/node_modules/semver": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/jest-util": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", + "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.9", + "picomatch": "^2.2.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-validate": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.6.3.tgz", + "integrity": "sha512-e7KWZcAIX+2W1o3cHfnqpGajdCs1jSM3DkXjGeLSNmCazv1EeI1ggTeK5wdZhF+7N+g44JI2Od3veojoaumlfg==", + "dev": true, + "dependencies": { + "@jest/types": "^29.6.3", + "camelcase": "^6.2.0", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "leven": "^3.1.0", + "pretty-format": "^29.6.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-validate/node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/jest-watcher": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.6.4.tgz", + "integrity": "sha512-oqUWvx6+On04ShsT00Ir9T4/FvBeEh2M9PTubgITPxDa739p4hoQweWPRGyYeaojgT0xTpZKF0Y/rSY1UgMxvQ==", + "dev": true, + "dependencies": { + "@jest/test-result": "^29.6.4", + "@jest/types": "^29.6.3", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "emittery": "^0.13.1", + "jest-util": "^29.6.3", + "string-length": "^4.0.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-worker": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", + "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*", + "jest-util": "^29.7.0", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-worker/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/jiti": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.4.2.tgz", + "integrity": "sha512-rg9zJN+G4n2nfJl5MW3BMygZX56zKPNVEYYqq7adpmMh4Jn2QNEwhvQlFy6jPVdcod7txZtKHWnyZiA3a0zP7A==", + "dev": true, + "license": "MIT", + "bin": { + "jiti": "lib/jiti-cli.mjs" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "node_modules/js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/jsdom": { + "version": "20.0.3", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-20.0.3.tgz", + "integrity": "sha512-SYhBvTh89tTfCD/CRdSOm13mOBa42iTaTyfyEWBdKcGdPxPtLFBXuHR8XHb33YNYaP+lLbmSvBTsnoesCNJEsQ==", + "dev": true, + "dependencies": { + "abab": "^2.0.6", + "acorn": "^8.8.1", + "acorn-globals": "^7.0.0", + "cssom": "^0.5.0", + "cssstyle": "^2.3.0", + "data-urls": "^3.0.2", + "decimal.js": "^10.4.2", + "domexception": "^4.0.0", + "escodegen": "^2.0.0", + "form-data": "^4.0.0", + "html-encoding-sniffer": "^3.0.0", + "http-proxy-agent": "^5.0.0", + "https-proxy-agent": "^5.0.1", + "is-potential-custom-element-name": "^1.0.1", + "nwsapi": "^2.2.2", + "parse5": "^7.1.1", + "saxes": "^6.0.0", + "symbol-tree": "^3.2.4", + "tough-cookie": "^4.1.2", + "w3c-xmlserializer": "^4.0.0", + "webidl-conversions": "^7.0.0", + "whatwg-encoding": "^2.0.0", + "whatwg-mimetype": "^3.0.0", + "whatwg-url": "^11.0.0", + "ws": "^8.11.0", + "xml-name-validator": "^4.0.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "canvas": "^2.5.0" + }, + "peerDependenciesMeta": { + "canvas": { + "optional": true + } + } + }, + "node_modules/jsdom/node_modules/acorn": { + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/jsdom/node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dev": true, + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/jsdom/node_modules/tough-cookie": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz", + "integrity": "sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==", + "dev": true, + "dependencies": { + "psl": "^1.1.33", + "punycode": "^2.1.1", + "universalify": "^0.2.0", + "url-parse": "^1.5.3" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/jsdom/node_modules/universalify": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", + "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", + "dev": true, + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/jsesc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", + "dev": true, + "license": "MIT", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, + "node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", + "dev": true, + "license": "ISC" + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/jsonml-html": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/jsonml-html/-/jsonml-html-1.2.0.tgz", + "integrity": "sha512-vg30gQFD5X+1nY3do43BW9Iiq4F5BZcysXc+ydPNu7O5AxaqxnaI9ikjTjlE9y9KaAvgTwTP6nOpifDqDoYmjg==", + "dev": true, + "license": "ISC" + }, + "node_modules/jsx-ast-utils": { + "version": "3.3.5", + "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz", + "integrity": "sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-includes": "^3.1.6", + "array.prototype.flat": "^1.3.1", + "object.assign": "^4.1.4", + "object.values": "^1.1.6" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/junk": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/junk/-/junk-4.0.1.tgz", + "integrity": "sha512-Qush0uP+G8ZScpGMZvHUiRfI0YBWuB3gVBYlI0v0vvOJt5FLicco+IkP0a50LqTTQhmts/m6tP5SWE+USyIvcQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/kleur": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/leven": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", + "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/lilconfig": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz", + "integrity": "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antonk52" + } + }, + "node_modules/lines-and-columns": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", + "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", + "dev": true + }, + "node_modules/load-json-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/load-json-file/node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dev": true, + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, + "node_modules/magic-string": { + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.9.tgz", + "integrity": "sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "sourcemap-codec": "^1.4.8" + } + }, + "node_modules/make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true, + "license": "ISC" + }, + "node_modules/make-synchronous": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/make-synchronous/-/make-synchronous-0.1.1.tgz", + "integrity": "sha512-Y4SxxqhaoyMDokJQ0AZz0E+bLhRkOSR7Z/IQoTKPdS6HYi3aobal2kMHoHHoqBadPWjf07P4K1FQLXOx3wf9Yw==", + "dev": true, + "dependencies": { + "subsume": "^3.0.0", + "type-fest": "^0.16.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/make-synchronous/node_modules/type-fest": { + "version": "0.16.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.16.0.tgz", + "integrity": "sha512-eaBzG6MxNzEn9kiwvtre90cXaNLkmadMWa1zQMs3XORCXNbsH/OewwbxC5ia9dCxIxnTAsSxXJaa/p5y8DlvJg==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/makeerror": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", + "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==", + "dev": true, + "dependencies": { + "tmpl": "1.0.5" + } + }, + "node_modules/marked": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/marked/-/marked-11.2.0.tgz", + "integrity": "sha512-HR0m3bvu0jAPYiIvLUUQtdg1g6D247//lvcekpHO1WMvbwDlwSkZAX9Lw4F4YHE1T0HaaNve0tuAWuV1UJ6vtw==", + "dev": true, + "bin": { + "marked": "bin/marked.js" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/marked-highlight": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/marked-highlight/-/marked-highlight-2.1.0.tgz", + "integrity": "sha512-peBvgGZZqUw074Vy/N8Y7/6JQhSnR54/T0Ozq2/fAIBzcYfVfExFdQJptIhQxreR1elpwvJRrqhp6S/Prk8prA==", + "dev": true, + "peerDependencies": { + "marked": ">=4 <12" + } + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/memorystream": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", + "integrity": "sha1-htcJCzDORV1j+64S3aUaR93K+bI=", + "dev": true, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/meow": { + "version": "12.1.1", + "resolved": "https://registry.npmjs.org/meow/-/meow-12.1.1.tgz", + "integrity": "sha512-BhXM0Au22RwUneMPwSCnyhTOizdWoIEPU9sp0Aqa1PnDMR5Wv2FGXYDjuzJEIX+Eo2Rb8xuYe5jrnm5QowQFkw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=16.10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "dev": true, + "license": "MIT", + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/microtime": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/microtime/-/microtime-3.1.1.tgz", + "integrity": "sha512-to1r7o24cDsud9IhN6/8wGmMx5R2kT0w2Xwm5okbYI3d1dk6Xv0m+Z+jg2vS9pt+ocgQHTCtgs/YuyJhySzxNg==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "node-addon-api": "^5.0.0", + "node-gyp-build": "^4.4.0" + }, + "engines": { + "node": ">= 14.13.0" + } + }, + "node_modules/mime-db": { + "version": "1.49.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.49.0.tgz", + "integrity": "sha512-CIc8j9URtOVApSFCQIF+VBkX1RwXp/oMMOrqdyXSBXq5RWNEsRfyj1kiRnQgmNXmHxPoFIxOroKA3zcU9P+nAA==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.32", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.32.tgz", + "integrity": "sha512-hJGaVS4G4c9TSMYh2n6SQAGrC4RnfU+daP8G7cSCmaqNjiOoUY0VHCMS42pxnQmVF1GWwFhbHWn3RIxCqTmZ9A==", + "dev": true, + "dependencies": { + "mime-db": "1.49.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/nanoid": { + "version": "3.3.10", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.10.tgz", + "integrity": "sha512-vSJJTG+t/dIKAUhUDw/dLdZ9s//5OxcHqLaDWWrW4Cdq7o6tdLIczUkMXt2MBNmk6sJRZBZRXVixs7URY1CmIg==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/nanospinner": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/nanospinner/-/nanospinner-1.2.2.tgz", + "integrity": "sha512-Zt/AmG6qRU3e+WnzGGLuMCEAO/dAu45stNbHY223tUxldaDAeE+FxSPsd9Q+j+paejmm0ZbrNVs5Sraqy3dRxA==", + "dev": true, + "license": "MIT", + "dependencies": { + "picocolors": "^1.1.1" + } + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "node_modules/nested-error-stacks": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/nested-error-stacks/-/nested-error-stacks-2.1.1.tgz", + "integrity": "sha512-9iN1ka/9zmX1ZvLV9ewJYEk9h7RyRRtqdK0woXcqohu8EWIerfPUjYJPg0ULy0UqP7cslmdGc8xKDJcojlKiaw==", + "dev": true, + "license": "MIT" + }, + "node_modules/next": { + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/next/-/next-15.2.4.tgz", + "integrity": "sha512-VwL+LAaPSxEkd3lU2xWbgEOtrM8oedmyhBqaVNmgKB+GvZlCy9rgaEc+y2on0wv+l0oSFqLtYD6dcC1eAedUaQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@next/env": "15.2.4", + "@swc/counter": "0.1.3", + "@swc/helpers": "0.5.15", + "busboy": "1.6.0", + "caniuse-lite": "^1.0.30001579", + "postcss": "8.4.31", + "styled-jsx": "5.1.6" + }, + "bin": { + "next": "dist/bin/next" + }, + "engines": { + "node": "^18.18.0 || ^19.8.0 || >= 20.0.0" + }, + "optionalDependencies": { + "@next/swc-darwin-arm64": "15.2.4", + "@next/swc-darwin-x64": "15.2.4", + "@next/swc-linux-arm64-gnu": "15.2.4", + "@next/swc-linux-arm64-musl": "15.2.4", + "@next/swc-linux-x64-gnu": "15.2.4", + "@next/swc-linux-x64-musl": "15.2.4", + "@next/swc-win32-arm64-msvc": "15.2.4", + "@next/swc-win32-x64-msvc": "15.2.4", + "sharp": "^0.33.5" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.1.0", + "@playwright/test": "^1.41.2", + "babel-plugin-react-compiler": "*", + "react": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0", + "react-dom": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0", + "sass": "^1.3.0" + }, + "peerDependenciesMeta": { + "@opentelemetry/api": { + "optional": true + }, + "@playwright/test": { + "optional": true + }, + "babel-plugin-react-compiler": { + "optional": true + }, + "sass": { + "optional": true + } + } + }, + "node_modules/next-sitemap": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/next-sitemap/-/next-sitemap-4.2.3.tgz", + "integrity": "sha512-vjdCxeDuWDzldhCnyFCQipw5bfpl4HmZA7uoo3GAaYGjGgfL4Cxb1CiztPuWGmS+auYs7/8OekRS8C2cjdAsjQ==", + "dev": true, + "funding": [ + { + "url": "https://github.com/iamvishnusankar/next-sitemap.git" + } + ], + "dependencies": { + "@corex/deepmerge": "^4.0.43", + "@next/env": "^13.4.3", + "fast-glob": "^3.2.12", + "minimist": "^1.2.8" + }, + "bin": { + "next-sitemap": "bin/next-sitemap.mjs", + "next-sitemap-cjs": "bin/next-sitemap.cjs" + }, + "engines": { + "node": ">=14.18" + }, + "peerDependencies": { + "next": "*" + } + }, + "node_modules/next-sitemap/node_modules/@next/env": { + "version": "13.5.8", + "resolved": "https://registry.npmjs.org/@next/env/-/env-13.5.8.tgz", + "integrity": "sha512-YmiG58BqyZ2FjrF2+5uZExL2BrLr8RTQzLXNDJ8pJr0O+rPlOeDPXp1p1/4OrR3avDidzZo3D8QO2cuDv1KCkw==", + "dev": true, + "license": "MIT" + }, + "node_modules/nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, + "node_modules/node-addon-api": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-5.1.0.tgz", + "integrity": "sha512-eh0GgfEkpnoWDq+VY8OyvYhFEzBk6jIYbRKdIlyTiAXIVJ8PyBaKb0rp7oDtoddbdoHWhq8wwr+XZ81F1rpNdA==", + "dev": true, + "license": "MIT" + }, + "node_modules/node-gyp-build": { + "version": "4.8.2", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.2.tgz", + "integrity": "sha512-IRUxE4BVsHWXkV/SFOut4qTlagw2aM8T5/vnTsmrHJvVoKueJHRc/JaFND7QDDc61kLYUJ6qlZM3sqTSyx2dTw==", + "dev": true, + "license": "MIT", + "bin": { + "node-gyp-build": "bin.js", + "node-gyp-build-optional": "optional.js", + "node-gyp-build-test": "build-test.js" + } + }, + "node_modules/node-int64": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", + "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", + "dev": true + }, + "node_modules/node-releases": { + "version": "2.0.19", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz", + "integrity": "sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==", + "dev": true, + "license": "MIT" + }, + "node_modules/normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "dependencies": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "node_modules/normalize-package-data/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/npm-run-all": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/npm-run-all/-/npm-run-all-4.1.5.tgz", + "integrity": "sha512-Oo82gJDAVcaMdi3nuoKFavkIHBRVqQ1qvMb+9LHk/cF4P6B2m8aP04hGf7oL6wZ9BuGwX1onlLhpuoofSyoQDQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "chalk": "^2.4.1", + "cross-spawn": "^6.0.5", + "memorystream": "^0.3.1", + "minimatch": "^3.0.4", + "pidtree": "^0.3.0", + "read-pkg": "^3.0.0", + "shell-quote": "^1.6.1", + "string.prototype.padend": "^3.0.0" + }, + "bin": { + "npm-run-all": "bin/npm-run-all/index.js", + "run-p": "bin/run-p/index.js", + "run-s": "bin/run-s/index.js" + }, + "engines": { + "node": ">= 4" + } + }, + "node_modules/npm-run-all/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/npm-run-all/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/npm-run-all/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/npm-run-all/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true, + "license": "MIT" + }, + "node_modules/npm-run-all/node_modules/cross-spawn": { + "version": "6.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.6.tgz", + "integrity": "sha512-VqCUuhcd1iB+dsv8gxPttb5iZh/D0iubSP21g36KXdEuf6I5JiioesUVjpCdHV9MZRUfVFlvwtIUyPfxo5trtw==", + "dev": true, + "license": "MIT", + "dependencies": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + }, + "engines": { + "node": ">=4.8" + } + }, + "node_modules/npm-run-all/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/npm-run-all/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/npm-run-all/node_modules/path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/npm-run-all/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/npm-run-all/node_modules/shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/npm-run-all/node_modules/shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/npm-run-all/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/npm-run-all/node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, + "node_modules/npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "dependencies": { + "path-key": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/nwsapi": { + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.7.tgz", + "integrity": "sha512-ub5E4+FBPKwAZx0UwIQOjYWGHTEq5sPqHQNRN8Z9e4A7u3Tj1weLJsL59yH9vmvqEtBHaOmT6cYQKIZOxp35FQ==", + "dev": true + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.assign": { + "version": "4.1.7", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.7.tgz", + "integrity": "sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0", + "has-symbols": "^1.1.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.entries": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.8.tgz", + "integrity": "sha512-cmopxi8VwRIAw/fkijJohSfpef5PdN0pMQJN6VC/ZKvn0LIknWD8KtgY6KlQdEc4tIjcQ3HxSMmnvtzIscdaYQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.fromentries": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.8.tgz", + "integrity": "sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.groupby": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.3.tgz", + "integrity": "sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.values": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.2.1.tgz", + "integrity": "sha512-gXah6aZrcUxjWg2zR2MwouP2eHlCBzdV4pygudehaKXSGW4v2AsRQUK+lwwXhii6KFZcunEnmSUoYp5CXibxtA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/open": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/open/-/open-10.1.0.tgz", + "integrity": "sha512-mnkeQ1qP5Ue2wd+aivTD3NHd/lZ96Lu0jgf0pwktLPtx6cTZiH7tyeGRRHs0zX0rbrahXPnXlUnbeXyaBBuIaw==", + "dev": true, + "license": "MIT", + "dependencies": { + "default-browser": "^5.2.1", + "define-lazy-prop": "^3.0.0", + "is-inside-container": "^1.0.0", + "is-wsl": "^3.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/own-keys": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/own-keys/-/own-keys-1.0.1.tgz", + "integrity": "sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg==", + "dev": true, + "license": "MIT", + "dependencies": { + "get-intrinsic": "^1.2.6", + "object-keys": "^1.1.1", + "safe-push-apply": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/p-event": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/p-event/-/p-event-5.0.1.tgz", + "integrity": "sha512-dd589iCQ7m1L0bmC5NLlVYfy3TbBEsMUfWx9PyAgPeIcFZ/E2yaTZ4Rz4MiBmmJShviiftHVXOqfnfzJ6kyMrQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-timeout": "^5.0.2" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-filter": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-filter/-/p-filter-3.0.0.tgz", + "integrity": "sha512-QtoWLjXAW++uTX67HZQz1dbTpqBfiidsB6VtQUC9iR85S120+s0T5sO6s+B5MLzFcZkrEd/DGMmCjR+f2Qpxwg==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-map": "^5.1.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-filter/node_modules/p-map": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-5.5.0.tgz", + "integrity": "sha512-VFqfGDHlx87K66yZrNdI4YGtD70IRyd+zSvgks6mzHPRNkoKy+9EKP4SFC77/vTTQYmRmti7dvqC+m5jBrBAcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "aggregate-error": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-map": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-6.0.0.tgz", + "integrity": "sha512-T8BatKGY+k5rU+Q/GTYgrEf2r4xRMevAN5mtXc2aPc4rS1j3s+vWTaO2Wag94neXuCAUAs8cxBL9EeB5EA6diw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-timeout": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-5.1.0.tgz", + "integrity": "sha512-auFDyzzzGZZZdHz3BtET9VEz0SE/uMEAx7uWfGPucfzEwwe/xH0iVeZibQmANYE/hp9T2+UUZT5m+BKyrDp3Ew==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "license": "MIT", + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==", + "dev": true, + "license": "MIT", + "dependencies": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/parse5": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", + "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", + "dev": true, + "dependencies": { + "entities": "^4.4.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pidtree": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.3.1.tgz", + "integrity": "sha512-qQbW94hLHEqCg7nhby4yRC7G2+jYHY4Rguc2bjw7Uug4GIJuu1tvf2uHaZv5Q8zdt+WKJ6qK1FOI6amaWUo5FA==", + "dev": true, + "bin": { + "pidtree": "bin/pidtree.js" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/pirates": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz", + "integrity": "sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/platform": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/platform/-/platform-1.3.6.tgz", + "integrity": "sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg==", + "dev": true + }, + "node_modules/possible-typed-array-names": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz", + "integrity": "sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/postcss": { + "version": "8.4.31", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", + "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "nanoid": "^3.3.6", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/prettier": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.5.0.tgz", + "integrity": "sha512-quyMrVt6svPS7CjQ9gKb3GLEX/rl3BCL2oa/QkNcXv4YNVBC9olt3s+H7ukto06q7B1Qz46PbrKLO34PR6vXcA==", + "dev": true, + "license": "MIT", + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/pretty-format/node_modules/react-is": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "dev": true, + "license": "MIT" + }, + "node_modules/prismjs": { + "version": "1.30.0", + "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.30.0.tgz", + "integrity": "sha512-DEvV2ZF2r2/63V+tK8hQvrR2ZGn10srHbXviTlcv7Kpzw8jWiNTqbVgjO3IY8RxrrOUF8VPMQQFysYYYv0YZxw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/prompts": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", + "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", + "dev": true, + "dependencies": { + "kleur": "^3.0.3", + "sisteransi": "^1.0.5" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/prop-types": { + "version": "15.8.1", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", + "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", + "dev": true, + "license": "MIT", + "dependencies": { + "loose-envify": "^1.4.0", + "object-assign": "^4.1.1", + "react-is": "^16.13.1" + } + }, + "node_modules/psl": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", + "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", + "dev": true + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/pure-rand": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.0.2.tgz", + "integrity": "sha512-6Yg0ekpKICSjPswYOuC5sku/TSWaRYlA0qsXqJgM/d/4pLPHPuTxK7Nbf7jFKzAeedUhR8C7K9Uv63FBsSo8xQ==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/dubzzz" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fast-check" + } + ] + }, + "node_modules/querystringify": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", + "dev": true + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/random-seed": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/random-seed/-/random-seed-0.3.0.tgz", + "integrity": "sha512-y13xtn3kcTlLub3HKWXxJNeC2qK4mB59evwZ5EkeRlolx+Bp2ztF7LbcZmyCnOqlHQrLnfuNbi1sVmm9lPDlDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "json-stringify-safe": "^5.0.1" + }, + "engines": { + "node": ">= 0.6.0" + } + }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "node_modules/react": { + "version": "19.1.0", + "resolved": "https://registry.npmjs.org/react/-/react-19.1.0.tgz", + "integrity": "sha512-FS+XFBNvn3GTAWq26joslQgWNoFu08F4kl0J4CgdNKADkdSGXQyTCnKteIAJy96Br6YbpEU1LSzV5dYtjMkMDg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-dom": { + "version": "19.1.0", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.1.0.tgz", + "integrity": "sha512-Xs1hdnE+DyKgeHJeJznQmYMIBG3TKIHJJT95Q58nHLSrElKlGQqDTR2HQ9fx5CN/Gk6Vh/kupBTDLU11/nDk/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "scheduler": "^0.26.0" + }, + "peerDependencies": { + "react": "^19.1.0" + } + }, + "node_modules/react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/read-pkg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha512-BLq/cCO9two+lBgiTYNqD6GdtK8s4NpaWrl6/rCO9w0TUS8oJl7cmToOZfRYllKTISY6nt1U7jQ53brmKqY6BA==", + "dev": true, + "license": "MIT", + "dependencies": { + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/read-pkg/node_modules/path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "dependencies": { + "pify": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/readdirp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14.18.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/reflect.getprototypeof": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz", + "integrity": "sha512-00o4I+DVrefhv+nX0ulyi3biSHCPDe+yLv5o/p6d/UVlirijB8E16FtfwSAi4g3tcqrQ4lRAqQSoFEZJehYEcw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.9", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.7", + "get-proto": "^1.0.1", + "which-builtin-type": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/regenerate": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", + "integrity": "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==", + "dev": true + }, + "node_modules/regenerate-unicode-properties": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-8.2.0.tgz", + "integrity": "sha512-F9DjY1vKLo/tPePDycuH3dn9H1OTPIkVD9Kz4LODu+F2C75mgjAJ7x/gwy6ZcSNRAAkhNlJSOHRe8k3p+K9WhA==", + "dev": true, + "dependencies": { + "regenerate": "^1.4.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/regexp.prototype.flags": { + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.4.tgz", + "integrity": "sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-errors": "^1.3.0", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "set-function-name": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/regjsgen": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.2.tgz", + "integrity": "sha512-OFFT3MfrH90xIW8OOSyUrk6QHD5E9JOTeGodiJeBS3J6IwlgzJMNE/1bZklWz5oTg+9dCMyEetclvCVXOPoN3A==", + "dev": true + }, + "node_modules/regjsparser": { + "version": "0.6.9", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.9.tgz", + "integrity": "sha512-ZqbNRz1SNjLAiYuwY0zoXW8Ne675IX5q+YHioAGbCw4X96Mjl2+dcX9B2ciaeyYjViDAfvIjFpQjJgLttTEERQ==", + "dev": true, + "dependencies": { + "jsesc": "~0.5.0" + }, + "bin": { + "regjsparser": "bin/parser" + } + }, + "node_modules/regjsparser/node_modules/jsesc": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==", + "dev": true, + "bin": { + "jsesc": "bin/jsesc" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", + "dev": true + }, + "node_modules/resolve": { + "version": "1.22.10", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.10.tgz", + "integrity": "sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-core-module": "^2.16.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-cwd": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", + "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", + "dev": true, + "dependencies": { + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/resolve-cwd/node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, + "node_modules/resolve.exports": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", + "integrity": "sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + } + }, + "node_modules/rollup": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.34.8.tgz", + "integrity": "sha512-489gTVMzAYdiZHFVA/ig/iYFllCcWFHMvUHI1rpFmkoUtRlQxqh6/yiNqnYibjMZ2b/+FUQwldG+aLsEt6bglQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "1.0.6" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.34.8", + "@rollup/rollup-android-arm64": "4.34.8", + "@rollup/rollup-darwin-arm64": "4.34.8", + "@rollup/rollup-darwin-x64": "4.34.8", + "@rollup/rollup-freebsd-arm64": "4.34.8", + "@rollup/rollup-freebsd-x64": "4.34.8", + "@rollup/rollup-linux-arm-gnueabihf": "4.34.8", + "@rollup/rollup-linux-arm-musleabihf": "4.34.8", + "@rollup/rollup-linux-arm64-gnu": "4.34.8", + "@rollup/rollup-linux-arm64-musl": "4.34.8", + "@rollup/rollup-linux-loongarch64-gnu": "4.34.8", + "@rollup/rollup-linux-powerpc64le-gnu": "4.34.8", + "@rollup/rollup-linux-riscv64-gnu": "4.34.8", + "@rollup/rollup-linux-s390x-gnu": "4.34.8", + "@rollup/rollup-linux-x64-gnu": "4.34.8", + "@rollup/rollup-linux-x64-musl": "4.34.8", + "@rollup/rollup-win32-arm64-msvc": "4.34.8", + "@rollup/rollup-win32-ia32-msvc": "4.34.8", + "@rollup/rollup-win32-x64-msvc": "4.34.8", + "fsevents": "~2.3.2" + } + }, + "node_modules/run-applescript": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/run-applescript/-/run-applescript-7.0.0.tgz", + "integrity": "sha512-9by4Ij99JUr/MCFBUkDKLWK3G9HVXmabKz9U5MlIAIuvuzkiOicRYs8XJLxX+xahD+mLiiCYDqF9dKAgtzKP1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/safe-array-concat": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.3.tgz", + "integrity": "sha512-AURm5f0jYEOydBj7VQlVvDrjeFgthDdEF5H1dP+6mNpoXOMo1quQqJ4wvJDyRZ9+pO3kGWoOdmV08cSv2aJV6Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "get-intrinsic": "^1.2.6", + "has-symbols": "^1.1.0", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">=0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-array-concat/node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/safe-push-apply": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/safe-push-apply/-/safe-push-apply-1.0.0.tgz", + "integrity": "sha512-iKE9w/Z7xCzUMIZqdBsp6pEQvwuEebH4vdpjcDWnyzaI6yl6O9FHvVpmGelvEHNsoY6wGblkxR6Zty/h00WiSA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-push-apply/node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true, + "license": "MIT" + }, + "node_modules/safe-regex-test": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.1.0.tgz", + "integrity": "sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "is-regex": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "node_modules/saxes": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/saxes/-/saxes-6.0.0.tgz", + "integrity": "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==", + "dev": true, + "dependencies": { + "xmlchars": "^2.2.0" + }, + "engines": { + "node": ">=v12.22.7" + } + }, + "node_modules/scheduler": { + "version": "0.26.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.26.0.tgz", + "integrity": "sha512-NlHwttCI/l5gCPR3D1nNXtWABUmBwvZpEQiD4IXSbIDq8BzLIK/7Ir5gTFSGZDUu37K5cMNp0hFtzO38sC7gWA==", + "dev": true, + "license": "MIT" + }, + "node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/serialize-javascript": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "randombytes": "^2.1.0" + } + }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-function-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", + "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-proto": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/set-proto/-/set-proto-1.0.0.tgz", + "integrity": "sha512-RJRdvCo6IAnPdsvP/7m6bsQqNnn1FCBX5ZNtFL98MmFF/4xAIJTIg1YbHW5DC2W5SKZanrC6i4HsJqlajw/dZw==", + "dev": true, + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/sharp": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.33.5.tgz", + "integrity": "sha512-haPVm1EkS9pgvHrQ/F3Xy+hgcuMV0Wm9vfIBSiwZ05k+xgb0PkBQpGsAA/oWdDobNaZTH5ppvHtzCFbnSEwHVw==", + "dev": true, + "hasInstallScript": true, + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "color": "^4.2.3", + "detect-libc": "^2.0.3", + "semver": "^7.6.3" + }, + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-darwin-arm64": "0.33.5", + "@img/sharp-darwin-x64": "0.33.5", + "@img/sharp-libvips-darwin-arm64": "1.0.4", + "@img/sharp-libvips-darwin-x64": "1.0.4", + "@img/sharp-libvips-linux-arm": "1.0.5", + "@img/sharp-libvips-linux-arm64": "1.0.4", + "@img/sharp-libvips-linux-s390x": "1.0.4", + "@img/sharp-libvips-linux-x64": "1.0.4", + "@img/sharp-libvips-linuxmusl-arm64": "1.0.4", + "@img/sharp-libvips-linuxmusl-x64": "1.0.4", + "@img/sharp-linux-arm": "0.33.5", + "@img/sharp-linux-arm64": "0.33.5", + "@img/sharp-linux-s390x": "0.33.5", + "@img/sharp-linux-x64": "0.33.5", + "@img/sharp-linuxmusl-arm64": "0.33.5", + "@img/sharp-linuxmusl-x64": "0.33.5", + "@img/sharp-wasm32": "0.33.5", + "@img/sharp-win32-ia32": "0.33.5", + "@img/sharp-win32-x64": "0.33.5" + } + }, + "node_modules/sharp/node_modules/semver": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "dev": true, + "license": "ISC", + "optional": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/shell-quote": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.2.tgz", + "integrity": "sha512-AzqKpGKjrj7EM6rKVQEPpB288oCfnrEIuyoT9cyF4nmGa7V8Zk6f7RRqYisX8X9m+Q7bd632aZW4ky7EhbQztA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true + }, + "node_modules/simple-swizzle": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", + "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "is-arrayish": "^0.3.1" + } + }, + "node_modules/simple-swizzle/node_modules/is-arrayish": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", + "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==", + "dev": true, + "license": "MIT", + "optional": true + }, + "node_modules/sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", + "dev": true + }, + "node_modules/size-limit": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/size-limit/-/size-limit-11.2.0.tgz", + "integrity": "sha512-2kpQq2DD/pRpx3Tal/qRW1SYwcIeQ0iq8li5CJHQgOC+FtPn2BVmuDtzUCgNnpCrbgtfEHqh+iWzxK+Tq6C+RQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "bytes-iec": "^3.1.1", + "chokidar": "^4.0.3", + "jiti": "^2.4.2", + "lilconfig": "^3.1.3", + "nanospinner": "^1.2.2", + "picocolors": "^1.1.1", + "tinyglobby": "^0.2.11" + }, + "bin": { + "size-limit": "bin.js" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + } + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/smob": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/smob/-/smob-1.4.0.tgz", + "integrity": "sha512-MqR3fVulhjWuRNSMydnTlweu38UhQ0HXM4buStD/S3mc/BzX3CuM9OmhyQpmtYCvoYdl5ris6TI0ZqH355Ymqg==", + "dev": true + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-js": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", + "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/sourcemap-codec": { + "version": "1.4.8", + "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", + "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", + "dev": true + }, + "node_modules/spdx-correct": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", + "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", + "dev": true, + "dependencies": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-exceptions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", + "dev": true + }, + "node_modules/spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-license-ids": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.9.tgz", + "integrity": "sha512-Ki212dKK4ogX+xDo4CtOZBVIwhsKBEfsEEcwmJfLQzirgc2jIWdzg40Unxz/HzEUqM1WFzVlQSMF9kZZ2HboLQ==", + "dev": true + }, + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "node_modules/stable-hash": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/stable-hash/-/stable-hash-0.0.4.tgz", + "integrity": "sha512-LjdcbuBeLcdETCrPn9i8AYAZ1eCtu4ECAWtP7UleOiZ9LzVxRzzUZEoZ8zB24nhkQnDWyET0I+3sWokSDS3E7g==", + "dev": true, + "license": "MIT" + }, + "node_modules/stack-utils": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz", + "integrity": "sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==", + "dev": true, + "dependencies": { + "escape-string-regexp": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/stack-utils/node_modules/escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/streamsearch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", + "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==", + "dev": true, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/string-length": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", + "integrity": "sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==", + "dev": true, + "dependencies": { + "char-regex": "^1.0.2", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/string.prototype.matchall": { + "version": "4.0.12", + "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.12.tgz", + "integrity": "sha512-6CC9uyBL+/48dYizRf7H7VAYCMCNTBeM78x/VTUe9bFEaxBepPJDa1Ow99LqI/1yF7kuy7Q3cQsYMrcjGUcskA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.6", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.6", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "internal-slot": "^1.1.0", + "regexp.prototype.flags": "^1.5.3", + "set-function-name": "^2.0.2", + "side-channel": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.padend": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/string.prototype.padend/-/string.prototype.padend-3.1.2.tgz", + "integrity": "sha512-/AQFLdYvePENU3W5rgurfWSMU6n+Ww8n/3cUt7E+vPBB/D7YDG8x+qjoFs4M/alR2bW7Qg6xMjVwWUOvuQ0XpQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.repeat": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/string.prototype.repeat/-/string.prototype.repeat-1.0.0.tgz", + "integrity": "sha512-0u/TldDbKD8bFCQ/4f5+mNRrXwZ8hg2w7ZR8wa16e8z9XpePWl3eGEcUD0OXpEH/VJH/2G3gjUtR3ZOiBe2S/w==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } + }, + "node_modules/string.prototype.trim": { + "version": "1.2.10", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.10.tgz", + "integrity": "sha512-Rs66F0P/1kedk5lyYyH9uBzuiI/kNRmwJAR9quK6VOtIpZ2G+hMZd+HQbbv25MgCA6gEffoMZYxlTod4WcdrKA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "define-data-property": "^1.1.4", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-object-atoms": "^1.0.0", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimend": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.9.tgz", + "integrity": "sha512-G7Ok5C6E/j4SGfyLCloXTrngQIQU3PWtXGst3yM7Bea9FRURf1S42ZHlZZtsNque2FN2PoUhfZXYLNWwEr4dLQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimstart": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", + "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-bom": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/style-mod": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/style-mod/-/style-mod-4.1.2.tgz", + "integrity": "sha512-wnD1HyVqpJUI2+eKZ+eo1UwghftP6yuFheBqqe+bWCotBjC2K1YnteJILRMs3SM4V/0dLEW1SC27MWP5y+mwmw==", + "dev": true, + "license": "MIT" + }, + "node_modules/styled-jsx": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.1.6.tgz", + "integrity": "sha512-qSVyDTeMotdvQYoHWLNGwRFJHC+i+ZvdBRYosOFgC+Wg1vx4frN2/RG/NA7SYqqvKNLf39P2LSRA2pu6n0XYZA==", + "dev": true, + "license": "MIT", + "dependencies": { + "client-only": "0.0.1" + }, + "engines": { + "node": ">= 12.0.0" + }, + "peerDependencies": { + "react": ">= 16.8.0 || 17.x.x || ^18.0.0-0 || ^19.0.0-0" + }, + "peerDependenciesMeta": { + "@babel/core": { + "optional": true + }, + "babel-plugin-macros": { + "optional": true + } + } + }, + "node_modules/subsume": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/subsume/-/subsume-3.0.0.tgz", + "integrity": "sha512-6n/UfV8UWKwJNO8OAOiKntwEMihuBeeoJfzpL542C+OuvT4iWG9SwjrXkOmsxjb4SteHUsos9SvrdqZ9+ICwTQ==", + "dev": true, + "dependencies": { + "escape-string-regexp": "^2.0.0", + "unique-string": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/subsume/node_modules/escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/symbol-tree": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", + "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", + "dev": true + }, + "node_modules/tapable": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", + "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/terser": { + "version": "5.19.2", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.19.2.tgz", + "integrity": "sha512-qC5+dmecKJA4cpYxRa5aVkKehYsQKc+AHeKl0Oe62aYjBL8ZA33tTljktDHJSaxxMnbI5ZYw+o/S2DxxLu8OfA==", + "dev": true, + "dependencies": { + "@jridgewell/source-map": "^0.3.3", + "acorn": "^8.8.2", + "commander": "^2.20.0", + "source-map-support": "~0.5.20" + }, + "bin": { + "terser": "bin/terser" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/terser/node_modules/acorn": { + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, + "dependencies": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/tinyglobby": { + "version": "0.2.12", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.12.tgz", + "integrity": "sha512-qkf4trmKSIiMTs/E63cxH+ojC2unam7rJ0WrauAzpT3ECNTxGRMlaXxVbfxMUC/w0LaYk6jQ4y/nGR9uBO3tww==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.4.3", + "picomatch": "^4.0.2" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tinyglobby/node_modules/fdir": { + "version": "6.4.3", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.3.tgz", + "integrity": "sha512-PMXmW2y1hDDfTSRc9gaXIuCCRpuoz3Kaz8cUelp3smouvfT632ozg2vrT6lJsHKKOF59YLbOGfAWGUcKEfRMQw==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/tinyglobby/node_modules/picomatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/tmpl": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", + "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", + "dev": true + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/tr46": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz", + "integrity": "sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==", + "dev": true, + "dependencies": { + "punycode": "^2.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/transducers-js": { + "version": "0.4.174", + "resolved": "https://registry.npmjs.org/transducers-js/-/transducers-js-0.4.174.tgz", + "integrity": "sha1-1YYsEO/0vj0zIqv2u3QuMPG7b8Q=", + "dev": true, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/ts-api-utils": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.0.1.tgz", + "integrity": "sha512-dnlgjFSVetynI8nzgJ+qF62efpglpWRk8isUEWZGWlJYySCTD6aKvbUDu+zbPeDakk3bg5H4XpitHukgfL1m9w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.12" + }, + "peerDependencies": { + "typescript": ">=4.8.4" + } + }, + "node_modules/ts-node": { + "version": "10.9.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", + "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.1", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-esm": "dist/bin-esm.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", + "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } + } + }, + "node_modules/ts-node/node_modules/acorn": { + "version": "8.14.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.1.tgz", + "integrity": "sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/tsconfig-paths": { + "version": "3.15.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", + "integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/json5": "^0.0.29", + "json5": "^1.0.2", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" + } + }, + "node_modules/tsconfig-paths/node_modules/json5": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "minimist": "^1.2.0" + }, + "bin": { + "json5": "lib/cli.js" + } + }, + "node_modules/tsconfig-paths/node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "dev": true, + "license": "0BSD" + }, + "node_modules/tstyche": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/tstyche/-/tstyche-3.5.0.tgz", + "integrity": "sha512-N4SUp/ZWaMGEcglpVFIzKez0GQEiBdfFDgcnqwv9O1mePZgos8N1cZCzNgGtPGo/w0ym04MjJcDnsw1sorEzgA==", + "dev": true, + "license": "MIT", + "bin": { + "tstyche": "build/bin.js" + }, + "engines": { + "node": ">=18.19" + }, + "funding": { + "url": "https://github.com/tstyche/tstyche?sponsor=1" + }, + "peerDependencies": { + "typescript": "4.x || 5.x" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/typed-array-buffer": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz", + "integrity": "sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.14" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/typed-array-byte-length": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.3.tgz", + "integrity": "sha512-BaXgOuIxz8n8pIq3e7Atg/7s+DpiYrxn4vdot3w9KbnBhcRQq6o3xemQdIfynqSeXeDrF32x+WvfzmOjPiY9lg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "for-each": "^0.3.3", + "gopd": "^1.2.0", + "has-proto": "^1.2.0", + "is-typed-array": "^1.1.14" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-byte-offset": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.4.tgz", + "integrity": "sha512-bTlAFB/FBYMcuX81gbL4OcpH5PmlFHqlCCpAl8AlEzMz5k53oNDvN8p1PNOWLEmI2x4orp3raOFB51tv9X+MFQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "for-each": "^0.3.3", + "gopd": "^1.2.0", + "has-proto": "^1.2.0", + "is-typed-array": "^1.1.15", + "reflect.getprototypeof": "^1.0.9" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-length": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.7.tgz", + "integrity": "sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "is-typed-array": "^1.1.13", + "possible-typed-array-names": "^1.0.0", + "reflect.getprototypeof": "^1.0.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typescript": { + "version": "5.7.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.3.tgz", + "integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/typescript-eslint": { + "version": "8.24.0", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.24.0.tgz", + "integrity": "sha512-/lmv4366en/qbB32Vz5+kCNZEMf6xYHwh1z48suBwZvAtnXKbP+YhGe8OLE2BqC67LMqKkCNLtjejdwsdW6uOQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/eslint-plugin": "8.24.0", + "@typescript-eslint/parser": "8.24.0", + "@typescript-eslint/utils": "8.24.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" + } + }, + "node_modules/unbox-primitive": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.1.0.tgz", + "integrity": "sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "has-bigints": "^1.0.2", + "has-symbols": "^1.1.0", + "which-boxed-primitive": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/unicode-canonical-property-names-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", + "integrity": "sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/unicode-match-property-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz", + "integrity": "sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg==", + "dev": true, + "dependencies": { + "unicode-canonical-property-names-ecmascript": "^1.0.4", + "unicode-property-aliases-ecmascript": "^1.0.4" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/unicode-match-property-value-ecmascript": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.2.0.tgz", + "integrity": "sha512-wjuQHGQVofmSJv1uVISKLE5zO2rNGzM/KCYZch/QQvez7C1hUhBIuZ701fYXExuufJFMPhv2SyL8CyoIfMLbIQ==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/unicode-property-aliases-ecmascript": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.1.0.tgz", + "integrity": "sha512-PqSoPh/pWetQ2phoj5RLiaqIk4kCNwoV3CI+LfGmWLKI3rE3kl1h59XpX2BjgDrmbxD9ARtQobPGU1SguCYuQg==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/unique-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz", + "integrity": "sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg==", + "dev": true, + "dependencies": { + "crypto-random-string": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/update-browserslist-db": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.2.tgz", + "integrity": "sha512-PPypAm5qvlD7XMZC3BujecnaOxwhrtoFR+Dqkk5Aa/6DssiH0ibKoketaj9w8LP7Bont1rYeoV5plxD7RTEPRg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/url-parse": { + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", + "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", + "dev": true, + "dependencies": { + "querystringify": "^2.1.1", + "requires-port": "^1.0.0" + } + }, + "node_modules/v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", + "dev": true, + "license": "MIT" + }, + "node_modules/v8-to-istanbul": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.1.0.tgz", + "integrity": "sha512-6z3GW9x8G1gd+JIIgQQQxXuiJtCXeAjp6RaPEPLv62mH3iPHPxV6W3robxtCzNErRo6ZwTmzWhsbNvjyEBKzKA==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.12", + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^1.6.0" + }, + "engines": { + "node": ">=10.12.0" + } + }, + "node_modules/validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "dependencies": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "node_modules/w3c-keyname": { + "version": "2.2.8", + "resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.8.tgz", + "integrity": "sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/w3c-xmlserializer": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-4.0.0.tgz", + "integrity": "sha512-d+BFHzbiCx6zGfz0HyQ6Rg69w9k19nviJspaj4yNscGjrHu94sVP+aRm75yEbCh+r2/yR+7q6hux9LVtbuTGBw==", + "dev": true, + "dependencies": { + "xml-name-validator": "^4.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/walker": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", + "integrity": "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==", + "dev": true, + "dependencies": { + "makeerror": "1.0.12" + } + }, + "node_modules/webidl-conversions": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/whatwg-encoding": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz", + "integrity": "sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg==", + "dev": true, + "dependencies": { + "iconv-lite": "0.6.3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/whatwg-mimetype": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz", + "integrity": "sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/whatwg-url": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-11.0.0.tgz", + "integrity": "sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ==", + "dev": true, + "dependencies": { + "tr46": "^3.0.0", + "webidl-conversions": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/which-boxed-primitive": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.1.1.tgz", + "integrity": "sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-bigint": "^1.1.0", + "is-boolean-object": "^1.2.1", + "is-number-object": "^1.1.1", + "is-string": "^1.1.1", + "is-symbol": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-builtin-type": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/which-builtin-type/-/which-builtin-type-1.2.1.tgz", + "integrity": "sha512-6iBczoX+kDQ7a3+YJBnh3T+KZRxM/iYNPXicqk66/Qfm1b93iu+yOImkg0zHbj5LNOcNv1TEADiZ0xa34B4q6Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "function.prototype.name": "^1.1.6", + "has-tostringtag": "^1.0.2", + "is-async-function": "^2.0.0", + "is-date-object": "^1.1.0", + "is-finalizationregistry": "^1.1.0", + "is-generator-function": "^1.0.10", + "is-regex": "^1.2.1", + "is-weakref": "^1.0.2", + "isarray": "^2.0.5", + "which-boxed-primitive": "^1.1.0", + "which-collection": "^1.0.2", + "which-typed-array": "^1.1.16" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-builtin-type/node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true, + "license": "MIT" + }, + "node_modules/which-collection": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.2.tgz", + "integrity": "sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-map": "^2.0.3", + "is-set": "^2.0.3", + "is-weakmap": "^2.0.2", + "is-weakset": "^2.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-typed-array": { + "version": "1.1.18", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.18.tgz", + "integrity": "sha512-qEcY+KJYlWyLH9vNbsr6/5j59AXk5ni5aakf8ldzBvGde6Iz4sxZGkJyWSAueTG7QhOvNRYb1lDdFmL5Td0QKA==", + "dev": true, + "license": "MIT", + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "for-each": "^0.3.3", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "node_modules/write-file-atomic": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz", + "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", + "dev": true, + "dependencies": { + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.7" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/ws": { + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.1.tgz", + "integrity": "sha512-RKW2aJZMXeMxVpnZ6bck+RswznaxmzdULiBr6KY7XkTnW8uvt0iT9H5DkHUChXrc+uurzwa0rVI16n/Xzjdz1w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/xml-name-validator": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-4.0.0.tgz", + "integrity": "sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/xmlchars": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", + "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", + "dev": true + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/yargs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + }, + "dependencies": { + "@ampproject/remapping": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz", + "integrity": "sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==", + "dev": true, + "requires": { + "@jridgewell/gen-mapping": "^0.3.0", + "@jridgewell/trace-mapping": "^0.3.9" + } + }, + "@babel/code-frame": { + "version": "7.26.2", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz", + "integrity": "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.25.9", + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" + } + }, + "@babel/compat-data": { + "version": "7.26.8", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.8.tgz", + "integrity": "sha512-oH5UPLMWR3L2wEFLnFJ1TZXqHufiTKAiLfqw5zkhS4dKXLJ10yVztfil/twG8EDTA4F/tvVNw9nOl4ZMslB8rQ==", + "dev": true + }, + "@babel/core": { + "version": "7.26.8", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.26.8.tgz", + "integrity": "sha512-l+lkXCHS6tQEc5oUpK28xBOZ6+HwaH7YwoYQbLFiYb4nS2/l1tKnZEtEWkD0GuiYdvArf9qBS0XlQGXzPMsNqQ==", + "dev": true, + "requires": { + "@ampproject/remapping": "^2.2.0", + "@babel/code-frame": "^7.26.2", + "@babel/generator": "^7.26.8", + "@babel/helper-compilation-targets": "^7.26.5", + "@babel/helper-module-transforms": "^7.26.0", + "@babel/helpers": "^7.26.7", + "@babel/parser": "^7.26.8", + "@babel/template": "^7.26.8", + "@babel/traverse": "^7.26.8", + "@babel/types": "^7.26.8", + "@types/gensync": "^1.0.0", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "dependencies": { + "convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true + }, + "debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "requires": { + "ms": "^2.1.3" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + } + } + }, + "@babel/generator": { + "version": "7.26.8", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.26.8.tgz", + "integrity": "sha512-ef383X5++iZHWAXX0SXQR6ZyQhw/0KtTkrTz61WXRhFM6dhpHulO/RJz79L8S6ugZHJkOOkUrUdxgdF2YiPFnA==", + "dev": true, + "requires": { + "@babel/parser": "^7.26.8", + "@babel/types": "^7.26.8", + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25", + "jsesc": "^3.0.2" + } + }, + "@babel/helper-compilation-targets": { + "version": "7.26.5", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.26.5.tgz", + "integrity": "sha512-IXuyn5EkouFJscIDuFF5EsiSolseme1s0CZB+QxVugqJLYmKdxI1VfIBOst0SUu4rnk2Z7kqTwmoO1lp3HIfnA==", + "dev": true, + "requires": { + "@babel/compat-data": "^7.26.5", + "@babel/helper-validator-option": "^7.25.9", + "browserslist": "^4.24.0", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "dependencies": { + "lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "requires": { + "yallist": "^3.0.2" + } + }, + "yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true + } + } + }, + "@babel/helper-module-imports": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.25.9.tgz", + "integrity": "sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw==", + "dev": true, + "requires": { + "@babel/traverse": "^7.25.9", + "@babel/types": "^7.25.9" + } + }, + "@babel/helper-module-transforms": { + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.26.0.tgz", + "integrity": "sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9", + "@babel/traverse": "^7.25.9" + } + }, + "@babel/helper-plugin-utils": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz", + "integrity": "sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==", + "dev": true + }, + "@babel/helper-string-parser": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz", + "integrity": "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==", + "dev": true + }, + "@babel/helper-validator-identifier": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", + "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", + "dev": true + }, + "@babel/helper-validator-option": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.25.9.tgz", + "integrity": "sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw==", + "dev": true + }, + "@babel/helpers": { + "version": "7.26.10", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.26.10.tgz", + "integrity": "sha512-UPYc3SauzZ3JGgj87GgZ89JVdC5dj0AoetR5Bw6wj4niittNyFh6+eOGonYvJ1ao6B8lEa3Q3klS7ADZ53bc5g==", + "dev": true, + "requires": { + "@babel/template": "^7.26.9", + "@babel/types": "^7.26.10" + } + }, + "@babel/parser": { + "version": "7.26.10", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.10.tgz", + "integrity": "sha512-6aQR2zGE/QFi8JpDLjUZEPYOs7+mhKXm86VaKFiLP35JQwQb6bwUE+XbvkH0EptsYhbNBSUGaUBLKqxH1xSgsA==", + "dev": true, + "requires": { + "@babel/types": "^7.26.10" + } + }, + "@babel/plugin-syntax-async-generators": { + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", + "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-bigint": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz", + "integrity": "sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-class-properties": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz", + "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.12.13" + } + }, + "@babel/plugin-syntax-import-meta": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", + "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-syntax-json-strings": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", + "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-jsx": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.22.5.tgz", + "integrity": "sha512-gvyP4hZrgrs/wWMaocvxZ44Hw0b3W8Pe+cMxc8V1ULQ07oh8VNbIRaoD1LRZVTvD+0nieDKjfgKg89sD7rrKrg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.22.5" + } + }, + "@babel/plugin-syntax-logical-assignment-operators": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", + "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-syntax-nullish-coalescing-operator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", + "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-numeric-separator": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", + "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-syntax-object-rest-spread": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", + "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-optional-catch-binding": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", + "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-optional-chaining": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", + "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-top-level-await": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", + "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.14.5" + } + }, + "@babel/plugin-syntax-typescript": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.22.5.tgz", + "integrity": "sha512-1mS2o03i7t1c6VzH6fdQ3OA8tcEIxwG18zIPRp+UY1Ihv6W+XZzBCVxExF9upussPXJ0xE9XRHwMoNs1ep/nRQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.22.5" + } + }, + "@babel/template": { + "version": "7.26.9", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.26.9.tgz", + "integrity": "sha512-qyRplbeIpNZhmzOysF/wFMuP9sctmh2cFzRAZOn1YapxBsE1i9bJIY586R/WBLfLcmcBlM8ROBiQURnnNy+zfA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.26.2", + "@babel/parser": "^7.26.9", + "@babel/types": "^7.26.9" + } + }, + "@babel/traverse": { + "version": "7.26.8", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.26.8.tgz", + "integrity": "sha512-nic9tRkjYH0oB2dzr/JoGIm+4Q6SuYeLEiIiZDwBscRMYFJ+tMAz98fuel9ZnbXViA2I0HVSSRRK8DW5fjXStA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.26.2", + "@babel/generator": "^7.26.8", + "@babel/parser": "^7.26.8", + "@babel/template": "^7.26.8", + "@babel/types": "^7.26.8", + "debug": "^4.3.1", + "globals": "^11.1.0" + }, + "dependencies": { + "debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "requires": { + "ms": "^2.1.3" + } + }, + "globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + } + } + }, + "@babel/types": { + "version": "7.26.10", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.10.tgz", + "integrity": "sha512-emqcG3vHrpxUKTrxcblR36dcrcoRDvKmnL/dCL6ZsHaShW80qxCAcNhzQZrpeM765VzEos+xOi4s+r4IXzTwdQ==", + "dev": true, + "requires": { + "@babel/helper-string-parser": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9" + } + }, + "@bcoe/v8-coverage": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", + "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", + "dev": true + }, + "@codemirror/autocomplete": { + "version": "6.18.6", + "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.18.6.tgz", + "integrity": "sha512-PHHBXFomUs5DF+9tCOM/UoW6XQ4R44lLNNhRaW9PKPTU0D7lIjRg3ElxaJnTwsl/oHiR93WSXDBrekhoUGCPtg==", + "dev": true, + "requires": { + "@codemirror/language": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.17.0", + "@lezer/common": "^1.0.0" + } + }, + "@codemirror/commands": { + "version": "6.8.1", + "resolved": "https://registry.npmjs.org/@codemirror/commands/-/commands-6.8.1.tgz", + "integrity": "sha512-KlGVYufHMQzxbdQONiLyGQDUW0itrLZwq3CcY7xpv9ZLRHqzkBSoteocBHtMCoY7/Ci4xhzSrToIeLg7FxHuaw==", + "dev": true, + "requires": { + "@codemirror/language": "^6.0.0", + "@codemirror/state": "^6.4.0", + "@codemirror/view": "^6.27.0", + "@lezer/common": "^1.1.0" + } + }, + "@codemirror/lang-javascript": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/@codemirror/lang-javascript/-/lang-javascript-6.2.3.tgz", + "integrity": "sha512-8PR3vIWg7pSu7ur8A07pGiYHgy3hHj+mRYRCSG8q+mPIrl0F02rgpGv+DsQTHRTc30rydOsf5PZ7yjKFg2Ackw==", + "dev": true, + "requires": { + "@codemirror/autocomplete": "^6.0.0", + "@codemirror/language": "^6.6.0", + "@codemirror/lint": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.17.0", + "@lezer/common": "^1.0.0", + "@lezer/javascript": "^1.0.0" + } + }, + "@codemirror/language": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/@codemirror/language/-/language-6.11.0.tgz", + "integrity": "sha512-A7+f++LodNNc1wGgoRDTt78cOwWm9KVezApgjOMp1W4hM0898nsqBXwF+sbePE7ZRcjN7Sa1Z5m2oN27XkmEjQ==", + "dev": true, + "requires": { + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.23.0", + "@lezer/common": "^1.1.0", + "@lezer/highlight": "^1.0.0", + "@lezer/lr": "^1.0.0", + "style-mod": "^4.0.0" + } + }, + "@codemirror/lint": { + "version": "6.8.5", + "resolved": "https://registry.npmjs.org/@codemirror/lint/-/lint-6.8.5.tgz", + "integrity": "sha512-s3n3KisH7dx3vsoeGMxsbRAgKe4O1vbrnKBClm99PU0fWxmxsx5rR2PfqQgIt+2MMJBHbiJ5rfIdLYfB9NNvsA==", + "dev": true, + "requires": { + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.35.0", + "crelt": "^1.0.5" + } + }, + "@codemirror/search": { + "version": "6.5.10", + "resolved": "https://registry.npmjs.org/@codemirror/search/-/search-6.5.10.tgz", + "integrity": "sha512-RMdPdmsrUf53pb2VwflKGHEe1XVM07hI7vV2ntgw1dmqhimpatSJKva4VA9h4TLUDOD4EIF02201oZurpnEFsg==", + "dev": true, + "requires": { + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0", + "crelt": "^1.0.5" + } + }, + "@codemirror/state": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.5.2.tgz", + "integrity": "sha512-FVqsPqtPWKVVL3dPSxy8wEF/ymIEuVzF1PK3VbUgrxXpJUSHQWWZz4JMToquRxnkw+36LTamCZG2iua2Ptq0fA==", + "dev": true, + "requires": { + "@marijn/find-cluster-break": "^1.0.0" + } + }, + "@codemirror/theme-one-dark": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/@codemirror/theme-one-dark/-/theme-one-dark-6.1.2.tgz", + "integrity": "sha512-F+sH0X16j/qFLMAfbciKTxVOwkdAS336b7AXTKOZhy8BR3eH/RelsnLgLFINrpST63mmN2OuwUt0W2ndUgYwUA==", + "dev": true, + "requires": { + "@codemirror/language": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0", + "@lezer/highlight": "^1.0.0" + } + }, + "@codemirror/view": { + "version": "6.36.5", + "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.36.5.tgz", + "integrity": "sha512-cd+FZEUlu3GQCYnguYm3EkhJ8KJVisqqUsCOKedBoAt/d9c76JUUap6U0UrpElln5k6VyrEOYliMuDAKIeDQLg==", + "dev": true, + "requires": { + "@codemirror/state": "^6.5.0", + "style-mod": "^4.1.0", + "w3c-keyname": "^2.2.4" + } + }, + "@corex/deepmerge": { + "version": "4.0.43", + "resolved": "https://registry.npmjs.org/@corex/deepmerge/-/deepmerge-4.0.43.tgz", + "integrity": "sha512-N8uEMrMPL0cu/bdboEWpQYb/0i2K5Qn8eCsxzOmxSggJbbQte7ljMRoXm917AbntqTGOzdTu+vP3KOOzoC70HQ==", + "dev": true + }, + "@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "requires": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "dependencies": { + "@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "requires": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + } + } + }, + "@emnapi/runtime": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.4.0.tgz", + "integrity": "sha512-64WYIf4UYcdLnbKn/umDlNjQDSS8AgZrI/R9+x5ilkUVFxXcA1Ebl+gQLc/6mERA4407Xof0R7wEyEuj091CVw==", + "dev": true, + "optional": true, + "requires": { + "tslib": "^2.4.0" + } + }, + "@esbuild/aix-ppc64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.1.tgz", + "integrity": "sha512-kfYGy8IdzTGy+z0vFGvExZtxkFlA4zAxgKEahG9KE1ScBjpQnFsNOX8KTU5ojNru5ed5CVoJYXFtoxaq5nFbjQ==", + "dev": true, + "optional": true + }, + "@esbuild/android-arm": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.1.tgz", + "integrity": "sha512-dp+MshLYux6j/JjdqVLnMglQlFu+MuVeNrmT5nk6q07wNhCdSnB7QZj+7G8VMUGh1q+vj2Bq8kRsuyA00I/k+Q==", + "dev": true, + "optional": true + }, + "@esbuild/android-arm64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.1.tgz", + "integrity": "sha512-50tM0zCJW5kGqgG7fQ7IHvQOcAn9TKiVRuQ/lN0xR+T2lzEFvAi1ZcS8DiksFcEpf1t/GYOeOfCAgDHFpkiSmA==", + "dev": true, + "optional": true + }, + "@esbuild/android-x64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.1.tgz", + "integrity": "sha512-GCj6WfUtNldqUzYkN/ITtlhwQqGWu9S45vUXs7EIYf+7rCiiqH9bCloatO9VhxsL0Pji+PF4Lz2XXCES+Q8hDw==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-arm64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.1.tgz", + "integrity": "sha512-5hEZKPf+nQjYoSr/elb62U19/l1mZDdqidGfmFutVUjjUZrOazAtwK+Kr+3y0C/oeJfLlxo9fXb1w7L+P7E4FQ==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-x64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.1.tgz", + "integrity": "sha512-hxVnwL2Dqs3fM1IWq8Iezh0cX7ZGdVhbTfnOy5uURtao5OIVCEyj9xIzemDi7sRvKsuSdtCAhMKarxqtlyVyfA==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-arm64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.1.tgz", + "integrity": "sha512-1MrCZs0fZa2g8E+FUo2ipw6jw5qqQiH+tERoS5fAfKnRx6NXH31tXBKI3VpmLijLH6yriMZsxJtaXUyFt/8Y4A==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-x64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.1.tgz", + "integrity": "sha512-0IZWLiTyz7nm0xuIs0q1Y3QWJC52R8aSXxe40VUxm6BB1RNmkODtW6LHvWRrGiICulcX7ZvyH6h5fqdLu4gkww==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.1.tgz", + "integrity": "sha512-NdKOhS4u7JhDKw9G3cY6sWqFcnLITn6SqivVArbzIaf3cemShqfLGHYMx8Xlm/lBit3/5d7kXvriTUGa5YViuQ==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.1.tgz", + "integrity": "sha512-jaN3dHi0/DDPelk0nLcXRm1q7DNJpjXy7yWaWvbfkPvI+7XNSc/lDOnCLN7gzsyzgu6qSAmgSvP9oXAhP973uQ==", + "dev": true, + "optional": true + }, + "@esbuild/linux-ia32": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.1.tgz", + "integrity": "sha512-OJykPaF4v8JidKNGz8c/q1lBO44sQNUQtq1KktJXdBLn1hPod5rE/Hko5ugKKZd+D2+o1a9MFGUEIUwO2YfgkQ==", + "dev": true, + "optional": true + }, + "@esbuild/linux-loong64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.1.tgz", + "integrity": "sha512-nGfornQj4dzcq5Vp835oM/o21UMlXzn79KobKlcs3Wz9smwiifknLy4xDCLUU0BWp7b/houtdrgUz7nOGnfIYg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-mips64el": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.1.tgz", + "integrity": "sha512-1osBbPEFYwIE5IVB/0g2X6i1qInZa1aIoj1TdL4AaAb55xIIgbg8Doq6a5BzYWgr+tEcDzYH67XVnTmUzL+nXg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-ppc64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.1.tgz", + "integrity": "sha512-/6VBJOwUf3TdTvJZ82qF3tbLuWsscd7/1w+D9LH0W/SqUgM5/JJD0lrJ1fVIfZsqB6RFmLCe0Xz3fmZc3WtyVg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-riscv64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.1.tgz", + "integrity": "sha512-nSut/Mx5gnilhcq2yIMLMe3Wl4FK5wx/o0QuuCLMtmJn+WeWYoEGDN1ipcN72g1WHsnIbxGXd4i/MF0gTcuAjQ==", + "dev": true, + "optional": true + }, + "@esbuild/linux-s390x": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.1.tgz", + "integrity": "sha512-cEECeLlJNfT8kZHqLarDBQso9a27o2Zd2AQ8USAEoGtejOrCYHNtKP8XQhMDJMtthdF4GBmjR2au3x1udADQQQ==", + "dev": true, + "optional": true + }, + "@esbuild/linux-x64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.1.tgz", + "integrity": "sha512-xbfUhu/gnvSEg+EGovRc+kjBAkrvtk38RlerAzQxvMzlB4fXpCFCeUAYzJvrnhFtdeyVCDANSjJvOvGYoeKzFA==", + "dev": true, + "optional": true + }, + "@esbuild/netbsd-arm64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.1.tgz", + "integrity": "sha512-O96poM2XGhLtpTh+s4+nP7YCCAfb4tJNRVZHfIE7dgmax+yMP2WgMd2OecBuaATHKTHsLWHQeuaxMRnCsH8+5g==", + "dev": true, + "optional": true + }, + "@esbuild/netbsd-x64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.1.tgz", + "integrity": "sha512-X53z6uXip6KFXBQ+Krbx25XHV/NCbzryM6ehOAeAil7X7oa4XIq+394PWGnwaSQ2WRA0KI6PUO6hTO5zeF5ijA==", + "dev": true, + "optional": true + }, + "@esbuild/openbsd-arm64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.1.tgz", + "integrity": "sha512-Na9T3szbXezdzM/Kfs3GcRQNjHzM6GzFBeU1/6IV/npKP5ORtp9zbQjvkDJ47s6BCgaAZnnnu/cY1x342+MvZg==", + "dev": true, + "optional": true + }, + "@esbuild/openbsd-x64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.1.tgz", + "integrity": "sha512-T3H78X2h1tszfRSf+txbt5aOp/e7TAz3ptVKu9Oyir3IAOFPGV6O9c2naym5TOriy1l0nNf6a4X5UXRZSGX/dw==", + "dev": true, + "optional": true + }, + "@esbuild/sunos-x64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.1.tgz", + "integrity": "sha512-2H3RUvcmULO7dIE5EWJH8eubZAI4xw54H1ilJnRNZdeo8dTADEZ21w6J22XBkXqGJbe0+wnNJtw3UXRoLJnFEg==", + "dev": true, + "optional": true + }, + "@esbuild/win32-arm64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.1.tgz", + "integrity": "sha512-GE7XvrdOzrb+yVKB9KsRMq+7a2U/K5Cf/8grVFRAGJmfADr/e/ODQ134RK2/eeHqYV5eQRFxb1hY7Nr15fv1NQ==", + "dev": true, + "optional": true + }, + "@esbuild/win32-ia32": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.1.tgz", + "integrity": "sha512-uOxSJCIcavSiT6UnBhBzE8wy3n0hOkJsBOzy7HDAuTDE++1DJMRRVCPGisULScHL+a/ZwdXPpXD3IyFKjA7K8A==", + "dev": true, + "optional": true + }, + "@esbuild/win32-x64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.1.tgz", + "integrity": "sha512-Y1EQdcfwMSeQN/ujR5VayLOJ1BHaK+ssyk0AEzPjC+t1lITgsnccPqFjb6V+LsTp/9Iov4ysfjxLaGJ9RPtkVg==", + "dev": true, + "optional": true + }, + "@eslint-community/eslint-utils": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.1.tgz", + "integrity": "sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^3.4.3" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true + } + } + }, + "@eslint-community/regexpp": { + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", + "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==", + "dev": true + }, + "@eslint/config-array": { + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.19.2.tgz", + "integrity": "sha512-GNKqxfHG2ySmJOBSHg7LxeUx4xpuCoFjacmlCoYWEbaPXLwvfIjixRI12xCQZeULksQb23uiA8F40w5TojpV7w==", + "dev": true, + "requires": { + "@eslint/object-schema": "^2.1.6", + "debug": "^4.3.1", + "minimatch": "^3.1.2" + }, + "dependencies": { + "debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "requires": { + "ms": "^2.1.3" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + } + } + }, + "@eslint/core": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.11.0.tgz", + "integrity": "sha512-DWUB2pksgNEb6Bz2fggIy1wh6fGgZP4Xyy/Mt0QZPiloKKXerbqq9D3SBQTlCRYOrcRPu4vuz+CGjwdfqxnoWA==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.15" + } + }, + "@eslint/eslintrc": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.2.0.tgz", + "integrity": "sha512-grOjVNN8P3hjJn/eIETF1wwd12DdnwFDoyceUJLYYdkpbwq3nLi+4fqrTAONx7XDALqlL220wC/RHSC/QTI/0w==", + "dev": true, + "requires": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^10.0.1", + "globals": "^14.0.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "dependencies": { + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "requires": { + "ms": "^2.1.3" + } + }, + "globals": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", + "dev": true + }, + "js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "requires": { + "argparse": "^2.0.1" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + } + } + }, + "@eslint/js": { + "version": "9.20.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.20.0.tgz", + "integrity": "sha512-iZA07H9io9Wn836aVTytRaNqh00Sad+EamwOVJT12GTLw1VGMFV/4JaME+JjLtr9fiGaoWgYnS54wrfWsSs4oQ==", + "dev": true + }, + "@eslint/object-schema": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.6.tgz", + "integrity": "sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA==", + "dev": true + }, + "@eslint/plugin-kit": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.5.tgz", + "integrity": "sha512-lB05FkqEdUg2AA0xEbUz0SnkXT1LcCTa438W4IWTUh4hdOnVbQyOJ81OrDXsJk/LSiJHubgGEFoR5EHq1NsH1A==", + "dev": true, + "requires": { + "@eslint/core": "^0.10.0", + "levn": "^0.4.1" + }, + "dependencies": { + "@eslint/core": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.10.0.tgz", + "integrity": "sha512-gFHJ+xBOo4G3WRlR1e/3G8A6/KZAH6zcE/hkLRCZTi/B9avAG365QhFA8uOGzTMqgTghpn7/fSnscW++dpMSAw==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.15" + } + } + } + }, + "@humanfs/core": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", + "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", + "dev": true + }, + "@humanfs/node": { + "version": "0.16.6", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.6.tgz", + "integrity": "sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==", + "dev": true, + "requires": { + "@humanfs/core": "^0.19.1", + "@humanwhocodes/retry": "^0.3.0" + }, + "dependencies": { + "@humanwhocodes/retry": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.1.tgz", + "integrity": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==", + "dev": true + } + } + }, + "@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true + }, + "@humanwhocodes/retry": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.1.tgz", + "integrity": "sha512-c7hNEllBlenFTHBky65mhq8WD2kbN9Q6gk0bTk8lSBvc554jpXSkST1iePudpt7+A/AQvuHs9EMqjHDXMY1lrA==", + "dev": true + }, + "@img/sharp-darwin-arm64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.33.5.tgz", + "integrity": "sha512-UT4p+iz/2H4twwAoLCqfA9UH5pI6DggwKEGuaPy7nCVQ8ZsiY5PIcrRvD1DzuY3qYL07NtIQcWnBSY/heikIFQ==", + "dev": true, + "optional": true, + "requires": { + "@img/sharp-libvips-darwin-arm64": "1.0.4" + } + }, + "@img/sharp-darwin-x64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.33.5.tgz", + "integrity": "sha512-fyHac4jIc1ANYGRDxtiqelIbdWkIuQaI84Mv45KvGRRxSAa7o7d1ZKAOBaYbnepLC1WqxfpimdeWfvqqSGwR2Q==", + "dev": true, + "optional": true, + "requires": { + "@img/sharp-libvips-darwin-x64": "1.0.4" + } + }, + "@img/sharp-libvips-darwin-arm64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.0.4.tgz", + "integrity": "sha512-XblONe153h0O2zuFfTAbQYAX2JhYmDHeWikp1LM9Hul9gVPjFY427k6dFEcOL72O01QxQsWi761svJ/ev9xEDg==", + "dev": true, + "optional": true + }, + "@img/sharp-libvips-darwin-x64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.0.4.tgz", + "integrity": "sha512-xnGR8YuZYfJGmWPvmlunFaWJsb9T/AO2ykoP3Fz/0X5XV2aoYBPkX6xqCQvUTKKiLddarLaxpzNe+b1hjeWHAQ==", + "dev": true, + "optional": true + }, + "@img/sharp-libvips-linux-arm": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.0.5.tgz", + "integrity": "sha512-gvcC4ACAOPRNATg/ov8/MnbxFDJqf/pDePbBnuBDcjsI8PssmjoKMAz4LtLaVi+OnSb5FK/yIOamqDwGmXW32g==", + "dev": true, + "optional": true + }, + "@img/sharp-libvips-linux-arm64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.0.4.tgz", + "integrity": "sha512-9B+taZ8DlyyqzZQnoeIvDVR/2F4EbMepXMc/NdVbkzsJbzkUjhXv/70GQJ7tdLA4YJgNP25zukcxpX2/SueNrA==", + "dev": true, + "optional": true + }, + "@img/sharp-libvips-linux-s390x": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.0.4.tgz", + "integrity": "sha512-u7Wz6ntiSSgGSGcjZ55im6uvTrOxSIS8/dgoVMoiGE9I6JAfU50yH5BoDlYA1tcuGS7g/QNtetJnxA6QEsCVTA==", + "dev": true, + "optional": true + }, + "@img/sharp-libvips-linux-x64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.0.4.tgz", + "integrity": "sha512-MmWmQ3iPFZr0Iev+BAgVMb3ZyC4KeFc3jFxnNbEPas60e1cIfevbtuyf9nDGIzOaW9PdnDciJm+wFFaTlj5xYw==", + "dev": true, + "optional": true + }, + "@img/sharp-libvips-linuxmusl-arm64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.0.4.tgz", + "integrity": "sha512-9Ti+BbTYDcsbp4wfYib8Ctm1ilkugkA/uscUn6UXK1ldpC1JjiXbLfFZtRlBhjPZ5o1NCLiDbg8fhUPKStHoTA==", + "dev": true, + "optional": true + }, + "@img/sharp-libvips-linuxmusl-x64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.0.4.tgz", + "integrity": "sha512-viYN1KX9m+/hGkJtvYYp+CCLgnJXwiQB39damAO7WMdKWlIhmYTfHjwSbQeUK/20vY154mwezd9HflVFM1wVSw==", + "dev": true, + "optional": true + }, + "@img/sharp-linux-arm": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.33.5.tgz", + "integrity": "sha512-JTS1eldqZbJxjvKaAkxhZmBqPRGmxgu+qFKSInv8moZ2AmT5Yib3EQ1c6gp493HvrvV8QgdOXdyaIBrhvFhBMQ==", + "dev": true, + "optional": true, + "requires": { + "@img/sharp-libvips-linux-arm": "1.0.5" + } + }, + "@img/sharp-linux-arm64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.33.5.tgz", + "integrity": "sha512-JMVv+AMRyGOHtO1RFBiJy/MBsgz0x4AWrT6QoEVVTyh1E39TrCUpTRI7mx9VksGX4awWASxqCYLCV4wBZHAYxA==", + "dev": true, + "optional": true, + "requires": { + "@img/sharp-libvips-linux-arm64": "1.0.4" + } + }, + "@img/sharp-linux-s390x": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.33.5.tgz", + "integrity": "sha512-y/5PCd+mP4CA/sPDKl2961b+C9d+vPAveS33s6Z3zfASk2j5upL6fXVPZi7ztePZ5CuH+1kW8JtvxgbuXHRa4Q==", + "dev": true, + "optional": true, + "requires": { + "@img/sharp-libvips-linux-s390x": "1.0.4" + } + }, + "@img/sharp-linux-x64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.33.5.tgz", + "integrity": "sha512-opC+Ok5pRNAzuvq1AG0ar+1owsu842/Ab+4qvU879ippJBHvyY5n2mxF1izXqkPYlGuP/M556uh53jRLJmzTWA==", + "dev": true, + "optional": true, + "requires": { + "@img/sharp-libvips-linux-x64": "1.0.4" + } + }, + "@img/sharp-linuxmusl-arm64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.33.5.tgz", + "integrity": "sha512-XrHMZwGQGvJg2V/oRSUfSAfjfPxO+4DkiRh6p2AFjLQztWUuY/o8Mq0eMQVIY7HJ1CDQUJlxGGZRw1a5bqmd1g==", + "dev": true, + "optional": true, + "requires": { + "@img/sharp-libvips-linuxmusl-arm64": "1.0.4" + } + }, + "@img/sharp-linuxmusl-x64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.33.5.tgz", + "integrity": "sha512-WT+d/cgqKkkKySYmqoZ8y3pxx7lx9vVejxW/W4DOFMYVSkErR+w7mf2u8m/y4+xHe7yY9DAXQMWQhpnMuFfScw==", + "dev": true, + "optional": true, + "requires": { + "@img/sharp-libvips-linuxmusl-x64": "1.0.4" + } + }, + "@img/sharp-wasm32": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.33.5.tgz", + "integrity": "sha512-ykUW4LVGaMcU9lu9thv85CbRMAwfeadCJHRsg2GmeRa/cJxsVY9Rbd57JcMxBkKHag5U/x7TSBpScF4U8ElVzg==", + "dev": true, + "optional": true, + "requires": { + "@emnapi/runtime": "^1.2.0" + } + }, + "@img/sharp-win32-ia32": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.33.5.tgz", + "integrity": "sha512-T36PblLaTwuVJ/zw/LaH0PdZkRz5rd3SmMHX8GSmR7vtNSP5Z6bQkExdSK7xGWyxLw4sUknBuugTelgw2faBbQ==", + "dev": true, + "optional": true + }, + "@img/sharp-win32-x64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.33.5.tgz", + "integrity": "sha512-MpY/o8/8kj+EcnxwvrP4aTJSWw/aZ7JIGR4aBeZkZw5B7/Jn+tY9/VNwtcoGmdT7GfggGIU4kygOMSbYnOrAbg==", + "dev": true, + "optional": true + }, + "@istanbuljs/load-nyc-config": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", + "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", + "dev": true, + "requires": { + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "get-package-type": "^0.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" + }, + "dependencies": { + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true + } + } + }, + "@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true + }, + "@jdeniau/immutable-devtools": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@jdeniau/immutable-devtools/-/immutable-devtools-0.2.0.tgz", + "integrity": "sha512-kncZLhyszWkGz0wAr8eoHFvhczuZz5Ud71OiLIhe5PFQ05nnLgsFdr520Qy+eHhMSL6roJYFrZ73ZJTv48/fUg==", + "dev": true + }, + "@jest/console": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.6.4.tgz", + "integrity": "sha512-wNK6gC0Ha9QeEPSkeJedQuTQqxZYnDPuDcDhVuVatRvMkL4D0VTvFVZj+Yuh6caG2aOfzkUZ36KtCmLNtR02hw==", + "dev": true, + "requires": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "jest-message-util": "^29.6.3", + "jest-util": "^29.6.3", + "slash": "^3.0.0" + } + }, + "@jest/core": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.6.4.tgz", + "integrity": "sha512-U/vq5ccNTSVgYH7mHnodHmCffGWHJnz/E1BEWlLuK5pM4FZmGfBn/nrJGLjUsSmyx3otCeqc1T31F4y08AMDLg==", + "dev": true, + "requires": { + "@jest/console": "^29.6.4", + "@jest/reporters": "^29.6.4", + "@jest/test-result": "^29.6.4", + "@jest/transform": "^29.6.4", + "@jest/types": "^29.6.3", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "jest-changed-files": "^29.6.3", + "jest-config": "^29.6.4", + "jest-haste-map": "^29.6.4", + "jest-message-util": "^29.6.3", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.6.4", + "jest-resolve-dependencies": "^29.6.4", + "jest-runner": "^29.6.4", + "jest-runtime": "^29.6.4", + "jest-snapshot": "^29.6.4", + "jest-util": "^29.6.3", + "jest-validate": "^29.6.3", + "jest-watcher": "^29.6.4", + "micromatch": "^4.0.4", + "pretty-format": "^29.6.3", + "slash": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "@jest/environment": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz", + "integrity": "sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==", + "dev": true, + "requires": { + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-mock": "^29.7.0" + } + }, + "@jest/expect": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==", + "dev": true, + "requires": { + "expect": "^29.7.0", + "jest-snapshot": "^29.7.0" + } + }, + "@jest/expect-utils": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.7.0.tgz", + "integrity": "sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==", + "dev": true, + "requires": { + "jest-get-type": "^29.6.3" + } + }, + "@jest/fake-timers": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.7.0.tgz", + "integrity": "sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==", + "dev": true, + "requires": { + "@jest/types": "^29.6.3", + "@sinonjs/fake-timers": "^10.0.2", + "@types/node": "*", + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" + } + }, + "@jest/globals": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.7.0.tgz", + "integrity": "sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==", + "dev": true, + "requires": { + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/types": "^29.6.3", + "jest-mock": "^29.7.0" + } + }, + "@jest/reporters": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.6.4.tgz", + "integrity": "sha512-sxUjWxm7QdchdrD3NfWKrL8FBsortZeibSJv4XLjESOOjSUOkjQcb0ZHJwfhEGIvBvTluTzfG2yZWZhkrXJu8g==", + "dev": true, + "requires": { + "@bcoe/v8-coverage": "^0.2.3", + "@jest/console": "^29.6.4", + "@jest/test-result": "^29.6.4", + "@jest/transform": "^29.6.4", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", + "@types/node": "*", + "chalk": "^4.0.0", + "collect-v8-coverage": "^1.0.0", + "exit": "^0.1.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-instrument": "^6.0.0", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.1.3", + "jest-message-util": "^29.6.3", + "jest-util": "^29.6.3", + "jest-worker": "^29.6.4", + "slash": "^3.0.0", + "string-length": "^4.0.1", + "strip-ansi": "^6.0.0", + "v8-to-istanbul": "^9.0.1" + }, + "dependencies": { + "istanbul-lib-instrument": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.3.tgz", + "integrity": "sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==", + "dev": true, + "requires": { + "@babel/core": "^7.23.9", + "@babel/parser": "^7.23.9", + "@istanbuljs/schema": "^0.1.3", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^7.5.4" + } + }, + "semver": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "dev": true + } + } + }, + "@jest/schemas": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", + "dev": true, + "requires": { + "@sinclair/typebox": "^0.27.8" + } + }, + "@jest/source-map": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.3.tgz", + "integrity": "sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==", + "dev": true, + "requires": { + "@jridgewell/trace-mapping": "^0.3.18", + "callsites": "^3.0.0", + "graceful-fs": "^4.2.9" + } + }, + "@jest/test-result": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.6.4.tgz", + "integrity": "sha512-uQ1C0AUEN90/dsyEirgMLlouROgSY+Wc/JanVVk0OiUKa5UFh7sJpMEM3aoUBAz2BRNvUJ8j3d294WFuRxSyOQ==", + "dev": true, + "requires": { + "@jest/console": "^29.6.4", + "@jest/types": "^29.6.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "collect-v8-coverage": "^1.0.0" + } + }, + "@jest/test-sequencer": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.6.4.tgz", + "integrity": "sha512-E84M6LbpcRq3fT4ckfKs9ryVanwkaIB0Ws9bw3/yP4seRLg/VaCZ/LgW0MCq5wwk4/iP/qnilD41aj2fsw2RMg==", + "dev": true, + "requires": { + "@jest/test-result": "^29.6.4", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.6.4", + "slash": "^3.0.0" + } + }, + "@jest/transform": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz", + "integrity": "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==", + "dev": true, + "requires": { + "@babel/core": "^7.11.6", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", + "babel-plugin-istanbul": "^6.1.1", + "chalk": "^4.0.0", + "convert-source-map": "^2.0.0", + "fast-json-stable-stringify": "^2.1.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "micromatch": "^4.0.4", + "pirates": "^4.0.4", + "slash": "^3.0.0", + "write-file-atomic": "^4.0.2" + }, + "dependencies": { + "convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true + } + } + }, + "@jest/types": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", + "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", + "dev": true, + "requires": { + "@jest/schemas": "^29.6.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^17.0.8", + "chalk": "^4.0.0" + } + }, + "@jridgewell/gen-mapping": { + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz", + "integrity": "sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==", + "dev": true, + "requires": { + "@jridgewell/set-array": "^1.2.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "@jridgewell/resolve-uri": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", + "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "dev": true + }, + "@jridgewell/set-array": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", + "dev": true + }, + "@jridgewell/source-map": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.5.tgz", + "integrity": "sha512-UTYAUj/wviwdsMfzoSJspJxbkH5o1snzwX0//0ENX1u/55kkZZkcTZP6u9bwKGkv+dkk9at4m1Cpt0uY80kcpQ==", + "dev": true, + "requires": { + "@jridgewell/gen-mapping": "^0.3.0", + "@jridgewell/trace-mapping": "^0.3.9" + } + }, + "@jridgewell/sourcemap-codec": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", + "dev": true + }, + "@jridgewell/trace-mapping": { + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "dev": true, + "requires": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "@lezer/common": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.2.3.tgz", + "integrity": "sha512-w7ojc8ejBqr2REPsWxJjrMFsA/ysDCFICn8zEOR9mrqzOu2amhITYuLD8ag6XZf0CFXDrhKqw7+tW8cX66NaDA==", + "dev": true + }, + "@lezer/highlight": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@lezer/highlight/-/highlight-1.2.1.tgz", + "integrity": "sha512-Z5duk4RN/3zuVO7Jq0pGLJ3qynpxUVsh7IbUbGj88+uV2ApSAn6kWg2au3iJb+0Zi7kKtqffIESgNcRXWZWmSA==", + "dev": true, + "requires": { + "@lezer/common": "^1.0.0" + } + }, + "@lezer/javascript": { + "version": "1.4.21", + "resolved": "https://registry.npmjs.org/@lezer/javascript/-/javascript-1.4.21.tgz", + "integrity": "sha512-lL+1fcuxWYPURMM/oFZLEDm0XuLN128QPV+VuGtKpeaOGdcl9F2LYC3nh1S9LkPqx9M0mndZFdXCipNAZpzIkQ==", + "dev": true, + "requires": { + "@lezer/common": "^1.2.0", + "@lezer/highlight": "^1.1.3", + "@lezer/lr": "^1.3.0" + } + }, + "@lezer/lr": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/@lezer/lr/-/lr-1.4.2.tgz", + "integrity": "sha512-pu0K1jCIdnQ12aWNaAVU5bzi7Bd1w54J3ECgANPmYLtQKP0HBj2cE/5coBD66MT10xbtIuUr7tg0Shbsvk0mDA==", + "dev": true, + "requires": { + "@lezer/common": "^1.0.0" + } + }, + "@marijn/find-cluster-break": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@marijn/find-cluster-break/-/find-cluster-break-1.0.2.tgz", + "integrity": "sha512-l0h88YhZFyKdXIFNfSWpyjStDjGHwZ/U7iobcK1cQQD8sejsONdQtTVU+1wVN1PBw40PiiHB1vA5S7VTfQiP9g==", + "dev": true + }, + "@next/env": { + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/@next/env/-/env-15.2.4.tgz", + "integrity": "sha512-+SFtMgoiYP3WoSswuNmxJOCwi06TdWE733D+WPjpXIe4LXGULwEaofiiAy6kbS0+XjM5xF5n3lKuBwN2SnqD9g==", + "dev": true + }, + "@next/swc-darwin-arm64": { + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-15.2.4.tgz", + "integrity": "sha512-1AnMfs655ipJEDC/FHkSr0r3lXBgpqKo4K1kiwfUf3iE68rDFXZ1TtHdMvf7D0hMItgDZ7Vuq3JgNMbt/+3bYw==", + "dev": true, + "optional": true + }, + "@next/swc-darwin-x64": { + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-15.2.4.tgz", + "integrity": "sha512-3qK2zb5EwCwxnO2HeO+TRqCubeI/NgCe+kL5dTJlPldV/uwCnUgC7VbEzgmxbfrkbjehL4H9BPztWOEtsoMwew==", + "dev": true, + "optional": true + }, + "@next/swc-linux-arm64-gnu": { + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-15.2.4.tgz", + "integrity": "sha512-HFN6GKUcrTWvem8AZN7tT95zPb0GUGv9v0d0iyuTb303vbXkkbHDp/DxufB04jNVD+IN9yHy7y/6Mqq0h0YVaQ==", + "dev": true, + "optional": true + }, + "@next/swc-linux-arm64-musl": { + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-15.2.4.tgz", + "integrity": "sha512-Oioa0SORWLwi35/kVB8aCk5Uq+5/ZIumMK1kJV+jSdazFm2NzPDztsefzdmzzpx5oGCJ6FkUC7vkaUseNTStNA==", + "dev": true, + "optional": true + }, + "@next/swc-linux-x64-gnu": { + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-15.2.4.tgz", + "integrity": "sha512-yb5WTRaHdkgOqFOZiu6rHV1fAEK0flVpaIN2HB6kxHVSy/dIajWbThS7qON3W9/SNOH2JWkVCyulgGYekMePuw==", + "dev": true, + "optional": true + }, + "@next/swc-linux-x64-musl": { + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-15.2.4.tgz", + "integrity": "sha512-Dcdv/ix6srhkM25fgXiyOieFUkz+fOYkHlydWCtB0xMST6X9XYI3yPDKBZt1xuhOytONsIFJFB08xXYsxUwJLw==", + "dev": true, + "optional": true + }, + "@next/swc-win32-arm64-msvc": { + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-15.2.4.tgz", + "integrity": "sha512-dW0i7eukvDxtIhCYkMrZNQfNicPDExt2jPb9AZPpL7cfyUo7QSNl1DjsHjmmKp6qNAqUESyT8YFl/Aw91cNJJg==", + "dev": true, + "optional": true + }, + "@next/swc-win32-x64-msvc": { + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-15.2.4.tgz", + "integrity": "sha512-SbnWkJmkS7Xl3kre8SdMF6F/XDh1DTFEhp0jRTj/uB8iPKoU2bb2NDfcu+iifv1+mxQEd1g2vvSxcZbXSKyWiQ==", + "dev": true, + "optional": true + }, + "@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + } + }, + "@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true + }, + "@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "requires": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + } + }, + "@nolyfill/is-core-module": { + "version": "1.0.39", + "resolved": "https://registry.npmjs.org/@nolyfill/is-core-module/-/is-core-module-1.0.39.tgz", + "integrity": "sha512-nn5ozdjYQpUCZlWGuxcJY/KpxkWQs4DcbMCmKojjyrYDEAGy4Ce19NN4v5MduafTwJlbKc99UA8YhSVqq9yPZA==", + "dev": true + }, + "@rollup/plugin-buble": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@rollup/plugin-buble/-/plugin-buble-1.0.3.tgz", + "integrity": "sha512-QYD9BKkJoof0FdCFeSYYhF6/Y8e0Mnf+098xGgmWOFJ4UPHlWujjqOYeVwEm2hJPOmlR5k7HPUdAjqtOWhN64Q==", + "dev": true, + "requires": { + "@rollup/pluginutils": "^5.0.1", + "@types/buble": "^0.19.2", + "buble": "^0.20.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "buble": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/buble/-/buble-0.20.0.tgz", + "integrity": "sha512-/1gnaMQE8xvd5qsNBl+iTuyjJ9XxeaVxAMF86dQ4EyxFJOZtsgOS8Ra+7WHgZTam5IFDtt4BguN0sH0tVTKrOw==", + "dev": true, + "requires": { + "acorn": "^6.4.1", + "acorn-dynamic-import": "^4.0.0", + "acorn-jsx": "^5.2.0", + "chalk": "^2.4.2", + "magic-string": "^0.25.7", + "minimist": "^1.2.5", + "regexpu-core": "4.5.4" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true + }, + "regexpu-core": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.5.4.tgz", + "integrity": "sha512-BtizvGtFQKGPUcTy56o3nk1bGRp4SZOTYrDtGNlqCQufptV5IkkLN6Emw+yunAJjzf+C9FQFtvq7IoA3+oMYHQ==", + "dev": true, + "requires": { + "regenerate": "^1.4.0", + "regenerate-unicode-properties": "^8.0.2", + "regjsgen": "^0.5.0", + "regjsparser": "^0.6.0", + "unicode-match-property-ecmascript": "^1.0.4", + "unicode-match-property-value-ecmascript": "^1.1.0" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "@rollup/plugin-commonjs": { + "version": "28.0.2", + "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-28.0.2.tgz", + "integrity": "sha512-BEFI2EDqzl+vA1rl97IDRZ61AIwGH093d9nz8+dThxJNH8oSoB7MjWvPCX3dkaK1/RCJ/1v/R1XB15FuSs0fQw==", + "dev": true, + "requires": { + "@rollup/pluginutils": "^5.0.1", + "commondir": "^1.0.1", + "estree-walker": "^2.0.2", + "fdir": "^6.2.0", + "is-reference": "1.2.1", + "magic-string": "^0.30.3", + "picomatch": "^4.0.2" + }, + "dependencies": { + "fdir": { + "version": "6.4.3", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.3.tgz", + "integrity": "sha512-PMXmW2y1hDDfTSRc9gaXIuCCRpuoz3Kaz8cUelp3smouvfT632ozg2vrT6lJsHKKOF59YLbOGfAWGUcKEfRMQw==", + "dev": true, + "requires": {} + }, + "magic-string": { + "version": "0.30.17", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.17.tgz", + "integrity": "sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==", + "dev": true, + "requires": { + "@jridgewell/sourcemap-codec": "^1.5.0" + } + }, + "picomatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "dev": true + } + } + }, + "@rollup/plugin-json": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-json/-/plugin-json-6.1.0.tgz", + "integrity": "sha512-EGI2te5ENk1coGeADSIwZ7G2Q8CJS2sF120T7jLw4xFw9n7wIOXHo+kIYRAoVpJAN+kmqZSoO3Fp4JtoNF4ReA==", + "dev": true, + "requires": { + "@rollup/pluginutils": "^5.1.0" + } + }, + "@rollup/plugin-terser": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/@rollup/plugin-terser/-/plugin-terser-0.4.4.tgz", + "integrity": "sha512-XHeJC5Bgvs8LfukDwWZp7yeqin6ns8RTl2B9avbejt6tZqsqvVoWI7ZTQrcNsfKEDWBTnTxM8nMDkO2IFFbd0A==", + "dev": true, + "requires": { + "serialize-javascript": "^6.0.1", + "smob": "^1.0.0", + "terser": "^5.17.4" + } + }, + "@rollup/plugin-typescript": { + "version": "12.1.2", + "resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-12.1.2.tgz", + "integrity": "sha512-cdtSp154H5sv637uMr1a8OTWB0L1SWDSm1rDGiyfcGcvQ6cuTs4MDk2BVEBGysUWago4OJN4EQZqOTl/QY3Jgg==", + "dev": true, + "requires": { + "@rollup/pluginutils": "^5.1.0", + "resolve": "^1.22.1" + } + }, + "@rollup/pluginutils": { + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.4.tgz", + "integrity": "sha512-USm05zrsFxYLPdWWq+K3STlWiT/3ELn3RcV5hJMghpeAIhxfsUIg6mt12CBJBInWMV4VneoV7SfGv8xIwo2qNQ==", + "dev": true, + "requires": { + "@types/estree": "^1.0.0", + "estree-walker": "^2.0.2", + "picomatch": "^4.0.2" + }, + "dependencies": { + "picomatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "dev": true + } + } + }, + "@rollup/rollup-android-arm-eabi": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.34.8.tgz", + "integrity": "sha512-q217OSE8DTp8AFHuNHXo0Y86e1wtlfVrXiAlwkIvGRQv9zbc6mE3sjIVfwI8sYUyNxwOg0j/Vm1RKM04JcWLJw==", + "dev": true, + "optional": true + }, + "@rollup/rollup-android-arm64": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.34.8.tgz", + "integrity": "sha512-Gigjz7mNWaOL9wCggvoK3jEIUUbGul656opstjaUSGC3eT0BM7PofdAJaBfPFWWkXNVAXbaQtC99OCg4sJv70Q==", + "dev": true, + "optional": true + }, + "@rollup/rollup-darwin-arm64": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.34.8.tgz", + "integrity": "sha512-02rVdZ5tgdUNRxIUrFdcMBZQoaPMrxtwSb+/hOfBdqkatYHR3lZ2A2EGyHq2sGOd0Owk80oV3snlDASC24He3Q==", + "dev": true, + "optional": true + }, + "@rollup/rollup-darwin-x64": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.34.8.tgz", + "integrity": "sha512-qIP/elwR/tq/dYRx3lgwK31jkZvMiD6qUtOycLhTzCvrjbZ3LjQnEM9rNhSGpbLXVJYQ3rq39A6Re0h9tU2ynw==", + "dev": true, + "optional": true + }, + "@rollup/rollup-freebsd-arm64": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.34.8.tgz", + "integrity": "sha512-IQNVXL9iY6NniYbTaOKdrlVP3XIqazBgJOVkddzJlqnCpRi/yAeSOa8PLcECFSQochzqApIOE1GHNu3pCz+BDA==", + "dev": true, + "optional": true + }, + "@rollup/rollup-freebsd-x64": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.34.8.tgz", + "integrity": "sha512-TYXcHghgnCqYFiE3FT5QwXtOZqDj5GmaFNTNt3jNC+vh22dc/ukG2cG+pi75QO4kACohZzidsq7yKTKwq/Jq7Q==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.34.8.tgz", + "integrity": "sha512-A4iphFGNkWRd+5m3VIGuqHnG3MVnqKe7Al57u9mwgbyZ2/xF9Jio72MaY7xxh+Y87VAHmGQr73qoKL9HPbXj1g==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-arm-musleabihf": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.34.8.tgz", + "integrity": "sha512-S0lqKLfTm5u+QTxlFiAnb2J/2dgQqRy/XvziPtDd1rKZFXHTyYLoVL58M/XFwDI01AQCDIevGLbQrMAtdyanpA==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-arm64-gnu": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.34.8.tgz", + "integrity": "sha512-jpz9YOuPiSkL4G4pqKrus0pn9aYwpImGkosRKwNi+sJSkz+WU3anZe6hi73StLOQdfXYXC7hUfsQlTnjMd3s1A==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-arm64-musl": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.34.8.tgz", + "integrity": "sha512-KdSfaROOUJXgTVxJNAZ3KwkRc5nggDk+06P6lgi1HLv1hskgvxHUKZ4xtwHkVYJ1Rep4GNo+uEfycCRRxht7+Q==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-loongarch64-gnu": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.34.8.tgz", + "integrity": "sha512-NyF4gcxwkMFRjgXBM6g2lkT58OWztZvw5KkV2K0qqSnUEqCVcqdh2jN4gQrTn/YUpAcNKyFHfoOZEer9nwo6uQ==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-powerpc64le-gnu": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.34.8.tgz", + "integrity": "sha512-LMJc999GkhGvktHU85zNTDImZVUCJ1z/MbAJTnviiWmmjyckP5aQsHtcujMjpNdMZPT2rQEDBlJfubhs3jsMfw==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-riscv64-gnu": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.34.8.tgz", + "integrity": "sha512-xAQCAHPj8nJq1PI3z8CIZzXuXCstquz7cIOL73HHdXiRcKk8Ywwqtx2wrIy23EcTn4aZ2fLJNBB8d0tQENPCmw==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-s390x-gnu": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.34.8.tgz", + "integrity": "sha512-DdePVk1NDEuc3fOe3dPPTb+rjMtuFw89gw6gVWxQFAuEqqSdDKnrwzZHrUYdac7A7dXl9Q2Vflxpme15gUWQFA==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-x64-gnu": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.34.8.tgz", + "integrity": "sha512-8y7ED8gjxITUltTUEJLQdgpbPh1sUQ0kMTmufRF/Ns5tI9TNMNlhWtmPKKHCU0SilX+3MJkZ0zERYYGIVBYHIA==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-x64-musl": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.34.8.tgz", + "integrity": "sha512-SCXcP0ZpGFIe7Ge+McxY5zKxiEI5ra+GT3QRxL0pMMtxPfpyLAKleZODi1zdRHkz5/BhueUrYtYVgubqe9JBNQ==", + "dev": true, + "optional": true + }, + "@rollup/rollup-win32-arm64-msvc": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.34.8.tgz", + "integrity": "sha512-YHYsgzZgFJzTRbth4h7Or0m5O74Yda+hLin0irAIobkLQFRQd1qWmnoVfwmKm9TXIZVAD0nZ+GEb2ICicLyCnQ==", + "dev": true, + "optional": true + }, + "@rollup/rollup-win32-ia32-msvc": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.34.8.tgz", + "integrity": "sha512-r3NRQrXkHr4uWy5TOjTpTYojR9XmF0j/RYgKCef+Ag46FWUTltm5ziticv8LdNsDMehjJ543x/+TJAek/xBA2w==", + "dev": true, + "optional": true + }, + "@rollup/rollup-win32-x64-msvc": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.34.8.tgz", + "integrity": "sha512-U0FaE5O1BCpZSeE6gBl3c5ObhePQSfk9vDRToMmTkbhCOgW4jqvtS5LGyQ76L1fH8sM0keRp4uDTsbjiUyjk0g==", + "dev": true, + "optional": true + }, + "@rtsao/scc": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@rtsao/scc/-/scc-1.1.0.tgz", + "integrity": "sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==", + "dev": true + }, + "@sinclair/typebox": { + "version": "0.27.8", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", + "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "dev": true + }, + "@sinonjs/commons": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.0.tgz", + "integrity": "sha512-jXBtWAF4vmdNmZgD5FoKsVLv3rPgDnLgPbU84LIJ3otV44vJlDRokVng5v8NFJdCf/da9legHcKaRuZs4L7faA==", + "dev": true, + "requires": { + "type-detect": "4.0.8" + } + }, + "@sinonjs/fake-timers": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz", + "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==", + "dev": true, + "requires": { + "@sinonjs/commons": "^3.0.0" + } + }, + "@size-limit/esbuild-why": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/@size-limit/esbuild-why/-/esbuild-why-11.2.0.tgz", + "integrity": "sha512-VtoQbbkvFbF314LWEaEp1+IjG0DH+9w6nP//D6Gd48SEAPLoBgqk287mjYTF9WYxg9N5lo8KjpXxEFk4gOXNpw==", + "dev": true, + "requires": { + "esbuild-visualizer": "^0.7.0", + "open": "^10.1.0" + } + }, + "@size-limit/preset-small-lib": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/@size-limit/preset-small-lib/-/preset-small-lib-11.2.0.tgz", + "integrity": "sha512-RFbbIVfv8/QDgTPyXzjo5NKO6CYyK5Uq5xtNLHLbw5RgSKrgo8WpiB/fNivZuNd/5Wk0s91PtaJ9ThNcnFuI3g==", + "dev": true, + "requires": { + "@size-limit/esbuild": "11.2.0", + "@size-limit/file": "11.2.0", + "size-limit": "11.2.0" + }, + "dependencies": { + "@size-limit/esbuild": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/@size-limit/esbuild/-/esbuild-11.2.0.tgz", + "integrity": "sha512-vSg9H0WxGQPRzDnBzeDyD9XT0Zdq0L+AI3+77/JhxznbSCMJMMr8ndaWVQRhOsixl97N0oD4pRFw2+R1Lcvi6A==", + "dev": true, + "requires": { + "esbuild": "^0.25.0", + "nanoid": "^5.1.0" + } + }, + "@size-limit/file": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/@size-limit/file/-/file-11.2.0.tgz", + "integrity": "sha512-OZHE3putEkQ/fgzz3Tp/0hSmfVo3wyTpOJSRNm6AmcwX4Nm9YtTfbQQ/hZRwbBFR23S7x2Sd9EbqYzngKwbRoA==", + "dev": true, + "requires": {} + }, + "nanoid": { + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-5.1.4.tgz", + "integrity": "sha512-GTFcMIDgR7tqji/LpSY8rtg464VnJl/j6ypoehYnuGb+Y8qZUdtKB8WVCXon0UEZgFDbuUxpIl//6FHLHgXSNA==", + "dev": true + } + } + }, + "@swc/counter": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@swc/counter/-/counter-0.1.3.tgz", + "integrity": "sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ==", + "dev": true + }, + "@swc/helpers": { + "version": "0.5.15", + "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.15.tgz", + "integrity": "sha512-JQ5TuMi45Owi4/BIMAJBoSQoOJu12oOk/gADqlcUL9JEdHB8vyjUSsxqeNXnmXHjYKMi2WcYtezGEEhqUI/E2g==", + "dev": true, + "requires": { + "tslib": "^2.8.0" + } + }, + "@tootallnate/once": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", + "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", + "dev": true + }, + "@tsconfig/node10": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.11.tgz", + "integrity": "sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==", + "dev": true + }, + "@tsconfig/node12": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", + "dev": true + }, + "@tsconfig/node14": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", + "dev": true + }, + "@tsconfig/node16": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", + "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", + "dev": true + }, + "@types/babel__core": { + "version": "7.20.1", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.1.tgz", + "integrity": "sha512-aACu/U/omhdk15O4Nfb+fHgH/z3QsfQzpnvRZhYhThms83ZnAOZz7zZAWO7mn2yyNQaA4xTO8GLK3uqFU4bYYw==", + "dev": true, + "requires": { + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" + } + }, + "@types/babel__generator": { + "version": "7.6.4", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.4.tgz", + "integrity": "sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg==", + "dev": true, + "requires": { + "@babel/types": "^7.0.0" + } + }, + "@types/babel__template": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.1.tgz", + "integrity": "sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==", + "dev": true, + "requires": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "@types/babel__traverse": { + "version": "7.20.1", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.1.tgz", + "integrity": "sha512-MitHFXnhtgwsGZWtT68URpOvLN4EREih1u3QtQiN4VdAxWKRVvGCSvw/Qth0M0Qq3pJpnGOu5JaM/ydK7OGbqg==", + "dev": true, + "requires": { + "@babel/types": "^7.20.7" + } + }, + "@types/buble": { + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/@types/buble/-/buble-0.19.2.tgz", + "integrity": "sha512-uUD8zIfXMKThmFkahTXDGI3CthFH1kMg2dOm3KLi4GlC5cbARA64bEcUMbbWdWdE73eoc/iBB9PiTMqH0dNS2Q==", + "dev": true, + "requires": { + "magic-string": "^0.25.0" + } + }, + "@types/estree": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", + "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", + "dev": true + }, + "@types/gensync": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@types/gensync/-/gensync-1.0.4.tgz", + "integrity": "sha512-C3YYeRQWp2fmq9OryX+FoDy8nXS6scQ7dPptD8LnFDAUNcKWJjXQKDNJD3HVm+kOUsXhTOkpi69vI4EuAr95bA==", + "dev": true + }, + "@types/graceful-fs": { + "version": "4.1.6", + "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.6.tgz", + "integrity": "sha512-Sig0SNORX9fdW+bQuTEovKj3uHcUL6LQKbCrrqb1X7J6/ReAbhCXRAhc+SMejhLELFj2QcyuxmUooZ4bt5ReSw==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/istanbul-lib-coverage": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz", + "integrity": "sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==", + "dev": true + }, + "@types/istanbul-lib-report": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", + "integrity": "sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "*" + } + }, + "@types/istanbul-reports": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", + "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", + "dev": true, + "requires": { + "@types/istanbul-lib-report": "*" + } + }, + "@types/jsdom": { + "version": "20.0.1", + "resolved": "https://registry.npmjs.org/@types/jsdom/-/jsdom-20.0.1.tgz", + "integrity": "sha512-d0r18sZPmMQr1eG35u12FZfhIXNrnsPU/g5wvRKCUf/tOGilKKwYMYGqh33BNR6ba+2gkHw1EUiHoN3mn7E5IQ==", + "dev": true, + "requires": { + "@types/node": "*", + "@types/tough-cookie": "*", + "parse5": "^7.0.0" + } + }, + "@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true + }, + "@types/json5": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", + "dev": true + }, + "@types/node": { + "version": "14.17.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.3.tgz", + "integrity": "sha512-e6ZowgGJmTuXa3GyaPbTGxX17tnThl2aSSizrFthQ7m9uLGZBXiGhgE55cjRZTF5kjZvYn9EOPOMljdjwbflxw==", + "dev": true + }, + "@types/prismjs": { + "version": "1.26.3", + "resolved": "https://registry.npmjs.org/@types/prismjs/-/prismjs-1.26.3.tgz", + "integrity": "sha512-A0D0aTXvjlqJ5ZILMz3rNfDBOx9hHxLZYv2by47Sm/pqW35zzjusrZTryatjN/Rf8Us2gZrJD+KeHbUSTux1Cw==", + "dev": true + }, + "@types/random-seed": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@types/random-seed/-/random-seed-0.3.5.tgz", + "integrity": "sha512-CftxcDPAHgs0SLHU2dt+ZlDPJfGqLW3sZlC/ATr5vJDSe5tRLeOne7HMvCOJnFyF8e1U41wqzs3h6AMC613xtA==", + "dev": true + }, + "@types/react": { + "version": "19.1.0", + "resolved": "https://registry.npmjs.org/@types/react/-/react-19.1.0.tgz", + "integrity": "sha512-UaicktuQI+9UKyA4njtDOGBD/67t8YEBt2xdfqu8+gP9hqPUPsiXlNPcpS2gVdjmis5GKPG3fCxbQLVgxsQZ8w==", + "dev": true, + "requires": { + "csstype": "^3.0.2" + } + }, + "@types/stack-utils": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz", + "integrity": "sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==", + "dev": true + }, + "@types/tough-cookie": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.2.tgz", + "integrity": "sha512-Q5vtl1W5ue16D+nIaW8JWebSSraJVlK+EthKn7e7UcD4KWsaSJ8BqGPXNaPghgtcn/fhvrN17Tv8ksUsQpiplw==", + "dev": true + }, + "@types/yargs": { + "version": "17.0.24", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.24.tgz", + "integrity": "sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw==", + "dev": true, + "requires": { + "@types/yargs-parser": "*" + } + }, + "@types/yargs-parser": { + "version": "21.0.0", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.0.tgz", + "integrity": "sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==", + "dev": true + }, + "@typescript-eslint/eslint-plugin": { + "version": "8.24.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.24.0.tgz", + "integrity": "sha512-aFcXEJJCI4gUdXgoo/j9udUYIHgF23MFkg09LFz2dzEmU0+1Plk4rQWv/IYKvPHAtlkkGoB3m5e6oUp+JPsNaQ==", + "dev": true, + "requires": { + "@eslint-community/regexpp": "^4.10.0", + "@typescript-eslint/scope-manager": "8.24.0", + "@typescript-eslint/type-utils": "8.24.0", + "@typescript-eslint/utils": "8.24.0", + "@typescript-eslint/visitor-keys": "8.24.0", + "graphemer": "^1.4.0", + "ignore": "^5.3.1", + "natural-compare": "^1.4.0", + "ts-api-utils": "^2.0.1" + } + }, + "@typescript-eslint/parser": { + "version": "8.24.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.24.0.tgz", + "integrity": "sha512-MFDaO9CYiard9j9VepMNa9MTcqVvSny2N4hkY6roquzj8pdCBRENhErrteaQuu7Yjn1ppk0v1/ZF9CG3KIlrTA==", + "dev": true, + "requires": { + "@typescript-eslint/scope-manager": "8.24.0", + "@typescript-eslint/types": "8.24.0", + "@typescript-eslint/typescript-estree": "8.24.0", + "@typescript-eslint/visitor-keys": "8.24.0", + "debug": "^4.3.4" + }, + "dependencies": { + "debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "requires": { + "ms": "^2.1.3" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + } + } + }, + "@typescript-eslint/scope-manager": { + "version": "8.24.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.24.0.tgz", + "integrity": "sha512-HZIX0UByphEtdVBKaQBgTDdn9z16l4aTUz8e8zPQnyxwHBtf5vtl1L+OhH+m1FGV9DrRmoDuYKqzVrvWDcDozw==", + "dev": true, + "requires": { + "@typescript-eslint/types": "8.24.0", + "@typescript-eslint/visitor-keys": "8.24.0" + } + }, + "@typescript-eslint/type-utils": { + "version": "8.24.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.24.0.tgz", + "integrity": "sha512-8fitJudrnY8aq0F1wMiPM1UUgiXQRJ5i8tFjq9kGfRajU+dbPyOuHbl0qRopLEidy0MwqgTHDt6CnSeXanNIwA==", + "dev": true, + "requires": { + "@typescript-eslint/typescript-estree": "8.24.0", + "@typescript-eslint/utils": "8.24.0", + "debug": "^4.3.4", + "ts-api-utils": "^2.0.1" + }, + "dependencies": { + "debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "requires": { + "ms": "^2.1.3" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + } + } + }, + "@typescript-eslint/types": { + "version": "8.24.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.24.0.tgz", + "integrity": "sha512-VacJCBTyje7HGAw7xp11q439A+zeGG0p0/p2zsZwpnMzjPB5WteaWqt4g2iysgGFafrqvyLWqq6ZPZAOCoefCw==", + "dev": true + }, + "@typescript-eslint/typescript-estree": { + "version": "8.24.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.24.0.tgz", + "integrity": "sha512-ITjYcP0+8kbsvT9bysygfIfb+hBj6koDsu37JZG7xrCiy3fPJyNmfVtaGsgTUSEuTzcvME5YI5uyL5LD1EV5ZQ==", + "dev": true, + "requires": { + "@typescript-eslint/types": "8.24.0", + "@typescript-eslint/visitor-keys": "8.24.0", + "debug": "^4.3.4", + "fast-glob": "^3.3.2", + "is-glob": "^4.0.3", + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^2.0.1" + }, + "dependencies": { + "brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0" + } + }, + "debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "requires": { + "ms": "^2.1.3" + } + }, + "minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "requires": { + "brace-expansion": "^2.0.1" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "semver": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "dev": true + } + } + }, + "@typescript-eslint/utils": { + "version": "8.24.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.24.0.tgz", + "integrity": "sha512-07rLuUBElvvEb1ICnafYWr4hk8/U7X9RDCOqd9JcAMtjh/9oRmcfN4yGzbPVirgMR0+HLVHehmu19CWeh7fsmQ==", + "dev": true, + "requires": { + "@eslint-community/eslint-utils": "^4.4.0", + "@typescript-eslint/scope-manager": "8.24.0", + "@typescript-eslint/types": "8.24.0", + "@typescript-eslint/typescript-estree": "8.24.0" + } + }, + "@typescript-eslint/visitor-keys": { + "version": "8.24.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.24.0.tgz", + "integrity": "sha512-kArLq83QxGLbuHrTMoOEWO+l2MwsNS2TGISEdx8xgqpkbytB07XmlQyQdNDrCc1ecSqx0cnmhGvpX+VBwqqSkg==", + "dev": true, + "requires": { + "@typescript-eslint/types": "8.24.0", + "eslint-visitor-keys": "^4.2.0" + } + }, + "abab": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", + "integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==", + "dev": true + }, + "acorn": { + "version": "6.4.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz", + "integrity": "sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==", + "dev": true + }, + "acorn-dynamic-import": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/acorn-dynamic-import/-/acorn-dynamic-import-4.0.0.tgz", + "integrity": "sha512-d3OEjQV4ROpoflsnUA8HozoIR504TFxNivYEUi6uwz0IYhBkTDXGuWlNdMtybRt3nqVx/L6XqMt0FxkXuWKZhw==", + "dev": true, + "requires": {} + }, + "acorn-globals": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-7.0.1.tgz", + "integrity": "sha512-umOSDSDrfHbTNPuNpC2NSnnA3LUrqpevPb4T9jRx4MagXNS0rs+gwiTcAvqCRmsD6utzsrzNt+ebm00SNWiC3Q==", + "dev": true, + "requires": { + "acorn": "^8.1.0", + "acorn-walk": "^8.0.2" + }, + "dependencies": { + "acorn": { + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", + "dev": true + } + } + }, + "acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "requires": {} + }, + "acorn-walk": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", + "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "dev": true + }, + "agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dev": true, + "requires": { + "debug": "4" + }, + "dependencies": { + "debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "requires": { + "ms": "^2.1.3" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + } + } + }, + "aggregate-error": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-4.0.1.tgz", + "integrity": "sha512-0poP0T7el6Vq3rstR8Mn4V/IQrpBLO6POkUSrN7RhyY+GF/InCFShQzsQ39T25gkHhLgSLByyAz+Kjb+c2L98w==", + "dev": true, + "requires": { + "clean-stack": "^4.0.0", + "indent-string": "^5.0.0" + } + }, + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dev": true, + "requires": { + "type-fest": "^0.21.3" + }, + "dependencies": { + "type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true + } + } + }, + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "anymatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", + "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", + "dev": true, + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, + "arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "array-buffer-byte-length": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.2.tgz", + "integrity": "sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw==", + "dev": true, + "requires": { + "call-bound": "^1.0.3", + "is-array-buffer": "^3.0.5" + } + }, + "array-includes": { + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.8.tgz", + "integrity": "sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.4", + "is-string": "^1.0.7" + } + }, + "array.prototype.findlast": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/array.prototype.findlast/-/array.prototype.findlast-1.2.5.tgz", + "integrity": "sha512-CVvd6FHg1Z3POpBLxO6E6zr+rSKEQ9L6rZHAaY7lLfhKsWYUBBOuMs0e9o24oopj6H+geRCX0YJ+TJLBK2eHyQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-shim-unscopables": "^1.0.2" + } + }, + "array.prototype.findlastindex": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.5.tgz", + "integrity": "sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-shim-unscopables": "^1.0.2" + } + }, + "array.prototype.flat": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.3.tgz", + "integrity": "sha512-rwG/ja1neyLqCuGZ5YYrznA62D4mZXg0i1cIskIUKSiqF3Cje9/wXAls9B9s1Wa2fomMsIv8czB8jZcPmxCXFg==", + "dev": true, + "requires": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-shim-unscopables": "^1.0.2" + } + }, + "array.prototype.flatmap": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.3.tgz", + "integrity": "sha512-Y7Wt51eKJSyi80hFrJCePGGNo5ktJCslFuboqJsbf57CCPcm5zztluPlc4/aD8sWsKvlwatezpV4U1efk8kpjg==", + "dev": true, + "requires": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-shim-unscopables": "^1.0.2" + } + }, + "array.prototype.tosorted": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/array.prototype.tosorted/-/array.prototype.tosorted-1.1.4.tgz", + "integrity": "sha512-p6Fx8B7b7ZhL/gmUsAy0D15WhvDccw3mnGNbZpi3pmeJdxtWsj2jEaI4Y6oo3XiHfzuSgPwKc04MYt6KgvC/wA==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.3", + "es-errors": "^1.3.0", + "es-shim-unscopables": "^1.0.2" + } + }, + "arraybuffer.prototype.slice": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.4.tgz", + "integrity": "sha512-BNoCY6SXXPQ7gF2opIP4GBE+Xw7U+pHMYKuzjgCN3GwiaIR09UUeKfheyIry77QtrCBlC0KK0q5/TER/tYh3PQ==", + "dev": true, + "requires": { + "array-buffer-byte-length": "^1.0.1", + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "is-array-buffer": "^3.0.4" + } + }, + "arrify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-3.0.0.tgz", + "integrity": "sha512-tLkvA81vQG/XqE2mjDkGQHoOINtMHtysSnemrmoGe6PydDPMRbVugqyk4A6V/WDWEfm3l+0d8anA9r8cv/5Jaw==", + "dev": true + }, + "async-function": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/async-function/-/async-function-1.0.0.tgz", + "integrity": "sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA==", + "dev": true + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true + }, + "available-typed-arrays": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "dev": true, + "requires": { + "possible-typed-array-names": "^1.0.0" + } + }, + "babel-jest": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.6.4.tgz", + "integrity": "sha512-meLj23UlSLddj6PC+YTOFRgDAtjnZom8w/ACsrx0gtPtv5cJZk0A5Unk5bV4wixD7XaPCN1fQvpww8czkZURmw==", + "dev": true, + "requires": { + "@jest/transform": "^29.6.4", + "@types/babel__core": "^7.1.14", + "babel-plugin-istanbul": "^6.1.1", + "babel-preset-jest": "^29.6.3", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "slash": "^3.0.0" + } + }, + "babel-plugin-istanbul": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", + "integrity": "sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-instrument": "^5.0.4", + "test-exclude": "^6.0.0" + } + }, + "babel-plugin-jest-hoist": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz", + "integrity": "sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==", + "dev": true, + "requires": { + "@babel/template": "^7.3.3", + "@babel/types": "^7.3.3", + "@types/babel__core": "^7.1.14", + "@types/babel__traverse": "^7.0.6" + } + }, + "babel-preset-current-node-syntax": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz", + "integrity": "sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==", + "dev": true, + "requires": { + "@babel/plugin-syntax-async-generators": "^7.8.4", + "@babel/plugin-syntax-bigint": "^7.8.3", + "@babel/plugin-syntax-class-properties": "^7.8.3", + "@babel/plugin-syntax-import-meta": "^7.8.3", + "@babel/plugin-syntax-json-strings": "^7.8.3", + "@babel/plugin-syntax-logical-assignment-operators": "^7.8.3", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", + "@babel/plugin-syntax-numeric-separator": "^7.8.3", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", + "@babel/plugin-syntax-optional-chaining": "^7.8.3", + "@babel/plugin-syntax-top-level-await": "^7.8.3" + } + }, + "babel-preset-jest": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz", + "integrity": "sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==", + "dev": true, + "requires": { + "babel-plugin-jest-hoist": "^29.6.3", + "babel-preset-current-node-syntax": "^1.0.0" + } + }, + "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "benchmark": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/benchmark/-/benchmark-2.1.4.tgz", + "integrity": "sha1-CfPeMckWQl1JjMLuVloOvzwqVik=", + "dev": true, + "requires": { + "lodash": "^4.17.4", + "platform": "^1.3.3" + } + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "requires": { + "fill-range": "^7.1.1" + } + }, + "browserslist": { + "version": "4.24.4", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.4.tgz", + "integrity": "sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A==", + "dev": true, + "requires": { + "caniuse-lite": "^1.0.30001688", + "electron-to-chromium": "^1.5.73", + "node-releases": "^2.0.19", + "update-browserslist-db": "^1.1.1" + } + }, + "bser": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", + "integrity": "sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==", + "dev": true, + "requires": { + "node-int64": "^0.4.0" + } + }, + "buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true + }, + "bundle-name": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bundle-name/-/bundle-name-4.1.0.tgz", + "integrity": "sha512-tjwM5exMg6BGRI+kNmTntNsvdZS1X8BFYS6tnJ2hdH0kVxM6/eVZ2xy+FqStSWvYmtfFMDLIxurorHwDKfDz5Q==", + "dev": true, + "requires": { + "run-applescript": "^7.0.0" + } + }, + "busboy": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", + "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==", + "dev": true, + "requires": { + "streamsearch": "^1.1.0" + } + }, + "bytes-iec": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/bytes-iec/-/bytes-iec-3.1.1.tgz", + "integrity": "sha512-fey6+4jDK7TFtFg/klGSvNKJctyU7n2aQdnM+CO0ruLPbqqMOM8Tio0Pc+deqUeVKX1tL5DQep1zQ7+37aTAsA==", + "dev": true + }, + "call-bind": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", + "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", + "dev": true, + "requires": { + "call-bind-apply-helpers": "^1.0.0", + "es-define-property": "^1.0.0", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.2" + } + }, + "call-bind-apply-helpers": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz", + "integrity": "sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==", + "dev": true, + "requires": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + } + }, + "call-bound": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.3.tgz", + "integrity": "sha512-YTd+6wGlNlPxSuri7Y6X8tY2dmm12UMH66RpKMhiX6rsk5wXXnYgbUcOt8kiS31/AjfoTOvCsE+w8nZQLQnzHA==", + "dev": true, + "requires": { + "call-bind-apply-helpers": "^1.0.1", + "get-intrinsic": "^1.2.6" + } + }, + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "caniuse-lite": { + "version": "1.0.30001699", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001699.tgz", + "integrity": "sha512-b+uH5BakXZ9Do9iK+CkDmctUSEqZl+SP056vc5usa0PL+ev5OHw003rZXcnjNDv3L8P5j6rwT6C0BPKSikW08w==", + "dev": true + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "char-regex": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", + "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", + "dev": true + }, + "chokidar": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", + "dev": true, + "requires": { + "readdirp": "^4.0.1" + } + }, + "ci-info": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.8.0.tgz", + "integrity": "sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==", + "dev": true + }, + "cjs-module-lexer": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.3.tgz", + "integrity": "sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ==", + "dev": true + }, + "clean-stack": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-4.2.0.tgz", + "integrity": "sha512-LYv6XPxoyODi36Dp976riBtSY27VmFo+MKqEU9QCCWyTrdEPDog+RWA7xQWHi6Vbp61j5c4cdzzX1NidnwtUWg==", + "dev": true, + "requires": { + "escape-string-regexp": "5.0.0" + }, + "dependencies": { + "escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", + "dev": true + } + } + }, + "client-only": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/client-only/-/client-only-0.0.1.tgz", + "integrity": "sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==", + "dev": true + }, + "cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "dependencies": { + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + } + } + }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", + "dev": true + }, + "codemirror": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-6.0.1.tgz", + "integrity": "sha512-J8j+nZ+CdWmIeFIGXEFbFPtpiYacFMDR8GlHK3IyHQJMCaVRfGx9NT+Hxivv1ckLWPvNdZqndbr/7lVhrf/Svg==", + "dev": true, + "requires": { + "@codemirror/autocomplete": "^6.0.0", + "@codemirror/commands": "^6.0.0", + "@codemirror/language": "^6.0.0", + "@codemirror/lint": "^6.0.0", + "@codemirror/search": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0" + } + }, + "collect-v8-coverage": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz", + "integrity": "sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==", + "dev": true + }, + "color": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz", + "integrity": "sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==", + "dev": true, + "optional": true, + "requires": { + "color-convert": "^2.0.1", + "color-string": "^1.9.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "color-string": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz", + "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==", + "dev": true, + "optional": true, + "requires": { + "color-name": "^1.0.0", + "simple-swizzle": "^0.2.2" + } + }, + "colors": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", + "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==", + "dev": true + }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, + "commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "convert-source-map": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", + "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", + "dev": true + }, + "cp-file": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/cp-file/-/cp-file-10.0.0.tgz", + "integrity": "sha512-vy2Vi1r2epK5WqxOLnskeKeZkdZvTKfFZQCplE3XWsP+SUJyd5XAUFC9lFgTjjXJF2GMne/UML14iEmkAaDfFg==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.10", + "nested-error-stacks": "^2.1.1", + "p-event": "^5.0.1" + } + }, + "cpy": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/cpy/-/cpy-10.1.0.tgz", + "integrity": "sha512-VC2Gs20JcTyeQob6UViBLnyP0bYHkBh6EiKzot9vi2DmeGlFT9Wd7VG3NBrkNx/jYvFBeyDOMMHdHQhbtKLgHQ==", + "dev": true, + "requires": { + "arrify": "^3.0.0", + "cp-file": "^10.0.0", + "globby": "^13.1.4", + "junk": "^4.0.1", + "micromatch": "^4.0.5", + "nested-error-stacks": "^2.1.1", + "p-filter": "^3.0.0", + "p-map": "^6.0.0" + }, + "dependencies": { + "globby": { + "version": "13.2.2", + "resolved": "https://registry.npmjs.org/globby/-/globby-13.2.2.tgz", + "integrity": "sha512-Y1zNGV+pzQdh7H39l9zgB4PJqjRNqydvdYCDG4HFXM4XuvSaQQlEc91IU1yALL8gUTDomgBAfz3XJdmUS+oo0w==", + "dev": true, + "requires": { + "dir-glob": "^3.0.1", + "fast-glob": "^3.3.0", + "ignore": "^5.2.4", + "merge2": "^1.4.1", + "slash": "^4.0.0" + } + }, + "slash": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", + "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", + "dev": true + } + } + }, + "cpy-cli": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cpy-cli/-/cpy-cli-5.0.0.tgz", + "integrity": "sha512-fb+DZYbL9KHc0BC4NYqGRrDIJZPXUmjjtqdw4XRRg8iV8dIfghUX/WiL+q4/B/KFTy3sK6jsbUhBaz0/Hxg7IQ==", + "dev": true, + "requires": { + "cpy": "^10.1.0", + "meow": "^12.0.1" + } + }, + "create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true + }, + "crelt": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/crelt/-/crelt-1.0.6.tgz", + "integrity": "sha512-VQ2MBenTq1fWZUH9DJNGti7kKv6EeAuYr3cLwxUWhIu1baTaXh4Ib5W2CqHVqib4/MqbYGJqiL3Zb8GJZr3l4g==", + "dev": true + }, + "cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "crypto-random-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz", + "integrity": "sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==", + "dev": true + }, + "cssom": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.5.0.tgz", + "integrity": "sha512-iKuQcq+NdHqlAcwUY0o/HL69XQrUaQdMjmStJ8JFmUaiiQErlhrmuigkg/CU4E2J0IyUKUrMAgl36TvN67MqTw==", + "dev": true + }, + "cssstyle": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz", + "integrity": "sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A==", + "dev": true, + "requires": { + "cssom": "~0.3.6" + }, + "dependencies": { + "cssom": { + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz", + "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==", + "dev": true + } + } + }, + "csstype": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.0.8.tgz", + "integrity": "sha512-jXKhWqXPmlUeoQnF/EhTtTl4C9SnrxSH/jZUih3jmO6lBKr99rP3/+FmrMj4EFpOXzMtXHAZkd3x0E6h6Fgflw==", + "dev": true + }, + "data-urls": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-3.0.2.tgz", + "integrity": "sha512-Jy/tj3ldjZJo63sVAvg6LHt2mHvl4V6AgRAmNDtLdm7faqtsx+aJG42rsyCo9JCoRVKwPFzKlIPx3DIibwSIaQ==", + "dev": true, + "requires": { + "abab": "^2.0.6", + "whatwg-mimetype": "^3.0.0", + "whatwg-url": "^11.0.0" + } + }, + "data-view-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.2.tgz", + "integrity": "sha512-EmKO5V3OLXh1rtK2wgXRansaK1/mtVdTUEiEI0W8RkvgT05kfxaH29PliLnpLP73yYO6142Q72QNa8Wx/A5CqQ==", + "dev": true, + "requires": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.2" + } + }, + "data-view-byte-length": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.2.tgz", + "integrity": "sha512-tuhGbE6CfTM9+5ANGf+oQb72Ky/0+s3xKUpHvShfiz2RxMFgFPjsXuRLBVMtvMs15awe45SRb83D6wH4ew6wlQ==", + "dev": true, + "requires": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.2" + } + }, + "data-view-byte-offset": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.1.tgz", + "integrity": "sha512-BS8PfmtDGnrgYdOonGZQdLZslWIeCGFP9tpan0hi1Co2Zr2NKADsvGYA8XxuG/4UWgJ6Cjtv+YJnB6MM69QGlQ==", + "dev": true, + "requires": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + } + }, + "decimal.js": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz", + "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==", + "dev": true + }, + "dedent": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.5.1.tgz", + "integrity": "sha512-+LxW+KLWxu3HW3M2w2ympwtqPrqYRzU8fqi6Fhd18fBALe15blJPI/I4+UHveMVG6lJqB4JNd4UG0S5cnVHwIg==", + "dev": true, + "requires": {} + }, + "deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, + "deepmerge": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", + "dev": true + }, + "default-browser": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/default-browser/-/default-browser-5.2.1.tgz", + "integrity": "sha512-WY/3TUME0x3KPYdRRxEJJvXRHV4PyPoUsxtZa78lwItwRQRHhd2U9xOscaT/YTf8uCXIAjeJOFBVEh/7FtD8Xg==", + "dev": true, + "requires": { + "bundle-name": "^4.1.0", + "default-browser-id": "^5.0.0" + } + }, + "default-browser-id": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/default-browser-id/-/default-browser-id-5.0.0.tgz", + "integrity": "sha512-A6p/pu/6fyBcA1TRz/GqWYPViplrftcW2gZC9q79ngNCKAeR/X3gcEdXQHl4KNXV+3wgIJ1CPkJQ3IHM6lcsyA==", + "dev": true + }, + "define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, + "requires": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + } + }, + "define-lazy-prop": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-3.0.0.tgz", + "integrity": "sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==", + "dev": true + }, + "define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "dev": true, + "requires": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + } + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true + }, + "detect-libc": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.3.tgz", + "integrity": "sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==", + "dev": true, + "optional": true + }, + "detect-newline": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", + "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", + "dev": true + }, + "diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true + }, + "diff-sequences": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", + "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", + "dev": true + }, + "dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "requires": { + "path-type": "^4.0.0" + } + }, + "doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, + "domexception": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz", + "integrity": "sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==", + "dev": true, + "requires": { + "webidl-conversions": "^7.0.0" + } + }, + "dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "dev": true, + "requires": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + } + }, + "electron-to-chromium": { + "version": "1.5.97", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.97.tgz", + "integrity": "sha512-HKLtaH02augM7ZOdYRuO19rWDeY+QSJ1VxnXFa/XDFLf07HvM90pALIJFgrO+UVaajI3+aJMMpojoUTLZyQ7JQ==", + "dev": true + }, + "emittery": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz", + "integrity": "sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==", + "dev": true + }, + "enhanced-resolve": { + "version": "5.18.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.18.1.tgz", + "integrity": "sha512-ZSW3ma5GkcQBIpwZTSRAI8N71Uuwgs93IezB7mf7R60tC8ZbJideoDNKjHn2O9KIlx6rkGTTEk1xUCK2E1Y2Yg==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.4", + "tapable": "^2.2.0" + } + }, + "entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "dev": true + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "es-abstract": { + "version": "1.23.9", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.9.tgz", + "integrity": "sha512-py07lI0wjxAC/DcfK1S6G7iANonniZwTISvdPzk9hzeH0IZIshbuuFxLIU96OyF89Yb9hiqWn8M/bY83KY5vzA==", + "dev": true, + "requires": { + "array-buffer-byte-length": "^1.0.2", + "arraybuffer.prototype.slice": "^1.0.4", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "data-view-buffer": "^1.0.2", + "data-view-byte-length": "^1.0.2", + "data-view-byte-offset": "^1.0.1", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-set-tostringtag": "^2.1.0", + "es-to-primitive": "^1.3.0", + "function.prototype.name": "^1.1.8", + "get-intrinsic": "^1.2.7", + "get-proto": "^1.0.0", + "get-symbol-description": "^1.1.0", + "globalthis": "^1.0.4", + "gopd": "^1.2.0", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "internal-slot": "^1.1.0", + "is-array-buffer": "^3.0.5", + "is-callable": "^1.2.7", + "is-data-view": "^1.0.2", + "is-regex": "^1.2.1", + "is-shared-array-buffer": "^1.0.4", + "is-string": "^1.1.1", + "is-typed-array": "^1.1.15", + "is-weakref": "^1.1.0", + "math-intrinsics": "^1.1.0", + "object-inspect": "^1.13.3", + "object-keys": "^1.1.1", + "object.assign": "^4.1.7", + "own-keys": "^1.0.1", + "regexp.prototype.flags": "^1.5.3", + "safe-array-concat": "^1.1.3", + "safe-push-apply": "^1.0.0", + "safe-regex-test": "^1.1.0", + "set-proto": "^1.0.0", + "string.prototype.trim": "^1.2.10", + "string.prototype.trimend": "^1.0.9", + "string.prototype.trimstart": "^1.0.8", + "typed-array-buffer": "^1.0.3", + "typed-array-byte-length": "^1.0.3", + "typed-array-byte-offset": "^1.0.4", + "typed-array-length": "^1.0.7", + "unbox-primitive": "^1.1.0", + "which-typed-array": "^1.1.18" + } + }, + "es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "dev": true + }, + "es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true + }, + "es-iterator-helpers": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-iterator-helpers/-/es-iterator-helpers-1.2.1.tgz", + "integrity": "sha512-uDn+FE1yrDzyC0pCo961B2IHbdM8y/ACZsKD4dG6WqrjV53BADjwa7D+1aom2rsNVfLyDgU/eigvlJGJ08OQ4w==", + "dev": true, + "requires": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.6", + "es-errors": "^1.3.0", + "es-set-tostringtag": "^2.0.3", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.6", + "globalthis": "^1.0.4", + "gopd": "^1.2.0", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.2.0", + "has-symbols": "^1.1.0", + "internal-slot": "^1.1.0", + "iterator.prototype": "^1.1.4", + "safe-array-concat": "^1.1.3" + } + }, + "es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "dev": true, + "requires": { + "es-errors": "^1.3.0" + } + }, + "es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "dev": true, + "requires": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + } + }, + "es-shim-unscopables": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.1.0.tgz", + "integrity": "sha512-d9T8ucsEhh8Bi1woXCf+TIKDIROLG5WCkxg8geBCbvk22kzwC5G2OnXVMO6FUsvQlgUUXQ2itephWDLqDzbeCw==", + "dev": true, + "requires": { + "hasown": "^2.0.2" + } + }, + "es-to-primitive": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.3.0.tgz", + "integrity": "sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g==", + "dev": true, + "requires": { + "is-callable": "^1.2.7", + "is-date-object": "^1.0.5", + "is-symbol": "^1.0.4" + } + }, + "esbuild": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.1.tgz", + "integrity": "sha512-BGO5LtrGC7vxnqucAe/rmvKdJllfGaYWdyABvyMoXQlfYMb2bbRuReWR5tEGE//4LcNJj9XrkovTqNYRFZHAMQ==", + "dev": true, + "requires": { + "@esbuild/aix-ppc64": "0.25.1", + "@esbuild/android-arm": "0.25.1", + "@esbuild/android-arm64": "0.25.1", + "@esbuild/android-x64": "0.25.1", + "@esbuild/darwin-arm64": "0.25.1", + "@esbuild/darwin-x64": "0.25.1", + "@esbuild/freebsd-arm64": "0.25.1", + "@esbuild/freebsd-x64": "0.25.1", + "@esbuild/linux-arm": "0.25.1", + "@esbuild/linux-arm64": "0.25.1", + "@esbuild/linux-ia32": "0.25.1", + "@esbuild/linux-loong64": "0.25.1", + "@esbuild/linux-mips64el": "0.25.1", + "@esbuild/linux-ppc64": "0.25.1", + "@esbuild/linux-riscv64": "0.25.1", + "@esbuild/linux-s390x": "0.25.1", + "@esbuild/linux-x64": "0.25.1", + "@esbuild/netbsd-arm64": "0.25.1", + "@esbuild/netbsd-x64": "0.25.1", + "@esbuild/openbsd-arm64": "0.25.1", + "@esbuild/openbsd-x64": "0.25.1", + "@esbuild/sunos-x64": "0.25.1", + "@esbuild/win32-arm64": "0.25.1", + "@esbuild/win32-ia32": "0.25.1", + "@esbuild/win32-x64": "0.25.1" + } + }, + "esbuild-visualizer": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/esbuild-visualizer/-/esbuild-visualizer-0.7.0.tgz", + "integrity": "sha512-Vz22k+G2WT7GuCo7rbhaQwGbZ26lEhwzsctkEdQlu2SVrshoM4hzQeRpu/3DP596a9+9K2JyYsinuC6AC896Og==", + "dev": true, + "requires": { + "open": "^8.4.0", + "picomatch": "^4.0.0", + "yargs": "^17.6.2" + }, + "dependencies": { + "define-lazy-prop": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz", + "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==", + "dev": true + }, + "is-docker": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", + "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", + "dev": true + }, + "is-wsl": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", + "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "dev": true, + "requires": { + "is-docker": "^2.0.0" + } + }, + "open": { + "version": "8.4.2", + "resolved": "https://registry.npmjs.org/open/-/open-8.4.2.tgz", + "integrity": "sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==", + "dev": true, + "requires": { + "define-lazy-prop": "^2.0.0", + "is-docker": "^2.1.1", + "is-wsl": "^2.2.0" + } + }, + "picomatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "dev": true + } + } + }, + "escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true + }, + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true + }, + "escodegen": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz", + "integrity": "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==", + "dev": true, + "requires": { + "esprima": "^4.0.1", + "estraverse": "^5.2.0", + "esutils": "^2.0.2", + "source-map": "~0.6.1" + } + }, + "eslint": { + "version": "9.20.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.20.1.tgz", + "integrity": "sha512-m1mM33o6dBUjxl2qb6wv6nGNwCAsns1eKtaQ4l/NPHeTvhiUPbtdfMyktxN4B3fgHIgsYh1VT3V9txblpQHq+g==", + "dev": true, + "requires": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.12.1", + "@eslint/config-array": "^0.19.0", + "@eslint/core": "^0.11.0", + "@eslint/eslintrc": "^3.2.0", + "@eslint/js": "9.20.0", + "@eslint/plugin-kit": "^0.2.5", + "@humanfs/node": "^0.16.6", + "@humanwhocodes/module-importer": "^1.0.1", + "@humanwhocodes/retry": "^0.4.1", + "@types/estree": "^1.0.6", + "@types/json-schema": "^7.0.15", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.6", + "debug": "^4.3.2", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^8.2.0", + "eslint-visitor-keys": "^4.2.0", + "espree": "^10.3.0", + "esquery": "^1.5.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^8.0.0", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3" + }, + "dependencies": { + "debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "requires": { + "ms": "^2.1.3" + } + }, + "glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "requires": { + "is-glob": "^4.0.3" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + } + } + }, + "eslint-import-resolver-node": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", + "integrity": "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==", + "dev": true, + "requires": { + "debug": "^3.2.7", + "is-core-module": "^2.13.0", + "resolve": "^1.22.4" + }, + "dependencies": { + "debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + } + } + }, + "eslint-import-resolver-typescript": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-3.7.0.tgz", + "integrity": "sha512-Vrwyi8HHxY97K5ebydMtffsWAn1SCR9eol49eCd5fJS4O1WV7PaAjbcjmbfJJSMz/t4Mal212Uz/fQZrOB8mow==", + "dev": true, + "requires": { + "@nolyfill/is-core-module": "1.0.39", + "debug": "^4.3.7", + "enhanced-resolve": "^5.15.0", + "fast-glob": "^3.3.2", + "get-tsconfig": "^4.7.5", + "is-bun-module": "^1.0.2", + "is-glob": "^4.0.3", + "stable-hash": "^0.0.4" + }, + "dependencies": { + "debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "requires": { + "ms": "^2.1.3" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + } + } + }, + "eslint-module-utils": { + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.12.0.tgz", + "integrity": "sha512-wALZ0HFoytlyh/1+4wuZ9FJCD/leWHQzzrxJ8+rebyReSLk7LApMyd3WJaLVoN+D5+WIdJyDK1c6JnE65V4Zyg==", + "dev": true, + "requires": { + "debug": "^3.2.7" + }, + "dependencies": { + "debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + } + } + }, + "eslint-plugin-import": { + "version": "2.31.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.31.0.tgz", + "integrity": "sha512-ixmkI62Rbc2/w8Vfxyh1jQRTdRTF52VxwRVHl/ykPAmqG+Nb7/kNn+byLP0LxPgI7zWA16Jt82SybJInmMia3A==", + "dev": true, + "requires": { + "@rtsao/scc": "^1.1.0", + "array-includes": "^3.1.8", + "array.prototype.findlastindex": "^1.2.5", + "array.prototype.flat": "^1.3.2", + "array.prototype.flatmap": "^1.3.2", + "debug": "^3.2.7", + "doctrine": "^2.1.0", + "eslint-import-resolver-node": "^0.3.9", + "eslint-module-utils": "^2.12.0", + "hasown": "^2.0.2", + "is-core-module": "^2.15.1", + "is-glob": "^4.0.3", + "minimatch": "^3.1.2", + "object.fromentries": "^2.0.8", + "object.groupby": "^1.0.3", + "object.values": "^1.2.0", + "semver": "^6.3.1", + "string.prototype.trimend": "^1.0.8", + "tsconfig-paths": "^3.15.0" + }, + "dependencies": { + "debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + } + } + }, + "eslint-plugin-jest": { + "version": "28.11.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-28.11.0.tgz", + "integrity": "sha512-QAfipLcNCWLVocVbZW8GimKn5p5iiMcgGbRzz8z/P5q7xw+cNEpYqyzFMtIF/ZgF2HLOyy+dYBut+DoYolvqig==", + "dev": true, + "requires": { + "@typescript-eslint/utils": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "eslint-plugin-react": { + "version": "7.37.4", + "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.37.4.tgz", + "integrity": "sha512-BGP0jRmfYyvOyvMoRX/uoUeW+GqNj9y16bPQzqAHf3AYII/tDs+jMN0dBVkl88/OZwNGwrVFxE7riHsXVfy/LQ==", + "dev": true, + "requires": { + "array-includes": "^3.1.8", + "array.prototype.findlast": "^1.2.5", + "array.prototype.flatmap": "^1.3.3", + "array.prototype.tosorted": "^1.1.4", + "doctrine": "^2.1.0", + "es-iterator-helpers": "^1.2.1", + "estraverse": "^5.3.0", + "hasown": "^2.0.2", + "jsx-ast-utils": "^2.4.1 || ^3.0.0", + "minimatch": "^3.1.2", + "object.entries": "^1.1.8", + "object.fromentries": "^2.0.8", + "object.values": "^1.2.1", + "prop-types": "^15.8.1", + "resolve": "^2.0.0-next.5", + "semver": "^6.3.1", + "string.prototype.matchall": "^4.0.12", + "string.prototype.repeat": "^1.0.0" + }, + "dependencies": { + "resolve": { + "version": "2.0.0-next.5", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.5.tgz", + "integrity": "sha512-U7WjGVG9sH8tvjW5SmGbQuui75FiyjAX72HX15DwBBwF9dNiQZRQAg9nnPhYy+TUnE0+VcrttuvNI8oSxZcocA==", + "dev": true, + "requires": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + } + } + } + }, + "eslint-scope": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.2.0.tgz", + "integrity": "sha512-PHlWUfG6lvPc3yvP5A4PNyBL1W8fkDUccmI21JUu/+GKZBoH/W5u6usENXUrWFRsyoW5ACUjFGgAFQp5gUlb/A==", + "dev": true, + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + } + }, + "eslint-visitor-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", + "dev": true + }, + "espree": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz", + "integrity": "sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==", + "dev": true, + "requires": { + "acorn": "^8.14.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^4.2.0" + }, + "dependencies": { + "acorn": { + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", + "dev": true + } + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "esquery": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", + "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", + "dev": true, + "requires": { + "estraverse": "^5.1.0" + } + }, + "esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "requires": { + "estraverse": "^5.2.0" + } + }, + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true + }, + "estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "dev": true + }, + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true + }, + "execa": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + } + }, + "exit": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==", + "dev": true + }, + "expect": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==", + "dev": true, + "requires": { + "@jest/expect-utils": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0" + } + }, + "fast-check": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fast-check/-/fast-check-4.0.0.tgz", + "integrity": "sha512-aXLyLemZ7qhLNn2oq+YpjT2Xed21+i29WGAYuyrGbU4r8oinB3i4XR4e62O3NY6qmm5qHEDoc/7d+gMsri3AfA==", + "dev": true, + "requires": { + "pure-rand": "^7.0.0" + }, + "dependencies": { + "pure-rand": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-7.0.1.tgz", + "integrity": "sha512-oTUZM/NAZS8p7ANR3SHh30kXB+zK2r2BPcEn/awJIbOvq82WoMN4p62AWWp3Hhw50G0xMsw1mhIBLqHw64EcNQ==", + "dev": true + } + } + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "fast-glob": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", + "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.8" + } + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true + }, + "fastq": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", + "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "dev": true, + "requires": { + "reusify": "^1.0.4" + } + }, + "fb-watchman": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", + "integrity": "sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==", + "dev": true, + "requires": { + "bser": "2.1.1" + } + }, + "file-entry-cache": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", + "dev": true, + "requires": { + "flat-cache": "^4.0.0" + } + }, + "fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "requires": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + } + }, + "flat-cache": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", + "dev": true, + "requires": { + "flatted": "^3.2.9", + "keyv": "^4.5.4" + } + }, + "flatted": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.2.tgz", + "integrity": "sha512-AiwGJM8YcNOaobumgtng+6NHuOqC3A7MixFeDafM3X9cIUM+xUXoS5Vfgf+OihAYe20fxqNM9yPBXJzRtZ/4eA==", + "dev": true + }, + "flow-bin": { + "version": "0.160.0", + "resolved": "https://registry.npmjs.org/flow-bin/-/flow-bin-0.160.0.tgz", + "integrity": "sha512-hqb/1z7U9Jv+2hDdslAgdab6D4AUDrYIcF2zH/CKx9YgQtCeHfnzCcypzCNU7xmBm2+Mi9+1hqeB4OQX2adh0A==", + "dev": true + }, + "for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dev": true, + "requires": { + "is-callable": "^1.1.3" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "optional": true + }, + "function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true + }, + "function.prototype.name": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.8.tgz", + "integrity": "sha512-e5iwyodOHhbMr/yNrc7fDYG4qlbIvI5gajyzPnb5TCwyhjApznQh1BMFou9b30SevY43gCJKXycoCBjMbsuW0Q==", + "dev": true, + "requires": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "functions-have-names": "^1.2.3", + "hasown": "^2.0.2", + "is-callable": "^1.2.7" + } + }, + "functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "dev": true + }, + "gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true + }, + "get-intrinsic": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.7.tgz", + "integrity": "sha512-VW6Pxhsrk0KAOqs3WEd0klDiF/+V7gQOpAvY1jVU/LHmaD/kQO4523aiJuikX/QAKYiW6x8Jh+RJej1almdtCA==", + "dev": true, + "requires": { + "call-bind-apply-helpers": "^1.0.1", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "function-bind": "^1.1.2", + "get-proto": "^1.0.0", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + } + }, + "get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "dev": true + }, + "get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "dev": true, + "requires": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + } + }, + "get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true + }, + "get-symbol-description": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.1.0.tgz", + "integrity": "sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg==", + "dev": true, + "requires": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6" + } + }, + "get-tsconfig": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.10.0.tgz", + "integrity": "sha512-kGzZ3LWWQcGIAmg6iWvXn0ei6WDtV26wzHRMwDSzmAbcXrTEXxHy6IehI6/4eT6VRKyMP1eF1VqwrVUmE/LR7A==", + "dev": true, + "requires": { + "resolve-pkg-maps": "^1.0.0" + } + }, + "glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "globals": { + "version": "15.15.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-15.15.0.tgz", + "integrity": "sha512-7ACyT3wmyp3I61S4fG682L0VA2RGD9otkqGJIwNUMF1SWUombIIk+af1unuDYgMm082aHYwD+mzJvv9Iu8dsgg==", + "dev": true + }, + "globalthis": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", + "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", + "dev": true, + "requires": { + "define-properties": "^1.2.1", + "gopd": "^1.0.1" + } + }, + "gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "dev": true + }, + "graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true + }, + "graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true + }, + "has-bigints": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dev": true, + "requires": { + "es-define-property": "^1.0.0" + } + }, + "has-proto": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.2.0.tgz", + "integrity": "sha512-KIL7eQPfHQRC8+XluaIw7BHUwwqL19bQn4hzNgdr+1wXoU0KKj6rufu47lhY7KbJR2C6T6+PfyN0Ea7wkSS+qQ==", + "dev": true, + "requires": { + "dunder-proto": "^1.0.0" + } + }, + "has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "dev": true + }, + "has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "dev": true, + "requires": { + "has-symbols": "^1.0.3" + } + }, + "hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "requires": { + "function-bind": "^1.1.2" + } + }, + "hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "dev": true + }, + "html-encoding-sniffer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", + "integrity": "sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA==", + "dev": true, + "requires": { + "whatwg-encoding": "^2.0.0" + } + }, + "html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true + }, + "http-proxy-agent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", + "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", + "dev": true, + "requires": { + "@tootallnate/once": "2", + "agent-base": "6", + "debug": "4" + }, + "dependencies": { + "debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "requires": { + "ms": "^2.1.3" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + } + } + }, + "https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "dev": true, + "requires": { + "agent-base": "6", + "debug": "4" + }, + "dependencies": { + "debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "requires": { + "ms": "^2.1.3" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + } + } + }, + "human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "dev": true + }, + "iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + } + }, + "ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true + }, + "import-fresh": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", + "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, + "import-local": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz", + "integrity": "sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==", + "dev": true, + "requires": { + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" + }, + "dependencies": { + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "requires": { + "find-up": "^4.0.0" + } + } + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "indent-string": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", + "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "internal-slot": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.1.0.tgz", + "integrity": "sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==", + "dev": true, + "requires": { + "es-errors": "^1.3.0", + "hasown": "^2.0.2", + "side-channel": "^1.1.0" + } + }, + "is-array-buffer": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.5.tgz", + "integrity": "sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A==", + "dev": true, + "requires": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "get-intrinsic": "^1.2.6" + } + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-async-function": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-async-function/-/is-async-function-2.1.1.tgz", + "integrity": "sha512-9dgM/cZBnNvjzaMYHVoxxfPj2QXt22Ev7SuuPrs+xav0ukGB0S6d4ydZdEiM48kLx5kDV+QBPrpVnFyefL8kkQ==", + "dev": true, + "requires": { + "async-function": "^1.0.0", + "call-bound": "^1.0.3", + "get-proto": "^1.0.1", + "has-tostringtag": "^1.0.2", + "safe-regex-test": "^1.1.0" + } + }, + "is-bigint": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.1.0.tgz", + "integrity": "sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ==", + "dev": true, + "requires": { + "has-bigints": "^1.0.2" + } + }, + "is-boolean-object": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.2.2.tgz", + "integrity": "sha512-wa56o2/ElJMYqjCjGkXri7it5FbebW5usLw/nPmCMs5DeZ7eziSYZhSmPRn0txqeW4LnAmQQU7FgqLpsEFKM4A==", + "dev": true, + "requires": { + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" + } + }, + "is-bun-module": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/is-bun-module/-/is-bun-module-1.3.0.tgz", + "integrity": "sha512-DgXeu5UWI0IsMQundYb5UAOzm6G2eVnarJ0byP6Tm55iZNKceD59LNPA2L4VvsScTtHcw0yEkVwSf7PC+QoLSA==", + "dev": true, + "requires": { + "semver": "^7.6.3" + }, + "dependencies": { + "semver": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "dev": true + } + } + }, + "is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "dev": true + }, + "is-core-module": { + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", + "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", + "dev": true, + "requires": { + "hasown": "^2.0.2" + } + }, + "is-data-view": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.2.tgz", + "integrity": "sha512-RKtWF8pGmS87i2D6gqQu/l7EYRlVdfzemCJN/P3UOs//x1QE7mfhvzHIApBTRf7axvT6DMGwSwBXYCT0nfB9xw==", + "dev": true, + "requires": { + "call-bound": "^1.0.2", + "get-intrinsic": "^1.2.6", + "is-typed-array": "^1.1.13" + } + }, + "is-date-object": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.1.0.tgz", + "integrity": "sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg==", + "dev": true, + "requires": { + "call-bound": "^1.0.2", + "has-tostringtag": "^1.0.2" + } + }, + "is-docker": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz", + "integrity": "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==", + "dev": true + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-finalizationregistry": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-finalizationregistry/-/is-finalizationregistry-1.1.1.tgz", + "integrity": "sha512-1pC6N8qWJbWoPtEjgcL2xyhQOP491EQjeUo3qTKcmV8YSDDJrOepfG8pcC7h/QgnQHYSv0mJ3Z/ZWxmatVrysg==", + "dev": true, + "requires": { + "call-bound": "^1.0.3" + } + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "is-generator-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", + "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", + "dev": true + }, + "is-generator-function": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.1.0.tgz", + "integrity": "sha512-nPUB5km40q9e8UfN/Zc24eLlzdSf9OfKByBw9CIdw4H1giPMeA0OIJvbchsCu4npfI2QcMVBsGEBHKZ7wLTWmQ==", + "dev": true, + "requires": { + "call-bound": "^1.0.3", + "get-proto": "^1.0.0", + "has-tostringtag": "^1.0.2", + "safe-regex-test": "^1.1.0" + } + }, + "is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-inside-container": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz", + "integrity": "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==", + "dev": true, + "requires": { + "is-docker": "^3.0.0" + } + }, + "is-map": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.3.tgz", + "integrity": "sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==", + "dev": true + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "is-number-object": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.1.1.tgz", + "integrity": "sha512-lZhclumE1G6VYD8VHe35wFaIif+CTy5SJIi5+3y4psDgWu4wPDoBhF8NxUOinEc7pHgiTsT6MaBb92rKhhD+Xw==", + "dev": true, + "requires": { + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" + } + }, + "is-potential-custom-element-name": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", + "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", + "dev": true + }, + "is-reference": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", + "integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==", + "dev": true, + "requires": { + "@types/estree": "*" + } + }, + "is-regex": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", + "integrity": "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==", + "dev": true, + "requires": { + "call-bound": "^1.0.2", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + } + }, + "is-set": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.3.tgz", + "integrity": "sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==", + "dev": true + }, + "is-shared-array-buffer": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.4.tgz", + "integrity": "sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A==", + "dev": true, + "requires": { + "call-bound": "^1.0.3" + } + }, + "is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true + }, + "is-string": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.1.1.tgz", + "integrity": "sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA==", + "dev": true, + "requires": { + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" + } + }, + "is-symbol": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.1.1.tgz", + "integrity": "sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w==", + "dev": true, + "requires": { + "call-bound": "^1.0.2", + "has-symbols": "^1.1.0", + "safe-regex-test": "^1.1.0" + } + }, + "is-typed-array": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.15.tgz", + "integrity": "sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==", + "dev": true, + "requires": { + "which-typed-array": "^1.1.16" + } + }, + "is-weakmap": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz", + "integrity": "sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==", + "dev": true + }, + "is-weakref": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.1.1.tgz", + "integrity": "sha512-6i9mGWSlqzNMEqpCp93KwRS1uUOodk2OJ6b+sq7ZPDSy2WuI5NFIxp/254TytR8ftefexkWn5xNiHUNpPOfSew==", + "dev": true, + "requires": { + "call-bound": "^1.0.3" + } + }, + "is-weakset": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.4.tgz", + "integrity": "sha512-mfcwb6IzQyOKTs84CQMrOwW4gQcaTOAWJ0zzJCl2WSPDrWk/OzDaImWFH3djXhb24g4eudZfLRozAvPGw4d9hQ==", + "dev": true, + "requires": { + "call-bound": "^1.0.3", + "get-intrinsic": "^1.2.6" + } + }, + "is-wsl": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-3.1.0.tgz", + "integrity": "sha512-UcVfVfaK4Sc4m7X3dUSoHoozQGBEFeDC+zVo06t98xe8CzHSZZBekNXH+tu0NalHolcJ/QAGqS46Hef7QXBIMw==", + "dev": true, + "requires": { + "is-inside-container": "^1.0.0" + } + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "istanbul-lib-coverage": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", + "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", + "dev": true + }, + "istanbul-lib-instrument": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz", + "integrity": "sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==", + "dev": true, + "requires": { + "@babel/core": "^7.12.3", + "@babel/parser": "^7.14.7", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^6.3.0" + } + }, + "istanbul-lib-report": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", + "dev": true, + "requires": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^4.0.0", + "supports-color": "^7.1.0" + }, + "dependencies": { + "make-dir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", + "dev": true, + "requires": { + "semver": "^7.5.3" + } + }, + "semver": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "dev": true + } + } + }, + "istanbul-lib-source-maps": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", + "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" + }, + "dependencies": { + "debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "requires": { + "ms": "^2.1.3" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + } + } + }, + "istanbul-reports": { + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.6.tgz", + "integrity": "sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==", + "dev": true, + "requires": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + } + }, + "iterator.prototype": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/iterator.prototype/-/iterator.prototype-1.1.5.tgz", + "integrity": "sha512-H0dkQoCa3b2VEeKQBOxFph+JAbcrQdE7KC0UkqwpLmv2EC4P41QXP+rqo9wYodACiG5/WM5s9oDApTU8utwj9g==", + "dev": true, + "requires": { + "define-data-property": "^1.1.4", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.6", + "get-proto": "^1.0.0", + "has-symbols": "^1.1.0", + "set-function-name": "^2.0.2" + } + }, + "jest": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest/-/jest-29.6.4.tgz", + "integrity": "sha512-tEFhVQFF/bzoYV1YuGyzLPZ6vlPrdfvDmmAxudA1dLEuiztqg2Rkx20vkKY32xiDROcD2KXlgZ7Cu8RPeEHRKw==", + "dev": true, + "requires": { + "@jest/core": "^29.6.4", + "@jest/types": "^29.6.3", + "import-local": "^3.0.2", + "jest-cli": "^29.6.4" + } + }, + "jest-changed-files": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.6.3.tgz", + "integrity": "sha512-G5wDnElqLa4/c66ma5PG9eRjE342lIbF6SUnTJi26C3J28Fv2TVY2rOyKB9YGbSA5ogwevgmxc4j4aVjrEK6Yg==", + "dev": true, + "requires": { + "execa": "^5.0.0", + "jest-util": "^29.6.3", + "p-limit": "^3.1.0" + } + }, + "jest-circus": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.6.4.tgz", + "integrity": "sha512-YXNrRyntVUgDfZbjXWBMPslX1mQ8MrSG0oM/Y06j9EYubODIyHWP8hMUbjbZ19M3M+zamqEur7O80HODwACoJw==", + "dev": true, + "requires": { + "@jest/environment": "^29.6.4", + "@jest/expect": "^29.6.4", + "@jest/test-result": "^29.6.4", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "co": "^4.6.0", + "dedent": "^1.0.0", + "is-generator-fn": "^2.0.0", + "jest-each": "^29.6.3", + "jest-matcher-utils": "^29.6.4", + "jest-message-util": "^29.6.3", + "jest-runtime": "^29.6.4", + "jest-snapshot": "^29.6.4", + "jest-util": "^29.6.3", + "p-limit": "^3.1.0", + "pretty-format": "^29.6.3", + "pure-rand": "^6.0.0", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + } + }, + "jest-cli": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.6.4.tgz", + "integrity": "sha512-+uMCQ7oizMmh8ZwRfZzKIEszFY9ksjjEQnTEMTaL7fYiL3Kw4XhqT9bYh+A4DQKUb67hZn2KbtEnDuHvcgK4pQ==", + "dev": true, + "requires": { + "@jest/core": "^29.6.4", + "@jest/test-result": "^29.6.4", + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "import-local": "^3.0.2", + "jest-config": "^29.6.4", + "jest-util": "^29.6.3", + "jest-validate": "^29.6.3", + "prompts": "^2.0.1", + "yargs": "^17.3.1" + } + }, + "jest-config": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.6.4.tgz", + "integrity": "sha512-JWohr3i9m2cVpBumQFv2akMEnFEPVOh+9L2xIBJhJ0zOaci2ZXuKJj0tgMKQCBZAKA09H049IR4HVS/43Qb19A==", + "dev": true, + "requires": { + "@babel/core": "^7.11.6", + "@jest/test-sequencer": "^29.6.4", + "@jest/types": "^29.6.3", + "babel-jest": "^29.6.4", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "deepmerge": "^4.2.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-circus": "^29.6.4", + "jest-environment-node": "^29.6.4", + "jest-get-type": "^29.6.3", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.6.4", + "jest-runner": "^29.6.4", + "jest-util": "^29.6.3", + "jest-validate": "^29.6.3", + "micromatch": "^4.0.4", + "parse-json": "^5.2.0", + "pretty-format": "^29.6.3", + "slash": "^3.0.0", + "strip-json-comments": "^3.1.1" + }, + "dependencies": { + "parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + } + } + } + }, + "jest-diff": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", + "integrity": "sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==", + "dev": true, + "requires": { + "chalk": "^4.0.0", + "diff-sequences": "^29.6.3", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + } + }, + "jest-docblock": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.6.3.tgz", + "integrity": "sha512-2+H+GOTQBEm2+qFSQ7Ma+BvyV+waiIFxmZF5LdpBsAEjWX8QYjSCa4FrkIYtbfXUJJJnFCYrOtt6TZ+IAiTjBQ==", + "dev": true, + "requires": { + "detect-newline": "^3.0.0" + } + }, + "jest-each": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.6.3.tgz", + "integrity": "sha512-KoXfJ42k8cqbkfshW7sSHcdfnv5agDdHCPA87ZBdmHP+zJstTJc0ttQaJ/x7zK6noAL76hOuTIJ6ZkQRS5dcyg==", + "dev": true, + "requires": { + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "jest-util": "^29.6.3", + "pretty-format": "^29.6.3" + } + }, + "jest-environment-jsdom": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-29.6.4.tgz", + "integrity": "sha512-K6wfgUJ16DoMs02JYFid9lOsqfpoVtyJxpRlnTxUHzvZWBnnh2VNGRB9EC1Cro96TQdq5TtSjb3qUjNaJP9IyA==", + "dev": true, + "requires": { + "@jest/environment": "^29.6.4", + "@jest/fake-timers": "^29.6.4", + "@jest/types": "^29.6.3", + "@types/jsdom": "^20.0.0", + "@types/node": "*", + "jest-mock": "^29.6.3", + "jest-util": "^29.6.3", + "jsdom": "^20.0.0" + } + }, + "jest-environment-node": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.6.4.tgz", + "integrity": "sha512-i7SbpH2dEIFGNmxGCpSc2w9cA4qVD+wfvg2ZnfQ7XVrKL0NA5uDVBIiGH8SR4F0dKEv/0qI5r+aDomDf04DpEQ==", + "dev": true, + "requires": { + "@jest/environment": "^29.6.4", + "@jest/fake-timers": "^29.6.4", + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-mock": "^29.6.3", + "jest-util": "^29.6.3" + } + }, + "jest-get-type": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz", + "integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==", + "dev": true + }, + "jest-haste-map": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz", + "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==", + "dev": true, + "requires": { + "@jest/types": "^29.6.3", + "@types/graceful-fs": "^4.1.3", + "@types/node": "*", + "anymatch": "^3.0.3", + "fb-watchman": "^2.0.0", + "fsevents": "^2.3.2", + "graceful-fs": "^4.2.9", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", + "micromatch": "^4.0.4", + "walker": "^1.0.8" + } + }, + "jest-leak-detector": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.6.3.tgz", + "integrity": "sha512-0kfbESIHXYdhAdpLsW7xdwmYhLf1BRu4AA118/OxFm0Ho1b2RcTmO4oF6aAMaxpxdxnJ3zve2rgwzNBD4Zbm7Q==", + "dev": true, + "requires": { + "jest-get-type": "^29.6.3", + "pretty-format": "^29.6.3" + } + }, + "jest-matcher-utils": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz", + "integrity": "sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==", + "dev": true, + "requires": { + "chalk": "^4.0.0", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + } + }, + "jest-message-util": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.7.0.tgz", + "integrity": "sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.12.13", + "@jest/types": "^29.6.3", + "@types/stack-utils": "^2.0.0", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "micromatch": "^4.0.4", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + } + }, + "jest-mock": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz", + "integrity": "sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==", + "dev": true, + "requires": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-util": "^29.7.0" + } + }, + "jest-pnp-resolver": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz", + "integrity": "sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==", + "dev": true, + "requires": {} + }, + "jest-regex-util": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", + "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", + "dev": true + }, + "jest-resolve": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.6.4.tgz", + "integrity": "sha512-fPRq+0vcxsuGlG0O3gyoqGTAxasagOxEuyoxHeyxaZbc9QNek0AmJWSkhjlMG+mTsj+8knc/mWb3fXlRNVih7Q==", + "dev": true, + "requires": { + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.6.4", + "jest-pnp-resolver": "^1.2.2", + "jest-util": "^29.6.3", + "jest-validate": "^29.6.3", + "resolve": "^1.20.0", + "resolve.exports": "^2.0.0", + "slash": "^3.0.0" + } + }, + "jest-resolve-dependencies": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.6.4.tgz", + "integrity": "sha512-7+6eAmr1ZBF3vOAJVsfLj1QdqeXG+WYhidfLHBRZqGN24MFRIiKG20ItpLw2qRAsW/D2ZUUmCNf6irUr/v6KHA==", + "dev": true, + "requires": { + "jest-regex-util": "^29.6.3", + "jest-snapshot": "^29.6.4" + } + }, + "jest-runner": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.6.4.tgz", + "integrity": "sha512-SDaLrMmtVlQYDuG0iSPYLycG8P9jLI+fRm8AF/xPKhYDB2g6xDWjXBrR5M8gEWsK6KVFlebpZ4QsrxdyIX1Jaw==", + "dev": true, + "requires": { + "@jest/console": "^29.6.4", + "@jest/environment": "^29.6.4", + "@jest/test-result": "^29.6.4", + "@jest/transform": "^29.6.4", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "emittery": "^0.13.1", + "graceful-fs": "^4.2.9", + "jest-docblock": "^29.6.3", + "jest-environment-node": "^29.6.4", + "jest-haste-map": "^29.6.4", + "jest-leak-detector": "^29.6.3", + "jest-message-util": "^29.6.3", + "jest-resolve": "^29.6.4", + "jest-runtime": "^29.6.4", + "jest-util": "^29.6.3", + "jest-watcher": "^29.6.4", + "jest-worker": "^29.6.4", + "p-limit": "^3.1.0", + "source-map-support": "0.5.13" + }, + "dependencies": { + "source-map-support": { + "version": "0.5.13", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", + "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + } + } + }, + "jest-runtime": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.6.4.tgz", + "integrity": "sha512-s/QxMBLvmwLdchKEjcLfwzP7h+jsHvNEtxGP5P+Fl1FMaJX2jMiIqe4rJw4tFprzCwuSvVUo9bn0uj4gNRXsbA==", + "dev": true, + "requires": { + "@jest/environment": "^29.6.4", + "@jest/fake-timers": "^29.6.4", + "@jest/globals": "^29.6.4", + "@jest/source-map": "^29.6.3", + "@jest/test-result": "^29.6.4", + "@jest/transform": "^29.6.4", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "cjs-module-lexer": "^1.0.0", + "collect-v8-coverage": "^1.0.0", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.6.4", + "jest-message-util": "^29.6.3", + "jest-mock": "^29.6.3", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.6.4", + "jest-snapshot": "^29.6.4", + "jest-util": "^29.6.3", + "slash": "^3.0.0", + "strip-bom": "^4.0.0" + } + }, + "jest-snapshot": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz", + "integrity": "sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==", + "dev": true, + "requires": { + "@babel/core": "^7.11.6", + "@babel/generator": "^7.7.2", + "@babel/plugin-syntax-jsx": "^7.7.2", + "@babel/plugin-syntax-typescript": "^7.7.2", + "@babel/types": "^7.3.3", + "@jest/expect-utils": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "babel-preset-current-node-syntax": "^1.0.0", + "chalk": "^4.0.0", + "expect": "^29.7.0", + "graceful-fs": "^4.2.9", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "natural-compare": "^1.4.0", + "pretty-format": "^29.7.0", + "semver": "^7.5.3" + }, + "dependencies": { + "semver": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "dev": true + } + } + }, + "jest-util": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", + "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", + "dev": true, + "requires": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.9", + "picomatch": "^2.2.3" + } + }, + "jest-validate": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.6.3.tgz", + "integrity": "sha512-e7KWZcAIX+2W1o3cHfnqpGajdCs1jSM3DkXjGeLSNmCazv1EeI1ggTeK5wdZhF+7N+g44JI2Od3veojoaumlfg==", + "dev": true, + "requires": { + "@jest/types": "^29.6.3", + "camelcase": "^6.2.0", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "leven": "^3.1.0", + "pretty-format": "^29.6.3" + }, + "dependencies": { + "camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true + } + } + }, + "jest-watcher": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.6.4.tgz", + "integrity": "sha512-oqUWvx6+On04ShsT00Ir9T4/FvBeEh2M9PTubgITPxDa739p4hoQweWPRGyYeaojgT0xTpZKF0Y/rSY1UgMxvQ==", + "dev": true, + "requires": { + "@jest/test-result": "^29.6.4", + "@jest/types": "^29.6.3", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "emittery": "^0.13.1", + "jest-util": "^29.6.3", + "string-length": "^4.0.1" + } + }, + "jest-worker": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", + "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", + "dev": true, + "requires": { + "@types/node": "*", + "jest-util": "^29.7.0", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "dependencies": { + "supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "jiti": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.4.2.tgz", + "integrity": "sha512-rg9zJN+G4n2nfJl5MW3BMygZX56zKPNVEYYqq7adpmMh4Jn2QNEwhvQlFy6jPVdcod7txZtKHWnyZiA3a0zP7A==", + "dev": true + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "jsdom": { + "version": "20.0.3", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-20.0.3.tgz", + "integrity": "sha512-SYhBvTh89tTfCD/CRdSOm13mOBa42iTaTyfyEWBdKcGdPxPtLFBXuHR8XHb33YNYaP+lLbmSvBTsnoesCNJEsQ==", + "dev": true, + "requires": { + "abab": "^2.0.6", + "acorn": "^8.8.1", + "acorn-globals": "^7.0.0", + "cssom": "^0.5.0", + "cssstyle": "^2.3.0", + "data-urls": "^3.0.2", + "decimal.js": "^10.4.2", + "domexception": "^4.0.0", + "escodegen": "^2.0.0", + "form-data": "^4.0.0", + "html-encoding-sniffer": "^3.0.0", + "http-proxy-agent": "^5.0.0", + "https-proxy-agent": "^5.0.1", + "is-potential-custom-element-name": "^1.0.1", + "nwsapi": "^2.2.2", + "parse5": "^7.1.1", + "saxes": "^6.0.0", + "symbol-tree": "^3.2.4", + "tough-cookie": "^4.1.2", + "w3c-xmlserializer": "^4.0.0", + "webidl-conversions": "^7.0.0", + "whatwg-encoding": "^2.0.0", + "whatwg-mimetype": "^3.0.0", + "whatwg-url": "^11.0.0", + "ws": "^8.11.0", + "xml-name-validator": "^4.0.0" + }, + "dependencies": { + "acorn": { + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", + "dev": true + }, + "form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + } + }, + "tough-cookie": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz", + "integrity": "sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==", + "dev": true, + "requires": { + "psl": "^1.1.33", + "punycode": "^2.1.1", + "universalify": "^0.2.0", + "url-parse": "^1.5.3" + } + }, + "universalify": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", + "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", + "dev": true + } + } + }, + "jsesc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", + "dev": true + }, + "json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true + }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, + "json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", + "dev": true + }, + "json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true + }, + "jsonml-html": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/jsonml-html/-/jsonml-html-1.2.0.tgz", + "integrity": "sha512-vg30gQFD5X+1nY3do43BW9Iiq4F5BZcysXc+ydPNu7O5AxaqxnaI9ikjTjlE9y9KaAvgTwTP6nOpifDqDoYmjg==", + "dev": true + }, + "jsx-ast-utils": { + "version": "3.3.5", + "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz", + "integrity": "sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==", + "dev": true, + "requires": { + "array-includes": "^3.1.6", + "array.prototype.flat": "^1.3.1", + "object.assign": "^4.1.4", + "object.values": "^1.1.6" + } + }, + "junk": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/junk/-/junk-4.0.1.tgz", + "integrity": "sha512-Qush0uP+G8ZScpGMZvHUiRfI0YBWuB3gVBYlI0v0vvOJt5FLicco+IkP0a50LqTTQhmts/m6tP5SWE+USyIvcQ==", + "dev": true + }, + "keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "requires": { + "json-buffer": "3.0.1" + } + }, + "kleur": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "dev": true + }, + "leven": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", + "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", + "dev": true + }, + "levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + } + }, + "lilconfig": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz", + "integrity": "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==", + "dev": true + }, + "lines-and-columns": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", + "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", + "dev": true + }, + "load-json-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" + }, + "dependencies": { + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true + } + } + }, + "locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "requires": { + "p-locate": "^5.0.0" + } + }, + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, + "loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dev": true, + "requires": { + "js-tokens": "^3.0.0 || ^4.0.0" + } + }, + "magic-string": { + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.9.tgz", + "integrity": "sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==", + "dev": true, + "requires": { + "sourcemap-codec": "^1.4.8" + } + }, + "make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true + }, + "make-synchronous": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/make-synchronous/-/make-synchronous-0.1.1.tgz", + "integrity": "sha512-Y4SxxqhaoyMDokJQ0AZz0E+bLhRkOSR7Z/IQoTKPdS6HYi3aobal2kMHoHHoqBadPWjf07P4K1FQLXOx3wf9Yw==", + "dev": true, + "requires": { + "subsume": "^3.0.0", + "type-fest": "^0.16.0" + }, + "dependencies": { + "type-fest": { + "version": "0.16.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.16.0.tgz", + "integrity": "sha512-eaBzG6MxNzEn9kiwvtre90cXaNLkmadMWa1zQMs3XORCXNbsH/OewwbxC5ia9dCxIxnTAsSxXJaa/p5y8DlvJg==", + "dev": true + } + } + }, + "makeerror": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", + "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==", + "dev": true, + "requires": { + "tmpl": "1.0.5" + } + }, + "marked": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/marked/-/marked-11.2.0.tgz", + "integrity": "sha512-HR0m3bvu0jAPYiIvLUUQtdg1g6D247//lvcekpHO1WMvbwDlwSkZAX9Lw4F4YHE1T0HaaNve0tuAWuV1UJ6vtw==", + "dev": true + }, + "marked-highlight": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/marked-highlight/-/marked-highlight-2.1.0.tgz", + "integrity": "sha512-peBvgGZZqUw074Vy/N8Y7/6JQhSnR54/T0Ozq2/fAIBzcYfVfExFdQJptIhQxreR1elpwvJRrqhp6S/Prk8prA==", + "dev": true, + "requires": {} + }, + "math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "dev": true + }, + "memorystream": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", + "integrity": "sha1-htcJCzDORV1j+64S3aUaR93K+bI=", + "dev": true + }, + "meow": { + "version": "12.1.1", + "resolved": "https://registry.npmjs.org/meow/-/meow-12.1.1.tgz", + "integrity": "sha512-BhXM0Au22RwUneMPwSCnyhTOizdWoIEPU9sp0Aqa1PnDMR5Wv2FGXYDjuzJEIX+Eo2Rb8xuYe5jrnm5QowQFkw==", + "dev": true + }, + "merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, + "merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true + }, + "micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "dev": true, + "requires": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + } + }, + "microtime": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/microtime/-/microtime-3.1.1.tgz", + "integrity": "sha512-to1r7o24cDsud9IhN6/8wGmMx5R2kT0w2Xwm5okbYI3d1dk6Xv0m+Z+jg2vS9pt+ocgQHTCtgs/YuyJhySzxNg==", + "dev": true, + "requires": { + "node-addon-api": "^5.0.0", + "node-gyp-build": "^4.4.0" + } + }, + "mime-db": { + "version": "1.49.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.49.0.tgz", + "integrity": "sha512-CIc8j9URtOVApSFCQIF+VBkX1RwXp/oMMOrqdyXSBXq5RWNEsRfyj1kiRnQgmNXmHxPoFIxOroKA3zcU9P+nAA==", + "dev": true + }, + "mime-types": { + "version": "2.1.32", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.32.tgz", + "integrity": "sha512-hJGaVS4G4c9TSMYh2n6SQAGrC4RnfU+daP8G7cSCmaqNjiOoUY0VHCMS42pxnQmVF1GWwFhbHWn3RIxCqTmZ9A==", + "dev": true, + "requires": { + "mime-db": "1.49.0" + } + }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true + }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true + }, + "nanoid": { + "version": "3.3.10", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.10.tgz", + "integrity": "sha512-vSJJTG+t/dIKAUhUDw/dLdZ9s//5OxcHqLaDWWrW4Cdq7o6tdLIczUkMXt2MBNmk6sJRZBZRXVixs7URY1CmIg==", + "dev": true + }, + "nanospinner": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/nanospinner/-/nanospinner-1.2.2.tgz", + "integrity": "sha512-Zt/AmG6qRU3e+WnzGGLuMCEAO/dAu45stNbHY223tUxldaDAeE+FxSPsd9Q+j+paejmm0ZbrNVs5Sraqy3dRxA==", + "dev": true, + "requires": { + "picocolors": "^1.1.1" + } + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "nested-error-stacks": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/nested-error-stacks/-/nested-error-stacks-2.1.1.tgz", + "integrity": "sha512-9iN1ka/9zmX1ZvLV9ewJYEk9h7RyRRtqdK0woXcqohu8EWIerfPUjYJPg0ULy0UqP7cslmdGc8xKDJcojlKiaw==", + "dev": true + }, + "next": { + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/next/-/next-15.2.4.tgz", + "integrity": "sha512-VwL+LAaPSxEkd3lU2xWbgEOtrM8oedmyhBqaVNmgKB+GvZlCy9rgaEc+y2on0wv+l0oSFqLtYD6dcC1eAedUaQ==", + "dev": true, + "requires": { + "@next/env": "15.2.4", + "@next/swc-darwin-arm64": "15.2.4", + "@next/swc-darwin-x64": "15.2.4", + "@next/swc-linux-arm64-gnu": "15.2.4", + "@next/swc-linux-arm64-musl": "15.2.4", + "@next/swc-linux-x64-gnu": "15.2.4", + "@next/swc-linux-x64-musl": "15.2.4", + "@next/swc-win32-arm64-msvc": "15.2.4", + "@next/swc-win32-x64-msvc": "15.2.4", + "@swc/counter": "0.1.3", + "@swc/helpers": "0.5.15", + "busboy": "1.6.0", + "caniuse-lite": "^1.0.30001579", + "postcss": "8.4.31", + "sharp": "^0.33.5", + "styled-jsx": "5.1.6" + } + }, + "next-sitemap": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/next-sitemap/-/next-sitemap-4.2.3.tgz", + "integrity": "sha512-vjdCxeDuWDzldhCnyFCQipw5bfpl4HmZA7uoo3GAaYGjGgfL4Cxb1CiztPuWGmS+auYs7/8OekRS8C2cjdAsjQ==", + "dev": true, + "requires": { + "@corex/deepmerge": "^4.0.43", + "@next/env": "^13.4.3", + "fast-glob": "^3.2.12", + "minimist": "^1.2.8" + }, + "dependencies": { + "@next/env": { + "version": "13.5.8", + "resolved": "https://registry.npmjs.org/@next/env/-/env-13.5.8.tgz", + "integrity": "sha512-YmiG58BqyZ2FjrF2+5uZExL2BrLr8RTQzLXNDJ8pJr0O+rPlOeDPXp1p1/4OrR3avDidzZo3D8QO2cuDv1KCkw==", + "dev": true + } + } + }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, + "node-addon-api": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-5.1.0.tgz", + "integrity": "sha512-eh0GgfEkpnoWDq+VY8OyvYhFEzBk6jIYbRKdIlyTiAXIVJ8PyBaKb0rp7oDtoddbdoHWhq8wwr+XZ81F1rpNdA==", + "dev": true + }, + "node-gyp-build": { + "version": "4.8.2", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.2.tgz", + "integrity": "sha512-IRUxE4BVsHWXkV/SFOut4qTlagw2aM8T5/vnTsmrHJvVoKueJHRc/JaFND7QDDc61kLYUJ6qlZM3sqTSyx2dTw==", + "dev": true + }, + "node-int64": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", + "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", + "dev": true + }, + "node-releases": { + "version": "2.0.19", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz", + "integrity": "sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==", + "dev": true + }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + }, + "dependencies": { + "semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true + } + } + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, + "npm-run-all": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/npm-run-all/-/npm-run-all-4.1.5.tgz", + "integrity": "sha512-Oo82gJDAVcaMdi3nuoKFavkIHBRVqQ1qvMb+9LHk/cF4P6B2m8aP04hGf7oL6wZ9BuGwX1onlLhpuoofSyoQDQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "chalk": "^2.4.1", + "cross-spawn": "^6.0.5", + "memorystream": "^0.3.1", + "minimatch": "^3.0.4", + "pidtree": "^0.3.0", + "read-pkg": "^3.0.0", + "shell-quote": "^1.6.1", + "string.prototype.padend": "^3.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "cross-spawn": { + "version": "6.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.6.tgz", + "integrity": "sha512-VqCUuhcd1iB+dsv8gxPttb5iZh/D0iubSP21g36KXdEuf6I5JiioesUVjpCdHV9MZRUfVFlvwtIUyPfxo5trtw==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==", + "dev": true + }, + "semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, + "npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "requires": { + "path-key": "^3.0.0" + } + }, + "nwsapi": { + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.7.tgz", + "integrity": "sha512-ub5E4+FBPKwAZx0UwIQOjYWGHTEq5sPqHQNRN8Z9e4A7u3Tj1weLJsL59yH9vmvqEtBHaOmT6cYQKIZOxp35FQ==", + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "dev": true + }, + "object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "dev": true + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + }, + "object.assign": { + "version": "4.1.7", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.7.tgz", + "integrity": "sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw==", + "dev": true, + "requires": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0", + "has-symbols": "^1.1.0", + "object-keys": "^1.1.1" + } + }, + "object.entries": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.8.tgz", + "integrity": "sha512-cmopxi8VwRIAw/fkijJohSfpef5PdN0pMQJN6VC/ZKvn0LIknWD8KtgY6KlQdEc4tIjcQ3HxSMmnvtzIscdaYQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + } + }, + "object.fromentries": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.8.tgz", + "integrity": "sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0" + } + }, + "object.groupby": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.3.tgz", + "integrity": "sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2" + } + }, + "object.values": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.2.1.tgz", + "integrity": "sha512-gXah6aZrcUxjWg2zR2MwouP2eHlCBzdV4pygudehaKXSGW4v2AsRQUK+lwwXhii6KFZcunEnmSUoYp5CXibxtA==", + "dev": true, + "requires": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "requires": { + "mimic-fn": "^2.1.0" + } + }, + "open": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/open/-/open-10.1.0.tgz", + "integrity": "sha512-mnkeQ1qP5Ue2wd+aivTD3NHd/lZ96Lu0jgf0pwktLPtx6cTZiH7tyeGRRHs0zX0rbrahXPnXlUnbeXyaBBuIaw==", + "dev": true, + "requires": { + "default-browser": "^5.2.1", + "define-lazy-prop": "^3.0.0", + "is-inside-container": "^1.0.0", + "is-wsl": "^3.1.0" + } + }, + "optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "dev": true, + "requires": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + } + }, + "own-keys": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/own-keys/-/own-keys-1.0.1.tgz", + "integrity": "sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg==", + "dev": true, + "requires": { + "get-intrinsic": "^1.2.6", + "object-keys": "^1.1.1", + "safe-push-apply": "^1.0.0" + } + }, + "p-event": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/p-event/-/p-event-5.0.1.tgz", + "integrity": "sha512-dd589iCQ7m1L0bmC5NLlVYfy3TbBEsMUfWx9PyAgPeIcFZ/E2yaTZ4Rz4MiBmmJShviiftHVXOqfnfzJ6kyMrQ==", + "dev": true, + "requires": { + "p-timeout": "^5.0.2" + } + }, + "p-filter": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-filter/-/p-filter-3.0.0.tgz", + "integrity": "sha512-QtoWLjXAW++uTX67HZQz1dbTpqBfiidsB6VtQUC9iR85S120+s0T5sO6s+B5MLzFcZkrEd/DGMmCjR+f2Qpxwg==", + "dev": true, + "requires": { + "p-map": "^5.1.0" + }, + "dependencies": { + "p-map": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-5.5.0.tgz", + "integrity": "sha512-VFqfGDHlx87K66yZrNdI4YGtD70IRyd+zSvgks6mzHPRNkoKy+9EKP4SFC77/vTTQYmRmti7dvqC+m5jBrBAcg==", + "dev": true, + "requires": { + "aggregate-error": "^4.0.0" + } + } + } + }, + "p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "requires": { + "yocto-queue": "^0.1.0" + } + }, + "p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "requires": { + "p-limit": "^3.0.2" + } + }, + "p-map": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-6.0.0.tgz", + "integrity": "sha512-T8BatKGY+k5rU+Q/GTYgrEf2r4xRMevAN5mtXc2aPc4rS1j3s+vWTaO2Wag94neXuCAUAs8cxBL9EeB5EA6diw==", + "dev": true + }, + "p-timeout": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-5.1.0.tgz", + "integrity": "sha512-auFDyzzzGZZZdHz3BtET9VEz0SE/uMEAx7uWfGPucfzEwwe/xH0iVeZibQmANYE/hp9T2+UUZT5m+BKyrDp3Ew==", + "dev": true + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + } + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==", + "dev": true, + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + }, + "parse5": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", + "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", + "dev": true, + "requires": { + "entities": "^4.4.0" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true + }, + "picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true + }, + "picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true + }, + "pidtree": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.3.1.tgz", + "integrity": "sha512-qQbW94hLHEqCg7nhby4yRC7G2+jYHY4Rguc2bjw7Uug4GIJuu1tvf2uHaZv5Q8zdt+WKJ6qK1FOI6amaWUo5FA==", + "dev": true + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", + "dev": true + }, + "pirates": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz", + "integrity": "sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==", + "dev": true + }, + "platform": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/platform/-/platform-1.3.6.tgz", + "integrity": "sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg==", + "dev": true + }, + "possible-typed-array-names": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz", + "integrity": "sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==", + "dev": true + }, + "postcss": { + "version": "8.4.31", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", + "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==", + "dev": true, + "requires": { + "nanoid": "^3.3.6", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + } + }, + "prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true + }, + "prettier": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.5.0.tgz", + "integrity": "sha512-quyMrVt6svPS7CjQ9gKb3GLEX/rl3BCL2oa/QkNcXv4YNVBC9olt3s+H7ukto06q7B1Qz46PbrKLO34PR6vXcA==", + "dev": true + }, + "pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "dev": true, + "requires": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true + }, + "react-is": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "dev": true + } + } + }, + "prismjs": { + "version": "1.30.0", + "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.30.0.tgz", + "integrity": "sha512-DEvV2ZF2r2/63V+tK8hQvrR2ZGn10srHbXviTlcv7Kpzw8jWiNTqbVgjO3IY8RxrrOUF8VPMQQFysYYYv0YZxw==", + "dev": true + }, + "prompts": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", + "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", + "dev": true, + "requires": { + "kleur": "^3.0.3", + "sisteransi": "^1.0.5" + } + }, + "prop-types": { + "version": "15.8.1", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", + "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", + "dev": true, + "requires": { + "loose-envify": "^1.4.0", + "object-assign": "^4.1.1", + "react-is": "^16.13.1" + } + }, + "psl": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", + "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", + "dev": true + }, + "punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true + }, + "pure-rand": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.0.2.tgz", + "integrity": "sha512-6Yg0ekpKICSjPswYOuC5sku/TSWaRYlA0qsXqJgM/d/4pLPHPuTxK7Nbf7jFKzAeedUhR8C7K9Uv63FBsSo8xQ==", + "dev": true + }, + "querystringify": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", + "dev": true + }, + "queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true + }, + "random-seed": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/random-seed/-/random-seed-0.3.0.tgz", + "integrity": "sha512-y13xtn3kcTlLub3HKWXxJNeC2qK4mB59evwZ5EkeRlolx+Bp2ztF7LbcZmyCnOqlHQrLnfuNbi1sVmm9lPDlDA==", + "dev": true, + "requires": { + "json-stringify-safe": "^5.0.1" + } + }, + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "requires": { + "safe-buffer": "^5.1.0" + } + }, + "react": { + "version": "19.1.0", + "resolved": "https://registry.npmjs.org/react/-/react-19.1.0.tgz", + "integrity": "sha512-FS+XFBNvn3GTAWq26joslQgWNoFu08F4kl0J4CgdNKADkdSGXQyTCnKteIAJy96Br6YbpEU1LSzV5dYtjMkMDg==", + "dev": true + }, + "react-dom": { + "version": "19.1.0", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.1.0.tgz", + "integrity": "sha512-Xs1hdnE+DyKgeHJeJznQmYMIBG3TKIHJJT95Q58nHLSrElKlGQqDTR2HQ9fx5CN/Gk6Vh/kupBTDLU11/nDk/g==", + "dev": true, + "requires": { + "scheduler": "^0.26.0" + } + }, + "react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", + "dev": true + }, + "read-pkg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha512-BLq/cCO9two+lBgiTYNqD6GdtK8s4NpaWrl6/rCO9w0TUS8oJl7cmToOZfRYllKTISY6nt1U7jQ53brmKqY6BA==", + "dev": true, + "requires": { + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" + }, + "dependencies": { + "path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "requires": { + "pify": "^3.0.0" + } + } + } + }, + "readdirp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", + "dev": true + }, + "reflect.getprototypeof": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz", + "integrity": "sha512-00o4I+DVrefhv+nX0ulyi3biSHCPDe+yLv5o/p6d/UVlirijB8E16FtfwSAi4g3tcqrQ4lRAqQSoFEZJehYEcw==", + "dev": true, + "requires": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.9", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.7", + "get-proto": "^1.0.1", + "which-builtin-type": "^1.2.1" + } + }, + "regenerate": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", + "integrity": "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==", + "dev": true + }, + "regenerate-unicode-properties": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-8.2.0.tgz", + "integrity": "sha512-F9DjY1vKLo/tPePDycuH3dn9H1OTPIkVD9Kz4LODu+F2C75mgjAJ7x/gwy6ZcSNRAAkhNlJSOHRe8k3p+K9WhA==", + "dev": true, + "requires": { + "regenerate": "^1.4.0" + } + }, + "regexp.prototype.flags": { + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.4.tgz", + "integrity": "sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA==", + "dev": true, + "requires": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-errors": "^1.3.0", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "set-function-name": "^2.0.2" + } + }, + "regjsgen": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.2.tgz", + "integrity": "sha512-OFFT3MfrH90xIW8OOSyUrk6QHD5E9JOTeGodiJeBS3J6IwlgzJMNE/1bZklWz5oTg+9dCMyEetclvCVXOPoN3A==", + "dev": true + }, + "regjsparser": { + "version": "0.6.9", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.9.tgz", + "integrity": "sha512-ZqbNRz1SNjLAiYuwY0zoXW8Ne675IX5q+YHioAGbCw4X96Mjl2+dcX9B2ciaeyYjViDAfvIjFpQjJgLttTEERQ==", + "dev": true, + "requires": { + "jsesc": "~0.5.0" + }, + "dependencies": { + "jsesc": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==", + "dev": true + } + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true + }, + "requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", + "dev": true + }, + "resolve": { + "version": "1.22.10", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.10.tgz", + "integrity": "sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w==", + "dev": true, + "requires": { + "is-core-module": "^2.16.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + } + }, + "resolve-cwd": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", + "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", + "dev": true, + "requires": { + "resolve-from": "^5.0.0" + }, + "dependencies": { + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true + } + } + }, + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + }, + "resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true + }, + "resolve.exports": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", + "integrity": "sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==", + "dev": true + }, + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true + }, + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "rollup": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.34.8.tgz", + "integrity": "sha512-489gTVMzAYdiZHFVA/ig/iYFllCcWFHMvUHI1rpFmkoUtRlQxqh6/yiNqnYibjMZ2b/+FUQwldG+aLsEt6bglQ==", + "dev": true, + "requires": { + "@rollup/rollup-android-arm-eabi": "4.34.8", + "@rollup/rollup-android-arm64": "4.34.8", + "@rollup/rollup-darwin-arm64": "4.34.8", + "@rollup/rollup-darwin-x64": "4.34.8", + "@rollup/rollup-freebsd-arm64": "4.34.8", + "@rollup/rollup-freebsd-x64": "4.34.8", + "@rollup/rollup-linux-arm-gnueabihf": "4.34.8", + "@rollup/rollup-linux-arm-musleabihf": "4.34.8", + "@rollup/rollup-linux-arm64-gnu": "4.34.8", + "@rollup/rollup-linux-arm64-musl": "4.34.8", + "@rollup/rollup-linux-loongarch64-gnu": "4.34.8", + "@rollup/rollup-linux-powerpc64le-gnu": "4.34.8", + "@rollup/rollup-linux-riscv64-gnu": "4.34.8", + "@rollup/rollup-linux-s390x-gnu": "4.34.8", + "@rollup/rollup-linux-x64-gnu": "4.34.8", + "@rollup/rollup-linux-x64-musl": "4.34.8", + "@rollup/rollup-win32-arm64-msvc": "4.34.8", + "@rollup/rollup-win32-ia32-msvc": "4.34.8", + "@rollup/rollup-win32-x64-msvc": "4.34.8", + "@types/estree": "1.0.6", + "fsevents": "~2.3.2" + } + }, + "run-applescript": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/run-applescript/-/run-applescript-7.0.0.tgz", + "integrity": "sha512-9by4Ij99JUr/MCFBUkDKLWK3G9HVXmabKz9U5MlIAIuvuzkiOicRYs8XJLxX+xahD+mLiiCYDqF9dKAgtzKP1A==", + "dev": true + }, + "run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "requires": { + "queue-microtask": "^1.2.2" + } + }, + "safe-array-concat": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.3.tgz", + "integrity": "sha512-AURm5f0jYEOydBj7VQlVvDrjeFgthDdEF5H1dP+6mNpoXOMo1quQqJ4wvJDyRZ9+pO3kGWoOdmV08cSv2aJV6Q==", + "dev": true, + "requires": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "get-intrinsic": "^1.2.6", + "has-symbols": "^1.1.0", + "isarray": "^2.0.5" + }, + "dependencies": { + "isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + } + } + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true + }, + "safe-push-apply": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/safe-push-apply/-/safe-push-apply-1.0.0.tgz", + "integrity": "sha512-iKE9w/Z7xCzUMIZqdBsp6pEQvwuEebH4vdpjcDWnyzaI6yl6O9FHvVpmGelvEHNsoY6wGblkxR6Zty/h00WiSA==", + "dev": true, + "requires": { + "es-errors": "^1.3.0", + "isarray": "^2.0.5" + }, + "dependencies": { + "isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + } + } + }, + "safe-regex-test": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.1.0.tgz", + "integrity": "sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==", + "dev": true, + "requires": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "is-regex": "^1.2.1" + } + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "saxes": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/saxes/-/saxes-6.0.0.tgz", + "integrity": "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==", + "dev": true, + "requires": { + "xmlchars": "^2.2.0" + } + }, + "scheduler": { + "version": "0.26.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.26.0.tgz", + "integrity": "sha512-NlHwttCI/l5gCPR3D1nNXtWABUmBwvZpEQiD4IXSbIDq8BzLIK/7Ir5gTFSGZDUu37K5cMNp0hFtzO38sC7gWA==", + "dev": true + }, + "semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true + }, + "serialize-javascript": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", + "dev": true, + "requires": { + "randombytes": "^2.1.0" + } + }, + "set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, + "requires": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + } + }, + "set-function-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", + "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", + "dev": true, + "requires": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.2" + } + }, + "set-proto": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/set-proto/-/set-proto-1.0.0.tgz", + "integrity": "sha512-RJRdvCo6IAnPdsvP/7m6bsQqNnn1FCBX5ZNtFL98MmFF/4xAIJTIg1YbHW5DC2W5SKZanrC6i4HsJqlajw/dZw==", + "dev": true, + "requires": { + "dunder-proto": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0" + } + }, + "sharp": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.33.5.tgz", + "integrity": "sha512-haPVm1EkS9pgvHrQ/F3Xy+hgcuMV0Wm9vfIBSiwZ05k+xgb0PkBQpGsAA/oWdDobNaZTH5ppvHtzCFbnSEwHVw==", + "dev": true, + "optional": true, + "requires": { + "@img/sharp-darwin-arm64": "0.33.5", + "@img/sharp-darwin-x64": "0.33.5", + "@img/sharp-libvips-darwin-arm64": "1.0.4", + "@img/sharp-libvips-darwin-x64": "1.0.4", + "@img/sharp-libvips-linux-arm": "1.0.5", + "@img/sharp-libvips-linux-arm64": "1.0.4", + "@img/sharp-libvips-linux-s390x": "1.0.4", + "@img/sharp-libvips-linux-x64": "1.0.4", + "@img/sharp-libvips-linuxmusl-arm64": "1.0.4", + "@img/sharp-libvips-linuxmusl-x64": "1.0.4", + "@img/sharp-linux-arm": "0.33.5", + "@img/sharp-linux-arm64": "0.33.5", + "@img/sharp-linux-s390x": "0.33.5", + "@img/sharp-linux-x64": "0.33.5", + "@img/sharp-linuxmusl-arm64": "0.33.5", + "@img/sharp-linuxmusl-x64": "0.33.5", + "@img/sharp-wasm32": "0.33.5", + "@img/sharp-win32-ia32": "0.33.5", + "@img/sharp-win32-x64": "0.33.5", + "color": "^4.2.3", + "detect-libc": "^2.0.3", + "semver": "^7.6.3" + }, + "dependencies": { + "semver": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "dev": true, + "optional": true + } + } + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "shell-quote": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.2.tgz", + "integrity": "sha512-AzqKpGKjrj7EM6rKVQEPpB288oCfnrEIuyoT9cyF4nmGa7V8Zk6f7RRqYisX8X9m+Q7bd632aZW4ky7EhbQztA==", + "dev": true + }, + "side-channel": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "dev": true, + "requires": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + } + }, + "side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "dev": true, + "requires": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + } + }, + "side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "dev": true, + "requires": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + } + }, + "side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "dev": true, + "requires": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + } + }, + "signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true + }, + "simple-swizzle": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", + "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==", + "dev": true, + "optional": true, + "requires": { + "is-arrayish": "^0.3.1" + }, + "dependencies": { + "is-arrayish": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", + "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==", + "dev": true, + "optional": true + } + } + }, + "sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", + "dev": true + }, + "size-limit": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/size-limit/-/size-limit-11.2.0.tgz", + "integrity": "sha512-2kpQq2DD/pRpx3Tal/qRW1SYwcIeQ0iq8li5CJHQgOC+FtPn2BVmuDtzUCgNnpCrbgtfEHqh+iWzxK+Tq6C+RQ==", + "dev": true, + "requires": { + "bytes-iec": "^3.1.1", + "chokidar": "^4.0.3", + "jiti": "^2.4.2", + "lilconfig": "^3.1.3", + "nanospinner": "^1.2.2", + "picocolors": "^1.1.1", + "tinyglobby": "^0.2.11" + } + }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true + }, + "smob": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/smob/-/smob-1.4.0.tgz", + "integrity": "sha512-MqR3fVulhjWuRNSMydnTlweu38UhQ0HXM4buStD/S3mc/BzX3CuM9OmhyQpmtYCvoYdl5ris6TI0ZqH355Ymqg==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "source-map-js": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", + "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", + "dev": true + }, + "source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "sourcemap-codec": { + "version": "1.4.8", + "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", + "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", + "dev": true + }, + "spdx-correct": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", + "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.9.tgz", + "integrity": "sha512-Ki212dKK4ogX+xDo4CtOZBVIwhsKBEfsEEcwmJfLQzirgc2jIWdzg40Unxz/HzEUqM1WFzVlQSMF9kZZ2HboLQ==", + "dev": true + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "stable-hash": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/stable-hash/-/stable-hash-0.0.4.tgz", + "integrity": "sha512-LjdcbuBeLcdETCrPn9i8AYAZ1eCtu4ECAWtP7UleOiZ9LzVxRzzUZEoZ8zB24nhkQnDWyET0I+3sWokSDS3E7g==", + "dev": true + }, + "stack-utils": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz", + "integrity": "sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==", + "dev": true, + "requires": { + "escape-string-regexp": "^2.0.0" + }, + "dependencies": { + "escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "dev": true + } + } + }, + "streamsearch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", + "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==", + "dev": true + }, + "string-length": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", + "integrity": "sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==", + "dev": true, + "requires": { + "char-regex": "^1.0.2", + "strip-ansi": "^6.0.0" + } + }, + "string.prototype.matchall": { + "version": "4.0.12", + "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.12.tgz", + "integrity": "sha512-6CC9uyBL+/48dYizRf7H7VAYCMCNTBeM78x/VTUe9bFEaxBepPJDa1Ow99LqI/1yF7kuy7Q3cQsYMrcjGUcskA==", + "dev": true, + "requires": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.6", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.6", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "internal-slot": "^1.1.0", + "regexp.prototype.flags": "^1.5.3", + "set-function-name": "^2.0.2", + "side-channel": "^1.1.0" + } + }, + "string.prototype.padend": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/string.prototype.padend/-/string.prototype.padend-3.1.2.tgz", + "integrity": "sha512-/AQFLdYvePENU3W5rgurfWSMU6n+Ww8n/3cUt7E+vPBB/D7YDG8x+qjoFs4M/alR2bW7Qg6xMjVwWUOvuQ0XpQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.2" + } + }, + "string.prototype.repeat": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/string.prototype.repeat/-/string.prototype.repeat-1.0.0.tgz", + "integrity": "sha512-0u/TldDbKD8bFCQ/4f5+mNRrXwZ8hg2w7ZR8wa16e8z9XpePWl3eGEcUD0OXpEH/VJH/2G3gjUtR3ZOiBe2S/w==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } + }, + "string.prototype.trim": { + "version": "1.2.10", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.10.tgz", + "integrity": "sha512-Rs66F0P/1kedk5lyYyH9uBzuiI/kNRmwJAR9quK6VOtIpZ2G+hMZd+HQbbv25MgCA6gEffoMZYxlTod4WcdrKA==", + "dev": true, + "requires": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "define-data-property": "^1.1.4", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-object-atoms": "^1.0.0", + "has-property-descriptors": "^1.0.2" + } + }, + "string.prototype.trimend": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.9.tgz", + "integrity": "sha512-G7Ok5C6E/j4SGfyLCloXTrngQIQU3PWtXGst3yM7Bea9FRURf1S42ZHlZZtsNque2FN2PoUhfZXYLNWwEr4dLQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + } + }, + "string.prototype.trimstart": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", + "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + }, + "strip-bom": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "dev": true + }, + "strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true + }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true + }, + "style-mod": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/style-mod/-/style-mod-4.1.2.tgz", + "integrity": "sha512-wnD1HyVqpJUI2+eKZ+eo1UwghftP6yuFheBqqe+bWCotBjC2K1YnteJILRMs3SM4V/0dLEW1SC27MWP5y+mwmw==", + "dev": true + }, + "styled-jsx": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.1.6.tgz", + "integrity": "sha512-qSVyDTeMotdvQYoHWLNGwRFJHC+i+ZvdBRYosOFgC+Wg1vx4frN2/RG/NA7SYqqvKNLf39P2LSRA2pu6n0XYZA==", + "dev": true, + "requires": { + "client-only": "0.0.1" + } + }, + "subsume": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/subsume/-/subsume-3.0.0.tgz", + "integrity": "sha512-6n/UfV8UWKwJNO8OAOiKntwEMihuBeeoJfzpL542C+OuvT4iWG9SwjrXkOmsxjb4SteHUsos9SvrdqZ9+ICwTQ==", + "dev": true, + "requires": { + "escape-string-regexp": "^2.0.0", + "unique-string": "^2.0.0" + }, + "dependencies": { + "escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "dev": true + } + } + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true + }, + "symbol-tree": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", + "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", + "dev": true + }, + "tapable": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", + "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", + "dev": true + }, + "terser": { + "version": "5.19.2", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.19.2.tgz", + "integrity": "sha512-qC5+dmecKJA4cpYxRa5aVkKehYsQKc+AHeKl0Oe62aYjBL8ZA33tTljktDHJSaxxMnbI5ZYw+o/S2DxxLu8OfA==", + "dev": true, + "requires": { + "@jridgewell/source-map": "^0.3.3", + "acorn": "^8.8.2", + "commander": "^2.20.0", + "source-map-support": "~0.5.20" + }, + "dependencies": { + "acorn": { + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", + "dev": true + } + } + }, + "test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, + "requires": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + } + }, + "tinyglobby": { + "version": "0.2.12", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.12.tgz", + "integrity": "sha512-qkf4trmKSIiMTs/E63cxH+ojC2unam7rJ0WrauAzpT3ECNTxGRMlaXxVbfxMUC/w0LaYk6jQ4y/nGR9uBO3tww==", + "dev": true, + "requires": { + "fdir": "^6.4.3", + "picomatch": "^4.0.2" + }, + "dependencies": { + "fdir": { + "version": "6.4.3", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.3.tgz", + "integrity": "sha512-PMXmW2y1hDDfTSRc9gaXIuCCRpuoz3Kaz8cUelp3smouvfT632ozg2vrT6lJsHKKOF59YLbOGfAWGUcKEfRMQw==", + "dev": true, + "requires": {} + }, + "picomatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "dev": true + } + } + }, + "tmpl": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", + "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", + "dev": true + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + }, + "tr46": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz", + "integrity": "sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==", + "dev": true, + "requires": { + "punycode": "^2.1.1" + } + }, + "transducers-js": { + "version": "0.4.174", + "resolved": "https://registry.npmjs.org/transducers-js/-/transducers-js-0.4.174.tgz", + "integrity": "sha1-1YYsEO/0vj0zIqv2u3QuMPG7b8Q=", + "dev": true + }, + "ts-api-utils": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.0.1.tgz", + "integrity": "sha512-dnlgjFSVetynI8nzgJ+qF62efpglpWRk8isUEWZGWlJYySCTD6aKvbUDu+zbPeDakk3bg5H4XpitHukgfL1m9w==", + "dev": true, + "requires": {} + }, + "ts-node": { + "version": "10.9.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", + "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", + "dev": true, + "requires": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.1", + "yn": "3.1.1" + }, + "dependencies": { + "acorn": { + "version": "8.14.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.1.tgz", + "integrity": "sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg==", + "dev": true + } + } + }, + "tsconfig-paths": { + "version": "3.15.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", + "integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==", + "dev": true, + "requires": { + "@types/json5": "^0.0.29", + "json5": "^1.0.2", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" + }, + "dependencies": { + "json5": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true + } + } + }, + "tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "dev": true + }, + "tstyche": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/tstyche/-/tstyche-3.5.0.tgz", + "integrity": "sha512-N4SUp/ZWaMGEcglpVFIzKez0GQEiBdfFDgcnqwv9O1mePZgos8N1cZCzNgGtPGo/w0ym04MjJcDnsw1sorEzgA==", + "dev": true, + "requires": {} + }, + "type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1" + } + }, + "type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true + }, + "typed-array-buffer": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz", + "integrity": "sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==", + "dev": true, + "requires": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.14" + } + }, + "typed-array-byte-length": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.3.tgz", + "integrity": "sha512-BaXgOuIxz8n8pIq3e7Atg/7s+DpiYrxn4vdot3w9KbnBhcRQq6o3xemQdIfynqSeXeDrF32x+WvfzmOjPiY9lg==", + "dev": true, + "requires": { + "call-bind": "^1.0.8", + "for-each": "^0.3.3", + "gopd": "^1.2.0", + "has-proto": "^1.2.0", + "is-typed-array": "^1.1.14" + } + }, + "typed-array-byte-offset": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.4.tgz", + "integrity": "sha512-bTlAFB/FBYMcuX81gbL4OcpH5PmlFHqlCCpAl8AlEzMz5k53oNDvN8p1PNOWLEmI2x4orp3raOFB51tv9X+MFQ==", + "dev": true, + "requires": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "for-each": "^0.3.3", + "gopd": "^1.2.0", + "has-proto": "^1.2.0", + "is-typed-array": "^1.1.15", + "reflect.getprototypeof": "^1.0.9" + } + }, + "typed-array-length": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.7.tgz", + "integrity": "sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "is-typed-array": "^1.1.13", + "possible-typed-array-names": "^1.0.0", + "reflect.getprototypeof": "^1.0.6" + } + }, + "typescript": { + "version": "5.7.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.3.tgz", + "integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==", + "dev": true + }, + "typescript-eslint": { + "version": "8.24.0", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.24.0.tgz", + "integrity": "sha512-/lmv4366en/qbB32Vz5+kCNZEMf6xYHwh1z48suBwZvAtnXKbP+YhGe8OLE2BqC67LMqKkCNLtjejdwsdW6uOQ==", + "dev": true, + "requires": { + "@typescript-eslint/eslint-plugin": "8.24.0", + "@typescript-eslint/parser": "8.24.0", + "@typescript-eslint/utils": "8.24.0" + } + }, + "unbox-primitive": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.1.0.tgz", + "integrity": "sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw==", + "dev": true, + "requires": { + "call-bound": "^1.0.3", + "has-bigints": "^1.0.2", + "has-symbols": "^1.1.0", + "which-boxed-primitive": "^1.1.1" + } + }, + "unicode-canonical-property-names-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", + "integrity": "sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==", + "dev": true + }, + "unicode-match-property-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz", + "integrity": "sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg==", + "dev": true, + "requires": { + "unicode-canonical-property-names-ecmascript": "^1.0.4", + "unicode-property-aliases-ecmascript": "^1.0.4" + } + }, + "unicode-match-property-value-ecmascript": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.2.0.tgz", + "integrity": "sha512-wjuQHGQVofmSJv1uVISKLE5zO2rNGzM/KCYZch/QQvez7C1hUhBIuZ701fYXExuufJFMPhv2SyL8CyoIfMLbIQ==", + "dev": true + }, + "unicode-property-aliases-ecmascript": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.1.0.tgz", + "integrity": "sha512-PqSoPh/pWetQ2phoj5RLiaqIk4kCNwoV3CI+LfGmWLKI3rE3kl1h59XpX2BjgDrmbxD9ARtQobPGU1SguCYuQg==", + "dev": true + }, + "unique-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz", + "integrity": "sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg==", + "dev": true, + "requires": { + "crypto-random-string": "^2.0.0" + } + }, + "update-browserslist-db": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.2.tgz", + "integrity": "sha512-PPypAm5qvlD7XMZC3BujecnaOxwhrtoFR+Dqkk5Aa/6DssiH0ibKoketaj9w8LP7Bont1rYeoV5plxD7RTEPRg==", + "dev": true, + "requires": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + } + }, + "uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "url-parse": { + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", + "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", + "dev": true, + "requires": { + "querystringify": "^2.1.1", + "requires-port": "^1.0.0" + } + }, + "v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", + "dev": true + }, + "v8-to-istanbul": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.1.0.tgz", + "integrity": "sha512-6z3GW9x8G1gd+JIIgQQQxXuiJtCXeAjp6RaPEPLv62mH3iPHPxV6W3robxtCzNErRo6ZwTmzWhsbNvjyEBKzKA==", + "dev": true, + "requires": { + "@jridgewell/trace-mapping": "^0.3.12", + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^1.6.0" + } + }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "w3c-keyname": { + "version": "2.2.8", + "resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.8.tgz", + "integrity": "sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ==", + "dev": true + }, + "w3c-xmlserializer": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-4.0.0.tgz", + "integrity": "sha512-d+BFHzbiCx6zGfz0HyQ6Rg69w9k19nviJspaj4yNscGjrHu94sVP+aRm75yEbCh+r2/yR+7q6hux9LVtbuTGBw==", + "dev": true, + "requires": { + "xml-name-validator": "^4.0.0" + } + }, + "walker": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", + "integrity": "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==", + "dev": true, + "requires": { + "makeerror": "1.0.12" + } + }, + "webidl-conversions": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", + "dev": true + }, + "whatwg-encoding": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz", + "integrity": "sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg==", + "dev": true, + "requires": { + "iconv-lite": "0.6.3" + } + }, + "whatwg-mimetype": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz", + "integrity": "sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==", + "dev": true + }, + "whatwg-url": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-11.0.0.tgz", + "integrity": "sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ==", + "dev": true, + "requires": { + "tr46": "^3.0.0", + "webidl-conversions": "^7.0.0" + } + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "which-boxed-primitive": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.1.1.tgz", + "integrity": "sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA==", + "dev": true, + "requires": { + "is-bigint": "^1.1.0", + "is-boolean-object": "^1.2.1", + "is-number-object": "^1.1.1", + "is-string": "^1.1.1", + "is-symbol": "^1.1.1" + } + }, + "which-builtin-type": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/which-builtin-type/-/which-builtin-type-1.2.1.tgz", + "integrity": "sha512-6iBczoX+kDQ7a3+YJBnh3T+KZRxM/iYNPXicqk66/Qfm1b93iu+yOImkg0zHbj5LNOcNv1TEADiZ0xa34B4q6Q==", + "dev": true, + "requires": { + "call-bound": "^1.0.2", + "function.prototype.name": "^1.1.6", + "has-tostringtag": "^1.0.2", + "is-async-function": "^2.0.0", + "is-date-object": "^1.1.0", + "is-finalizationregistry": "^1.1.0", + "is-generator-function": "^1.0.10", + "is-regex": "^1.2.1", + "is-weakref": "^1.0.2", + "isarray": "^2.0.5", + "which-boxed-primitive": "^1.1.0", + "which-collection": "^1.0.2", + "which-typed-array": "^1.1.16" + }, + "dependencies": { + "isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + } + } + }, + "which-collection": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.2.tgz", + "integrity": "sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==", + "dev": true, + "requires": { + "is-map": "^2.0.3", + "is-set": "^2.0.3", + "is-weakmap": "^2.0.2", + "is-weakset": "^2.0.3" + } + }, + "which-typed-array": { + "version": "1.1.18", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.18.tgz", + "integrity": "sha512-qEcY+KJYlWyLH9vNbsr6/5j59AXk5ni5aakf8ldzBvGde6Iz4sxZGkJyWSAueTG7QhOvNRYb1lDdFmL5Td0QKA==", + "dev": true, + "requires": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "for-each": "^0.3.3", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2" + } + }, + "word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "write-file-atomic": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz", + "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", + "dev": true, + "requires": { + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.7" + } + }, + "ws": { + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.1.tgz", + "integrity": "sha512-RKW2aJZMXeMxVpnZ6bck+RswznaxmzdULiBr6KY7XkTnW8uvt0iT9H5DkHUChXrc+uurzwa0rVI16n/Xzjdz1w==", + "dev": true, + "requires": {} + }, + "xml-name-validator": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-4.0.0.tgz", + "integrity": "sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==", + "dev": true + }, + "xmlchars": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", + "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", + "dev": true + }, + "y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true + }, + "yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "requires": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "dependencies": { + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true + } + } + }, + "yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true + }, + "yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true + } + } +} diff --git a/package.json b/package.json index d3d813b6b4..e773736d96 100644 --- a/package.json +++ b/package.json @@ -1,100 +1,27 @@ { "name": "immutable", - "version": "3.8.1", + "version": "5.1.2", "description": "Immutable Data Collections", - "homepage": "https://facebook.github.com/immutable-js", + "license": "MIT", + "homepage": "https://immutable-js.com", "author": { "name": "Lee Byron", "url": "https://github.com/leebyron" }, "repository": { "type": "git", - "url": "git://github.com/facebook/immutable-js.git" + "url": "git://github.com/immutable-js/immutable-js.git" }, "bugs": { - "url": "https://github.com/facebook/immutable-js/issues" + "url": "https://github.com/immutable-js/immutable-js/issues" }, "main": "dist/immutable.js", - "typings": "dist/immutable-nonambient.d.ts", - "typescript": { - "definition": "dist/immutable.d.ts" - }, - "scripts": { - "build": "grunt default && gulp default", - "lint": "eslint src/ && grunt lint && gulp lint", - "testonly": "./resources/node_test.sh", - "test": "npm run lint && npm run testonly", - "perf": "node ./resources/bench.js", - "start": "npm run build && node ./pages/resources/start.js", - "deploy": "(cd ./pages/out && git init && git config user.name \"Travis CI\" && git config user.email \"github@fb.com\" && git add . && git commit -m \"Deploy to GitHub Pages\" && git push --force --quiet \"https://${GH_TOKEN}@github.com/facebook/immutable-js.git\" master:gh-pages > /dev/null 2>1)" - }, - "jest": { - "scriptPreprocessor": "resources/jestPreprocessor.js", - "testFileExtensions": [ - "js", - "ts" - ], - "persistModuleRegistryBetweenSpecs": true - }, - "devDependencies": { - "acorn": "0.11.x", - "babel-eslint": "^4.1.8", - "benchmark": "^1.0.0", - "bluebird": "3.1.1", - "browser-sync": "2.11.0", - "browserify": "^5.11.2", - "colors": "1.1.2", - "del": "2.2.0", - "es6-transpiler": "0.7.18", - "eslint": "^1.10.3", - "estraverse": "1.9.3", - "express": "^4.13.4", - "fbjs-scripts": "^0.5.0", - "grunt": "0.4.5", - "grunt-cli": "0.1.13", - "grunt-contrib-clean": "0.7.0", - "grunt-contrib-copy": "0.8.2", - "grunt-contrib-jshint": "0.11.3", - "grunt-release": "0.13.0", - "gulp": "3.9.0", - "gulp-concat": "2.6.0", - "gulp-filter": "3.0.1", - "gulp-header": "1.7.1", - "gulp-jest": "^0.2.1", - "gulp-jshint": "^1.8.4", - "gulp-less": "3.0.5", - "gulp-size": "2.0.0", - "gulp-sourcemaps": "1.6.0", - "gulp-uglify": "1.5.1", - "gulp-util": "3.0.7", - "harmonize": "1.4.4", - "jasmine-check": "^0.1.2", - "jest-cli": "^0.5.10", - "jshint-stylish": "^0.4.0", - "magic-string": "0.10.2", - "marked": "0.3.5", - "microtime": "^2.0.0", - "node-jsx": "^0.12.4", - "react": "^0.12.0", - "react-router": "^0.11.2", - "react-tools": "^0.12.0", - "rollup": "0.24.0", - "run-sequence": "1.1.5", - "through2": "2.0.0", - "typescript": "1.7.5", - "uglify-js": "2.6.1", - "vinyl-buffer": "1.0.0", - "vinyl-source-stream": "1.1.0" - }, - "engines": { - "node": ">=0.10.0" - }, + "module": "dist/immutable.es.js", + "types": "dist/immutable.d.ts", "files": [ "dist", - "contrib", "README.md", - "LICENSE", - "PATENTS" + "LICENSE" ], "keywords": [ "immutable", @@ -108,5 +35,127 @@ "sequence", "iteration" ], - "license": "BSD-3-Clause" + "publishKeys": [ + "name", + "version", + "description", + "license", + "homepage", + "author", + "repository", + "bugs", + "main", + "module", + "sideEffects", + "types", + "files", + "keywords" + ], + "engines": { + "npm": ">=7.0.0" + }, + "scripts": { + "test": "run-s format lint type-check build test:*", + "test:unit": "jest", + "test:types": "tstyche", + "format": "npm run lint:format -- --write", + "lint": "run-s lint:*", + "lint:format": "prettier --check \"{__tests__,src,type-definitions,website/src,perf,resources}/**/*{.js,.mjs,.ts,.tsx,.flow,.css}\"", + "lint:js": "eslint", + "type-check": "run-s type-check:*", + "type-check:ts": "tsc --project tsconfig.src.json && tsc --project type-definitions/tsconfig.json && tsc --project __tests__/tsconfig.json", + "type-check:flow": "flow check type-definitions/flow-tests --include-warnings", + "build": "run-s build:*", + "build:clean": "rimraf dist", + "build:dist": "rollup -c ./resources/rollup-config.mjs", + "build:types": "cpy \"./type-definitions/immutable.*\" dist", + "build:prepare": "./resources/prepare-dist.sh", + "build:stats": "node ./resources/dist-stats.mjs", + "website:build": "cd website && next build && next-sitemap", + "website:dev": "cd website && next dev --turbopack", + "check-build-output": "node ./resources/check-build-output.mjs", + "check-git-clean": "./resources/check-git-clean.sh", + "benchmark": "node ./resources/benchmark.js", + "publish": "echo 'ONLY PUBLISH VIA CI'; exit 1;" + }, + "prettier": { + "singleQuote": true, + "trailingComma": "es5" + }, + "devDependencies": { + "@codemirror/commands": "^6.8.1", + "@codemirror/lang-javascript": "^6.2.3", + "@codemirror/state": "^6.5.2", + "@codemirror/theme-one-dark": "^6.1.2", + "@codemirror/view": "^6.36.5", + "@eslint/js": "^9.20.0", + "@jdeniau/immutable-devtools": "^0.2.0", + "@jest/globals": "^29.7.0", + "@rollup/plugin-buble": "1.0.3", + "@rollup/plugin-commonjs": "28.0.2", + "@rollup/plugin-json": "6.1.0", + "@rollup/plugin-terser": "^0.4.4", + "@rollup/plugin-typescript": "^12.1.2", + "@size-limit/esbuild-why": "^11.2.0", + "@size-limit/preset-small-lib": "^11.2.0", + "@types/prismjs": "^1.26.3", + "@types/random-seed": "0.3.5", + "@types/react": "19.1.0", + "benchmark": "2.1.4", + "codemirror": "^6.0.1", + "colors": "1.4.0", + "cpy-cli": "^5.0.0", + "eslint": "^9.20.1", + "eslint-import-resolver-typescript": "^3.7.0", + "eslint-plugin-import": "^2.31.0", + "eslint-plugin-jest": "^28.11.0", + "eslint-plugin-react": "^7.37.4", + "fast-check": "^4.0.0", + "flow-bin": "0.160.0", + "globals": "^15.15.0", + "jest": "^29.0.0", + "jest-environment-jsdom": "^29.6.4", + "jsonml-html": "^1.2.0", + "make-synchronous": "0.1.1", + "marked": "^11.2.0", + "marked-highlight": "^2.1.0", + "microtime": "3.1.1", + "next": "15.2.4", + "next-sitemap": "4.2.3", + "npm-run-all": "4.1.5", + "prettier": "^3.5.0", + "prismjs": "^1.29.0", + "random-seed": "0.3.0", + "react": "19.1.0", + "react-dom": "19.1.0", + "rimraf": "2.7.1", + "rollup": "4.34.8", + "size-limit": "^11.2.0", + "transducers-js": "0.4.174", + "ts-node": "^10.9.2", + "tslib": "^2.8.1", + "tstyche": "^3.5", + "typescript": "5.7", + "typescript-eslint": "^8.24.0" + }, + "size-limit": [ + { + "name": "all", + "path": "dist/immutable.es.js", + "import": "*", + "limit": "20 kB" + }, + { + "name": "List", + "path": "dist/immutable.es.js", + "import": "{ List }", + "limit": "20 kB" + }, + { + "name": "Seq", + "path": "dist/immutable.es.js", + "import": "{ Seq }", + "limit": "20 kB" + } + ] } diff --git a/pages/lib/DocVisitor.js b/pages/lib/DocVisitor.js deleted file mode 100644 index 37be4623a6..0000000000 --- a/pages/lib/DocVisitor.js +++ /dev/null @@ -1,435 +0,0 @@ -var TypeScript = require('./typescript-services'); -var TypeKind = require('./TypeKind'); -var { Seq } = require('../../'); - -class DocVisitor extends TypeScript.SyntaxWalker { - - constructor(text) { - this.text = text; - this.stack = []; - this.data = {}; - this.typeParams = []; - this.aliases = []; - } - - push(newData) { - this.stack.push(this.data); - this.data = newData; - } - - pop() { - var prevData = this.data; - this.data = this.stack.pop(); - return prevData; - } - - getLineNum(node) { - return this.text.lineMap().getLineNumberFromPosition( - TypeScript.firstToken(node).fullStart() - ); - } - - getDoc(node) { - return parseComment( - last( - TypeScript.ASTHelpers.docComments(node, this.text) - ) - ); - } - - isTypeParam(name) { - return this.typeParams.some(set => !!set[name]); - } - - isAliased(name) { - return !!Seq(this.aliases).last()[name]; - } - - addAliases(comment, name) { - Seq(comment && comment.notes).filter( - note => note.name === 'alias' - ).map( - node => node.body - ).forEach(alias => { - Seq(this.aliases).last()[alias] = name; - }); - } - - visitModuleDeclaration(node) { - var moduleObj = {}; - - var comment = this.getDoc(node); - if (!shouldIgnore(comment)) { - var name = - node.name ? node.name.text() : - node.stringLiteral ? node.stringLiteral.text() : - ''; - - if (comment) { - setIn(this.data, [name, 'doc'], comment); - } - - setIn(this.data, [name, 'module'], moduleObj); - } - - this.push(moduleObj); - this.aliases.push({}); - - super.visitModuleDeclaration(node); - - this.aliases.pop(); - this.pop(); - } - - visitFunctionDeclaration(node) { - var comment = this.getDoc(node); - var name = node.identifier.text(); - if (!shouldIgnore(comment) && !this.isAliased(name)) { - this.addAliases(comment, name); - - var comment = this.getDoc(node); - if (comment) { - setIn(this.data, [name, 'call', 'doc'], comment); - } - - var callSignature = this.parseCallSignature(node.callSignature); - callSignature.line = this.getLineNum(node); - pushIn(this.data, [name, 'call', 'signatures'], callSignature); - } - super.visitFunctionDeclaration(node); - } - - visitInterfaceDeclaration(node) { - var interfaceObj = {}; - - var comment = this.getDoc(node); - var ignore = shouldIgnore(comment); - if (!ignore) { - var name = node.identifier.text(); - - interfaceObj.line = this.getLineNum(node) - - if (comment) { - interfaceObj.doc = comment; - } - if (node.typeParameterList) { - interfaceObj.typeParams = node.typeParameterList.typeParameters.map(tp => { - if (tp.constraint) { - throw new Error('Not yet implemented: type constraint'); - } - return tp.identifier.text(); - }); - } - - this.typeParams.push( - Seq(interfaceObj.typeParams).toSetSeq().toObject() - ); - - if (node.heritageClauses) { - node.heritageClauses.forEach(hc => { - var kind; - if (hc.extendsOrImplementsKeyword.kind() === TypeScript.SyntaxKind.ExtendsKeyword) { - kind = 'extends'; - } else if (hc.extendsOrImplementsKeyword.kind() === TypeScript.SyntaxKind.ImplementsKeyword) { - kind = 'implements'; - } else { - throw new Error('Unknown heritageClause'); - } - interfaceObj[kind] = hc.typeNames.map(c => this.parseType(c)); - }); - } - setIn(this.data, [name, 'interface'], interfaceObj); - } - - this.push(interfaceObj); - this.aliases.push({}); - - super.visitInterfaceDeclaration(node); - - if (!ignore) { - this.typeParams.pop(); - } - - this.aliases.pop(); - this.pop(); - } - - visitTypeAnnotation(node) { - // do not visit type annotations. - return; - } - - ensureGroup(node) { - var trivia = TypeScript.firstToken(node).leadingTrivia(); - if (trivia && trivia.trivia) { - trivia.trivia.forEach(tv => { - if (tv.kind() === TypeScript.SyntaxKind.SingleLineCommentTrivia) { - pushIn(this.data, ['groups'], { - title: tv.fullText().substr(3) - }); - } - }) - } - if (!this.data.groups || this.data.groups.length === 0) { - pushIn(this.data, ['groups'], {}); - } - } - - visitPropertySignature(node) { - var comment = this.getDoc(node); - var name = node.propertyName.text(); - if (!shouldIgnore(comment) && !this.isAliased(name)) { - this.addAliases(comment, name); - - this.ensureGroup(node); - - var propertyObj = { - line: this.getLineNum(node), - // name: name // redundant - }; - - var comment = this.getDoc(node); - if (comment) { - setIn(last(this.data.groups), ['members', '#'+name, 'doc'], comment); - } - - setIn(last(this.data.groups), ['members', '#'+name], propertyObj); - - if (node.questionToken) { - throw new Error('NYI: questionToken'); - } - - if (node.typeAnnotation) { - propertyObj.type = this.parseType(node.typeAnnotation.type); - } - } - super.visitPropertySignature(node); - } - - visitMethodSignature(node) { - var comment = this.getDoc(node); - var name = node.propertyName.text(); - if (!shouldIgnore(comment) && !this.isAliased(name)) { - this.addAliases(comment, name); - - this.ensureGroup(node); - - var comment = this.getDoc(node); - if (comment) { - setIn(last(this.data.groups), ['members', '#'+name, 'doc'], comment); - } - - var callSignature = this.parseCallSignature(node.callSignature); - callSignature.line = this.getLineNum(node); - pushIn(last(this.data.groups), ['members', '#'+name, 'signatures'], callSignature); - - if (node.questionToken) { - throw new Error('NYI: questionToken'); - } - } - super.visitMethodSignature(node); - } - - parseCallSignature(node) { - var callSignature = {}; - - if (node.typeParameterList && - node.typeParameterList.typeParameters.length) { - callSignature.typeParams = node.typeParameterList.typeParameters.map(tp => { - if (tp.constraint) { - throw new Error('Not yet implemented: type constraint'); - } - return tp.identifier.text(); - }); - } - - this.typeParams.push( - Seq(callSignature.typeParams).toSetSeq().toObject() - ); - - if (node.parameterList.parameters.length) { - callSignature.params = - node.parameterList.parameters.map(p => this.parseParam(p)); - } - - if (node.typeAnnotation) { - callSignature.type = this.parseType(node.typeAnnotation.type); - } - - this.typeParams.pop(); - - return callSignature; - } - - parseType(node) { - switch (node.kind()) { - case TypeScript.SyntaxKind.AnyKeyword: - return { - k: TypeKind.Any - }; - case TypeScript.SyntaxKind.BooleanKeyword: - return { - k: TypeKind.Boolean - }; - case TypeScript.SyntaxKind.NumberKeyword: - return { - k: TypeKind.Number - }; - case TypeScript.SyntaxKind.StringKeyword: - return { - k: TypeKind.String - }; - case TypeScript.SyntaxKind.ObjectType: - return { - k: TypeKind.Object, - members: node.typeMembers.map(m => { - switch (m.kind()) { - case TypeScript.SyntaxKind.IndexSignature: - return { - index: true, - params: m.parameters.map(p => this.parseParam(p)), - type: this.parseType(m.typeAnnotation.type) - } - case TypeScript.SyntaxKind.PropertySignature: - return { - name: m.propertyName.text(), - type: this.parseType(m.typeAnnotation.type) - } - } - throw new Error('Unknown member kind: ' + m.kind()); - }) - }; - case TypeScript.SyntaxKind.ArrayType: - return { - k: TypeKind.Array, - type: this.parseType(node.type) - } - case TypeScript.SyntaxKind.FunctionType: - return { - k: TypeKind.Function, - params: node.parameterList.parameters.map(p => this.parseParam(p)), - type: this.parseType(node.type) - }; - case TypeScript.SyntaxKind.IdentifierName: - var text = node.text(); - if (this.isTypeParam(text)) { - return { - k: TypeKind.Param, - param: node.text() - }; - } else { - return { - k: TypeKind.Type, - name: node.text() - }; - } - case TypeScript.SyntaxKind.GenericType: - var t = { - k: TypeKind.Type, - name: getText(node.name) - }; - if (node.typeArgumentList) { - t.args = node.typeArgumentList.typeArguments.map( - ta => this.parseType(ta) - ); - } - return t; - case TypeScript.SyntaxKind.QualifiedName: - var type = this.parseType(node.right); - type.qualifier = [node.left.text()].concat(type.qualifier || []); - return type; - } - throw new Error('Unknown type kind: ' + node.kind()); - } - - parseParam(node) { - var p = { - name: node.identifier.text() - }; - if (node.dotDotDotToken) { - p.varArgs = true; - } - if (node.questionToken) { - p.optional = true; - } - if (node.equalsValueClause) { - throw new Error('NYI: equalsValueClause'); - } - if (node.typeAnnotation) { - p.type = this.parseType(node.typeAnnotation.type); - } - return p; - } -} - -function getText(node) { - if (node.kind() === TypeScript.SyntaxKind.QualifiedName) { - return getText(node.left) + '.' + getText(node.right); - } - return node.text(); -} - -function last(list) { - return list[list.length - 1]; -} - -function pushIn(obj, path, value) { - for (var ii = 0; ii < path.length; ii++) { - obj = obj[path[ii]] || (obj[path[ii]] = (ii === path.length - 1 ? [] : {})); - } - obj.push(value); -} - -function setIn(obj, path, value) { - for (var ii = 0; ii < path.length - 1; ii++) { - obj = obj[path[ii]] || (obj[path[ii]] = {}); - } - obj[path[path.length - 1]] = value; -} - -var COMMENT_NOTE_RX = /@(\w+)(?:\s+(.*))?/; - -var NOTE_BLACKLIST = { - override: true -}; - -function parseComment(node) { - if (!node) { - return node; - } - var text = node.fullText(); - var lines; - if (text.substr(0, 2) === '//') { - lines = text.substr(2); - } else { - lines = text.split('\n').slice(1, -1).map(l => l.trim().substr(2)); - } - - var notes = lines - .map(l => l.match(COMMENT_NOTE_RX)) - .filter(n => n !== null && !NOTE_BLACKLIST[n[1]]) - .map(n => ({ name: n[1], body: n[2] })); - var paragraphs = - lines.filter(l => !COMMENT_NOTE_RX.test(l)).join('\n').split('\n\n'); - var synopsis = paragraphs.shift(); - var description = paragraphs.join('\n\n'); - - var comment = { synopsis }; - if (notes.length) { - comment.notes = notes; - } - if (description) { - comment.description = description; - } - - return comment; -} - - -function shouldIgnore(comment) { - return !!(comment && Seq(comment.notes).find( - note => note.name === 'ignore' - )); -} - -module.exports = DocVisitor; diff --git a/pages/lib/TypeKind.js b/pages/lib/TypeKind.js deleted file mode 100644 index 1f7d0987aa..0000000000 --- a/pages/lib/TypeKind.js +++ /dev/null @@ -1,15 +0,0 @@ -var TypeKind = { - Any: 0, - - Boolean: 1, - Number: 2, - String: 3, - Object: 4, - Array: 5, - Function: 6, - - Param: 7, - Type: 8, -}; - -module.exports = TypeKind; diff --git a/pages/lib/collectMemberGroups.js b/pages/lib/collectMemberGroups.js deleted file mode 100644 index 369f314d5a..0000000000 --- a/pages/lib/collectMemberGroups.js +++ /dev/null @@ -1,74 +0,0 @@ -var { Seq } = require('../../'); -// Note: intentionally using raw defs, not getTypeDefs to avoid circular ref. -var defs = require('../resources/immutable.d.json'); - -function collectMemberGroups(interfaceDef, options) { - var members = {}; - - if (interfaceDef) { - collectFromDef(interfaceDef); - } - - var groups = {'':[]}; - - if (options.showInGroups) { - Seq(members).forEach(member => { - (groups[member.group] || (groups[member.group] = [])).push(member); - }); - } else { - groups[''] = Seq(members).sortBy(member => member.memberName).toArray(); - } - - if (!options.showInherited) { - groups = Seq(groups).map( - members => members.filter(member => !member.inherited) - ).toObject(); - } - - return groups; - - function collectFromDef(def, name) { - - def.groups && def.groups.forEach(g => { - Seq(g.members).forEach((memberDef, memberName) => { - collectMember(g.title || '', memberName, memberDef); - }); - }); - - def.extends && def.extends.forEach(e => { - var superModule = defs.Immutable; - e.name.split('.').forEach(part => { - superModule = - superModule && superModule.module && superModule.module[part]; - }); - var superInterface = superModule && superModule.interface; - if (superInterface) { - collectFromDef(superInterface, e.name); - } - }); - - function collectMember(group, memberName, memberDef) { - var member = members[memberName]; - if (member) { - if (!member.inherited) { - member.overrides = { name, def, memberDef }; - } - if (!member.group && group) { - member.group = group; - } - } else { - member = { - group, - memberName: memberName.substr(1), - memberDef - }; - if (def !== interfaceDef) { - member.inherited = { name, def }; - } - members[memberName] = member; - } - } - } -} - -module.exports = collectMemberGroups; diff --git a/pages/lib/genMarkdownDoc.js b/pages/lib/genMarkdownDoc.js deleted file mode 100644 index 75a4a6eb4d..0000000000 --- a/pages/lib/genMarkdownDoc.js +++ /dev/null @@ -1,17 +0,0 @@ -require('node-jsx').install({harmony: true}); -var markdown = require('./markdown'); -var defs = require('./getTypeDefs'); - - -function genMarkdownDoc(typeDefSource) { - return markdown( - typeDefSource.replace(/\n[^\n]+?travis-ci.org[^\n]+?\n/, '\n'), - { - defs, - typePath: ['Immutable'], - relPath: 'docs/' - } - ); -} - -module.exports = genMarkdownDoc; diff --git a/pages/lib/genTypeDefData.js b/pages/lib/genTypeDefData.js deleted file mode 100644 index c1280a7d42..0000000000 --- a/pages/lib/genTypeDefData.js +++ /dev/null @@ -1,16 +0,0 @@ -var TypeScript = require('./typescript-services'); -require('node-jsx').install({harmony: true}); -var DocVisitor = require('./DocVisitor'); - - -function genTypeDefData(typeDefPath, typeDefSource) { - var typeDefText = TypeScript.SimpleText.fromString(typeDefSource); - var typeDefAST = TypeScript.Parser.parse(typeDefPath, typeDefText, 1, true); - - var visitor = new DocVisitor(typeDefText); - TypeScript.visitNodeOrToken(visitor, typeDefAST.sourceUnit()); - var typeDefData = visitor.pop(); - return typeDefData; -} - -module.exports = genTypeDefData; diff --git a/pages/lib/getTypeDefs.js b/pages/lib/getTypeDefs.js deleted file mode 100644 index dcbee0db4e..0000000000 --- a/pages/lib/getTypeDefs.js +++ /dev/null @@ -1,5 +0,0 @@ -var markdownDocs = require('./markdownDocs'); -var defs = require('../resources/immutable.d.json'); -markdownDocs(defs); - -module.exports = defs; diff --git a/pages/lib/markdown.js b/pages/lib/markdown.js deleted file mode 100644 index ee02566c56..0000000000 --- a/pages/lib/markdown.js +++ /dev/null @@ -1,165 +0,0 @@ -var { Seq } = require('../../'); -var marked = require('marked'); -var prism = require('./prism'); -var collectMemberGroups = require('./collectMemberGroups'); -// Note: intentionally using raw defs, not getTypeDefs to avoid circular ref. -var defs = require('../resources/immutable.d.json'); - - -function collectAllMembersForAllTypes(defs) { - var allMembers = new WeakMap(); - _collectAllMembersForAllTypes(defs); - return allMembers; - function _collectAllMembersForAllTypes(defs) { - - Seq(defs).forEach((def, name) => { - if (def.interface) { - var groups = collectMemberGroups(def.interface, { showInherited: true }); - allMembers.set( - def.interface, - Seq.Keyed(groups[''].map( - member => [member.memberName, member.memberDef] - )).toObject() - ); - } - if (def.module) { - _collectAllMembersForAllTypes(def.module); - } - }); - return allMembers; - } -} - -var allMembers = collectAllMembersForAllTypes(defs); - -// functions come before keywords -prism.languages.insertBefore('javascript', 'keyword', { - 'var': /\b(this)\b/g, - 'block-keyword': /\b(if|else|while|for|function)\b/g, - 'primitive': /\b(true|false|null|undefined)\b/g, - 'function': prism.languages.function, -}); - -prism.languages.insertBefore('javascript', { - 'qualifier': /\b[A-Z][a-z0-9_]+/g, -}); - -marked.setOptions({ - xhtml: true, - highlight: code => prism.highlight(code, prism.languages.javascript) -}); - -var renderer = new marked.Renderer(); - -renderer.code = function(code, lang, escaped) { - if (this.options.highlight) { - var out = this.options.highlight(code, lang); - if (out != null && out !== code) { - escaped = true; - code = out; - } - } - return '' + - (escaped ? code : escapeCode(code, true)) + - ''; -}; - -var METHOD_RX = /^(\w+)(?:[#.](\w+))?(?:\(\))?$/; -var PARAM_RX = /^\w+$/; -var MDN_TYPES = { - 'Array': true, - 'Object': true, - 'JSON': true, -}; -var MDN_BASE_URL = - 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/'; - -renderer.codespan = function(text) { - return '' + decorateCodeSpan(text, this.options) + ''; -}; - -function decorateCodeSpan(text, options) { - var context = options.context; - - if (context.signatures && - PARAM_RX.test(text) && - context.signatures.some(sig => - sig.params && sig.params.some(param => param.name === text))) { - return '' + text + ''; - } - - var method = METHOD_RX.exec(text); - if (method) { - method = method.slice(1).filter(function(x){return !!x}); - if (MDN_TYPES[method[0]]) { - return '
'+text+''; - } - if (context.typePath && - !arrEndsWith(context.typePath, method) && - !arrEndsWith(context.typePath.slice(0, -1), method)) { - var path = findPath(context, method); - if (path) { - var relPath = context.relPath || ''; - return ''+text+''; - } - } - } - - if (options.highlight) { - return options.highlight(unescapeCode(text), prism.languages.javascript); - } - - return text; -} - -function arrEndsWith(arr1, arr2) { - for (var ii = 1; ii <= arr2.length; ii++) { - if (arr2[arr2.length - ii] !== arr1[arr1.length - ii]) { - return false; - } - } - return true; -} - -function findPath(context, search) { - var relative = context.typePath; - - for (var ii = 0; ii <= relative.length; ii++) { - var path = relative.slice(0, relative.length - ii).concat(search); - if (path.reduce( - (def, name) => def && ( - (def.module && def.module[name]) || - (def.interface && allMembers && allMembers.get(def.interface)[name]) || - undefined - ), - {module: defs} - )) { - return path; - } - } -} - -function escapeCode(code) { - return code - .replace(/&/g, '&') - .replace(//g, '>') - .replace(/"/g, '"') - .replace(/'/g, '''); -} - -function unescapeCode(code) { - return code - .replace(/</g, '<') - .replace(/>/g, '>') - .replace(/"/g, '"') - .replace(/'/g, '\'') - .replace(/&/g, '&'); -} - -function markdown(content, context) { - context || (context = {}); - return content ? marked(content, { renderer, context }) : content; -} - -module.exports = markdown; diff --git a/pages/lib/markdownDocs.js b/pages/lib/markdownDocs.js deleted file mode 100644 index 7482250f82..0000000000 --- a/pages/lib/markdownDocs.js +++ /dev/null @@ -1,50 +0,0 @@ -var { Seq } = require('../../'); -var markdown = require('./markdown'); - - -function markdownDocs(defs) { - markdownTypes(defs, []); - - function markdownTypes(typeDefs, path) { - Seq(typeDefs).forEach((typeDef, typeName) => { - var typePath = path.concat(typeName); - markdownDoc( - typeDef.doc, - { typePath } - ); - typeDef.call && markdownDoc( - typeDef.call.doc, - { typePath, - signatures: typeDef.call.signatures } - ); - if (typeDef.interface) { - markdownDoc(typeDef.interface.doc, { defs, typePath }); - Seq(typeDef.interface.groups).forEach(group => - Seq(group.members).forEach((member, memberName) => - markdownDoc( - member.doc, - { typePath: typePath.concat(memberName.slice(1)), - signatures: member.signatures } - ) - ) - ); - } - typeDef.module && markdownTypes(typeDef.module, typePath); - }); - } -} - -function markdownDoc(doc, context) { - if (!doc) { - return; - } - doc.synopsis && (doc.synopsis = markdown(doc.synopsis, context)); - doc.description && (doc.description = markdown(doc.description, context)); - doc.notes && doc.notes.forEach(note => { - if (note.name !== 'alias') { - note.body = markdown(note.body, context); - } - }); -} - -module.exports = markdownDocs; diff --git a/pages/lib/prism.js b/pages/lib/prism.js deleted file mode 100644 index ae123e914d..0000000000 --- a/pages/lib/prism.js +++ /dev/null @@ -1,661 +0,0 @@ -/* ********************************************** - Begin prism-core.js -********************************************** */ - -self = (typeof window !== 'undefined') - ? window // if in browser - : ( - (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope) - ? self // if in worker - : {} // if in node js - ); - -/** - * Prism: Lightweight, robust, elegant syntax highlighting - * MIT license http://www.opensource.org/licenses/mit-license.php/ - * @author Lea Verou http://lea.verou.me - */ - -var Prism = (function(){ - -// Private helper vars -var lang = /\blang(?:uage)?-(?!\*)(\w+)\b/i; - -var _ = self.Prism = { - util: { - encode: function (tokens) { - if (tokens instanceof Token) { - return new Token(tokens.type, _.util.encode(tokens.content), tokens.alias); - } else if (_.util.type(tokens) === 'Array') { - return tokens.map(_.util.encode); - } else { - return tokens.replace(/&/g, '&').replace(/ text.length) { - // Something went terribly wrong, ABORT, ABORT! - break tokenloop; - } - - if (str instanceof Token) { - continue; - } - - pattern.lastIndex = 0; - - var match = pattern.exec(str); - - if (match) { - if(lookbehind) { - lookbehindLength = match[1].length; - } - - var from = match.index - 1 + lookbehindLength, - match = match[0].slice(lookbehindLength), - len = match.length, - to = from + len, - before = str.slice(0, from + 1), - after = str.slice(to + 1); - - var args = [i, 1]; - - if (before) { - args.push(before); - } - - var wrapped = new Token(token, inside? _.tokenize(match, inside) : match, alias); - - args.push(wrapped); - - if (after) { - args.push(after); - } - - Array.prototype.splice.apply(strarr, args); - } - } - } - } - - return strarr; - }, - - hooks: { - all: {}, - - add: function (name, callback) { - var hooks = _.hooks.all; - - hooks[name] = hooks[name] || []; - - hooks[name].push(callback); - }, - - run: function (name, env) { - var callbacks = _.hooks.all[name]; - - if (!callbacks || !callbacks.length) { - return; - } - - for (var i=0, callback; callback = callbacks[i++];) { - callback(env); - } - } - } -}; - -var Token = _.Token = function(type, content, alias) { - this.type = type; - this.content = content; - this.alias = alias; -}; - -Token.stringify = function(o, language, parent) { - if (typeof o == 'string') { - return o; - } - - if (Object.prototype.toString.call(o) == '[object Array]') { - return o.map(function(element) { - return Token.stringify(element, language, o); - }).join(''); - } - - var env = { - type: o.type, - content: Token.stringify(o.content, language, parent), - tag: 'span', - classes: ['token', o.type], - attributes: {}, - language: language, - parent: parent - }; - - if (env.type == 'comment') { - env.attributes['spellcheck'] = 'true'; - } - - if (o.alias) { - var aliases = _.util.type(o.alias) === 'Array' ? o.alias : [o.alias]; - Array.prototype.push.apply(env.classes, aliases); - } - - _.hooks.run('wrap', env); - - var attributes = ''; - - for (var name in env.attributes) { - attributes += name + '="' + (env.attributes[name] || '') + '"'; - } - - return '<' + env.tag + ' class="' + env.classes.join(' ') + '" ' + attributes + '>' + env.content + ''; - -}; - -if (!self.document) { - if (!self.addEventListener) { - // in Node.js - return self.Prism; - } - // In worker - self.addEventListener('message', function(evt) { - var message = JSON.parse(evt.data), - lang = message.language, - code = message.code; - - self.postMessage(JSON.stringify(_.util.encode(_.tokenize(code, _.languages[lang])))); - self.close(); - }, false); - - return self.Prism; -} - -// Get current script and highlight -var script = document.getElementsByTagName('script'); - -script = script[script.length - 1]; - -if (script) { - _.filename = script.src; - - if (document.addEventListener && !script.hasAttribute('data-manual')) { - document.addEventListener('DOMContentLoaded', _.highlightAll); - } -} - -return self.Prism; - -})(); - -if (typeof module !== 'undefined' && module.exports) { - module.exports = Prism; -} - - -/* ********************************************** - Begin prism-markup.js -********************************************** */ - -Prism.languages.markup = { - 'comment': //g, - 'prolog': /<\?.+?\?>/, - 'doctype': //, - 'cdata': //i, - 'tag': { - pattern: /<\/?[\w:-]+\s*(?:\s+[\w:-]+(?:=(?:("|')(\\?[\w\W])*?\1|[^\s'">=]+))?\s*)*\/?>/gi, - inside: { - 'tag': { - pattern: /^<\/?[\w:-]+/i, - inside: { - 'punctuation': /^<\/?/, - 'namespace': /^[\w-]+?:/ - } - }, - 'attr-value': { - pattern: /=(?:('|")[\w\W]*?(\1)|[^\s>]+)/gi, - inside: { - 'punctuation': /=|>|"/g - } - }, - 'punctuation': /\/?>/g, - 'attr-name': { - pattern: /[\w:-]+/g, - inside: { - 'namespace': /^[\w-]+?:/ - } - } - - } - }, - 'entity': /\&#?[\da-z]{1,8};/gi -}; - -// Plugin to make entity title show the real entity, idea by Roman Komarov -Prism.hooks.add('wrap', function(env) { - - if (env.type === 'entity') { - env.attributes['title'] = env.content.replace(/&/, '&'); - } -}); - - -/* ********************************************** - Begin prism-css.js -********************************************** */ - -Prism.languages.css = { - 'comment': /\/\*[\w\W]*?\*\//g, - 'atrule': { - pattern: /@[\w-]+?.*?(;|(?=\s*{))/gi, - inside: { - 'punctuation': /[;:]/g - } - }, - 'url': /url\((["']?).*?\1\)/gi, - 'selector': /[^\{\}\s][^\{\};]*(?=\s*\{)/g, - 'property': /(\b|\B)[\w-]+(?=\s*:)/ig, - 'string': /("|')(\\?.)*?\1/g, - 'important': /\B!important\b/gi, - 'punctuation': /[\{\};:]/g, - 'function': /[-a-z0-9]+(?=\()/ig -}; - -if (Prism.languages.markup) { - Prism.languages.insertBefore('markup', 'tag', { - 'style': { - pattern: /[\w\W]*?<\/style>/ig, - inside: { - 'tag': { - pattern: /|<\/style>/ig, - inside: Prism.languages.markup.tag.inside - }, - rest: Prism.languages.css - }, - alias: 'language-css' - } - }); - - Prism.languages.insertBefore('inside', 'attr-value', { - 'style-attr': { - pattern: /\s*style=("|').+?\1/ig, - inside: { - 'attr-name': { - pattern: /^\s*style/ig, - inside: Prism.languages.markup.tag.inside - }, - 'punctuation': /^\s*=\s*['"]|['"]\s*$/, - 'attr-value': { - pattern: /.+/gi, - inside: Prism.languages.css - } - }, - alias: 'language-css' - } - }, Prism.languages.markup.tag); -} - -/* ********************************************** - Begin prism-clike.js -********************************************** */ - -Prism.languages.clike = { - 'comment': [ - { - pattern: /(^|[^\\])\/\*[\w\W]*?\*\//g, - lookbehind: true - }, - { - pattern: /(^|[^\\:])\/\/.*?(\r?\n|$)/g, - lookbehind: true - } - ], - 'string': /("|')(\\?.)*?\1/g, - 'class-name': { - pattern: /((?:(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/ig, - lookbehind: true, - inside: { - punctuation: /(\.|\\)/ - } - }, - 'keyword': /\b(if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/g, - 'boolean': /\b(true|false)\b/g, - 'function': { - pattern: /[a-z0-9_]+\(/ig, - inside: { - punctuation: /\(/ - } - }, - 'number': /\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/g, - 'operator': /[-+]{1,2}|!|<=?|>=?|={1,3}|&{1,2}|\|?\||\?|\*|\/|\~|\^|\%/g, - 'ignore': /&(lt|gt|amp);/gi, - 'punctuation': /[{}[\];(),.:]/g -}; - - -/* ********************************************** - Begin prism-javascript.js -********************************************** */ - -Prism.languages.javascript = Prism.languages.extend('clike', { - 'keyword': /\b(break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|finally|for|function|get|if|implements|import|in|instanceof|interface|let|new|null|package|private|protected|public|return|set|static|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/g, - 'number': /\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?|NaN|-?Infinity)\b/g -}); - -Prism.languages.insertBefore('javascript', 'keyword', { - 'regex': { - pattern: /(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/g, - lookbehind: true - } -}); - -if (Prism.languages.markup) { - Prism.languages.insertBefore('markup', 'tag', { - 'script': { - pattern: /[\w\W]*?<\/script>/ig, - inside: { - 'tag': { - pattern: /|<\/script>/ig, - inside: Prism.languages.markup.tag.inside - }, - rest: Prism.languages.javascript - }, - alias: 'language-javascript' - } - }); -} - - -/* ********************************************** - Begin prism-file-highlight.js -********************************************** */ - -(function(){ - -if (!self.Prism || !self.document || !document.querySelector) { - return; -} - -var Extensions = { - 'js': 'javascript', - 'html': 'markup', - 'svg': 'markup', - 'xml': 'markup', - 'py': 'python', - 'rb': 'ruby' -}; - -Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach(function(pre) { - var src = pre.getAttribute('data-src'); - var extension = (src.match(/\.(\w+)$/) || [,''])[1]; - var language = Extensions[extension] || extension; - - var code = document.createElement('code'); - code.className = 'language-' + language; - - pre.textContent = ''; - - code.textContent = 'Loading…'; - - pre.appendChild(code); - - var xhr = new XMLHttpRequest(); - - xhr.open('GET', src, true); - - xhr.onreadystatechange = function() { - if (xhr.readyState == 4) { - - if (xhr.status < 400 && xhr.responseText) { - code.textContent = xhr.responseText; - - Prism.highlightElement(code); - } - else if (xhr.status >= 400) { - code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText; - } - else { - code.textContent = '✖ Error: File does not exist or is empty'; - } - } - }; - - xhr.send(null); -}); - -})(); diff --git a/pages/lib/typescript-services.js b/pages/lib/typescript-services.js deleted file mode 100644 index 212c8cf423..0000000000 --- a/pages/lib/typescript-services.js +++ /dev/null @@ -1,17 +0,0 @@ -var fs = require('fs'); -var path = require('path'); -var vm = require('vm'); - -var TypeScript = {}; - -vm.runInNewContext( - fs.readFileSync( - path.resolve( - __dirname, - '../third_party/typescript/bin/typescriptServices.js' - ) - ), - { TypeScript: TypeScript } -); - -module.exports = TypeScript; diff --git a/pages/resources/identity.ai b/pages/resources/identity.ai deleted file mode 100644 index 44a1d29661..0000000000 --- a/pages/resources/identity.ai +++ /dev/null @@ -1,2208 +0,0 @@ -%PDF-1.5 % -1 0 obj <>/OCGs[5 0 R 6 0 R]>>/Pages 3 0 R/Type/Catalog>> endobj 2 0 obj <>stream - - - - - application/pdf - - - identity - - - Adobe Illustrator CC 2014 (Macintosh) - 2014-10-30T16:19:54-07:00 - 2014-10-30T16:19:54-07:00 - 2014-10-30T16:19:54-07:00 - - - - 256 - 108 - JPEG - /9j/4AAQSkZJRgABAgEASABIAAD/7QAsUGhvdG9zaG9wIDMuMAA4QklNA+0AAAAAABAASAAAAAEA AQBIAAAAAQAB/+4ADkFkb2JlAGTAAAAAAf/bAIQABgQEBAUEBgUFBgkGBQYJCwgGBggLDAoKCwoK DBAMDAwMDAwQDA4PEA8ODBMTFBQTExwbGxscHx8fHx8fHx8fHwEHBwcNDA0YEBAYGhURFRofHx8f Hx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8f/8AAEQgAbAEAAwER AAIRAQMRAf/EAaIAAAAHAQEBAQEAAAAAAAAAAAQFAwIGAQAHCAkKCwEAAgIDAQEBAQEAAAAAAAAA AQACAwQFBgcICQoLEAACAQMDAgQCBgcDBAIGAnMBAgMRBAAFIRIxQVEGE2EicYEUMpGhBxWxQiPB UtHhMxZi8CRygvElQzRTkqKyY3PCNUQnk6OzNhdUZHTD0uIIJoMJChgZhJRFRqS0VtNVKBry4/PE 1OT0ZXWFlaW1xdXl9WZ2hpamtsbW5vY3R1dnd4eXp7fH1+f3OEhYaHiImKi4yNjo+Ck5SVlpeYmZ qbnJ2en5KjpKWmp6ipqqusra6voRAAICAQIDBQUEBQYECAMDbQEAAhEDBCESMUEFURNhIgZxgZEy obHwFMHR4SNCFVJicvEzJDRDghaSUyWiY7LCB3PSNeJEgxdUkwgJChgZJjZFGidkdFU38qOzwygp 0+PzhJSktMTU5PRldYWVpbXF1eX1RlZmdoaWprbG1ub2R1dnd4eXp7fH1+f3OEhYaHiImKi4yNjo +DlJWWl5iZmpucnZ6fkqOkpaanqKmqq6ytrq+v/aAAwDAQACEQMRAD8A7vhYuxV2KuxV2KuxV2Ku xV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2Kux V2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV 2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2 KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2K uxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2Ku xV2KuxV2KuxV2KuxV2KuxV2KpJrfnXytoV2lpq2oR2ly8YlSNw5JQkqG+EHupwgFICm3n7ycl9BY PqkK3dwImhjbkOQnUPEakU+JWBG+NJ4Smup6np+l2Mt9qE621pCAZZnNFFTQfeTTAgBJT+Y3kkWC X51aIWbytAk1HoZEVXZfs12V1OGinh93zCeafqFlqNlDe2My3FpOvOGZDVWGBBFJF/ysjyOZZ4hq 8Je2DGYDmQAhoxqFoae2Giy4Cr2fnryle2F5qFrqUctnYBTeTAPSMPULWq13p2xpHChB+Z/kIwmb 9Mw+mGCFqSfaIJA+z7Y0V4dr2+YWr+af5fswUa1CSTQDjJ3/ANjjwleH3fMJlrPnLyxot5FZ6rqE VpczKHjiflUqWKhtgQBVT1xooAtGavrOmaPYtfancLbWiFVaV6kAsaAbAnrgUC0ntPzK8iXUoih1 u25nYCRjGCT7yBRhorXu+aM1zzl5Y0KaKHVtQjtJZl9SJXDHktaV+EHviAnhRN15g0a10VdbuLpY 9KaOOVbohuPCYqI2oBX4uY7Y0ikmj/NHyBLIsaazCzuQqikm5JoP2caKRH3fMMpwMXYq7FXYq7FX Yq7FXYq7FXYq7FXYq7FXYq7FXYq7FXz7/wA5BD/ncrX/ALZkX/UTNl2Pl8WEuvu/SxbzmUGqoWFR +jdLFabj/Qodxgj0ckkVK/L7yreaPzC1zX9G0zTL9h6WnL+9etTczCoSR6/yx0+kk99pRj3NRlW5 /t/Z1WXlF8kWgAFBrt5QU2oLe27ZEf71tmAMkh/tn61TQvzC13R/LN/oVm/G3vt4p6nlbcv74J/r r08Oo3wmO+7UDtt/Z3/sSbSmU/XKDiv1GYDx+1398JH3s4kHly4D97MPJ4A/LrzxTb9xYfjXIdR7 /wBLKYA/0v8AvAhfJ/lfSNZ8u+Zbi9nlgk0uNLmzWFlUNIIJSA/JWqKqOlMkL5sMsgJcPK5foCh+ WXljSfMutS2mr3M8EEFsbhGhdVJkWVVAbmsgpRvDJEHoGuWSogyP4soHz15gXX/Neo6iG5W88pit W8IIv3cbb9OVORyMRQZ2OR67ft/033PQ/MXmL9O/kXFcyNW6t5YLS7rufVhcLU17svFj88jEVJEj 6SfxzeS3JtxzXifUV5vUJdWXiR+6CIByUqQamvh9JjyHwb8+05A8rl3edUPJlPnhzJpXlEvcLdH9 DN+9B5D4WkATfvHTifcYjr7x97EAGv6sv9w9L83/APkgoP8Atm6X/wATt8Y/W4x+l4/ocnlyPUOO qxXskv1pfq/1SeGONV5inJHjkJ38CMRfD8HKyishF/x7cq57bW+r8qaHYq7FXYq7FXYq7FXYq7FX Yq7FXYq7FXYq7FXYq7FXhf56aHrN/wCbbaWxsZ7qL9HRxmSKNnUMJ5WIJA60OX4gSGucwLsjcd47 2OeZ/LOvT65bD9GXMkDWWmRyMsT8R6dpCsgJA2oQQcYwLbLNAWCRvXUd6/V/ywv7Gy1OaJXvPTkR NLhiq7mNmDO7KvdR8P3nwy84yHBjqozoX069PJTuvLvmF/Jdqg0u69UaxdzND6T8wjwW/FiKdCVI ykQPLyc2eeJkZWN53zCK0n8rrq7j0i4nD2sMqt+lrd6rIDG7cOKn+daD265fHETTgz1UY2B5e4/2 FLfKvknX7u9ntbmyuLOOWznQTyxsqB+JZKkjoWoMqMCT8XJGeMYncfTXMd6GTT/PGm2uoaQlnexw X4ijvYYrf1klEBqnGUBqU/yDv3wGBB5MxljIXZ5Dly5V8NnoPkXydfWXkjzHJfq8d/qEDm3s1oWH CGQRqaV+Ji/TCRKPLqGk5IZJ2T9Mr/HyYZ5X0jzPptrrDrpN6LqawNtahYXqZJZkBPT9mPkfmMdw eXNncJAbi4+Y57/rUtL/AC+80XlpK6Wj2qsPRkiuJPRZ1Uq9eJjOxYA9euIxz/H9qZ6nANjfL+cP +JNfNVstL83p5X1rSjo16LS8a3uIy0MhAnhcKwBAAq6vU7fsjIiJBHe2TyRkJEHb3jnte6DbQ/Nc 9ulgmj3Bi+stcoZLf025uAtDMx2T22/oxhKqr8fJOXPi4zMG9yase/8AnH7r6Jv5p8k67Yaf5dtE tZrxo7Gb6y9sjSqkk8sj8BTb4eYB3wGMiTt1CMebGKs7VLu6iupCIml/M+88pXeiXllevpMVnBHa xPZCL+5uIBGFdV5NRFPfBEerzTk4eHY7VzND/fFJdO07zfYzlrXSJmMswkpPYJKQSezyK5H0ZIRk BVfj5Lky4pSMhLnK+YHP3T/Q+osx0OxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KpDr0cjX iFVJHpj/AIk2Z2lIEfi6rXRJmPchryGQ3KfCePCOv/ACuWY5Cvm1ZoHiHuH3KbWtFcjc7cB9OSE2 Bxc17Qy/o9BxNfWY0/2K4OIcfwZGB8Mf1v0BatrXgTt/OMJmxGLk61t5CzhgVBRt8ZyC4sZ39y1B eRxyRorem9PUoKg06b4TwkglA4wCByKNsLRTZzmQkOBVVHiAaZTln6hTk4MXoNoW1hlCyngxfj8A HjUDLJyGzRigaO26mltMVPRa7EHJGYYDHJWiS5FlPGY29NipBptyB/pkZGPEDbZES4CK2UPTnKBO GwNa5OxdtfDKqpEXltIkFqq/HRCSR0qWJpleOYJLbmxkRiPJUL6k9k8UqH0AihPhp0Zab/LI1ASs c2d5TAgj01+pCwrcIwATuDuK5bIgtEBIdGWZqnfOxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2Kux V2KpbqUbtOpVSRxHT5nMnCRTh6iJMvgpTwyGZfhJHFK/8CMlGQprnA38mntSquR8X8gxE1OKrcYp fqqjia8yafQMeIcS8J4Pi2trXgTt/OMTNRi5LYIJCzAqQCp3wykEQgVoW5RXQK3FvtUFQae+G4nd FSFhFWtuRby8vtEVA+g5VOe4b8WP0lQgimUSURuRWi0HeuTkRs1QiRey1LaYg7UrsQcJmGIxyXIk 4t5EKHi1CDTuDgJFgsgJcJFLPTnKhOG1a9MlY5sOGVVSpcW8ixwqByopqR7muRjIWWzJjIAXVvGt 2jdT6YUBdvAimD03afWY0eSlGs6EAJ37iuSJBa4iQ6J1mG7J2KuxV2KuxV2KuxV2KuxV2KuxV2Ku xV2KuxV2KuxVQnVi4oCdsnEtcwbaZGLDY0oP1YQUEG22gIDEb/y4iSmC3g/pgUNa/wAMb3RRpcsF eJO38wxMkiC1I2JIIIqOuJKBEtcZRVaGh64bC0VWONljavUjpkSd2cY0FNFdQ3wmpFBhJDAAhywy EHt88TIKIlwV+DLxO+NhQDTXCQjjx2rXDYWiueNgFAFaDemAFJiXfvShUg0ptt747LvTSiQdF/DC aQAUTlTc7FXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FX Yq7FXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FXY q7FXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FWTf7hv+Xf8A4TAyd/uG/wCXf/hMVd/uG/5d/wDhMVd/ uG/5d/8AhMVd/uG/5d/+ExV3+4b/AJd/+ExV3+4b/l3/AOExV3+4b/l3/wCExV3+4b/l3/4TFXf7 hv8Al3/4TFXf7hv+Xf8A4TFXf7hv+Xf/AITFXf7hv+Xf/hMVd/uG/wCXf/hMVd/uG/5d/wDhMVd/ uG/5d/8AhMVd/uG/5d/+ExV3+4b/AJd/+ExV3+4b/l3/AOExV3+4b/l3/wCExV3+4b/l3/4TFXf7 hv8Al3/4TFXf7hv+Xf8A4TFXf7hv+Xf/AITFXf7hv+Xf/hMVd/uG/wCXf/hMVd/uG/5d/wDhMVd/ uG/5d/8AhMVd/uG/5d/+ExV3+4b/AJd/+ExV3+4b/l3/AOExV3+4b/l3/wCExV//2Q== - - - - proof:pdf - uuid:65E6390686CF11DBA6E2D887CEACB407 - xmp.did:5962c3f6-6a0f-4199-90f1-c6dea6f71387 - uuid:15bcb097-31e4-8d46-bdb6-d8c19fdf6524 - - uuid:1abccb90-0c26-4942-b156-fd2eb962e3e1 - xmp.did:58fdc1b8-1448-3a44-9e20-282d8ec1cf95 - uuid:65E6390686CF11DBA6E2D887CEACB407 - proof:pdf - - - - - saved - xmp.iid:5962c3f6-6a0f-4199-90f1-c6dea6f71387 - 2014-10-30T16:19:52-07:00 - Adobe Illustrator CC 2014 (Macintosh) - / - - - - Web - Document - 1 - True - False - - 960.000000 - 560.000000 - Pixels - - - - Cyan - Magenta - Yellow - Black - - - - - - Default Swatch Group - 0 - - - - White - RGB - PROCESS - 255 - 255 - 255 - - - Black - RGB - PROCESS - 0 - 0 - 0 - - - RGB Red - RGB - PROCESS - 255 - 0 - 0 - - - RGB Yellow - RGB - PROCESS - 255 - 255 - 0 - - - RGB Green - RGB - PROCESS - 0 - 255 - 0 - - - RGB Cyan - RGB - PROCESS - 0 - 255 - 255 - - - RGB Blue - RGB - PROCESS - 0 - 0 - 255 - - - RGB Magenta - RGB - PROCESS - 255 - 0 - 255 - - - R=193 G=39 B=45 - RGB - PROCESS - 193 - 39 - 45 - - - R=237 G=28 B=36 - RGB - PROCESS - 237 - 28 - 36 - - - R=241 G=90 B=36 - RGB - PROCESS - 241 - 90 - 36 - - - R=247 G=147 B=30 - RGB - PROCESS - 247 - 147 - 30 - - - R=251 G=176 B=59 - RGB - PROCESS - 251 - 176 - 59 - - - R=252 G=238 B=33 - RGB - PROCESS - 252 - 238 - 33 - - - R=217 G=224 B=33 - RGB - PROCESS - 217 - 224 - 33 - - - R=140 G=198 B=63 - RGB - PROCESS - 140 - 198 - 63 - - - R=57 G=181 B=74 - RGB - PROCESS - 57 - 181 - 74 - - - R=0 G=146 B=69 - RGB - PROCESS - 0 - 146 - 69 - - - R=0 G=104 B=55 - RGB - PROCESS - 0 - 104 - 55 - - - R=34 G=181 B=115 - RGB - PROCESS - 34 - 181 - 115 - - - R=0 G=169 B=157 - RGB - PROCESS - 0 - 169 - 157 - - - R=41 G=171 B=226 - RGB - PROCESS - 41 - 171 - 226 - - - R=0 G=113 B=188 - RGB - PROCESS - 0 - 113 - 188 - - - R=46 G=49 B=146 - RGB - PROCESS - 46 - 49 - 146 - - - R=27 G=20 B=100 - RGB - PROCESS - 27 - 20 - 100 - - - R=102 G=45 B=145 - RGB - PROCESS - 102 - 45 - 145 - - - R=147 G=39 B=143 - RGB - PROCESS - 147 - 39 - 143 - - - R=158 G=0 B=93 - RGB - PROCESS - 158 - 0 - 93 - - - R=212 G=20 B=90 - RGB - PROCESS - 212 - 20 - 90 - - - R=237 G=30 B=121 - RGB - PROCESS - 237 - 30 - 121 - - - R=199 G=178 B=153 - RGB - PROCESS - 199 - 178 - 153 - - - R=153 G=134 B=117 - RGB - PROCESS - 153 - 134 - 117 - - - R=115 G=99 B=87 - RGB - PROCESS - 115 - 99 - 87 - - - R=83 G=71 B=65 - RGB - PROCESS - 83 - 71 - 65 - - - R=198 G=156 B=109 - RGB - PROCESS - 198 - 156 - 109 - - - R=166 G=124 B=82 - RGB - PROCESS - 166 - 124 - 82 - - - R=140 G=98 B=57 - RGB - PROCESS - 140 - 98 - 57 - - - R=117 G=76 B=36 - RGB - PROCESS - 117 - 76 - 36 - - - R=96 G=56 B=19 - RGB - PROCESS - 96 - 56 - 19 - - - R=66 G=33 B=11 - RGB - PROCESS - 66 - 33 - 11 - - - - - - Grays - 1 - - - - R=0 G=0 B=0 - RGB - PROCESS - 0 - 0 - 0 - - - R=26 G=26 B=26 - RGB - PROCESS - 26 - 26 - 26 - - - R=51 G=51 B=51 - RGB - PROCESS - 51 - 51 - 51 - - - R=77 G=77 B=77 - RGB - PROCESS - 77 - 77 - 77 - - - R=102 G=102 B=102 - RGB - PROCESS - 102 - 102 - 102 - - - R=128 G=128 B=128 - RGB - PROCESS - 128 - 128 - 128 - - - R=153 G=153 B=153 - RGB - PROCESS - 153 - 153 - 153 - - - R=179 G=179 B=179 - RGB - PROCESS - 179 - 179 - 179 - - - R=204 G=204 B=204 - RGB - PROCESS - 204 - 204 - 204 - - - R=230 G=230 B=230 - RGB - PROCESS - 230 - 230 - 230 - - - R=242 G=242 B=242 - RGB - PROCESS - 242 - 242 - 242 - - - - - - Web Color Group - 1 - - - - R=63 G=169 B=245 - RGB - PROCESS - 63 - 169 - 245 - - - R=122 G=201 B=67 - RGB - PROCESS - 122 - 201 - 67 - - - R=255 G=147 B=30 - RGB - PROCESS - 255 - 147 - 30 - - - R=255 G=29 B=37 - RGB - PROCESS - 255 - 29 - 37 - - - R=255 G=123 B=172 - RGB - PROCESS - 255 - 123 - 172 - - - R=189 G=204 B=212 - RGB - PROCESS - 189 - 204 - 212 - - - - - - - Adobe PDF library 11.00 - - - - - - - - - - - - - - - - - - - - - - - - - endstream endobj 3 0 obj <> endobj 8 0 obj <>/Resources<>/ExtGState<>/Properties<>/XObject<>>>/Thumb 20 0 R/TrimBox[0.0 0.0 960.0 560.0]/Type/Page>> endobj 9 0 obj <>stream -HWˎGWTNWlcƮuAf֣[dRAdUV& ߞgg~zl.Ot8Rߜo7WӥlK&`)vJe_s=wkhs1Krބm)\_/|z9r ,>X Goc 4n}Sy06Uelm۫&~ؙcǰrqB!Mgpjm`s0|iFl #lk[XÜ IBaMoI}MU 5l]zYv,ܗyƭvZ@IR9qQTx4m^/xHsa#wFq^<ˎsUC{zެMx8aYcj=hCbiԉl?7 -̰ @fxi4uB̰8YMU/ff!UQRV 3xnEXܝ;%çw|61գx48ndqaa|6%U^0-~/B#t;6 ؊JjC͡`8q! -}*D^u&4@~E pvef YglDvE3gFłpF;*b44C6]'Z#Ġx^xl$9s|ʚbE^0HCkQ*AO -T*':iIVݷoHiUiU_@G!(V=+':i*GѪvҪVkhg緣U*ZV,6/`>]?nl+~ ۊ[&z,WOuVnl+b[ɝld['*u>!ۺ;d[RT߈PV#E`d_Vwpe< tz1_sҐ@+ ]rRM\fPI +[k5|:j[ǛleTiݩ3A$MT^~ԚdvuuuUჳht.[> endobj 20 0 obj <>stream -8;Z\u5n8N$$j;VR-9:UhT)'<$0@%\#iB&n#M&p=M`b5lXt>9a/<+@KdI>\';9_Ob?VVFp#qBr -6`>t+Opn?\"-,&u;UKhmW#jb?),s)kWS;mu=QT4(Es1c*Hs+$IogkoB7r@q*WQF\3 -W#eMkTStuRhFE':++9f0-UJ(^KFgHU\Km4:!!e-hiW~> endstream endobj 22 0 obj [/Indexed/DeviceRGB 255 23 0 R] endobj 23 0 obj <>stream -8;X]O>EqN@%''O_@%e@?J;%+8(9e>X=MR6S?i^YgA3=].HDXF.R$lIL@"pJ+EP(%0 -b]6ajmNZn*!='OQZeQ^Y*,=]?C.B+\Ulg9dhD*"iC[;*=3`oP1[!S^)?1)IZ4dup` -E1r!/,*0[*9.aFIR2&b-C#soRZ7Dl%MLY\.?d>Mn -6%Q2oYfNRF$$+ON<+]RUJmC0InDZ4OTs0S!saG>GGKUlQ*Q?45:CI&4J'_2j$XKrcYp0n+Xl_nU*O( -l[$6Nn+Z_Nq0]s7hs]`XX1nZ8&94a\~> endstream endobj 17 0 obj <>/ExtGState<>>>/Subtype/Form>>stream -/CS0 cs 0.427 0.737 0.859 scn -/GS0 gs -271.996 378.559 13.56 -40.02 re -f -q 1 0 0 1 289.6611 378.5591 cm -0 0 m -10.56 0 l -21 -15.36 l -31.38 0 l -41.94 0 l -41.94 -40.02 l -29.16 -40.02 l -29.16 -25.62 l -21 -37.62 l -12.78 -25.62 l -12.78 -40.02 l -0 -40.02 l -h -f -Q -q 1 0 0 1 335.707 378.5591 cm -0 0 m -10.56 0 l -21 -15.36 l -31.38 0 l -41.94 0 l -41.94 -40.02 l -29.16 -40.02 l -29.16 -25.62 l -21 -37.62 l -12.78 -25.62 l -12.78 -40.02 l -0 -40.02 l -h -f -Q -q 1 0 0 1 397.1504 337.519 cm -0 0 m --2.52 0 -4.8 0.321 -6.84 0.96 c --8.88 1.6 -10.62 2.56 -12.06 3.84 c --13.5 5.12 -14.61 6.74 -15.39 8.7 c --16.17 10.659 -16.56 12.96 -16.56 15.6 c --16.56 41.04 l --3.78 41.04 l --3.78 16.14 l --3.78 14.739 -3.49 13.67 -2.91 12.93 c --2.331 12.189 -1.36 11.82 0 11.82 c -1.359 11.82 2.33 12.189 2.91 12.93 c -3.489 13.67 3.78 14.739 3.78 16.14 c -3.78 41.04 l -16.62 41.04 l -16.62 15.6 l -16.62 12.96 16.23 10.659 15.45 8.7 c -14.67 6.74 13.55 5.12 12.09 3.84 c -10.629 2.56 8.88 1.6 6.84 0.96 c -4.8 0.321 2.52 0 0 0 c -f -Q -q 1 0 0 1 423.2202 368.0591 cm -0 0 m --7.38 0 l --7.38 10.5 l -20.58 10.5 l -20.58 0 l -13.2 0 l -13.2 -29.52 l -0 -29.52 l -h -f -Q -q 1 0 0 1 460.8916 350.959 cm -0 0 m --2.7 7.02 l --5.4 0 l -h --7.5 27.6 m -2.1 27.6 l -17.28 -12.42 l -4.68 -12.42 l -3.36 -8.82 l --8.76 -8.82 l --10.08 -12.42 l --22.68 -12.42 l -h -f -Q -q 1 0 0 1 493.0215 347.959 cm -0 0 m -3.039 0 4.56 1.16 4.56 3.48 c -4.56 5.799 3.039 6.96 0 6.96 c --1.44 6.96 l --1.44 0 l -h -3 18.42 m -3 20.259 1.999 21.18 0 21.18 c --1.44 21.18 l --1.44 15.66 l -0 15.66 l -1.999 15.66 3 16.58 3 18.42 c --13.801 30.6 m -1.859 30.6 l -3.859 30.6 5.689 30.37 7.35 29.91 c -9.009 29.45 10.43 28.77 11.609 27.87 c -12.789 26.97 13.71 25.85 14.369 24.51 c -15.029 23.169 15.359 21.6 15.359 19.8 c -15.359 18.52 15.199 17.43 14.88 16.53 c -14.559 15.63 14.22 14.88 13.859 14.28 c -13.419 13.56 12.919 12.96 12.359 12.48 c -13.239 11.919 14.04 11.199 14.76 10.32 c -15.359 9.56 15.909 8.6 16.409 7.44 c -16.909 6.279 17.159 4.86 17.159 3.18 c -17.159 1.26 16.819 -0.48 16.14 -2.04 c -15.459 -3.6 14.489 -4.93 13.229 -6.03 c -11.97 -7.13 10.43 -7.971 8.609 -8.55 c -6.789 -9.13 4.76 -9.42 2.52 -9.42 c --13.801 -9.42 l -h -f -Q -q 1 0 0 1 513.6592 378.5591 cm -0 0 m -13.32 0 l -13.32 -29.52 l -24.36 -29.52 l -24.36 -40.02 l -0 -40.02 l -h -f -Q -q 1 0 0 1 539.9697 378.5591 cm -0 0 m -23.58 0 l -23.58 -10.5 l -12.78 -10.5 l -12.78 -14.94 l -23.4 -14.94 l -23.4 -24.9 l -12.78 -24.9 l -12.78 -29.52 l -24 -29.52 l -24 -40.02 l -0 -40.02 l -h -f -Q - endstream endobj 18 0 obj <>/ExtGState<>>>/Subtype/Form>>stream -/CS0 cs 0.427 0.737 0.859 scn -/GS0 gs -271.996 398.559 13.56 -40.02 re -f -q 1 0 0 1 289.6611 398.5591 cm -0 0 m -10.56 0 l -21 -15.36 l -31.38 0 l -41.94 0 l -41.94 -40.02 l -29.16 -40.02 l -29.16 -25.62 l -21 -37.62 l -12.78 -25.62 l -12.78 -40.02 l -0 -40.02 l -h -f -Q -q 1 0 0 1 335.707 398.5591 cm -0 0 m -10.56 0 l -21 -15.36 l -31.38 0 l -41.94 0 l -41.94 -40.02 l -29.16 -40.02 l -29.16 -25.62 l -21 -37.62 l -12.78 -25.62 l -12.78 -40.02 l -0 -40.02 l -h -f -Q -q 1 0 0 1 397.1504 357.519 cm -0 0 m --2.52 0 -4.8 0.321 -6.84 0.96 c --8.88 1.6 -10.62 2.56 -12.06 3.84 c --13.5 5.12 -14.61 6.74 -15.39 8.7 c --16.17 10.659 -16.56 12.96 -16.56 15.6 c --16.56 41.04 l --3.78 41.04 l --3.78 16.14 l --3.78 14.739 -3.49 13.67 -2.91 12.93 c --2.331 12.189 -1.36 11.82 0 11.82 c -1.359 11.82 2.33 12.189 2.91 12.93 c -3.489 13.67 3.78 14.739 3.78 16.14 c -3.78 41.04 l -16.62 41.04 l -16.62 15.6 l -16.62 12.96 16.23 10.659 15.45 8.7 c -14.67 6.74 13.55 5.12 12.09 3.84 c -10.629 2.56 8.88 1.6 6.84 0.96 c -4.8 0.321 2.52 0 0 0 c -f -Q -q 1 0 0 1 423.2202 388.0591 cm -0 0 m --7.38 0 l --7.38 10.5 l -20.58 10.5 l -20.58 0 l -13.2 0 l -13.2 -29.52 l -0 -29.52 l -h -f -Q -q 1 0 0 1 460.8916 370.959 cm -0 0 m --2.7 7.02 l --5.4 0 l -h --7.5 27.6 m -2.1 27.6 l -17.28 -12.42 l -4.68 -12.42 l -3.36 -8.82 l --8.76 -8.82 l --10.08 -12.42 l --22.68 -12.42 l -h -f -Q -q 1 0 0 1 493.0215 367.959 cm -0 0 m -3.039 0 4.56 1.16 4.56 3.48 c -4.56 5.799 3.039 6.96 0 6.96 c --1.44 6.96 l --1.44 0 l -h -3 18.42 m -3 20.259 1.999 21.18 0 21.18 c --1.44 21.18 l --1.44 15.66 l -0 15.66 l -1.999 15.66 3 16.58 3 18.42 c --13.801 30.6 m -1.859 30.6 l -3.859 30.6 5.689 30.37 7.35 29.91 c -9.009 29.45 10.43 28.77 11.609 27.87 c -12.789 26.97 13.71 25.85 14.369 24.51 c -15.029 23.169 15.359 21.6 15.359 19.8 c -15.359 18.52 15.199 17.43 14.88 16.53 c -14.559 15.63 14.22 14.88 13.859 14.28 c -13.419 13.56 12.919 12.96 12.359 12.48 c -13.239 11.919 14.04 11.199 14.76 10.32 c -15.359 9.56 15.909 8.6 16.409 7.44 c -16.909 6.279 17.159 4.86 17.159 3.18 c -17.159 1.26 16.819 -0.48 16.14 -2.04 c -15.459 -3.6 14.489 -4.93 13.229 -6.03 c -11.97 -7.13 10.43 -7.971 8.609 -8.55 c -6.789 -9.13 4.76 -9.42 2.52 -9.42 c --13.801 -9.42 l -h -f -Q -q 1 0 0 1 513.6592 398.5591 cm -0 0 m -13.32 0 l -13.32 -29.52 l -24.36 -29.52 l -24.36 -40.02 l -0 -40.02 l -h -f -Q -q 1 0 0 1 539.9697 398.5591 cm -0 0 m -23.58 0 l -23.58 -10.5 l -12.78 -10.5 l -12.78 -14.94 l -23.4 -14.94 l -23.4 -24.9 l -12.78 -24.9 l -12.78 -29.52 l -24 -29.52 l -24 -40.02 l -0 -40.02 l -h -f -Q - endstream endobj 19 0 obj <>/ExtGState<>>>/Subtype/Form>>stream -/CS0 cs 0.427 0.737 0.859 scn -/GS0 gs -271.996 418.559 13.56 -40.02 re -f -q 1 0 0 1 289.6611 418.5591 cm -0 0 m -10.56 0 l -21 -15.36 l -31.38 0 l -41.94 0 l -41.94 -40.02 l -29.16 -40.02 l -29.16 -25.62 l -21 -37.62 l -12.78 -25.62 l -12.78 -40.02 l -0 -40.02 l -h -f -Q -q 1 0 0 1 335.707 418.5591 cm -0 0 m -10.56 0 l -21 -15.36 l -31.38 0 l -41.94 0 l -41.94 -40.02 l -29.16 -40.02 l -29.16 -25.62 l -21 -37.62 l -12.78 -25.62 l -12.78 -40.02 l -0 -40.02 l -h -f -Q -q 1 0 0 1 397.1504 377.519 cm -0 0 m --2.52 0 -4.8 0.321 -6.84 0.96 c --8.88 1.6 -10.62 2.56 -12.06 3.84 c --13.5 5.12 -14.61 6.74 -15.39 8.7 c --16.17 10.659 -16.56 12.96 -16.56 15.6 c --16.56 41.04 l --3.78 41.04 l --3.78 16.14 l --3.78 14.739 -3.49 13.67 -2.91 12.93 c --2.331 12.189 -1.36 11.82 0 11.82 c -1.359 11.82 2.33 12.189 2.91 12.93 c -3.489 13.67 3.78 14.739 3.78 16.14 c -3.78 41.04 l -16.62 41.04 l -16.62 15.6 l -16.62 12.96 16.23 10.659 15.45 8.7 c -14.67 6.74 13.55 5.12 12.09 3.84 c -10.629 2.56 8.88 1.6 6.84 0.96 c -4.8 0.321 2.52 0 0 0 c -f -Q -q 1 0 0 1 423.2202 408.0591 cm -0 0 m --7.38 0 l --7.38 10.5 l -20.58 10.5 l -20.58 0 l -13.2 0 l -13.2 -29.52 l -0 -29.52 l -h -f -Q -q 1 0 0 1 460.8916 390.959 cm -0 0 m --2.7 7.02 l --5.4 0 l -h --7.5 27.6 m -2.1 27.6 l -17.28 -12.42 l -4.68 -12.42 l -3.36 -8.82 l --8.76 -8.82 l --10.08 -12.42 l --22.68 -12.42 l -h -f -Q -q 1 0 0 1 493.0215 387.959 cm -0 0 m -3.039 0 4.56 1.16 4.56 3.48 c -4.56 5.799 3.039 6.96 0 6.96 c --1.44 6.96 l --1.44 0 l -h -3 18.42 m -3 20.259 1.999 21.18 0 21.18 c --1.44 21.18 l --1.44 15.66 l -0 15.66 l -1.999 15.66 3 16.58 3 18.42 c --13.801 30.6 m -1.859 30.6 l -3.859 30.6 5.689 30.37 7.35 29.91 c -9.009 29.45 10.43 28.77 11.609 27.87 c -12.789 26.97 13.71 25.85 14.369 24.51 c -15.029 23.169 15.359 21.6 15.359 19.8 c -15.359 18.52 15.199 17.43 14.88 16.53 c -14.559 15.63 14.22 14.88 13.859 14.28 c -13.419 13.56 12.919 12.96 12.359 12.48 c -13.239 11.919 14.04 11.199 14.76 10.32 c -15.359 9.56 15.909 8.6 16.409 7.44 c -16.909 6.279 17.159 4.86 17.159 3.18 c -17.159 1.26 16.819 -0.48 16.14 -2.04 c -15.459 -3.6 14.489 -4.93 13.229 -6.03 c -11.97 -7.13 10.43 -7.971 8.609 -8.55 c -6.789 -9.13 4.76 -9.42 2.52 -9.42 c --13.801 -9.42 l -h -f -Q -q 1 0 0 1 513.6592 418.5591 cm -0 0 m -13.32 0 l -13.32 -29.52 l -24.36 -29.52 l -24.36 -40.02 l -0 -40.02 l -h -f -Q -q 1 0 0 1 539.9697 418.5591 cm -0 0 m -23.58 0 l -23.58 -10.5 l -12.78 -10.5 l -12.78 -14.94 l -23.4 -14.94 l -23.4 -24.9 l -12.78 -24.9 l -12.78 -29.52 l -24 -29.52 l -24 -40.02 l -0 -40.02 l -h -f -Q - endstream endobj 26 0 obj <> endobj 13 0 obj <> endobj 12 0 obj [/ICCBased 27 0 R] endobj 27 0 obj <>stream -HyTSwoɞc [5laQIBHADED2mtFOE.c}08׎8GNg9w߽'0 ֠Jb  - 2y.-;!KZ ^i"L0- @8(r;q7Ly&Qq4j|9 -V)gB0iW8#8wթ8_٥ʨQQj@&A)/g>'Kt;\ ӥ$պFZUn(4T%)뫔0C&Zi8bxEB;Pӓ̹A om?W= -x-[0}y)7ta>jT7@tܛ`q2ʀ&6ZLĄ?_yxg)˔zçLU*uSkSeO4?׸c. R ߁-25 S>ӣVd`rn~Y&+`;A4 A9=-tl`;~p Gp| [`L`< "A YA+Cb(R,*T2B- -ꇆnQt}MA0alSx k&^>0|>_',G!"F$H:R!zFQd?r 9\A&G rQ hE]a4zBgE#H *B=0HIpp0MxJ$D1D, VĭKĻYdE"EI2EBGt4MzNr!YK ?%_&#(0J:EAiQ(()ӔWT6U@P+!~mD eԴ!hӦh/']B/ҏӿ?a0nhF!X8܌kc&5S6lIa2cKMA!E#ƒdV(kel }}Cq9 -N')].uJr - wG xR^[oƜchg`>b$*~ :Eb~,m,-ݖ,Y¬*6X[ݱF=3뭷Y~dó ti zf6~`{v.Ng#{}}jc1X6fm;'_9 r:8q:˜O:ϸ8uJqnv=MmR 4 -n3ܣkGݯz=[==<=GTB(/S,]6*-W:#7*e^YDY}UjAyT`#D="b{ų+ʯ:!kJ4Gmt}uC%K7YVfFY .=b?SƕƩȺy چ k5%4m7lqlioZlG+Zz͹mzy]?uuw|"űNwW&e֥ﺱ*|j5kyݭǯg^ykEklD_p߶7Dmo꿻1ml{Mś nLl<9O[$h՛BdҞ@iءG&vVǥ8nRĩ7u\ЭD-u`ֲK³8%yhYѹJº;.! -zpg_XQKFAǿ=ȼ:ɹ8ʷ6˶5̵5͵6ζ7ϸ9к<Ѿ?DINU\dlvۀ܊ݖޢ)߯6DScs 2F[p(@Xr4Pm8Ww)Km endstream endobj 25 0 obj <> endobj 24 0 obj <> endobj 5 0 obj <> endobj 6 0 obj <> endobj 30 0 obj [/View/Design] endobj 31 0 obj <>>> endobj 28 0 obj [/View/Design] endobj 29 0 obj <>>> endobj 14 0 obj <> endobj 15 0 obj <> endobj 16 0 obj <> endobj 11 0 obj <> endobj 32 0 obj <> endobj 33 0 obj <>stream -%!PS-Adobe-3.0 %%Creator: Adobe Illustrator(R) 17.0 %%AI8_CreatorVersion: 18.0.0 %%For: (Lee Byron) () %%Title: (Untitled-1) %%CreationDate: 10/30/14 4:19 PM %%Canvassize: 16383 %%BoundingBox: 83 -268 726 -4 %%HiResBoundingBox: 83.2057291666688 -267.358072916666 725.64453125 -4.17317708333303 %%DocumentProcessColors: Cyan Magenta Yellow Black %AI5_FileFormat 13.0 %AI12_BuildNumber: 18 %AI3_ColorUsage: Color %AI7_ImageSettings: 0 %%RGBProcessColor: 0 0 0 ([Registration]) %AI3_Cropmarks: 0 -560 960 0 %AI3_TemplateBox: 480.5 -280.5 480.5 -280.5 %AI3_TileBox: 102 -568 836 8 %AI3_DocumentPreview: None %AI5_ArtSize: 14400 14400 %AI5_RulerUnits: 6 %AI9_ColorModel: 1 %AI5_ArtFlags: 0 0 0 1 0 0 1 0 0 %AI5_TargetResolution: 800 %AI5_NumLayers: 2 %AI9_OpenToView: 57.5 -4.5 2 1192 711 18 0 0 121 293 0 0 0 1 1 0 1 1 0 1 %AI5_OpenViewLayers: 73 %%PageOrigin:80 -580 %AI7_GridSettings: 72 8 72 8 1 0 0.800000011920929 0.800000011920929 0.800000011920929 0.899999976158142 0.899999976158142 0.899999976158142 %AI9_Flatten: 1 %AI12_CMSettings: 00.MS %%EndComments endstream endobj 34 0 obj <>stream -%%BoundingBox: 83 -268 726 -4 %%HiResBoundingBox: 83.2057291666688 -267.358072916666 725.64453125 -4.17317708333303 %AI7_Thumbnail: 128 52 8 %%BeginData: 12290 Hex Bytes %0000330000660000990000CC0033000033330033660033990033CC0033FF %0066000066330066660066990066CC0066FF009900009933009966009999 %0099CC0099FF00CC0000CC3300CC6600CC9900CCCC00CCFF00FF3300FF66 %00FF9900FFCC3300003300333300663300993300CC3300FF333300333333 %3333663333993333CC3333FF3366003366333366663366993366CC3366FF %3399003399333399663399993399CC3399FF33CC0033CC3333CC6633CC99 %33CCCC33CCFF33FF0033FF3333FF6633FF9933FFCC33FFFF660000660033 %6600666600996600CC6600FF6633006633336633666633996633CC6633FF %6666006666336666666666996666CC6666FF669900669933669966669999 %6699CC6699FF66CC0066CC3366CC6666CC9966CCCC66CCFF66FF0066FF33 %66FF6666FF9966FFCC66FFFF9900009900339900669900999900CC9900FF %9933009933339933669933999933CC9933FF996600996633996666996699 %9966CC9966FF9999009999339999669999999999CC9999FF99CC0099CC33 %99CC6699CC9999CCCC99CCFF99FF0099FF3399FF6699FF9999FFCC99FFFF %CC0000CC0033CC0066CC0099CC00CCCC00FFCC3300CC3333CC3366CC3399 %CC33CCCC33FFCC6600CC6633CC6666CC6699CC66CCCC66FFCC9900CC9933 %CC9966CC9999CC99CCCC99FFCCCC00CCCC33CCCC66CCCC99CCCCCCCCCCFF %CCFF00CCFF33CCFF66CCFF99CCFFCCCCFFFFFF0033FF0066FF0099FF00CC %FF3300FF3333FF3366FF3399FF33CCFF33FFFF6600FF6633FF6666FF6699 %FF66CCFF66FFFF9900FF9933FF9966FF9999FF99CCFF99FFFFCC00FFCC33 %FFCC66FFCC99FFCCCCFFCCFFFFFF33FFFF66FFFF99FFFFCC110000001100 %000011111111220000002200000022222222440000004400000044444444 %550000005500000055555555770000007700000077777777880000008800 %000088888888AA000000AA000000AAAAAAAABB000000BB000000BBBBBBBB %DD000000DD000000DDDDDDDDEE000000EE000000EEEEEEEE0000000000FF %00FF0000FFFFFF0000FF00FFFFFF00FFFFFF %524C45FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFA8FFA8FFA8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8 %A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8 %AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8 %A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8 %AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8AFA8FFA8AFA8FFA8AFA8FF %A8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AF %A8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FF %A8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AF %A8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFFD81A8FF %A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFFD04A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AF %A8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8 %A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AF %A8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8 %A8AFA8A8A8AFA8A8A8AFA8A8A8AFFFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8 %FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8 %AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8 %FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8 %AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFFD81A8FFA8FFA8FFA8 %FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8 %FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8 %FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8 %FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8 %FFA8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8 %A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AF %A8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8 %A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AF %A8A8A8AFA8A8A8AFA8A8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8 %AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8 %FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8 %AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8 %FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFFD81A8FFA8FFA8FFA8FFA8FFA8 %FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8 %FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8 %FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8 %FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFFD04A8 %AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8 %A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8 %AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8 %A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8 %AFA8A8A8AFFFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FF %A8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AF %A8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FF %A8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AF %A8FFA8AFA8FFA8AFA8FFA8AFFD81A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8A8AFA8A8A8AFA8 %A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8 %AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8 %A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8 %AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8 %A8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AF %A8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FF %A8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AF %A8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FF %A8AFA8FFA8AFA8FFFD81A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFFD04A8AFA8A8A8AFA8A8A8AF %A8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8FFA8A8 %A8FFA8A8A8FFA8A8A8FFA8A8A8AFA8CAA8FFA8A8A8FFA8A9A8FFA8CBA8FF %A8A8A8FFA8A8A8FFA8CAA8FFA8A8A8FFA8A8A8FFA8CBA8FFA8A8A8AFA8A8 %A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFFFA8AFA8 %FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8 %AFA8FF7D5252A877527DFFA8FF52527D7D4C7DA8FFA87D527D765252CB76 %52767D5277525252FF7D5252FFA8A85277527D7DFFA2524CA8AFA8527752 %5276FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8 %FFA8AFFD26A87D0027525221277DFF5227007D522700A1AE7D0027275200 %4CA852004C272727280027A85221277DFF7DFD05277DA1002752FFA82821 %270028A8AFFD1EA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8 %FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF5928277D524C2753A1284B4C595327 %5228A828522752524C4CCB524C4C7D522E27537DA82752277DFFA8275252 %5227537D4C277DFFA9284C2E7D7DFFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8 %FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8A8AFA8A8A8AFA8A8A8AFA8A8A8AF %A8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A87D272777522728 %27282728277D5227274C272827284C522752A8522752FF7D00277DFF5227 %272827A87D282752272753A8272753FFA8282752527DA8AFA8A8A8AFA8A8 %A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8AFA8FFA8AFA8 %FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8 %FF5928277D5252274C272E274C53532728275227282752524C4CFF524C28 %AF5928277D8452272E27287DA8274C275227597D4C277DFFAF284C27274C %FFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8 %FFFD26A87D00275352272827280528277D5228272727282727275227287D %52272860592727535A2727282E27527D2827592E27277D272752CA7E5227 %2E527DFD20A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8 %FFA8FFA8FFA8FFA8FFA8FFA8FF5928277D524C5253277D284C597D275252 %285352275352282752272828FF7D28277E524C4B4C4B52277D284C4C5227 %527D524B52277D2852275252FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8 %FFA8FFA8FFA8FFA8FFA8FFA8FFFD04A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8 %A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA87D0027775200525A5959 %27217D4C272784528427272884FD05277EA87D0027524C27525353272727 %4C274B27287DA1004B27274C52274B214CA8A8A8AFA8A8A8AFA8A8A8AFA8 %A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFFFA8AFA8FFA8AFA8FFA8AF %A8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FF845A59A8 %7E5A59858484597E848459848485607E59848485597D598484A97E7E597E %7D7E5A85847E7DA8597E597E5AAFA87E59847DA8597E595A7DFFA8AFA8FF %A8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFFD26A8A9 %6085848560845A845A855AA9848560845A84608584845A85A8855A848484 %6085848560855A845A85A8855A8584845AA9608584FFA8845A858484FD20 %A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFA8FF848560AF848584858485608584856085848584856085 %84858485608584FF848560A984858485608584A9848584856085A8856085 %60858485848584FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFA8FFA8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8 %AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8A95A8484855A84848584845AA984 %845A8584845A8584A85A855A845AA9A8A85A8584845A8584845A8584845A %85608484A960845A8584845A855A84A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8 %A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8AFA8FFA8AFA8FFA8AFA8FFA8AF %A8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8FF848584A984A9 %848584A9848584A9848584A9848584A9848584AF848584AF848584A9A885 %84A9848584AF848584A984A9A8A984A9A8FF848584A984FFA8FFA8AFA8FF %A8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFFD27A87E8484 %847EFD0684A8FD04847EFD0484A8FD0784A8848484A8FD0684A88484A884 %8484A87E8484A8A8FD0484FD21A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8 %FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA88584A984A984A984 %AF8485A8AF84A984A9A8A984AFA88584A9848584FFA88584AF848584A984 %8584AF848584A984A9A8A9848584AF848584A984FFA8FFA8FFA8FFA8FFA8 %FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFFD04A8AFA8A8A8AFA8 %A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A884 %85A8A884A9A8A884A984A8848584A884A9848484A98484848584A8A8A984 %8484A984A884A9848484A9848484A9A8A884A9848484A9848484A9A8A8A8 %AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFFF %A8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AF %A8FFA8AFA8FFA8A9A8AFA8A9A8AFA8A9A8AFA8A9A8AFA8A9A8AFA8A9A8AF %A8AFA8AFA8FFA8AFA8A9A8AFA8A9A8AFA8AFA8AFA8A9A8AFA8A9A8AFA8AF %A8AFA8A9A8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FF %A8AFA8FFA8AFFD27A884A8A8A884A884A8A8A884A8A8A884A884A884A8A8 %A884A8A8A884A8A8A884A8A8A884A8A8A884A8A8A884A8A8A884A884A884 %A8A8A884FD23A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8A9A8FFA8A9A8FFA8AFA8AFA8AFA8AF %A8AFA8AFA8AFA8AFA8A9A8AFA8FFA8AFA8AFA8AFA8AFA8AFA8AFA8AFA8A9 %A8AFA8AFA8AFA8AFA8AFA8A9A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8 %A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8A9A8A8A8A9A8A8A8 %AFA8A884A9A8A8A8AFA8A8A8A9A8A8A8A9A8A8A8AFA8A884A9A8A884A9A8 %A8A8A9A8A884A9A8A8A8A9A8A8A8A9A8A884A9A8A8A8AFA8A8A8AFA8A8A8 %AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8AFA8FFA8AFA8FF %A8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AF %A8FFA8AFA8FFA8AFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8AFA8FFA8FFA8FFA8FFA8FFA8AF %A8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FF %FD81A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFA8FFA8FFFD04A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AF %A8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8 %A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AF %A8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8 %A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFFFA8AFA8FFA8AFA8FFA8AFA8 %FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8 %AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8 %FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8 %AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFFD81A8FFA8 %FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8 %FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8 %FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8 %FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8 %FFA8FFA8FFFD81A8FFA8FFFFFFA8FFFFFFA8FFFFFFA8FFFFFFA8FFFFFFA8 %FFFFFFA8FFFFFFA8FFFFFFA8FFFFFFA8FFFFFFA8FFFFFFA8FFFFFFA8FFFF %FFA8FFFFFFA8FFFFFFA8FFFFFFA8FFFFFFA8FFFFFFA8FFFFFFA8FFFFFFA8 %FFFFFFA8FFFFFFA8FFFFFFA8FFFFFFA8FFFFFFA8FFFFFFA8FFFFFFA8FFFF %FFA8FFFFFFA8FFFFFFA8FFFFFFA8FD81FFFF %%EndData endstream endobj 35 0 obj <>stream -%AI12_CompressedDataxeu&0 5ZǼ[ N\rK B:+,e;+e"'"^= 2␇u/n>}/gson?.O?9>㛏o?>y{~#*[oֆSO zﯾg_ͻ?]?<K]:"]31&/䳏ŴxN!Do]D7gg޽g>׏_|q_tWNy'Լ:ߏo߾0G7o1xs+>|gO'?~+_}O#^.QC)??鍬&v矽o1ӌVbeB1gԶxigcGӚNu<ǿ=|]k|߽%~4$o~WRmWke'_ wcgYxr'kgwb9gOn3&ͻ_v1ͧfw*?y3n~'dcǏc;f7ܿg\/xఱaϽ}'[~|uZOAj'{%/?ջ}?L| " ȅ?z?;܇ǓVgo=+uݿ?}[m|{ݫ'|o50=kl^#6Ct?`S/|oG쫖w˧lx^}3(OX:?^"ًv<6G2jcޞ|9޾}>G9_*olݽO~7>_||| ͨkz+6˫7vw7zN Z?,Op l/~`nSw^}w {wߓOp;'SN_&خMZJٖb]ٔ m-wro&n`)~S®D-mBoٔyWne)K;݄?;-۩)aSK,fS.Zh-߭gج꺶(ӲaȺ-(Zv;oVRž,ˬr﷫9\k7c]/WkYܭM-Z{)w*zYuXtڒu@S]#m-wRky`i'/]K+Ћ'/fy;#Le0I8Hc'!r6-Pn%܅tSq7o}|0 ]R`7(x`- Vs~S6vS.r+s+W6%oJڕ)aS`N= [~s+Z&)72oJٕ)iStvo)f-mʧv۟Mh[׬~˂6_炙Ns720u -w<-۲>kfDg㦖YJ%KIZ_+SIڳEM-R ZPEIo#m-e.^E'ʂpLLl,dެԽLE&LQޕ/hndYFdD=&t%P@̈́tYѻ+70 z(7Vqo@6˜A@#dq?`#a.s)oŃ[\!wK.9hGonq?`ab/ 3} &3acoq1(&R0<. kq2r! n.}]qRp3%qGyUv(U^/b%]ڊZ+i:7p)wpqҍtо~l[ Æ+I"6f:JrGo +璷Pnz*m&@nvY9r + Lý 2qanY fK!ܝӢg]-*ֺ 7• -KhG9c\d/tAX/Fq4g*+R=:hOE:iƇ񲰿Lى8=ZN2Ti?ʐd=E@[8})i' -݄;wte"451s)a(~(ԟi'OܖI[;,"iVaai#kI/,He(q/,G|P6|ϑ~۽hU.w(ՔMIQ,ܔOUlnǻEߟơӻ==MOk^T(VݐĪc;wFUr]edUlvih42 -ãA~39ݷ~FGQi\ }/\%T H?#8n!4A" #@Q9,rr%[HA$ RHB* Qr* =TeF΍[-=0w*NVbҔ3+"@i׵ᱚ&U-$дavDu ;eG#wq$,m;$kOp#22q||JZj^-Q5nua"H/nWn+iWSNWv*Jr˴Z0ǦM=R5ycWJZ]SfQ7?Ug)E\?U^VeZ5KvT7f?]Xhi*LUh6fi?Znthzlz4D7-l$J#-i)\h~@UuL6thBQkTgCi.ùNk1;R $M9$ϑiёiK%6i؜kd`<{:_IӢeUeag&pzic=T,mQ e6E^XQh$iN{/Zzrbm7n[ZoXw#n!- b5`IҦ0Td8RA5*h73fAJSX+Sg}['ɇm?y36 rkyH<&a*Dd6F{/"HQ.ljQ 8S]?Ny\ޚ=bU~Y}nfU̹ߨN%}uùcWBUamu:ٺ''oON׉PASH;}ZD¡dC&b(b`bu5Yi;jb/*sUjkՄBW2?+u%Y '+zUVCJnf_l\'cU'_(2i4lZĎp#ETRw$"ª sTbUuZEnK, 7$k w;!c˥o"6YvY ߊ͗\ݙWW\ ;~p#^Y`Q良W^{cbLBA}.`Ӌ]}\ocq Nބۻpu;{/Ǔ2>ն{_?~y8=~-GT(Ҡ"`T+ʴx>7lg|R-Ozٛe>TYY:ٻSݾIuL\چu͍2.O",W(^Q^l~924}9!,4#AiEq%,g %#s%υja3'g:<<r=?39I;yo|0vYdBŞ#K<$K1FmcAǢBH=Qh=W; -Ѷfk2tPACU}02x/4>/ϕ=ӧ{A1e9qoY8ejoUI'O>sUcb FcWTՎb&<9WDU\g`o =9er>h*_Iig=~Jhgnnyms^\j/e Ro:SnhBL\$#kq  -kX&,^kz\u>l/ƴ7T7rǥ2 M/ޅA[lH8$fqOTqƅYv5.b5)% Wjk@|G\X9->L䥔,岖)n 7nݬMrXJܕte>(7SrDY̺ӱOPj<m1F~Ke=vUP^hũ -19f)~uݘkFlgVf 5Rn{xq{Qƺ7NlnNq#.uėيE 4\ETp햩ڭ(-uјc't*-2ߌAchn%jjfLsF dkN*Wn&k5uNi6l;⳦2I1/6N^gf[`:[t z5{^r}>nc[4}ok|>\,"MUZEi/C7V_[{:AIUޞȽbw -\vqZUo"[`qF؈DO7ϼZḔJ 6J~-[yWsHrMW~$t_onQ]/ 4v%|"74o|u4$ybGL}$WaPMӢݪD6]ա;eZDh޴u}tB]kt@/]đ_5U'z&9s5faNXգxo$^#qHj+v{WYQceϗ:UѪ>KNRlC4hI١K*VgZSEt7U/MJUH~٧ۃkѫ-j>OU7 赠>qUS7sO91w$LζPqĝ$D}G=hݻW=~zSd>}zS {Ef٠{ -sP*n޻:NjWkηɴ8{c* 5/p 㥨#OxO|: d;ۻp5c?ӿ}@D ô}I? xc!>[z9pn9?@4\>YFkc)6>FqG]u$/~)P 3/~"gATYT{,LwbEyTlm-LgT58GBs'Ӵ2ݘ.'VM>g﹟ENMJYZNZVTo"๫NP۲0V}Yt-+%}^T2]*_L_:e^^~“4/-TD9='|G!:S|X|Y T{k: 47샘C*H&V%Q5~OKVz⪢h*jQ!,gݣ{ꝣ"sظ+8 sh)S_̗H|vGH}N),\2ٴvƇc'o ŶKt`1 d)ڳDEg"J|8'=b^èٻ9|o|?;8:t $ww["PnZnzm<#+ l .眍K§HF*`x'N?isĬT/4ggp.FWl X_<q`WA޺O(OY|ǏaVl Ë}u{ o5Ss}6GrpDoqx{q}%wSUa SyҺSqɾ;G{ztFM|ԙax$nBIW{QݷbdXw'z=WYL~_+V,QLIia}-+49r0iąˆcEq"9mkKKޤTZҷ}|^}dH'ȍʾ ߃R~xZ)k{" ތ[rx|vAXl<ƲzuZܠ ٸ_m_Ə|aSz[ KdH>F'> - mTpue*״V6^/wM`W 9P&k-JӭQI hi+]PW7Yȫhӽ%X!3l#yfQ={tqw0(^bcl'IJw޳y#4u1_χ3l%}q@.O؊x ML;5>b p),Jq tD[G6##iyռs]Vg 6oaF{l9WEs sYݻ:n:j0r.$~cQnŐo] ,wk,ZGJGV1h<<$7^/?klä2.)_"F#x/G6-mC+dm=wK>Y XMרO+2;Yƀ{Rc9]"Bᘬ0wBpɀD^23_uӨT ڈ|ˏlՍJ!4ccK|7$ɹ'@A#`T`rU8r(8󍄻p$ۅKWVjI.ExPd\_y !3OUsh}f5k6oŒmm&|RcbncH)171Og}YyZߡj};IM/Wq fʸ nrn+Lߒ"T<ʦF 8Qԅ@RbEIo9QщAMF;cgXPKJ8,[PƊ37[ -ޠ\so|RЬ['-w}[PUpb+b'p;RZefy:Yִ$J{eήr@5JۚVl1S*G\82o7"k{O?{L- \"n/iF,wBj-UT3|/>-\K[tjg)gEwMr~Xkɴh -٬[Szu^)b-c -JӐH~[͎Csߤ+ÕR%iAFae/l䜣)Ӛ)KE$ZôOB5fvIco7 c&vlWE콷b0JsEOӕ̳JD&Z*f5%\8{}OFFxd4;C^~1Jim3#K0K!X!TO5UFу63&Q阚g$' Kr7]ϳjn6j82v{|NJrRm8eeLf8 m; X\lKz07A+GsK~NaG)㧸>sOXFXS$-▛E{EI&Y㭩.)+Kz5A^KKޒwwwBwg;{foG!+SWcUW8]ytt67 W܅^];,]dm#gqPu;䥷eӋ2-VܔBuN>7GgX֙[I=硿r5'xw|۱o>>#ȭ5xfviVoiRnIаo!x_a&ffs= 6 e&!J.4} ZHܫ; wl|e씆Qkh,+V,~ )5qᾦ#A>jn,&lL*u 6kRE[k3VF`# Vیml2<K̰OPMSfAx~fl6t%+uxdEݚJV uہLtׯA7z=N_?Z.E Iԭ)p]Ni([!JE0{19}IE39}IM^tqzVO[᧭Vi+\(֡ ߕ |Ûw߼/~۷?|5{wo/^A<'h) L#;ozoO'|/?})'Y(k-Nuvn -8lrL̩Bː7lt.?[{6`gXb9{,.fČi;0@xD!YL)fǴ|8Іlitl63(UF _r[/c\> iق6 $3iŒy 'Y2)g osg@ .O.K qƋ&;}%Vgs @"PilM^MJ VO -X1=X~׉Kə1xYC:3ma= %س\ Zg YC,}l6 .E†*z9Hes{5I:֣nq2{AxD tDaSvI|=r֦dR!*0Xl׃G; qkO6 3_ _8Jexl Q~MLv HDs\(A7Ufĥq -񜊯s.SLXU[BQ̌}:p0>@| cþpʬt9أQo5Fw6*@|Xp"9|a N`z03f`J8oBŬb-q8qKbI8*&R{ͮs[м 6 ;2dE#c=׭dCRyt{'<,D~_gG89DM?+a#Dg2';ux -6e hV; zo;p"MP"0=N3Xp n$|9#APr- -23CިLOZę\'"LӁ -|7`yjwt`qsz4ȠR Md.qO+ޱEIi@  vgGuE5gspxa;go@JJ_قV3:0ĦK=%syCG*uoua.HKE<bw06S1=7rc-RDyJ2و[X]HsFLN+]N˷IXsy/D|6tjv!DőՒ V|Bҝ IsT)F=fɓ'iO 5%gm-᦯gJ)0P83Dc(~}'S@ZQa9![$>|}XY[]&d?ٵ٨cW·YC pgb" O w&S'D)5{ڻDB?!t=Gڤñ-wj~]^PSNXJe_4;-I Џu /'~N[zR>6GBvqgAw#i ݲ "=-Z -ZipOɯ%:F I6Fɒ "K6{%Rzѱ{"Dv"rH\hEja;s<%-È8Hfxٻ(R3I9Z"օ޻^ѐy@7A;^|DYd(@\▃@zusKVtΐ"Gh΃I >RFH+P8vm=Y ipΈr쁿d\$Gb8 W&:y bLT})G>9Urh28+invv;\fe٘itS{ }. .bcB=NǾN2͔ZO<y:vΙtp+39鯐)΃&9 L+l WXq9bs3:0xp:rBTav++'-"B^Wm-31܍-ߜ; 6bs[qd{{({Z;8DGCCЃ~:Gσ -W:tHD P*qeލl\lG ; Uf -!O )MnA؞);zwC[{'҃ aDcӵ'."u6dX:jK[x\txL.n&iR87+D7,wo~ylR_=fqyx臮_|'|W$p|\sA'gWӌzj_Mv9<& Cyl?6"CsQ*ǯ>ݫ֋QN=s{ MYn_fss'˒{#b悡U3 ^3*vD4&[{X2~F^@%lUDb/aM -NM;{`olt̖.`,Ѩ= [@l -Ї'1G@}`d1 $h΁a%{k<*#تWɋUT/8£ԫ-"T*uuSYc28Ҥ4PzFGƁqf~5*"|L!֋݃WN@F2y*7Ap45Y&@$)&*el\$p#nţ~(pYwӮ]Y|Y/(+Ϥ% n6}ya^<>?+#Y$0r02T;gTaťb0W8;u3I<+^ LHcT/;qx bADF{ -5,-h'EA sCQ` ^(Ji$3|+_ӈ{%$81!3gǭ(X( %m9gZfd@-V3A+ -/$^h,CIC+:SZQ͆6q,NE VSעQnn~:+8`KďY3ЭշbD`-.@7g+&@zEB -,%w'Ka, U=f:L9kU$HKԠ( #fUԪ2ij^ +Mo&+DhI(\3Qi5<@SL:h1 MSR DJh^wh\tZ o*{")|#pX9Q3o8If -Z=k8b$Q+UY^x&mu0ׁbÈ:A2֌--@:>h+ %5J9]W@Qn.t(EXd#+)u #j_]TdTSW38FW8W*q\&(V@f!E\GWkb%XЖ`w4} /fpꧢ>>I"tl?֘Ts*Oi5K;Xql%1ԫ "%(ӥBo[!PmkFn9#v7~s(V1eF2ށ -:!Wz2|Y:]$KR`uF` fP"0* },aiටkp=9[Éw-b8$f'387^H7gbgy@h <9`^k&f觟a(Ϭ -"eA5 cK>;n5Wg y DV”N̉AI} U ͐ƅYư{ȪK .%L)P+'ujh̎BڏtJv|>av3DUqڪȦS!CN #kjXpj10=& T3`"|1бOJ|d*҉)F,9 Z#-.')ΰgqxNYW-~qz-:ѴF -ƽ8tZ|Q9#$d['VoۧQ[T0"ucOUq{JW%T3NWuzn:-7jZU ҏR9Hߢia2O|3 rlG!܉-ۋ: px̙"=B- -A?:{} -21eL!du?NjxE3vS2O0gdňw~td6[AFhR;b> U~`u SŦRSܳA.:f:@ }ߊԈQ}vC!ta -=0gWh HzDkJr1up$ JLnfz%mQWPĥ_o<h 6M\ɋl'nhƍ_1S]mtf: W=tJ$' [TN5 Gt9CL=d<0%g 8CSEqj{p9Fk'Df~*t=L\N Vd/8<=u |\7tr KOF 0DSMmaDXEu܆l^eJYLcG9xD&A[=Yty?cq"ֹxg<k74+ęKE'+4}ގmRwE7n}ЪhSC SA@@Կ0P[E-ك!К 6a po}1DSu=FĮ9 Y-袀NP{6'upotqcZja,>HjiH7z6[x݊!A+A `s@ @DKS1+#z13 e~ Ϯгʱ* 1@bD XxF7`D L1 p!HĀ7D PzHD;Ćpf!b!>!aft%b;l ѐlb  x0t8:TC(.rhÀpHp!10  =!xC;8`7DF1Zu Cb8 c7=8A8aп!03 Uڲ;|C VBl a,\աa(hgq[5QBߨ~nǑР{ -isq }-v@w{n ~WDy*ev06"tm[O V<Փq_lF3żṙq -i򡕦FuZ3-u`?l+mWԡ5cվ$58ɼ3P>ĭ1$[fq,Cڝܵ -_F5>Kb]2ԵhR\77C?cyn~HqS.V2ͣJ5ammlED]5XPO4#L3 ׃m -UQwo\9CdWeeAĂ;, -!bfq - -.@aae4m²,gq#,(zy@ݺfuFBwF@va]fM1VbDwh`W7ޭ*c쯵.β){.fN8L2 -SY+0k}Nk}[,tϹ:wϺx~1 uZi챵R 3@Zgrz,*}F+ L<ɥJw}.G"|,TcF+skeF +C lůrT]A`Dr5z\)sNzU9B:T5P%R<9N7Ax`~ޔHW(#PT< PtIiĂ*n(+ 0$02/ Zف)I690L|8qI]%BY;>f86Z+;`92@u\64*+ZC(AH%GHJg#Vq*{ިP_@&K+GKe6D&BSkDwsD _"&~cZ6ZA T,eHܢe2 }_צSU[v?%Z+;ݬ(Xy(H/ߢvY*xg}NCh}[,Ϲ6wmrik -@R٣~+x@‚t6?U鬕{1ggyfkst?⨱ -cÀFH?SGQX`+qW0Gb` -Ɨ[?Z*$۵(ksOǛO?Yջ <z׶wo><~{s??|xoH3B4ӯ__\/}\6\ D_~_O}Zп/z~Ϳ?|D[t -7O,5ShDMe?e~> )s{_oN?S"H,OV[z}Su{vy޼n?[3/~+jʂB4};O(c]#5V+Fk>ũ*(~ y#ogclk)+J&4 -f`E -ZT:УRS%@3W$OGGQWN#!;*vR$dK2^;z+xR1g^Ds&WT YӃ29Z%CiX2㫠pVt -ffoҙƸ~&w?8fe]|md*f_+[&LR0!/̝l'6ސP:TTd@ʼc"gB] -9*˸6gJ"܍ZzTL%4G`bD}L%y*$+J&:vK?^AT .*m>GRW9E!e?"Њ -2WV|Kؤys $t"i-5$'Ce>D/#d>fL7#Ad(Je:LڨDSC1)E| -D`:^!f Tm44DF+tJj'QE gC!cZaViQQ-WR,TDc9iGi -ĚҲ/y]i ÀGԊ4т"h ɳ`KZ%M5XSNhjʤ$KQ -} )fMy|E BjHXX[DŽ0$N0ѢPn:q*Ac #&dxlse&] -&#"UqI cJEҐ9KȯjA=NxGh @4b#AM'bË 21Lì>. N(RK&Dm@& -iʚK]a7ީ cV. 7n&qëΌ4ׄꂖK"=`l|J>0ht$ܙ@(IH1њĀ-)I}Y"E%Na3UTHƷ^A3RQP^LEQDmE Z*xn;\uqdz ߜNyS/FQy y4B!1!-&QuDbiɊdBуZw,j<Й@*MDb+IWjK ť.ѕP ^1N*5ӕx*jEh&In!JEjnauxy0i=ue`v.Aɸ-AI/(~1W!q$*HUd j s\9HX" -U4ӠYI*J 'F5]@H$ߢTseѲ7*J_F;ůPȏT&N@Tٓis޺'{wy "7I"0T%VY5f'*s6<&39ўm:EEc5N!>3>G3)j -CkRƁ P" `T9 TJw&L+;+A$ሉ[R?hJ [:9N:܀Kf%Tܪ 0"1%8X!D)k~Br7cIl5;+WrL#tgIYQيYAq%$.\G<~N {ŬwCePGD) -LlŸ1’$',l$0s0zU --t٣F,$Ӄ5^J]Ł,F^=xdr^fB$W26Cd{&,|j _ ,0{c(\7D`4,W_0 -s%B+:qް輻=Kޞ&*'/C.Jً\"DLZ*gg8H\;~~ne3ٙmYL4R9g -\UصءYT|>T~>T*Y,8 7^\ÝZVݝ<+m7C&[e쯡ިMF誡i;R HHPUh^LÎ"bDo\Vs &p-H>(?SLxR!jG3ɐz_J$~0^8PnuA4`VK뤾5It8cwLO4 -kp@@c*管G8cRJ)V`G+۪?\d[EaQ)QB73Όy B!YT+,$ժqu։x^b*ap$d.Dh>KwrSvHe(i}f(4;SV2[^T# sfeU@SYAv!Tm*P"ege/e}UDj!rǡTT -((!Ͱ~Գx)&=uB ŔHҴȇT -H)AL7K$$}+ND%dV g^eƄߒc&+ 䥻9K0[Vdpf&dSWʥ!Y'F_dl'RhsH5̄`2B$s3$6Q>$܆P8|!= -IEOlaϴRvg *t-+dD| n]ښ1w81/$R`i-qE8+eTe[eSukћtJnab 3n_JצzV4t -ŵȐ6` #_%/0< `5 R=gNfK`QUVr+PƉ"p4ar :1Q*.NVK) -yCgś:5>ws)M\P>K>'Ü/՜u-׃(ee]v|%cYD\|zn#I.iRǨ:, KǜGS"L#CiqITQ1QfjXG(;;L$-.ݐbvPz%Շ +Q6dFHĥ̔E0RM\Zu ܤ ULrly*0pRkETU:CN jXEQ/x rbR I!N!as?VvHbs΁N(LӰC8JGARps#)fԊ; -5!b?î6]l2Ĭ Hdff T7'Y2ydVW:*=IHyt 뢹rτq_=*7 ~&\jYVP0ⓖE -j/Pj݉2Lxzt?Psi&OI,)D$ؓw -jS R4(̬No/8'0 |ɪ\ж  Yތ de;:$53iS^γn5I`nDT.I5S}#hYפf^T #)[ ,%̡'-u0P\C<$0L3I܀\- 㙵UV@% [4nQ.qfg 1m1d敕Up^$"-m6k?QYtĢC $ ,ҏW$.z ԊTj5, " 2 %#)X5CII>ga0.mJR]rԸZQ|w5{iîb]nx#Е4..4RMKi>G*S$|K â%(!7*3ЃQs&v ]fh*W#\EʙZ <$z>. &2=āVz(LfC~ -KViܒ<5@@gɆ#y]PE,#(V,.ߴ5cK9)?B!}̠j"O&T5;Ss O[,'=@vhRJs(Ѣ`@Y\O~RеI:{LT $qN"Ġ| -V0$s$5Zq?fWv&;ӻ[e=gP-\*AV|YLf\238dk?oDXr82Ռ~Zq&nMDt 0ng=ܞq) l  {Fn^ -4Zc[,kl\bI+(5Sgw!9~qpT40c/[FbʞaRE7kg~D8ࡉ1`V aKb%J*c9dм(=L N7"Lbu9%6W`_ -2Ar+Pj#؂\͍i&YS~IY6e mCۨjk!atZ=x9[m5{z`fyv>C',|du2M JOjߑfI b಴^˥ǐ%0~VjA`Xl_nZCu$ (f_Ŝr}A'V e쳄mgB+ |%v1_#NjJم10tfW -'-L#!<؍IMMΪn0ǟ` cu - n-K#!!?FT 4ISiAKXZ^!TztAwJ6:7~:*GCb!1; 8[]>mS*|)겍@ .(W <:; :զ3 -h8qML(=\2)@xYȫ3{!n ؿ? -mD=ߞ+#QZ)N,czA-\7t6lN B{7qes P)|ïMCcK-8>4 34Lh=^Q HW,7)ӣ3?P8 -!FRd% Hi&v * r*Y6zELS "XG}v `ͿMA7R-̫{f4-?BEf/3~bpGhvcPS|]rߘd 2J9|J6 -m!Dr< K9o)ζ !~H㓃6-$ж|PN *>q<QRpQU?9/amK,?hca&ť6htKwO- G -U!|j l_p$7G:j'Rdq! U~~־ Em;np A*&<8'cQiTr[LmG@^J).bf_yXz|+ǞaV'%Sf'\<]1)fv=%LVe%wb$T*돐Cʉ뱉|^@r|,9Ff g*;7;v-n9,Vl(Z5420 2( νD͗8Q)XE4}<ZM7Jh]5y曲71RddYl=yEpw_L!;!N?P Gk6H~)H$(Ңa~=ЋorUO _7t~o }\vS)uIMaSw }҆߇ORޞ @1Bʰ'p sZ/B٦jgDʀ-Lu/?5JPx"CT Ld8|>24и(9LR*f]=4`?Ĺ#eւk$5j {aym&sCEݵSVyE~jGYM3 sJ'K*&WnLÞ6US!G`YU̔+,m26IɄ$'\KJwghәnR,+-=Q -W)Æ -ʪtZ 9)]7R^w_gۿ2jes"e7jsFTR $ -cCĪaTܐ bF4KyyKjg_<]ذб1cT3.ђ#vw RGŠH!؍ipҢ9Rqc |ĆA:dנ2qT2ꬮReF332'r¶Dt#V#xJuK:)D}+|Г»#%fFL*g -k| soq..?Ct -5 (0:7.A1@z!s=Pg.3 rJ+("ҝN)?" r|5(L^m86Զy(elP8@(mh^-p]8D@R0'CH_A5x{[['\sp$_6E0Mh/R z1ݸs#Zq&Qcb#.xAG -a9"< Ў%TߗmmmW9Ց9 -333b1'沣v-ڛS5-FOD49L͹9'ײca+@Ͷ%2! A2Krdռ. DhIP%/IxAE#f-ץK[0AݑIs]eZmtjF^ b$*v* Gkx үB&W4LUsb%ADl`q.p}h,hje'1O NNL ^ځv,pn\%N<'RNq.Z睨9 K1puQb"&%}t녑f PPiᙎx^^#"%ǩnہp*ĽRi:#עa:iTdq>6 ͆P@gCOcG_Pj:-TLH%&yo$3ha ~̘e/&Kynq%s-d̿D'@rafl&QCɑFQ:X/5_kt~ )%'f6+MngO=|N VO:- d@s ݬ((y~M%b/\kږ9D;i sۛF^\#%k29'RF j&ǒe N\bu§JcYmG|\ nC]euEiT -~ k="C\Qcwݣ/4Z*Qt )!A! -~Ap1U!JRu=֧w/jHbM* =j)wPEƝN;Jc=wx`OGIMގmV v4֤%e BZ*  $خF<C?w,Gՠ:md} 攝UDΟYA, -Q]pe6T猳ݥ9Fَ1<2#@&?ci܁"dz6UyxFb* l(+g!8"3!-:UIeӑ@ǡwXh0Q=UԂ dX|=VV[sfwÜrG! s})c KlP#c!L[ƆbbÜ4_~@ar8A -G|$gӡEeKcd2}(!+=8p|z,8~* -=El"3Lszm%ǦtoUZre\b'(ЀF{û"Fq)n7T^CcEDf=NWc.{k7D3B4˜^G׼.] 2 9I~毼LIY-O!z7OCkBJ#B_<a?ef3Tq^5C M;#m/_m_d -l4_(t,TrHj>j{/TD/8CpN-WԂf. 2m3mЉLR,Iu .Ioh)A/ޔ|0t7ev?JŏkG؊FuCI@-'Q"28z҄cEqb&גAe I8^h,S<&|< Q|x4˜g@Z湾i_([e1pA}K(ΈcI@ 2?0w0`Jf@lkb,ô[V"rw -. X -2+Ѐ'<%)Kq+Uۚ)Nhbe(2&Ͱ΢ċd-UQhx,TsC#ZDcy-9Pրy~c(Gn?FUTI!Vj!p.fei7Q #1ʘ82Yq>p>e86V'ܬ- gX #fy|ߥ0/zXiW'}~Xv] -LNPBJ덺}+L/S8P -T߳ S.p,FYzmȴht7gFW^u}fj*!@mq6I/=SlN(0ɆEPNؚB:jح(KB){Վ}zJVMNJS~xm!)1@8Rէ)`7}G^($CI-$`4_f7q|U}B9wp/: -9'`V X1)؈R)`WIbHP-`394pW[S٘1B"#$;x\}b3h:s3)vYҍ恘R9w]V[/}U;Rn,ȍ"s ) dǠXm|L`&uCgnk%u&Y%cjU(&z 9a]e|Y(-@FBC .0ء6%Y׾^ޞ[Mi>2|/U"{?wr'ǯO0?g/?ÿ^?_$6p'3*L0$тP;`[U-FP]&5Y˷`X05,ol@q׿bu!>9f"=*`cJ԰ ۋ2G86{!8rE:iDe?匴8:OYWleq8Egd',;C+N(*.P -& 2at.Mb6AUqڗ{cW{$4AǷ=,u_p}gEDt/dҷ}R~&Q!]!e3)smMO*HO=mD綗3 ϾUlԾ]mhgsi{$}8WpV5#'=%^N&t V?͖vN! ,2}wEM9\@-C5ߠބ"7\)ַ!8$'KWX쿋BDvUc}w"]Tnkoƅ}gy Fޅ}*ÿ;9zvS .M@K:mJMS羽?]: 5!(Nܨnn֟"ǸJ\=ʼnpVW)қO59*T5(mO͖t&xk6f&ABcQSxzPs)ܣm= BvgCOZ,Em V0n0Ho7iX&d<"i.o^bc,b6캽kfr~ZBArv#mA/MfV_vz<7s"`b{:(l'g>šo"qҶmH֜4hIG̐Xu͝y91S&O>Z-]opk[f'|dl˻2 aF//#oʘlsrs/p{$0 ]!PM/cօRvi/++L4v@FܶXcIaij&enL.en ><}xt0Ƕqe>!j閭YýH]f Fʅk=/>m4#); c ,|Cѷ0hXŤ!!7+aNC"J|&}O8ȹY0QUGUZ߬C%jYx[3*:p|{i0~e,_rLO9_ƾ~dxSH-^jȅi/[ڧW/+ -nۢXV̋r͐߶s'Sz -U4-]Sa{1rW%;y[r78fȄ=t t QFEX&`7.)roK\qn^pYo@4]n~^8&mnSoK[f67˔7p%`Wb#J̿jOr,~b};%ϿI۔,K{hoSZ@{^g^@V_^|ʶ=yDo#@KVCF{Tr9q,C%>*ف'|=kt q,S$=?gõ -+GZJYCVypA!)$,rnwܖZ-V(u̱GsXtM>si'^8?;r\|[Px6JG̟i'#ZA/j#ۈx3sf*bˈ6U2>g願L䟍hMT-~kCz;ޜhM73ȊɉVt-oÉքeo#ګb.~Eآ^.m7;αNe7Kcqz3e/\A)kF -*>OYn Q3L?z^oagΑ5jqV+ -jez_ =ɪGrjá.) :im'yM%fQY!mUz3sNo![^tL6ԕ$ԕSp;EmSWÒJ)U 86CdoSWaeI6uAg|3@>]]i"jȁW]]m%7WWJ )ػl{WlT@Gbդ?|^Ӕ )꧌9秬&-<1Jpyy1ΓCJ/&Ttk>4͇9nWwxͫArfJ "}Bjsۼ|# *ja!v~=$(M4֚5ct~FHNp;5YLJC ZBf;@ -6^Иiļy۝}_B<#1nX2`-Pn{::U oX$fCR/,`=HbIoV6 -i rbJ߬`J9ʩ_^jj6dL_էbPL*bN?<`yt>(ov؛,0Ƴ(K #}{S: ^鈆[JO#֟^qP'+[U+onX?UCSuWOO^`zao_Ʃ_}h٤kQz{adQ/a9o/:suq?ާ|l< ȺN*?t`TXHTg5EzV>$۽k+o,o`@۪+Ӡ |IǒvgS{!mmCk8POQǸMGٚz^-|a1ꡜngQ>2ŋ@POoQp}.-TA0TDTcW4ޒ4Hjmf)%<7K4(!l۱+=Rߌ*9ÑZJ@B&QGb'kQ."Zz38|{NWi0dLF &{pYXO |JSFEdG*R3c(*3\˦q[PR,+թ9~@r, OHt)ݮX%0?ᤸ&aA5z;qڛ#:' -#oy7qK68}3"k2}#^HO Fs`Yi"`m֋h;.gPzWD2W{3zVSg)Bȁ]rDc:;2A@QiS"Щ1KE^ -,v "Z}W\/-۵bEmZ۫<~ OBTV8,gB]z CHV;3AUճ╇:!u/l|3" F&gɆt}%7iDH$ڡmDH4sрп*NC|}2 AU>aۀP2(ErԘAc4Y)ur ۀpFBK8\!n%JbԽ /׿%VS4VnTw6i2HrjF,,i k$d Lllk1e?]"%;&A@눟 Oo$=xLk9.$ >9a"I$,:3/Ap%G#ЭQ6V;V f $vϹ?ח%=)uv.OO@뤓T޿M}4RM?M" \e pNԝ6R}ňn!%_!Nk7$ja7k@#rV2ݡ4o#@/ߧ9׏+e( LSU :,(CKξs>"omp8%Kvt -V- - Ш?~vAkvAQِ]N4 v9]כ9!YGNb@(Kfhg]ކL Y`}r}fYy2 Cwu&.z*7[mHP 7@Jc - `<=IHGߊ*xt; D7o`Yo?'e\dA!ԗޟ" kx -Gq]thrSsHyQt)uuw7?}(L in?ʷ5e9i`7l Jއv•!e~ מ|D,2i`nEvkYΧ(Z(qݾm_E~Kž~zE+U97?52a)or펷m ǎ">qqf@Qt1:5h%φw""%{ ewZi1JGv4+mo//@$o۞~ -~SQ n{}OO?H@Z3cIzT۔+^߫ijCΠcx{ C[Ǜ$ #ԿZ[gol -8OJRަ~C -@Y?Ϥ^~ZrXzL'J.?X9?`뛕Nn*o+?̭L;o/?b7r\'ГOlh*@cIo/?\|9 ~B$rVM"!$K_IJ>MTrsoS?]7F}s' p$rՏ]ʤ,ǻX4?dC*ޏ>s6|AD`6vYQF͑џWSqDnmF҄|ٗx# s;7ms 2afᑯ_*J/q7?*f9utjr3†b6O~@O/՗Ej au1J]97??*!kl~E:x:ZJV~8IjqDh'eXbH/?Wig3 *HSo?`הz<|hʐYǮ/'{W㇫E>ӛ6Yyxy{1(nG@2kA*FcuV*Op=u6ٓw{!l) -uJ2O=qu ?8yQ9m\פ'd/PA -zZi]ݲƒrv4XN/7 TR4+kj. 2CovDloU0} :gJKtۛU7{rv߲c&۾ O^Z4+ر\XS0՛,[?,ɶv"˪m@Ɵ_nn,3BMUp_V.!vIǶCJALvqXȹ__М\R mmh' -,Q? ]ZWuLo~_c|<+!O{Ur6o//2$^Ri˹(42bފa!{tk\\ rr17tjیUџ0B R2bBq l}m/b()a5т:V{9\^Y0VYdE /cvaͅ+GݯZjVo+vW5L - 0‰>V&: - `Ϸ] QۯP)ۧg=.*2sA4&!ӏ -`[囷@)R9P J_dŔB{zsbRӴn;1G{TM!MP^QfRyXD"Dβ+܆P0#a?]8ƍfOi{<4Vm^}`nu\L(ݾK}DuiDbk#H ےitbǶS_Rv.FURvY~+cSI?VJ})>(์U_Yk8n.\e&#J iX(иBKӿw492e;moD&7S#l/#/[Z7-V /^XQ/=-Ky,L\:CPɞC 6NlHpzB%vb y2gnr5H:~v ZW_.A\C@0 )|4e3,gOOs(g xzYz?Y?^bøG(?>MP?y >]y:t|0K !INѾ-wڱL>vX%^͗0D:֐zB2\ ʑ~p)y~8el2bJ}P(ml^quFG̾p))_5ENf>j -?frz~h>#?߀%Sl!]’^J=TwCdr* -@V3wzz)l(z!BT!HU-pbralMslkWxbͽU[a&816@A8hغ9F.s٬ʞTSYS1Ck(;%z`41~{= =U~I(;ym3p}N 'X+qL0|b{ 3B=9Q+ѽ¸`p.83sS>YGkU!Nqx/X>qѫ!c2fzUzΛNqhn͙+ȚBI$H"msuVTMW%jsE9];T:0YAkE3ч9) :"}3&!2WE$)n#tHSŎ5ϑ6V) ndI+x'=Pk@e,6X -DO5hTC(5p)0rX7̹%rG+ a_ 7F),Ÿa -|l'ޔWeO:  -MEmR*(1у}Yڗ(^6b/r_sta&a,\ 0_(A΢iz<M-V:7W$BTUpql;9hzΌPF"\َPL) ɦm$OftW@~]ٹAz 20MPVg_# i+l=NZC @̜6E5 ~]AdU 99 u44i>_i^G^+^ ,q -Id/gqŢތMiz_|ӦSOL -ds9+sy SDES"2;#7L'~Y -8G3弮I:'bо -=;d}aoy~[[Guw x@2NqZ5Z_[.+B:Ҝ>lfsJNxZCwCf'Lf -Fudkח*,C2FHe?DރI/8I][:`t¢?F515>A!27уa>c \jkt>P^D ߤF =)G1|cy5Z$PD JbU8rg[B$TRD.F9b9fP="݀5y3!z(_GRsK7z -;džQ 6_ڄ>H__z:0RS=S3u ݻ#z\k=;%n[tF~q7 ih/:⋮lC岮N]oz`zT"j.wW1Q.R`XVäOfN{4C~C9zpvSw2_EHuu2qw4~ OB91IZXf޾% H@h(P8/&]'KUp#żο>!au6}aJ.upH Y嶄$([~^E`ka6P"+0qPQz*z]}+): w(5ޖAZaƵh; - -SГ3,㽆ʇdTC7BN^yifN f98A0/*i .f^ ǩ~)Ir>G}} FʪE_XW:S3}@8JXf!"2!ѹin3gvؠd\SƆDG!g3i2G~"S@`c[nmA@Բ.Q)2(bgΝ, }u%\}(VC7$J}Hh11\ -90[\,omrlkZq`=4xov5es+?tdAqpa='M_ : 颚j+5 LGM<<Ġu[/24[~w!@)qR@#R Ĝ۹ϓy!M4FBz<W8Gy.s/)\\6?SB it#vby$36r%d '̘R#Lw#ÍiEPYKՔt5Sd}>C_*~ -qltR#H,"( CG{̈+ r_'Yx̠WutC:gc:.Z^%5P3G0O!}-/zSA-N\XLXvz J8Ԧ N3bL^vPh,FiPM;G+38Dtanu5wZpu#e42έ ~\ ʸx朳WִjC`!Ʃ [ e:US`HM]wRndYɐJ9hU$bΩ8<3tϳXbуSS}K=j%hP-@!(7D/|:)$2S}["{ ^2|Bj-/%D\D˶e䐑pTK؅5F#L^6~\[C#] j/,Mf_!'m#~bJYK)N0cZtĪ.IŌ|3tZ 1o:0茇J+G)~W0Yy:efB2'k ,UXa6{cb⢌H@V=4`=>}޼d׏'IEl8l4VwlX2 Wᩧ3)z!Km*.X)QnYXYJ8(dLWjBiIc7/]ɺ2:YG2SBeo#\ J|M,7dBV}Z 3CeXiЕ/!$BR= c rsW ْ>h#P#@s@{vJ\kDօɊ/ 3?Pa^cڴA tO#ѫAqra ͇1 6??xr$Z@ -, ڹ&& -G8,q0ÈT_Xg2-[q3$8B]J>%flө/P,"11a~m(JlT/aBTbhY>TʹE3^82Gv&&/?|6(y{8[1%u͝s%p2?\b1 _ - ^%G<HqKmkLC#b v Pt[,UYc.f#s4&$QƐL@Qiv4Ġ؃Ѥ#AFv^XtJH-Nhk6Xt=(!Qj.35ȑ2X;@AJ'%Р|%gf"F^ҹf n-VhF(φ'h-W3wk8d{Sǔ)v ,{,I PMS㶬^-PRM% vQ@L9zh̒i1 /5h{wpR ,"򉡁,rFCwcMѹNNS0*ZTr<`FZ}k?l~\‘(t4{OoX(swW{Bc \#l/ӘФMpIDM hGȖqv[ |'RSdQ\Dר_4(c]zrps:EW5# g5**y.bM$c:愍V";Cf1^qIi.4p2" ̢c\uas=oh3!>{UccY>N($c_ʼUs+5١-RgH.<+P4/Kf""D)$Hf8J=hzH0Ùq c8ހ$'IUV^A` Y%yO]X*I H1QzZ[&etNcsM/ z6o*O/<pBg0,) '4>HGm RMvPYU0{ -s GLFty^[ΖE:Wv2"lO!Rk&۴6s!T!F'v-EppIAV@$][ -(Er`'"w{ ;JjF2J\GtPGk=,c.ƱmrI}9m3kD\= ,r/B)aM+[J͙\ȋ[01YTz >M0(&h;n=WʄmEfCxׅ!]T GO -촢l^c,,? -pGhT%9TVuCD@ !b!8ts@hj_J8bnX7Ņ( Pb=cRӼn֕l9zV4+e~p+O#-;m}AC+8B>$Zldvri"_/-a)w&w@BN\JZmLfBߚMũjZ^Fkc.<%Pc7\ 8̸فH=L62j5 @%XcVbgأm?"R!g].*+>;`D@B_i8D!BKbCMTL~,, -O1F.)AeCx+Jk͐Ig2a u~>07%F@@M~^*]HXw ead"4M@EeG1_ ڂzu4I=gon.(56@gl:;pz@Gk+t#E@2bd v,>dg.5/aoxXة"|6^DpkQS루)j9vqG<6jÁ$*ېj84" 2s ^0`<݂.[_N 6RgM!1'f)+XTpXRXMN.9 f]LHLU#fvk5Әvwxc̥/pCHҍ! tTBycy)t(vKY }Gd%;^\7~(?#ėhg`1h_ի(M%|֡e}z|VZGj`_ VX>`ִ{07Y2hbJLUKէDK,i/8V8m#pTK- -'uW x;oFte_O @>^`ΰ4 -&4:= ѷ Ii~`D -3ύ bA_qD )⋽:#( -KhNp9(@{`$)Fy?8cYzBKy*.holFyW w9~FhHO5|z'mZtkA|E$zQk”^+1 t |,jh\,7QK'y uX1]ZCȻw'ԁIp^(FPp -bZ,am-})Tgy1V!7D=Un^ZK(Q`%7*g@B11A6"A93f] -H<] `&*luh8jq1ɔM:\Zi.C <A18;EWɂT cDxZjRq/K3Ԃ"=_ LQsE*RX^R ̉r,de >Rc -NrЇd7Fhj68 ںxHth)O3$4(GLlT ?G XyBkЅ;s=洀O2p6z~©SNlNT<N4e(Z:f-֖LZ J̟rĕ1:,ȧIaF-=ڱzos^+s@ bszVYQ"#,9'3cۥYIԹuw B!dsR)R tR Ţ,L QskO>C?\U!ܻ7>Ws8GK/BˍE|Yk/0ZaFם镬#OR/:'&V8~ -ڹ,(^>&@1iW[ry׵jT":ˁ=*ݷRyIčKhi,gunXDZB @ .]]3j\$AN5cjn}^h.3M¢fu->p۝V/0|!GI})k3ޚ`4R -g wSCm60E*Q{֫KrŧVR -IAnԃ/Ō)&b5st%d$^hh t'8)Θ LD}}$9u6\liƘ tp'=d 1I侥x#1M@H43H*Bn56镜)/OU*7bLu~FL0wRExTJxg*_gPD!m:=L / > VUzeޅ$ {wvݻ" -d$(.[zՍ:Bp܌>B05Nޏ[4`BDIL>^0t -?dd4d|n:DtN߱q-GZN)HTk) W04JU* fZ 﫻Mֱ 'z`K"QF JT J;(ԜŔu~`B_Y<;7kՕPv0(0^!uƂi -zWi+&## mQ2  S8=b8 m؅3@r^ŝY=䒣Iuz}yamhc$8Hz/umdT '駲jtdўK֊!NGYYv.C.rSö%? (]f{7ng-]&rpԹo<M44c@[E4s LY% ֐%T!:_ZL8vHK1.vI Duc-F,7h%zHF #vU. >`%u,LXt(aMNekh?t '{;f='dxS?'`h\Ɲ9/_)Uڃ/&M./PVa^ׇz5HH=)L2cJ"?Ԭ拠lKUʸ"K^,L$Fkrs,0Zn衤v,>MEwbKy8kwo )ej(Rziq(ƹ'7)Fށ%"4 ԫT*9Ccٴ廩Aŕ X){x< IRp4:eImͯIWB?zz@lwE*ʉVL(YLh[=\PAհ6er[B"C>uՙG5"w|Uu潕ӌh?T<qPzXW^=l3 _NB3;'tz]7] Z2zD\g)Y;5V)+# ѻʝ Lc6r ZԐUCcgC/H&uxr+!MR=_vBe*-H=H4zQDU|ݜ"ԡy"c=CB8\!^}9j&gJ GG=P81 9L1Kl&ZY~fnzwk Fj*&9ޜGnmsԔU$DAƻZǩ\g* gIᠺK`f(MH~ KT* e~ ı FӔ@ !Bg^& -ux5x EZ xY#4!A,# |$u5n#7 JAU}r)7^[xbcgʦ0za%rd$L-W9vq5^W`bP%j;-TK (]_4z=܉*|LmΝb FQMm!@ɀThDc-u1-Y%듆`iXγB4O%!UL. 8AI헨}9xmYyNJoS}q`-4U?b~-fze(ږTϽurfTէ%ck=%M)҈0MPwV6b=P8ltŏW>*\ۃ˸{1F5s(Ex$~q ֲTU_eCWh5DmW8u:cAUZߨ>)StzW8S/I-_ Z:Ԥ%8F и:(=r0ĚVJ~'apSGkM0 -Blle'khA$NJ=|okPԳ`?WRv(B.ȢPD;VzLEEE@L4<#c5hޔ\R?gwX %1KhcO|{9F˲"SFHDeVx rԶ׹ SˊBӢkr=e0F&T[^kh8~ 0TyՕY޹1qWNڀ匔OM [TzZMbUB}r_LXn2Ygm+d%Gds}w$?G\T}]y) h|0['֯/|Ŷ]x i!6\qY\O -0zm)&_~(Ve"I#oi'=>6=(#WS/5Oゼoou^!VOm8RKʴe{ oQ0ƾEZ,ll୐xBD)uP#"Rw%ɳDp 0J|1C4Ãka& W^]/u#ݣ7vq5쯠BўPujğ}Jȍ(}m5onhF<|G8ol{_5$σ) 39۰O"{ĕQBԦc3i{ǜc-~[jb GqA{{AQ-{$66 -5D -0}XaZJF*2==Eꥈi?\s;\9.'xĊ[&f?p2Ɂe;%VyfLOF(wF H-Tԋ<$F؂ĽĴ\Pn)e}S jX2|()F'`2B{ /&O*k\6%w[̥F;&aWl'U ܹE2'eߧ6_ӦvQÞgK>0SB;CNB<+%Ǐ(B -,MQִ*R4!M,K b|Om9$[$TR d4Q)=㱜B=IUԮ.W -˔=T{ރ`_; zB5A{vORmUJmry­A>kS/Ph4aNocpIshqdGRrطWуRԌ60 .Oi?'<oG٧3r3#&.j1lJ2}g0Sr-GڭY~QQ(iwdh^tħ Vm6,͏́?D6r^ٽ&zAe/$cMB(Urۏ ---cBġ?7joDzs%yP}^{?i^֪Bug|Jv&7e.tlLTȫ˛_eXgLY T%9.Inj{muIw !#vh+~ykL&"\)X `C{d%rW˃XP;AbpͰ_VC/Hݨb)9,mv^M!9yk?PLb@Y< -_62w ɭegwUd )9>W`o -YD˦^ # 3,~(.-{?DWD %md& K:",`㨇x8sT%V.CVYȋPʵ=bC{Cm==^osWA-Rryf4?!R)SzNL؏Jv366<~6jMܐjcl@29)}~GKQo}$?_uYgKH:sSIp_fBV҄z;jзBȺb(l+7YZT}o]H{N{b`LxKV<(ނizh@XY$y,=n#wi֎_]qBN5AϐŝƢɑѸG>}E 6#2A9'hee߽>j+./["ߣ0R4Nx0}V2bկ%Tc! RJǦZğ.Texf{%8'^jyw4qIi HEQAl0@ߔY7/@|71=`W -ࢮ_e&xRs{h "O*QuOR^G -MHΪkdD|ejkFNvy3XcIQ,Pf˔֒煔;85ؙ/*@4Hb]i0Y"b/k&ן(+Nmti't(8+ƒ%#EQD$OITX^&б7JqeQNV@rU<9;j5`'!Iv)U~'|:Y9~*bQaY0|<f)(;}%\cqFPWO=dli H#KT _e}nٚ^Q%wHl!V)d6H\ - M9u-*K[n qЁ鿖L:;e@Get'2"#ڒZ2Xr.b]Xz8&z~+d.$[<-fzUmNa]鍷-I=|QC83~U*%x\ܦ P[ ;ĐIqft ,DD6ƺI0[Lv3k \QwZ!js+H @Z1Xp,FDJRߞgOeH/>y~GJ7󅱳),!IAʴM`yeez#lWW9/R؎u'wÝI} xq[G6.r -#|9q˔ed|FWxI?tz0dl&ti;H#ּ9J )ɏG(cLA/XݭX]W~eՋ<4aCjP?X$`ih30?TNO$4e"pi^R oY )q۟?۟_ͯ~___|o~7?~}߽Q _|M0cXb (wgs *dFJJp(JM}3D``\d2\ --g~ N lJҤr*(nye݈>%ЗsH4?ײB) 2AR9 KrJR8cHAIo-iг}xˡPETd{8ۥ &o6V&,0\ڨ@+}XyHFxpVDRB2'!Hs}Za )0A56O0oρarFc:=޺.sbYƎ;jF&. -+&dY ftNӞLF~-3'ZI'֛%+ymj8~D‿JD[8_a%׌Ɯ'nrm"ڛxZQ[WH7bt'8@엤D iRoRl6Cկ @YU.`Qd6`{e""R>AiWsXAm2^D!9jr Z-L R(tic<>0}&sHqG,Lj$x|+."Mq@eY}股, @U>raBy+'+hE -b<j{Aߐx,UMz ׾z 7?>PtӉ%K@Wf,i05?~p`#2ce)zSk!b  -lmP +oJj+Dmu6Ҕ!tM7==gqEyُ|?BQ)S\ Yf[=vw5{Vv|s8``{(-zXl; 2À{?#K C/yŦ.$mf"4 oux(cŻ,=ыqyh -.G(!zurUdTq?Ql59tc!U4 endstream endobj 36 0 obj <>stream -Ö8{@үY+/YP"pKFU(\l> ^?$D *#Q..yr(mȺּqmvU~VMfd)~u[%ggKe$pKN!p1Wﲩu͎XV W_ A/W/v7|ghӴ[%&7*€=Rd`D/1ߠ(5CBZT*q aqr}K5bUW()*;pF.\8%79]x t2Ev=iL>茥SX[v D KAƒH)mZ]tz!w)-z*^Hr(ke9#Qb; 0rX.]|`7/caⲔ$x­BF2Z`g%Vo .U-T='tA4 ^~|$ӂ7y^MӖKboMh -~s=*z7WLS@mڋꪟr -#%)s`PT]q ~~CbNǑQ}\CeFq5ו7Ҽ?TFs,+t|%xzAYqhKh!E`.O%fw蟮vܾ[УN AMep*a3}059xaK#En$H#DXݶ[ޫkhԱxTZ -$}S> oVo<ԛAWޅiS  ~]@uk80 =dzޙ}2pErʁF<}P)4o|+`pp=szJ זs+>{4{8n.ל){w`qvM%, Cg@]nu껡K' u{x7yhgQِIJcDޞv?)HIH=eI}2 Rpn.?ԂS *d\R(.T¡*Ɍ(\v\-b[9ATU}$4(Ad/~2tXChsѰD}b'#epԲb-Kds5%T$Gӄ=,qm"ؠ(}{vv+@5cOmp"^xv}˔/\-"Or(~u@\nלRUn 'Ȍbể(r5J͙۟0)(}yB2c1'erɳ[X+_r $q̤C3;r burK(R~?|>8EW%ۍg@8\q aCAHr?I; GLجO{M-0| +fJJ{pJ;9De&KuMs_sb?xnB@5Qߓ@Ca44A wx?"Ն] -t8Ma -Ů.eO(W+az^fBOЃDTpm°UWE96颰9W߳gE8GTdYӌf g{w[&V]/>>s m])wC3[=Jn1RF/$Iԭ=7|a|Ln7 >_22:.!jw^jy/a. _"-*v^Z~)9hMnPSUt^+[PΎ‰bm{`|)Xnw HIyļ BWuUoV'<^ (MC3 -,%+OY;njqGDGf!HpI7g+RXR8)j#D. ~'-%$q N_tL9d;o(G1j?ž&6N{UH^ONnfk -ѸuPnz;lV%Ba)}{OctCeW;{ -^A FWBmU<}Ѻx+Zw9pŚfq_"79,JJ!vi&۰|sEV0-g#.lGsvrj@Ҥx -B =HqM$0uڮaV0F((KDqobM1(`d/س\%1 -(<jr$~^eǁ(0sBK m3-bTLoo\958,̕<*j^1H Ԝ1VaMN E擼QtbTj{PQi0 CH]I+Ps= ˫!VYby˓{\7Ce )!9P?[bPL\nVq;_ -]qh1G~!YG͈/ODbIa5HO{BّV H6+Lb{*S}E:-I"SjѺtSM2yR=Xa?HU[^ H4-$84"Bk{KCu P<:$ތd/#̙O:[%m8^KFOl_rSHZIV 3Qԫ\DBAġܫ̈́9j;V2DF8%n)N.KVu6 -FF96I<>;W.H("9iÂ*9pG]vtI"EYQ^qCbTV X $n .F?e6l3wjr(j(cr[ <= VuCaWუƒn7sDgV '&( >U2vPA\:MV()zGM`O:@>8}/ҹKJyrl#Y& רw4硦I1S@v`BbRn%Z@0'э~ߑ0B5@|bz $T!Vۯw*s#+SE2D7\%tOɄ2 Pߟ §U(^J~H֣s*-NiRBPx5aiaY 2ba1u]Xt+&~z(RW+jUe8ЪX{dRq.RC5Р8)$6=$\73< sTR -~9UBt5ij؍A!&?NHTS5.r#*dJt>Q`SԢN{f2 1!Dn [JYq;x8FD5) M6L}VKna=QEߓk4 ԧ/3L۟V -Bѐ&[;,ÄpƐ=!/ @w3PHEl90GڅS:l۫0A0EމBb;BZw,:dB3GR EmXC8*0Z\RtQQM3u/Zfj -[]RyIC'~"cjcv~T]D}5X 9~Xi Ds]_zV훈qdJST$Jn&,At~Hz]k2~xTJ/E% Kr۹z?@1L܅\:$rN"vTve{R.uc}Z9HWL%˫w<5,E̫D+B CR ki"0B[G=KVx &Jc%0n JIS{ A6 'Rbbn\=G4qXN}n"(('JLLs] ,= veYO!!@q8np T\q&r-rD*Wu,[]zΫzxMqIzIMP#.%keӵ07)$p +x3qI/[=ڹs8#ۅ0-G)t1p$Q;tG^%TBzRʏ=6[j9"S#(+*b @6G#l\&>k]7-wN`DNpFm+WBwVהZUe/C(맯- \^zOaqvG'I:Eٞ[=;N#` Q2b -8M,+1;ܘak}]bB+tS4=۹)(Gj!(aa 2t!4eCݍ+6v_^ѭ9(8n9BxpɼKG{z ˆ[9WPv@ypnЬײ>f4\L9)oyy"Cbxy?9iN<%AQI`-qGV|> -%(\@(p -5`)=QMޡ8@AB.ǎT]sWڒ6/cDNAlVeTD)m}<9娧}>XuzD<9ЃKehe~8]R{9n%:xZ=OŮ|ZSeJ%XAkx_SH_{_XoXOy"=)Yu*|TZ#!$SE쇝}F3 |w98}lU3Tw  -ՊA{nRTuN=n{CQZ{(7:PM=&tTʬr%C-:vх45NѮk?8yh6\ns@Bf!|h'A)b W`֠pA1kt=nwtq<`f+H}.qN5*=A8WnN&Jb!({s.Bݷa@! `5`fJ0Il b/}TAb,Dп. Ky432p x.XuЬ(# ;:A|oH9 -+oe}8sO2$*KF3AKHFZʶx\19BM7"nopaZ,EnF('|XWHu$80&0Y繐g킭hJRe$< T&REV+B s VIP\RH^zDia1Nx J9U|)J& doL&>ɡg]n;y 8WX42/uM7SB!Tq.Ay?&6b`܂Wb@xojىW_,$Cc_Px=G]A  , ?8kI13 ]PƊxX p8 X{+Y oآto|BO6$d00fmЍGdU݆we)w%-mn@Z[A6=_ü8,@,=d-H ]:z.x7Ưs3fH'mlJ/qZ|^@^.h {gQ:Hl/CU(ёl杈}J ⯈삌e#٢ AsB'&OU:XD8Շ^+B\5VWIS/#mئr%IC7fK%:jC(RpwaD$`S0vr-I@ek2lBs4^%xUBRd,VjP—\$N.K-2Oe-VB (XHBH9_ag8_[5M\՞ȤP6ܞe-!xjI m^uMN52Q΋%NB9$:㼬+*jCN/K^IW g( - lO͌(e \l<}K.&e' w1~<=:%4c[%֥b&9;@\ߛ4[QAow L@e9"B]0(&uґwLhb,F̻yF s4AnoJC6{ /e/$9C$m%,#1&tZ5Z/T4+*R^zG`$ UԌAUJPo0vGKo ةpre7Bأs0"?>q{ 4 YSIP_^ do5 -:S'zΉ˜?S~PĢH¨X"BElsʬ>TCIg5y? QC[&J9$=W K:`H! .˙'N@6*l%'8c(yKC辚/HPw[QNn*$;zw$5{8M9yF3ǔ"P =e}T5K$XbK;KQn_Imká''j?0Fx`z'Ez a:>:\ٳ%odّJn)R6VrX/!+ܡpRZg48ௌ/(-;+ğYGLk"սKn`~E7KҼUnDl9"W;.Q* Д|m5ϗ̣=ǜ+ -Kl\-d?B*@C9qqj8LJ,dؖ̏#(nߝT$b՛f]GmS"5Áuxj\IRza$U96n,sEH;N˩w _.W9.͌jC'Y -}2F i` n`8:>(gQkȌp.ռ-G^ bɱi p01 -SwvQYje,B"A)#uʽ$#YP&B W>N@%OIt1H7L=?tH)) 4vcreoZ0pIbtYXh%J*#[?ag^Cco^>cHDrpT0]i%X$pp,").V"?~渾_`2;H5^E;NۖEIjU2\,@90N -xmsG"IC%v7-Edဧd$ ʟO|eH%(g9";A}$f;dogDo"-c!I:ˏKYmQGK.r N -~ V3's/P12-pPgMP+A&M7IB$4VBK.(;R=vvSGz|? +ⶒ@J1Ui4#Л&db-N`fxPcJ)L5D.BW6=EvYk/$eؠJeFPMߑF/E6O##q^';V倹d66Ca5BgTb5b>ȧ -Hk=nگ4ֳBz yyAxXsĐDBBIDl(:!gp7$*kUt2zN1F煭ݡռտ"QrGۛ,Ԏ8{hZ/^ک~XHEŦ=R&.3Z Tߦ!>ƗCѪqb~B3°}[g(myw*w:$)Z>n Sbz -ߊv ]஗m:#nsC ںu`8DBUW!:%`jz&8&o_$[-~/ -F;3n[wy1⭧7kBlD%2Ms/ a9QI}xbܚ2=-G :H@Y@K`t&]O{{@]'>نyle? `ӈ5}q*ԣ@: S -gQmqf Yؑ-H3cЅO l%l# OrQQpb_3lҺTtҒ{\@RAQ忒&e^S :\"Oiz;(ge -d@YO3 Viǒ%vzU|["TxvC^ڧlvmd֬yQ/?*k͊!t7v83t_D K~5՘MȫU5jj,zv_Blam=@ Vp5"\u㨇=:$2tjA+ށC==b3;<|)gM$cņFn*"ie YGB-Pi]6S'قN{Vׅ 0i bUv-O=Ghy> @8*]_tbw DUJy S eE0:m3/xDy!?iwO&$0zg.LM XBR;6b9"AyzX.j@吥 -dt/K' -KN@!1tOaYÁɦF2x:P}@`)srR B0z8f?]t37 0ѣ$uu jłM|+t I VPǵ⢋%q' 9tJb&)ԖYؑ_h  44$IA_orfLu/t]K،ׇ̔E꿾م\l0V/-bM$Tռ{#IJb,!%[@uSv I+ѭ^1;,4'N[@_ `٤v&s?EcqId @3$Y:Iв2M,sm:U,(FcxS0=xՆx`*3q:A\/ ߼!L\)DX()![TP aU}Q.b' 'Y71$i7HC*vJ>VgLH=004Lh6k,TcѴtO "?{y.Ffs2֜C*&4fpFX -+$C7]PFdH<׬ -jqK`~bF_P2Eyc@$JGqhAjk]"kӒ=~h -T2n~&zOvWJdv/{P@?`Ň~u'@HO_/uF`]59JPph iJ%<؅n8!|)S%劅:Jxlztv V\[R2\J/qY۬' ?ӈoOPfQ9Y# J-h %;1S 6(c/nv#+Lv-pEqɨ['$&Xfp -.O.S"ku)>L{i4'D!,c` -oBҳ\ Z8ɜٸkJRHXfZΩG[jt>~L²2fh?j_nZ,*ߧta?EdC`C6CگA -]+nah2A8t$[en2 BK%.kg(PI@kB]@i/Fp"Xk+xJbd!-XR%G:>/P(i' Uɂ1LTÔ!4TDM!Bѡ61l8P}K eTo?ԢP3n"0^yAf q'sN02} -IW^$^A(+EE -\?Rc_5qXaC't,xud{PnS׸ ~닶5neo5/~H;bOxxQOKk@oK_zD| Sswlg%/47QRI"JK -NBւGSʭ_.&H \]ћb蠀fcCz8,|5;Z@ lH;}E(%AePNP!+H]-_GyM_.t:ܫ)s Jt1&}ZuJfD*K)ME4>b&/*;☣lX
s.5pu;Y1R[y\{dV\0- 1:MPma~跹p} <.zg}Y殒r'onhw)uJW]R%`tAf5yNvg) -}nYtyJĀO(9Y L[~+:(*Ln+KCyNdQ0_mg|\lLKeUS'gyPoBUt[THp{dst9.S@h<;8W0]ቼ9h(Qm()9 BEut&O<%িBVL^m ciˎe[V(ݖw w+ҷS 3㔷??_|~~͏߿_w??d?0#g?b?}ͯJǿo}b/o~~|}Xo/ݏ~}?++_oyťgZb OD7_:ߝw/}Wg,W?|~q_H__Uu~_/~ -( |a7a~oC, ?|_C@A. kTXH ;Xn7Tdl($b(A4jxakvaP3yhDW 7etcf -onD(~ɍX;cŋ,)D#;_q D+S ֕;f;cLt}x`=wD9~FWϗ|u[)H )n8,*eZ=O'`BBH!QK煚[ =NOZ_my]qǁgsѳyLÿyb("ٜHDѸ?h| ?G#n㚋w'sD>tGqEdH#=[[AW^{AWv0+?w_:9ȶ:P_2Yo|IdѬ[)-)h+`4Ƣ ?s!w,t\j{F~v_шݓwHrm}/eX=AG8߈K@h9o~㫗z{P$VuF-Vǹ7'j6n H8pgq+CF$1k -/gAWV $}jc3ek᫻z$t|LY {M=>zb,L9~7>9_ݰW=~h:<,Xrgn_4jE!)|~hY<-ީ>}/u:-_dsoRz}><5x+#guG@r-m4QbO444zRz#0-] -Ln|_njGs}9ӷytKySfa{y-?ZKkyw?C6_][sv g~udzBNb@j4 <.XE\ ŅxAKcok@G 'mr99hxh}3SE4߹ɤ@}#ra3\8l+x} -62>o`t3o9}>b+Ɗ go_L_l|Hb[ - -:x-'~Q.vn޽h@Z1ꕏAKR<^X@>Z@qAhUx“ѼWk(O4_껌¯/yWh_2=S^Jcx4jnXhٷzc7\e[G^sH4֫dh%}DJ!OaBܾeEh^}ϔ{vyΥq{ʠd>w>rȒghEQ sv7W2,̞Wyט\y4T|][ D֛^:7[߽F_eb%xN s|eVB-'0XєNV,߯5mFt<Ȗ3l[[s^g$mfsWґWb^\;^ؐ,XWK(m4%'x6tQބR ('/X9^H'q{IeIǂudaUY5DLg<՗a2HO6/7ֻ9"2%_eyfngD1I3@Sx$g9 0]66~ίfF(fu+k}_yE؅g \/4u2ҒFkpw+-?t _^%j#D\E]63Ot9h[Ɠ}kѫ'E @B"m=U\8;?y]اWp5ΎLƙmx.Q3$`HL1 '۸7Q"~ dsgH.3xϲ%PZYSc[y(Ԟ>ypc.o$l'ONPy邲3crx3{Oc ly/WS (@dڟR&V<0k퉞Vϰz߹k9gU0):A]ɿUu);yPY#I]_sW~akq{ -ߍLJFYϣ7C{,7gsGבynVmDud\]y`Z\7d@h+<̃g!6z垕u6_8)Rq2ZL%Y3 i5r'j&ί(-:J!?o4f&4R7Vo Q y)yPI42 ̻xEd|2_Yn畟VF&lI -fl6w5/^.DAdD!?[}2ie0!Z#I&cu}8S< w= (X{NzrٵVSg25F|kv -=Xxߏ׻zo]\%v"gA@,_A^tܫLybvūMu>7Z=䓮e:.Z\9vʌ-&mK8H -sXl2{_I}ڈH"j=EuUO2vۙ9PiǔՎh,#>#v0qLwc 9@VHw~1O vs2@+WVnj}4yewwi<[WHʓtqX'L;UWL7\dH:eؾW#El~ej}s5lD;Ni8?fdQ1[Jn?7?GߌD7ޑ?6l,w!==Ov 0v>g2?G|Ƴ7Km-*GՕ9% 13Sy %8ɵWap=<9_m59,'ؽ\n}vƏ DRy\f;g_:qOfw Vdr [C#*o13ߨ1]`6gFa9żZ̺JwZJ3*4F\U},8I>k=NMi?RλF;sC gm'y,7*>3F! nlgPO*A zS>P9OOkգpw+-=OY"CzR8l<7EƼn|Z~VxAW ֿ udew]k\}Uoů |sL ŝ+nUw{3j}F=wI]H5X|Ω<Kh8nָ5{9#9.=s_goyJU4^ d@KapWK@Y` r1ޙ[~|sgYɣq-Q} M~O=ͯlœzgCW1Yk07W]yJprh.kޅ]1~ Y.y~:%arxĸ?P9U45Ϝ*<ϋ:وg~JcJYD=N)[ܳxSlЈI%D_vsM&^^cMn~)֊eU_2%u̬5}OI& ī't=3U_/hzxnŦfߌD2}RuLwsGYaXA DͮhiTquxUwڜڋ/:=neГ3@9NhϋT _ :kS,es̵yibSfb5sW6f_`):|yQ@\okDK-%9䕻F}zۃ(8ˤBdlT͗Vn~zB|Gݢ`V=q[1C< j_8uLz# $EL3Zϗ#"0B N)G\:~ae8XEw%V׹7I>uesOͼQ7*ͳw5|'*\xɉWJN^zF}w (fӷ|_9_ -ZyZ+3#nkƔ됕ƉhȀIO#4Y}dq|'P -5/KE;q:u+:FE|%gfX}mW\0"k絿OXޓH. -/ter-uHk6;_a!4wx4?I4NC\|L.'X+r>{3 s>7I[KY#Qsߕ4ۋD_{Mzʅ|{\rmʕZw$NtC i|qdfzzbJXz2w"}k>{2-Ӣɛɀj'w&у1VJ8(x ^sUoX^Aǒ㮕qk{ɜ@,qG"cG{$y5pσ|FFfhTJ #}+|jLlА%zΚScJgO_)2w,lA9ܘ;1(5Uqɧ;2q>Y|g^ $j:m4&{=SJP Y_ @;מD6cM$*?%7,L.;oR{SO|S5cL4S?Ú]}P#) CȗV BYa9zdɡC4W3q57ϕYVAM*W2#^[7y݁tEJ4I5KH1@otRsq#jB̫rʣol5X1ցhU=7Y#&Lmgycc)_ssX :3qc澻uݸ <$˚SⓧjF=&eL]vl^B[ͼW5l[ *3_e4ާ1&)\N:UX` lά+Lg Ȱd]\tN%#2F}%RGvXF $u^]4$LvvŋHyuMۜĉF` rRygJ4bCWT8 n|/*m?/=1^rX4GCy͚[Yѷ9Uצy]Oͷq8GYdrbsz" k 812w9NOzsG;lS~(d.3E[V2<9O2>ۿWW$mu'7U'[Shc&b  R'w%o=Yi?;P頻{}aP"NJ'tH)ƬjB}#vܘ$\e*nJ~HDdW?ٗԪ[<3s7p&"ѷ4dRU7d.3~lӎֻBo֝^^Yv pr INdXup Ř4W#ڝ qld 7"L{܂} 1[fgHS]u=)w5Q{XʽF}5"*I8PTdM5ݍwP^^&5eTeھ G ECBr$Spb2P|\AUN8qXuP8BRBE£t~'U=*?a$̂z_\k*2L|/aMō ЯX+S(hޝj,lTQĀMفX -l^b{"D,e v fP2DBpPf+'q}u T5Ldj$nǓ*w"/f*%Sa/AIoMq"PD 8H`p↸RQ^-웃 aLe4,>4K QS1!FPU) U*_e焙Tya@+LL bA:(=9YMBzmzbT*͠Q8_=1Fb䦼ٌEhhh@_JKAT/* U@s+JXD {c(zڟ(}5wIKTsڇ>X]R[lR5|ia|NtzjނnԇJ®ZzWP<@]WK5ʣ. t` -M ^[Vrܨ -ʂ7wfJf=C $(^O*SD(' e* RTS~Ѓ$Ta\Bn -EK ! -,[+|.eֶ- T5C`0KCQ脥s}!"ӓ*,-\^huQTU,KդҕMMS .DNp*_bF##Z2T3R+Fu%X}PzjWzb-2Hفq<=r=ҮTY/P([Uqe&}.IլvjR@Gnq|TY[ E.+0C6g*TФNYKH(uCQ2qUFu52+77&}#e 0dʏXDl#U7S4`)ƳD䃛E"hX -u@5#'(e!|ʳ1U1#,MuukM ő5'銊#u]JlԕbuNe^~V]5F5Q?Y:p*w+E/ -$mӚnf}æh;RvLU4UTB ݤjVЁTԒ~BB@Cb"5TUKO E]MODP"%YM2x)iUc@8J-f(>*-|__& -k&o nX@1BB >BE}>XDTr*\xVXV 'Ԝ4k)VE*\ĶOv\Z_XMT51a$oT5 UEdļc=84Rͥu*ň뉽z.Ec(c[e  -»(yI7SS -F[ڰE/ -tE (5Yf(a5T[p@2nP^Ձ_o&JD1Y PNOYL5Qa(zk -;"cSrY CWʧ/b4U`HIzE*k,ZDd~?nT?g S;5vS_7WYl'[]NJOU妿cx۟NqɪfUNJFAQp}jUN~S73 jY]KgvbPI6Zա:BDLF>W.co6CP]H][L66FBa& }S Ga(&VúH(&TQW6RFAB>1 vrtbu^L+! -~BT)9eZYEBpt"hO>RB>uM&=5U%[=P@@pv+.Sj6 -~BHèF*ckYu:,GhFC?=Qua"OU[%L QES7}'0a:P~b͚m+}\,})W::nCqG ɺbغ\DDǹd+%}2F3i#I!Op15OF(Y{ j0tѦ}3hGr<4iQ_H5?M:khliAwp̶5؟rG:ș4LBZrHm3n(~|XDƁMj3ʯȀjC%cZ44itXx&l]1 J$*"S1r$`c¼6ma:iX#ENbnʮF NBp~Zh崇&Vٌl\/X.֬ a{-Yzzk?k@5i5elka.sgnn')4f[%֜3Gl3#Y\ -]Hf[?w8TFyiX - %r[$9䌫M{kN9!gP6 yMT>t6<<-n /z 68o,Y=J'AYc<#'!cA~hAkP.+4YA|T)ʐʞHvmhOE| >kEb 7ȼMh$O07x1aH;?m\Iظj۴O$у)($3ySIp)\Ld>v=L2#A mZ68 F<͟]fZg LIoLy bCG5途[@6(s 捴b<鈺ɴg Qcr3#JH@-+[SƸג㦱y #ٲX4)ϰAcZ, - uՐmբCI䡤{`Bϒtg8w`"сchAּ&? Cȁx~ܢy/M}s~2KrȺ%qޚң6^Z[.8o9¹ ⃳)BA G`:"w-'Odo&哹HWnlTdER.i7.tN璷B`*t}6yp&.uKИRlCW}=x;xKBt#^oo 0'L3KҫR*6$w,:HX@U>οaH{f7=Ɇgs.f.es.c؄jD9haxD2k_h=re_)w]zud]g.U|ހE:d .8m cqp# 5o&,a4qCX3: -7}$% :ݓAa:@z)<Yش]sCh>x}x!Yxb){dւti(u%e3J=J#^HgKMN$<ĝ3dߑ> ="]˝|0bk9QS(_4QahߔWp*`5>t*+.c[88-Ƈtdm)s -] Ag-)~VȖs'*%aC1jc{ -#𺔬 zp: u^0B;I3>NhAEO"K&Pa㨐±TtW!"k'^dA £[`:( 2LJH; ef`9@#֗I#mC{P+0v m"_yoySA>HVL]Ox#<;0?>b -恍VYd_d_@ćd,A!!37 XNZՎ0 -=. 2 zF!| )LR 6.~䦙GGza2;fPHְ"a=I$4W3xhg#+uh$r`mcCRG>]@6tG1?1O/k$31B -a|I HV3!nȦ#.~g0HgMFXx~h/t0S 4@>$ܵNZ2-lG]C-8/f}6 -aae|ݦiN:h>&֤]DNF dBl, h%MV?^^^_Ǣr'ھZޛvcu S*]_Тq2G_-KGw!4.٣a"`||8|(K!nQ2U0wP+x0O.,u &0a= -k#ԟDؔ!l5E1f"^8Zd}=Eknwl)5A=裂 TӫgĎ)W!QA9#56遮] ~!KC}3Gb\Yx`&03pt$(@6Ek?]ذv]f q! DDxovҠcަNu&r28 )1r9Px%46KƾG\:G |݊GjY6AB:i5t,-Aw"8 iѰF]E祀1gD,=g@~:ZMD]C:p"cqp֠c@XD[D8{#q+cl~doX7#}PdcA'ba]58|\Xx>&I/6~MiBe&2\1MoK_۟"^xaB]G:s&<l-6@1 -x,aL_6#'>$];tۦD}gitTd*FҎ/JՏ3{+nv%r -RV]Iخ1G9P%׍̶$ؼQH`M/' - 'M$:A:p|+ҟa1ۅ -1fF^>a-I-~0=Mk^vdl6ZCy$#.wFL/`z" 0U9yGekɫ|6#"k~gk_p -8 -s'0>[<{>'aOWHP/ aMV -2:FI̡_gR!؈9׽H7 ;,df2wwtyTXX:񗠴Q_FҾhl^3ͧcK_Bŷ0a_;Ag[Hֽ\N<0⛦]d«&QE'tO*gP9 7dIjԁuV_AVGԶO_1ΛXB[d\5LlO#.oYmCY}׷YV/mu7kB -u)lX>Fs^PKY¤]ߙaӛcgнd[x"yG|d2aa &ħnW!B䖯s?z8&~<ĉ袉Di]rϋMv[=֊)v=CO 8;xtXriȢ38dyWW=2gCC-U|}p,x6-1ʤFy>Qho7cp>5{g.HT\7..L'$\B|Oh63F;Twpif!kK4Ȧs)ͳ+&d.fSA6%P\僕lUl1@КGzk0^ȮQvhD\2Ʒa`Έ+RyeWZ5NyhLψuGk3l0[&.PMGW:|=u&uxF|xPK dީ%[?%jb]>bbL\*sօDͽo膮5D]2Il=bX1ƖOW]3ycqes#ypx #&q`bZ6]?j_v<⇀ 2G#69*U߶D;?cv͑״}'oyZ5{F`"=s5:wpM6lQ]1U{oUy[=MN NM]=Z͵m!ZB|Tkԁy~ -b 7Dn q48ޝ}B?GC"ASzo5({xнVVwՄNa*YGd욧@s&_«0cK҈6ܢ G 6da==ۻ}1S=# #ƌ٠đ?q#'d`b] -?`ۀ_cUSStι=q\a:|3e&Īج] [&docKوZ.Ќ mD=S2B*v*pp73't&fA»"{cnLS - -q[xa BxjCS^ið~G|Xmnl >O 7i>yhhȶ? rG)tȎ'jcDyj hȪʛWȫZ7v}8 |ooYAbaf.!nMj bK,7X>^/Zt -ľlb^8r >,=7GaBrw3ډ0j\.'{*}]|J>ae|C| Zc\"z`"佒c֜ RUVРw[~gdph䆀~*cƇ K"s'Skb?dx8|@.`m\ ȜI8q6-E@a)Gؿ[7#vaĽy=֓׿^N .a@bǫհNaa=T8V=p FX{-LƇ˙9d .-,$-YWHo6JV~^q3%_+a o@  +/f\4a_ r#ؘ)`3"ƅ*8+ozJ穹U khg&3Ri#!]"* ƃI08aMtֆb=A:B8b=EI)[q;sad>Uzp&Aғg;Qt -z.4)x p~`}2I;fEtԎ)r!dPh?o$ȧ窱ndŪu ,%$.#j .>,kgOׇ/Q%?4;WgUxY!ۆ}cqr9b&׵}Ooly;dFl`9ϐ Y5۷)8ߚ5ZO GO! -psYy C A\$6]Z7lyS"^,!%D8d.ۜѵ旲º2Sw5]zt،3|8$${, 1;*YJ7*:O>izmƶ<3'Z?\N̂5@_0L=:G^;;2S|Zl.g>> -Ȗ1y{1g 1iĄa F 4+:"G5 (B1SL,Hdd -t`6}hp:qiges;xye`ـ*s[˸kp -+C/3,=kB=^ 1!YDm{>n݅C}hk`sgYDM}܌j^GgDL̤к )KD_ a%!f [8޹AX|OrYa|v'&펰A&j^4=)`f -9S#st!1b:k|l ҆8 6> -Utp^986}<)p k@o`>y_WO2v/^! ̘2-a(B -;V|&Lba}왋s@E2ĔOka^Sy w>*8D1w6Z2r"蠢t -wU9\o;AF D_KaIJ,?2 ydUu[>}yk'ulbLLґ8}0.Km8T: -_ڀ8*pJes ]=ð݇9&=֨)C'1PaV4'Y8kmaro`"`? yMö=}̗H^|KM7 ! 3>M?X~N12ϣs3k#P|lFhD6=]-oy -|Ttvȳ_)}Aڀ|=fby݃o@a䋠>1{q, > !Ko6jMQ+Ε"Įa35Y\XD50ǁ" .\cQ5=a햄?8G5v0䢀Mf̩ߒ&ۢ˝C!+n([?ʿO5 B^XŐ "rQ /;I`S3CR%d=c>sH\CMBטƾO6B)*;f;qEW0fZ8pܑ_Kbk Ȋ<6"G+[ߒEq ;klgT?'dψ?8n<q~6RQ `+Fdc.eil LkA6{|i͆O&|l{˚:Q)3ZjwE͔i~l~}%d5#޷f8*džfv6K?.8@wwX!ӚgBcm!M4ZI4YNܖ8~V\2 -H'lxmLԴ} 8< ~)xJ잙\Cqwdۗd9G81G:aL*|y)/`ЊQDdD2nty/ɽXe迷!.}J@;l|YM4\Cm͝r/>~Fᨦ7ڤVx]EcFf@2>9gtU {{r;Vle |@XET5cD?3 wH1D؞nyj}j|{&!}\c2gy엦sO.I4X^xj3.}Ktdd-#y˕DcJk=e4wl"W|xvyo@N@!w֌m`C/֍~U=FZK?j'wۙ:b?nC蒱٣W[ȿ+/0jiy͟iw=,jo7ZfN^7fLJJY5]'mn{6:M%IGgަ/1cchtu#6aO-Ec AQ) 4mJ.O:6Ӣ53~WiG^IvZ'yJ=EC_ycw'Ŝ{DȒg>pܹ'ӏ[趴`ke3O/h_=̝d<&y6SRfH~8Gj sjKs>ϼʞ~̜~A-5O5ZNyaEzNQh>ْ8ђ>$OA樼uA.A2M ^˴ܢN(gDCr}t#] f!o|LvOɝ7{_oy3q9u>74q3O_|{ݏs9DJʑ^Y/eG"?I_,[_γ΃ۋ7mO|vvoZng /-v#g9>.غ-]|VOMK-wp\8{ϛ=Ɔ9N{~i6c[lߘ'RaCsFA~aS:Ͽ)e0c_n ެnyꃩ_j2r^w >JEtB@5t3b{˹s7/3=Orm_-vy~ #GV70Ņ_S^q]ϭ.؝~FVf+kűvz;9Q3fZnAzBnG7khu䁧V.[#7|6O,#OP0W0^Qg)i {s7Gg;oOĕ9?j#3C\bG}?ƿ>A}iG|+#[?m=^e5pIqǺ4lg\q3ȷ]wSڒݳ9t1g{1\N}a-? οW~qoQ^{Q_Sz|s9k -lqK~)x/cw3.UW͇[ܧYwU{S '# u9¥`_eUpb{AN'UR'Ym|e~>֭X!+gd]7lݧ rCmnCm\zjܹv~˶XeǻuHd6 LhE*l7B~W{O1ܗ[ܧ̗ә//Swrݞ{u7&ˮ,RҳX}W#onsof/2G=Ah<?9>9Z~[)o?m{nS7[g':nu>`~do>?oEٶ]Naouyys:} =N䏯r y_]yteo3̶h׷:X$wf?IVxߖǾLcwqo:g/íoIvgWSG:-rKWy/yፂ\^pM̻(ydDسN6*VQi9fGxѧ^*g^N/mܩgmhE!K_xݿ>zzfz˃5v׸:RB9a:~2{=ޖ̇~kZûeU{w7V< |TYYWؾgRݣ+=gz.1m]m9һ:L+l$$F}losڀ]yr3`wvZG8x+ ~. ~S 3yk9[I3@*tr5X&[oǖSVBww}rY.RCn"Z['y-xjS=Y-ϽĪm쯔Y[SJl޵2O;WOҶQ¿jˢnxʮ|>/ ٙ7uuYWXWJهw",cyC[{ٖK^|yʬGp?=a֏MWq]2sGjg w ?폒g6<,n{v]f5Oe;^Kz2]uھt27_99ZUZS(QBӖ:í3҃+$U~~żJV/sn-VkL13ٙw?`N@F]wJ|Z[_,\3ei޽gmq_jD^wOˇ=+y|)b--Jd%vyT-u]z^EYߙPQ0bo~km/C/}/c^_п%ѿ%9z^nSI\#kvnv>lKw{z&aI}ɽԚa Y̓Xp8]GoGSmL[QM؃WJO\) -yRt -Ň{o9>Z]ې8!yK9)dOO{No{>o 쮨(_8ҝA)5Q[6d)b]S6]amrRg7ތ/Fvx;YE]MEN={'oè_w;{]_J|Ssjl[EGƕW|ZLe}k̊7/ߌ,hE:мO]A9:u3eioί.#hGxInWrlY`>]-g{o[s֜d$F+%F+$K-Kɣ85jM_w-;E/1JFiť+Rvl`޽My} -W7\K~+t e*YwcK/ v3/B -wmEjR4~c ]?n8oYn*T2s; F_$c%:$H[J~-\|v芪OSvw。6^g2خ7ܛY/eWV]K.iXjB1ҋ%WJOތ.Vd᎛%HS㕘+ -ƗO}eyng꫽U? *9:EIhlH9,y0u$#%%%$-6z/M?Ze(z_m(ڰ]}V-@BYg3K/]N/)RRq%tK]/9w9آyfl1%D=ȪIg~z.K\Ӳ? /)[w6ny!9mz* 07CDiශ+aI~5N2q"durxn|F:ʑ{ߝtwEĒ+c -%ވ/A:9voO'ͭ%:g>{}?Q+kqLB3fhm ^6޶\eˡ %/Xvj~kg/~u* -GڶTҲ{]s7v~Vn8\^v9rꢅ+d Ȼ6JSØ%j⟏#sol{?Udd1!U1hEH#㷹!o>ZX{%f@^u%ν+[_7o49cnF]׃wǚp~!sNgi6ګ?߃UgcI6B2{<R\3sAjxWJ(3"V|gVb _,qrAC<xUQ;m=g˩˅-;~TʗIzFdnW~zyǘjOpL4CH\4L֥fGed[T<[zBQK;n]* {/6nlGhm3Mw_3?g<Ƽyj0*LT3P&Y *&xO21~2Ҙ&Dj@kl+@/h8_R.^yK n׵ʾp6&cOc_ًwazzNӳq͙WeG7Wd5ؠW z+9&/CSJd:.GzEPg!2ϵ ]{&hpdGmXi#x|r&:͎)mށcߋ]*¾Jv}wp;o>cd$ .? )0^V@5"D~?Uͱ/& q -2]&[68GK|7?)7U6Eyǵ.py.UAk͗?=w-ry"7Gh>?8j@S8! ;dfrGBdf-Ff3M,ַ}tEH͙3$ojkM87ki^҄V=] nm~U~WW96 u٦j։yO<:|AmL@T'#3mdfO^fќh]$~ yRd>FgSh4dꎦL"?[$jE x{r洽ANy; 'M)^?3xH6q,24C:)p2ղ"7퐹Z4mŠk3LB4˵M[,7YFԈTux1rr={j/6qbk/K{^(xjm*7=lG:sNӱ\Z#襎cT}ӰEN"i&X##7ykdeFKb5hf@#Sl#ڗ=Y{P9 qϔ&Vw-ݼpfN7w3~xYVϭ{9]7{j+X_Kra-*#o1wJ{8Ƹ'{oiᄚ=Ў7r1slzkrk['ǯm|\99eeղwoK~krA˗rGnf7Pz>RJ^*~O2=^[#,p^{pM = <}'u|5]1>Ó4wdj#Ds\B -"iZW;!庳x|(Q:[U`E"iS48XS0⹑sn'Kq~e跏OW}(yꛖ~OmۯG~7ߤHe=}8s(=kw[h٥ɰ)2IVf=Xf8~:V"4}~0E=2-ڄFh4g;@ VhU28W]u]Ce[eӯy_ﯗx\/}}J;PpSɈF!'ro5_W3>dn(;m}QR|w{%ϰZOإ*Tm8 LdnZz!{99hUlC5u_)y 7J8]@u4+~(LO3RRR2ukeW% ߸F-ZMJ-ex+{'O(W b^zu=IOׇ `, ?oe{lҙ9wCTS{4V->ʯ{Vz MRT|Ko75ܫm~<)=O(n)=O!$ɇ߳eܫ~f S@PA%c81 HvZ ̞?у?z2M}#k-X*Dz3M5gk GvAݪk_s̗P8_?(#|c_@IRR~7G0eVX-%pF%lzi+,9l){c'{ Ke+ǬD;,~b>ȉn.,ή`&ߺR50j|= yzZV`D.YE祍5 4q%2ԟh<_?Pr[wzG -'93^q}~GM+=اbשxiIAe a`&MA~_qkJRa") -P߼%, JȷRqٗag#i{>ŝ|Jޝ?M(}P3J'{tYK< qXHJܳ(|W*T&Wa-KKb?7tD+oO'=xx BBߊ +} -N~,ٻ@ɡySimFd5@ jD' z-ǫؽ(.:h!ffRře 5~sj ߔf]fG48M&Չƹ}zX^+y}eq F^b( -FV;o>a'Bӧ Ǚh5~(8wPo?\'l{X8JQ{ok: VvBHB㓴#7N -)}bG~rg?H|/>uT-ɩ2vϦ==g =nTn92G:'lkq䲷M  y5]wzdwOoUWgIQsdu#zE+Mܯ+ſ)3EUxJIySN$E*OloJcNIRZ y#(/lS6>b9Z9k>Z;o -pqF0<Ȕ<ФtW`/Q0uk5h뵒~Kjؚ9Jj%~\&ޞ~%nS*>[j${!].0WfCxD0߾]WiqI^77Um;m埐MC.G4M69_44#|Qh: 6Ϝז9TϖV ElF$IUT5L.+&Ì)h1`_(?{;62̷2ItљSwn>HŵkY̡bq3l fSKeS.Eާ=rN'L;6#eQrt' (4 BNܑ: -Iؽ/Bz੓$)_[(V ILj@zcJOq$UQX$8]]HoPuvtoZ:rd[g7\ -hfn1H6~F$wײ;{]x+]NJk̖ L^/}?Lz;"wl gR>83'_%kϡsꌩɢIŠC2vy+U=x_YNUHR[ E$\7-2\W!WW@t`JF8I[&J#b5h|Qė{#> IՒ3N,f|FxV*xtFIBSudd3 fRՇfS͒4][,(:qZg@Z6g15g.B/Ennn/y؆c@0C|H&h0A/У Za*BZ/ϜAJ,ad> \~=H?Ǟ˘ ݩ=?yBOq!_XgFWf|ȟ~.>7OQ9Ia[w}ӄ9B>IG" MW6dk:,GF u~o0"A^eZ஁$ -(`a7A?;gC)S&SRt/5]-ÔЋgӪ IO^n4~ -VK5YL7^Ȕ O+z:]s+5ejf(8S nsbhꉃ35@gs `hb*\=NЧɖx@z>tJgG Ӈ X/\M5a៝Źݦ┆ /N.`t$Q!et^ uվh ۥi$J"pmXK'fiՁAI4^4Fc]WEZ,*c|PT WGeh) -g#@ 16Sb Zr{m@O,w_z*y, }#$^zzvkxc'vˠ58;2Or7]>F&9;;/5PiTwkv#.3q6#gdyC֗X?#VD͏DM.d2_{R#k\b_fI7^n?no{woq:cL`mYlV)I6͌hl`:ŋwMc̈df$:!KN(!z;ې q5ρ>|Ш҄>i*嫿XH'R* Lpy0_߻vq?Kz S t54W s {9'ޙ|Н!iju?uoITnI2Zj3ڑbkqjF6 n*:Kmڔ\4|-MFc؜Mꢰx5`vНM i<zD㺠h-m+ёi9mY#z ny2;3{~:{/Kzx6;X ->m{h:$ezua}1oLIj!.l BoCt#&<ƈq|RDzdU:kQbЅaB&&:x[g60 X\W&3=L``LmLv UmLvCfS_K'8!*We3ꍡxL tg*a:=ŀ\^`3Z24\_'dGɹP#f4 }6lyh=M痂 Ah\'Ꮮ`΀|]j75pwq-50؊3FAC -'dC$&o<]8<m'nˑ90 -KwLqb tLb82UӗCl -=tH:hɰD?{5R[fCVJ9T%)l*Kё'Τ <&zxOG7XrU";x|1HX(5d {qwk$_m(,DD޸&M'7JtG,OP -° ClX&hO_ Fbu@+ -%fRAܖv[zF Wr1ҁ~~s9X'G5h38lb1Zg(P\-o qjqh:hSF v8>"6JC&3'K4q pt c p`-!1Ҋ&+@ 8Wzu89idZw-"Q5ƠcZGk/@XSm< .s2tr$8Z -62+ٴVc4N5žPa#3A asԊ  8Ǒ̳ Dgb(BѡI/u _oL,a㲵`LǨAEl1`ƉSāV~n)Wk&ׁn"{ۉk8hm/ ¦3_dUm`J/A,|_}}zPÃ+}5& &fUYm&P#ITV!9+:$ -Oռq%Ĺ4!ф-&7O~)ha)b:Jݨg3U&r|3l.,F}˟|D xHAo9:eO֧h EW 8QT_$2u8iU]L«P1u>XjD6ϥsvta[ˌsh64QU[$9h \b4Amc|<]Yuݑ -hnv~9`J=*N =;9 l -_Kংf*`ĕH7i+Km M1B.TڐIXB%V2}Q0O_z$ֻhȚf-Dpnt`uqq&0 --els6_zvJ{yM]!3mW=7r:uj0GМw?s M:yy"&TP(W"34Xi<~r`;.g0$VN7dɤN>Sa -Q 恶{oJѕtr$?gކ0'R/9$V㹡k/@ ]% //ZcN0!wHɐU-o%kQ!4<\.]3)ƶ^u`/.քZmWҽ7VA^Po.+yuHw\v'd6KBc l 鶡d0Co}IxLd˴٘mƍ#'# x./uLM[^wF\mړ 6Lٮ8%zzĤarCoaIA)F~2[΂&ox$~`H%VQ35l7z:(` t|5uP":"Nڐiۜh nB4ij \ ]y`a̓~" H}MY8fPv`gIᄝ%vd{WVEr1vV)aMJ)Lg?YGn|37bx8U -`sdj\; iiQ4xO\T=n| QXU1B- 3| A5vu]]'h<2]OGt;ozȏ= |._90d4:ސ+[_kᢈMu⺼[AIx&,RU, '^ \$«tx4Mz1hKw?'R|mdgU; wzV Ќg;-ȥ;KNw^!Y\"z"+rzJ)gp<#: - +c -a(fUR^d Zl Ju}ם]p ƞg `lrցA#>!;}*?u$x! MY i4IT&IH6lm5ܬ*TE@HVך\>w -?`5LH$EN ucbO+5Yxm0?q./ql |%݋ĜLE;;k:AL(PǗHUO,-yt4b8>2su^YA%O6!S =]k˵ѧTiy ̓5n;h+:00J;1zX+-n.֐ |33䤰(ז*-ol: -KP','3Isׅk) J7m7{泪W,%Cm쬢1v_TM/Xc9\yQT3dn}d|X8Jf|>ҞM}k4]pw_p *;O]c{&,-g3y @Gر#DZ/[w'+) U Ha=;@,C`..\O(  ?RgU(JvL:m -q lYa{ -f}5[y`g^I.HYC ",oMUFԢA:zh5 i<> D`su:4Dg -;pr*&|­]3Qg-P\:>Grֈ"BhAmb}ts! w ;Φ:.v~ӑrہ sQn¦޺OvV;K쬄?Y㘠h5ŵ ;>%{r`l4y>;( j\*_}l>yS%c:ǻg>Yqf͗ï}%=OV -R4~@FꄸM05?o)Ѹ& Xo1uD?Ppp䴚q5^}=$[ fӰ?7U/+ql>2|Fa~+jSg~3? -񿳳`gmRvҺvbI -wmýRyVdYA%3RߚY͓{UG+q4DxM8߼^3!V=L׵t'ka?2=Vp^\KAK=*..lAiFlXbC6,!p-;Ɨcg1u-tY A0 tqt *h,X_+m%9`++nN{a}|i×v ])MՅb0aD^m6X:Ҏpc:w!vHUsl|yfhuok?mv?p5rXu6Msl!a+ ->k@rה-bcl$(\b'A?׃EP6l<\[y<m;4_ ý9s )yP"=?8@.qL5HgHkU`SpCc(ya ׄ}' `F!lӱ|e -か"b&h6y d}C?1RpKz'=}&!GK1 _.ۮv|1# Ys+3-k9KY -*l;x7mbYo1_nIrM0zڎ];/NX󥃳dsW-sI)3P~C6\3{ǝYCU{l>'Y剅63&2N?4dѐNTk,RkT]w\[˷\vpPe1JckPm!al3\Plی֍G$#lmyn-=&dhȚ{˄\m>)_0€$>8g{|N}e簭aMDZ?Y-QZ-YM\//'j@gTM" f<68n }±׊מFXӐ~$U}w\xuGp0jp +% b.#u[a_wb 㒮PK"35%8g;L&-ʼn>h6:W'GK!|rTӀkKם{Vyk`'J -pMrK2g˫>'c M* -k|}rz|t!Mz}/I Uk;}l1uc ycl˞9i[󑜵\_>@Zj ,2zSWr IclIU灟\JQb@).+rOwr">Yz^,S~aB|^YaCAp8$1{f s\,|BaP&*{o{~ @֭w^6_s[9`% q֮ >ܛPb,>{2`-8ElF (h2*pNpoܠsZ)7b{یx/V kprFir>ab 97yi>#-ߟ\.a`rį+s -I)rt`or90?X[j u6d˫;d Vt5Q/',.zjUl~qw -ɝTXDQ j VAL86k;3M_!W:`EooCu_s/Z/A/*|L6.CKe,‡=${fp +ԑeP -,mr;=0l\p 𦤉:r}iZ_ԏ}TY57_Z+Bb -A Իp!OY.>S605uO<|| y启O Aس%+0}biz !$Mdӷ8fL<^O2MLx°_10eh7WV/!WX3y(qn1S -XΎ4 _"lg>l@˘/8BNt|ůϓĀ -aXurrDg|}tL:ηa/mn[g>]V1IMmGf~W& "9]SI\>lK=3V춦OW˦7C>G tpD[Q  }V77s_v&*MC c7 8=8%؃ }y}|t|:>Oǧt|:>Oǧt|:>Oǧt|:>Oǧt|:>Oǧc,p=Ko (dcJD^ެE)na) !V-ߏvr ɈHZd4jA s_]p"QDH؋Z[ 7a!c -?(x +-$oڸ^?Mm*>>$."܊| -j\V'z%V?6?ـfdT*~_gkod/~+ǾW}~??<4vi=c#>%gu멷-"5:,՟bV7{pXpb{{+pvgOxVZwd%RvVf"lnɊz7]?*B&J| -Q  SDxM||H$Y"ӄIId$2[S!%; к^ۃCtJ"I5@"7@!D&WEl IT -%J /E#%KQD(ǯ!FG -T U MFgVO $E~T͇Y[=ԤWfcB1eNyq4]J:4I] -֠ Zgb4>.GhZ ZD<7}*u=M5%d7U C"25УL+T(i*V=ЇE$k%o3:z&L4i@ӋւKdKU| - 12eٵi(Va6iV9ݳзLj@4r,EsSMelJ-~QgDǫ,K48rZȾrSj@ "N(؏O;tPޢP -ܠ,TBT|2Nbub>KU,S5_~UЉeKrmIhh @U$ j FЏn5 KR瑋ClH&_3KfƕJU`>*RԼyo -h#qP:#OTg"5euqyMerIL`/~Ʋ^+FU#ʨ0bӴ4M)KA"BtAZwN[caӵGhu1i`Afl=yr<4B}Р`B6j!AjLXљfsu?Sb}|J42Gh7C,Ƙfo/ۃmWg#4@CBm#zKk,5q:lB69F7[ )Ft/GVC_$;=$x,=^l[?.>[d q'rƓF"c5s.HGGz8`D oTu&cXS!7(c(ՈMDa*BJ@迲㠟+M?x!D]f|ͥ6qQZby йfiLLcڠ_ $6&ctCD&a?.P#K>I\e(֑dhAo"Ƅ މLM岷3{<>ڄǁWR* h6N"49z'z["/k#vb|޹2 s<zusd3bc2C;،<zaI?3BuS7UFrir9x-cUCzQI]%C`Jwͬ~AkoV7Mi=oNBR.akz$ь\7 xl6NK}sL -'X%V{3>AӀ9Й ?M( mыF~ -$OÒ5$HU?D *}fI5:"Nz}Ȇ25<-Ʌ z`ctp܂+'Ps/DWZmEҔC vD,VU -}8QTp:}]U{#d1ڠ M.K Z(+ﱆ>h`[| O<*t~?OҶAE٤,l,/&+K(m%:|l>E-F&j>0< 7^WIҍ|F$!f0 fC/B"?DK`QpN0UZudm8  !;y;,AzX$%וa7-;gֳl,yv%e -s zR}У'=廱T&S+L< TkA -I㷞 #?zUqaC62A)\h&4"%Vz!Agt@Ar2]+4M0^j -TD_ ZVseGl\X})5s2:tj"Uc#TVlp-q‰@l:eqy:w GXs6 bϠ5c~nZ BQB|Tf)r;Cɒ:d,ˆ)aEo23 s(ٌtUFg -I_$0/AaހCtNIt@!^Ȃ6=m@4#6 Z"gMm,賄Uҏm (@4\4Ұ/ۗ~Дecl4]r {|b+H6ZmH4{)EzԆL} =xaLzA,X4h| x/p|_\Uۺ6>-vw' Ұ֚ -;FB>xswZlswcqϔsx- 7ރ\Fx=nl*[<5z?Z5cCneOLA6YʉngsX.N?_ZqD Gm\ե 0FeAS +ErĦtb/{E,'GAV4#YφpហuXqϳbmQ0^|½AW&3g&#,| -\4!- ч=@Wq\74F{yFlj -Z1tо>Wb@우p, 6raF9/{-*a/KӠ$@&EF|1Zq, Qqx/c6`MHM~ \zf-=Bn,ǀ7Ħx?=&ڢMR*:h1:19?8|t[hй~kSbX t!,MW _. Xd5u@źX|}p,87 @蕽 qU7;ִ{ \ ^蟻r"[ ~16B9n=@-|85i1]|j{+hPӠw-:K"Si%QM]4OD5b Y_*q\Qb -xƀ<5kL]13X;[Xy3oKՏx{y_^fhΟu9Q<(rKR$/DS| endstream endobj 37 0 obj <>stream -R>hf 4X?q#+3,Υ;F@\ G?ǿ+bGvx4XxMBsQaLv6cBB ScZO91&cnN+D#EznYj60y~Y߇ɘC5Uxp7f9J7ʙЛvllSDѤAWfz(؀'Ϝ=ÂGMGhm}|4wi4 IgpxBp"1GV0p K"'뱟gt|2UOk8 zok` | -`JWOBhp|^QЗ4{3vy5k8zX"(@;{ý.ɕXrac1@s <):ťd?x{,)GAGtH=(λDJ(VcB c߃_=&܆=&P(nV=7w>hA_Kqܝ yWɔ%:K} -=PWx9>|e7"R -V `;V-WT3_>xz<PLu8/_}:m*[hNmm}qpiOGi=&4iB["vc5O<k{%:➵@ab_y0':+f&vc -zyX4h6^GuWuTl]۰"B+e($/کGgt;'ύd\cva ğa!+:+>K;}([DŽ˰DŽ_=&MD'e0ޅ5aT=lt.N36b+΃^M*uP"K .5oÜ/0t`sSYˡ\/xXY)kWK:\Oԅ< uU=BYEP7 ؓx=p'\=,>~F1||A-GKõSՙmbTp:`&^N@&c;5DpZV?=&.`[A_|kh>QaM}< xH >5R|)xֶ=K!WA<za;) -0/ -)bϤŠ,yѪ'ڢ ^U8ƕ+J+y䪃lTv Lv&h:C}TߜUÚ_ /eQf%JRX㡎;Mt߼Wx) AZ/q ;ek϶}o8xo0VtB^ab -RBT(B+ k7"LhCmd.9*d|/L9C̥lL^6Z 8m%XF)J;dwhIKn -逧khy2d:yo2AMG0F# Pa@e15!Ћ"=M>-J|z\]yi_|)D*-x?فoϵ^U2pxxLqzHHr%m?w4 p@}\㸇<5+ފ$FUSom;x/=~ӡl`*zEr3R&SeK-;(ɨ^$ -vbOH(Z}# -ab f"d o4Qe_s=mD|T^g|30\ =/[B1>1!z|$?K\RX&W+u(Ú OO^Z*ZxABkZ뱕Jfu:h&^= -ziPGݪ:+yTsAJ-}:8;%.mv:M]A̓د'By R#Ijf9?W,r aT웷F✱քb_7X4W r[MDG__* -~ns{ C?k?C־}iB!:$N(cx9XyOk􄄱%ZJ5*,f `JGS@@m| z; p5iI'7)EwW<`^X s}^ -W.䞸ЁOvOum*%?;O#qc ?B.BBy1b🦬"gRa{ahY`Lj9(QzaE=c2pDu+Џޫ{%pS|B=S#^Fuaz4 -֩`}ֆG{n -x_9Ax u9p}GC5XrpF8恗j%. ľW^S|E䒾 LOƗo.#ga#3ߊCA߻ȨMoTg'CV=X >{ax^Ff=k pW26/ ߇x)wFÁ"|XR-L/pIYJDX9KATp>m>g]'x)YNz~ 7x+Rn|# w Bq}haoŇ80o/w-YZ=>&_BB-s1 )ʽx-zX!^2 Q\fa=u ;|d(&qĸ+d$ZRx1p:sa31GV5bL|p=@B~6)R}|MNO>O؋W;Z*l? n茶dV -B Ytg2b0&ܗFs8JX+~ owAn؆=`7 -nӀ8tdV:WCXKx!`er"]|zY)K^lgĆex>?7/(}µ}3 I|='^ O79;zK|ó3&8'Y_r=aS0!0 z>ʱao.2 9})lp{9j*>g؃t=Qh1G%/? N,[kKcK웷 /ڎ1+00y|}r`}aT/q^pN ^ו7 ->=qetx 25!XwGBP=R*1/u; EA6@? >h; yCy:TP; -cZ!;p:$hVdd.߅ u/IE5mtf!*i/!J܃jvðVy<-5Gs po&}*r7흹{G@Qށ'LZ*W -#aeBl/GdlgחЩD-:෎\pX< ׫ -wUqX옾a/!=ɐsxc -Ō*2 -]ֱre4>i6풳(B^tٯ˿UUCz͐*x`kȬOAUv_UuQUgc1Lzv%UtCgٔf8Rt84N-bK߱eLC+ڽП2ڽ%9'l{m&֯$wu8繴VE_=PqhlhvD*xC@&!7 -03ۿ {{1mlQ)wrWqUE)dPD?_4>?mxDQǓרJ1)-QJ?]$+]mDIj"+&,1:9-s0 ֎:GFss`6!i1a~z'Ee Q{JN{aȻ_u NgD[Œ#FEN5AJ^2GJsLcn5aF& -;!6u(*!QF(AcPKjQ5 2"?g }_٣CԦn}ԡ|cHg}(ԋՇ㢼âvP¼Faaa̓3WAW]g-xLPw#WR\^mgEoHVKk:L 876`+\W>?J6u@ER#6CwH𴄵Pb+Jsѽ^CanT|S$n$iaZ(Wd}, -:t;% +EyH6Qz(ګ,KCQ#y-߁noYэ"* :~Ɏ1@Q{?iWcQwEICb‚ޓF˦sm:#㼊Ӈ_X?*߯Y_T׻Ҽ>? tQҗ^߮>jxV -|NTe!2;m8Jf(xEH}2f*z%ޒw> -;{c=A&w#3>هbq^1{e۵.aVQ1o -36c@_:_5ɻu[$'PT~.z}kVtge_`Q/L^z'Bf)n4x&j -r:Δj|ia^r>iСF^k8#\ -UuWvI$ŕL_׫1Ao}W'o̐Oi~oʂoECҬ6^IiqaywnFeu$[DNUOQc4&.@WC>Ÿ́$.@=2F:*~;u&zdj4\[uTrPn1C>y/%6SQaYq~ǝ&:A/T\Ue'uT{|7t ۪|xac29^Sd;(֔h ۣ=':nHG_F1Mּװ%[2ٽZoo w4lH;4لTԵ ]%U'Yn "m r%y/*4*؜Q^\Y*i+:.pi -IjkrάqȮsY7ҫ7owƘ>egƒgM$/%ŵϚNZiFc/fv{n͉?z5ټZ[ɒZ_oAݏdOu95mW?mxCiԑ(S})@8Ey-zP'3)_U׺i7ZXuQ(nd߻KCğ*CϝҁP۞w>=)*;%my% 6xZz5Qc܍;s+ں-<&=^}DIuhQUȫfb::Y]x.w.Q.QɕQ1OAzP?l,?( 13*+u3j* 0, id*QQIqEq/H=Rj#RK"f5;׾1OD–fWSJP.,6/ m >қePShޖ,xv5Wq> 8/u}Vu1"=dgNcSZ[sEXqZ\Vo%zd%Qzŵ_oo[eHsMHlR{_"55s'X[^e+));$:7jpI ~t[ݹlS[}H&/mo:W:߫ /i -Mmr>{7Ew y߹KONFOjcc"3K##-#5Dl͎~(2}!,y im>uZ5i)<גz5;1^D,Zӛ5*VxvIN̠uXXk W^qZY߶=Yk4]!inr&?DT_YؐfظZ(Ӟ[qt9CXkhsBL r ~p{勣N'֎lYS8".m19v/ѡ62%+15֦96U[/llvf:mE .sMIN56ձ 7ܢq -jC9yt2̤(ڴ'7bkR_os]X⩎+tW0޼q[ccc]c=Z}vT7[^=g[jڥ;[+(gF)~FkuW_LZk{7K\#4嬲jࡖKQr{_Nm;gyV&ǘ!Ol#rl#Z=Ua;"\R36kT ѕ73X^gVwڭBtZ?ur>mӳ%"W #r|b1 -c.#b;u4||b1b1Uf.1{1rBazbĪU6}swլC/=:5P%;"|ܨmD7aoJ -mCuOt.OtNHzskD+1aB= ~L5Ե\nlPMUV242g]PJL&cQH9 -],Ay$ze"Fdk/V7=;a[DDsȈBBW"cҋ<"G+p|QWK]47:G<(q|Sn]~~n!r-:U+B[p O+Dq8?tV2*`l&tW w`1f4u21Zf2i1{Zb#A9 C#QGfmc # -2߸EfuD9&,!Խ*0Ó8GŎw:EĖzDudE -mgoulyo;w`[i -gk4:C~(⦣j|uz#'xBsqSo,՛jA8SYhUZ%%=isԓט'%Nq:EDt~U'¥*$&':+* -JNIQ+nʦ62o'fL18s28#q4z {p^>':ML'Xnjn&ȩ{䔸Fjˌ>lޔ x%^>M]d􉎜x=sx%uVX*$%֤?7 1 #kp?ΌGwhcqhG-&q7c+1_n+1g~b2Ub}b>1g>!?OH!i{&)6߿p {qKw"͢bJ#Όq޽s/v,.qD;,HfɖݨN XFsblbĜiyI;ÌZD[Lz,yUbC hbc$n?wԤԀg~e_%&!}c`}@m`}b]c`Rd6՘OmO8\` 7 ;=7a1gjB~zWr֡3}/!?c/1s~|mW󗈉N4}G -Ꙧ˭QLs7 8tUlDc7aʛ[yrIb3b~+b LřXhM,P!~Q%V‰2|ڧ(=V pDž=ŎK -C=Ny#9 -8CPOes|l v)nٜ9Z>c-zDlKQ_"rsE K܈ (/$ -MENK9KuÉE:2;<'-Vi>-|q6-(U@U\ѵ8=-_c6~6>1-Gu" c\2ǡњL4s1SB~&"~Q&)hP",TAB(gy9{ys 䕈+hbJUb p<&:$=P?GmҶm4I6O%q10˙ 2Gyb(8siK>x1r_H}׹ϸ's+&m;{r|+)qss/%5GNX1p"oZGV9%սs#ث89~rO@c'"֩[+)kbi(>o:77 ?jgm~4Nvv1ݫ&x̭;PU-Q -lSVsZ@ipBwRmL8`lCch}BCz-B*@\EKVRYV"+,'Bl[̮@1O5@5 iOdn[#v>js>m3c?ی!_9#ޏ7^NxȿlvdJԽ?eDϿn+H2>q qa9[(egu!0Ӧ]fhd)b5A=dIwX"VU%VT#nI;/<˦d/VT48>ΘѴf+o߬jq졬j&պm)8W ϲZ#}ϢMz^F>vVwDP$VXUn^4h#.e!m'm1 6&v.ʞs*q䮰j?8>7t^3[?QkJwNO3IrGO=:=ѡZǩ.4ݜ?w;]]f7u݉Мly'QW_`bB_l4R>~ڧmjڃy1/;z;NӷsNC9J7wN|ۭ\mQTu[ׇGT8VF8^BEŞKnCn -NM3p?j/trJf2[vjD?b1eȐk:Q[θ_ۘM:ȄU`70y-qKIoE^9lC5)c'/B:]mc\by^8V% ؂W '],?puo -ӯD9MF0KUңƄoS{T7[XRTr jWMh(wQ;V)+zMu,]v{gR6vU'3e]G ^﫝NQ?g~z8Uk?\wAa.y -Uv3.zMt˚?g=$1k1c,ܨG(;MUmj~GWj7'k1);48EIЧ)(xLMA%UBmBWQ2fY!皽*lPOBA'c˷y+i߻+{+D魚&Y56|7k4 oҺu{U$9Cߕ)[ȧCaK{/g.vj\ΙwPߴiVt]|cT y~FJJMعl B2a$6=rq-JmgSI{`q#s>{ - rз`_75^LAԍk6Q6Iqm,~jƠ63K }J/w~;co׾mU+vprb!NG~i J9V/zsiᳲĮ ;vzuhD0c:DX@|ҖK䙳Y=dr>7v#@P_yp OEXpbmtR#JW)}֖3秴=o,-æ /xEOjOgW;EBD6G2Us&Yr U%tM.E=vsCWӤO( ,<Σ$xڠaxTuKU AF"92d:h:?6³lNY1Q^DpФ; :2iCSjdՂGkߴ $uvqht4ns[tjRT#%,bTU-o -uHB+iJk{ʨ{_"DRYs\S_[I\C3mEދ>(?* "J7gO\SIRzGg]lyfb5a.2_sw~JV?T U4+ߨ1]]˖pzU~=sfg|E P[bflf .L}cJb6w DZ,hI.-v2*GCtN$|P/d[|:_ {vZbRv(!<]P! DugɇyTY׾~ْv aA)|'ӖIRIk͕|NOտV1O Bѽ4 S<]+؎]OQޭBTAV2]phfn1s|Lq-´CTj f?v4 k$^J=qO_zw1)~aZEsfWQf.|-byuP~%䧶Nա?2:ʬ($!Bp N@TOUbąw ;tC7hh>g{wg538c/5F5tH%U3״WLfv.0ӫ^)܌\n'4'wspᩙ=bf]Wq~t]Fx}tcފ'es {l̕Y{<ˠ+IBn4bۋ͆ ]|.n 7b7ySibr8>z,?w:m9N߼~4 -h'}mw77Sg..ok-~nO|}gnpUyzU}V/yS+oŷݽ kh߭qټ_sPh9KmD4sl4siW]K+0g8z}`oE_V/kDc%i_4Fo*FxK/׵>Xw7ϼn6p.7sOpO짵^}aP?;qwxpVx{WA? -,&n -" -lp}u :#1|fF#P;# c- -س[NC,ȶ -G =,_` BjGV_]u~E~K8x;/~}GOO:i軟o7Z=Nřoߌl6~L-x|Jh}tPqi~._vA70+O͚+5˜fk6]ٲrfϞ==Ylcq4]4ݽ5Gh¿`FZsN|dNﯗz{_@ɵ*犧{W`b)e -43_kO ՗pg/n{LhW7ktp7ssB}ݥ=luLL+o9]h}(ْuІeXoZAb|͖u4v`~S#j酆O]/:jF!fNdCE.9RfYM[NՕ{g:Q`OŋI42?"]cV 7 ŧfe]S7\9,ZTK.;hRGpH1kXvu!w/hbW9-s#slЎ ѷ?D3uo-w} ,=>5oߏr5"a6khOE9Q0F7M7o;u'ۅ|.?vA LghN:--whgNKܵCu&͞-]j5:^SAǤjC,$$+>I>u5&5LPCRF(R!$Ƙ;[lZO೚'eóާۅ;s*O/ E9X'\x =]ۿ -GϢ[g~ ?)s'quōfI_Xx.a,]اku%Wf듛ǹxj6,_qv@'X_:1Ȝ4?ISHTK7ņ˄oqwIct;y:xsX{c9~ɿ Cm*9IE炵;'"N9͓IS'Ճ,/)f7O&-|t ]`Gz;o-?kr!#5`U֘ޞT~m\r>`h|;)s*֋_wi7ۤXlҰN~OzuPR/ R "Լs?.z;77VsY=WӧW2br&̏Cڑ:C\Z8l>YÅt':UsCHcҾЦ -fk9AJnt5Ed&Xj,o@JR;OҸ QfB]ﳭl=nJlp#qwp+>^a<_~VaBp;ETObkwp.x ;4ȊQBġܠ/Lї]O<\uېnd|1ec+!i4UxctaC!cΟ]7 ͸'pEf!k,/D+ RjqlĚBbP7V, nq@(s1 \o.\7;!w VQ5sZ>x!1p44\?SK__P#@38P,rjhπ ³:?g7_z^nL\()m:n=bѹ9Z5@bl(44,O>$k}xH> wJxzhnߧ9#kD+}tġ$Dځ}B!^hCCص!hqВI?{piғ岾yr%R~aw*bO=p/}$=u#= -v+c |QuVz|M,׳D].Іٺdƍt[8xĆhsC^ohĀkhON /V%Sۆ|.տtTZ[#\V?6 E@^d9e;+ĺq>jr=YպCQ玔C#Kf>3Nd.Qdj$}H,% t +9h 8dbN@J-.#>8,^a.&к4c} ,xw .Zp~&n#4YԷ(&pR"}D 318ub2O,I i]`$]0|Ig#g:brOoY)`b!GfؠO-Ln-$TBGp)0Q*M/t)5\_Ew5 vzл'z'}#iC6kTZrO^FcN5!e&nМuė%gM{s֓‹츰\%ʜ N"p-ܼ$VlNiz^r2g -Uc-U'9u`S@lЧbQ-$u? -fMq_n&[ oMھ Sֆ rr}4]=Hvw8N`2͡wé|Zޤ1JIHSCvɵo] VO|Ilt k5|+8 ja,p Boh:HO8R?aIJ%C 'X܅OCml[?-Еn,۞nnV8jgAHn1O3;S)_~wr>C'{BTR23@XN9G˝{q7>{Uz@?J~ CNj]r67PNrx`uHO/LL6q7/ѷ@zBqLqO}j>ԎOlpb*é^˶=[vh'Ʌ-0N5buVAV`T7-ґشlZ}?(y)Ё,uPSmg^߅_+-:AK c9*@'],DKQVYǦs:9ǧy8K~fcD܄7ZdyʉH-mĀ+9uNS{6[ӆ_JwW7 }OHgk- /8u?l;=H|F<ΘPxj;Ef c"ِ3j?9s*i=٭z5/YQhhl+ĞĶ{>gA'=%/vz^ƴR+{ګ.CoߡG`/&0[Kˠu'CܫˋF\.tj]V%64Nf?t$avCב1*/4T^]i,/%TUb(-Ŏ;תI zG8~ggq'X^vo@T!s!~"4PY'C,BXxc冏7]}+-ww;~lr0|H!6{_X{rt+o۟EC]y7iqu5 Qz>BZܨ)`5jhQ:pXn_b/:g޹ ^G$YD?5K==% Wf5¶tR9|^c37Rz)̇77e*=r|#4.P`׫Zvc9tԱ8ɡ_048\g|}ycgk9|ǫm|ǫ+;P,xpnp[wke7_wkP -1|,sا:>{_mf^WC^ 1Bp"qb+ǂ;1 B3lrX.7yO9X >q;w}7c:\` H[V/EXpsq  v`$k4msGѡ2H*783ƮBlb Mrwk-nlp>w>۟}^tq1q' DZ~>3o߁uRw{Eb6q2Z7;Kv_w>r%;XĶ϶K7ϰ,=r׋=dlkHs=-ȧxORH1|yC=r+Wp>\'1Xujxsp/tuW(tk .jV"$W;A\|qYEھfgU\{54hY%FiY|p^K梁.CR@E#0k#XH|h.4|&hzH-.^oFɅr%hq\: 92 3Eɡ&-nL:`>C2h<{#lL}Tb|sFFgؙY 'JI`g5^$ n!ɶ&EzYA#]3[k,X-q[C1 KCnth2/dU -#gpgLf5[f\2poo]wT7>Cw;םzto+1 M5}7Sl>,mPn'w̋3ӃVpz\Frz?4kg*f'a=R8XIEc՜醤: kB=cy2{y5'vNRY!&zy5{,#>RGBm )6JP98u$|4Xħn6OSmwt0~H>yr}M76(5)u0go+X( 9)zJhms#*읅~ { GGsіrb1bkvV]r襼fg!* `rzxe`gY&v~/r`5.4#Uȁs 3g4٘Y;Ir@bo&L롷Gu͆61k4nߒӋ }X C?{AGX,v V9:0]+u5^rAP;S5`bKguB.)Gxk4<baH`,l:rb"[`K΃=f&5Y}:@N!Ʃ`+Y!Yp|TW^]BO05X^b9kD,4aJFd؇kS?z軞m r=QQ08h<Ƀ2G{<9x\NrB~.zNs,<1Y -=\7qd|x!XW-ß2j98o?w^ v4#Rltgg%uvRws_2F7{o{Ij饾s}oMxIf8. iكW@lIrZ-˽NE[?*w+t|oyo= e񹤆wVCKղ+K%U{MM*'DXmY6Mjl+r0ղ&%;v{ AF}@,Q|pmH?5; %0T=O:LͫJ=Y=DixwR+Q8+5!YCfb@!!v'Rͅ%jWI{3GKq%![wg~XA.8fA156OC/#Ծ m ƷWC`H=6`٭w|[?WV(VMSġb1yj`! & -<,@s'`þ0cf07uCĦ+cmB}EGll E/w>cN}?@ ā.))=}!:RBûփe8T vXsvf>Rv4hY sY`U쳤}&y*0co[߈AV -)d~‰k:KgE=5_44OmN:Fb%x1`\(uunϪ<;p>{R˯/76O#KP<QoNwb5Wʭny_-%dk|<pP[CRnߞ{ĒI\g7̶ #A_r0fZ݅O\483&g?9Ge+BF fKJ% {TL>r0ħQzg-2+Q'YMs.#^Pj%1P ) PmV!' ng]{MeLw{R4ԋ_bσ]o^+kE) yXd(' ;Kl궼irU7~ZY/&N+M)>gJY6oc]-c=3`T C]9@Ll&6,Գ<?pC.@ )F*V<ܡ{:n;칫חӹɔG:럄_p`}.V=Yٽd]y8&dTͧf%af.y}n~`z1\eN5Bp\‰?C_Փ#tXw)s%bUX|#`ќeыC"TZ!V]^^>beb-QR|~QhLଡY2ZY=LEjyPrqFjc-i 7T\^{~x\3л{3\˵CmCqVJRx|i8 |%B;}u6jbyr>Y+/B%T0c7ws-.i1ЎbRȥ±db(p=!;cogN4*,+ f#Ū Ee Cx8{& ub{k9b]8멞Z_K:vrV\1^%xO8@q+޴^X|!( -g2 H;b'τ1!8i|kƙxo-W*,B{|bb P|rxk=3J1?ԒK8!Ff*)X6qR>:Ku`?-OLBMYA^^݅eG[ f{QV{l3Ex {U"|o>O`J5=\:pbWO2G:{^#](|c?=;>7YM{:,vv3[> 8;ql)Gns\ǔ;%Cs+j ps 'ײ84QfVeԼWtmv ا2030e\i&CNT1ϙ=t3zk1*Fd؀)F(3$yó0C#Ԕ*TfT|%IVs xSJLxAI'21|fz|i/GiG6A< Y)*Նliv͔8#GeتoCARP;#$nzB#9 >Ɖ1'2"6Nәx8Jn8Ѧ#VV=bKMSsV,l)I3;c " }DN(^f?}N≁ -0<'RϦ?99:!8K[̮S#^˝P']M:\~f.λ! b}Q-!cťʋˈ >tk6i"1 }6{i|31Bb מvwJC/= $k̇ cn8=,,`toZVכǛǛǛǛǛǛǛǛǛǛǛǛǛǛǛǛǛǛǛǛǛǛǛǛǛǛǛǛǛǛǛǛǛǛǛǛǛǛǛϏyFsq[_$>(~ -=Qq)Λ%mfS|WZyB77 -ϋ]|Z 煦+.4$4}Qd-il ^r,_zH|ykVnX/_M//?|a{>~E΢`%>t-\C#6+/ U>{Cvf{=Z邲1δgXkX.^[k\%'ni5ԇ=.>HykXXpy"[T+! dtZdK_>3t;؟ZbQ?pG -5S!ebH"cN cԕdz#r0L-G*b8zqLCAL`?k`<'鶐K+1292Ӗ$(؟JX"i|?F'X - q';BDɴ#iTkFyCB`F -16,YC*[I?Bq>4# HpI6Ngg?:VͨZd陉Qd5LH}yf?cqGǒQVt%p:EH(vI)uNBHHCd[Q$yb2'ɚtM0:sb -Fp|C7܂!m16d|ͼfުK:&H$x9~:%B>)Has@RȺ -E\hP _, }`|Z(6bdPvvRui!92NδcrD1 4Q0 -t$٫cn[nebG ^0{xf- )¹EeҨIj!cP2F -KI${e#RddӝHWV`͐hc,r8{j0󃞲C4!lQ$|7g@nrb`ţ !f$>FĆqRHgY - +vQ=h5&;SF*avz5B2?m٩ɵ qjdbQTcj)s2jhT gǖ>Hv $yYfEZbKͅ4k!4ݐ~Vˆ5E\1Z.$Vdu yW9Bm> F+ ɵb-!A2, jx-$2l0t2lKg'=e7O,i$TK#~Ƣ4*~|)/蜩etH -}ԊK3 IchlrMU+G)u!B2d2@k(dTJ!k]cd2úBrm3>I&!wG4cDB&CJ,ؐ"ϤJ"Lǘ)O2[t!b4c] f_!+H`gB8f$sa# Y<Ƙ?Q{HECgO?2OvMX`U ^xi+hm76r˅7 iki|1AJk$}kdTZ)K ?nOP/.뮮h8]YI?v_XbQM?1Ř?0 -~G;l $ʗJ p{|lSkq=Kv*߰HL85fqM  Q9v?%)(ܯ1 -|ɍ8`IɿX@KN_2!%v(#'9΂4G\Y -YlYe6ԒgR^1H QH@yH#Ё>_lhυ'gC^ecR;gJזbXc/$k$dm0 -A9RL|*d;h<׶aj-IV2[d}s|`3-^**ie^5a?HjŐҋ -$2'^3N.93Ozk $IzC#48S3;'Yst bl=Zc9rRz&3269vqd,V >  l;9ډ:_PjC1_fH7BI>>y5ސ[`| [aGbr~ oQ}Y_d_)`L 4C, )V7R.bIVRIl&hd``M?EݳHP@֜:dX=X;(LlHJNYaQdVC['|c֣t>qRG+$!kc``ґ1@G:ct[j $xo/s0sC}gg!&\F) R\h'enXc-))ͅXC2ZVd,ћ -xKoJhz 7$t)4c$$ \V{<< [i}eLn~uן{un&S,}$ 7R*G.0 -=R` ȱY7ΪG'AFИrQjt-O5t S o5EYd 9NXn ) *Ɠe1  `gJV$\8/z$YPv)dd@מy|'5- Ŗ:FP x 2;4q B>j H5hk$ւz}X~Vִ~^ -6sl%SȐqD l-4p8s$jVx|5>rJ[C::9%|S~G,i1%|',)Q/2}Ȩ;X|(##H|fd5.$ӯ~qZ`5Qy錄1oB[KшE| ݐHA -{vzJe'cNLߐ -f5[AiɇBT;BPeR6]o<=C5z!$Y79|m>J*~&?RM^ExǖO7JwVCP/X 1X"‰O7Hu2'!?BGBv\hbl;I9U0G/$?)w>-s\IŕiKIK@9S~̞J%ROֻ{5e.zM:+)p$ÒF"PPs g6ݣσ~S !1fN (c*/#AOIȸ˱Uc>׉Rhwt5 yG䡆#EԫT3z̨7yd9\bz$]?d| ;fpml՝?O;?o5}YHr#õ" ws'(?LTn4飇t"'QH/eRXu7nH`1cI&!2?I5T)d-n>Iܡ^ζS X00Hg6! c1IJaKѱ诊IEc NxK3 r5ח'uOA.8!U\["t}S<`?qQNo,6z]Rq,1ڑc1/9EXJ}V6 $(Wk'uwY!OtdQU[[HR,N|sf9'Qu`!ؽs\LB7B{᯼9q7}Ǜ ʮy ŃYXjİam=@:r*ԏ$*3Ob WL)?H;>MzuH=R" y(2ѧZTCRi"G6-wrdXԳȱAP $30ÇccGB+ NBI!HN ļ =v;D8b~B#d  -j+s% srCXh9YgCLl Ixyo焌e[k$Av:gW{ԡ}pm%,;{4 Hj2)wؙ.Q.Uu}DLB_C IY? -{ &LGzk7Y||;"I1#!Fc6h QH*j4ZOCi&+U\Yl_CJ9czHajhV!'?I~YX]nd IC}NO{m!*UZAl;U-c`kpmh.}G2!~N8m;b2lH&Yw -,PX"Gj"< fbȄ/VYT~}1pQ&Wnc >P7͒0)ԍEd-Dz|)@bDY=J4M,ؚ$Y@#c`_/j @TbJō`Lhb …kr6i]z|s!!V !weP>턾dp"fwۤrGg}HȦ^ye(OrɵM2É#)`k ?hf. ?ClL(ǙVHSX3aϓ+K !dđFBt?ܭ>rқ'FBd3CWG~$H8B:01($mgMܮ ;Kv]?T*N{UO(TJȵ֯J~a"iXlG jj؀<8h'ICKy[~39@=ڏp_>t>Agf׶ TkՅ<^ͰeQ~!u@/u9@2q5/*q]Hֳn_ؚZ$6^n5S'H QCg45''}(+38 -J` ;>$ oSZJ~9'z@t5\-y&dqOo6ɍL}Ԃ6g죒U5y!}z ؓPqc\DjxVG '?䑆@VaB뤬i\dd1Ojoe>>F;G; 7 rtu*m{Or?ȁlk3p!!j.p !R~GBď4rHc[ӱ 5 S 8 1$yzmZΠEXIIg. -W^AMrθwΆJ /y/Rk[0 ]HooCK:9SPƞk$HH?+CqvJ%Cs?bͅؼFBm϶.2P}n!nwڳKw֪P|:=Vnn˝= ލuѹ\[V%W ,%Uqyb(7>} -JwJvҎO@݀z=> J7K g_B%BjD!Αp. G3avDdy[/dы~;V兆+ˍE(9R>5P:-~3`z.kp* !ԃ@gͳ % WWL)NwKR=ÀDn|hI)uDCýJgL5;i8qaoz} -GpO-O?>(zhq7G}4@Y/{ܹ6OCRմ7a,X͖V7\3MYys߸  X;Ӵ?7?R3tńHGuTBԂ(4!!o$YoH`@^3XJߥ.RTt?w = nX܏V0I9 -5CN>UZ{KCR5|qNtH =/wY>E -,ΫQvF DF*\R0䐱we8 )kK '0lأ -8+<5`4g( >=WP @gʫ$ ەR˩YSQ>ɵbsGHw#-7|A~)UR}z bkXuy1B7{?\H)CH]5LDN.=AB~}Žз~X9>(c62M,08hBZ 5qj/NZm(ujڲb;ԎJ=BW`XS}w`pGI"B?s@&>PhH_r9k*bTqz! .O9g6GgacuA V3Y,G=Y'<,>B68gJ,@?6`:F=p?k/>@Y 3S:,ce@ 7`P!(pVA-rs7`2G%W"GQאL9|jF<3[^!iZ~z1@8"g=tT:U0 -g qFm7g zJ,3g`ή4O -dݵ$+=ϔ7K}kbpltП)o;~{M>>2a&+,Pvf19p])=?i[CF9:ߞ E۩,<(~/ԭ襖[@F%.9pvoaV_[T\]{=k:}L__3 ΦL諒|:gH%cɏfh @?\=sO]wcRe8S?u&0w\@8ʉՎbt3c*#%9galmSU3{ [k ]}e)"l8/z8#h0&9j,Jg%S5ֻ\za1,i+bk`e';ʙ7"TM/ŠIgCsmq}4oL}@%zK:h 􌹨,[.$q`Jb_nZ~:cl.!_Q3h'Kjo2]cS= RBӽ @R=|+D} P]V+G-00H,2"KmHO:'we A xI~!sE(._2gu!IĘxc5zWͣ qQLʟX<㻿.4ZGV@a_4 U Iz5^] ̷2?MC,fYD9-0_XDg;ĒY^/bOJh&y0~V@;ma1k=0QY}=o\ -3}7~optp6Ы -xKv_uV5B1'1cT|z.Aѩ߈. D>~A34{f7gD$W_ey;+)?,-V^]g9kj.~,9I;5k;_=uW?=͗ேkIɿypCytGzy'ϢķWI͟n-gLC_ήk#[ wVJvO>)zq=wJ';OPdjkx;mjNKC{+v} &xWD~HО۹ԗj^~E|G`r`gjٹKO< -vw +Ͻy亾ކ ;`3v|gG?^h/}zٮo{wW|O;"H!W|=.>.<+׽┫+?|OWrO7jCdxqڣ2S9ag7+J@!ᬁxMj=Wt'` 3:4_zKJ>=n}/> -*i%0J di}{)1;RQJG <p[ =(|V?Mr 'grEf{>Y}O= ܟ?WOߕ/%9V\;㽻Y_Vw~S[_Go~{Qp~{7v/|J7Jg2k&)v-'7`6 >x[/o>o$KYzC'!oП])V+]F=.ًOO_}.~+~IoT/Tõǁ~?;\'}j+ {͉﯄]Ƅ\WدmzO>gbcWN>;g~e-jֽ]*$M4R/(ki;PTR(Pw7 {}39g{_כ\ISsd%9H 7zM͏&\ѐz:@?(^݂m,RvKAGk̂{_M_9Uͱ_i󬸲U㒂Z)nBsbX/>J> 9KA_`y̜J[+ZUFP7oϪDw{$5tV(C]3AVԥ;+YvVF4h_D<*&~o(`@di rh -v8{`6樰s0zřG ~󑌔EXߕ麑(n -}v7GTwH4~ZE}Ge/[N -:$ -_9[<,;)[/rS;wz .߅К1~'R/Ukcv^M"lrq/.l3h<"yb/,{EH<oNEGȧR E?{oE:B}!"+Nvx6of—_hY 骼$y_$r#} -D޵ nz^,fAmN#j6ɕ>9[(}$n׺M]^+hBa/E_m>4Y{p>?{I"!pPHm7mdsY-lO?0&DuN0/EW].HV;>z$In%#f$|_5vG 9ŝ#ҷ%.f%>ő*\InDM\ʀ!n]'Lj! +fE |*Tџ>SџZApeđ\ى갤 oÿy"}'7+;$Bn'؟[刍05!y`^\)}q~7OzVgpqe^TyZRR"0{sAT~VAA\zzmKhXc/ySqR\\{<3˽! ˜%D]́ުH`]=~IJt~pTBP9V񋭰=$Te Q-px'%pwWF5ѳ[ՎUIA^YAKL= ŞR[ћMŏ;D[aM|_eMX-md[{CA}=l_&5gՠ9Uyj6{k="hͩIIZG;s͆"ɑ~a/~7A?Qj" aCʐ!m(v -e|N6.ҪHfXb4U]*,nh --[214a(H\de*޾VlfeA(QqQ^rG`髚Ե6V}ﱮDhs)! mę|zi@$cm2;NW\v_C{FڭMoa]DPmx=Ժe<2¿{Hˉ+_͟4<îq(_Ϗ[/|vv?K:q@] +idW' %˺ş~ di1auxQ}iz[x9û8w1Fߏw\gV&%6\JkH=Ӟj{/Q&Z3*j tkFxG1y& ;a֣"Kܕ3bc }:0MBIz!RO(ݎ}7Txҏ-9j c6`oe'#)z%K+DF*c[SSR|䁍aDSROKTK 1- Wd 17j~%ݡ=/;f>(|_7V#w ƻqѲ,޺EU>վ񁵡Oo" ͋X%c4"!K^+Se~-%abEZO -s˃6am_$ 5!^L]y y0.x@DmM8y3|¢XHm)FTtPy$c]"OjݨsAGA{#8N/d/ʼO< *8~j{__z筷e{l[|g}dOyɲKlz`,A5&DS=:Zȑ6(ο)$QG/o9{fĒsQ[\e-qmUaﵡ(Z ~u4zhp#&vP:h~Fq@ vj`}`v q;<tO*&F˳2:6bEAY7 `p5GN*ü(92(%]<7> r Z~cQtvwKߞ:Gt9r$6l,V`.P>_=f60{Wi^,:of)L``zxVj.L1chagw5yw,b;we1o*]zĦU&$T/ֆF LŎ,BbLˁ'2s[ktbC۹8- W?U ].O13(tafmش\o.\X -0L0d:*MK ;L~h%s&h&mcx__瑢uO({jfⅺwqYoeɠ_ZS=JoDzgodb=b2|jØ^/].i =֝9z-M>¦``@⤢A@ Ct+-[L0eۥ -@ϟ+`Rb_'7z[2oٽwn1jCA O>N a tJhJe8̎VB;Tm4<+Ehlz֠D=0V -'QO̩km`` 0#'Q6УEqob->&EGMܢqT@UD͇o=c Jd򲀸]9q/oIuFĴ{rcƿe1X8a:lG3D'6M - -5ۭh75:7՜a0(}_n,֮#?\\eM1Ʊb/vܐ/};3=V,=[n 2rFw7L#ڨgUŋ9`9ߧnN/r=[28k'o&>.JWOۗ |"Kd>5QA Cv+6?9ٮxky 뷃Y˞isl+vk~Z(hv -sxD0LUY -+-u]sEðcWP=В2TW+.>oKʗ˽ca3uJm[ `~!<5zެ} n_*vb{fq>?=Og[DzoƔ``[*7u>٦nԩٻKhɌk(M)/Nhc\7+#;h}SJFɦ0};'jtCm瘎1l';[BJ l*3ڴܼ<(֋}Tͨ,J{V#_Q 󨎍CoMxﲄZ?uHJh͊v;~zC%iL|o|wi 20Yy)L̜VV|lx¼E qQ ⏕f/]A FA9[emboӹ=6;caC 426J_Ӊ+6YfNfO fw@= ̘o&X0U:Ϭv3vD:e 'sJZόZJTTwiU3'+A>RWY*ß&QDO9З,ӕWku`ڄ`܃`JzT6:SqOhT/S28 IE>boy[ -Oyi[oR7П,GǗȴ47z>>Q]e1 iV0wV0k~0gf-YKy@}]AuFQ`GDw1ؼG2'`jo`srƷ^qoK<`e]G#l c]Oa=29DZd0]q&5n%5u3s?XNV<oQ0gY10sLWgm'u>0zAƪ̰!q_M1^C3q=qU>PᙂrRd6kOfsf?c{?ߛߝ -f_fMX UC߼ -̘ο]`^LS϶mJs0w,`VwvEN(dVj19CP셿Ob3JJd47zduyft5DPv#o6♪,+$8Lc8j¶m3fm mfo6;EZ`'*< lz7*M@9H11obaU3qe]wy[3ɱ:=&=TӔԁEM=NO{+?c7~[X(X,˴.`y0_ǂfwuNx̬1޷b>Z, u@vQw<"g[ŰNhrc!E_^и,5kÿ˕\ 0z)X6~!Kb@ڦOS۷_}#<3A,\g6KyX0#q[bFNgED -_V'+I{:OCUi~?׉c3ϟ%?spù6 ,4O09b0wNSrXQk9a`=![?U=aCfs@alQ0Ph{Wi/ɏXy7fVUqJ.dM'׶b3S:?Ƴ9x _NSsp>Ut,&%`~|1 `#i9ĜZ >8՚,CQծJ=b++bk=/m^jG ?c9ON]1N Xa ֺW^n[ߍp*m i-y61۝FY=pY>C;Y53B.FdЂS}b,YPraU%xD z~ro>@;),YKEv̐_`Vh@6הv7Lڛ;O-MمߞЦr6BVi.k*+'PL:#f3O~a?F/%~F} Z18m%/d%~]wFaa4|| $Gv7NTC4M{h=41`_֘%;.`?? k`Zr.X۱PgudV1چMc}iFso?\:J?׵k3[M*!5eN}x`2^}(8/g$GNԚ5 i#//إ"`l`Μ`SY.9+tꁷj nj}zZj׻hsp>3|+cM~7e5g>ʸ1T1֜?v<`L!]דuߖiJ?v*gH*dMf|2 e}ڦ{6uU{:M6_}XN܋`+'`ԡƿ2?X٭YlctL~g4b52XK_bmO%CU1^p7pˇ& QE-;@(uXVj\詴%DFa3<ws5G6l<0g,cM^ nV4Ž]jKwƞ @_`*3.gLx͌pq5aqɺ q3 -j~!g~s8…mxg}%H؄E=_Ni0/KJ,߄ҏ{,dL2~i2TWƭdM{]_4L3NZm`j#8vSy {o}v-'Kf~su}qԍ_1d[ד#o"V?yN1ǩsOV>;08Ɛm Z;y -Ec̻صBIBKW2i'}G$~fO貢Jڏ+Ls }r+u,/Fs/Z -c B -Vx1`-a~fN1f_y0_Fo087uؾk8Q17/j-:ّ&O0Տ덂^3yhp_1Nff^̓弇?IoS씒`cJ,' 3-{k8׭N'AቋMTOMkr -,JzŸv(6s XCvJC4fk>gj73 e?ߚ-_Ģq {,9.nlT{QFF`.@ -H'Wn=/t\$ZX% -ۄI3唼rYN!}[b^Y }x.|/;XNAL^Mrcљ iٵ1eZ5r{n>xYc< ʸy ɭ6P106`7fhyuOr:b`ǘv, v/cl`򢭢WMG'ݔ &LdAcc +Q%KwdDfFE®v~Np!^WfF-2 ͜Njո׿[b9wLT\fC&k+>%B"4GXI Yf+p066yŸ*/%/"}yz'G*k|_UyI -}[4~9u/*Pi LCWnM):mA~Ŀ|Ň~fH&3iaؗOVP&L@LA m4y+IJ|s;̤7~K+aW+ȋwV r$TBn-b:ڃA\guk {'W?jKPi[U鍿k -}3+`OFH w2{KqA72; OZ=a䖵dkyۉxIz-G#J,JC\_p4JSI)Rx=:_Q9v=/5 _Bj׿>ݘP ?wKNd!cúm׫Y}y] '.n|٪٭7p az#a3cl\q^2Fe }GȷrUSG5wkmBB3a&韽BK >[O^M,+]䐡® kiAf^zXA VwygӦn/F:_U3SŎ+]1ZA?5I,úi| ޽qY1WhI*8'/NSa[x$ݒDt S9ƒ5VR,zk Ln?gHiu1h] ~G,h5wT#//E@)/:_uL|?he byѸ!1gAcgC&!o/FJϏ2y!W"'%;k.ԼLn@l3byBm.E$jb9h8} -6< M8;!HizmHCxoz%s!.dHĿf0ބPTB'MG̪H+=^?t7R=!V})X3q| tI;?Jp(Sʘ͹QYe -wzlؙIx" qb fX2m4v(1aĕ^=5$΅N#Չ&mR['>vuwc̟W! =hńavoy!s!r#~{Vh6Ʃ}慾X"8#녭{@s>0[+}cc._NTk`+3E;О<ɥ(y>U e2"DZg|cPq 3j\zARVAgv?.ұ('#?pk=DFqۈ鰼[nf>_@P-& IGc߭g}݃w,<>B3]BL,r,2t#?o7'lYXٸ`_О0<~C'jre t+qk~e-?JaXZ^݂ x*k Qqq^ E􊝉EY-9b]~'뎆S*9_=x+* L%po\&X3Hi} Fe~\e1ш%dL:"UvB9O62}\9@y磦Q" 5z$8e꜇9]Y@z&bY.c~YNÕcThĚGAJpu'x{TUtSZ#0Ȟ)ϴ9h?j naWaaF>8Dv6b!auQ9&dA|)!vPCD5;0 v0l39 P33K߅#?bG -pY+a#ڀ0k.+قcG:Hр:<))/gPb>s#0;̷:4;H1Dy[>YƵweY0VZىV/JTvqVopzWiGY?oQ™"B> V1ڋa$ț;}"G1@|1;s0p1A墺ZH ˍ ]1ڸONaf EL1D:OF {cAX|YBh1  -p٫͈=ApX'X c3aF!S^(y(o$n.AA5".F6qE|q%<9ɟu - -Ʀ4Uh#8@qH *zF0!`_C!t-N)# .aY*br:({z{ J {ܭ'ވY}cg;6TvˣcMk#]EQhboՓh_>cʞDRCտOlHmMػf'05b:qcG,9ȳEpL=uN4Mg -9($kОZ{KơIs;>]H+0͟+(ǰicX¬H_ՂEz/~gN 3?S1a$qE$􍄍i2C> w 3g5l? 3S#,g7s(Gh[TAENA{EBX(#Vm,Z'Ga vE Jr-" -=bԩ+Ka~qˍDF`˼iv">gm?u6Q#eِ9*ފb9ݒ.8q\ s ˎ(N10>%NMFkUk T# 4]+v&o}NE qP2>0ٱ<br#4"?nuFER-Oӈ+D&;|FŘHwGpC EV [6'nsLq1YJh_ Ѐ2(Vc80;=Tt\uC}b`ͣ v,vt4RgqL wV%.XJ8MExReuTQHo*3rDqX}6ħ]bb QuڈSiUY 'ܵi!P4) ؗ둟}}.@zW8OCSdZ("ޱ)&RYF ùY)!\WJ|5a{FȄ]dZk(c35]ІڏvMò벛鵻Q͋4кټ$Qv-2z?>A~HkH: n܇8hM/\[B7k#|:euZ{$,Ddhsxf9(VO*߅4[;򿾄սpw(Lj#.2S|NF| ,Z~q*j -pquMa t׹aAhY$Ҍv') X1VABIhFiِ")"7,28N~UβQ|E>v[]<&k>/,G+Q)+H/9Ryb--Zx.Sw;) fu"y}2p5n$p=2;46΍euyIȼUFUE 64c';RWrTt,òQMvЛs#ޓ0K[^u bKXxĥ;q +'T o"Ek+PElqg5Cd["C/NבEQ0-7jq.dL*b\t ũRZA#: 1S$-NMfOI 2j88Hˆ,l+6}xMDDKXS$®hHWZ=(yRy}Dz(@Oe},ҜCӑ>iкG@;AfuD':@OU>Ps$*(.Y'C"jعEN|{2 b".7Wf(|dCacvaq+Ge-+) ɣ-9?Ib=iLYKQ˴2/,i@8NA:HgFh4VXmcInեf͏{NB*KYKbq.:Juf OęHeq\a#?p]o]iPtHY,Y!7l%XYF!~cOV+ն99iS,6{>?#K;K|No?1|^Qm iͣψV(f,@DKٸF򒤆tF.=S -~ ]| A _C>*JA\]*S10y,|vʪj ]7D:WѪbXZ"6η9X4Q\d5qјP#\(U\es>9 -"z5H(=s\t݄ -}vV΂DO\ȸvy,`<&I ,(+{Z&6 { Ue`cDN(#}&f/,n4:N\ܢf/孤cvR_sQ"`t6vV<2RNH;K -x\g4tݐ^CbsΚX^_Y6ncEQϷJ}axyTNj#6هr ]f@gj^2KsGi"m<0v5Btҕ?uO)#D?w^& @xz6G H>*ڄrIą< `bLcCJאREH嬶);nDk]SjVzr қGYt$em'V;@!jbG)fǜǛMD(8H d:({)@Dj95KO%Cs3^ FQ|=ʩ'ȨDH9FˑU J-l*G f̢bckmN ND@E9KEΈ9E(Qَ_x{~78J(9{Z{9}2GZ>jN:$f -p'7,YT$yM=XJ򠝥m(i!{ǀjSﮦYJ'C;+\g,Y;{VrЎ)~oo@ L+QVO\t>t%ʉkH_Ob@HEWF(vry WyW/"c 9]`OLX6k ~ICQGDAE -NL^2xsEqH)z -|)$q[?%>2O~+yEJao&tޖ[E.,v tùCokJRVvS}kg|wRKCW@3G~{퟈8[&ԯeȻ94)uK3K*m2ZٺtW9!h>f0OrYF;YM? /}؃jaSp֑;4Rltx:|}>t1eܱЮ݃a8&b}.<>ǥT7&@EǕtjriRpHbٱ;s]X?^]s`hҎT%jݫŠ􅸲 X`ireoKNKfE _p& 5Z1q~=1*SG@>O9:]*lLyV5|>Pt6 {~HBS}Oc$kTg5Oa l9p/Ffo?q*:)lA}S)4XCEb(pj~(!XXN B4qQ©On-Vĺ -㡋.ljЖ hPp/uRyMU ]:Sc'kQȒXǘn}.f\ȭY,VVtCSGUF˚5SvBPJ SN\/"4YBم\#h|ep5߇f 0saF;tU6jGUH9~Xs=HLh׮J*JkRJ>5zvޓf7w$k#$t6\DHEs3{? ٷ'Z0 -w|$A}(wK*3Z2~iz -|]FlU20Bz4kP FuN(FC 9R<BTx:S K>GH?0ClIL<2T}[.ś}`01d.RDĨF戏+QsFCZH|'a`&c*Mr4}c\Uϑ{Os#$vE]O9>5 X睯41'<Ί,m#s*2X"Nмo B:z2v|&wu1%|Yh*qTՆ&vO>X6N9%\qxQ8H^\{.%EM ?9syw#wU잺U$Zs/Ɛ$@}lÓhΜwu蛡grb a{8G-̊`CKBŰ=q]l텨K|\ٍjyc'@ -&QY 9M9@rYԢ8hm~ggsI'9+=CGkbTB`,tPF/ve֬!j3ӤСVc tUMR& czGZ(o2${+86{ꈻ҇a_wDyY6ry?R9\?KՓ94o 棘5T/CsFA˺0_m%^B hC -yݕtmNy/b,ޟs ¡SYoױh"g - kcSwcÍӊ֘ShNE kgxEb40Moyy3b4?r~RO0\>б$X-{_ -BAk p9#gu 2 ^^љ#TQHB9v_NxjBC=n(nYQ#|@tkST-z3n0{Z#G\ }c ƟdEPΣk:$vv珢뀨G`p@H FEw(vb&m}td%[M8?pO 0(V>=+W_[uz6)MIJ -}yx^H!hG_zhRyޭE Ћʹ>&[0pCV=^p"15=Z" +=<6Ir~X{ޔۗ_ܕ8D/'>h4󑜉p/mjd[h&wq߁ irﱗGGB<<xzZgK3{70pX/s;GRttS86yfAә cbP>얀}s_D}ٹT5C13SbQg'sLE]83I4ͼ4L_Z$$ IĠ -ayP'DJ &>X}t7KMEGʰN?y0}H99?8] B[+eH4.%I55KS;H9?]xf*9x^_D5unϲM}ύ#Eɬî#cgA>=v|;ߎoǷv|;ߎoǷv|;ߎoǷv|;ߎoǷv|;ߎoǷ`-klvrt Vn\hE~پSDjJkmw8m_8MkOdci5jT8w۩3K̚@͛_z::8n#OZڸi^#y\hYHsf-`xZ0ob}<Ok^ǛUݦkDT}Օw~kV3i\eG.?<=Em}>yZT9+Ƀۅotȗs?·`Hq"Oҟ;GX_T߂[]F?|y6|/_~_@>}.-ǟ50#]`Eu}6ld,cl렅YTnܶ} Fnch$2,{SfCfbN3CkJSf u ͣqk`JANEwQ%]\ջ`j[d'| [aR;hVE[--4⡃fI4Dv=@n!62B -G -OJr197AAk)f)lƁh\o) y2l,%nH#T(@^q?=wLAEcq|PwWtnG2y>m6ueܦ BZ=% I7S2A)"$;4i1n A  65ffaLb@&e ޅUoc5l1h]ez䞒Av& ec6{뀔Ĭ6L ROCKAچj)c]¶Akd? suWtغHp [ٝUwg{HN!}DVAi6sSJ iPJ -IJ7ûpCQ"7rFKKĴ AI#ͻ7%(Jx%А-䏅[Ty*=*㇂Ml2 fAprfmPK>gP?4GY_MɏBFLN*an1dDl_ᰭ;g2 ћA P.&ܕ'Ѡ%4DL=)^Y7jAҐ`,d,=ЦĞXU>$Tn[@D9XZ4;EdKƍ6ڻ%xfֺGc,X2ߔ;[2rMĈӈiS2]dv3@Dm "5>f-Yn \CxޖJOm|7\-:'4!jA !'٧W&k[JďZuJީÔ %׀Oo4٪|x[4q@/B@2>}J<0T7M$pg0:NBҹhD9lEr_AA|/a(SS>0U$hG} 񟚆dⓉD6ܒ}{61MM3ѴDoQ{#~Y3a#f ?_s$Kw5PF3\*&KӸX56E FDHV9~< !DGNjhVDKPH/m%61KP*CI Ơ OL.z a-*Hp -K#π}xspA/`WLM ȩd -x ORzȔZ?P'Yf㤭s펦n#ScmbzA؋q>lLa&f-4ц-pr 8\[d?qg)0d⎤ ,ܸf=#\D49[{t%x%\_!91$S@o4[J1%А } ]@8Fa%FەJUQh87?{L$` Ȓ=R±MR)E]AٻІ42-=t+|҆0@IhT[B/&v@ 7CdU&%4܊ gf⌫h84pP1xo@ScH?1`A:6PKhܣ6Tx{T}1Wm޻A"ׂBnNo+%< x[rnI\p -\jGw~oFOA\r~AS&?@02];Aد{t?Jpn9r;ov[L?jMOv;txKi+Vu z1o%M ~Q(4ZѠNI \)\XzzGzXD0aHhj !R ,(ߜo`;!% $8'MMyEv N6h$6GX̡Z>1%b}4&M2_1/ADˈ{'%@6CѦ\ڀ Gmܑ) | -AjK|Ϥ͢h -ZJl  Err/} -K>M =-0]4NR$63q0%s;uNX[@ 02Lj?$ Cs?y{O<⽿X~4f@b)b_ p.)`HqgtcoڌKlTI>v% @~d.T d4paţ)gdz}h|79 EރXbxX> 4Vsdza p~ A-T@z*EVOçACpo3$݂Du m ]:>L0YXn*$W漫ɿdFЄ=|m== ôq726i"~2D9h%2n.0w d CX<"O lh% p2z#Fb$*7-`RPLE_O`;RP; Q" 'WKJI*Wѷ7d|兏B$@z~aDÇW؊א5 HB$f7F"r<gI|H|2_ LףM8D0%t!y_EH4$rYhs=O`*@b,HrXg2|z(H<`ߞ8h7\Ea $BkE˂w y `Dgg - r[3~%^%q.w.ѝƃq>=@ F k 6n諰n|]ܦmnB>| -Mf rJJKt1nBIA8-zE- J!/i\U3ZˢgK@I`dvyX|yW`Op@9 xߤpP:j($ D. In}?%!g v)+\` jr 9IAW(w0kÎ -{5DUӳJ29_]UjA O)i{kJ=\ۃ]ww"^CtB^_GlVxpEc(68 ># hvGv[h5&d.HąG3s5g@-x><)̐bF?T '[̥ dڜ4fV`ۍfv{:H墧6HANy(ޝ1cQ$^whԅ ;H*ld^]H @^ `<5掾s"`#3TQV̀ЎM9;3H|6_[aՒHEIR0X$$_)y<"~gXN}(Hk@K " q7`^885C/YO雮! LIrlEqOTiW 3)Et81r2PjEUT2|y k!BGKlν||@CѿK?SX4ai\v -iPXD,2FWBG#/D D\K}C?5O0˺DƠ06iubWST`iW/ 9'ɟ@F&{yPOc $o:v@N*+^[ ᗁwP!=lG@[rZcPos@qKP/&+Cۣh$Ԩzg@)y+p;#QR(Aqd򂻋?*|4U[ IZ˂l8c?A9BգiM5zd}Se@"-Z -$_jJ/SGh~%~P 4<<BB[p_{'P5JT6D 93:!ˮ݃P_vE 9?>B4vʙYJx!N %WpY ?p#. -#̳s!LGLp"1ϋr}1~%[شLQl}D# $J R: K8 [`GJԇ즃|C8Ipj_)IF`-```a#~藧w 5Fs/@-̦^%ĝ&{T0/OCL3G$٦ #[d$|zcMHKZ+$@kzd)EB0=lxEzd_.x^ ۻ# FRpg8sMI)9?Kǁ\VVHC -}I^G-%ȱpn24[m@r4o"!Bk kMCN/$ȻK6KMG TۓRF>v -/ȹ9\ɬ{R4Ԯm$?Nٯ8MsIA!76$fN&yhC -YR~*jc@t^eؕ{}uR|7cl~ZeQl|GE)u*L漫_JJvfQ/%yFhk yu>tn!XM6+"GlѓIwK@?u>,7 - 1_xqX/䌦 !xAƖ֝&|/BPgbBiZpMU(+]8{`q{sDwm䩭!u%?a8 _B@ endstream endobj 38 0 obj <>stream -@ązI3S"דi2[#QCD><>aZ_rG-W)\㈘ dr_-hHzwٹPAp8]TsDD~Ħ P]*v[x]$i_ h &*g08{FΤ!tO7>8O89M$?ImX?94ɍ WJxl:,$/WlCEӵĂ1 /ϦT0#vʅ́thF.2p͛h؅13jSXqoI} \؅}@/ aȃE]x_HINgDx*4D?rgC3fJE7R=<57-eWr$ĸ>b+:r~m.?{uL-eQԂطѿ'/]yR= Qr"=@Zq~I0_LL8? -+{ջƛknӡ_upD Wᰓ!-2--~Ne\e_] H)|}nH5e]G(:*%8=l66PT>ėǖN7(+[,Lي ?P 2O7`  3[X1& :**vY؅WQ[!:iQ5aټKx;i se LJ6T}X~`X8zBr47%#*9M#!N -dK;b\Xq.y!w5/;R>-$GkM3כ3]dK-.QòT@Xɣ'Þ/(իOri\TZ˸P"}?!m'~ϳT" ،b>_.vRRó  ښ%O -=!XS;JP=Qk+nKwiW0J=`5!bUh>wbHA,=?;n*m3B4: ~ }e|WҨ] j?yo}㟅WbSSE+XQl )C[кL"yɇg)FNbzh~qd:$vн=c»˄|ij -/jlyX!uxGE9\̩IlG% -1M.$`:ͱ!ʉ|n2ar/[y,}{&?%MN#G6Cta:[8J,L5K[u7sbA8|&Z֋L  ^Gc.TƝk@Aد j!|kvP Pb|7rBB͡5H;NSnL<5{:4d 3vf|0@#j]:8j+ƵbnOo?8:M5{*IסqJ>yT@pq|3)ob nL=Xh2>2SB \}wHAM# E0a]TKrSå- -Ε:Y>V>gb{@sqQ ߤ!4JQ0]Dj.쳋 hAWz| T -ˑ<%% +4?)m[5AOFCZ1`5tAX }ϫ[!gn}5!a-9:ji$G7)l_sSmbJ6,Χx8Hk"_ۓR_R4$lYjػ!k6QT wm}U#Gu LňєkG[=?$. - ?=]Z1kBT`kX_!cb9<"Z֠ޢW&ɣLSχ"[_OQj.Oꨛ -7pd*FI ڌz&LI/^5ZiʙNA^ ͞)$Ϡ{t1L)AXo:]:XֆP^)D+0 GpwuGOGC5>9# jZ2L=F?0 {9S3V4BUVl9ݣ-b -;/EԷ#'98G>Q{`JHh:W!vz25ǥ%/oY^`15 {"4BKg*DueE -LQ -B}&TEՅ+siXnL4N΀й24ws'b5B;c!d`e$g *L -2йuTȻsA| qQXĚG>ƘuE-r:g1%GTҡUBJ!|4nt=^Mq6^9[QK=<ISQ0'{HE~ bRb©[YcbK u.5S{Z>jX;3xAԏB kͰ3sX,@/OE'揅=WP^޶[P_31?AV@Lۙ6^+]ԶğKB)Sd\^@O MEΆaa+:ȫ:VEG>+zIWҺ4د|CSVL -omE{bX_:/j؏fZV(+jZ"Hu{%QS5{tP4e@NFڿwP*RMo*4(MїwG1&r쩷uڒ6jmA}= >t vcp1H^eI|,p1Rq=A -R+s5 k$b*=gAJ0U-(.o]cUDCЄӱ/)L>"Y|3'wr:A xIBh>|%{r_@A[xy~]CNc@kXº#jQc)~"LQg6Bn"nXSF=K2b[0a9ˊ|i#1pwRL  !Jc \L8CYq2I"4.*;LE-˨ݧ"EQݏ$f-:*ɏ-F#ŝΧMk>b([OE,PrڦCi_R^?X=\wPοh}`[ֹJh3;7 9qhȧ]JqHĸ3EUL,5(.$?`CưʣN72DZſWWoՆne ~u|bx޹ީjå [{^.7.W>R\NVel>PcwmnX yGu]J6 7^;I5~-h釮9[!xWVVtp॥tV["P3:L2S}$9`gu -&[l-[x=a!j۱;p^{pߺsw~qTV -[mܕlj KmcodlǍΟ`>p'^gt͆?sO/V UOMUg`ߪ {9{pN;m~3d+N=}P\ybof{?|ʍkx᩸ANߊed‰vٶk^E[!}lIw[4u+Z~5㮿SM'1?g2iR_Np)UfZ©J]R<^ǥay#ɮ`-RveKŒUUrNw}jm;rH(V?3XeX=7LH -;FߴXvO3y_B?_ [rEJjSV˳3n}q8[ᯡһ'_WKo:/v]h_h'c -Vw[U:koؓ܅WtǺ&Ym5O+6*4Y7ތ{)>vʼR˄yM,w9ѪWSUSWw׭Xi/Ց})@ܘfL-^}5ߙæ^zHq/[]۩]uNyJuX wS?W/7ʓmgc|H>ǏBUm m^tz~遢/O۽+~x'uGM>w|Pw2yн<߫(l֒]ɍxյ63~YKl.~TvؠYVo+?N}sFDMmAh!Y{Gd(ڽ:y8W!Ezߞl僯M?ˊ^Eu/FrEf,٥9x>;_`1Ch ^6^ec"WUv볕广.VppOdMo^= Řlyy>[|T`~/M+7ߗ2hkGe^Y]xna}D~bˆEN*O~y,|LNOgۼ;a[͎m5wWSS?LSv_ј{C)$@ܪLYiȹHzSWpem}p/d5)gZϖ_(W>bëKIh;['G>N**i ˋ~T쨉etyO֒Vۼ;'%<1D]q>8\oVl]|v͹9ߜ߼dw.}Q^lqQ^mqW~Kogxˏ]o/c]x-qoW~DQ<[ŃUʚ(o7';]fW֙ZhRӝdoy}%xռ=xATfI<٤yZ\w<,ΓE^m{[yяS23+BGfxVۺ+n_zM> |Rku d ʬ Jso)ϵz-UД`Z_<,wY(NKܙxfa'3Ҿ,wwV}S-YxͿ||8M\~x.,^A52_-śM.ÛRJwhڻlۻqv/n}u,ߎGwjIv|7cߴȼ+k0,.<;!1Wfim``微‰tfWvO5-wldwZ=dV+ޭdN;֝-jlzXPH]fZY~𯆖E͋e~]ǝ+ -m^%.O[K|w5oͩ[^k.*|8ȽD~*IcmI yCՇ38yՇ+5!yk=VFf9=۟%~HE57;]}->Rݣ uM ƴĺ"P]]N[J~Ww7:g'Yľw;sS|b|zkѲƤI?=\aTR'=8C2ԅfo -ȼ^XafoW?vb|JPcf^b܂Yw#rR}][9Nl/.Kx_ڔQYU Eκ קs];w6E?I(>+^x.[]&F'>.ٔ7(e5]+-^M!9>!&\Mputmbk[E|?g;ώD>J.:~;T}~`aG S_s/2%f ']Y^M|փԏm?]"$)dcG]^/gm νv_}?+-DaGC"jitkI`ʀ[ݵXRb~Xe,X3h*fޢ̜?13`,2e˃ 8?hmտN]kg!{fq+>;F\vHuĜZo^gl޲x煦>ꁫDfh}f|w=f,njf0ߑ>~Z0VF)@k*\{24h43I^5cj}njό52?z3urf;jw ~4nd/Kqkpww"so ʸSq?½؆Ģ;ѹG蘆f܏ZOo۰ܦ6])d.ܰt?gm:8зbqq={Կ-4<ӵ0ɤD}1L_ӛCOÙ0f}fbsgtޗ,8f][z_YkrU1Bl{-~pnLcR~#/fUފ>W~?0coMxKCodܺQ0<;>:}gR+_;}|=Ei_Z:$nsf&Ogf̜¬O0rZG?m@?Ӌ0?r]_7F3U!A~Ҧ#ם̙'2?*.λιs/&+Vl[QY{oFfufs2y&T}nH֝ڀ o/_~Ց{৻rBr62ʉ2r -qn=Yiѫ%i7?ZjJ]gAkV0fĠ̬[5эzHL|=ѹ@^Ȭ[7C2*DdU ">&ݠ<7Ӣ65%WJF{H_\d_=M~azAkJ,n0w/Wn>8gfEakuM3е&Z!ٶRcl寮<ٹ׮,Klcw;6xZd[!tK j y00ST@~Ӌ.]]w[jb "#5j}#_=ioZ8` ^>z=27s ?y/$ͰWsJOMIͮ'yW]PmHfqmdo]^u-Z}dJ{?ٳ1#PM?ڜN?_{sO3\//fDf5̔E6Z뚻ydla5.Yȇ[ʲːWG5e8vWC3fonI`]ayN Vz3rN|_j{;Ӈܡ>:{5Uヴ\ko:c-qf:Ywku]lj4φ=9;e5/+4 满mK6= ʹv'4g[aمw>v).W2tй:˘ z@8x3nb3_*Se_Z_>r%*;7 - / )t+,Ь[Q꠺,<듳H|W4D:jXe4}uh6=gn_~ׇ/7ff@7=2NCOEbXf3DfP ̴ҭuVͿLpĄкSmՇ+.mjc._YJ| 0^[oۼ3ӧ=3.u'hdFhJ5^`kˀ>Х!?0Ç-f/da ;ed&,^k.G#I{Ӏ͎_*$=7* +{{/raBm -.mo, .B޵k;`3'? O(K2úOa =o3bfօ0n 2_2Vx}=8j|։1n=Ww;Ap޽[!youӫ|(ήf__W чz_EH/$8\g<QC00#Ǧ2Xˌ`ƌ`Ɍh 6n#3z24Jc~ ]qkrp,[n:w+TMYvnMGoBAYodݾEQKS&_JbuO;^5sE#aZ#}0#fF1d&RxfA7rwݺyiSoߦOdYo_×d\s c8>LF2͠c5ѝؠ3:fL@fX_f07fhOff"2ٱLmzl0tmlzҳZMO*߹ɥn{v`7^?üo}kI}N Wfoؒs!ه$i3ɇ+3t;˙ACB|&gd>l8ؕ1F8N1ckl;3c)%Ϊfa߆jʠ`|tEƍ6lJy׵E^.٪kco R_\5LEI׆x \?Wol!%Ͳ18 7NYQd,fK83n3j)Hpi䁘71l)3zLc U̮zano ݿ2|gR6J}_pCmߜhRUsu O{v~wcK񃦎[r6};~Ǎ-Y㹙󱡱?3+[џA/I2N4fh?y9ɏϛ.~Q?2LD>a’]hk^ XX|za晾K1a?R6$?]Í)OvlF=ԮW~|yO?vQ -[}fMc9>Ù3c1Ӽ|63!tZf1Ӿ32Ϛ(`6弚gY+w~֕>n۬8caCg 7Lz`{d`_4O !3&,8}$w.Ӱ]!( xOeOȰr]1_8C\A<̄tU234̜&..18.@aފ;km2CSo1ZliMeݶZ?s/Fw -fr֚8q!iv}G\63IŌ81=irfw3}i 3e.LLL/3Zg,̹f?x5>46r?Z͏+տ[sש^M;hpӠT|nT 㷉ғWFh[[5?|Y+|>3nN3+qʘ|>8tadA4[bs5e4+՞^?T~t?"?* xed_|Ws_-CD,P>m~S`KGSthk2#bĆZeyZiaKm`f45sKf i0 _ "}5hW<5,re#U6U|ds MwKKla-!Tʐ̾G{ -8mp 5v`G}\W,Mڄr)gaSoãչ݃Ldیւ6MHEr~dfnp /VHKWC/?"_2p [Cn78-xr옣۹X!K'T;{~>|'>??k0_8~?HsVwZ^Oj߄JmV]ĺ?O=C^}{Nq ZeIb?LhRGcFOcfd3.qM]^r?F1,&I}ѰԻ`K/<ŧ_~up'ŷOJ_^5( V$2UI3Wo=+zR.=y<6GaòL; 5.^z/]x.]{fFоxp_{~~_)u}V',uv$fL2 FncpѐLVI./%/JoՋpjt⵷YOwE>Zm~՗>4*.;l<7^oG_GelW 3$~ _~z?Cn1Xeb矲zI@ -3z\Mzvi7!qmf ,nvyTGe5߾Tۣo/4ޟy _"Kӊ%h<)|V$zr1>2Zd]\R>C}+}o<߫汅-C]#;K7w?<;r /*\5n6SvrPIT$fI>+?0L r|$WYyp䟋# |Cow5 -a$.8,6:|mxyKUa̢Ù%xLxpa+s5}-}2OGޟ-³w}!.:^k=Ļ4מp{k4M}g_Ht7>[e`>%yڳ~&{[8Evr 8aXjߖe Xĕ4=|8z{1a ɖQ9#+O,O§/co?J}/C`kOgkOtƒC]sq<5 /0W1)fe+E/<οU[?=3Nn~`3}O Z-2gƓA7Nvsq z0ίW;/Mg^魚CƖW9;N ~z:_WfVՐNYaO0K(`os[_ggmV.aPhT49;Wc,< \ƄhM" R Òs7 |3BS_?zZVv:r5_+=j9l.Wm=i%YM sznS5\vSyܰ2po |y1Šzg}dn h a ~9$'%x1 'bV0@0SЄETab~p\[zh+,&XYs/*8 E-CCY u |-[yt:w_~bݝ/JRzpZlPqph~/zeTۃ5F>@=O¾}ӄåƁRAp!o;rU]0U޸s|D*Ձ_?,WB8 ]{,_y> -6uVnj}"N{v2;oU^0(?2xn~j@+c_!80I@m*<׌ 4U7YN>}}7̛@) pŰ$S}zvGs|MW2qso0 Gu+9 ۆe]xingyt>?qώ'{n\)>Px$n[7ײЏ^ܱoczy*m(E >LcO.OkӍFlV;՚z[̘>@R7Ͱɸ/^ɸ/Z)(XqX\_gƓs>-]Z[99=R=ݩڣ\ln nTo\#cեsV5^i={5^!t:ٛŪcN RGб=2hO5Gƨ9v d+0.~Sj[WϥcW^cG0_a5&Bq"q3Wp3E(n!fn37 s6;[HUvoAЁ77J++utho7˭P#eH }?=\ŧk,.)OCCӱ^hfQ_dT199Aɦ\dZfƒYFZc+$YB+ KmzՌɶM JZ7A\E>NpBf9`롻k1Ta/I%Gu'&N|ř†H0IjA[TkS^pV6p ̒"o&@a>KU\gKf=3f)?_t|ztNO, ?II4U2#cM)Z5%å-.co/&4\}=ϗBGAHY |ù·ݯ\ptP{4< ,VuɋH+E\>Gu\5OW>/?5 (>B!#_8H<6|2}+B[?.ЂK);Hr)\ۭBC_)}zPWߪѧ?]6}@e[^RUӧT?/B l[7nϻfrGsc7_vv^̜ 3ic33g3+Wd|$7Hb|Sx*ex h zZOÍ9=\1Տvyt% n.J7V<4Pw+Vw;KEĒ>`5ϵ\ܾƷ[k(qV>W8:H>2B}o^ٺS]:_88Jo}#eX)V:|,fy+ohD :0QvS2讁C^3A -zEC~x80R(ږ/)vfw>^H{?|!z+I ֝!|_(_~?]9"'7k/UvS V6gKFqUY| -VFaMC0sT\aA!Y+1K.dV.&vb<ֆLZk'ZSLAI/f|VTsv*>3iGg[hc]t~mb :/ﻊU=0w̷Z?Hq:qduYv}r}.8u6s[ 2}.ԟ'j>Ҙ2?RFTjoǦ _zq7e\+l#tnt~3<{Y.7r#c68[#NEۇRN3I.^gX}(eIf7 s-R+YD3}.:Xx R5G4x{SڏIA\Q:=s %VRapՇxq{]u`۟-;k`{\^RsVYB"aYb' ֛|u=R-/aawo_wߨ? W.dIksCܝ+|^\o~ꂞ^܆'1 :c1\7+8RɮThs@_ x6CbzY?0\C_˧hCԨ e(Vr|i63Ixs 3 3)ERG-ܞoW凝Djd%Xt `3¾#vOT3˼ ҝ#HH(BR:*Ob#r-ӕM1KFΔU=qr)n˅YTSd^ڃ>:}>5gRcʣ c-x*h>Jҽ*zʁU=rOD_>MgI ER }ݔ̒) RDfr?uʰTS?E8eTDe++);- -(薀/f; n>BvXLpT/U R+H(? PKrƏfAH#zb!gYS5U6`ri -,㉯Xo'7<0  1p'XaKġ^Ӗ12J92⼠ -\}pxu$2E^!XleZSm8yt9>e5c…6Lb%1cBo$(DQ}CĂ|zu?ep<ՐVGͳƔQ%P)3|XH2H.j -M,syX'Sʱ$G0b#rͅBtnK9EX=cIݾDqo W,ʼ4hvBO{>elȦKs0Gs叟מ'O5<8BH(eMFwRa>5?nğY8avuV\䐚dCRT35ṁ1685'o1Ow聬;L>Jمe;FϼE -:jNqdCUfJYCNkbNļz -GƙI*} Pˌk*K//T2z`i6F$Ò(jں#fhNB { )U } ";r30CnvѶ`j>]9P[/6G%tSL -+6" ZRz#؄a^*0#nu9*kwTتBH~Bؿh,Ϩ][LfJG@jIV:$F@oKXhO5 'R9N͐;o{jWjv7 υW>wC=~u>Y.巐MBnߏ`N۞-zF˅;$Idr+nuE&2p-2|y3nr)CL;aݡBzpR:vzh "PÀD"QﺃL}SJ5vk*r4DŽ[27H3A;tq:x{+]1)Mf}1xAQa`ySFtbiQ<ҎKtVț>R][(XTa͵_]: ڲ]96CB{*/aM-gJu+vlAڏnTq`Sa)Zrdx+-՝xDnVt0fXKH<%Fo&K;/tOu]_,&A*!8zPHs&[n̗۾Z)wuStQiv?隒a+֛6]hNFrbh&Q^B-41K7~R[`քjڐq \t%~uptRxj -^jZj c cA*3 8cBbN06*{$fMz!!'~rnpʮz5/4.FʻGuBW+} טacI,㶛2i|Ri`IeU4]=_):^.*Ǖ=ΔoBHOMW)*kԺABZe^&O9Ќ!vՔw m u'gjh5[/׶>4_^gY6yԞ~Ajkw9<׮!0DJSe0WW6R0 T}6G`kS-r.ڝ=w4tZ-tONWp*462-6^^gtRsvD}|@yS ͞\ǵŔōrRCsvM-Fr+RERg$ހM+X^x>~:< uK4%Gk& WO5mc;y[hOMEJFA|+h5,4uKr͡km%k?m'f~<]}ہ` #-7R]`/ *N6\$5ձ㓸=]ugoF?;ws;wtabN+М}:qm#;+{xyHbޜ.VJ4C\YɵwagyM-'ב8*T;^*0|v@;kU:<ڲgŠqlu1V8Lٰ s2m)Sy]X|nh@dT7tf@cj'URҽck$BSEs,nM\ /!7.H'^ߕJWiQ6g^'=RW"T;l3< Y.jgiM;;C -hԫUNMj )6X-FQhWC9uHMjz+uQh}<ʝq绾ԝ|~bvCXwx]7CQ|z]W;9UziUi`$/G\u>T`̱ -9'+.4Qjm({U9t^ #R5n278},jgkvV H~Tl]m\~ʭT$X2a,gHf`-zbavT1&ZяYm -}&0)zy -Nau=+ $Lv=rdHΔPf%PE3 gp7f-Qul-v61ϪW;QRR=>}7!i3-,+C;+2>HM$Q굖T+eP]K]fGuyqĔZQ0'_{_f5[L$Y9@k|pMНwiy_y;h3{B MmQlt9$9} v -Œ| rísa#rBJaR5e{FmvG]F}^㓅'+KE5{-s{xS,5bigb"PzH|2F|EfEZb,4i}ԅMô?l {wA 4~(>mV-|E4MTe'`,n)}@fR]7XYj -ojcuz -tM4F -7RBդm=˹+vQvVIv!q/ ts]0kJzf97 %>pb݇jogl׃G-5mه\c兺&k g[ud{O;8Ў6}=X?Yg|z)?@ -dF!G5R2B@&D|XerI9&H &ܚAj"T[yhS;xq桝R1XAbhgY>ﺴ{mzI,Rh4IbD&Ohw,Ww"49tv^&̦A'hT<>r*>1Bm7PI#Lr[7W 6Yd5 #u/XJ;.T;ϵ|BQfhga.j=`uSmuv*vVY}N$y_|oo '.ϦV'uM^ڄ#K'45H^9;VK&ȊŤ&oP~'s]OC 6r/naT<#9JQÌ:#"~b \ > -hsy c2?n]o"|i^I RE|.ezVngT; , 2JSC5jS+P#|wm^.qvÁecSK5s "=p-z{7Ѧ;P 縵T^Ip ˑGX$ZHc68`g9yL*H 1Wڢndi){K).D3Rb=ȥt#i$qb͓m؟^nga]Ps MgfB@e+lqD hA[{bԪfp]S΅ K? ľhþc`\oh!7)o"@;(NϠ m<;n>W޸_}G."QTl(yMe?ǘ/%4~<~c>t 7|cX]s>?jgA+Y5>+;9vVivybt|]a#5߇f aa۹r=9ryh5_=Ntvk{.>_uD~ǃoIk)гOOeo*DśM=y]zd>w"55֟*\_&oyBtS)4k>䵶AfY2;H>wBIdr!I=$:Kl[10º1hAs0sg+h.|rQ#47ccBיJzE+/ ,"kaTؒϠ kmĈL#T nk"1F+QKf5si:eR T]V@Ly@6ѐSEN"6n69ObkHOŚ#mqg`ʪdFMQ07at=ߴĦ shݶy\zqBlT9Kr|1e4kqQYemm$aNm?O5ֵ{{߷c$ւС7A?>MlBllt,tͪgރjU'\6N9*֑Zr<+?"=wmtdVQ?=ukNM -?i~ rw/:$@}U8u j*5sEAjjcTzmtDb?qV1f`JQ}㼄mu ROQs:#I>KS }+_Dg[?h>Rb-J3fÇ3ĺ`-1Z)tɦQ=tMő T&ՎQY6z sqϊjb vQyz8Pw9abonIQx]`t=X;=]J)cr-İ3MF@ yyo/=XC'g-v|L[o4-hZ{dh ~Swyʹ1̊ƤCKi<%0]i'D;|q \謣Wk⍡_A5UH\>{X&P 7i ^;4Q$9[ PI?ޛ4A݋"Ͱ'k)C֘U[@S{cBj_jy ch߫gtMIXC=H䌚[Eb4r$|7]EMXT#O[y|8{"KMt,8}b/ƏAAk pۆΦ B zyG!l/Ljρ{T"h5CJ94 wijH.]%ڍǦOܴ{T+ڎ=Z#U(U;t;.e[?[o8$CXqpz;eho2Oi$Wv³XЭBM81w3$ߪz8齲ͧfm7I/>oVqH,+ĵ|k=ʻM&rmqWsۮE/g}L1>BS{ՇȫI _k:Zhi|TM|)IRsY 4IVJ[MF\I|TGj&ZoA_Zb< ]\wI*-mCc\3MIH,Mg!_AҖw9ck2 B <ꦧ{с1J|4TO ZftnFSmOpyŚ C1ǥM{O:WЊ:;c rJyl@sga --ϗ7 IĠ -a`>L:H)D +PpExT1~FŮ2RGÑ7gUfJmYě@>(Pl{J Sɀ~ԭ2VE1 -M2Z-f~`&@ƀO5e#KB2Mg{>䧊 !9ARe.v hEG+%[ۙvRtc1:1uͣeNH>,ThNr-AݕDG&|KJ ?5-4I4 IRI|t+G1'R秭DHʷTls5y 7T!" ݄"SAVqÅƙH)I3S(=-)6#f$?b6o`mIQB if*s;NU}뙲n:jJ -Z ibz{)A.K0UJ*mCpJ)@  Cvӝ4cMx)dD.mAQFJURˀFWGI&J,Q&ބ%ÇkJ -J -1\L%ijRE(Wzf9-0 (<7@fVx)tf uԍ2kVL4:C>ć<T#P=@#R -$S!*\J_hI\Pɭ,9_5;۝@1e:HIVY).Â0 #wDm#/.ԟ+HvL tP*II+g7 'R2t@+45kmABט< c"'Q"dlR`NJ}SKl5QTe8ur\j9\ >`*F&$^1CS4uǧ2 |K9:@"BjD;JaڢQxr%` -z)BrZGƂ:N%1(P%b"3Ȝ7RrzU|?Zň>+A( !ڈ9[YJoZu)& )}-jtvU4 #16fuM2Qk N4լ^k4PRcϳfY U]7H -GC9:\K tɓ񱤪d('AZmCJKoH)o t9 ],r]A "uO֭;0IK) _dM} '.H%c%fE9lFQ:]]%%ǠvU F.^Z9@Rd?D,ynӕ\Ӗ Uog_3 +-1ڽ@4H.ZFˌv:WtѠ!MC rw\%URk~/|W^ON3` Sfrv`|U MHlћg +ć(cJofCWzSLa,D 1 A!fBwhJ,!߹K,֤ڃ4h:;|Vz16XbK.$dJ@% /f[I)ʨ:݈]Xmɱ>xҎAA'ۗ26>}K6w޼mk,AVu -ߤ:8HQe -dF;<@n!Ǭ郮Tm5YA2P 6l<u%ĖB2(w=d7 焹TM۶tbs Ng(%p#pt+CljXPuiO>k0r[i;kmiL<sEH >1]zԧ_ bDo% A8jQou1ą -RX9J/rc/Z&fA>:zbI֔yQ=]L3!)iݱ )-,<\*_+*Tӱ&A Ǧ'g+^ݣyBy2id\H"QmdX*1d G4_ qM-A<]dS2ް%h'5:fqM EV<(WJu\K |%WbIX ̀?:]h2!%2^4#gVۡ#7 -"6V%6D}%}dI5PRqmJH)\я粞1 .f.*XQ҆SSy,.1]PT[YJOA͋pmK݂-Y*a_X!O9H2RXВVxcXm!сZuj2D(G3H~L^<8Np -hb!P 6*H CU@M0(.&W@CO4FNJ<GAʎ&u=+ޠB+9g8=swLd|o:;w'eN!ȫAyCnEj5$n}"O% -#oEK8gI|I|9eN0vq!CP -fbs,i.Bb)Q$2aC[``N?)n@Dso09;#[q433JQ "?Aj8Ԍ"w<UUO}hPԲ\p2h9~*;P@bCjX2"yj3֕,U#%!/wQhR6 -?tƙ,d [hOBlUJYߏIG~(ƚrQIlD)kq1Y݂`"uy//kBBfDI0QƨPOằI&7RZ,ӥQ5 `I[JyZqPCZ/ ~`n%bz[\ -&%)AmsMWfKiuv\Dp@ 7i=\Ѐ5RKo>IyLKڜ*{3PKs -&99H N2Hn -P֦A HA*3R_KbIhn'>=VtjL)e(\q7AJ.I_S3kOlv -8|J %Wr<9AZh^H)$%hq\sP#QiRL@6P$B*l"2W>qa '(MZma֛ ]/@*R2u)V.'f)҆s- 2`~loN -s*pWgEAI'P$vu'HIU2[@$Ǻ^.st9>$5ZN|k &ApC\-K1rʺM֔ӵ:PK;hYj{"9aO0k*tH)yEul:F"^Eeq.a㚨@YJE!ck2۹N+a}N?XJQ]۠>p8y CK -vsN؎|~&ٞR3}sVC|d.ƈm. "-`r=kJL(xS&ꞋrLb+<43[ 1">b5rBIk ^ --cҖp1BnG..ܰ6ES ~Ӯ'~ #z4_jhc ÁӉ.N%iCnJ!׽ -:*t_W.+uD%u:X ޸E7җaͶxOMb x] ^䕵l"Q{ky2}rױ%qQNɰ%PzOki̽33Os\t`Jg/gC4'g -|S8)\MloEO6c%q 1^]B'v.^DAoւ""(:s s%R*@TL>׷1g|'q}uzP7tث:qЙ˯yub쐴Xb6릘"[.얶E"[+Fg җ+鵆Mک-yS8!1'%出bmM|0G\w$T ' ~Nqg1t>_np_" y`CD*VP.:)9q)ա#Ѡvm!S TȸfeI 0&}lOڏ#d95A:c\G ܟjnėS5Yqw8IkCjUQls*tW`WAY1sXNT!B/(BK3s\(=<&`;atl2a7ׁ ,na8%XEg\IZ<*Vn}]9\5tEx#ȏJa'A\:~m4t%L-G@naH&~7?\8. `kxqj7NwxMt n*S  :b?P`0lnd 0؏h=3*5N^CǸYx>^=d]3Z{τf?84F \5g9[ -?`ep]{ϹrQ[*z8e7^!Eĭ)眀cҟjA &K 衎J]cXBs"y:-X2V -]j%xQCcC1xrf`xc Y ( Zp97P%7h UimαAN)'O9? _Q )j1Quw)AIP8 -A8#/p .KȊ=b9̨Dr*USشp. 16 A(mܕOSue.6sXNG/=7G.yCf -O źדs0|y4u ץD.~V0`@z;sWN-AW)p ܚ8 s W5!585ndM>?/8-)}w]ʭ3J*ߥBwRo7qKnȔOK W١@NVPT@ -:*\sf -\<*3!=Cy09> ܏<9"(jiR.]T -WLP셸>ⅠXǩo@,x9(voN\-j{}xOm5lPiC'pap (">ͩAPHODke5#Hq(N5jpjCjU8ĥ1yR|\û~(̈́d0bwV8U -:ҭC& B\Zt{&z.֡Jk煮> _Jy\]e ?;A Mb~u̍IVO,KoclSAwdX|19MuRUDښF;je4 !% AyHO< 5_FF2K%t`6 m\{:Z{ؚHUeڵ95fAXqqSK.ޘ5O$Ԟ`) +Z(GX"+~3.PsᒼlWAӰ2xEOj[bf, 4gk#K|Q\&4G l^ݗ!vՃ@'SUC/5S'J~M"Qr5UdKOz_-4@RCA-;P Cj.R#@Hs6+%178\r$RTA iąCɠNZͩAXzOxWJyIrj.CjЧJu_z xENy T0~Tej9~ߤ -9PE;2POENu1SC]ù:bkG5)M`p9!PՁ\*pt?I|4}i!~F*7g=m]k_'s>f>tQZ``yeͩ;Gc@ 󻿎 -{ |5}`uO]NG+Kb*5ı*Q)e4WE:UP:LnAE3UPwCB%P#ʁ̵`n{\/ p3:Y񼽂SotIM @- e2Cpș/%Nja'BtDaqjρC<9aM^UbdPEC5ScB-W:P yWF@ -{*HrPncugu(FC5\r!Ᲊ o:ϗx^ 47fTʧveFx1.U b&}a]|T+0y^EI,vJc":z"jUywe2j"ϜRSVN5_st >㑹 M@=͉G&=%p\MԁC"ID}"+P\v#} @6 -~QSS.Eυ'#V߇9N^ն̓-p"Τ]@]8Cȷh+M<7q'9vzC$>ٛĞY`n!g zN5☐x!B9u1)\.bXa\>fX~O6rJO#1cXHP!~>ퟻ -+{0` js99ȗ] NPlz!r 5H^/SA5ضº:Qc%/ofP< e)aI<1AJff]\50]p]*\\{\W2(( QA7s9x^I˸ 1c~/GθM3}nxT95|%N/(k#e2iax3 ;8L -`S;ɍE?6嗿 USb@vk1 {uޔȘg)<*[!-v5L \ o7廨9U?=wޒعLVJs5t-Րu,*m8Iѹx#9O/pJQ< }y,wVb]B!T@jdar#9(2w^YPfI\ -B΢3[۟}ԅY? ȷߍO~YH|LPgw $/H֝kLmWB6#(:[RzU`+vgbZD$O&6RM ^K$O^Ԟ2~Xm&KKԥuZt|l{vü~/ұ*f#:Rۦ!|Sbl nSS!w)5'?wy~#&aZDuGD9m$6A&w0w6sH< 軟#&v -bf4INJ:]C_HRŗ -9FXƨN QrkE6 djH -\A&4cmRQH/<@Ӧv{x~ہn|Iʼ9*<(ǘFe''-a'b̂Y _(&aMDKk&o?\6y4RFj֧zޘܭ 8I*2  o0mj. IȅX^?6e$VRz%6Ӻ nPbn>\A)q -o}_MԮ#NM%t ҿ -wT6,` ~{BUI&Q ՂL}wy|ndGSQkY|-'ZZW銟z(J8E*{Pcb]v\ ӧE$eDWuaL.N,(s #wBbƢl e)BVˀoR MA _d"Ω=.i8%]xUH藉 -Ήr/{e>F݌k;N~>LKŽg_&}7*"?e]gm7ʲkTfJ&ɟ~uP̓v$ɔy魺Dj('{ZqַE уeD=h$ME/LɻtO̽6jOH2OF~;|>˔u\/ҕ:D> -}Bѣfto$lr3/ 6ٳ֜lrﰢ&3>kS؇Z^9MΖc\ -UuWeuHW̟\FjоO -$B(A^%A]AmYZ a긬Ҹ`qInuI&8݈*)(瘤~m $R #k 1$Q_%%%ޢ=_E@3͉nޑeÏv %~s58¤8X-moj;y~7hμ<,LHP45/=k9.zsz/\RQqM\[ kiUtcf̩1G;G{.vTKk,}&Lq9}Сޜm6'F^\z1.Dkz@="$\&O]HTn 0):`w ^-4D5ig֖lZyeءa&kaSǬb!:ƈvwI:ކj{1)X˓"wkfR|Hӻ&uM-b3L{ɶp£]C=J<` ~b< \g$Z]0&KB؇$;mu{++X۽piPPa?41]i˩Z&/j.Jw#R8@UNZ<;^Eme[(jiptW^3U\0m`.ZR#ʝ£+#jnF;\l1z.Z #%uIȅ}?>]'j~~@Sd W+ޭG-RnƩuBi\] D)yzʸIZZa'zc*Lu0h[\x1HHkK~|}U[x4rcLkwKwL\c[wUvѴCca NaU5w+xCn{z{xU ZvIB_ J_6i8+-"ypyL1wğ=%Ʃ挨)qgoŞj'M*yq{P?%vm3LKC9tK54]~c&C:㣞qLI;cm"?98RSbucp[gMoO[PjCZZ +UV%5~~Jˀk٥A!>gÍj<ͺuW3iMWg}upika(q7ALv᭯^Rc\{&憙I -j -uu9ے'/c:udF97yG{FD:߭ +&7eׂs#^مfGoj7ɪNIJj- k7uQ\P[UCu8cFQl|ܣ" -’ -]BmB{90hc?> ;û'ldά0JT^vѹ? 7Awm\ *lHh ;ҝNh3) -㳽Is_۪ʛQ%!.!*CDž;ޜ,)5~,i~l6zrw]ѫ_5oJK8Ӝ}cf!z^>$z~{߫|t5{lΞ0j(±>q]u[V 6 ,clc5m2*]LvڞYju/W~'kJtYn+giA{'{^r%~oa%z!M+ $EV&U[Vć߈I-sjHvWzvkq]|Cr}UPUeD|Ч,#~!/43 -YPs--:a+nĶ<м;;T[z戈z:hf5553(d t 󏘥1OUw8-FgxbS0{w JN5%w \+؏a;쎵gFT<,p~SlU#_Nvؾ@/>cURi7t -s ^`/`^tyupVuo[GGC`Au_*64?`rQn@vA[wCJ;Jhֽh -ڨCʄ0kϧmFA~m+ Jzs#;|Ј\|`<;iLwUmˌ(ʿ=:[DRSh a?a)7 ! o/-Z?hd~6gyƫF hb5 Ľ]AgqS{׫#޻$.pv1$55Y]b"l_˷/ L(s - plnvfK'\M+iZ\]v5S9u1+e d4F4%?!?_G=H}^Q̷wїzwώWZ6cz?>L5k|éFỒFs3_p|C &< h԰)D4Rn"i5e-Z:V5? kmaI_׉.!yC?8`ShRaߵ7E!'BDx15z5FV}l=u ݼ-{x 4;~ƍ_= ܍oދkD*3ﲫ أLGǬUбЫ5ob,$aDPǬ.oy[,!.&H=s1cO -~Ŭ.s4ܟO;g6s2xZqsjˬ/F}%EC\?؇9q -{=ر?ܷ=̧Fhj]wKbK]BKoY%uUͭ6WB&qkp w皓㞿`Lcӑs47Iĩ[ѢBJ -"75?pFk9a9"9F9ŗǾwww - -˩'JC]tJY5+61d {9{ca hҰxa4hڈehh4eZ4kZv}7B5ar0ɧR/MƄ25Sm/ nntsNPaďwH,AV اU1)^fM܂L߅fOہflG3nC'lDGm@SǭGSf2ؕy}SU)v ƾ995cB2JJR]YIo_v8Ka"2\4 "x~?b[MMM͚w-Z= &J=E+k&~g#r#" K">G8D<vzhkZzz,Mc9>Gsvd̟O0b1ih̭h}h2u4!Df/5D -sьEh -Gm[&g7H> |ᖂ!16 /r 83 ǃ<_0+. -)( c yWnɖ]طNvr4gs=8C# Yhؕh h}h:)Z4Z_'b4w1f-'Ь<4CA͙ŽNPj^?[3Kd;p1l9@K525PWB ԭJ~h,ӽusv=**P͘Wqu\rsB3G\j<zs]l /a-{ Ǿl"K/+r6r3Y㖠iaۈɫ/ALzshIt=Zjxu嶻Վw]`|JLu[]+:㱕( Xe::&&9gub a/[2t)ͯa®[l -vj'ot/ ʻmg[ kRw->bI-,ok>ُx,}_Ex*hB5l+Y~ڎm&gx͛͝WPAZZ цrFoo`O9͚],Oڸ퉛@\פ|B?^:F1qiou2`OiTnNSאoáCc9zi椵h.6hv3l-^ru͛cJZB6rh7ZOEG_o);GUV7dy HSuia:jLHx{#"͈MM{Bjʬ*,\BXr޹ql#L|dُq} rQM">qH-Q{f.T~ɮ<]'owN5eCWQ>E5]uU5̞7̞}-t3{{1*prπ;`TZr-&d>.df_< lgmӗd0j.7e=ZF32n=+kczMH0^Rƕ}e@82DӐiY_PT}QQ¤20?aʼb*ʞU䵜z'BHE%?]{6u"7|h Z$Za]ZKhchVXV@kDHQ; -Ob*VM5eM?|.B姵n hV'kv~)k+a)~k*l840 3z*EXYqŹ/ϥ'L-vpbEc]k3A$ɨ'4.Ō[j7x(lG 0νz;bG]^{;ޯ!adKݢͪ -(p -v q^{oOحZe5w\|a~U10>!ePGpF*&u<)"%Tﺢc2&|o:MA{͆h%kS,&DKVX=>m헃?Sg >u-e 2+f Y3kmɞ䕱kV0mK|^BVA'ւƞC=K]Ez:K619J#qi}y);xN{lhӦ7^2o^)KoM$yhhEGoCV h{÷(U~iajV:0V᱂[Vn*>Nl0ϗhtZ謇mխ);T4MF{čϵ%X4E%? 8*XN?eUxoY͆/>ElG}FiW§  !;)I󩨆wWd5W񃻅gn3w>dh쭜\#dyfmA+ 09ٵj>_Ykmo9Ac[\ھ+IӒFgii== !bg"];-ԿJ>aԇ 0!Ze/cvZ%W3&"MaQ kn+QYwFx1lemd7E + +uRcod_H]j~nse>؂P+zVoBd/} ό%Խ -|mF~N?bi@6!HhM#24V Y Ç;]I6U#ݥJ4Y}zVOk5*b^BQHFhk۷#"]I=4AGE/{A$%%ݓq@Km=3NiD\^-EM9b[()?yS"`o*xy!ieA>| ;);KS^V|b-" SϦռ5Ibx6'*+Y3ZH]EITFwF³cmC2IEx~@L:! pN6[$:'(B ar292͉T'k5?&4&'}YvD(fdRu=t:|?^Mض{Zt 뻞Q~%TAϛ}voR=3ZUDʀ*C$Hh#E'3W6 Y|>YNӖ] NӕXrz /N_🨪lf`޴aR۵><0BzB9wc$+NM[ElÙa&ZO]a&y"#ޭZ$oVת8$EJ|VHn瓖~Kw ߈Q7u?e|'𼿘rwZ q0/?f(Fp6{rDXۃpTpj.a:<)S]tT -͆~F\?&Rx_vQQFU"Y ΋ئP~ȫ>SHT;nodԫ.)ׄm?Bd j/;'NgL[dm鋺eťTN0RMVa)Z3a!:iшjH#sÉWG -dWGܧc#.zNڏ㛚ˁ2VrTN3pѩ+cWVA4""SIu.MkH]"SԤ?pa|n "+ -2h3zHAJ^Q{L2z"n7[NσԍEDX6^UsK0ZϺ(w'rP!?0<7I}HsQ< SZX@9'o=[n +vc.)`<: >YkزT|~N.}#LVm2u 0i0:~F -. 5ԫ~ yp/?:~p$1´U"ep?$,'-Oex燲JTMSeFnb}{ftgha߆t (CZ:쌼"p*g"I39mqXӏ {$4 Ug7qa噾d W!K-a#@O,ѝZ8N*jPzxD'u"& ##w39&=S?l^MfлtaBv]; ٌ0fxpDk#wnڎ6,Xvoۏ4 ЈWJc?h~| (aΆE䑼Αb? Vc cvwuOuU/O_ʝɳᛠM\_AϬUDd["RAJ>"ǀ6$7.~|yyuTob98>tD>u=&#$:mY+Z%X_yI9)kw$ro0a'w:a\N8[4(A*˩8#zWw1o>]gmU¨Sʌ `Cd;!Nl,kc[vDdr aJ 3 -Б򵥗2{{?[kQ9-#uk{~O/_վU{>vvӺC߷ߋc5ud&F}m[O1?6@1:'cTKެ -Yp#럾4{SC <;3}/]>11F`ŎO~dhRL{\_ZKro+N ?ld^9'cy1Foъ4 oΔ{qm|_Kҳk{/{?k}}M)`lwS<7 ` -WZgqs}\8svf·KM_`|15m~%ORm(n|{OܽlpcLy̫P-/:"}ø0Plxo^k56?[ca΂` -ʻ7\:`_WW>~~x#+8߿%\D֝{Ced0ż!45>Էc"o{Пn8u.\E2xs3aВga TyX5_܇6ƌƵ!+Cy0S9=A`'^9cfa?YsFx3_g6vݽl0Ph W"b תS76#O1ߛZzRէ{2۷x 3o]QwGߺdBg/8(صt́ ݛ*}K&̞J\\0k 9cɄ(~ WQ,~5͇&Eq=JƵ'~RNyvd;?e"|s(u>]w~a럆\>chz&A;o75mwm8땊9``L'w?77,̞8fkE$=ն' 1V-w-9v~`8]aL%|ӂ޼ -cNВKC]/իP΢][u"siO|0?5xgx]'>q%̶p*FkjwuJ[U4-k>aخ5. :d4I0&7Ɵ?К t,{xb׮EqO|(6y/mߺb<7W-?;Y='[섺 -;1\cNJfi@Hy@2}i3Hq1)_%ƄE* -Yv(si1.>fe:{ūzmWa\.YJO8u]?S#^j Wz{e9?UB~qK݀&bN=W/,9x\}3çPEpw=hx{Ib9ayj+k -JYq9kN,qnW.vƉXGxscn}`> -D0>WGA?Xě2ѴW(_Q39ǂ sc\@ cm{OΞTqm`1qœ 1X/p<gN|pck"~w*u=;ヅ-+Iz%7b;.wh~0a`jO2;س̦)g>rz;:ۃG:d?TS,/_Jn<-xi~0W:31#ca53\KDyn:$3xyWtYSbQ_A oy_ ?v^ir Evӂ~;# Gs}`?LuߡQ7ǵy033\{^~Icd/pߪCO~ y{1Ů;ڦ}6/u1Zp -=Xo_ք͘ h)sꖦC߄qBqM/yW|ys  _qܳ֞ 8q)lձß44ݿT1gkx[U.(զoMȑ?79I~UD[_12w?pںw yËapE}#9cCnQc̭ ,5އΉvo9;rׅ=m?b+&BF{;sY@/{O w~F1w; @a n)o󪽗5/M`Sboqr>Lc,9շW̯ h~4_}y?NѦ[0 #gn/^;#c7?x5z|k[.v/{ڗ^uYDz#o]8Dc^>س\9߹ߦpb y@.wMvO$ȹ}5|=GP#bϢO~Olٜǘ?{C"ܻbM?c}MMЖ}.iG_z|05tⱘsB0?ƿ_'sf^1{&0w35w;3؞rfݽ̕ Twڳ"@bUMdvg/tϷ7=sg-4_1lS8uBShxݜ^fsrb.\zRbڮ=b*?xK7y1̂}+۸{㙔nYwv>sD "Qݖ=) t<—(w;!̝]}O]1cWsgRNo=xތ@m|ղpkZys)?1Zn<˟Dτ1)?)79Zқ|u-+_{Ο*aŽȵ*§#^Vp%L]O$Xܔh(,|8ߨ˜F{;9U[^N9>,^s掊WzЋᥘ;kAEC=3Yz2}7r(ֹ4=w;+OYpˢ(,X51gN]+v_D9Wly,>~)o^ 5t?>ókcV#}@6kZ~t{Ot3|; /x}/L{$MN599(1o|q;5a_*W -깑/Bm 91Ztr"aYb_ؚ/m^]׆s b%E=[myc㚂f+pebg6|i96'N&zO/?y4ԫw^[?C姢|S?1ŧr.1\{=9Uч^rm}yOf b, B,jIq 0\sZ,tX^-wKoMH@f4rg&rp-ȝ6yHϑ['b2̝6rgrg-{ԉ(_,y%'m{p^<'S-߲>[G;>aߕsrO?muѕǸϘr>56+r1,xTd'w}_>5Z̉+z yG*#|ъp8q={/V93Bʢ.Io!^1.XQ7"`W`t))ʝMMƵI} -fos|;k>J[c`"Ƒ?Q9>ߛ{:/d-L_9#m'] ?1wCWcD̡Fk왏o?M5l `_D=9Pܔ=W\r$lcAf/i^;v^ز-'7uӂ?F_cCc'L(w -i;k.̝u\/Xݔ)wV3OYYYi#w֒-!-c΋<{)`.楛`~s+P};"PλNa^*(sj^9~2ڹtO=s~GW>}aC/ܦ}_L;;N@C[SD+`'=-X8>r϶7l00﴿ {0[a -=wVS9MoK0ɘ˗J'[&ҷr?TGrgaTߩ>3w2=wV (w֫ 즳}Mqw̷{+ 7uKv&{|Pu=WEmG68Joji_|ĹBw4.jMg}ۼ 0 #o\;<{=y~8L dR(ǚWd$5ʳk`jK_|]/.y?q[R;-wm(ت7P E=u{~C=r`%?~'  X``7C=$LTq_sc^TM-d5g~u+g܆u͍M$ )}Gz6{8&T?0wVK6=խ;+ȫSGxËWWcYiS(w ->7^̝u;+wЮ((#hd~] |s>|{Bd;i \O|O ?Bymq%>~L:73?),c>;b[6/`{ï^kW> ^Dkp(Xdkl ݿ9POoW,91_vL̃[wZ-(=G]  `7m+0c>\ )_oPfC#;@n>Ah~OpO]p9+Ïui]͏&ubSc(G͚._ Ϡ[dݷwXǛ|Ծ&CvҢ\`<v{/M9+ڧ;?;u/||GЯk>#/s)%$u w>%kfi叝[p ԔC̻Ao -%75n5./?c+q]ɓ}q}U -('')b)GŵPGjB|Fжo]k(CU>(ztR~ŜT\ypmϒEH=+ykH޹.Iy>߄[<:|MCߪB&ǵnev9Hrũ ѥ;~=W4E>锳(Lh/o -?˛cx-4ǜκ)_< 1VP3wq:֟N2WC>To9EО'ޝ\C=HugRN,Ѩ#aߚ76D7Abޚ{\uZXBȿ}"Qet\<sQ ̵VBy1gs9rųi됽*-@"7d:CK`^%Y8EuO|')ג 5W'7^]>MM{~1G{:@v リq=}W>q# {~FSd}{N@[V΁9B+97#Fjb=~1=6ÛÏ/>}ޓw/Y9dlkzXbc [ B W/.{|Iy{K>G ~#AM$9^<s:S>aW\rvP݊-Nu8 啫&bBE:U=\ft Wyw휈~/r'ʱ=7#>ǹ_6ر$<$r` -G=t&wq?~܏q?~܏q?~܏q?~܏q?~qL4mF< V9zl"S9rRLvF5Lw3}iXW333.ޗȴ0-bt9,)Q x3Yk?{3ɎdZ㩄tWY%K2eEQȊx9c=X^^D[q -,ЋF(YT쪼RL ++,jg]&Z槻2ɮlJ+I\*w/=+BN5/^ {:S]St+\؛M "a2'Z%SmDyZl_7 da&MLw%[vu>$՞]Hv,x'= }1aZl.r CT=:ս(:+O >3⠤ޕh֤{ڠo5eN!jf{WN9DJ>p&DWk)*agr -O&ӛrG/̶-zd*ᜭq9uvַfK^e¶0ޓI s9ɫ {@6IhrNe0Fx|Lkbv&޽(Xr=0'Rs69 eWhDsyB=%[өtfEkvӗrr?=t'Z{!ck0zz3քtr*Πc`t{SeD+8P dm'VrT\S$-wazERV4[̰ }\Tt+[W̒YL[ӎ QaH@vJm -O[d!L+?P4/uXWY< |t żs@9m-.md; ($:Y.Bǎ.~mh;J9/H &O%*V{Cr:GĎAǣt:UI$;)Y*1%p|bW^g3ds*5y(nPI 2}R.OmTܹB9ZҙET1,e r7IJ6:Vc,t<sΐK9ז˄ =/jcjt62:GcR.\1@="E>%VxvQ+%Rb -+87 -daQG3=ݩxk3ѕ.?oT\RRǤ\,1\9N!+(:\ҙyG)-g]3 cR.L) R*(?d*UWj4 ۶I/hOA!iAf~>!yFaѳ1%[[{;{﵃g2˝y&% CP%%E YtD{&ãpt+w|5jv~Vt7i6rzОLQږ(Y&dg8Q)wLYG·\*u)>VfZnjL 6Svn3cߌSqC||98VGquqgFX3g-Ǚ"RcqugʈǙ"]3 q8;ΔQCy4eOHw07Gā2,H ,)|L%Hnx I_gxoeffU\V-r7\n.wsXnm\6s oНDEL"<N"wND!k)h)z}rRGt\u:[r⃙DgzpnLhŤqHn@7iX4Fň4=)deb0\ɮD{kvغ"s;c<=~͓E)Uja1KL+YˁwclqBtA&GM!H7j ,?0TNamJTAvmࣥ{tr pv@9m-.md; hdEs.JgcH=8~ÿ\\R\gr\w>`ܽ7f9JJyTl9u%8w n83w: QޑI$=';ӗ$өDvz&6=w .ЍtD"+Vb1Lq X|y7;HH;7՟I22Peߙ[k7MOwt<d/mc{m9t:\ VkpGX(^i,.渋9b.渋9b3 ҍКSڶljpWܕcOwij9 -{ 51&/نxrc <[3a9Ra9Ra9qr"t$MH1jHv+BKau#["Eh8-ܨVCa,E-)Ҫ|ؓ{ؿ,L0D!h+9˄rmaw[VҀ8NL'ZCncX(׈+q#INtQ&_ô4V/Cdn2]Ŋ ѹ8c18Wj+史$wdw&2V?.v?JGY-aKeݞfZe14p.ێ?ߧr1Ҿl2:zƧ"cn]JzǚZI$Mt:7jT{B7\pEn"j[3Ñ3Sc5u)vG70őդ)eX[v#p:]==Њl,2ew<}%V|bi9cze*m嵁P\ءV˙[.wmc`Z̬=vS4ma*޺xG+Jw[پiE,:dRG⢆o\n,R=Ov,M⸄&p,2[.Wlgyc0*rhʅ9g_i(8Kq\7[0{qm2ڈӭ7oMZŨ9JHiTl9uiqhnD֒6Jন5[[]Ԍ/Ovj>?j֌$1bSq~cIYBrQ\m ǒ ˺]"Š3}-Z/Xvړ<ʓ<'|T._iD#Mmcs/6ēk)yX5[<_ |$qN[Gxy; -3DN\Zƕ#=duKP瀔uNZc|ݤ_gͨ|bF@Y)?k`ve;ДpߋggC՞ʏF+)t9-Jg98Ơ5!EJ~FT?OVhUu7G)|p@>=tWC`rLrb `0w5pW -'2xT>Bc\k.(n,jm,?2+{׃f6~][(;=2v.JWGܕwdHCxթk#q@ЏPRXM2-3TVX$bItW4A~DGCnjC~u.L*'Wyfŗ3D*O5 -ŋDeU_x%UfUUIaQ0^VPN4?/+1",/sB$3pȩbEE8YUax>stream -V*/ jesk%<|FS8 *ST:"|+,[(ysmYd G *("GxQFP*plT "QQvT/Щd/xhWUzyYe@$)X`8hAUv5QU VGyF ɪ <(ZAH/FE\2IQ=6XC§20ˬv,"^K=`Y4Te -r}LD AUâ({8ŋ HJI0cLA=0^ࠂY00< |Fl a@3#lWjUVcpLyHS,S +#!y6h6ҬkylױD`?RcBW3:?o#cGb[JwHL-3m{,rhr֪_iSiT(IWf0/%ԾI٪hh:zΛF+Px'}`q7p -*[*|R֮?uS4T7j\$&UQg?V^RJȥcWAɲe}ψgTۀ -8NKcAaYQsOPQ%gdQYʉ`C ZVrTBsY+\%i -l|4И,"Q8II#)0u3` 땭[eO<8@# 25@24KU~(_T]`d*N=DOw$T$b.oX?y1gY8F /l6PY$T*^.8X]`wif0'Kk> 9S5g8~Vxձ5j$o|KAGr(è6NQ lvDp`5zt2Dp'uQ1W8c(NG&78M -d+"~grN6{_fxᑜ DG#IKE\͠i 4Ӧ=  A5` Grh@[Ž%Eb(nkj/)mp($,Jݐ/r ӾF_Rϡ ;آ\ʝf0B? -TNhHRA$ KFN9#1GK 1 A` ͪ=V %"' -ʉ~+R5iAu` xUc6E9 /itgEмY:&!v%a\h=:ecу58cTwSgk73vkk߮7q g.eir9s=Hr)Ll<GZQ*E.T9j aP*pyݰ9` @^=2ң:Z[Y Θ"Y Dt0QgAIY\H [Bkre:I$'J᮫j6dzae,Zm[%ՖQfuhEfSTOF£f3pFj>O_ -4:]SS٘Κgt1њδShK+/ 9u6Ԟt(h -s/ۗJX.1Ԇ+'d -%(&h3"(.FBYd#M +Ґk ÅNa&*&=IA a=NCAnը +ӢR);FѨd S>n"h L?]]eU! g^۶p%y'' ZGo 'GGGUPTNy6#asQކӆX5ur2 +p} -j֮Żd~rڂ`|YY,e<6X*b|n]6a"SH|n/Җp0J -|J4ɠLbş>(,@V8œ>IqqrV0uWoXV3ɚ)|1%_/F5A);G]%)<#s:.ʂHF_9Vc)l^ZĠ3%e :W ƚAKSn`MߠyG -"k~ -!YTM~ ؽey[B]NF>t* -dQgVȪN8F_`TL鴃QB`6U0IaQm@ @g  BqW90XYU -d!yeDIbUëEQyVw<܀QJ)JG($'I)S ы> -9^b8zX -{HiERYaM )`2+Q4+p( Ј b`xJ~#dbFYW)xRADgNezGT; - -Ȳ6lXT`GYc\v$dY9_΋,+skFx[Xm* \$7%φn -0i'?=1͸!N r-31I%$)h'4 -& fz@] S-d 9i@ - !B@$9(UWIKaj^խm" "lĂzngcִ+IOg/I Tct!wt!?6RK%2 2lĄ;1j2@162Br6(\( b WlS8Dǟ_Nh5n`ꂅ?Lh" ^e,!@R.E-vL -A~HKtaPކ8+ ` -mV5{fknBC e&F֮^GYve -pN"LJ]&YILr1&:!EU@v:Ƭ"c"lx0L" JYܐe 6ً0D6=Yar0oLF͆m:Ƭ"c"l׀|mZ=PfBaV3۵(+&t+]SAyTt=T" zb)xƽM3lUKWҬv6 LIv,gz-Ⱥbg:ٮU@-POl(3L ^׎l(3t( EˬebfF ef2[Ѱ rPfa2!7ڵ(NfCQdf(;&FdÙ8pfhWf5]2m3J,Y%\F&Ƌm2gCŸ́hV` ,79ʚ}ZE5tdž0CK!Pje6lPfY8i /KaMLvsbZÏ];pƙ 3tCfEL(2+YBUd"^Dp /f—QYVm:bW,\%Pc@mh: uB1%Fei[x2KL4JM^Y82nmuîY82J xkʍ#]PdHFBMEhW!_qS ޤ^P>6 -!PT2 ButlSPd(hz[m3M#fZM^Q>>Zn3ڶS aӌEy}`,Ҟ:=m`}c" U  P?k{G{= ǺT-M7:jPU(Od7&r_Q^e=\;KKW1(x -ڏU -QP_l Ѣ:hɱyEIQU{l=,k9sBy5cTC肥 uxPSoxV3I-GQlrekh&s"6x4걾LBo]ZX5ө^[wt?T%3 OPm)pTl_PB3[t)?qfc,ҥìoi-fHo -%MO[p\Ne=o~ڸ_x o]WQC:ɀ[UqҩhxA~O -:J9<ͪ±b G(@WtݚFx`C"m)!wt .9DpN*ucv/ɛTXd1\qUgvKG1䴡7][iE;*UjSBk=lyx 0:Xđ~Wzئbk+f'C5i:jsn -!; :vёcf ]ʦpEcpxyE1XJ`kHK,`l6֔ m,L/ y%7h5 `4qQUY;t Fn Zti#W 3۠~k\m9vP^R:$)lqBx ac%Dў!: ;tfE_gWsl-vV18mcPe+;pSr8U) iɧi#xFvbSZ)!J/ oasheNtNx;{I,IkCMDzygoj~ PL^@Q`К!U〽tF*mM"85e9 -5F0Kp:H nh[TKl -[hyjr+zK&T"9Xku sԣnHK,z~G"IcXkD -p~0P,F.w P<y*#ʫ@~NdQg\Mx樋z5o~t hVKp :k)aΐgv^BjWRT(H;>8a"dZP9(A6H ߣc^S ,Уj3Jl%#!E,nIA`1i+h[J=O26p׊PcIW)2LplizjfW`]/1V;+tu55v ֻ݄)dJގ=QQxb7&xf ,jZ ‘3^l sȵeEem5/iqjZ2MqѫG,R+zk e"F%#//fN+hF'|AK:RI*8O{/Ƌ&K${KzbAo4=ȘxE5-;zF'),63fat[ƽ%em"ĵhgFeh۸_mT;Xy8PDPd\Adh!XŸ hS|aM0|? \N`[;SU99Fâ -R<C} tQõt<4$Z)qjM{4B<{m\wu&gao*u (ΩS<^ 0@9Q+:pQ ɊK%L橞RyJP uɅ0Zj}Ԃhm!8B 0> Ys|ޛy/s+{q$`jӋTKs`ZHns ʀz X1NAѝ-aĚW #<y - ,IЏ @f$/0l_*S9unWzi݀\鉷ML!4$뒄tg7΂Y]Fhh3UP=In`a luq-{E46Q{LǀΆe5uF3Slkt33!Ym7uQZA`QqmY7HfJ2(t%ʼ%/ d|ħ I\oks "f2«ʋ -Z( 1"xtyQC2ӕӖPpa(I%چ XѳϪ? Sg.Kb[$pw!o59Dv - -sR^o,A:&4TzfRbؓ{=`ٜf${S>6ghu5ti1r3-x+w^UdŵAl"z4!1cQ9-hqE+ZJCϕLd=dW*r6JdzK*5jJeWO9;=5fַ w%Ƣ1pĉe8QD*O ʰ(9*)TMM s'-B=@ 5M~ؗ/}2QDӋ.'9IM7ᙟ(}Qf% adYNP9eeNVyV GHőN\#Y \#%-=v5Iq= RdNŤh<=QV$,N(k+N4a4DثFd>%  J~D` Y \ގ>Wd5d a Ʊ>Y8{[* -Cv?fD}S.,r?1f<0 -G%z#$5}D0<EQ$ # -%ZlQY8E'$*#NJ`1ishVz8RSL 1}(>`COtnTT'0c" -E?]<>EA0i?=f3_/L_e-&7ölD%JVTKm#g-%U]VL0}\faɋ-#Kql+ngnYaF$@uAʙ\JxJT–;C$k"{%Ioכƴ7\? ୿8GX@1Lqj밷p-QQN. :jހmb5vWb+t ς>JxH?7=xݶFk -_+l4ךoA#y/ QYq҇JA+"I"ZpI ɛRհx'9<{L! Ca[_Us?ՇYLJ[٣vrQc2vg*_S}_{'ZfVN wKd~ϛ1zT/[a9Y^0[1~SҞ#ٵ #\˜,\>#!hTʖzߧ}7 =y|3Z It† #~ɳwz!Vl{ -ꦡ ^|6")`{^Dz?gz ࡑ>%!A&02=a:Lb_hco*uO c'|ޮ&վv -'` L LƭXE~/sY0=~|S#$%j<(J2W`|&tT @ ~#4DW5=VK EpO\%Q%3* -pR(я^FJNQZA&S ) -臄y(a8 7ңA7 -? EҨ -(ˀʡyĀRpQ \AAC>| C"`UfZ!R<L( $?lBXԠ0Gl"*( DOmOtOO܋H>,@B-M2Y'^X1caq$v^</!&Jt,o"QPAx"*#!*w3r?Ƿ8 -kz7Ir`^/Y0XK݇c|~>?te ؒ3<);6 [..e$;E/zڋ@.""z:EB.ovuAs  Dxf;`l0v߁ |AXya\;@q -)L`B%ickM@ i -@y)!f@y,+N<#phbv((_v h(DdZ+1x@v:>B'^ E9G sCS?<`A`@zQI@gT$%U< 0*(mWj=SDiG?I޲ ' rN|K8 Q5_ZQ{}/1~^+#"c vf^=ZŅr9]4Lm9Za|=TU6 +p$0|kr~؂KW -p;Z1ma1ǧϞml1v0 =t̴EdڡL;(vVHb|4ԂcK;l5$o}%&HELh B73:l_IR,ɡI_G]=XL+9.ݍ?x7` e1E{\dq,7鈽Lu-^qL{)׃OhIc6WɨNmΎ IN &Բ<X+Zfv;ɀE!D_-?5 {VN<qڴ2?GX06և`D A=hq9ÐuPh!'^cxk&cx%َ۬Gnf.Q%,"D6qدo~53hW4=HzRL۹! -9Ivרg=B~X|xh _Ta߉mUP'۔ۗj:4qt}h Xe3z8R[N2 VSDꈎːZoط(#;fѰ]gQipI 1-'UĨ8ӳq =JH:K|ɦuj3}Aܸ#$\şWmk6'jp46} - -Q|'M^7}`zՑd~9B8]p$^]IibSt3pI sm@=Fe{;Gdo5Ƭx q]ke4W6+ӪT,7)oyfiGgerv5<0G}KF߀EN] F:mL`%i1A& -JȯR.9s?ܟXZX G&7an1ѯiUUZXHC~v$ߺ_OL~;[avBI~W]9) JHn͆m'L,np !#б(w^c۟{̠#n I zlm4zK^l]K΅ Ft)+jGI]-Zal8~_,6Y0ԉK6iV;d.RmwbTb V;%"6{PxNm:-zu<ƾ, -Ք.j;jJ9#O =4 *(%PSH"f=c&xl˻BJ ({۝:f2hhMI-oe[/{N8 ahhW{p,6xRwLGjv0Qk\E?޹VIt2(h qʶfׂ`q%jHKh cީ_JsxhR[mJqKv.xnt(\D4@ -=!p(H` @{tudH3NAJCO*vݩ'(Pӆ5 Twz1"dR3#Kje١ -?vR.cw˛-O)Zh /Lѳ5X9G(z?m["QB%Gm[9t~؍vs20oO'WPѥiI1Q쑭yҤ h+5DͶlw#4:m} rx<)z޿l_3B} IO |V͗A}௉g,zw$}56o9+6H_x@ogR]ӍҮs$~M|ƾ-C}Ijx.A[gS_ fMB |o$Z3f3Igw؜7KO #scȷ' ).x*T5D|_6w8MgP3.cz_h/̏w[@Al?si.uVBS'i~L-}"sK=QޛcqMtl͘϶\LCCG3KHk ˛4N,דC6-Ti4hf|Ȟoϔ0/XcЪJ4Uj6o[̕q6=|ݥ_OT…]C1a%Ig5]7"$>cwƞvP ;bc ׉A7'38 N{=vyJ%&^Rf-4`%:x:0ӥ^mJ/8ZYmz[g mB c-!kYsaﬓzD3H?({_g뚢Uо9DtūΚiuRإ?:G92_:Wiչ'Xu?y ;D|HQG; ]GzГ BbŪ+ҮKli]˘wl;7oBucЕ3~V]DtL(T'I:|ukGF'x}6}]Uoϛ;x+^77y2֭{T^+z&Yћ2}~S޹3~J/Q -E1s/o;Դg%^Xo:xJo5yK,C_q@gOҰyoj@ٛh3Suo :o =g eog|džxŐ~(V 554NC`5ރWm IciJ_7FêvN_ߙɝםO }|J]*Mbo] -ܭ]/dxWJӻp\F]1Me`~3'ȃ)fL17}+Ǝ~l.׌6~}|֌`i {^y>|4LˍׇMj)GJ|ejQco3i2VtpZfӮ4;Gg2odi57g{Vcc7/˅~gEu8lt --lRhi&[o`7e"IЖ}՝׬r9f\wzgCs1ն~u%,(Eg36`߶wn{FGӺgG](coն_ڭɻ -?ἾoOc#+[{O3ڿ*}oˇ!頲GĹ~udvٙ:1dԯs;!g™xn;KyosO '_+._ @qZUܹzkQ\-'v}w`hS|] =b s׺}bIDϓaNzY$&`)I& , -SdLU֢߳EEv*,Rۡm.k^'|ɢ=x|']%n^>eF#~ر϶wԹyw>}_˥RFߓj i-yOOxzDfؙ$ړ8eM+|<, Mv9Cro)׃͓JPXS~{> .]\4|V)6$6kMlNei00?e. Y93%nTrv6OK|矧X~i[L -f)VHX_AmP b9}/N[XR}ݕ/V , پl l;1愭$CgxxXFUW%U}\=Cpv}GȮՠxc|ik{ϗ -ˇb=2=5rzѭZ7M 4#ZRmNm2<%_KFi [nlUJkl|ɆNLO헀Qގcg:\[ϓyeб;~ -zKhZi:BeZ~%;k3؛5:н&{wnPQ~_7GU˸;۞>\OO OpLgu?ox{Ck~kت~}xطnƎ|KސvLb;\^#ojїh -Ǟ`\m?q3P¤0}L滵ny\55]̷ۙ=>^g2h_tmPjٗ_I!:y+w_"y ,:r?/cx\vlqeͫ|[ Dtb^OȆ"MYuw3nzmqqf2ųoWm'`'=dK5=F\! ~08({g^㑗#糖ze,oq8njTQZL,0Y{9qJF[HE\Bp?*(t|ڍ)C`WXq -H[Ogj'4+Glr-X(;þB߱1(wHQ -/G[7ٸ$~A1MWFuIqajzGQs(zLUg2-JWsjs|6OX{*+afJ況 vA]-qlv]rn{lT''r<5Rhlv̓3PaYcۧޓ#\wBc?h!޵_ sƘždgwz|}K4S,SaBMdLH6 asؓ`WVB Ow% Or.Q$1Dg2.DBYf BtЇzp6Ԕ3+{T`IFf(4L4 dÃzBkP/ZJ-Ip>*nfeh  \j%]d(y+申eE8PXyc< f5g3i?I;-,p\d@ύ-.UkhN`qMS3nJ򔑖VNBhSF -fZ'DLv8 ۙ"pFD;m|]$"ɹe3Fr'_'5IK}iDO-{7j=|Å$KkYLOx$rAH)I>C{z dbVϟN侚Z㉅w.h:ER8#92J{aIsNoO-k~e=2ooIDę:ɠ&}M%QS? OE|{#&@nx̄Ѡ|~ NPpb,r5X(0zqB%n`q5 ?r(h`|rP".`!DBaA:$DGwAI!.90CƟ¯ Y# Y@ܬN",(YQfs舞W*TQcib] G 34-(ZU7GHHJa ,n/G2`c,Yxjk^F̒p=\B(vl;G]W0B[t'iٍd?IlIBR_mGHT%ķE0+]Nh!EbfTrd49gm zI?訚͍#`rj c=}v[1R"fFEoOAJştARmFW^M|Wu';"c2 9՝pN(d6ysqw!Y+)cp`(q~ bݢ|`z_k5q-rh+r!9Ʒ7Tica>1 -d>=$ ൛KNA%-qķb>k: `8+؝U7E3#*~BS{c_ 9O:90tqkdhbtӒ_Agڸ&"?zNNGe q/qjȫ|wJԣ+v#z@})-pЁΟvjDCe28Ev=N f\b.xQ_hixɅNBV;n ć{k|OtdXS@wFDI~ u,_ hJveLKēe&a$pN%#vXCXg|$(NJ0].=n|S3[Mb uADW]6M&L)Nn7;%uH&Cztg^F{ ~XO6X8u }; u_QI,J{$8Od Əq;2#* T}M'],$yBIo5 l$$AGx`~s(`ZզZgʨy^"Eeisy__n< (3;2[w.ҮЉx9i*p@kr {:~Q=ёnvN.19B@$vƅ(v^5]RXذt.)7Fv;Yd|\YC 2OcI8DSZd5}ꑅG=ts@Lx N/ssǛD}k p9>ӥސH }8n2MO|>8ط-V;Xj'2c;֨Ѹ_Ʊ01\G@u'fh84CTVK.d3u'O -)bCh}1,<3]Xڢ- YK)u8ּ 4'fe͌$_bC>d#{>սSEݘ8 G7\tseYHEbj}t)g* p[x‹-L&݋f"pvEקlP%lmeO9[k7؎!lv"j~ -bK]sM2amEMƹmol]Ke/}pU@g$KA1o -/U+.,ze -npT'XM{߷nm8ӽ}ǐ{}ž> gn7ԣ=d2Ƹ=Z:'9Qg#:KPإB 9 -E ӥǗ{﫟1O2 x[`)CDc1nh?<.Gڮl^KF pWGOX"zԧ._%i?>%7`K4ݜ1}ZrԽ!߅14uG|wmxھ-%m0(1n9'h - z=e<L'auL'O߷mCH/59yâ~9Ft;CS5BעP{xgV<YV;f;} -KF"!^qsz -գY5Y~1@$vTԻ1R7[T{9mdlI1»2 V tx{ׯ4Ј޲3M[ јIw)H.7S`>" R&`}v4zҏR@zVjTG9 x6WogD /ҫ&sw@Н9qDoi91by56 -Ĉr!A@mg3ϿW -(Q^G(hvڐZ2\VyF㗚+ZyK^^YhXerckd6Gc"[[ý$жeNX93/=ׇK7Y$Y\EPoDJwIg,P}ksYbniTܮD4-Irb΃6 1rno lC}usjm*u߉gy ]$ -4>TG"y"sAhԙGf(b'Qu; {7MFPjQ%f-n3Z[`a,3(8OOv1{,^Ⱦ ״}Jd"Cicu.ayLρӊn1V_%z?m3i&)v>qSu$dr}|&f45I䟶jw -O7 cӴ߫]R===X};dI=e1Fz[ΞQIi2?}y -#ߡӐi}3Sӏtw/}:H/O7" :gX+)F6 *+VIgfzNb;m{{pL{s*7`>b<EVXF}$}] z9 9 3]\bъ_sW+3X GD@#6~+y -#9JE4|5:4 '`Y M굾g{.>&`)! Ѳsڿ PP @2Z'nz> !Wx㩙6&8B(ӟ2l3S07HCN1pرIy`iwgsN4XqTR )St<Y ;*LIsdU .\*f(=?GmzC/XAğmM#1?^~Djרu m4̼rRx1^JYaᝇ1!?br)[&=9>7 W - X@5QqAtx43Ýynz?$K҂[+ԜzqC1 ?ld}U`{ -%;ItmtKSѓ%4H[++pʢ(恽Ƥa}qc| -83IQ{ʉ9lm=H/WƹhRdj*^?eNU5?\?jbl3n.ꌸ&a&<-87\'ybhe-1|JJ)VNuli䅖orwc%i,7;h4&h1eǓFS.;N4 աH DqE-a("Gq*{ƧbǮk tKaFlX5nJ#|dki "\w߲{=,?$Y -*۲auo5+̺ -,Z]~8?~4!16?_ϐɁ'Ѳ9F#441 N➻nxdY| Nv47K%+8sJIeQlj^ijspH D-+7ȝ,&&4Xi/ߧw5}n*,/| v<6R@isUzSB+ӪdTiݠ/D))In}Ѭo+ O-{~ٔΥwd2+%:/=c?x˓7Fy',Nxho˖6:9J6hea0~Mn4RorʲOn -+,L~nBjMOI~4rT/_T^=.g䂝,zպ}_-y-"}R -E:# 6B,*+)TJ _UhD$$Gch7ħxM:uTs]7Fu1Eךo$ډaݮ P/MTXqK4Qq~KGZ.rqi-egO\ni8sl~cF`AU$ԕT|_]̢5{ #'Mc4Q$GG!<)ڗ(Oj.r7t6*@gsy/%bY"]d\~l5\ 1Ku}Ad+aP -*)ޖ;Ѷwq"Rj}5%dsh[g7'KxH;MJ"(2Qh-ݚoqg2*' |> I"p<*{1˲Z_ڲdǯc%j}vɡSΠ: :9tt8 -9ttl)gCAw-: :WɡSΠ;Yr 9tt“DrT+C' -H>߯1Dtn: 3'pSqH)|"@72Qiw`X O:dl۴x. O 831dQfp?-hKkg|'8,f~9#JsZg .TpdD3Uw/SjdKg ] l9Qb{ɻD]ԞIGE:'?64AɅaʛrG(lZJ ^!ONv -yBFP:﫣C p#ʒS$&yJU>i#%: -XṮ>jzƉUҏTRLndQ<}"/hx,vot1^Yf܍A]$#0$*&$xs#S#8-bYY?HY2i]hHϹ NdW.Ƞ44Ie)e4zdpv##wǝb|%]9%砹j{qQ%F 9% +9eSa܎z> M.d{5RhQ)t>h5+՝JjyuƮ[I1RHTc1n(YcغE~_2p*])9Kg];rI>T*dn>o"T)e^/Y|W·JK~ݪ1Ugp21W·;UC~YX'uv_O~)-Qٵb"Nfox֪+P*Z ܏r֍~~c_P?T"u&ݦuysgsΆ %1 7Nk&kaK*4Rmf vq"bŸXL?$Ber~~{EMg:;vB/mxUTiѝòoWH%*hH%bޫUHGnՅ2RWHm_)#}Զ5put=;n9M>z{vqZAWOygI\˩agPGY%(d/ CC,~ vldTfNBQ[r3gyY| 2@q=)f@s y=?RZ6~=tsߝMGp)e\Hj;ߔ;^t#ك|$۳ԄkZZU͜E|A̕|jPVF%9)wtJr1:r?¥H*àh6YK"OՊOsڸjEI'bmʵ-:G15Rj嗰jf8M'!;sM'e-eI98M'rytR gIul:^dItEl:\:şdI0^kfI½tTiJL_{52w\,d_{0Z_I71`Yx_*XI6Yb.Hj?5]z Tddd/ -":?J3–Z>Q,2ZiVYkPz ]^[^1 -:V4Tm1J9ͣ6G믓{S8ju?s"-5hDuZiB]4IK}y[3&72NR.CNϐTLdbC_C{\ڟe2gagJj`ˇjZ$ǙQO8Ž\υ RZ?Hd%j *lxW2RE#UӖ_ -w7MsqjUS|9 -zAG-Hk*ɳ+IJW(r 59־^bm9~ybm[٪Z7S2WH^Y\1\<3>zQvT.O a"U41}l~Sk5!Uк$&.h6]CV.?xwnh4?Բ~K!ؕ-vz(8_ϳT縊/:bVʻ^kG*dY\|+NluqGmj*+lA3Ӡt2\\)OkGPE{|yg7zѻtʜBقE[&3߭7NPҿ05M\) &#Sn ȥut>yܶ\ M.5M!.ri1^<ɥx۶K“N.&{%IřDHjlh{3Oru` n\ &Ѫ"tb10Ƹ T #-=Qv0|vYvXD[TKv"mfZ΃|b0dH>d3UT+SԦBd5]|߸I%T' T @TēYv欴BjYiSء~@0Iݺ kn WtG/Xy"cH?U(|x -ىܦAJ UR5rTrX߸TND م9P]YG~eSc*'LhHVF/LgLVcˏjUC ?̟,@JYZsoԚx,@;m˲E7,@v4PO\_SOH*Y[?.',eE$pW/ʧV:E 4zQ>Y/UI\(UW74(ݙP\ -\WJ~S4+ %[O+$֓ZOߏ.˯rU?-)dQ-?LkD+\WJDwYJ~-QO3\\՟JGT%_Fwr+;oIWZrI]?tk )^﷥lQO9;e]?07[h.lZ4Gj만I)\ߜ)?wIVڵUdu SL2RՏ-B/z:⬤_S) -nש'GLU?Ō )7Kʱ$uU~^J~^봿(]vO)Ԝe]?.K2ojuIKSVsp)WN=>,\~:]]c/Y\IӖ /A]?dx^lU?99vi]?~_S6ۥ~U~bL[$/I<$8[yuC~U?\ I,,OeT맜+~\O*>V(^PO=uǟU-/Da\.'-E]BµUgŬ(J8a}G*CfZ-V[0*EQ[>ԙv(FdcW~":ۺB=%?f"`&NdDqe(;ue?Aޡh2ev!! C B ! g}[%ɶn -;YaeTAaǣ>|Hv_yC29D{pc|x&g?[ӣW ͇?frkr3'G_.;޽t<L_1$|\]|=$fg϶OnfZ_ib`s|ԋw{cG#x31t'TG!;WxG޽Ol-ܼ^xݧT?>xk!z(??6Ӝx/;/us ŸY0BĞ—SR(bgr:#{Q'&9>B_`Ĭ/99|M:#ڜN~^%{; /w'y:$»Z|l&h1 ,+4' /wua^~`3ɹXL~s:*Arzs4h -V^GQ~V }X3-rv2MVGo7N흭0837x:~~`Dx>#Mj'x{4JUrcO=on_b;ǟ\AaX)MةJ80xױd}?Tls)s>4ͪWێ# [LXiru{' =^;#qꤕګ~[zʃi`\7`0hlç&' &K߳"=]#e2/'D2OHV۶F;":&v&Ɯb@[<δ٣b)!S  "w2s?)ih7 -hsD?ph5rh| >R2y0^t~p/އ^{|ǟYA4mWuѐzץGJ+aIGqQ'`u\%(a⡣K.]*nlʨ^>$ ɪ/wz'w7|Y1JZ|P>'-g?mNwE\)o/jazpv^6qIgU٘cCª{mzjD]UNEͿM=.7V%xKO/hք|P\gg dA66vWuڇ66~w`"naVg,סW=ϧX;F'}6oUov!wFoeUaпه"O\O^,M&+ciNݥ[һ[D oI$7%<,q_KV}K˲DRS~I/zTHbyœ)wC~ꛧ3+Wut7 S[Ȕg'+|Oَ⋋b/[ .姲; }fcjjBWŃŽWk]u]n}~aw*~YL( -F'ߞu7pkq[o[-ԍ햻a |y轒x]n%oJǟy/'hxHG%x$ʫd}[a=۹z:祥Ml:.gNUÄ합tl}8d -f+T4ߓxөb-Ÿzvr[ tLfb3{8;Aߞ~jgC7l.?A~-o|mOw'}JGWƏ_ 6=ܟ#KzxI̷o_ٶ?ֶn~~|-wK1{yebaï-YK9ȡ;SH־ȏ:z円z[&|tK2+B7KoVGN^8r<=,He|SfkI?w瘅~q;a8T6>ܱw+Gf#{t3f-Nqӡ&w=AvWxg vE{~Glӌ2C戜djFc,^437?e-^5-">DZ8Y~6{I*GAfמL?f9ѱbk/ w+ ߙض׶9rvOֻT )-?Wݫ/gC8޽8\vtMkYxi3k|J׾?xh/~>/l_jzax[—Fxmtu8 3_Pߕq_p?ǞƗY~slO%Թ؜l/.vޮ,ړ[K#gǫ;+٧sko>B1| Uv&j~9^w>9a~|:~Ěs[Z_b7XDiÔg\pOb$ߊA?}/_NNLn_|PX -UL?eO7Pm/m'/wuL+4{3U>Ѩ]e hDWgF|'ł7;kɗۇg+;XҾ 歛{凴TMB:ٿ弋XNSH⦉?Mٷ-}O?OypgnRavMdcٗ 7];Gۨ;;+ xXY^~~~iy2_]]y6Ɏ}=hQ퇐Q.+dY[s=U3.)_y-xˉo| -x|{ |utܯ?6<3GHvʞ> kȳq2а#1*+#WrԿ3v۫\Uݙ}ǿ>}=lsUCnf˓,[-|mi+Z=ml6?Y+!][[6ɜ6iX)7ՀSMW2dEaBvR`Ⱥηbfo-N7&+WWO_; l|{"J~${OUqvˢ|&nKM?Z/Fԉy0-d$u`^^#1,+<. dn}U~~~99>@UȯJTcm}WЛs+hvPp' - ;,2H *AmբkHAZoڢU:sëڄ.z[9ڳtDs;eQW;~lԕu鄹p2cv2|Q4A_?) s}L|7Ky<]mŝm{[M6p>|g{{qg{y _kyW者w:ԮA?Wg׾+0);[}]qU]Oݎܭ#2X41=7y!@bpHbH$HHC&BUXI*[qG^ɘBA|1D !cAexRbL`D(!RQ -i 0z6ˁRZRO2-#8gnb4M8MHTKJ=?&#$QiHHax,&yKVF+ds O"HjI -~"zZ(瘀Y) yg\V -\# Ղ!%"$K) j^+#:/)A9|Hخդߐ!Ȗ#:pX0eh`wÅ`pip &&QXÀDCPD4WbD7 .Ʌvh$80 %-8TQp)$OpE;n'E)TUǠ^չ4\^lq4^zcI0kE -é -A ([t,%AWI.@o녴UvU*`d C=++_^,A0!+>lLpy0B32"s/0N" rb{7(s0=N{)T! h~i ~r? kXG.ĘBbA &j*hRIM2 -X}.&G`c!&xY.eBLFI\@Y͖b;P&? -"cXPE4}M7q@ $DցbB % 2,i $o\B1 z  pJMu8a #Pv\ -2FJU5'A Wيԗc1 XU$(Aӟḵ *ˁak3pqDs hD85z7s0(j4=_R).>HyOC”b. AbABCL|DPLń% 3}L-@UfK8U&6%J -]eq@ LRS&ADÂR' -]u4Aϭn3DN, NL -nTE;3 -B}J̳!.cj ʼnI2Ф -$2Sj&f"LNyOK!1LlA%lfVrA2{ }d@9hV0?TY3׭EpBpqM -PXf~ݧ;O'_#x,83qZG8VBf)̾p!€T2#NUj],6-5 e! \QBUXzBC5Rӹjda$$$koX- La@S=r<1LVD"COUs-0`^' -.$!XD4զ{9NBPWkLSH%B,aWzW9S+[!ϼ3bNdklU@J\,:[M)Ę3S#N GwSDr *,HS - | | | | | | |jn D}"AE|bB@!?@ L0Lp`&-G&2Lp`n ]!?Lp`Bu9v' &8B^0A L(e؜LpL &86܆`%?W="uHL 5p p.&`R b8 !/ `7 & (\/P& `&sY L(,qXLpLpWLpVLpֺLp}Lp=L a0HL a0=`&:`BaG&:`& Lpd|` `# -- UztA0 `#zgtA0϶`ےL=_P0 La0AdLa0AdLa0AdLPa0ATLPa0ATLPa0ATLPa0A(B`b `"80 NL >&: &` ̩ x0 RH0' Lp/P!0 * &0  ` - U%c`P &hc0'&`48Lp%`BI& =e{7B&Bh;A``Buttnp;* LPa0AT0A=D? -yט`+ Yz3? | | | | | | | |>h>h>h4A ":`#-B`+}g1Lpz!? EK~0 δW&`&`kN^0 ՙ6x۝`/yQL&8B^0?ڜL5UL5K^0 ՙ6sxep L &&C`ޚ - *&:` - * &` - 2 &:`\`#d0Ad0AT0Ad0Ad0u?YLA0AULPa0AULPA0_>0u^0u& j P0  `PxW&+h&8B^0ђLpUT0AyW&T  P=_P0 La0xLa0xLa0xLa0ADLa0ADLa0ADLa0AdLa0AdLa0AdLa0ATLPa0ATLPa0ATL:&I 0nLp -P &Tc? &:` " &:`&:`&0 `BUj *&0 2 & j Uѽ`B!4LPuUL(0|~0:{:7}G&0   j yYz3? | | | | | | | |>h>h>h4A JZEk?Y?@ UI1AbtqdhE<!? DDp "-AG"2Dp ": "8!?P{js} D`u@A #i"86x AxDp BuV: 2 " "": " " < ": \ #xAxAADAAxAxu?A^DAAAQDaAAQDaAAYDAAAoA!?P$~ -"8D(4DpTDAAG"TP=_PDahDahDahD`aXD`aXD`aXD`axDaxDaxDaDDaADDaADDaAdDp -xA71  , "0PU?" " ": <": " BU8sT?P DAr6Dp<DMmG~, ": ": ": ": cq~5K/P{fq@ԃ@'cx΋'ó 0L1 -|1nspΨwD .QAϯ4A$L((&)'xڂ -pD8;TJS^|hP)Ud(+2R/ER7؛{fnl 56nb:v)n=`ڞYV%Neai ~Fyn'([j)NK`FFv+kqMYe @J #Q 26)͖R˃yƍrKڡ4ږ^2P"* -|晷{R!ujy'Y`.aj;)d`J˪0׃S$7<.ѱP"^'P -!0bq[_:XIR=CtEp7ضTM@HTeTwjjjc\7Ol؆x1"47g@슘tmYn -Za!SMnj{@B٩v $ZJr'Hvv'MA;Dӈe,~rdf,ѱ &WAb -ܦlgiOdS)w mgDڠ zMȱ ԗ†q -Oa«0V12D}i("B=ʰ#~`-Dd)B},ZP)1'S2L^++40S -^aͦzZ -2,}Jq-a=i1`FG5fq@gGƳdn%FOȹV0Yz -^llll{0 ,` a bn~h:׮#(XDPFhogip#k3a U%Pg&scvs)֬CI,!HLK6!76  fF_* 0;e2wp ?#rX2#1!u&6ɝ`ƆPdw)Z}Y~Qpoza"G!DXlCTv3ʡ=S4! -])jj;d>iI$dT.$2Befl;⣝a{> T Y5 -HrhDOTv!$T9 &ep@Y.`u-MfED"r+ 08jyS\"%c( 9eWJҫ -As¦!Ӓ~^X߻uJ]pRF`&^LeܘPA3&DвsJͅeE`vm节.4K jĬbԃvq*kV5uo`5rLj -'98aƜvнh=ۦ7ٜ8%r= %Y @;_K4x`nngG6F -nUO &,Oe5,N7F(3n3JAqYD)rg!mhҞ>ԁn`nl7l9OTM \ MeDfiqNm\#6Tޛ{{{{{n4> -)SҕagLԺ2w%=Bl,H 5Hz7-cVYcX6jPpyUw*yZ JbEӴz9YJ A˜rQACP*x|6z0]5P#T晹{8^+G^MO;G_oλWC_:?֗Uu?|%oWWH endstream endobj 21 0 obj [/ICCBased 27 0 R] endobj 7 0 obj [6 0 R 5 0 R] endobj 40 0 obj <> endobj xref 0 41 0000000000 65535 f -0000000016 00000 n -0000000156 00000 n -0000038280 00000 n -0000000000 00000 f -0000053108 00000 n -0000053178 00000 n -0000378446 00000 n -0000038331 00000 n -0000038793 00000 n -0000041265 00000 n -0000053839 00000 n -0000050299 00000 n -0000050186 00000 n -0000053480 00000 n -0000053603 00000 n -0000053716 00000 n -0000042272 00000 n -0000044889 00000 n -0000047506 00000 n -0000041327 00000 n -0000378411 00000 n -0000041711 00000 n -0000041759 00000 n -0000053045 00000 n -0000052982 00000 n -0000050123 00000 n -0000050334 00000 n -0000053364 00000 n -0000053395 00000 n -0000053248 00000 n -0000053279 00000 n -0000053913 00000 n -0000054175 00000 n -0000055286 00000 n -0000067808 00000 n -0000133396 00000 n -0000198984 00000 n -0000264572 00000 n -0000330160 00000 n -0000378475 00000 n -trailer <<0C9D12E6EE994682A6EAD56912419B86>]>> startxref 378666 %%EOF \ No newline at end of file diff --git a/pages/resources/immutable-global.js b/pages/resources/immutable-global.js deleted file mode 100644 index 1b3cbe3ec0..0000000000 --- a/pages/resources/immutable-global.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = global.Immutable; diff --git a/pages/resources/jest-preprocessor.js b/pages/resources/jest-preprocessor.js deleted file mode 100644 index a17045350b..0000000000 --- a/pages/resources/jest-preprocessor.js +++ /dev/null @@ -1,10 +0,0 @@ -var reactTools = require('react-tools'); - -module.exports = { - process: function(src, path) { - if (path.match(/\.js$/)) { - return reactTools.transform(src, { harmony: true }); - } - return src; - } -}; diff --git a/pages/resources/react-global.js b/pages/resources/react-global.js deleted file mode 100644 index 45b0fd0871..0000000000 --- a/pages/resources/react-global.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = global.React; diff --git a/pages/resources/start.js b/pages/resources/start.js deleted file mode 100644 index baed046d06..0000000000 --- a/pages/resources/start.js +++ /dev/null @@ -1,10 +0,0 @@ -var path = require('path'); -var express = require('express'); - -var app = express(); - -app.use(express.static(path.join(__dirname, '../out'))); - -app.listen(8121, function () { - console.log('http://localhost:8121/'); -}); diff --git a/pages/src/docs/index.html b/pages/src/docs/index.html deleted file mode 100644 index a48835b4ef..0000000000 --- a/pages/src/docs/index.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - - Immutable.js - - - - - - - - - - - - - - - diff --git a/pages/src/docs/src/Defs.js b/pages/src/docs/src/Defs.js deleted file mode 100644 index 531942fa04..0000000000 --- a/pages/src/docs/src/Defs.js +++ /dev/null @@ -1,246 +0,0 @@ -var React = require('react'); -var CSSCore = require('react/lib/CSSCore'); -var Router = require('react-router'); -var { Seq } = require('../../../../'); -var TypeKind = require('../../../lib/TypeKind'); -var defs = require('../../../lib/getTypeDefs'); - - -var InterfaceDef = React.createClass({ - render() { - var name = this.props.name; - var def = this.props.def; - return ( - - {'class '} - {name} - {def.typeParams && - ['<', Seq(def.typeParams).map((t, k) => - {t} - ).interpose(', ').toArray(), '>'] - } - {def.extends && [ - {' extends '}, - Seq(def.extends).map((e, i) => - - ).interpose(', ').toArray() - ]} - {def.implements && [ - {' implements '}, - Seq(def.implements).map((e, i) => - - ).interpose(', ').toArray() - ]} - - ); - } -}); - -exports.InterfaceDef = InterfaceDef; - - -var CallSigDef = React.createClass({ - render() { - var info = this.props.info; - var module = this.props.module; - var name = this.props.name; - var callSig = this.props.callSig || {}; - - var shouldWrap = callSigLength(info, module, name, callSig) > 80; - - return ( - - {module && [{module}, '.']} - {name} - {callSig.typeParams && - ['<', Seq(callSig.typeParams).map(t => - {t} - ).interpose(', ').toArray(), '>'] - } - {'('} - {callSig && functionParams(info, callSig.params, shouldWrap)} - {')'} - {callSig.type && [': ', ]} - - ); - } -}); - -exports.CallSigDef = CallSigDef; - - -var TypeDef = React.createClass({ - render() { - var info = this.props.info; - var type = this.props.type; - var prefix = this.props.prefix; - switch (type.k) { - case TypeKind.Any: return this.wrap('primitive', 'any'); - case TypeKind.Boolean: return this.wrap('primitive', 'boolean'); - case TypeKind.Number: return this.wrap('primitive', 'number'); - case TypeKind.String: return this.wrap('primitive', 'string'); - case TypeKind.Object: return this.wrap('object', [ - '{', - Seq(type.members).map(t => - - ).interpose(', ').toArray(), - '}' - ]); - case TypeKind.Array: return this.wrap('array', [ - , '[]' - ]); - case TypeKind.Function: - var shouldWrap = (prefix || 0) + 6 + paramLength(info, type.params) + typeLength(info, type.type) > 78; - return this.wrap('function', [ - '(', functionParams(info, type.params, shouldWrap), ') => ', - - ]); - case TypeKind.Param: return ( - info && info.propMap[info.defining + '<' + type.param] ? - : - this.wrap('typeParam', type.param) - ); - case TypeKind.Type: - var qualifiedType = (type.qualifier || []).concat([type.name]); - var qualifiedTypeName = qualifiedType.join('.'); - var def = qualifiedTypeName.split('.').reduce( - (def, name) => def && def.module && def.module[name], - defs.Immutable - ); - var typeNameElement = [ - type.qualifier && [Seq(type.qualifier).map(q => - {q} - ).interpose('.').toArray(), '.'], - {type.name} - ]; - if (def) { - typeNameElement = - - {typeNameElement} - - } - return this.wrap('type', [ - typeNameElement, - type.args && ['<', Seq(type.args).map(a => - - ).interpose(', ').toArray(), '>'] - ]); - } - throw new Error('Unknown kind ' + type.k); - }, - - mouseOver(event) { - CSSCore.addClass(this.getDOMNode(), 'over'); - event.stopPropagation(); - }, - - mouseOut() { - CSSCore.removeClass(this.getDOMNode(), 'over'); - }, - - wrap(className, child) { - return ( - - {child} - - ); - } -}); - -exports.TypeDef = TypeDef; - - -var MemberDef = React.createClass({ - render() { - var module = this.props.module; - var member = this.props.member; - return ( - - {module && [{module}, '.']} - {member.index ? - ['[', functionParams(null, member.params), ']'] : - {member.name}} - {member.type && [': ', ]} - - ); - } -}); - -exports.MemberDef = MemberDef; - - -function functionParams(info, params, shouldWrap) { - var elements = Seq(params).map(t => [ - t.varArgs ? '...' : null, - {t.name}, - t.optional ? '?: ' : ': ', - - ]).interpose(shouldWrap ? [',',
] : ', ').toArray(); - return shouldWrap ? -
{elements}
: - elements; -} - -function callSigLength(info, module, name, sig) { - return ( - (module ? module.length + 1 : 0) + - name.length + - (sig.typeParams ? 2 + sig.typeParams.join(', ').length : 0) + - 2 + (sig.params ? paramLength(info, sig.params) : 0) + - (sig.type ? 2 + typeLength(info, sig.type) : 0) - ); -} - -function paramLength(info, params) { - return params.reduce((s, p) => - s + - (p.varArgs ? 3 : 0) + - p.name.length + - (p.optional ? 3 : 2) + - typeLength(info, p.type), - (params.length - 1) * 2 - ); -} - -function memberLength(info, members) { - return members.reduce((s, m) => - s + (m.index ? paramLength(info, m.params) + 4 : m.name + 2) + - typeLength(info, m.type), - (members.length - 1) * 2 - ); -} - -function typeLength(info, type) { - if (!type) { - throw new Error('Expected type'); - } - switch (type.k) { - case TypeKind.Any: return 3; - case TypeKind.Boolean: return 7; - case TypeKind.Number: return 6; - case TypeKind.String: return 6; - case TypeKind.Object: return 2 + memberLength(info, type.members); - case TypeKind.Array: return typeLength(info, type.type) + 2; - case TypeKind.Function: - return paramLength(info, type.params) + 6 + typeLength(info, type.type); - case TypeKind.Param: return ( - info && info.propMap[info.defining + '<' + type.param] ? - typeLength(null, info.propMap[info.defining + '<' + type.param]) : - type.param.length - ); - case TypeKind.Type: return ( - (type.qualifier ? 1 + type.qualifier.join('.').length : 0) + - type.name.length + - (!type.args ? 0 : - type.args.reduce((s, a) => s + typeLength(info, a), type.args.length * 2)) - ); - } - throw new Error('Unknown kind ' + type.k); -} diff --git a/pages/src/docs/src/DocHeader.js b/pages/src/docs/src/DocHeader.js deleted file mode 100644 index 5c7b4edd8e..0000000000 --- a/pages/src/docs/src/DocHeader.js +++ /dev/null @@ -1,28 +0,0 @@ -var React = require('react'); -var SVGSet = require('../../src/SVGSet'); -var Logo = require('../../src/Logo'); - -var DocHeader = React.createClass({ - - render() { - return ( -
- ); - } -}); - -module.exports = DocHeader; diff --git a/pages/src/docs/src/DocOverview.js b/pages/src/docs/src/DocOverview.js deleted file mode 100644 index d72c05e3db..0000000000 --- a/pages/src/docs/src/DocOverview.js +++ /dev/null @@ -1,46 +0,0 @@ -var React = require('react'); -var Router = require('react-router'); -var { Seq } = require('../../../../'); -var Markdown = require('./MarkDown'); - -var DocOverview = React.createClass({ - - render() { - var def = this.props.def; - var doc = def.doc; - - return ( -
- - {doc &&
- - {doc.description && } -
} - -

API

- - {Seq(def.module).map((t, name) => { - var isFunction = !t.interface && !t.module; - if (isFunction) { - t = t.call; - } - return ( -
-

- - {name + (isFunction ? '()' : '')} - -

- {t.doc && - - } -
- ); - }).toArray()} - -
- ); - } -}); - -module.exports = DocOverview; diff --git a/pages/src/docs/src/MarkDown.js b/pages/src/docs/src/MarkDown.js deleted file mode 100644 index b7eb3680ee..0000000000 --- a/pages/src/docs/src/MarkDown.js +++ /dev/null @@ -1,19 +0,0 @@ -var React = require('react'); - -var MarkDown = React.createClass({ - shouldComponentUpdate() { - return false; - }, - - render() { - var html = this.props.contents; - return ( -
- ); - } -}); - -module.exports = MarkDown; diff --git a/pages/src/docs/src/MemberDoc.js b/pages/src/docs/src/MemberDoc.js deleted file mode 100644 index 0511cb32c0..0000000000 --- a/pages/src/docs/src/MemberDoc.js +++ /dev/null @@ -1,209 +0,0 @@ -var React = require('react'); -var { TransitionGroup } = React.addons; -var ReactTransitionEvents = require('react/lib/ReactTransitionEvents'); -var Router = require('react-router'); -var { CallSigDef, MemberDef } = require('./Defs'); -var PageDataMixin = require('./PageDataMixin'); -var isMobile = require('./isMobile'); -var MarkDown = require('./MarkDown'); - - -var MemberDoc = React.createClass({ - mixins: [ PageDataMixin, Router.Navigation ], - - getInitialState() { - var showDetail = this.props.showDetail; - return { detail: showDetail }; - }, - - componentDidMount() { - if (this.props.showDetail) { - var node = this.getDOMNode(); - var navType = this.getPageData().type; - if (navType === 'init' || navType === 'push') { - window.scrollTo( - window.scrollX, - offsetTop(node) - FIXED_HEADER_HEIGHT - ); - } - } - }, - - componentWillReceiveProps(nextProps) { - if (nextProps.showDetail && !this.props.showDetail) { - this.scrollTo = true; - this.setState({ detail: true }); - } - }, - - componentDidUpdate() { - if (this.scrollTo) { - this.scrollTo = false; - var node = this.getDOMNode(); - var navType = this.getPageData().type; - if (navType === 'init' || navType === 'push') { - window.scrollTo( - window.scrollX, - offsetTop(node) - FIXED_HEADER_HEIGHT - ); - } - } - }, - - toggleDetail() { - // Note: removed this because it drops the URL bar on mobile, and that's - // the only place it's currently being used. - // var member = this.props.member; - // var name = member.memberName; - // var typeName = this.props.parentName; - // var showDetail = this.props.showDetail; - // if (!this.state.detail) { - // this.replaceWith('/' + (typeName ? typeName + '/' : '') + name ); - // } else if (this.state.detail && showDetail) { - // this.replaceWith('/' + (typeName || '') ); - // } - this.setState({ detail: !this.state.detail }); - }, - - render() { - var typePropMap = this.props.typePropMap; - var member = this.props.member; - var module = member.isStatic ? this.props.parentName : null; - var name = member.memberName; - var def = member.memberDef; - var doc = def.doc || {}; - var isProp = !def.signatures; - - var typeInfo = member.inherited && { - propMap: typePropMap, - defining: member.inherited.name - }; - - var showDetail = isMobile ? this.state.detail : true; - - return ( -
-

- {(module ? module + '.' : '') + name + (isProp ? '' : '()')} -

- - {showDetail && -
- {doc.synopsis && } - {isProp ? - - - : - - {def.signatures.map((callSig, i) => - [, '\n'] - )} - } - {member.inherited && -
-

- Inherited from -

- - - {member.inherited.name + '#' + name} - - -
- } - {member.overrides && -
-

- Overrides -

- - - {member.overrides.name + '#' + name} - - -
- } - {doc.notes && doc.notes.map((note, i) => -
-

- {note.name} -

- { - note.name === 'alias' ? - : - - } -
- )} - {doc.description && -
-

- {doc.description.substr(0, 5) === ' - -

- } -
- } -
-
- ); - } -}); - - -function makeSlideDown(child) { - return {child} -} - -var SlideDown = React.createClass({ - componentWillEnter(done) { - this.slide(false, done); - }, - - componentWillLeave(done) { - this.slide(true, done); - }, - - slide(slidingUp, done) { - var node = this.getDOMNode(); - node.style.height = 'auto'; - var height = getComputedStyle(node).height; - var start = slidingUp ? height : 0; - var end = slidingUp ? 0 : height; - node.style.transition = ''; - node.style.height = start; - node.style.transition = 'height 0.35s ease-in-out'; - var endListener = event => { - ReactTransitionEvents.removeEndEventListener(node, endListener); - done(); - }; - ReactTransitionEvents.addEndEventListener(node, endListener); - this.timeout = setTimeout(() => { - node.style.height = end; - }, 17); - }, - - render() { - return this.props.children; - } -}); - -var FIXED_HEADER_HEIGHT = 75; - -function offsetTop(node) { - var top = 0; - do { - top += node.offsetTop; - } while ((node = node.offsetParent)); - return top; -} - -module.exports = MemberDoc; diff --git a/pages/src/docs/src/PageDataMixin.js b/pages/src/docs/src/PageDataMixin.js deleted file mode 100644 index 6f79be1121..0000000000 --- a/pages/src/docs/src/PageDataMixin.js +++ /dev/null @@ -1,14 +0,0 @@ -var React = require('react'); - -module.exports = { - contextTypes: { - getPageData: React.PropTypes.func.isRequired, - }, - - /** - * Returns the most recent change event. - */ - getPageData() { - return this.context.getPageData(); - } -}; diff --git a/pages/src/docs/src/SideBar.js b/pages/src/docs/src/SideBar.js deleted file mode 100644 index 915469e997..0000000000 --- a/pages/src/docs/src/SideBar.js +++ /dev/null @@ -1,107 +0,0 @@ -var React = require('react'); -var Router = require('react-router'); -var { Seq } = require('../../../../'); -var defs = require('../../../lib/getTypeDefs'); - - -var SideBar = React.createClass({ - render() { - var type = defs.Immutable; - - return ( -
-
-

API

- {Seq(type.module).map((t, name) => - this.renderSideBarType(name, t) - ).toArray()} -
-
- ); - }, - - renderSideBarType(typeName, type) { - var isFocus = this.props.focus === typeName; - var isFunction = !type.interface && !type.module; - var call = type.call; - var functions = Seq(type.module).filter(t => !t.interface && !t.module); - var types = Seq(type.module).filter(t => t.interface || t.module); - - var label = typeName + (isFunction ? '()' : ''); - - if (!isFocus) { - label = {label}; - } - - var memberGroups = this.props.memberGroups; - - var members = !isFocus || isFunction ? null : -
- - {call && -
-

Construction

-
- - {typeName + '()'} - -
-
- } - - {functions.count() > 0 && -
-

Static Methods

- {functions.map((t, name) => -
- - {typeName + '.' + name + '()'} - -
- ).toArray()} -
- } - - {types.count() > 0 && -
-

Types

- {types.map((t, name) => -
- - {typeName + '.' + name} - -
- ).toArray()} -
- } - -
- {Seq(memberGroups).map((members, title) => - members.length === 0 ? null : - Seq([ -

- {title || 'Members'} -

, - Seq(members).map(member => -
- - {member.memberName + (member.memberDef.signatures ? '()' : '')} - -
- ) - ]) - ).flatten().toArray()} -
-
; - - return ( -
-

{label}

- {members} -
- ); - } -}); - - -module.exports = SideBar; diff --git a/pages/src/docs/src/TypeDocumentation.js b/pages/src/docs/src/TypeDocumentation.js deleted file mode 100644 index 46515bb7c7..0000000000 --- a/pages/src/docs/src/TypeDocumentation.js +++ /dev/null @@ -1,300 +0,0 @@ -var React = require('react'); -var Router = require('react-router'); -var { Seq } = require('../../../../'); -var { InterfaceDef, CallSigDef } = require('./Defs'); -var MemberDoc = require('./MemberDoc'); -var isMobile = require('./isMobile'); -var SideBar = require('./SideBar'); -var MarkDown = require('./MarkDown'); -var DocOverview = require('./DocOverview'); -var collectMemberGroups = require('../../../lib/collectMemberGroups'); -var TypeKind = require('../../../lib/TypeKind'); -var defs = require('../../../lib/getTypeDefs'); - - -var TypeDocumentation = React.createClass({ - getInitialState() { - return { - showInherited: true, - showInGroups: true, - }; - }, - - toggleShowInGroups() { - this.setState({ showInGroups: !this.state.showInGroups }); - }, - - toggleShowInherited() { - this.setState({ showInherited: !this.state.showInherited }); - }, - - render() { - var name = this.props.name; - var memberName = this.props.memberName; - var def = this.props.def; - - var memberGroups = collectMemberGroups(def && def.interface, { - showInGroups: this.state.showInGroups, - showInherited: this.state.showInherited, - }); - - return ( -
- {isMobile || } - {isMobile ||
-
- Grouped - {' • '} - Alphabetized -
-
- Inherited - {' • '} - Defined -
-
} -
- - {!def ? - : - !name ? - : - !def.interface && !def.module ? - : - - } - -
-
- ); - } -}); - -var NotFound = React.createClass({ - render() { - return
{'Not found'}
; - } -}); - -var FunctionDoc = React.createClass({ - render() { - var name = this.props.name; - var def = this.props.def; - var doc = def.doc || {}; - - return ( -
-

- {name + '()'} -

- {doc.synopsis && } - - {def.signatures.map((callSig, i) => - [, '\n'] - )} - - {doc.notes && doc.notes.map((note, i) => -
-

- {note.name} -

- { - note.name === 'alias' ? - : - note.body - } -
- )} - {doc.description && -
-

- {doc.description.substr(0, 5) === ' - -

- } -
- ); - } -}); - -var TypeDoc = React.createClass({ - render() { - var name = this.props.name; - var def = this.props.def; - var memberName = this.props.memberName; - var memberGroups = this.props.memberGroups; - - var doc = def.doc || {}; - var call = def.call; - var functions = Seq(def.module).filter(t => !t.interface && !t.module); - var types = Seq(def.module).filter(t => t.interface || t.module); - var interfaceDef = def.interface; - var typePropMap = getTypePropMap(interfaceDef); - - return ( -
-

- {name} -

- {doc.synopsis && } - {interfaceDef && - - } - - {doc.notes && doc.notes.map((note, i) => -
-

- {note.name} -

- { - note.name === 'alias' ? - : - note.body - } -
- )} - - {doc.description && -
-

- {doc.description.substr(0, 5) === ' - -

- } - - {call && -
-

Construction

- -
- } - - {functions.count() > 0 && -
-

Static methods

- {functions.map((t, fnName) => - - ).toArray()} -
- } - - {types.count() > 0 && -
-

Types

- {types.map((t, typeName) => -
- - {(name?name+'.'+typeName:typeName)} - -
- ).toArray()} -
- } - -
- {Seq(memberGroups).map((members, title) => - members.length === 0 ? null : - Seq([ -

- {title || 'Members'} -

, - Seq(members).map(member => - - ) - ]) - ).flatten().toArray()} -
-
- ); - } -}); - - -/** - * Get a map from super type parameter to concrete type definition. This is - * used when rendering inherited type definitions to ensure contextually - * relevant information. - * - * Example: - * - * type A implements B - * type B implements C - * type C - * - * parse C: - * {} - * - * parse B: - * { C { - var superModule = defs.Immutable; - e.name.split('.').forEach(part => { - superModule = - superModule && superModule.module && superModule.module[part]; - }); - var superInterface = superModule && superModule.interface; - if (superInterface) { - var interfaceMap = Seq(superInterface.typeParams) - .toKeyedSeq().flip().map(i => e.args[i]).toObject(); - Seq(interfaceMap).forEach((v, k) => { - map[e.name + '<' + k] = v; - }); - var superMap = getTypePropMap(superInterface); - Seq(superMap).forEach((v, k) => { - map[k] = v.k === TypeKind.Param ? interfaceMap[v.param] : v - }); - } - }); - return map; -} - - -module.exports = TypeDocumentation; diff --git a/pages/src/docs/src/index.js b/pages/src/docs/src/index.js deleted file mode 100644 index 2c26c3764b..0000000000 --- a/pages/src/docs/src/index.js +++ /dev/null @@ -1,135 +0,0 @@ -var React = require('react'); -var assign = require('react/lib/Object.assign'); -var Router = require('react-router'); -var { Route, DefaultRoute, RouteHandler } = Router; -var DocHeader = require('./DocHeader'); -var TypeDocumentation = require('./TypeDocumentation'); -var defs = require('../../../lib/getTypeDefs'); - - -var Documentation = React.createClass({ - render() { - var typeDefURL = "https://github.com/facebook/immutable-js/blob/master/type-definitions/Immutable.d.ts"; - var issuesURL = "https://github.com/facebook/immutable-js/issues"; - return ( -
- -
-
- -
- This documentation is generated from Immutable.d.ts. - Pull requests and Issues welcome. -
-
-
-
- ); - } -}); - -var DocDeterminer = React.createClass({ - mixins: [ Router.State ], - - render() { - var { def, name, memberName } = determineDoc(this.getPath()); - return ( - - ); - } -}); - - -function determineDoc(path) { - var [, name, memberName] = path.split('/'); - - var namePath = name ? name.split('.') : []; - var def = namePath.reduce( - (def, subName) => def && def.module && def.module[subName], - defs.Immutable - ); - - return { def, name, memberName }; -} - - -module.exports = React.createClass({ - - childContextTypes: { - getPageData: React.PropTypes.func.isRequired, - }, - - getChildContext() { - return { - getPageData: this.getPageData, - }; - }, - - getPageData() { - return this.pageData; - }, - - componentWillMount() { - var location, scrollBehavior; - - if (window.document) { - location = Router.HashLocation; - location.addChangeListener(change => { - this.pageData = assign({}, change, determineDoc(change.path)); - }); - - this.pageData = !window.document ? {} : assign({ - path: location.getCurrentPath(), - type: 'init', - }, determineDoc(location.getCurrentPath())); - - scrollBehavior = { - updateScrollPosition: (position, actionType) => { - switch (actionType) { - case 'push': - return this.getPageData().memberName ? - null : - window.scrollTo(0, 0); - case 'pop': - return window.scrollTo( - position ? position.x : 0, - position ? position.y : 0 - ); - } - } - }; - } - - Router.create({ - routes: - - - - - , - location: location, - scrollBehavior: scrollBehavior - }).run(Handler => { - this.setState({handler: Handler}); - }); - }, - - // TODO: replace this. this is hacky and probably wrong - - componentDidMount() { - setTimeout(() => { this.pageData.type = ''; }, 0); - }, - - componentDidUpdate() { - setTimeout(() => { this.pageData.type = ''; }, 0); - }, - - render () { - var Handler = this.state.handler; - return ; - } -}); diff --git a/pages/src/docs/src/isMobile.js b/pages/src/docs/src/isMobile.js deleted file mode 100644 index 0af2bd376b..0000000000 --- a/pages/src/docs/src/isMobile.js +++ /dev/null @@ -1,3 +0,0 @@ -var isMobile = - window.matchMedia && window.matchMedia('(max-device-width: 680px)'); -module.exports = false && !!(isMobile && isMobile.matches); diff --git a/pages/src/docs/src/style.less b/pages/src/docs/src/style.less deleted file mode 100644 index 2a995e5d0d..0000000000 --- a/pages/src/docs/src/style.less +++ /dev/null @@ -1,272 +0,0 @@ -@import (less) '../../src/base.less'; - -.pageBody { - padding: 0 36px; - position: relative; -} - -.contents { - margin: 0 auto; - max-width: 880px; - padding: 64px 0; - position: relative; -} - -.disclaimer { - margin: 60px 20px 0 260px; - border: solid 1px #eecccc; - background: #fefafa; - padding: 1em; - text-align: center; - font-size: 0.8em; -} - -@media only screen and (max-width: 680px) { - .disclaimer { - margin: 60px 0 0; - } -} - -.miniHeader { - background: #6dbcdb; - position: fixed; - width: 100%; - z-index: 1; -} - -@media only screen and (max-width: 680px) { - .miniHeader { - position: relative; - } -} - -.miniHeaderContents { - margin: 0 auto; - max-width: 880px; - padding: 12px 36px; - position: relative; - text-align: right; -} - -@media only screen and (max-width: 680px) { - .miniHeaderContents { - text-align: left; - } -} - -.miniLogo { - float: left; - left: -140px; - top: 12px; -} - -@media only screen and (max-width: 680px) { - .miniLogo { - display: none; - } -} - -.miniLogo > .svg { - height: 24px; -} - -.miniHeaderContents a { - color: #fff; - font-weight: bold; - margin-right: 1em; - text-decoration: none; - text-shadow: 0 1px 1px rgba(0,0,0,0.25); -} - -.miniHeaderContents a:last-child { - margin-right: 0; -} - -.toolBar { - .select-none(); - font-size: 0.825em; - position: absolute; - right: 0; - top: 66px; - width: 220px; - color: #888; - cursor: pointer; -} - -.toolBar .selected { - color: #141420; -} - -@media only screen and (max-width: 680px) { - .toolBar { - display: none; - } -} - -.sideBar { - .select-none(); - font-size: 0.825em; - height: 100%; - overflow: hidden; - position: absolute; - right: 0; - top: 50px; - width: 220px; - z-index: 0; -} - -@media only screen and (max-width: 680px) { - .sideBar { - display: none; - } -} - -.sideBar .scrollContent { - box-sizing: border-box; - height: 100%; - overflow: auto; - padding: 66px 0 100px; - width: 240px; -} - -.sideBar h2 { - font-size: 1em; - margin: 1em 0; - - position: relative; -} - -.sideBar h2 a { - font-weight: normal; -} - -.sideBar .members { - margin: 0 0 2.5em 1em; -} - -.sideBar .groupTitle { - color: @body-color; - font-size: 1em; - margin: 1em 0 0; -} - -.docContents { - margin-right: 240px; -} - -@media only screen and (max-width: 680px) { - .docContents { - margin-right: 0; - } -} - -.t a { - .transition(background-color 0.15s); - background-color: rgba(0,0,0,0.01); - border-radius: 4px; - box-shadow: inset 0 0 1px rgba(0,0,0,0.08); - margin: -2px -4px; - padding: 2px 4px; -} - -.t a:hover { - background-color: rgba(112, 170, 220, 0.2); -} - -.typeHeader { - color: #555; - font-size: 1.5em; - font-weight: normal; - margin: 1rem 0; - font-weight: bold; -} - -.interfaceMember { - margin: 1.3rem 0; -} - -.infoHeader { - color: #555; - font-size: 10px; - letter-spacing: 0.25ch; - line-height: 16px; - margin: 1rem 0 0.125rem; - text-transform: uppercase; -} - -.synopsis { - margin: -0.5em 0 1em; -} - -.discussion p:first-child { - margin-top: 0.5em; -} - -.memberSignature { - border-left-color: #9CDAE9; - background: #F8F9FA; -} - -.t.over { - border-bottom: solid 2px rgba(0,0,0,0.05); - padding-bottom: 3px; -} - -.memberLabel { - font-size: 1em; - margin: 0; -} - -@media only screen and (max-width: 680px) { - .memberLabel { - .select-none(); - cursor: pointer; - } -} - -.detail { - box-sizing: border-box; - margin-bottom: 2.6rem; - overflow: hidden; -} - -.groupTitle { - color: #9A9C9E; - font-size: 1.5em; - font-weight: 300; - margin: 3rem 0 2rem; -} - -@media only screen and (max-width: 680px) { - .groupTitle { - margin: 2em 0 1em; - } -} - -.doc { - margin: 2em 0 3em; -} - -p:last-child { - margin-bottom: 0; -} - - -// macros - -.transition(@transition) { - -webkit-transition: @transition; - -moz-transition: @transition; - -ms-transition: @transition; - -o-transition: @transition; -} - -.select-none() { - cursor: default; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - -webkit-touch-callout: none; - -webkit-user-select: none; - user-select: none; -} diff --git a/pages/src/index.html b/pages/src/index.html deleted file mode 100644 index ffd3298d44..0000000000 --- a/pages/src/index.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - - Immutable.js - - - - - - - - - - - - - - - diff --git a/pages/src/src/Header.js b/pages/src/src/Header.js deleted file mode 100644 index bd1d287eeb..0000000000 --- a/pages/src/src/Header.js +++ /dev/null @@ -1,124 +0,0 @@ -var React = require('react'); -var SVGSet = require('./SVGSet'); -var Logo = require('./Logo'); -var StarBtn = require('./StarBtn'); - - -var isMobileMatch = window.matchMedia && window.matchMedia('(max-device-width: 680px)'); -var isMobile = isMobileMatch && isMobileMatch.matches; - -var Header = React.createClass({ - - getInitialState: function() { - return { scroll: 0 }; - }, - - componentDidMount: function () { - this.offsetHeight = this.getDOMNode().offsetHeight; - window.addEventListener('scroll', this.handleScroll); - window.addEventListener('resize', this.handleResize); - }, - - componentWillUnmount: function () { - window.removeEventListener('scroll', this.handleScroll); - window.removeEventListener('resize', this.handleResize); - }, - - handleResize: function (event) { - this.offsetHeight = this.getDOMNode().offsetHeight; - }, - - handleScroll: function (event) { - if (!this._pending) { - var headerHeight = Math.min(800, Math.max(260, document.documentElement.clientHeight * 0.7)); - if (window.scrollY < headerHeight) { - this._pending = true; - window.requestAnimationFrame(() => { - this._pending = false; - this.setState({ scroll: window.scrollY }); - }); - } - } - }, - - render: function() { - var neg = this.state.scroll < 0; - var s = neg ? 0 : this.state.scroll; - var sp = isMobile ? 35 : 70; - - return ( -
- -
-
-
-
- -
-
-
- {(isMobile ? [0,0,0,0,0,0,0] : [0,0,0,0,0,0,0,0,0,0,0,0]).map((_, i) => - - - - - )} - - - - -
-
-
- -
-
-
-
-
- ); - } -}); - - -function y(s, p) { - return ((p < s ? p : s) * -0.55); -} - -function o(s, p) { - return Math.max(0, s > p ? 1 - (s - p)/350 : 1); -} - -function z(s, p) { - return Math.max(0, s > p ? 1 - (s - p)/20000 : 1); -} - -function t(y, z) { - var transform = 'translate3d(0, '+y+'px, 0) scale('+z+')'; - return { - transform: transform, - WebkitTransform: transform, - MozTransform: transform, - msTransform: transform, - OTransform: transform, - }; -} - - -module.exports = Header; diff --git a/pages/src/src/Logo.js b/pages/src/src/Logo.js deleted file mode 100644 index a3f9ce2a49..0000000000 --- a/pages/src/src/Logo.js +++ /dev/null @@ -1,67 +0,0 @@ -var React = require('react'); - - -var Logo = React.createClass({ - - shouldComponentUpdate: function(nextProps) { - return nextProps.opacity !== this.props.opacity; - }, - - render: function() { - var opacity = this.props.opacity; - if (opacity === undefined) { - opacity = 1; - } - return !this.props.inline ? ( - - - - - - - - - - - - ) : ( - - - - - - - - - - - - ); - } -}); - - -module.exports = Logo; diff --git a/pages/src/src/SVGSet.js b/pages/src/src/SVGSet.js deleted file mode 100644 index a6fb1a7e4a..0000000000 --- a/pages/src/src/SVGSet.js +++ /dev/null @@ -1,15 +0,0 @@ -var React = require('react'); - - -var SVGSet = React.createClass({ - render: function() { - return ( - - {this.props.children} - - ); - } -}); - - -module.exports = SVGSet; diff --git a/pages/src/src/StarBtn.js b/pages/src/src/StarBtn.js deleted file mode 100644 index 3f30cc8a4a..0000000000 --- a/pages/src/src/StarBtn.js +++ /dev/null @@ -1,40 +0,0 @@ -var React = require('react'); -var loadJSON = require('./loadJSON'); - - -// API endpoints -// https://registry.npmjs.org/immutable/latest -// https://api.github.com/repos/facebook/immutable-js - -var StarBtn = React.createClass({ - - getInitialState: function() { - return { stars: null }; - }, - - componentDidMount: function () { - loadJSON('https://api.github.com/repos/facebook/immutable-js', value => { - value && value.stargazers_count && - this.setState({stars: value.stargazers_count}); - }); - }, - - render: function() { - return ( - - - - Star - - {this.state.stars && - - {this.state.stars} - - } - - ); - } - -}); - -module.exports = StarBtn; diff --git a/pages/src/src/StarBtn.less b/pages/src/src/StarBtn.less deleted file mode 100644 index 6bf95f3c3e..0000000000 --- a/pages/src/src/StarBtn.less +++ /dev/null @@ -1,136 +0,0 @@ -.github-btn { - margin-top: -10%; -} - -.gh-btn, -.gh-count, -.gh-ico { - float: left; -} - -.gh-btn, -.gh-count { - border-radius: 6px; - color: #212121; - cursor: pointer; - font-size: 24px; - font-weight: 300; - line-height: 32px; - padding: 6px 14px 6px 12px; - text-decoration: none; - text-shadow: 0 1px 0 #fff; - white-space: nowrap; -} - -.gh-btn { - .gradient(#fafafa, #eaeaea); - border-bottom-color: #bcbcbc; - border: 1px solid #d4d4d4; -} - -.gh-btn:hover, -.gh-btn:focus, -.gh-btn:active { - background-color: #3072b3; - border-color: #518cc6 #518cc6 #2a65a0; - color: #fff; - text-shadow: 0 -1px 0 rgba(0,0,0,0.25); -} - -.gh-btn:hover, -.gh-btn:focus { - .gradient(#599bdc, #3072b3); -} - -.gh-btn:active { - -moz-box-shadow: inset 0 2px 5px rgba(0,0,0,0.1); - -webkit-box-shadow: inset 0 2px 5px rgba(0,0,0,0.1); - background-image: none; - box-shadow: inset 0 2px 5px rgba(0,0,0,0.1); -} - -.gh-ico { - background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxNy4xLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DQo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB3aWR0aD0iMTMycHgiIGhlaWdodD0iNjZweCIgdmlld0JveD0iMCAwIDEzMiA2NiIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMTMyIDY2IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBmaWxsPSIjMzMzMzMzIiBkPSJNMzMsMS44Yy0xNy43LDAtMzIsMTQuMy0zMiwzMmMwLDE0LjEsOS4yLDI2LjEsMjEuOSwzMC40DQoJYzEuNiwwLjMsMi4yLTAuNywyLjItMS41YzAtMC44LDAtMi44LDAtNS40Yy04LjksMS45LTEwLjgtNC4zLTEwLjgtNC4zYy0xLjUtMy43LTMuNi00LjctMy42LTQuN2MtMi45LTIsMC4yLTEuOSwwLjItMS45DQoJYzMuMiwwLjIsNC45LDMuMyw0LjksMy4zYzIuOSw0LjksNy41LDMuNSw5LjMsMi43YzAuMy0yLjEsMS4xLTMuNSwyLTQuM2MtNy4xLTAuOC0xNC42LTMuNi0xNC42LTE1LjhjMC0zLjUsMS4yLTYuMywzLjMtOC42DQoJYy0wLjMtMC44LTEuNC00LjEsMC4zLTguNWMwLDAsMi43LTAuOSw4LjgsMy4zYzIuNi0wLjcsNS4zLTEuMSw4LTEuMWMyLjcsMCw1LjUsMC40LDgsMS4xYzYuMS00LjEsOC44LTMuMyw4LjgtMy4zDQoJYzEuNyw0LjQsMC42LDcuNywwLjMsOC41YzIuMSwyLjIsMy4zLDUuMSwzLjMsOC42YzAsMTIuMy03LjUsMTUtMTQuNiwxNS44YzEuMSwxLDIuMiwyLjksMi4yLDUuOWMwLDQuMywwLDcuNywwLDguOA0KCWMwLDAuOSwwLjYsMS45LDIuMiwxLjVDNTUuOCw1OS45LDY1LDQ3LjksNjUsMzMuOEM2NSwxNi4xLDUwLjcsMS44LDMzLDEuOHoiLz4NCjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBmaWxsPSIjRkZGRkZGIiBkPSJNOTksMS44Yy0xNy43LDAtMzIsMTQuMy0zMiwzMmMwLDE0LjEsOS4yLDI2LjEsMjEuOSwzMC40DQoJYzEuNiwwLjMsMi4yLTAuNywyLjItMS41YzAtMC44LDAtMi44LDAtNS40Yy04LjksMS45LTEwLjgtNC4zLTEwLjgtNC4zYy0xLjUtMy43LTMuNi00LjctMy42LTQuN2MtMi45LTIsMC4yLTEuOSwwLjItMS45DQoJYzMuMiwwLjIsNC45LDMuMyw0LjksMy4zYzIuOSw0LjksNy41LDMuNSw5LjMsMi43YzAuMy0yLjEsMS4xLTMuNSwyLTQuM2MtNy4xLTAuOC0xNC42LTMuNi0xNC42LTE1LjhjMC0zLjUsMS4yLTYuMywzLjMtOC42DQoJYy0wLjMtMC44LTEuNC00LjEsMC4zLTguNWMwLDAsMi43LTAuOSw4LjgsMy4zYzIuNi0wLjcsNS4zLTEuMSw4LTEuMWMyLjcsMCw1LjUsMC40LDgsMS4xYzYuMS00LjEsOC44LTMuMyw4LjgtMy4zDQoJYzEuNyw0LjQsMC42LDcuNywwLjMsOC41YzIuMSwyLjIsMy4zLDUuMSwzLjMsOC42YzAsMTIuMy03LjUsMTUtMTQuNiwxNS44YzEuMSwxLDIuMiwyLjksMi4yLDUuOWMwLDQuMywwLDcuNywwLDguOA0KCWMwLDAuOSwwLjYsMS45LDIuMiwxLjVjMTIuNy00LjIsMjEuOS0xNi4yLDIxLjktMzAuNEMxMzEsMTYuMSwxMTYuNywxLjgsOTksMS44eiIvPg0KPC9zdmc+DQo=); - background-position: 0 0; - background-repeat: no-repeat; - background-size: 56px 28px; - height: 28px; - margin: 2px 6px 0 0; - width: 28px; -} - -.gh-btn:hover .gh-ico, -.gh-btn:focus .gh-ico, -.gh-btn:active .gh-ico { - background-position: -28px 0; -} - -.gh-count { - background-color: #fafafa; - border: 1px solid #d4d4d4; - display: block !important; - display: none; - margin-left: 10px; - position: relative; -} - -.gh-count:hover, -.gh-count:focus { - color: #4183C4; -} - -.gh-count:before, -.gh-count:after { - border-color: transparent; - border-style: solid; - content: ''; - position: absolute; -} - -.gh-count:before{ - border-right-color: #fafafa; - border-width: 8px 8px 8px 0; - left: -7px; - margin-top: -8px; - top: 50%; -} - -.gh-count:after{ - border-right-color: #d4d4d4; - border-width: 9px 9px 9px 0; - left: -8px; - margin-top: -9px; - top: 50%; - z-index: -1; -} - -@media only screen and (max-width: 680px) { - .gh-btn, - .gh-count { - font-size: 16px; - line-height: 21px; - padding: 4px 12px 4px 10px; - } - - .gh-ico { - background-size: 36px 18px; - height: 18px; - margin: 1px 4px 0 0; - width: 18px; - } - - .gh-btn:hover .gh-ico, - .gh-btn:focus .gh-ico, - .gh-btn:active .gh-ico { - background-position: -18px 0; - } -} - -.gradient (@startColor: #eee, @endColor: white) { - background-color: @startColor; - background: -webkit-gradient(linear, left top, left bottom, from(@startColor), to(@endColor)); - background: -webkit-linear-gradient(top, @startColor, @endColor); - background: -moz-linear-gradient(top, @startColor, @endColor); - background: -ms-linear-gradient(top, @startColor, @endColor); - background: -o-linear-gradient(top, @startColor, @endColor); -} diff --git a/pages/src/src/base.less b/pages/src/src/base.less deleted file mode 100644 index ea7abee058..0000000000 --- a/pages/src/src/base.less +++ /dev/null @@ -1,140 +0,0 @@ -@link-color: #4183C4; -@header-color: #212325; -@body-color: #626466; - -html, body { - -webkit-tap-highlight-color: rgba(0, 0, 0, 0); - -webkit-text-size-adjust: 100%; - -ms-text-size-adjust: 100%; - margin: 0; - padding: 0; - -webkit-font-smoothing: antialiased; - color: @body-color; - font-family: 'Fira Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; - font-size: 16px; - line-height: 1.625; -} - -@media only screen and (max-width: 680px) { - body { - font-size: 14px; - } -} - -h1, h2, h3, h4, h5, h6 { - color: @header-color; -} - -a { - color: @link-color; - text-decoration: none; -} - -pre, code { - font-family: 'Fira Mono', Menlo, monospace; - background: #F9F8F7; - color: #484A4C; - font-size: 0.9375em; - letter-spacing: -0.015em; -} - -code { - margin: -0.05rem -0.15em; - padding: 0.05rem 0.35em; -} - -blockquote { - margin: 1rem 0; - padding: 0 1rem; - color: #727476; - border-left: solid 3px #DCDAD9; -} - -blockquote > :first-child { - margin-top: 0; -} - -blockquote > :last-child { - margin-bottom: 0; -} - - -// Markdown - -.codeBlock { - -webkit-overflow-scrolling: touch; - background: #FCFBFA; - border-left: solid 3px #ECEAE9; - box-sizing: border-box; - display: block; - font-size: 0.875em; - margin: 0.5rem 0; - overflow-y: scroll; - padding: 0.5rem 8px 0.5rem 12px; - white-space: pre; -} - -.t.blockParams { - padding-left: 2ch; -} - -// TODO: not random colors - -.token.punctuation, -.token.ignore, -.t.interfaceDef, -.t.member, -.t.callSig { - color: #808890; -} - -.token.function, -.token.class-name, -.token.qualifier, -.t.fnQualifier, -.t.fnName { - color: #32308E; -} - -.token.primitive, -.t.primitive { - color: #922; -} - -.token.number, -.t.typeParam { - color: #905; -} - -.t.typeQualifier, -.t.typeName { - color: #013679; -} - -.t.param { - color: #945277; -} - -.t.memberName { - color: teal; -} - -.token.block-keyword, -.token.keyword, -.t.keyword { - color: #A51; -} - -.token.string, -.token.regex { - color: #df5050; -} - -.token.operator { - color: #a67f59; -} - -.token.comment { - color: #998; - font-style: italic; -} diff --git a/pages/src/src/index.js b/pages/src/src/index.js deleted file mode 100644 index 734abc3baf..0000000000 --- a/pages/src/src/index.js +++ /dev/null @@ -1,22 +0,0 @@ -var React = require('react'); -var Header = require('./Header'); -var readme = require('../../resources/readme.json'); - - -var Index = React.createClass({ - render: function () { - return ( -
-
-
-
-
-
-
-
- ); - } -}); - - -module.exports = Index; diff --git a/pages/src/src/loadJSON.js b/pages/src/src/loadJSON.js deleted file mode 100644 index f83528bb72..0000000000 --- a/pages/src/src/loadJSON.js +++ /dev/null @@ -1,14 +0,0 @@ -module.exports = loadJSON; - -function loadJSON(url, then) { - var oReq = new XMLHttpRequest(); - oReq.onload = event => { - var json; - try { - json = JSON.parse(event.target.responseText); - } catch (e) {} - then(json); - } - oReq.open("get", url, true); - oReq.send(); -} diff --git a/pages/src/src/style.less b/pages/src/src/style.less deleted file mode 100644 index 75b1e180a3..0000000000 --- a/pages/src/src/style.less +++ /dev/null @@ -1,191 +0,0 @@ -.header { - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - -webkit-touch-callout: none; - -webkit-user-select: none; - user-select: none; -} - -.pageBody { - padding: 0 36px; - position: relative; -} - -.contents { - margin: 0 auto; - max-width: 740px; - padding: 64px 0; -} - -.contents h2 { - margin: 4rem 0 1rem; -} - -.contents h3 { - margin: 2rem 0 1rem; -} - -.miniHeader { - background: #6dbcdb; - position: fixed; - width: 100%; - z-index: 1; -} - -.miniHeaderContents { - margin: 0 auto; - max-width: 880px; - padding: 12px 36px; - text-align: right; -} - -@media only screen and (max-width: 680px) { - .miniHeaderContents { - text-align: left; - } -} - -.miniLogo { - float: left; - left: -140px; - top: 12px; -} - -@media only screen and (max-width: 680px) { - .miniLogo { - display: none; - } -} - -.miniLogo > .svg { - height: 24px; -} - -.miniHeaderContents a { - color: #fff; - font-weight: bold; - margin-right: 1em; - text-decoration: none; - text-shadow: 0 1px 1px rgba(0,0,0,0.25); -} - -.miniHeaderContents a:last-child { - margin-right: 0; -} - -.coverContainer { - background-color: #d7dadb; - height: 70vh; - max-height: 800px; - min-height: 260px; - outline: solid 1px rgba(0,0,0,0.2); - overflow: hidden; - position: relative; - width: 100%; - z-index: 1; -} - -.cover { - height: 70vh; - max-height: 800px; - min-height: 260px; - position: absolute; - width: 100%; - clip: rect(0, auto, auto, 0); -} - -.coverFixed { - -webkit-align-items: center; - -webkit-flex-direction: column; - -webkit-justify-content: center; - align-items: center; - display: -webkit-flex; - display: flex; - flex-direction: column; - height: 100%; - justify-content: center; - position: fixed; - width: 100%; - top: 0; - height: 70vh; -} - -.filler { - -webkit-flex: 10; - flex: 10; - width: 100%; -} - -.synopsis { - -webkit-flex: 10; - box-sizing: border-box; - flex: 10; - max-width: 700px; - padding: 0 30px; - pointer-events: none; - position: relative; - width: 100%; -} - -.logo { - bottom: 0; - left: 60px; - position: absolute; - right: 60px; - top: 0; -} - -.logo > .svg { - height: 100%; - position: absolute; - width: 100%; -} - -.buttons { - -webkit-align-items: center; - -webkit-flex: 10; - align-items: center; - display: -webkit-flex; - display: flex; - flex: 10; -} - - - -@media only screen and (max-width: 680px) { - - .cover { - max-height: 260px; - } - - .coverFixed { - max-height: 260px; - } - - .miniHeader { - display: none; - } - - .miniHeaderContents { - padding: 12px; - text-align: center; - } - - .synopsis { - max-width: 540px; - } - - .logo { - left: 30px; - right: 30px; - } - - .contents { - padding-top: 24px; - } - - .pageBody { - padding: 0 12px; - } -} diff --git a/pages/third_party/typescript/.npmignore b/pages/third_party/typescript/.npmignore deleted file mode 100644 index 99b51a2b65..0000000000 --- a/pages/third_party/typescript/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -built -doc -src -tests -Jakefile diff --git a/pages/third_party/typescript/.travis.yml b/pages/third_party/typescript/.travis.yml deleted file mode 100644 index 11396be589..0000000000 --- a/pages/third_party/typescript/.travis.yml +++ /dev/null @@ -1,13 +0,0 @@ -language: node_js - -node_js: -- '0.10' - -before_script: npm install -g codeclimate-test-reporter - -after_script: -- cat coverage/lcov.info | codeclimate - -addons: - code_climate: - repo_token: 9852ac5362c8cc38c07ca5adc0f94c20c6c79bd78e17933dc284598a65338656 diff --git a/pages/third_party/typescript/CONTRIBUTING.md b/pages/third_party/typescript/CONTRIBUTING.md deleted file mode 100644 index a6ab80a408..0000000000 --- a/pages/third_party/typescript/CONTRIBUTING.md +++ /dev/null @@ -1,73 +0,0 @@ -## Contributing bug fixes -TypeScript is currently accepting contributions in the form of bug fixes. A bug must have an issue tracking it in the issue tracker that has been approved ("Milestone == Community") by the TypeScript team. Your pull request should include a link to the bug that you are fixing. If you've submitted a PR for a bug, please post a comment in the bug to avoid duplication of effort. - -## Contributing features -Features (things that add new or improved functionality to TypeScript) may be accepted, but will need to first be approved (marked as "Milestone == Community" by a TypeScript coordinator with the message "Approved") in the suggestion issue. Features with language design impact, or that are adequately satisfied with external tools, will not be accepted. - -Design changes will not be accepted at this time. If you have a design change proposal, please log a suggestion issue. - -## Legal -You will need to complete a Contributor License Agreement (CLA). Briefly, this agreement testifies that you are granting us permission to use the submitted change according to the terms of the project's license, and that the work being submitted is under appropriate copyright. - -Please submit a Contributor License Agreement (CLA) before submitting a pull request. Download the agreement ([Microsoft Contribution License Agreement.docx](https://www.codeplex.com/Download?ProjectName=typescript&DownloadId=822190)), sign, scan, and email it back to . Be sure to include your github user name along with the agreement. Once we have received the signed CLA, we'll review the request. Please note that we're currently only accepting pull requests of bug fixes rather than new features. - -## Housekeeping -Your pull request should: - -* Include a description of what your change intends to do -* Be a child commit of a reasonably recent commit in the **master** branch - * Requests need not be a single commit, but should be a linear sequence of commits (i.e. no merge commits in your PR) -* It is desirable, but not necessary, for the tests to pass at each commit -* Have clear commit messages - * e.g. "Refactor feature", "Fix issue", "Add tests for issue" -* Include adequate tests - * At least one test should fail in the absence of your non-test code changes. If your PR does not match this criteria, please specify why - * Tests should include reasonable permutations of the target fix/change - * Include baseline changes with your change - * All changed code must have 100% code coverage -* Follow the code conventions descriped in [Coding guidlines](https://github.com/Microsoft/TypeScript/wiki/Coding-guidlines) - -## Running the Tests -To run all tests, invoke the runtests target using jake: - -`jake runtests` - -This run will all tests; to run only a specific subset of tests, use: - -`jake runtests tests=` - -e.g. to run all compiler baseline tests: - -`jake runtests tests=compiler` - -or to run specifc test:tests\cases\compiler\2dArrays.ts - -`jake runtests tests=2dArrays` - -## Adding a Test -To add a new testcase, simply place a .ts file in tests\cases\compiler containing code that exemplifies the bugfix or change you are making. - -These files support metadata tags in the format // @name: value . The supported names and values are: - -* comments, sourcemap, noimplicitany, declaration: true or false (corresponds to the compiler command-line options of the same name) -* target: ES3 or ES5 (same as compiler) -* out, outDir: path (same as compiler) -* module: local, commonjs, or amd (local corresponds to not passing any compiler --module flag) - -**Note** that if you have a test corresponding to a specific spec compliance item, you can place it in tests\cases\conformance in an appropriately-named subfolder. -**Note** that filenames here must be distinct from all other compiler testcase names, so you may have to work a bit to find a unique name if it's something common. - -## Managing the Baselines -Compiler testcases generate baselines that track the emitted .js, the errors produced by the compiler, and the type of each expression in the file. Additionally, some testcases opt in to baselining the source map output. - -When a change in the baselines is detected, the test will fail. To inspect changes vs the expected baselines, use - -`jake diff` - -After verifying that the changes in the baselines are correct, run - -`jake baseline-accept` - -to establish the new baselines as the desired behavior. This will change the files in tests\baselines\reference, which should be included as part of your commit. It's important to carefully validate changes in the baselines. - -**Note** that baseline-accept should only be run after a full test run! Accepting baselines after running a subset of tests will delete baseline files for the tests that didn't run. diff --git a/pages/third_party/typescript/CopyrightNotice.txt b/pages/third_party/typescript/CopyrightNotice.txt deleted file mode 100644 index 0f6db1f75f..0000000000 --- a/pages/third_party/typescript/CopyrightNotice.txt +++ /dev/null @@ -1,15 +0,0 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - diff --git a/pages/third_party/typescript/LICENSE.txt b/pages/third_party/typescript/LICENSE.txt deleted file mode 100644 index 8746124b27..0000000000 --- a/pages/third_party/typescript/LICENSE.txt +++ /dev/null @@ -1,55 +0,0 @@ -Apache License - -Version 2.0, January 2004 - -http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - -"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. - -"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. - -"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. - -"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. - -"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. - -"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. - -"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). - -"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. - -"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." - -"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: - -You must give any other recipients of the Work or Derivative Works a copy of this License; and - -You must cause any modified files to carry prominent notices stating that You changed the files; and - -You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and - -If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS diff --git a/pages/third_party/typescript/README.md b/pages/third_party/typescript/README.md deleted file mode 100644 index f7e55d2dff..0000000000 --- a/pages/third_party/typescript/README.md +++ /dev/null @@ -1,78 +0,0 @@ -[![Build Status](https://travis-ci.org/Microsoft/TypeScript.svg?branch=master)](https://travis-ci.org/Microsoft/TypeScript) -[![Issue Stats](http://issuestats.com/github/Microsoft/TypeScript/badge/pr)](http://issuestats.com/github/microsoft/typescript) -[![Issue Stats](http://issuestats.com/github/Microsoft/TypeScript/badge/issue)](http://issuestats.com/github/microsoft/typescript) - -# TypeScript - -[TypeScript](http://www.typescriptlang.org/) is a language for application-scale JavaScript. TypeScript adds optional types, classes, and modules to JavaScript. TypeScript supports tools for large-scale JavaScript applications for any browser, for any host, on any OS. TypeScript compiles to readable, standards-based JavaScript. Try it out at the [playground](http://www.typescriptlang.org/Playground), and stay up to date via [our blog](http://blogs.msdn.com/typescript) and [twitter account](https://twitter.com/typescriptlang). - - -## Contribute - -There are many ways to [contribute](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md) to TypeScript. -* [Submit bugs](https://github.com/Microsoft/TypeScript/issues) and help us verify fixes as they are checked in. -* Review the [source code changes](https://github.com/Microsoft/TypeScript/pulls). -* Engage with other TypeScript users and developers on [StackOverflow](http://stackoverflow.com/questions/tagged/typescript). -* Join the [#typescript](http://twitter.com/#!/search/realtime/%23typescript) discussion on Twitter. -* [Contribute bug fixes](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md). -* Read the language specification ([docx](http://go.microsoft.com/fwlink/?LinkId=267121), [pdf](http://go.microsoft.com/fwlink/?LinkId=267238)). - - -## Documentation - -* [Quick tutorial](http://www.typescriptlang.org/Tutorial) -* [Programming handbook](http://www.typescriptlang.org/Handbook) -* [Language specification](https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md) -* [Homepage](http://www.typescriptlang.org/) - -## Building - -In order to build the TypeScript compiler, ensure that you have [Git](http://git-scm.com/downloads) and [Node.js](http://nodejs.org/) installed. - -Clone a copy of the repo: - -``` -git clone https://github.com/Microsoft/TypeScript.git -``` - -Change to the TypeScript directory: - -``` -cd TypeScript -``` - -Install Jake tools and dev dependencies: - -``` -npm install -g jake -npm install -``` - -Use one of the following to build and test: - -``` -jake local # Build the compiler into built/local -jake clean # Delete the built compiler -jake LKG # Replace the last known good with the built one. - # Bootstrapping step to be executed when the built compiler reaches a stable state. -jake tests # Build the test infrastructure using the built compiler. -jake runtests # Run tests using the built compiler and test infrastructure. - # You can override the host or specify a test for this command. - # Use host= or tests=. -jake runtests-browser # Runs the tests using the built run.js file. Syntax is jake runtests. Optional - parameters 'host=', 'tests=[regex], reporter=[list|spec|json|]'. -jake baseline-accept # This replaces the baseline test results with the results obtained from jake runtests. -jake -T # List the above commands. -``` - - -## Usage - -```shell -node built/local/tsc.js hello.ts -``` - - -## Roadmap - -For details on our planned features and future direction please refer to our [roadmap](https://github.com/Microsoft/TypeScript/wiki/Roadmap). diff --git a/pages/third_party/typescript/ThirdPartyNoticeText.txt b/pages/third_party/typescript/ThirdPartyNoticeText.txt deleted file mode 100644 index 6fbb7e4a0c..0000000000 --- a/pages/third_party/typescript/ThirdPartyNoticeText.txt +++ /dev/null @@ -1,35 +0,0 @@ -/*!----------------- TypeScript ThirdPartyNotices ------------------------------------------------------- - -The TypeScript software is based on or incorporates material and code from the projects listed below -(collectively "Third Party Code"). Microsoft is not the original author of the -Third Party Code. The original copyright notice and the license, under which -Microsoft received such Third Party Code, are set forth below. Such license and -notices are provided for informational purposes only. Microsoft licenses the Third -Party Code to you under the terms of the Apache 2.0 License. -All Third Party Code licensed by Microsoft under the Apache License, Version 2.0 (the "License"); you -may not use this file except in compliance with the License. You may obtain a copy -of the License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR -CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions and -limitations under the License. ---------------------------------------------- -Third Party Code Components --------------------------------------------- - -------------------- DefinitelyTyped -------------------- -This file is based on or incorporates material from the projects listed below (collectively ?Third Party Code?). Microsoft is not the original author of the Third Party Code. The original copyright notice and the license, under which Microsoft received such Third Party Code, are set forth below. Such licenses and notices are provided for informational purposes only. Microsoft, not the third party, licenses the Third Party Code to you under the terms set forth in the EULA for the Microsoft Product. Microsoft reserves all other rights not expressly granted under this agreement, whether by implication, estoppel or otherwise. -DefinitelyTyped -This project is licensed under the MIT license. -Copyrights are respective of each contributor listed at the beginning of each definition file. -Provided for Informational Purposes Only - -MIT License -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------------------------------------------------------------------- -------------- End of ThirdPartyNotices --------------------------------------------------- */ diff --git a/pages/third_party/typescript/bin/lib.core.d.ts b/pages/third_party/typescript/bin/lib.core.d.ts deleted file mode 100644 index 1d3ed6dca4..0000000000 --- a/pages/third_party/typescript/bin/lib.core.d.ts +++ /dev/null @@ -1,1119 +0,0 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - -/// - -///////////////////////////// -/// ECMAScript APIs -///////////////////////////// - -declare var NaN: number; -declare var Infinity: number; - -/** - * Evaluates JavaScript code and executes it. - * @param x A String value that contains valid JavaScript code. - */ -declare function eval(x: string): any; - -/** - * Converts A string to an integer. - * @param s A string to convert into a number. - * @param radix A value between 2 and 36 that specifies the base of the number in numString. - * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal. - * All other strings are considered decimal. - */ -declare function parseInt(s: string, radix?: number): number; - -/** - * Converts a string to a floating-point number. - * @param string A string that contains a floating-point number. - */ -declare function parseFloat(string: string): number; - -/** - * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a number). - * @param number A numeric value. - */ -declare function isNaN(number: number): boolean; - -/** - * Determines whether a supplied number is finite. - * @param number Any numeric value. - */ -declare function isFinite(number: number): boolean; - -/** - * Gets the unencoded version of an encoded Uniform Resource Identifier (URI). - * @param encodedURI A value representing an encoded URI. - */ -declare function decodeURI(encodedURI: string): string; - -/** - * Gets the unencoded version of an encoded component of a Uniform Resource Identifier (URI). - * @param encodedURIComponent A value representing an encoded URI component. - */ -declare function decodeURIComponent(encodedURIComponent: string): string; - -/** - * Encodes a text string as a valid Uniform Resource Identifier (URI) - * @param uri A value representing an encoded URI. - */ -declare function encodeURI(uri: string): string; - -/** - * Encodes a text string as a valid component of a Uniform Resource Identifier (URI). - * @param uriComponent A value representing an encoded URI component. - */ -declare function encodeURIComponent(uriComponent: string): string; - -interface PropertyDescriptor { - configurable?: boolean; - enumerable?: boolean; - value?: any; - writable?: boolean; - get? (): any; - set? (v: any): void; -} - -interface PropertyDescriptorMap { - [s: string]: PropertyDescriptor; -} - -interface Object { - /** The initial value of Object.prototype.constructor is the standard built-in Object constructor. */ - constructor: Function; - - /** Returns a string representation of an object. */ - toString(): string; - - /** Returns a date converted to a string using the current locale. */ - toLocaleString(): string; - - /** Returns the primitive value of the specified object. */ - valueOf(): Object; - - /** - * Determines whether an object has a property with the specified name. - * @param v A property name. - */ - hasOwnProperty(v: string): boolean; - - /** - * Determines whether an object exists in another object's prototype chain. - * @param v Another object whose prototype chain is to be checked. - */ - isPrototypeOf(v: Object): boolean; - - /** - * Determines whether a specified property is enumerable. - * @param v A property name. - */ - propertyIsEnumerable(v: string): boolean; -} - -/** - * Provides functionality common to all JavaScript objects. - */ -declare var Object: { - new (value?: any): Object; - (): any; - (value: any): any; - - /** A reference to the prototype for a class of objects. */ - prototype: Object; - - /** - * Returns the prototype of an object. - * @param o The object that references the prototype. - */ - getPrototypeOf(o: any): any; - - /** - * Gets the own property descriptor of the specified object. - * An own property descriptor is one that is defined directly on the object and is not inherited from the object's prototype. - * @param o Object that contains the property. - * @param p Name of the property. - */ - getOwnPropertyDescriptor(o: any, p: string): PropertyDescriptor; - - /** - * Returns the names of the own properties of an object. The own properties of an object are those that are defined directly - * on that object, and are not inherited from the object's prototype. The properties of an object include both fields (objects) and functions. - * @param o Object that contains the own properties. - */ - getOwnPropertyNames(o: any): string[]; - - /** - * Creates an object that has the specified prototype, and that optionally contains specified properties. - * @param o Object to use as a prototype. May be null - * @param properties JavaScript object that contains one or more property descriptors. - */ - create(o: any, properties?: PropertyDescriptorMap): any; - - /** - * Adds a property to an object, or modifies attributes of an existing property. - * @param o Object on which to add or modify the property. This can be a native JavaScript object (that is, a user-defined object or a built in object) or a DOM object. - * @param p The property name. - * @param attributes Descriptor for the property. It can be for a data property or an accessor property. - */ - defineProperty(o: any, p: string, attributes: PropertyDescriptor): any; - - /** - * Adds one or more properties to an object, and/or modifies attributes of existing properties. - * @param o Object on which to add or modify the properties. This can be a native JavaScript object or a DOM object. - * @param properties JavaScript object that contains one or more descriptor objects. Each descriptor object describes a data property or an accessor property. - */ - defineProperties(o: any, properties: PropertyDescriptorMap): any; - - /** - * Prevents the modification of attributes of existing properties, and prevents the addition of new properties. - * @param o Object on which to lock the attributes. - */ - seal(o: any): any; - - /** - * Prevents the modification of existing property attributes and values, and prevents the addition of new properties. - * @param o Object on which to lock the attributes. - */ - freeze(o: any): any; - - /** - * Prevents the addition of new properties to an object. - * @param o Object to make non-extensible. - */ - preventExtensions(o: any): any; - - /** - * Returns true if existing property attributes cannot be modified in an object and new properties cannot be added to the object. - * @param o Object to test. - */ - isSealed(o: any): boolean; - - /** - * Returns true if existing property attributes and values cannot be modified in an object, and new properties cannot be added to the object. - * @param o Object to test. - */ - isFrozen(o: any): boolean; - - /** - * Returns a value that indicates whether new properties can be added to an object. - * @param o Object to test. - */ - isExtensible(o: any): boolean; - - /** - * Returns the names of the enumerable properties and methods of an object. - * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. - */ - keys(o: any): string[]; -} - -/** - * Creates a new function. - */ -interface Function { - /** - * Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function. - * @param thisArg The object to be used as the this object. - * @param argArray A set of arguments to be passed to the function. - */ - apply(thisArg: any, argArray?: any): any; - - /** - * Calls a method of an object, substituting another object for the current object. - * @param thisArg The object to be used as the current object. - * @param argArray A list of arguments to be passed to the method. - */ - call(thisArg: any, ...argArray: any[]): any; - - /** - * For a given function, creates a bound function that has the same body as the original function. - * The this object of the bound function is associated with the specified object, and has the specified initial parameters. - * @param thisArg An object to which the this keyword can refer inside the new function. - * @param argArray A list of arguments to be passed to the new function. - */ - bind(thisArg: any, ...argArray: any[]): any; - - prototype: any; - length: number; - - // Non-standard extensions - arguments: any; - caller: Function; -} - -declare var Function: { - /** - * Creates a new function. - * @param args A list of arguments the function accepts. - */ - new (...args: string[]): Function; - (...args: string[]): Function; - prototype: Function; -} - -interface IArguments { - [index: number]: any; - length: number; - callee: Function; -} - -interface String { - /** Returns a string representation of a string. */ - toString(): string; - - /** - * Returns the character at the specified index. - * @param pos The zero-based index of the desired character. - */ - charAt(pos: number): string; - - /** - * Returns the Unicode value of the character at the specified location. - * @param index The zero-based index of the desired character. If there is no character at the specified index, NaN is returned. - */ - charCodeAt(index: number): number; - - /** - * Returns a string that contains the concatenation of two or more strings. - * @param strings The strings to append to the end of the string. - */ - concat(...strings: string[]): string; - - /** - * Returns the position of the first occurrence of a substring. - * @param searchString The substring to search for in the string - * @param position The index at which to begin searching the String object. If omitted, search starts at the beginning of the string. - */ - indexOf(searchString: string, position?: number): number; - - /** - * Returns the last occurrence of a substring in the string. - * @param searchString The substring to search for. - * @param position The index at which to begin searching. If omitted, the search begins at the end of the string. - */ - lastIndexOf(searchString: string, position?: number): number; - - /** - * Determines whether two strings are equivalent in the current locale. - * @param that String to compare to target string - */ - localeCompare(that: string): number; - - /** - * Matches a string with a regular expression, and returns an array containing the results of that search. - * @param regexp A variable name or string literal containing the regular expression pattern and flags. - */ - match(regexp: string): RegExpMatchArray; - - /** - * Matches a string with a regular expression, and returns an array containing the results of that search. - * @param regexp A regular expression object that contains the regular expression pattern and applicable flags. - */ - match(regexp: RegExp): RegExpMatchArray; - - /** - * Replaces text in a string, using a regular expression or search string. - * @param searchValue A String object or string literal that represents the regular expression - * @param replaceValue A String object or string literal containing the text to replace for every successful match of rgExp in stringObj. - */ - replace(searchValue: string, replaceValue: string): string; - - /** - * Replaces text in a string, using a regular expression or search string. - * @param searchValue A String object or string literal that represents the regular expression - * @param replaceValue A function that returns the replacement text. - */ - replace(searchValue: string, replaceValue: (substring: string, ...args: any[]) => string): string; - - /** - * Replaces text in a string, using a regular expression or search string. - * @param searchValue A Regular Expression object containing the regular expression pattern and applicable flags - * @param replaceValue A String object or string literal containing the text to replace for every successful match of rgExp in stringObj. - */ - replace(searchValue: RegExp, replaceValue: string): string; - - /** - * Replaces text in a string, using a regular expression or search string. - * @param searchValue A Regular Expression object containing the regular expression pattern and applicable flags - * @param replaceValue A function that returns the replacement text. - */ - replace(searchValue: RegExp, replaceValue: (substring: string, ...args: any[]) => string): string; - - /** - * Finds the first substring match in a regular expression search. - * @param regexp The regular expression pattern and applicable flags. - */ - search(regexp: string): number; - - /** - * Finds the first substring match in a regular expression search. - * @param regexp The regular expression pattern and applicable flags. - */ - search(regexp: RegExp): number; - - /** - * Returns a section of a string. - * @param start The index to the beginning of the specified portion of stringObj. - * @param end The index to the end of the specified portion of stringObj. The substring includes the characters up to, but not including, the character indicated by end. - * If this value is not specified, the substring continues to the end of stringObj. - */ - slice(start?: number, end?: number): string; - - /** - * Split a string into substrings using the specified separator and return them as an array. - * @param separator A string that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned. - * @param limit A value used to limit the number of elements returned in the array. - */ - split(separator: string, limit?: number): string[]; - - /** - * Split a string into substrings using the specified separator and return them as an array. - * @param separator A Regular Express that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned. - * @param limit A value used to limit the number of elements returned in the array. - */ - split(separator: RegExp, limit?: number): string[]; - - /** - * Returns the substring at the specified location within a String object. - * @param start The zero-based index number indicating the beginning of the substring. - * @param end Zero-based index number indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end. - * If end is omitted, the characters from start through the end of the original string are returned. - */ - substring(start: number, end?: number): string; - - /** Converts all the alphabetic characters in a string to lowercase. */ - toLowerCase(): string; - - /** Converts all alphabetic characters to lowercase, taking into account the host environment's current locale. */ - toLocaleLowerCase(): string; - - /** Converts all the alphabetic characters in a string to uppercase. */ - toUpperCase(): string; - - /** Returns a string where all alphabetic characters have been converted to uppercase, taking into account the host environment's current locale. */ - toLocaleUpperCase(): string; - - /** Removes the leading and trailing white space and line terminator characters from a string. */ - trim(): string; - - /** Returns the length of a String object. */ - length: number; - - // IE extensions - /** - * Gets a substring beginning at the specified location and having the specified length. - * @param from The starting position of the desired substring. The index of the first character in the string is zero. - * @param length The number of characters to include in the returned substring. - */ - substr(from: number, length?: number): string; - - [index: number]: string; -} - -/** - * Allows manipulation and formatting of text strings and determination and location of substrings within strings. - */ -declare var String: { - new (value?: any): String; - (value?: any): string; - prototype: String; - fromCharCode(...codes: number[]): string; -} - -interface Boolean { -} -declare var Boolean: { - new (value?: any): Boolean; - (value?: any): boolean; - prototype: Boolean; -} - -interface Number { - /** - * Returns a string representation of an object. - * @param radix Specifies a radix for converting numeric values to strings. This value is only used for numbers. - */ - toString(radix?: number): string; - - /** - * Returns a string representing a number in fixed-point notation. - * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive. - */ - toFixed(fractionDigits?: number): string; - - /** - * Returns a string containing a number represented in exponential notation. - * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive. - */ - toExponential(fractionDigits?: number): string; - - /** - * Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits. - * @param precision Number of significant digits. Must be in the range 1 - 21, inclusive. - */ - toPrecision(precision?: number): string; -} - -/** An object that represents a number of any kind. All JavaScript numbers are 64-bit floating-point numbers. */ -declare var Number: { - new (value?: any): Number; - (value?: any): number; - prototype: Number; - - /** The largest number that can be represented in JavaScript. Equal to approximately 1.79E+308. */ - MAX_VALUE: number; - - /** The closest number to zero that can be represented in JavaScript. Equal to approximately 5.00E-324. */ - MIN_VALUE: number; - - /** - * A value that is not a number. - * In equality comparisons, NaN does not equal any value, including itself. To test whether a value is equivalent to NaN, use the isNaN function. - */ - NaN: number; - - /** - * A value that is less than the largest negative number that can be represented in JavaScript. - * JavaScript displays NEGATIVE_INFINITY values as -infinity. - */ - NEGATIVE_INFINITY: number; - - /** - * A value greater than the largest number that can be represented in JavaScript. - * JavaScript displays POSITIVE_INFINITY values as infinity. - */ - POSITIVE_INFINITY: number; -} - -interface Math { - /** The mathematical constant e. This is Euler's number, the base of natural logarithms. */ - E: number; - /** The natural logarithm of 10. */ - LN10: number; - /** The natural logarithm of 2. */ - LN2: number; - /** The base-2 logarithm of e. */ - LOG2E: number; - /** The base-10 logarithm of e. */ - LOG10E: number; - /** Pi. This is the ratio of the circumference of a circle to its diameter. */ - PI: number; - /** The square root of 0.5, or, equivalently, one divided by the square root of 2. */ - SQRT1_2: number; - /** The square root of 2. */ - SQRT2: number; - /** - * Returns the absolute value of a number (the value without regard to whether it is positive or negative). - * For example, the absolute value of -5 is the same as the absolute value of 5. - * @param x A numeric expression for which the absolute value is needed. - */ - abs(x: number): number; - /** - * Returns the arc cosine (or inverse cosine) of a number. - * @param x A numeric expression. - */ - acos(x: number): number; - /** - * Returns the arcsine of a number. - * @param x A numeric expression. - */ - asin(x: number): number; - /** - * Returns the arctangent of a number. - * @param x A numeric expression for which the arctangent is needed. - */ - atan(x: number): number; - /** - * Returns the angle (in radians) from the X axis to a point (y,x). - * @param y A numeric expression representing the cartesian y-coordinate. - * @param x A numeric expression representing the cartesian x-coordinate. - */ - atan2(y: number, x: number): number; - /** - * Returns the smallest number greater than or equal to its numeric argument. - * @param x A numeric expression. - */ - ceil(x: number): number; - /** - * Returns the cosine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - cos(x: number): number; - /** - * Returns e (the base of natural logarithms) raised to a power. - * @param x A numeric expression representing the power of e. - */ - exp(x: number): number; - /** - * Returns the greatest number less than or equal to its numeric argument. - * @param x A numeric expression. - */ - floor(x: number): number; - /** - * Returns the natural logarithm (base e) of a number. - * @param x A numeric expression. - */ - log(x: number): number; - /** - * Returns the larger of a set of supplied numeric expressions. - * @param values Numeric expressions to be evaluated. - */ - max(...values: number[]): number; - /** - * Returns the smaller of a set of supplied numeric expressions. - * @param values Numeric expressions to be evaluated. - */ - min(...values: number[]): number; - /** - * Returns the value of a base expression taken to a specified power. - * @param x The base value of the expression. - * @param y The exponent value of the expression. - */ - pow(x: number, y: number): number; - /** Returns a pseudorandom number between 0 and 1. */ - random(): number; - /** - * Returns a supplied numeric expression rounded to the nearest number. - * @param x The value to be rounded to the nearest number. - */ - round(x: number): number; - /** - * Returns the sine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - sin(x: number): number; - /** - * Returns the square root of a number. - * @param x A numeric expression. - */ - sqrt(x: number): number; - /** - * Returns the tangent of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - tan(x: number): number; -} -/** An intrinsic object that provides basic mathematics functionality and constants. */ -declare var Math: Math; - -/** Enables basic storage and retrieval of dates and times. */ -interface Date { - /** Returns a string representation of a date. The format of the string depends on the locale. */ - toString(): string; - /** Returns a date as a string value. */ - toDateString(): string; - /** Returns a time as a string value. */ - toTimeString(): string; - /** Returns a value as a string value appropriate to the host environment's current locale. */ - toLocaleString(): string; - /** Returns a date as a string value appropriate to the host environment's current locale. */ - toLocaleDateString(): string; - /** Returns a time as a string value appropriate to the host environment's current locale. */ - toLocaleTimeString(): string; - /** Returns the stored time value in milliseconds since midnight, January 1, 1970 UTC. */ - valueOf(): number; - /** Gets the time value in milliseconds. */ - getTime(): number; - /** Gets the year, using local time. */ - getFullYear(): number; - /** Gets the year using Universal Coordinated Time (UTC). */ - getUTCFullYear(): number; - /** Gets the month, using local time. */ - getMonth(): number; - /** Gets the month of a Date object using Universal Coordinated Time (UTC). */ - getUTCMonth(): number; - /** Gets the day-of-the-month, using local time. */ - getDate(): number; - /** Gets the day-of-the-month, using Universal Coordinated Time (UTC). */ - getUTCDate(): number; - /** Gets the day of the week, using local time. */ - getDay(): number; - /** Gets the day of the week using Universal Coordinated Time (UTC). */ - getUTCDay(): number; - /** Gets the hours in a date, using local time. */ - getHours(): number; - /** Gets the hours value in a Date object using Universal Coordinated Time (UTC). */ - getUTCHours(): number; - /** Gets the minutes of a Date object, using local time. */ - getMinutes(): number; - /** Gets the minutes of a Date object using Universal Coordinated Time (UTC). */ - getUTCMinutes(): number; - /** Gets the seconds of a Date object, using local time. */ - getSeconds(): number; - /** Gets the seconds of a Date object using Universal Coordinated Time (UTC). */ - getUTCSeconds(): number; - /** Gets the milliseconds of a Date, using local time. */ - getMilliseconds(): number; - /** Gets the milliseconds of a Date object using Universal Coordinated Time (UTC). */ - getUTCMilliseconds(): number; - /** Gets the difference in minutes between the time on the local computer and Universal Coordinated Time (UTC). */ - getTimezoneOffset(): number; - /** - * Sets the date and time value in the Date object. - * @param time A numeric value representing the number of elapsed milliseconds since midnight, January 1, 1970 GMT. - */ - setTime(time: number): number; - /** - * Sets the milliseconds value in the Date object using local time. - * @param ms A numeric value equal to the millisecond value. - */ - setMilliseconds(ms: number): number; - /** - * Sets the milliseconds value in the Date object using Universal Coordinated Time (UTC). - * @param ms A numeric value equal to the millisecond value. - */ - setUTCMilliseconds(ms: number): number; - - /** - * Sets the seconds value in the Date object using local time. - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setSeconds(sec: number, ms?: number): number; - /** - * Sets the seconds value in the Date object using Universal Coordinated Time (UTC). - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setUTCSeconds(sec: number, ms?: number): number; - /** - * Sets the minutes value in the Date object using local time. - * @param min A numeric value equal to the minutes value. - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setMinutes(min: number, sec?: number, ms?: number): number; - /** - * Sets the minutes value in the Date object using Universal Coordinated Time (UTC). - * @param min A numeric value equal to the minutes value. - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setUTCMinutes(min: number, sec?: number, ms?: number): number; - /** - * Sets the hour value in the Date object using local time. - * @param hours A numeric value equal to the hours value. - * @param min A numeric value equal to the minutes value. - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setHours(hours: number, min?: number, sec?: number, ms?: number): number; - /** - * Sets the hours value in the Date object using Universal Coordinated Time (UTC). - * @param hours A numeric value equal to the hours value. - * @param min A numeric value equal to the minutes value. - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setUTCHours(hours: number, min?: number, sec?: number, ms?: number): number; - /** - * Sets the numeric day-of-the-month value of the Date object using local time. - * @param date A numeric value equal to the day of the month. - */ - setDate(date: number): number; - /** - * Sets the numeric day of the month in the Date object using Universal Coordinated Time (UTC). - * @param date A numeric value equal to the day of the month. - */ - setUTCDate(date: number): number; - /** - * Sets the month value in the Date object using local time. - * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. - * @param date A numeric value representing the day of the month. If this value is not supplied, the value from a call to the getDate method is used. - */ - setMonth(month: number, date?: number): number; - /** - * Sets the month value in the Date object using Universal Coordinated Time (UTC). - * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. - * @param date A numeric value representing the day of the month. If it is not supplied, the value from a call to the getUTCDate method is used. - */ - setUTCMonth(month: number, date?: number): number; - /** - * Sets the year of the Date object using local time. - * @param year A numeric value for the year. - * @param month A zero-based numeric value for the month (0 for January, 11 for December). Must be specified if numDate is specified. - * @param date A numeric value equal for the day of the month. - */ - setFullYear(year: number, month?: number, date?: number): number; - /** - * Sets the year value in the Date object using Universal Coordinated Time (UTC). - * @param year A numeric value equal to the year. - * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. Must be supplied if numDate is supplied. - * @param date A numeric value equal to the day of the month. - */ - setUTCFullYear(year: number, month?: number, date?: number): number; - /** Returns a date converted to a string using Universal Coordinated Time (UTC). */ - toUTCString(): string; - /** Returns a date as a string value in ISO format. */ - toISOString(): string; - /** Used by the JSON.stringify method to enable the transformation of an object's data for JavaScript Object Notation (JSON) serialization. */ - toJSON(key?: any): string; -} - -declare var Date: { - new (): Date; - new (value: number): Date; - new (value: string): Date; - new (year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Date; - (): string; - prototype: Date; - /** - * Parses a string containing a date, and returns the number of milliseconds between that date and midnight, January 1, 1970. - * @param s A date string - */ - parse(s: string): number; - /** - * Returns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the specified date. - * @param year The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year. - * @param month The month as an number between 0 and 11 (January to December). - * @param date The date as an number between 1 and 31. - * @param hours Must be supplied if minutes is supplied. An number from 0 to 23 (midnight to 11pm) that specifies the hour. - * @param minutes Must be supplied if seconds is supplied. An number from 0 to 59 that specifies the minutes. - * @param seconds Must be supplied if milliseconds is supplied. An number from 0 to 59 that specifies the seconds. - * @param ms An number from 0 to 999 that specifies the milliseconds. - */ - UTC(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): number; - now(): number; -} - -interface RegExpMatchArray extends Array { - index?: number; - input?: string; -} - -interface RegExpExecArray extends Array { - index: number; - input: string; -} - -interface RegExp { - /** - * Executes a search on a string using a regular expression pattern, and returns an array containing the results of that search. - * @param string The String object or string literal on which to perform the search. - */ - exec(string: string): RegExpExecArray; - - /** - * Returns a Boolean value that indicates whether or not a pattern exists in a searched string. - * @param string String on which to perform the search. - */ - test(string: string): boolean; - - /** Returns a copy of the text of the regular expression pattern. Read-only. The rgExp argument is a Regular expression object. It can be a variable name or a literal. */ - source: string; - - /** Returns a Boolean value indicating the state of the global flag (g) used with a regular expression. Default is false. Read-only. */ - global: boolean; - - /** Returns a Boolean value indicating the state of the ignoreCase flag (i) used with a regular expression. Default is false. Read-only. */ - ignoreCase: boolean; - - /** Returns a Boolean value indicating the state of the multiline flag (m) used with a regular expression. Default is false. Read-only. */ - multiline: boolean; - - lastIndex: number; - - // Non-standard extensions - compile(): RegExp; -} -declare var RegExp: { - new (pattern: string, flags?: string): RegExp; - (pattern: string, flags?: string): RegExp; - - // Non-standard extensions - $1: string; - $2: string; - $3: string; - $4: string; - $5: string; - $6: string; - $7: string; - $8: string; - $9: string; - lastMatch: string; -} - -interface Error { - name: string; - message: string; -} -declare var Error: { - new (message?: string): Error; - (message?: string): Error; - prototype: Error; -} - -interface EvalError extends Error { -} -declare var EvalError: { - new (message?: string): EvalError; - (message?: string): EvalError; - prototype: EvalError; -} - -interface RangeError extends Error { -} -declare var RangeError: { - new (message?: string): RangeError; - (message?: string): RangeError; - prototype: RangeError; -} - -interface ReferenceError extends Error { -} -declare var ReferenceError: { - new (message?: string): ReferenceError; - (message?: string): ReferenceError; - prototype: ReferenceError; -} - -interface SyntaxError extends Error { -} -declare var SyntaxError: { - new (message?: string): SyntaxError; - (message?: string): SyntaxError; - prototype: SyntaxError; -} - -interface TypeError extends Error { -} -declare var TypeError: { - new (message?: string): TypeError; - (message?: string): TypeError; - prototype: TypeError; -} - -interface URIError extends Error { -} -declare var URIError: { - new (message?: string): URIError; - (message?: string): URIError; - prototype: URIError; -} - -interface JSON { - /** - * Converts a JavaScript Object Notation (JSON) string into an object. - * @param text A valid JSON string. - * @param reviver A function that transforms the results. This function is called for each member of the object. - * If a member contains nested objects, the nested objects are transformed before the parent object is. - */ - parse(text: string, reviver?: (key: any, value: any) => any): any; - /** - * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. - * @param value A JavaScript value, usually an object or array, to be converted. - */ - stringify(value: any): string; - /** - * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. - * @param value A JavaScript value, usually an object or array, to be converted. - * @param replacer A function that transforms the results. - */ - stringify(value: any, replacer: (key: string, value: any) => any): string; - /** - * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. - * @param value A JavaScript value, usually an object or array, to be converted. - * @param replacer Array that transforms the results. - */ - stringify(value: any, replacer: any[]): string; - /** - * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. - * @param value A JavaScript value, usually an object or array, to be converted. - * @param replacer A function that transforms the results. - * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. - */ - stringify(value: any, replacer: (key: string, value: any) => any, space: any): string; - /** - * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. - * @param value A JavaScript value, usually an object or array, to be converted. - * @param replacer Array that transforms the results. - * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. - */ - stringify(value: any, replacer: any[], space: any): string; -} -/** - * An intrinsic object that provides functions to convert JavaScript values to and from the JavaScript Object Notation (JSON) format. - */ -declare var JSON: JSON; - - -///////////////////////////// -/// ECMAScript Array API (specially handled by compiler) -///////////////////////////// - -interface Array { - /** - * Gets or sets the length of the array. This is a number one higher than the highest element defined in an array. - */ - length: number; - /** - * Returns a string representation of an array. - */ - toString(): string; - toLocaleString(): string; - /** - * Appends new elements to an array, and returns the new length of the array. - * @param items New elements of the Array. - */ - push(...items: T[]): number; - /** - * Removes the last element from an array and returns it. - */ - pop(): T; - /** - * Combines two or more arrays. - * @param items Additional items to add to the end of array1. - */ - concat(...items: U[]): T[]; - /** - * Combines two or more arrays. - * @param items Additional items to add to the end of array1. - */ - concat(...items: T[]): T[]; - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - /** - * Reverses the elements in an Array. - */ - reverse(): T[]; - /** - * Removes the first element from an array and returns it. - */ - shift(): T; - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): T[]; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: T, b: T) => number): T[]; - - /** - * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. - * @param start The zero-based location in the array from which to start removing elements. - */ - splice(start: number): T[]; - - /** - * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. - * @param start The zero-based location in the array from which to start removing elements. - * @param deleteCount The number of elements to remove. - * @param items Elements to insert into the array in place of the deleted elements. - */ - splice(start: number, deleteCount: number, ...items: T[]): T[]; - - /** - * Inserts new elements at the start of an array. - * @param items Elements to insert at the start of the Array. - */ - unshift(...items: T[]): number; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0. - */ - indexOf(searchElement: T, fromIndex?: number): number; - - /** - * Returns the index of the last occurrence of a specified value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array. - */ - lastIndexOf(searchElement: T, fromIndex?: number): number; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void; - - /** - * Calls a defined callback function on each element of an array, and returns an array that contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[]; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): T[]; - - /** - * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; - /** - * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; - /** - * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; - - [n: number]: T; -} -declare var Array: { - new (arrayLength?: number): any[]; - new (arrayLength: number): T[]; - new (...items: T[]): T[]; - (arrayLength?: number): any[]; - (arrayLength: number): T[]; - (...items: T[]): T[]; - isArray(arg: any): boolean; - prototype: Array; -} diff --git a/pages/third_party/typescript/bin/lib.d.ts b/pages/third_party/typescript/bin/lib.d.ts deleted file mode 100644 index 8fb56ba312..0000000000 --- a/pages/third_party/typescript/bin/lib.d.ts +++ /dev/null @@ -1,14169 +0,0 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - -/// - -///////////////////////////// -/// ECMAScript APIs -///////////////////////////// - -declare var NaN: number; -declare var Infinity: number; - -/** - * Evaluates JavaScript code and executes it. - * @param x A String value that contains valid JavaScript code. - */ -declare function eval(x: string): any; - -/** - * Converts A string to an integer. - * @param s A string to convert into a number. - * @param radix A value between 2 and 36 that specifies the base of the number in numString. - * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal. - * All other strings are considered decimal. - */ -declare function parseInt(s: string, radix?: number): number; - -/** - * Converts a string to a floating-point number. - * @param string A string that contains a floating-point number. - */ -declare function parseFloat(string: string): number; - -/** - * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a number). - * @param number A numeric value. - */ -declare function isNaN(number: number): boolean; - -/** - * Determines whether a supplied number is finite. - * @param number Any numeric value. - */ -declare function isFinite(number: number): boolean; - -/** - * Gets the unencoded version of an encoded Uniform Resource Identifier (URI). - * @param encodedURI A value representing an encoded URI. - */ -declare function decodeURI(encodedURI: string): string; - -/** - * Gets the unencoded version of an encoded component of a Uniform Resource Identifier (URI). - * @param encodedURIComponent A value representing an encoded URI component. - */ -declare function decodeURIComponent(encodedURIComponent: string): string; - -/** - * Encodes a text string as a valid Uniform Resource Identifier (URI) - * @param uri A value representing an encoded URI. - */ -declare function encodeURI(uri: string): string; - -/** - * Encodes a text string as a valid component of a Uniform Resource Identifier (URI). - * @param uriComponent A value representing an encoded URI component. - */ -declare function encodeURIComponent(uriComponent: string): string; - -interface PropertyDescriptor { - configurable?: boolean; - enumerable?: boolean; - value?: any; - writable?: boolean; - get? (): any; - set? (v: any): void; -} - -interface PropertyDescriptorMap { - [s: string]: PropertyDescriptor; -} - -interface Object { - /** The initial value of Object.prototype.constructor is the standard built-in Object constructor. */ - constructor: Function; - - /** Returns a string representation of an object. */ - toString(): string; - - /** Returns a date converted to a string using the current locale. */ - toLocaleString(): string; - - /** Returns the primitive value of the specified object. */ - valueOf(): Object; - - /** - * Determines whether an object has a property with the specified name. - * @param v A property name. - */ - hasOwnProperty(v: string): boolean; - - /** - * Determines whether an object exists in another object's prototype chain. - * @param v Another object whose prototype chain is to be checked. - */ - isPrototypeOf(v: Object): boolean; - - /** - * Determines whether a specified property is enumerable. - * @param v A property name. - */ - propertyIsEnumerable(v: string): boolean; -} - -/** - * Provides functionality common to all JavaScript objects. - */ -declare var Object: { - new (value?: any): Object; - (): any; - (value: any): any; - - /** A reference to the prototype for a class of objects. */ - prototype: Object; - - /** - * Returns the prototype of an object. - * @param o The object that references the prototype. - */ - getPrototypeOf(o: any): any; - - /** - * Gets the own property descriptor of the specified object. - * An own property descriptor is one that is defined directly on the object and is not inherited from the object's prototype. - * @param o Object that contains the property. - * @param p Name of the property. - */ - getOwnPropertyDescriptor(o: any, p: string): PropertyDescriptor; - - /** - * Returns the names of the own properties of an object. The own properties of an object are those that are defined directly - * on that object, and are not inherited from the object's prototype. The properties of an object include both fields (objects) and functions. - * @param o Object that contains the own properties. - */ - getOwnPropertyNames(o: any): string[]; - - /** - * Creates an object that has the specified prototype, and that optionally contains specified properties. - * @param o Object to use as a prototype. May be null - * @param properties JavaScript object that contains one or more property descriptors. - */ - create(o: any, properties?: PropertyDescriptorMap): any; - - /** - * Adds a property to an object, or modifies attributes of an existing property. - * @param o Object on which to add or modify the property. This can be a native JavaScript object (that is, a user-defined object or a built in object) or a DOM object. - * @param p The property name. - * @param attributes Descriptor for the property. It can be for a data property or an accessor property. - */ - defineProperty(o: any, p: string, attributes: PropertyDescriptor): any; - - /** - * Adds one or more properties to an object, and/or modifies attributes of existing properties. - * @param o Object on which to add or modify the properties. This can be a native JavaScript object or a DOM object. - * @param properties JavaScript object that contains one or more descriptor objects. Each descriptor object describes a data property or an accessor property. - */ - defineProperties(o: any, properties: PropertyDescriptorMap): any; - - /** - * Prevents the modification of attributes of existing properties, and prevents the addition of new properties. - * @param o Object on which to lock the attributes. - */ - seal(o: any): any; - - /** - * Prevents the modification of existing property attributes and values, and prevents the addition of new properties. - * @param o Object on which to lock the attributes. - */ - freeze(o: any): any; - - /** - * Prevents the addition of new properties to an object. - * @param o Object to make non-extensible. - */ - preventExtensions(o: any): any; - - /** - * Returns true if existing property attributes cannot be modified in an object and new properties cannot be added to the object. - * @param o Object to test. - */ - isSealed(o: any): boolean; - - /** - * Returns true if existing property attributes and values cannot be modified in an object, and new properties cannot be added to the object. - * @param o Object to test. - */ - isFrozen(o: any): boolean; - - /** - * Returns a value that indicates whether new properties can be added to an object. - * @param o Object to test. - */ - isExtensible(o: any): boolean; - - /** - * Returns the names of the enumerable properties and methods of an object. - * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. - */ - keys(o: any): string[]; -} - -/** - * Creates a new function. - */ -interface Function { - /** - * Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function. - * @param thisArg The object to be used as the this object. - * @param argArray A set of arguments to be passed to the function. - */ - apply(thisArg: any, argArray?: any): any; - - /** - * Calls a method of an object, substituting another object for the current object. - * @param thisArg The object to be used as the current object. - * @param argArray A list of arguments to be passed to the method. - */ - call(thisArg: any, ...argArray: any[]): any; - - /** - * For a given function, creates a bound function that has the same body as the original function. - * The this object of the bound function is associated with the specified object, and has the specified initial parameters. - * @param thisArg An object to which the this keyword can refer inside the new function. - * @param argArray A list of arguments to be passed to the new function. - */ - bind(thisArg: any, ...argArray: any[]): any; - - prototype: any; - length: number; - - // Non-standard extensions - arguments: any; - caller: Function; -} - -declare var Function: { - /** - * Creates a new function. - * @param args A list of arguments the function accepts. - */ - new (...args: string[]): Function; - (...args: string[]): Function; - prototype: Function; -} - -interface IArguments { - [index: number]: any; - length: number; - callee: Function; -} - -interface String { - /** Returns a string representation of a string. */ - toString(): string; - - /** - * Returns the character at the specified index. - * @param pos The zero-based index of the desired character. - */ - charAt(pos: number): string; - - /** - * Returns the Unicode value of the character at the specified location. - * @param index The zero-based index of the desired character. If there is no character at the specified index, NaN is returned. - */ - charCodeAt(index: number): number; - - /** - * Returns a string that contains the concatenation of two or more strings. - * @param strings The strings to append to the end of the string. - */ - concat(...strings: string[]): string; - - /** - * Returns the position of the first occurrence of a substring. - * @param searchString The substring to search for in the string - * @param position The index at which to begin searching the String object. If omitted, search starts at the beginning of the string. - */ - indexOf(searchString: string, position?: number): number; - - /** - * Returns the last occurrence of a substring in the string. - * @param searchString The substring to search for. - * @param position The index at which to begin searching. If omitted, the search begins at the end of the string. - */ - lastIndexOf(searchString: string, position?: number): number; - - /** - * Determines whether two strings are equivalent in the current locale. - * @param that String to compare to target string - */ - localeCompare(that: string): number; - - /** - * Matches a string with a regular expression, and returns an array containing the results of that search. - * @param regexp A variable name or string literal containing the regular expression pattern and flags. - */ - match(regexp: string): RegExpMatchArray; - - /** - * Matches a string with a regular expression, and returns an array containing the results of that search. - * @param regexp A regular expression object that contains the regular expression pattern and applicable flags. - */ - match(regexp: RegExp): RegExpMatchArray; - - /** - * Replaces text in a string, using a regular expression or search string. - * @param searchValue A String object or string literal that represents the regular expression - * @param replaceValue A String object or string literal containing the text to replace for every successful match of rgExp in stringObj. - */ - replace(searchValue: string, replaceValue: string): string; - - /** - * Replaces text in a string, using a regular expression or search string. - * @param searchValue A String object or string literal that represents the regular expression - * @param replaceValue A function that returns the replacement text. - */ - replace(searchValue: string, replaceValue: (substring: string, ...args: any[]) => string): string; - - /** - * Replaces text in a string, using a regular expression or search string. - * @param searchValue A Regular Expression object containing the regular expression pattern and applicable flags - * @param replaceValue A String object or string literal containing the text to replace for every successful match of rgExp in stringObj. - */ - replace(searchValue: RegExp, replaceValue: string): string; - - /** - * Replaces text in a string, using a regular expression or search string. - * @param searchValue A Regular Expression object containing the regular expression pattern and applicable flags - * @param replaceValue A function that returns the replacement text. - */ - replace(searchValue: RegExp, replaceValue: (substring: string, ...args: any[]) => string): string; - - /** - * Finds the first substring match in a regular expression search. - * @param regexp The regular expression pattern and applicable flags. - */ - search(regexp: string): number; - - /** - * Finds the first substring match in a regular expression search. - * @param regexp The regular expression pattern and applicable flags. - */ - search(regexp: RegExp): number; - - /** - * Returns a section of a string. - * @param start The index to the beginning of the specified portion of stringObj. - * @param end The index to the end of the specified portion of stringObj. The substring includes the characters up to, but not including, the character indicated by end. - * If this value is not specified, the substring continues to the end of stringObj. - */ - slice(start?: number, end?: number): string; - - /** - * Split a string into substrings using the specified separator and return them as an array. - * @param separator A string that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned. - * @param limit A value used to limit the number of elements returned in the array. - */ - split(separator: string, limit?: number): string[]; - - /** - * Split a string into substrings using the specified separator and return them as an array. - * @param separator A Regular Express that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned. - * @param limit A value used to limit the number of elements returned in the array. - */ - split(separator: RegExp, limit?: number): string[]; - - /** - * Returns the substring at the specified location within a String object. - * @param start The zero-based index number indicating the beginning of the substring. - * @param end Zero-based index number indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end. - * If end is omitted, the characters from start through the end of the original string are returned. - */ - substring(start: number, end?: number): string; - - /** Converts all the alphabetic characters in a string to lowercase. */ - toLowerCase(): string; - - /** Converts all alphabetic characters to lowercase, taking into account the host environment's current locale. */ - toLocaleLowerCase(): string; - - /** Converts all the alphabetic characters in a string to uppercase. */ - toUpperCase(): string; - - /** Returns a string where all alphabetic characters have been converted to uppercase, taking into account the host environment's current locale. */ - toLocaleUpperCase(): string; - - /** Removes the leading and trailing white space and line terminator characters from a string. */ - trim(): string; - - /** Returns the length of a String object. */ - length: number; - - // IE extensions - /** - * Gets a substring beginning at the specified location and having the specified length. - * @param from The starting position of the desired substring. The index of the first character in the string is zero. - * @param length The number of characters to include in the returned substring. - */ - substr(from: number, length?: number): string; - - [index: number]: string; -} - -/** - * Allows manipulation and formatting of text strings and determination and location of substrings within strings. - */ -declare var String: { - new (value?: any): String; - (value?: any): string; - prototype: String; - fromCharCode(...codes: number[]): string; -} - -interface Boolean { -} -declare var Boolean: { - new (value?: any): Boolean; - (value?: any): boolean; - prototype: Boolean; -} - -interface Number { - /** - * Returns a string representation of an object. - * @param radix Specifies a radix for converting numeric values to strings. This value is only used for numbers. - */ - toString(radix?: number): string; - - /** - * Returns a string representing a number in fixed-point notation. - * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive. - */ - toFixed(fractionDigits?: number): string; - - /** - * Returns a string containing a number represented in exponential notation. - * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive. - */ - toExponential(fractionDigits?: number): string; - - /** - * Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits. - * @param precision Number of significant digits. Must be in the range 1 - 21, inclusive. - */ - toPrecision(precision?: number): string; -} - -/** An object that represents a number of any kind. All JavaScript numbers are 64-bit floating-point numbers. */ -declare var Number: { - new (value?: any): Number; - (value?: any): number; - prototype: Number; - - /** The largest number that can be represented in JavaScript. Equal to approximately 1.79E+308. */ - MAX_VALUE: number; - - /** The closest number to zero that can be represented in JavaScript. Equal to approximately 5.00E-324. */ - MIN_VALUE: number; - - /** - * A value that is not a number. - * In equality comparisons, NaN does not equal any value, including itself. To test whether a value is equivalent to NaN, use the isNaN function. - */ - NaN: number; - - /** - * A value that is less than the largest negative number that can be represented in JavaScript. - * JavaScript displays NEGATIVE_INFINITY values as -infinity. - */ - NEGATIVE_INFINITY: number; - - /** - * A value greater than the largest number that can be represented in JavaScript. - * JavaScript displays POSITIVE_INFINITY values as infinity. - */ - POSITIVE_INFINITY: number; -} - -interface Math { - /** The mathematical constant e. This is Euler's number, the base of natural logarithms. */ - E: number; - /** The natural logarithm of 10. */ - LN10: number; - /** The natural logarithm of 2. */ - LN2: number; - /** The base-2 logarithm of e. */ - LOG2E: number; - /** The base-10 logarithm of e. */ - LOG10E: number; - /** Pi. This is the ratio of the circumference of a circle to its diameter. */ - PI: number; - /** The square root of 0.5, or, equivalently, one divided by the square root of 2. */ - SQRT1_2: number; - /** The square root of 2. */ - SQRT2: number; - /** - * Returns the absolute value of a number (the value without regard to whether it is positive or negative). - * For example, the absolute value of -5 is the same as the absolute value of 5. - * @param x A numeric expression for which the absolute value is needed. - */ - abs(x: number): number; - /** - * Returns the arc cosine (or inverse cosine) of a number. - * @param x A numeric expression. - */ - acos(x: number): number; - /** - * Returns the arcsine of a number. - * @param x A numeric expression. - */ - asin(x: number): number; - /** - * Returns the arctangent of a number. - * @param x A numeric expression for which the arctangent is needed. - */ - atan(x: number): number; - /** - * Returns the angle (in radians) from the X axis to a point (y,x). - * @param y A numeric expression representing the cartesian y-coordinate. - * @param x A numeric expression representing the cartesian x-coordinate. - */ - atan2(y: number, x: number): number; - /** - * Returns the smallest number greater than or equal to its numeric argument. - * @param x A numeric expression. - */ - ceil(x: number): number; - /** - * Returns the cosine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - cos(x: number): number; - /** - * Returns e (the base of natural logarithms) raised to a power. - * @param x A numeric expression representing the power of e. - */ - exp(x: number): number; - /** - * Returns the greatest number less than or equal to its numeric argument. - * @param x A numeric expression. - */ - floor(x: number): number; - /** - * Returns the natural logarithm (base e) of a number. - * @param x A numeric expression. - */ - log(x: number): number; - /** - * Returns the larger of a set of supplied numeric expressions. - * @param values Numeric expressions to be evaluated. - */ - max(...values: number[]): number; - /** - * Returns the smaller of a set of supplied numeric expressions. - * @param values Numeric expressions to be evaluated. - */ - min(...values: number[]): number; - /** - * Returns the value of a base expression taken to a specified power. - * @param x The base value of the expression. - * @param y The exponent value of the expression. - */ - pow(x: number, y: number): number; - /** Returns a pseudorandom number between 0 and 1. */ - random(): number; - /** - * Returns a supplied numeric expression rounded to the nearest number. - * @param x The value to be rounded to the nearest number. - */ - round(x: number): number; - /** - * Returns the sine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - sin(x: number): number; - /** - * Returns the square root of a number. - * @param x A numeric expression. - */ - sqrt(x: number): number; - /** - * Returns the tangent of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - tan(x: number): number; -} -/** An intrinsic object that provides basic mathematics functionality and constants. */ -declare var Math: Math; - -/** Enables basic storage and retrieval of dates and times. */ -interface Date { - /** Returns a string representation of a date. The format of the string depends on the locale. */ - toString(): string; - /** Returns a date as a string value. */ - toDateString(): string; - /** Returns a time as a string value. */ - toTimeString(): string; - /** Returns a value as a string value appropriate to the host environment's current locale. */ - toLocaleString(): string; - /** Returns a date as a string value appropriate to the host environment's current locale. */ - toLocaleDateString(): string; - /** Returns a time as a string value appropriate to the host environment's current locale. */ - toLocaleTimeString(): string; - /** Returns the stored time value in milliseconds since midnight, January 1, 1970 UTC. */ - valueOf(): number; - /** Gets the time value in milliseconds. */ - getTime(): number; - /** Gets the year, using local time. */ - getFullYear(): number; - /** Gets the year using Universal Coordinated Time (UTC). */ - getUTCFullYear(): number; - /** Gets the month, using local time. */ - getMonth(): number; - /** Gets the month of a Date object using Universal Coordinated Time (UTC). */ - getUTCMonth(): number; - /** Gets the day-of-the-month, using local time. */ - getDate(): number; - /** Gets the day-of-the-month, using Universal Coordinated Time (UTC). */ - getUTCDate(): number; - /** Gets the day of the week, using local time. */ - getDay(): number; - /** Gets the day of the week using Universal Coordinated Time (UTC). */ - getUTCDay(): number; - /** Gets the hours in a date, using local time. */ - getHours(): number; - /** Gets the hours value in a Date object using Universal Coordinated Time (UTC). */ - getUTCHours(): number; - /** Gets the minutes of a Date object, using local time. */ - getMinutes(): number; - /** Gets the minutes of a Date object using Universal Coordinated Time (UTC). */ - getUTCMinutes(): number; - /** Gets the seconds of a Date object, using local time. */ - getSeconds(): number; - /** Gets the seconds of a Date object using Universal Coordinated Time (UTC). */ - getUTCSeconds(): number; - /** Gets the milliseconds of a Date, using local time. */ - getMilliseconds(): number; - /** Gets the milliseconds of a Date object using Universal Coordinated Time (UTC). */ - getUTCMilliseconds(): number; - /** Gets the difference in minutes between the time on the local computer and Universal Coordinated Time (UTC). */ - getTimezoneOffset(): number; - /** - * Sets the date and time value in the Date object. - * @param time A numeric value representing the number of elapsed milliseconds since midnight, January 1, 1970 GMT. - */ - setTime(time: number): number; - /** - * Sets the milliseconds value in the Date object using local time. - * @param ms A numeric value equal to the millisecond value. - */ - setMilliseconds(ms: number): number; - /** - * Sets the milliseconds value in the Date object using Universal Coordinated Time (UTC). - * @param ms A numeric value equal to the millisecond value. - */ - setUTCMilliseconds(ms: number): number; - - /** - * Sets the seconds value in the Date object using local time. - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setSeconds(sec: number, ms?: number): number; - /** - * Sets the seconds value in the Date object using Universal Coordinated Time (UTC). - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setUTCSeconds(sec: number, ms?: number): number; - /** - * Sets the minutes value in the Date object using local time. - * @param min A numeric value equal to the minutes value. - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setMinutes(min: number, sec?: number, ms?: number): number; - /** - * Sets the minutes value in the Date object using Universal Coordinated Time (UTC). - * @param min A numeric value equal to the minutes value. - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setUTCMinutes(min: number, sec?: number, ms?: number): number; - /** - * Sets the hour value in the Date object using local time. - * @param hours A numeric value equal to the hours value. - * @param min A numeric value equal to the minutes value. - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setHours(hours: number, min?: number, sec?: number, ms?: number): number; - /** - * Sets the hours value in the Date object using Universal Coordinated Time (UTC). - * @param hours A numeric value equal to the hours value. - * @param min A numeric value equal to the minutes value. - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setUTCHours(hours: number, min?: number, sec?: number, ms?: number): number; - /** - * Sets the numeric day-of-the-month value of the Date object using local time. - * @param date A numeric value equal to the day of the month. - */ - setDate(date: number): number; - /** - * Sets the numeric day of the month in the Date object using Universal Coordinated Time (UTC). - * @param date A numeric value equal to the day of the month. - */ - setUTCDate(date: number): number; - /** - * Sets the month value in the Date object using local time. - * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. - * @param date A numeric value representing the day of the month. If this value is not supplied, the value from a call to the getDate method is used. - */ - setMonth(month: number, date?: number): number; - /** - * Sets the month value in the Date object using Universal Coordinated Time (UTC). - * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. - * @param date A numeric value representing the day of the month. If it is not supplied, the value from a call to the getUTCDate method is used. - */ - setUTCMonth(month: number, date?: number): number; - /** - * Sets the year of the Date object using local time. - * @param year A numeric value for the year. - * @param month A zero-based numeric value for the month (0 for January, 11 for December). Must be specified if numDate is specified. - * @param date A numeric value equal for the day of the month. - */ - setFullYear(year: number, month?: number, date?: number): number; - /** - * Sets the year value in the Date object using Universal Coordinated Time (UTC). - * @param year A numeric value equal to the year. - * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. Must be supplied if numDate is supplied. - * @param date A numeric value equal to the day of the month. - */ - setUTCFullYear(year: number, month?: number, date?: number): number; - /** Returns a date converted to a string using Universal Coordinated Time (UTC). */ - toUTCString(): string; - /** Returns a date as a string value in ISO format. */ - toISOString(): string; - /** Used by the JSON.stringify method to enable the transformation of an object's data for JavaScript Object Notation (JSON) serialization. */ - toJSON(key?: any): string; -} - -declare var Date: { - new (): Date; - new (value: number): Date; - new (value: string): Date; - new (year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Date; - (): string; - prototype: Date; - /** - * Parses a string containing a date, and returns the number of milliseconds between that date and midnight, January 1, 1970. - * @param s A date string - */ - parse(s: string): number; - /** - * Returns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the specified date. - * @param year The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year. - * @param month The month as an number between 0 and 11 (January to December). - * @param date The date as an number between 1 and 31. - * @param hours Must be supplied if minutes is supplied. An number from 0 to 23 (midnight to 11pm) that specifies the hour. - * @param minutes Must be supplied if seconds is supplied. An number from 0 to 59 that specifies the minutes. - * @param seconds Must be supplied if milliseconds is supplied. An number from 0 to 59 that specifies the seconds. - * @param ms An number from 0 to 999 that specifies the milliseconds. - */ - UTC(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): number; - now(): number; -} - -interface RegExpMatchArray extends Array { - index?: number; - input?: string; -} - -interface RegExpExecArray extends Array { - index: number; - input: string; -} - -interface RegExp { - /** - * Executes a search on a string using a regular expression pattern, and returns an array containing the results of that search. - * @param string The String object or string literal on which to perform the search. - */ - exec(string: string): RegExpExecArray; - - /** - * Returns a Boolean value that indicates whether or not a pattern exists in a searched string. - * @param string String on which to perform the search. - */ - test(string: string): boolean; - - /** Returns a copy of the text of the regular expression pattern. Read-only. The rgExp argument is a Regular expression object. It can be a variable name or a literal. */ - source: string; - - /** Returns a Boolean value indicating the state of the global flag (g) used with a regular expression. Default is false. Read-only. */ - global: boolean; - - /** Returns a Boolean value indicating the state of the ignoreCase flag (i) used with a regular expression. Default is false. Read-only. */ - ignoreCase: boolean; - - /** Returns a Boolean value indicating the state of the multiline flag (m) used with a regular expression. Default is false. Read-only. */ - multiline: boolean; - - lastIndex: number; - - // Non-standard extensions - compile(): RegExp; -} -declare var RegExp: { - new (pattern: string, flags?: string): RegExp; - (pattern: string, flags?: string): RegExp; - - // Non-standard extensions - $1: string; - $2: string; - $3: string; - $4: string; - $5: string; - $6: string; - $7: string; - $8: string; - $9: string; - lastMatch: string; -} - -interface Error { - name: string; - message: string; -} -declare var Error: { - new (message?: string): Error; - (message?: string): Error; - prototype: Error; -} - -interface EvalError extends Error { -} -declare var EvalError: { - new (message?: string): EvalError; - (message?: string): EvalError; - prototype: EvalError; -} - -interface RangeError extends Error { -} -declare var RangeError: { - new (message?: string): RangeError; - (message?: string): RangeError; - prototype: RangeError; -} - -interface ReferenceError extends Error { -} -declare var ReferenceError: { - new (message?: string): ReferenceError; - (message?: string): ReferenceError; - prototype: ReferenceError; -} - -interface SyntaxError extends Error { -} -declare var SyntaxError: { - new (message?: string): SyntaxError; - (message?: string): SyntaxError; - prototype: SyntaxError; -} - -interface TypeError extends Error { -} -declare var TypeError: { - new (message?: string): TypeError; - (message?: string): TypeError; - prototype: TypeError; -} - -interface URIError extends Error { -} -declare var URIError: { - new (message?: string): URIError; - (message?: string): URIError; - prototype: URIError; -} - -interface JSON { - /** - * Converts a JavaScript Object Notation (JSON) string into an object. - * @param text A valid JSON string. - * @param reviver A function that transforms the results. This function is called for each member of the object. - * If a member contains nested objects, the nested objects are transformed before the parent object is. - */ - parse(text: string, reviver?: (key: any, value: any) => any): any; - /** - * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. - * @param value A JavaScript value, usually an object or array, to be converted. - */ - stringify(value: any): string; - /** - * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. - * @param value A JavaScript value, usually an object or array, to be converted. - * @param replacer A function that transforms the results. - */ - stringify(value: any, replacer: (key: string, value: any) => any): string; - /** - * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. - * @param value A JavaScript value, usually an object or array, to be converted. - * @param replacer Array that transforms the results. - */ - stringify(value: any, replacer: any[]): string; - /** - * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. - * @param value A JavaScript value, usually an object or array, to be converted. - * @param replacer A function that transforms the results. - * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. - */ - stringify(value: any, replacer: (key: string, value: any) => any, space: any): string; - /** - * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. - * @param value A JavaScript value, usually an object or array, to be converted. - * @param replacer Array that transforms the results. - * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. - */ - stringify(value: any, replacer: any[], space: any): string; -} -/** - * An intrinsic object that provides functions to convert JavaScript values to and from the JavaScript Object Notation (JSON) format. - */ -declare var JSON: JSON; - - -///////////////////////////// -/// ECMAScript Array API (specially handled by compiler) -///////////////////////////// - -interface Array { - /** - * Gets or sets the length of the array. This is a number one higher than the highest element defined in an array. - */ - length: number; - /** - * Returns a string representation of an array. - */ - toString(): string; - toLocaleString(): string; - /** - * Appends new elements to an array, and returns the new length of the array. - * @param items New elements of the Array. - */ - push(...items: T[]): number; - /** - * Removes the last element from an array and returns it. - */ - pop(): T; - /** - * Combines two or more arrays. - * @param items Additional items to add to the end of array1. - */ - concat(...items: U[]): T[]; - /** - * Combines two or more arrays. - * @param items Additional items to add to the end of array1. - */ - concat(...items: T[]): T[]; - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - /** - * Reverses the elements in an Array. - */ - reverse(): T[]; - /** - * Removes the first element from an array and returns it. - */ - shift(): T; - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): T[]; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: T, b: T) => number): T[]; - - /** - * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. - * @param start The zero-based location in the array from which to start removing elements. - */ - splice(start: number): T[]; - - /** - * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. - * @param start The zero-based location in the array from which to start removing elements. - * @param deleteCount The number of elements to remove. - * @param items Elements to insert into the array in place of the deleted elements. - */ - splice(start: number, deleteCount: number, ...items: T[]): T[]; - - /** - * Inserts new elements at the start of an array. - * @param items Elements to insert at the start of the Array. - */ - unshift(...items: T[]): number; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0. - */ - indexOf(searchElement: T, fromIndex?: number): number; - - /** - * Returns the index of the last occurrence of a specified value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array. - */ - lastIndexOf(searchElement: T, fromIndex?: number): number; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void; - - /** - * Calls a defined callback function on each element of an array, and returns an array that contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[]; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): T[]; - - /** - * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; - /** - * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; - /** - * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; - - [n: number]: T; -} -declare var Array: { - new (arrayLength?: number): any[]; - new (arrayLength: number): T[]; - new (...items: T[]): T[]; - (arrayLength?: number): any[]; - (arrayLength: number): T[]; - (...items: T[]): T[]; - isArray(arg: any): boolean; - prototype: Array; -} - -///////////////////////////// -/// IE10 ECMAScript Extensions -///////////////////////////// - -/** - * Represents a raw buffer of binary data, which is used to store data for the - * different typed arrays. ArrayBuffers cannot be read from or written to directly, - * but can be passed to a typed array or DataView Object to interpret the raw - * buffer as needed. - */ -interface ArrayBuffer { - /** - * Read-only. The length of the ArrayBuffer (in bytes). - */ - byteLength: number; - - /** - * Returns a section of an ArrayBuffer. - */ - slice(begin:number, end?:number): ArrayBuffer; -} - -declare var ArrayBuffer: { - prototype: ArrayBuffer; - new (byteLength: number): ArrayBuffer; -} - -interface ArrayBufferView { - buffer: ArrayBuffer; - byteOffset: number; - byteLength: number; -} - -/** - * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Int8Array extends ArrayBufferView { - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * The length of the array. - */ - length: number; - - [index: number]: number; - - /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. - */ - get(index: number): number; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: Int8Array, offset?: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: number[], offset?: number): void; - - /** - * Gets a new Int8Array view of the ArrayBuffer store for this array, referencing the elements at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Int8Array; -} -declare var Int8Array: { - prototype: Int8Array; - new (length: number): Int8Array; - new (array: Int8Array): Int8Array; - new (array: number[]): Int8Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int8Array; - BYTES_PER_ELEMENT: number; -} - -/** - * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Uint8Array extends ArrayBufferView { - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * The length of the array. - */ - length: number; - [index: number]: number; - - /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. - */ - get(index: number): number; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: Uint8Array, offset?: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: number[], offset?: number): void; - - /** - * Gets a new Uint8Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Uint8Array; -} -declare var Uint8Array: { - prototype: Uint8Array; - new (length: number): Uint8Array; - new (array: Uint8Array): Uint8Array; - new (array: number[]): Uint8Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint8Array; - BYTES_PER_ELEMENT: number; -} - -/** - * A typed array of 16-bit integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Int16Array extends ArrayBufferView { - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * The length of the array. - */ - length: number; - [index: number]: number; - - /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. - */ - get(index: number): number; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: Int16Array, offset?: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: number[], offset?: number): void; - - /** - * Gets a new Int16Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Int16Array; -} -declare var Int16Array: { - prototype: Int16Array; - new (length: number): Int16Array; - new (array: Int16Array): Int16Array; - new (array: number[]): Int16Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int16Array; - BYTES_PER_ELEMENT: number; -} - -/** - * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Uint16Array extends ArrayBufferView { - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * The length of the array. - */ - length: number; - [index: number]: number; - - /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. - */ - get(index: number): number; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: Uint16Array, offset?: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: number[], offset?: number): void; - - /** - * Gets a new Uint16Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Uint16Array; -} -declare var Uint16Array: { - prototype: Uint16Array; - new (length: number): Uint16Array; - new (array: Uint16Array): Uint16Array; - new (array: number[]): Uint16Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint16Array; - BYTES_PER_ELEMENT: number; -} - -/** - * A typed array of 32-bit integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Int32Array extends ArrayBufferView { - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * The length of the array. - */ - length: number; - [index: number]: number; - - /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. - */ - get(index: number): number; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: Int32Array, offset?: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: number[], offset?: number): void; - - /** - * Gets a new Int32Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Int32Array; -} -declare var Int32Array: { - prototype: Int32Array; - new (length: number): Int32Array; - new (array: Int32Array): Int32Array; - new (array: number[]): Int32Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int32Array; - BYTES_PER_ELEMENT: number; -} - -/** - * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Uint32Array extends ArrayBufferView { - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * The length of the array. - */ - length: number; - [index: number]: number; - - /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. - */ - get(index: number): number; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: Uint32Array, offset?: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: number[], offset?: number): void; - - /** - * Gets a new Int8Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Uint32Array; -} -declare var Uint32Array: { - prototype: Uint32Array; - new (length: number): Uint32Array; - new (array: Uint32Array): Uint32Array; - new (array: number[]): Uint32Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint32Array; - BYTES_PER_ELEMENT: number; -} - -/** - * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Float32Array extends ArrayBufferView { - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * The length of the array. - */ - length: number; - [index: number]: number; - - /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. - */ - get(index: number): number; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: Float32Array, offset?: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: number[], offset?: number): void; - - /** - * Gets a new Float32Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Float32Array; -} -declare var Float32Array: { - prototype: Float32Array; - new (length: number): Float32Array; - new (array: Float32Array): Float32Array; - new (array: number[]): Float32Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float32Array; - BYTES_PER_ELEMENT: number; -} - -/** - * A typed array of 64-bit float values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Float64Array extends ArrayBufferView { - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * The length of the array. - */ - length: number; - [index: number]: number; - - /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. - */ - get(index: number): number; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: Float64Array, offset?: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: number[], offset?: number): void; - - /** - * Gets a new Float64Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Float64Array; -} -declare var Float64Array: { - prototype: Float64Array; - new (length: number): Float64Array; - new (array: Float64Array): Float64Array; - new (array: number[]): Float64Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float64Array; - BYTES_PER_ELEMENT: number; -} - -/** - * You can use a DataView object to read and write the different kinds of binary data to any location in the ArrayBuffer. - */ -interface DataView extends ArrayBufferView { - /** - * Gets the Int8 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getInt8(byteOffset: number): number; - - /** - * Gets the Uint8 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getUint8(byteOffset: number): number; - - /** - * Gets the Int16 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getInt16(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Uint16 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getUint16(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Int32 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getInt32(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Uint32 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getUint32(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Float32 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getFloat32(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Float64 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getFloat64(byteOffset: number, littleEndian?: boolean): number; - - /** - * Stores an Int8 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - */ - setInt8(byteOffset: number, value: number): void; - - /** - * Stores an Uint8 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - */ - setUint8(byteOffset: number, value: number): void; - - /** - * Stores an Int16 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. - */ - setInt16(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Uint16 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. - */ - setUint16(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Int32 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. - */ - setInt32(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Uint32 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. - */ - setUint32(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Float32 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. - */ - setFloat32(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Float64 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. - */ - setFloat64(byteOffset: number, value: number, littleEndian?: boolean): void; -} -declare var DataView: { - prototype: DataView; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): DataView; -} - -///////////////////////////// -/// IE11 ECMAScript Extensions -///////////////////////////// - -interface Map { - clear(): void; - delete(key: K): boolean; - forEach(callbackfn: (value: V, index: K, map: Map) => void, thisArg?: any): void; - get(key: K): V; - has(key: K): boolean; - set(key: K, value: V): Map; - size: number; -} -declare var Map: { - new (): Map; -} - -interface WeakMap { - clear(): void; - delete(key: K): boolean; - get(key: K): V; - has(key: K): boolean; - set(key: K, value: V): WeakMap; -} -declare var WeakMap: { - new (): WeakMap; -} - -interface Set { - add(value: T): Set; - clear(): void; - delete(value: T): boolean; - forEach(callbackfn: (value: T, index: T, set: Set) => void, thisArg?: any): void; - has(value: T): boolean; - size: number; -} -declare var Set: { - new (): Set; -} - -declare module Intl { - - interface CollatorOptions { - usage?: string; - localeMatcher?: string; - numeric?: boolean; - caseFirst?: string; - sensitivity?: string; - ignorePunctuation?: boolean; - } - - interface ResolvedCollatorOptions { - locale: string; - usage: string; - sensitivity: string; - ignorePunctuation: boolean; - collation: string; - caseFirst: string; - numeric: boolean; - } - - interface Collator { - compare(x: string, y: string): number; - resolvedOptions(): ResolvedCollatorOptions; - } - var Collator: { - new (locales?: string[], options?: CollatorOptions): Collator; - new (locale?: string, options?: CollatorOptions): Collator; - (locales?: string[], options?: CollatorOptions): Collator; - (locale?: string, options?: CollatorOptions): Collator; - supportedLocalesOf(locales: string[], options?: CollatorOptions): string[]; - supportedLocalesOf(locale: string, options?: CollatorOptions): string[]; - } - - interface NumberFormatOptions { - localeMatcher?: string; - style?: string; - currency?: string; - currencyDisplay?: string; - useGrouping?: boolean; - } - - interface ResolvedNumberFormatOptions { - locale: string; - numberingSystem: string; - style: string; - currency?: string; - currencyDisplay?: string; - minimumintegerDigits: number; - minimumFractionDigits: number; - maximumFractionDigits: number; - minimumSignificantDigits?: number; - maximumSignificantDigits?: number; - useGrouping: boolean; - } - - interface NumberFormat { - format(value: number): string; - resolvedOptions(): ResolvedNumberFormatOptions; - } - var NumberFormat: { - new (locales?: string[], options?: NumberFormatOptions): Collator; - new (locale?: string, options?: NumberFormatOptions): Collator; - (locales?: string[], options?: NumberFormatOptions): Collator; - (locale?: string, options?: NumberFormatOptions): Collator; - supportedLocalesOf(locales: string[], options?: NumberFormatOptions): string[]; - supportedLocalesOf(locale: string, options?: NumberFormatOptions): string[]; - } - - interface DateTimeFormatOptions { - localeMatcher?: string; - weekday?: string; - era?: string; - year?: string; - month?: string; - day?: string; - hour?: string; - minute?: string; - second?: string; - timeZoneName?: string; - formatMatcher?: string; - hour12: boolean; - } - - interface ResolvedDateTimeFormatOptions { - locale: string; - calendar: string; - numberingSystem: string; - timeZone: string; - hour12?: boolean; - weekday?: string; - era?: string; - year?: string; - month?: string; - day?: string; - hour?: string; - minute?: string; - second?: string; - timeZoneName?: string; - } - - interface DateTimeFormat { - format(date: number): string; - resolvedOptions(): ResolvedDateTimeFormatOptions; - } - var DateTimeFormat: { - new (locales?: string[], options?: DateTimeFormatOptions): Collator; - new (locale?: string, options?: DateTimeFormatOptions): Collator; - (locales?: string[], options?: DateTimeFormatOptions): Collator; - (locale?: string, options?: DateTimeFormatOptions): Collator; - supportedLocalesOf(locales: string[], options?: DateTimeFormatOptions): string[]; - supportedLocalesOf(locale: string, options?: DateTimeFormatOptions): string[]; - } -} - -interface String { - /** - * Determines whether two strings are equivalent in the current locale. - * @param that String to compare to target string - * @param locales An array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details. - * @param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details. - */ - localeCompare(that: string, locales: string[], options?: Intl.CollatorOptions): number; - - /** - * Determines whether two strings are equivalent in the current locale. - * @param that String to compare to target string - * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details. - * @param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details. - */ - localeCompare(that: string, locale: string, options?: Intl.CollatorOptions): number; -} - -interface Number { - /** - * Converts a number to a string by using the current or specified locale. - * @param locales An array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. - * @param options An object that contains one or more properties that specify comparison options. - */ - toLocaleString(locales?: string[], options?: Intl.NumberFormatOptions): string; - - /** - * Converts a number to a string by using the current or specified locale. - * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used. - * @param options An object that contains one or more properties that specify comparison options. - */ - toLocaleString(locale?: string, options?: Intl.NumberFormatOptions): string; -} - -interface Date { - /** - * Converts a date to a string by using the current or specified locale. - * @param locales An array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. - * @param options An object that contains one or more properties that specify comparison options. - */ - toLocaleString(locales?: string[], options?: Intl.DateTimeFormatOptions): string; - - /** - * Converts a date to a string by using the current or specified locale. - * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used. - * @param options An object that contains one or more properties that specify comparison options. - */ - toLocaleString(locale?: string, options?: Intl.DateTimeFormatOptions): string; -} - -///////////////////////////// -/// IE DOM APIs -///////////////////////////// - - -interface PositionOptions { - enableHighAccuracy?: boolean; - timeout?: number; - maximumAge?: number; -} - -interface ObjectURLOptions { - oneTimeOnly?: boolean; -} - -interface StoreExceptionsInformation extends ExceptionInformation { - siteName?: string; - explanationString?: string; - detailURI?: string; -} - -interface StoreSiteSpecificExceptionsInformation extends StoreExceptionsInformation { - arrayOfDomainStrings?: string[]; -} - -interface ConfirmSiteSpecificExceptionsInformation extends ExceptionInformation { - arrayOfDomainStrings?: string[]; -} - -interface AlgorithmParameters { -} - -interface MutationObserverInit { - childList?: boolean; - attributes?: boolean; - characterData?: boolean; - subtree?: boolean; - attributeOldValue?: boolean; - characterDataOldValue?: boolean; - attributeFilter?: string[]; -} - -interface PointerEventInit extends MouseEventInit { - pointerId?: number; - width?: number; - height?: number; - pressure?: number; - tiltX?: number; - tiltY?: number; - pointerType?: string; - isPrimary?: boolean; -} - -interface ExceptionInformation { - domain?: string; -} - -interface DeviceAccelerationDict { - x?: number; - y?: number; - z?: number; -} - -interface MsZoomToOptions { - contentX?: number; - contentY?: number; - viewportX?: string; - viewportY?: string; - scaleFactor?: number; - animate?: string; -} - -interface DeviceRotationRateDict { - alpha?: number; - beta?: number; - gamma?: number; -} - -interface Algorithm { - name?: string; - params?: AlgorithmParameters; -} - -interface MouseEventInit { - bubbles?: boolean; - cancelable?: boolean; - view?: Window; - detail?: number; - screenX?: number; - screenY?: number; - clientX?: number; - clientY?: number; - ctrlKey?: boolean; - shiftKey?: boolean; - altKey?: boolean; - metaKey?: boolean; - button?: number; - buttons?: number; - relatedTarget?: EventTarget; -} - -interface WebGLContextAttributes { - alpha?: boolean; - depth?: boolean; - stencil?: boolean; - antialias?: boolean; - premultipliedAlpha?: boolean; - preserveDrawingBuffer?: boolean; -} - -interface NodeListOf extends NodeList { - length: number; - item(index: number): TNode; - [index: number]: TNode; -} - -interface HTMLElement extends Element, ElementCSSInlineStyle, MSEventAttachmentTarget, MSNodeExtensions { - hidden: any; - readyState: any; - onmouseleave: (ev: MouseEvent) => any; - onbeforecut: (ev: DragEvent) => any; - onkeydown: (ev: KeyboardEvent) => any; - onmove: (ev: MSEventObj) => any; - onkeyup: (ev: KeyboardEvent) => any; - onreset: (ev: Event) => any; - onhelp: (ev: Event) => any; - ondragleave: (ev: DragEvent) => any; - className: string; - onfocusin: (ev: FocusEvent) => any; - onseeked: (ev: Event) => any; - recordNumber: any; - title: string; - parentTextEdit: Element; - outerHTML: string; - ondurationchange: (ev: Event) => any; - offsetHeight: number; - all: HTMLCollection; - onblur: (ev: FocusEvent) => any; - dir: string; - onemptied: (ev: Event) => any; - onseeking: (ev: Event) => any; - oncanplay: (ev: Event) => any; - ondeactivate: (ev: UIEvent) => any; - ondatasetchanged: (ev: MSEventObj) => any; - onrowsdelete: (ev: MSEventObj) => any; - sourceIndex: number; - onloadstart: (ev: Event) => any; - onlosecapture: (ev: MSEventObj) => any; - ondragenter: (ev: DragEvent) => any; - oncontrolselect: (ev: MSEventObj) => any; - onsubmit: (ev: Event) => any; - behaviorUrns: MSBehaviorUrnsCollection; - scopeName: string; - onchange: (ev: Event) => any; - id: string; - onlayoutcomplete: (ev: MSEventObj) => any; - uniqueID: string; - onbeforeactivate: (ev: UIEvent) => any; - oncanplaythrough: (ev: Event) => any; - onbeforeupdate: (ev: MSEventObj) => any; - onfilterchange: (ev: MSEventObj) => any; - offsetParent: Element; - ondatasetcomplete: (ev: MSEventObj) => any; - onsuspend: (ev: Event) => any; - onmouseenter: (ev: MouseEvent) => any; - innerText: string; - onerrorupdate: (ev: MSEventObj) => any; - onmouseout: (ev: MouseEvent) => any; - parentElement: HTMLElement; - onmousewheel: (ev: MouseWheelEvent) => any; - onvolumechange: (ev: Event) => any; - oncellchange: (ev: MSEventObj) => any; - onrowexit: (ev: MSEventObj) => any; - onrowsinserted: (ev: MSEventObj) => any; - onpropertychange: (ev: MSEventObj) => any; - filters: any; - children: HTMLCollection; - ondragend: (ev: DragEvent) => any; - onbeforepaste: (ev: DragEvent) => any; - ondragover: (ev: DragEvent) => any; - offsetTop: number; - onmouseup: (ev: MouseEvent) => any; - ondragstart: (ev: DragEvent) => any; - onbeforecopy: (ev: DragEvent) => any; - ondrag: (ev: DragEvent) => any; - innerHTML: string; - onmouseover: (ev: MouseEvent) => any; - lang: string; - uniqueNumber: number; - onpause: (ev: Event) => any; - tagUrn: string; - onmousedown: (ev: MouseEvent) => any; - onclick: (ev: MouseEvent) => any; - onwaiting: (ev: Event) => any; - onresizestart: (ev: MSEventObj) => any; - offsetLeft: number; - isTextEdit: boolean; - isDisabled: boolean; - onpaste: (ev: DragEvent) => any; - canHaveHTML: boolean; - onmoveend: (ev: MSEventObj) => any; - language: string; - onstalled: (ev: Event) => any; - onmousemove: (ev: MouseEvent) => any; - style: MSStyleCSSProperties; - isContentEditable: boolean; - onbeforeeditfocus: (ev: MSEventObj) => any; - onratechange: (ev: Event) => any; - contentEditable: string; - tabIndex: number; - document: Document; - onprogress: (ev: ProgressEvent) => any; - ondblclick: (ev: MouseEvent) => any; - oncontextmenu: (ev: MouseEvent) => any; - onloadedmetadata: (ev: Event) => any; - onafterupdate: (ev: MSEventObj) => any; - onerror: (ev: ErrorEvent) => any; - onplay: (ev: Event) => any; - onresizeend: (ev: MSEventObj) => any; - onplaying: (ev: Event) => any; - isMultiLine: boolean; - onfocusout: (ev: FocusEvent) => any; - onabort: (ev: UIEvent) => any; - ondataavailable: (ev: MSEventObj) => any; - hideFocus: boolean; - onreadystatechange: (ev: Event) => any; - onkeypress: (ev: KeyboardEvent) => any; - onloadeddata: (ev: Event) => any; - onbeforedeactivate: (ev: UIEvent) => any; - outerText: string; - disabled: boolean; - onactivate: (ev: UIEvent) => any; - accessKey: string; - onmovestart: (ev: MSEventObj) => any; - onselectstart: (ev: Event) => any; - onfocus: (ev: FocusEvent) => any; - ontimeupdate: (ev: Event) => any; - onresize: (ev: UIEvent) => any; - oncut: (ev: DragEvent) => any; - onselect: (ev: UIEvent) => any; - ondrop: (ev: DragEvent) => any; - offsetWidth: number; - oncopy: (ev: DragEvent) => any; - onended: (ev: Event) => any; - onscroll: (ev: UIEvent) => any; - onrowenter: (ev: MSEventObj) => any; - onload: (ev: Event) => any; - canHaveChildren: boolean; - oninput: (ev: Event) => any; - onmscontentzoom: (ev: MSEventObj) => any; - oncuechange: (ev: Event) => any; - spellcheck: boolean; - classList: DOMTokenList; - onmsmanipulationstatechanged: (ev: any) => any; - draggable: boolean; - dataset: DOMStringMap; - dragDrop(): boolean; - scrollIntoView(top?: boolean): void; - addFilter(filter: any): void; - setCapture(containerCapture?: boolean): void; - focus(): void; - getAdjacentText(where: string): string; - insertAdjacentText(where: string, text: string): void; - getElementsByClassName(classNames: string): NodeList; - setActive(): void; - removeFilter(filter: any): void; - blur(): void; - clearAttributes(): void; - releaseCapture(): void; - createControlRange(): ControlRangeCollection; - removeBehavior(cookie: number): boolean; - contains(child: HTMLElement): boolean; - click(): void; - insertAdjacentElement(position: string, insertedElement: Element): Element; - mergeAttributes(source: HTMLElement, preserveIdentity?: boolean): void; - replaceAdjacentText(where: string, newText: string): string; - applyElement(apply: Element, where?: string): Element; - addBehavior(bstrUrl: string, factory?: any): number; - insertAdjacentHTML(where: string, html: string): void; - msGetInputContext(): MSInputMethodContext; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var HTMLElement: { - prototype: HTMLElement; - new(): HTMLElement; -} - -interface Document extends Node, NodeSelector, MSEventAttachmentTarget, DocumentEvent, MSResourceMetadata, MSNodeExtensions, MSDocumentExtensions, GlobalEventHandlers { - /** - * Gets a reference to the root node of the document. - */ - documentElement: HTMLElement; - /** - * Retrieves the collection of user agents and versions declared in the X-UA-Compatible - */ - compatible: MSCompatibleInfoCollection; - /** - * Fires when the user presses a key. - * @param ev The keyboard event - */ - onkeydown: (ev: KeyboardEvent) => any; - /** - * Fires when the user releases a key. - * @param ev The keyboard event - */ - onkeyup: (ev: KeyboardEvent) => any; - /** - * Gets the implementation object of the current document. - */ - implementation: DOMImplementation; - /** - * Fires when the user resets a form. - * @param ev The event. - */ - onreset: (ev: Event) => any; - /** - * Retrieves a collection of all script objects in the document. - */ - scripts: HTMLCollection; - /** - * Fires when the user presses the F1 key while the browser is the active window. - * @param ev The event. - */ - onhelp: (ev: Event) => any; - /** - * Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation. - * @param ev The drag event. - */ - ondragleave: (ev: DragEvent) => any; - /** - * Gets or sets the character set used to encode the object. - */ - charset: string; - /** - * Fires for an element just prior to setting focus on that element. - * @param ev The focus event - */ - onfocusin: (ev: FocusEvent) => any; - /** - * Sets or gets the color of the links that the user has visited. - */ - vlinkColor: string; - /** - * Occurs when the seek operation ends. - * @param ev The event. - */ - onseeked: (ev: Event) => any; - security: string; - /** - * Contains the title of the document. - */ - title: string; - /** - * Retrieves a collection of namespace objects. - */ - namespaces: MSNamespaceInfoCollection; - /** - * Gets the default character set from the current regional language settings. - */ - defaultCharset: string; - /** - * Retrieves a collection of all embed objects in the document. - */ - embeds: HTMLCollection; - /** - * Retrieves a collection of styleSheet objects representing the style sheets that correspond to each instance of a link or style object in the document. - */ - styleSheets: StyleSheetList; - /** - * Retrieves a collection of all window objects defined by the given document or defined by the document associated with the given window. - */ - frames: Window; - /** - * Occurs when the duration attribute is updated. - * @param ev The event. - */ - ondurationchange: (ev: Event) => any; - /** - * Returns a reference to the collection of elements contained by the object. - */ - all: HTMLCollection; - /** - * Retrieves a collection, in source order, of all form objects in the document. - */ - forms: HTMLCollection; - /** - * Fires when the object loses the input focus. - * @param ev The focus event. - */ - onblur: (ev: FocusEvent) => any; - /** - * Sets or retrieves a value that indicates the reading order of the object. - */ - dir: string; - /** - * Occurs when the media element is reset to its initial state. - * @param ev The event. - */ - onemptied: (ev: Event) => any; - /** - * Sets or gets a value that indicates whether the document can be edited. - */ - designMode: string; - /** - * Occurs when the current playback position is moved. - * @param ev The event. - */ - onseeking: (ev: Event) => any; - /** - * Fires when the activeElement is changed from the current object to another object in the parent document. - * @param ev The UI Event - */ - ondeactivate: (ev: UIEvent) => any; - /** - * Occurs when playback is possible, but would require further buffering. - * @param ev The event. - */ - oncanplay: (ev: Event) => any; - /** - * Fires when the data set exposed by a data source object changes. - * @param ev The event. - */ - ondatasetchanged: (ev: MSEventObj) => any; - /** - * Fires when rows are about to be deleted from the recordset. - * @param ev The event - */ - onrowsdelete: (ev: MSEventObj) => any; - Script: MSScriptHost; - /** - * Occurs when Internet Explorer begins looking for media data. - * @param ev The event. - */ - onloadstart: (ev: Event) => any; - /** - * Gets the URL for the document, stripped of any character encoding. - */ - URLUnencoded: string; - defaultView: Window; - /** - * Fires when the user is about to make a control selection of the object. - * @param ev The event. - */ - oncontrolselect: (ev: MSEventObj) => any; - /** - * Fires on the target element when the user drags the object to a valid drop target. - * @param ev The drag event. - */ - ondragenter: (ev: DragEvent) => any; - onsubmit: (ev: Event) => any; - /** - * Returns the character encoding used to create the webpage that is loaded into the document object. - */ - inputEncoding: string; - /** - * Gets the object that has the focus when the parent document has focus. - */ - activeElement: Element; - /** - * Fires when the contents of the object or selection have changed. - * @param ev The event. - */ - onchange: (ev: Event) => any; - /** - * Retrieves a collection of all a objects that specify the href property and all area objects in the document. - */ - links: HTMLCollection; - /** - * Retrieves an autogenerated, unique identifier for the object. - */ - uniqueID: string; - /** - * Sets or gets the URL for the current document. - */ - URL: string; - /** - * Fires immediately before the object is set as the active element. - * @param ev The event. - */ - onbeforeactivate: (ev: UIEvent) => any; - head: HTMLHeadElement; - cookie: string; - xmlEncoding: string; - oncanplaythrough: (ev: Event) => any; - /** - * Retrieves the document compatibility mode of the document. - */ - documentMode: number; - characterSet: string; - /** - * Retrieves a collection of all a objects that have a name and/or id property. Objects in this collection are in HTML source order. - */ - anchors: HTMLCollection; - onbeforeupdate: (ev: MSEventObj) => any; - /** - * Fires to indicate that all data is available from the data source object. - * @param ev The event. - */ - ondatasetcomplete: (ev: MSEventObj) => any; - plugins: HTMLCollection; - /** - * Occurs if the load operation has been intentionally halted. - * @param ev The event. - */ - onsuspend: (ev: Event) => any; - /** - * Gets the root svg element in the document hierarchy. - */ - rootElement: SVGSVGElement; - /** - * Retrieves a value that indicates the current state of the object. - */ - readyState: string; - /** - * Gets the URL of the location that referred the user to the current page. - */ - referrer: string; - /** - * Sets or gets the color of all active links in the document. - */ - alinkColor: string; - /** - * Fires on a databound object when an error occurs while updating the associated data in the data source object. - * @param ev The event. - */ - onerrorupdate: (ev: MSEventObj) => any; - /** - * Gets a reference to the container object of the window. - */ - parentWindow: Window; - /** - * Fires when the user moves the mouse pointer outside the boundaries of the object. - * @param ev The mouse event. - */ - onmouseout: (ev: MouseEvent) => any; - /** - * Occurs when a user clicks a button in a Thumbnail Toolbar of a webpage running in Site Mode. - * @param ev The event. - */ - onmsthumbnailclick: (ev: MSSiteModeEvent) => any; - /** - * Fires when the wheel button is rotated. - * @param ev The mouse event - */ - onmousewheel: (ev: MouseWheelEvent) => any; - /** - * Occurs when the volume is changed, or playback is muted or unmuted. - * @param ev The event. - */ - onvolumechange: (ev: Event) => any; - /** - * Fires when data changes in the data provider. - * @param ev The event. - */ - oncellchange: (ev: MSEventObj) => any; - /** - * Fires just before the data source control changes the current row in the object. - * @param ev The event. - */ - onrowexit: (ev: MSEventObj) => any; - /** - * Fires just after new rows are inserted in the current recordset. - * @param ev The event. - */ - onrowsinserted: (ev: MSEventObj) => any; - /** - * Gets or sets the version attribute specified in the declaration of an XML document. - */ - xmlVersion: string; - msCapsLockWarningOff: boolean; - /** - * Fires when a property changes on the object. - * @param ev The event. - */ - onpropertychange: (ev: MSEventObj) => any; - /** - * Fires on the source object when the user releases the mouse at the close of a drag operation. - * @param ev The event. - */ - ondragend: (ev: DragEvent) => any; - /** - * Gets an object representing the document type declaration associated with the current document. - */ - doctype: DocumentType; - /** - * Fires on the target element continuously while the user drags the object over a valid drop target. - * @param ev The event. - */ - ondragover: (ev: DragEvent) => any; - /** - * Deprecated. Sets or retrieves a value that indicates the background color behind the object. - */ - bgColor: string; - /** - * Fires on the source object when the user starts to drag a text selection or selected object. - * @param ev The event. - */ - ondragstart: (ev: DragEvent) => any; - /** - * Fires when the user releases a mouse button while the mouse is over the object. - * @param ev The mouse event. - */ - onmouseup: (ev: MouseEvent) => any; - /** - * Fires on the source object continuously during a drag operation. - * @param ev The event. - */ - ondrag: (ev: DragEvent) => any; - /** - * Fires when the user moves the mouse pointer into the object. - * @param ev The mouse event. - */ - onmouseover: (ev: MouseEvent) => any; - /** - * Sets or gets the color of the document links. - */ - linkColor: string; - /** - * Occurs when playback is paused. - * @param ev The event. - */ - onpause: (ev: Event) => any; - /** - * Fires when the user clicks the object with either mouse button. - * @param ev The mouse event. - */ - onmousedown: (ev: MouseEvent) => any; - /** - * Fires when the user clicks the left mouse button on the object - * @param ev The mouse event. - */ - onclick: (ev: MouseEvent) => any; - /** - * Occurs when playback stops because the next frame of a video resource is not available. - * @param ev The event. - */ - onwaiting: (ev: Event) => any; - /** - * Fires when the user clicks the Stop button or leaves the Web page. - * @param ev The event. - */ - onstop: (ev: Event) => any; - /** - * Occurs when an item is removed from a Jump List of a webpage running in Site Mode. - * @param ev The event. - */ - onmssitemodejumplistitemremoved: (ev: MSSiteModeEvent) => any; - /** - * Retrieves a collection of all applet objects in the document. - */ - applets: HTMLCollection; - /** - * Specifies the beginning and end of the document body. - */ - body: HTMLElement; - /** - * Sets or gets the security domain of the document. - */ - domain: string; - xmlStandalone: boolean; - /** - * Represents the active selection, which is a highlighted block of text or other elements in the document that a user or a script can carry out some action on. - */ - selection: MSSelection; - /** - * Occurs when the download has stopped. - * @param ev The event. - */ - onstalled: (ev: Event) => any; - /** - * Fires when the user moves the mouse over the object. - * @param ev The mouse event. - */ - onmousemove: (ev: MouseEvent) => any; - /** - * Fires before an object contained in an editable element enters a UI-activated state or when an editable container object is control selected. - * @param ev The event. - */ - onbeforeeditfocus: (ev: MSEventObj) => any; - /** - * Occurs when the playback rate is increased or decreased. - * @param ev The event. - */ - onratechange: (ev: Event) => any; - /** - * Occurs to indicate progress while downloading media data. - * @param ev The event. - */ - onprogress: (ev: ProgressEvent) => any; - /** - * Fires when the user double-clicks the object. - * @param ev The mouse event. - */ - ondblclick: (ev: MouseEvent) => any; - /** - * Fires when the user clicks the right mouse button in the client area, opening the context menu. - * @param ev The mouse event. - */ - oncontextmenu: (ev: MouseEvent) => any; - /** - * Occurs when the duration and dimensions of the media have been determined. - * @param ev The event. - */ - onloadedmetadata: (ev: Event) => any; - media: string; - /** - * Fires when an error occurs during object loading. - * @param ev The event. - */ - onerror: (ev: ErrorEvent) => any; - /** - * Occurs when the play method is requested. - * @param ev The event. - */ - onplay: (ev: Event) => any; - onafterupdate: (ev: MSEventObj) => any; - /** - * Occurs when the audio or video has started playing. - * @param ev The event. - */ - onplaying: (ev: Event) => any; - /** - * Retrieves a collection, in source order, of img objects in the document. - */ - images: HTMLCollection; - /** - * Contains information about the current URL. - */ - location: Location; - /** - * Fires when the user aborts the download. - * @param ev The event. - */ - onabort: (ev: UIEvent) => any; - /** - * Fires for the current element with focus immediately after moving focus to another element. - * @param ev The event. - */ - onfocusout: (ev: FocusEvent) => any; - /** - * Fires when the selection state of a document changes. - * @param ev The event. - */ - onselectionchange: (ev: Event) => any; - /** - * Fires when a local DOM Storage area is written to disk. - * @param ev The event. - */ - onstoragecommit: (ev: StorageEvent) => any; - /** - * Fires periodically as data arrives from data source objects that asynchronously transmit their data. - * @param ev The event. - */ - ondataavailable: (ev: MSEventObj) => any; - /** - * Fires when the state of the object has changed. - * @param ev The event - */ - onreadystatechange: (ev: Event) => any; - /** - * Gets the date that the page was last modified, if the page supplies one. - */ - lastModified: string; - /** - * Fires when the user presses an alphanumeric key. - * @param ev The event. - */ - onkeypress: (ev: KeyboardEvent) => any; - /** - * Occurs when media data is loaded at the current playback position. - * @param ev The event. - */ - onloadeddata: (ev: Event) => any; - /** - * Fires immediately before the activeElement is changed from the current object to another object in the parent document. - * @param ev The event. - */ - onbeforedeactivate: (ev: UIEvent) => any; - /** - * Fires when the object is set as the active element. - * @param ev The event. - */ - onactivate: (ev: UIEvent) => any; - onselectstart: (ev: Event) => any; - /** - * Fires when the object receives focus. - * @param ev The event. - */ - onfocus: (ev: FocusEvent) => any; - /** - * Sets or gets the foreground (text) color of the document. - */ - fgColor: string; - /** - * Occurs to indicate the current playback position. - * @param ev The event. - */ - ontimeupdate: (ev: Event) => any; - /** - * Fires when the current selection changes. - * @param ev The event. - */ - onselect: (ev: UIEvent) => any; - ondrop: (ev: DragEvent) => any; - /** - * Occurs when the end of playback is reached. - * @param ev The event - */ - onended: (ev: Event) => any; - /** - * Gets a value that indicates whether standards-compliant mode is switched on for the object. - */ - compatMode: string; - /** - * Fires when the user repositions the scroll box in the scroll bar on the object. - * @param ev The event. - */ - onscroll: (ev: UIEvent) => any; - /** - * Fires to indicate that the current row has changed in the data source and new data values are available on the object. - * @param ev The event. - */ - onrowenter: (ev: MSEventObj) => any; - /** - * Fires immediately after the browser loads the object. - * @param ev The event. - */ - onload: (ev: Event) => any; - oninput: (ev: Event) => any; - onmspointerdown: (ev: any) => any; - msHidden: boolean; - msVisibilityState: string; - onmsgesturedoubletap: (ev: any) => any; - visibilityState: string; - onmsmanipulationstatechanged: (ev: any) => any; - onmspointerhover: (ev: any) => any; - onmscontentzoom: (ev: MSEventObj) => any; - onmspointermove: (ev: any) => any; - onmsgesturehold: (ev: any) => any; - onmsgesturechange: (ev: any) => any; - onmsgesturestart: (ev: any) => any; - onmspointercancel: (ev: any) => any; - onmsgestureend: (ev: any) => any; - onmsgesturetap: (ev: any) => any; - onmspointerout: (ev: any) => any; - onmsinertiastart: (ev: any) => any; - msCSSOMElementFloatMetrics: boolean; - onmspointerover: (ev: any) => any; - hidden: boolean; - onmspointerup: (ev: any) => any; - msFullscreenEnabled: boolean; - onmsfullscreenerror: (ev: any) => any; - onmspointerenter: (ev: any) => any; - msFullscreenElement: Element; - onmsfullscreenchange: (ev: any) => any; - onmspointerleave: (ev: any) => any; - /** - * Returns a reference to the first object with the specified value of the ID or NAME attribute. - * @param elementId String that specifies the ID value. Case-insensitive. - */ - getElementById(elementId: string): HTMLElement; - /** - * Returns the current value of the document, range, or current selection for the given command. - * @param commandId String that specifies a command identifier. - */ - queryCommandValue(commandId: string): string; - adoptNode(source: Node): Node; - /** - * Returns a Boolean value that indicates whether the specified command is in the indeterminate state. - * @param commandId String that specifies a command identifier. - */ - queryCommandIndeterm(commandId: string): boolean; - getElementsByTagNameNS(namespaceURI: string, localName: string): NodeList; - createProcessingInstruction(target: string, data: string): ProcessingInstruction; - /** - * Executes a command on the current document, current selection, or the given range. - * @param commandId String that specifies the command to execute. This command can be any of the command identifiers that can be executed in script. - * @param showUI Display the user interface, defaults to false. - * @param value Value to assign. - */ - execCommand(commandId: string, showUI?: boolean, value?: any): boolean; - /** - * Returns the element for the specified x coordinate and the specified y coordinate. - * @param x The x-offset - * @param y The y-offset - */ - elementFromPoint(x: number, y: number): Element; - createCDATASection(data: string): CDATASection; - /** - * Retrieves the string associated with a command. - * @param commandId String that contains the identifier of a command. This can be any command identifier given in the list of Command Identifiers. - */ - queryCommandText(commandId: string): string; - /** - * Writes one or more HTML expressions to a document in the specified window. - * @param content Specifies the text and HTML tags to write. - */ - write(...content: string[]): void; - /** - * Allows updating the print settings for the page. - */ - updateSettings(): void; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "a"): HTMLAnchorElement; - createElement(tagName: "abbr"): HTMLPhraseElement; - createElement(tagName: "acronym"): HTMLPhraseElement; - createElement(tagName: "address"): HTMLBlockElement; - createElement(tagName: "applet"): HTMLAppletElement; - createElement(tagName: "area"): HTMLAreaElement; - createElement(tagName: "article"): HTMLElement; - createElement(tagName: "aside"): HTMLElement; - createElement(tagName: "audio"): HTMLAudioElement; - createElement(tagName: "b"): HTMLPhraseElement; - createElement(tagName: "base"): HTMLBaseElement; - createElement(tagName: "basefont"): HTMLBaseFontElement; - createElement(tagName: "bdo"): HTMLPhraseElement; - createElement(tagName: "bgsound"): HTMLBGSoundElement; - createElement(tagName: "big"): HTMLPhraseElement; - createElement(tagName: "blockquote"): HTMLBlockElement; - createElement(tagName: "body"): HTMLBodyElement; - createElement(tagName: "br"): HTMLBRElement; - createElement(tagName: "button"): HTMLButtonElement; - createElement(tagName: "canvas"): HTMLCanvasElement; - createElement(tagName: "caption"): HTMLTableCaptionElement; - createElement(tagName: "center"): HTMLBlockElement; - createElement(tagName: "cite"): HTMLPhraseElement; - createElement(tagName: "code"): HTMLPhraseElement; - createElement(tagName: "col"): HTMLTableColElement; - createElement(tagName: "colgroup"): HTMLTableColElement; - createElement(tagName: "datalist"): HTMLDataListElement; - createElement(tagName: "dd"): HTMLDDElement; - createElement(tagName: "del"): HTMLModElement; - createElement(tagName: "dfn"): HTMLPhraseElement; - createElement(tagName: "dir"): HTMLDirectoryElement; - createElement(tagName: "div"): HTMLDivElement; - createElement(tagName: "dl"): HTMLDListElement; - createElement(tagName: "dt"): HTMLDTElement; - createElement(tagName: "em"): HTMLPhraseElement; - createElement(tagName: "embed"): HTMLEmbedElement; - createElement(tagName: "fieldset"): HTMLFieldSetElement; - createElement(tagName: "figcaption"): HTMLElement; - createElement(tagName: "figure"): HTMLElement; - createElement(tagName: "font"): HTMLFontElement; - createElement(tagName: "footer"): HTMLElement; - createElement(tagName: "form"): HTMLFormElement; - createElement(tagName: "frame"): HTMLFrameElement; - createElement(tagName: "frameset"): HTMLFrameSetElement; - createElement(tagName: "h1"): HTMLHeadingElement; - createElement(tagName: "h2"): HTMLHeadingElement; - createElement(tagName: "h3"): HTMLHeadingElement; - createElement(tagName: "h4"): HTMLHeadingElement; - createElement(tagName: "h5"): HTMLHeadingElement; - createElement(tagName: "h6"): HTMLHeadingElement; - createElement(tagName: "head"): HTMLHeadElement; - createElement(tagName: "header"): HTMLElement; - createElement(tagName: "hgroup"): HTMLElement; - createElement(tagName: "hr"): HTMLHRElement; - createElement(tagName: "html"): HTMLHtmlElement; - createElement(tagName: "i"): HTMLPhraseElement; - createElement(tagName: "iframe"): HTMLIFrameElement; - createElement(tagName: "img"): HTMLImageElement; - createElement(tagName: "input"): HTMLInputElement; - createElement(tagName: "ins"): HTMLModElement; - createElement(tagName: "isindex"): HTMLIsIndexElement; - createElement(tagName: "kbd"): HTMLPhraseElement; - createElement(tagName: "keygen"): HTMLBlockElement; - createElement(tagName: "label"): HTMLLabelElement; - createElement(tagName: "legend"): HTMLLegendElement; - createElement(tagName: "li"): HTMLLIElement; - createElement(tagName: "link"): HTMLLinkElement; - createElement(tagName: "listing"): HTMLBlockElement; - createElement(tagName: "map"): HTMLMapElement; - createElement(tagName: "mark"): HTMLElement; - createElement(tagName: "marquee"): HTMLMarqueeElement; - createElement(tagName: "menu"): HTMLMenuElement; - createElement(tagName: "meta"): HTMLMetaElement; - createElement(tagName: "nav"): HTMLElement; - createElement(tagName: "nextid"): HTMLNextIdElement; - createElement(tagName: "nobr"): HTMLPhraseElement; - createElement(tagName: "noframes"): HTMLElement; - createElement(tagName: "noscript"): HTMLElement; - createElement(tagName: "object"): HTMLObjectElement; - createElement(tagName: "ol"): HTMLOListElement; - createElement(tagName: "optgroup"): HTMLOptGroupElement; - createElement(tagName: "option"): HTMLOptionElement; - createElement(tagName: "p"): HTMLParagraphElement; - createElement(tagName: "param"): HTMLParamElement; - createElement(tagName: "plaintext"): HTMLBlockElement; - createElement(tagName: "pre"): HTMLPreElement; - createElement(tagName: "progress"): HTMLProgressElement; - createElement(tagName: "q"): HTMLQuoteElement; - createElement(tagName: "rt"): HTMLPhraseElement; - createElement(tagName: "ruby"): HTMLPhraseElement; - createElement(tagName: "s"): HTMLPhraseElement; - createElement(tagName: "samp"): HTMLPhraseElement; - createElement(tagName: "script"): HTMLScriptElement; - createElement(tagName: "section"): HTMLElement; - createElement(tagName: "select"): HTMLSelectElement; - createElement(tagName: "small"): HTMLPhraseElement; - createElement(tagName: "SOURCE"): HTMLSourceElement; - createElement(tagName: "span"): HTMLSpanElement; - createElement(tagName: "strike"): HTMLPhraseElement; - createElement(tagName: "strong"): HTMLPhraseElement; - createElement(tagName: "style"): HTMLStyleElement; - createElement(tagName: "sub"): HTMLPhraseElement; - createElement(tagName: "sup"): HTMLPhraseElement; - createElement(tagName: "table"): HTMLTableElement; - createElement(tagName: "tbody"): HTMLTableSectionElement; - createElement(tagName: "td"): HTMLTableDataCellElement; - createElement(tagName: "textarea"): HTMLTextAreaElement; - createElement(tagName: "tfoot"): HTMLTableSectionElement; - createElement(tagName: "th"): HTMLTableHeaderCellElement; - createElement(tagName: "thead"): HTMLTableSectionElement; - createElement(tagName: "title"): HTMLTitleElement; - createElement(tagName: "tr"): HTMLTableRowElement; - createElement(tagName: "track"): HTMLTrackElement; - createElement(tagName: "tt"): HTMLPhraseElement; - createElement(tagName: "u"): HTMLPhraseElement; - createElement(tagName: "ul"): HTMLUListElement; - createElement(tagName: "var"): HTMLPhraseElement; - createElement(tagName: "video"): HTMLVideoElement; - createElement(tagName: "wbr"): HTMLElement; - createElement(tagName: "x-ms-webview"): MSHTMLWebViewElement; - createElement(tagName: "xmp"): HTMLBlockElement; - createElement(tagName: string): HTMLElement; - /** - * Removes mouse capture from the object in the current document. - */ - releaseCapture(): void; - /** - * Writes one or more HTML expressions, followed by a carriage return, to a document in the specified window. - * @param content The text and HTML tags to write. - */ - writeln(...content: string[]): void; - createElementNS(namespaceURI: string, qualifiedName: string): Element; - /** - * Opens a new window and loads a document specified by a given URL. Also, opens a new window that uses the url parameter and the name parameter to collect the output of the write method and the writeln method. - * @param url Specifies a MIME type for the document. - * @param name Specifies the name of the window. This name is used as the value for the TARGET attribute on a form or an anchor element. - * @param features Contains a list of items separated by commas. Each item consists of an option and a value, separated by an equals sign (for example, "fullscreen=yes, toolbar=yes"). The following values are supported. - * @param replace Specifies whether the existing entry for the document is replaced in the history list. - */ - open(url?: string, name?: string, features?: string, replace?: boolean): any; - /** - * Returns a Boolean value that indicates whether the current command is supported on the current range. - * @param commandId Specifies a command identifier. - */ - queryCommandSupported(commandId: string): boolean; - /** - * Creates a TreeWalker object that you can use to traverse filtered lists of nodes or elements in a document. - * @param root The root element or node to start traversing on. - * @param whatToShow The type of nodes or elements to appear in the node list. For more information, see whatToShow. - * @param filter A custom NodeFilter function to use. - * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded. - */ - createTreeWalker(root: Node, whatToShow: number, filter: NodeFilter, entityReferenceExpansion: boolean): TreeWalker; - createAttributeNS(namespaceURI: string, qualifiedName: string): Attr; - /** - * Returns a Boolean value that indicates whether a specified command can be successfully executed using execCommand, given the current state of the document. - * @param commandId Specifies a command identifier. - */ - queryCommandEnabled(commandId: string): boolean; - /** - * Causes the element to receive the focus and executes the code specified by the onfocus event. - */ - focus(): void; - /** - * Closes an output stream and forces the sent data to display. - */ - close(): void; - getElementsByClassName(classNames: string): NodeList; - importNode(importedNode: Node, deep: boolean): Node; - /** - * Returns an empty range object that has both of its boundary points positioned at the beginning of the document. - */ - createRange(): Range; - /** - * Fires a specified event on the object. - * @param eventName Specifies the name of the event to fire. - * @param eventObj Object that specifies the event object from which to obtain event object properties. - */ - fireEvent(eventName: string, eventObj?: any): boolean; - /** - * Creates a comment object with the specified data. - * @param data Sets the comment object's data. - */ - createComment(data: string): Comment; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "a"): NodeListOf; - getElementsByTagName(name: "abbr"): NodeListOf; - getElementsByTagName(name: "acronym"): NodeListOf; - getElementsByTagName(name: "address"): NodeListOf; - getElementsByTagName(name: "applet"): NodeListOf; - getElementsByTagName(name: "area"): NodeListOf; - getElementsByTagName(name: "article"): NodeListOf; - getElementsByTagName(name: "aside"): NodeListOf; - getElementsByTagName(name: "audio"): NodeListOf; - getElementsByTagName(name: "b"): NodeListOf; - getElementsByTagName(name: "base"): NodeListOf; - getElementsByTagName(name: "basefont"): NodeListOf; - getElementsByTagName(name: "bdo"): NodeListOf; - getElementsByTagName(name: "bgsound"): NodeListOf; - getElementsByTagName(name: "big"): NodeListOf; - getElementsByTagName(name: "blockquote"): NodeListOf; - getElementsByTagName(name: "body"): NodeListOf; - getElementsByTagName(name: "br"): NodeListOf; - getElementsByTagName(name: "button"): NodeListOf; - getElementsByTagName(name: "canvas"): NodeListOf; - getElementsByTagName(name: "caption"): NodeListOf; - getElementsByTagName(name: "center"): NodeListOf; - getElementsByTagName(name: "cite"): NodeListOf; - getElementsByTagName(name: "code"): NodeListOf; - getElementsByTagName(name: "col"): NodeListOf; - getElementsByTagName(name: "colgroup"): NodeListOf; - getElementsByTagName(name: "datalist"): NodeListOf; - getElementsByTagName(name: "dd"): NodeListOf; - getElementsByTagName(name: "del"): NodeListOf; - getElementsByTagName(name: "dfn"): NodeListOf; - getElementsByTagName(name: "dir"): NodeListOf; - getElementsByTagName(name: "div"): NodeListOf; - getElementsByTagName(name: "dl"): NodeListOf; - getElementsByTagName(name: "dt"): NodeListOf; - getElementsByTagName(name: "em"): NodeListOf; - getElementsByTagName(name: "embed"): NodeListOf; - getElementsByTagName(name: "fieldset"): NodeListOf; - getElementsByTagName(name: "figcaption"): NodeListOf; - getElementsByTagName(name: "figure"): NodeListOf; - getElementsByTagName(name: "font"): NodeListOf; - getElementsByTagName(name: "footer"): NodeListOf; - getElementsByTagName(name: "form"): NodeListOf; - getElementsByTagName(name: "frame"): NodeListOf; - getElementsByTagName(name: "frameset"): NodeListOf; - getElementsByTagName(name: "h1"): NodeListOf; - getElementsByTagName(name: "h2"): NodeListOf; - getElementsByTagName(name: "h3"): NodeListOf; - getElementsByTagName(name: "h4"): NodeListOf; - getElementsByTagName(name: "h5"): NodeListOf; - getElementsByTagName(name: "h6"): NodeListOf; - getElementsByTagName(name: "head"): NodeListOf; - getElementsByTagName(name: "header"): NodeListOf; - getElementsByTagName(name: "hgroup"): NodeListOf; - getElementsByTagName(name: "hr"): NodeListOf; - getElementsByTagName(name: "html"): NodeListOf; - getElementsByTagName(name: "i"): NodeListOf; - getElementsByTagName(name: "iframe"): NodeListOf; - getElementsByTagName(name: "img"): NodeListOf; - getElementsByTagName(name: "input"): NodeListOf; - getElementsByTagName(name: "ins"): NodeListOf; - getElementsByTagName(name: "isindex"): NodeListOf; - getElementsByTagName(name: "kbd"): NodeListOf; - getElementsByTagName(name: "keygen"): NodeListOf; - getElementsByTagName(name: "label"): NodeListOf; - getElementsByTagName(name: "legend"): NodeListOf; - getElementsByTagName(name: "li"): NodeListOf; - getElementsByTagName(name: "link"): NodeListOf; - getElementsByTagName(name: "listing"): NodeListOf; - getElementsByTagName(name: "map"): NodeListOf; - getElementsByTagName(name: "mark"): NodeListOf; - getElementsByTagName(name: "marquee"): NodeListOf; - getElementsByTagName(name: "menu"): NodeListOf; - getElementsByTagName(name: "meta"): NodeListOf; - getElementsByTagName(name: "nav"): NodeListOf; - getElementsByTagName(name: "nextid"): NodeListOf; - getElementsByTagName(name: "nobr"): NodeListOf; - getElementsByTagName(name: "noframes"): NodeListOf; - getElementsByTagName(name: "noscript"): NodeListOf; - getElementsByTagName(name: "object"): NodeListOf; - getElementsByTagName(name: "ol"): NodeListOf; - getElementsByTagName(name: "optgroup"): NodeListOf; - getElementsByTagName(name: "option"): NodeListOf; - getElementsByTagName(name: "p"): NodeListOf; - getElementsByTagName(name: "param"): NodeListOf; - getElementsByTagName(name: "plaintext"): NodeListOf; - getElementsByTagName(name: "pre"): NodeListOf; - getElementsByTagName(name: "progress"): NodeListOf; - getElementsByTagName(name: "q"): NodeListOf; - getElementsByTagName(name: "rt"): NodeListOf; - getElementsByTagName(name: "ruby"): NodeListOf; - getElementsByTagName(name: "s"): NodeListOf; - getElementsByTagName(name: "samp"): NodeListOf; - getElementsByTagName(name: "script"): NodeListOf; - getElementsByTagName(name: "section"): NodeListOf; - getElementsByTagName(name: "select"): NodeListOf; - getElementsByTagName(name: "small"): NodeListOf; - getElementsByTagName(name: "SOURCE"): NodeListOf; - getElementsByTagName(name: "span"): NodeListOf; - getElementsByTagName(name: "strike"): NodeListOf; - getElementsByTagName(name: "strong"): NodeListOf; - getElementsByTagName(name: "style"): NodeListOf; - getElementsByTagName(name: "sub"): NodeListOf; - getElementsByTagName(name: "sup"): NodeListOf; - getElementsByTagName(name: "table"): NodeListOf; - getElementsByTagName(name: "tbody"): NodeListOf; - getElementsByTagName(name: "td"): NodeListOf; - getElementsByTagName(name: "textarea"): NodeListOf; - getElementsByTagName(name: "tfoot"): NodeListOf; - getElementsByTagName(name: "th"): NodeListOf; - getElementsByTagName(name: "thead"): NodeListOf; - getElementsByTagName(name: "title"): NodeListOf; - getElementsByTagName(name: "tr"): NodeListOf; - getElementsByTagName(name: "track"): NodeListOf; - getElementsByTagName(name: "tt"): NodeListOf; - getElementsByTagName(name: "u"): NodeListOf; - getElementsByTagName(name: "ul"): NodeListOf; - getElementsByTagName(name: "var"): NodeListOf; - getElementsByTagName(name: "video"): NodeListOf; - getElementsByTagName(name: "wbr"): NodeListOf; - getElementsByTagName(name: "x-ms-webview"): NodeListOf; - getElementsByTagName(name: "xmp"): NodeListOf; - getElementsByTagName(name: string): NodeList; - /** - * Creates a new document. - */ - createDocumentFragment(): DocumentFragment; - /** - * Creates a style sheet for the document. - * @param href Specifies how to add the style sheet to the document. If a file name is specified for the URL, the style information is added as a link object. If the URL contains style information, it is added to the style object. - * @param index Specifies the index that indicates where the new style sheet is inserted in the styleSheets collection. The default is to insert the new style sheet at the end of the collection. - */ - createStyleSheet(href?: string, index?: number): CSSStyleSheet; - /** - * Gets a collection of objects based on the value of the NAME or ID attribute. - * @param elementName Gets a collection of objects based on the value of the NAME or ID attribute. - */ - getElementsByName(elementName: string): NodeList; - /** - * Returns a Boolean value that indicates the current state of the command. - * @param commandId String that specifies a command identifier. - */ - queryCommandState(commandId: string): boolean; - /** - * Gets a value indicating whether the object currently has focus. - */ - hasFocus(): boolean; - /** - * Displays help information for the given command identifier. - * @param commandId Displays help information for the given command identifier. - */ - execCommandShowHelp(commandId: string): boolean; - /** - * Creates an attribute object with a specified name. - * @param name String that sets the attribute object's name. - */ - createAttribute(name: string): Attr; - /** - * Creates a text string from the specified value. - * @param data String that specifies the nodeValue property of the text node. - */ - createTextNode(data: string): Text; - /** - * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document. - * @param root The root element or node to start traversing on. - * @param whatToShow The type of nodes or elements to appear in the node list - * @param filter A custom NodeFilter function to use. For more information, see filter. Use null for no filter. - * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded. - */ - createNodeIterator(root: Node, whatToShow: number, filter: NodeFilter, entityReferenceExpansion: boolean): NodeIterator; - /** - * Generates an event object to pass event context information when you use the fireEvent method. - * @param eventObj An object that specifies an existing event object on which to base the new object. - */ - createEventObject(eventObj?: any): MSEventObj; - /** - * Returns an object representing the current selection of the document that is loaded into the object displaying a webpage. - */ - getSelection(): Selection; - msElementsFromPoint(x: number, y: number): NodeList; - msElementsFromRect(left: number, top: number, width: number, height: number): NodeList; - clear(): void; - msExitFullscreen(): void; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "msthumbnailclick", listener: (ev: MSSiteModeEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "stop", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mssitemodejumplistitemremoved", listener: (ev: MSSiteModeEvent) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "selectionchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "storagecommit", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msfullscreenerror", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msfullscreenchange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var Document: { - prototype: Document; - new(): Document; -} - -interface Console { - info(message?: any, ...optionalParams: any[]): void; - warn(message?: any, ...optionalParams: any[]): void; - error(message?: any, ...optionalParams: any[]): void; - log(message?: any, ...optionalParams: any[]): void; - profile(reportName?: string): void; - assert(test?: boolean, message?: string, ...optionalParams: any[]): void; - msIsIndependentlyComposed(element: Element): boolean; - clear(): void; - dir(value?: any, ...optionalParams: any[]): void; - profileEnd(): void; - count(countTitle?: string): void; - groupEnd(): void; - time(timerName?: string): void; - timeEnd(timerName?: string): void; - trace(): void; - group(groupTitle?: string): void; - dirxml(value: any): void; - debug(message?: string, ...optionalParams: any[]): void; - groupCollapsed(groupTitle?: string): void; - select(element: Element): void; -} -declare var Console: { - prototype: Console; - new(): Console; -} - -interface MSEventObj extends Event { - nextPage: string; - keyCode: number; - toElement: Element; - returnValue: any; - dataFld: string; - y: number; - dataTransfer: DataTransfer; - propertyName: string; - url: string; - offsetX: number; - recordset: any; - screenX: number; - buttonID: number; - wheelDelta: number; - reason: number; - origin: string; - data: string; - srcFilter: any; - boundElements: HTMLCollection; - cancelBubble: boolean; - altLeft: boolean; - behaviorCookie: number; - bookmarks: BookmarkCollection; - type: string; - repeat: boolean; - srcElement: Element; - source: Window; - fromElement: Element; - offsetY: number; - x: number; - behaviorPart: number; - qualifier: string; - altKey: boolean; - ctrlKey: boolean; - clientY: number; - shiftKey: boolean; - shiftLeft: boolean; - contentOverflow: boolean; - screenY: number; - ctrlLeft: boolean; - button: number; - srcUrn: string; - clientX: number; - actionURL: string; - getAttribute(strAttributeName: string, lFlags?: number): any; - setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; - removeAttribute(strAttributeName: string, lFlags?: number): boolean; -} -declare var MSEventObj: { - prototype: MSEventObj; - new(): MSEventObj; -} - -interface HTMLCanvasElement extends HTMLElement { - /** - * Gets or sets the width of a canvas element on a document. - */ - width: number; - /** - * Gets or sets the height of a canvas element on a document. - */ - height: number; - /** - * Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas. - * @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext("2d"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext("experimental-webgl"); - */ - getContext(contextId: "2d"): CanvasRenderingContext2D; - /** - * Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas. - * @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext("2d"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext("experimental-webgl"); - */ - getContext(contextId: "experimental-webgl"): WebGLRenderingContext; - /** - * Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas. - * @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext("2d"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext("experimental-webgl"); - */ - getContext(contextId: string, ...args: any[]): any; - /** - * Returns the content of the current canvas as an image that you can use as a source for another canvas or an HTML element. - * @param type The standard MIME type for the image format to return. If you do not specify this parameter, the default value is a PNG format image. - */ - toDataURL(type?: string, ...args: any[]): string; - /** - * Returns a blob object encoded as a Portable Network Graphics (PNG) format from a canvas image or drawing. - */ - msToBlob(): Blob; -} -declare var HTMLCanvasElement: { - prototype: HTMLCanvasElement; - new(): HTMLCanvasElement; -} - -interface Window extends EventTarget, MSEventAttachmentTarget, WindowLocalStorage, MSWindowExtensions, WindowSessionStorage, WindowTimers, WindowBase64, IDBEnvironment, WindowConsole, GlobalEventHandlers { - ondragend: (ev: DragEvent) => any; - onkeydown: (ev: KeyboardEvent) => any; - ondragover: (ev: DragEvent) => any; - onkeyup: (ev: KeyboardEvent) => any; - onreset: (ev: Event) => any; - onmouseup: (ev: MouseEvent) => any; - ondragstart: (ev: DragEvent) => any; - ondrag: (ev: DragEvent) => any; - screenX: number; - onmouseover: (ev: MouseEvent) => any; - ondragleave: (ev: DragEvent) => any; - history: History; - pageXOffset: number; - name: string; - onafterprint: (ev: Event) => any; - onpause: (ev: Event) => any; - onbeforeprint: (ev: Event) => any; - top: Window; - onmousedown: (ev: MouseEvent) => any; - onseeked: (ev: Event) => any; - opener: Window; - onclick: (ev: MouseEvent) => any; - innerHeight: number; - onwaiting: (ev: Event) => any; - ononline: (ev: Event) => any; - ondurationchange: (ev: Event) => any; - frames: Window; - onblur: (ev: FocusEvent) => any; - onemptied: (ev: Event) => any; - onseeking: (ev: Event) => any; - oncanplay: (ev: Event) => any; - outerWidth: number; - onstalled: (ev: Event) => any; - onmousemove: (ev: MouseEvent) => any; - innerWidth: number; - onoffline: (ev: Event) => any; - length: number; - screen: Screen; - onbeforeunload: (ev: BeforeUnloadEvent) => any; - onratechange: (ev: Event) => any; - onstorage: (ev: StorageEvent) => any; - onloadstart: (ev: Event) => any; - ondragenter: (ev: DragEvent) => any; - onsubmit: (ev: Event) => any; - self: Window; - document: Document; - onprogress: (ev: ProgressEvent) => any; - ondblclick: (ev: MouseEvent) => any; - pageYOffset: number; - oncontextmenu: (ev: MouseEvent) => any; - onchange: (ev: Event) => any; - onloadedmetadata: (ev: Event) => any; - onplay: (ev: Event) => any; - onerror: ErrorEventHandler; - onplaying: (ev: Event) => any; - parent: Window; - location: Location; - oncanplaythrough: (ev: Event) => any; - onabort: (ev: UIEvent) => any; - onreadystatechange: (ev: Event) => any; - outerHeight: number; - onkeypress: (ev: KeyboardEvent) => any; - frameElement: Element; - onloadeddata: (ev: Event) => any; - onsuspend: (ev: Event) => any; - window: Window; - onfocus: (ev: FocusEvent) => any; - onmessage: (ev: MessageEvent) => any; - ontimeupdate: (ev: Event) => any; - onresize: (ev: UIEvent) => any; - onselect: (ev: UIEvent) => any; - navigator: Navigator; - styleMedia: StyleMedia; - ondrop: (ev: DragEvent) => any; - onmouseout: (ev: MouseEvent) => any; - onended: (ev: Event) => any; - onhashchange: (ev: Event) => any; - onunload: (ev: Event) => any; - onscroll: (ev: UIEvent) => any; - screenY: number; - onmousewheel: (ev: MouseWheelEvent) => any; - onload: (ev: Event) => any; - onvolumechange: (ev: Event) => any; - oninput: (ev: Event) => any; - performance: Performance; - onmspointerdown: (ev: any) => any; - animationStartTime: number; - onmsgesturedoubletap: (ev: any) => any; - onmspointerhover: (ev: any) => any; - onmsgesturehold: (ev: any) => any; - onmspointermove: (ev: any) => any; - onmsgesturechange: (ev: any) => any; - onmsgesturestart: (ev: any) => any; - onmspointercancel: (ev: any) => any; - onmsgestureend: (ev: any) => any; - onmsgesturetap: (ev: any) => any; - onmspointerout: (ev: any) => any; - msAnimationStartTime: number; - applicationCache: ApplicationCache; - onmsinertiastart: (ev: any) => any; - onmspointerover: (ev: any) => any; - onpopstate: (ev: PopStateEvent) => any; - onmspointerup: (ev: any) => any; - onpageshow: (ev: PageTransitionEvent) => any; - ondevicemotion: (ev: DeviceMotionEvent) => any; - devicePixelRatio: number; - msCrypto: Crypto; - ondeviceorientation: (ev: DeviceOrientationEvent) => any; - doNotTrack: string; - onmspointerenter: (ev: any) => any; - onpagehide: (ev: PageTransitionEvent) => any; - onmspointerleave: (ev: any) => any; - alert(message?: any): void; - scroll(x?: number, y?: number): void; - focus(): void; - scrollTo(x?: number, y?: number): void; - print(): void; - prompt(message?: string, _default?: string): string; - toString(): string; - open(url?: string, target?: string, features?: string, replace?: boolean): Window; - scrollBy(x?: number, y?: number): void; - confirm(message?: string): boolean; - close(): void; - postMessage(message: any, targetOrigin: string, ports?: any): void; - showModalDialog(url?: string, argument?: any, options?: any): any; - blur(): void; - getSelection(): Selection; - getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; - msCancelRequestAnimationFrame(handle: number): void; - matchMedia(mediaQuery: string): MediaQueryList; - cancelAnimationFrame(handle: number): void; - msIsStaticHTML(html: string): boolean; - msMatchMedia(mediaQuery: string): MediaQueryList; - requestAnimationFrame(callback: FrameRequestCallback): number; - msRequestAnimationFrame(callback: FrameRequestCallback): number; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "hashchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: "devicemotion", listener: (ev: DeviceMotionEvent) => any, useCapture?: boolean): void; - addEventListener(type: "deviceorientation", listener: (ev: DeviceOrientationEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var Window: { - prototype: Window; - new(): Window; -} - -interface HTMLCollection extends MSHTMLCollectionExtensions { - /** - * Sets or retrieves the number of objects in a collection. - */ - length: number; - /** - * Retrieves an object from various collections. - */ - item(nameOrIndex?: any, optionalIndex?: any): Element; - /** - * Retrieves a select object or an object from an options collection. - */ - namedItem(name: string): Element; - // [name: string]: Element; - [index: number]: Element; -} -declare var HTMLCollection: { - prototype: HTMLCollection; - new(): HTMLCollection; -} - -interface BlobPropertyBag { - type?: string; - endings?: string; -} - -interface Blob { - type: string; - size: number; - msDetachStream(): any; - slice(start?: number, end?: number, contentType?: string): Blob; - msClose(): void; -} -declare var Blob: { - prototype: Blob; - new (blobParts?: any[], options?: BlobPropertyBag): Blob; -} - -interface NavigatorID { - appVersion: string; - appName: string; - userAgent: string; - platform: string; - product: string; - vendor: string; -} - -interface HTMLTableElement extends HTMLElement, MSDataBindingTableExtensions, MSDataBindingExtensions, DOML2DeprecatedBackgroundStyle, DOML2DeprecatedBackgroundColorStyle { - /** - * Sets or retrieves the width of the object. - */ - width: string; - /** - * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. - */ - borderColorLight: any; - /** - * Sets or retrieves the amount of space between cells in a table. - */ - cellSpacing: string; - /** - * Retrieves the tFoot object of the table. - */ - tFoot: HTMLTableSectionElement; - /** - * Sets or retrieves the way the border frame around the table is displayed. - */ - frame: string; - /** - * Sets or retrieves the border color of the object. - */ - borderColor: any; - /** - * Sets or retrieves the number of horizontal rows contained in the object. - */ - rows: HTMLCollection; - /** - * Sets or retrieves which dividing lines (inner borders) are displayed. - */ - rules: string; - /** - * Sets or retrieves the number of columns in the table. - */ - cols: number; - /** - * Sets or retrieves a description and/or structure of the object. - */ - summary: string; - /** - * Retrieves the caption object of a table. - */ - caption: HTMLTableCaptionElement; - /** - * Retrieves a collection of all tBody objects in the table. Objects in this collection are in source order. - */ - tBodies: HTMLCollection; - /** - * Retrieves the tHead object of the table. - */ - tHead: HTMLTableSectionElement; - /** - * Sets or retrieves a value that indicates the table alignment. - */ - align: string; - /** - * Retrieves a collection of all cells in the table row or in the entire table. - */ - cells: HTMLCollection; - /** - * Sets or retrieves the height of the object. - */ - height: any; - /** - * Sets or retrieves the amount of space between the border of the cell and the content of the cell. - */ - cellPadding: string; - /** - * Sets or retrieves the width of the border to draw around the object. - */ - border: string; - /** - * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. - */ - borderColorDark: any; - /** - * Removes the specified row (tr) from the element and from the rows collection. - * @param index Number that specifies the zero-based position in the rows collection of the row to remove. - */ - deleteRow(index?: number): void; - /** - * Creates an empty tBody element in the table. - */ - createTBody(): HTMLElement; - /** - * Deletes the caption element and its contents from the table. - */ - deleteCaption(): void; - /** - * Creates a new row (tr) in the table, and adds the row to the rows collection. - * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection. - */ - insertRow(index?: number): HTMLElement; - /** - * Deletes the tFoot element and its contents from the table. - */ - deleteTFoot(): void; - /** - * Returns the tHead element object if successful, or null otherwise. - */ - createTHead(): HTMLElement; - /** - * Deletes the tHead element and its contents from the table. - */ - deleteTHead(): void; - /** - * Creates an empty caption element in the table. - */ - createCaption(): HTMLElement; - /** - * Moves a table row to a new position. - * @param indexFrom Number that specifies the index in the rows collection of the table row that is moved. - * @param indexTo Number that specifies where the row is moved within the rows collection. - */ - moveRow(indexFrom?: number, indexTo?: number): any; - /** - * Creates an empty tFoot element in the table. - */ - createTFoot(): HTMLElement; -} -declare var HTMLTableElement: { - prototype: HTMLTableElement; - new(): HTMLTableElement; -} - -interface TreeWalker { - whatToShow: number; - filter: NodeFilter; - root: Node; - currentNode: Node; - expandEntityReferences: boolean; - previousSibling(): Node; - lastChild(): Node; - nextSibling(): Node; - nextNode(): Node; - parentNode(): Node; - firstChild(): Node; - previousNode(): Node; -} -declare var TreeWalker: { - prototype: TreeWalker; - new(): TreeWalker; -} - -interface GetSVGDocument { - getSVGDocument(): Document; -} - -interface SVGPathSegCurvetoQuadraticRel extends SVGPathSeg { - y: number; - y1: number; - x: number; - x1: number; -} -declare var SVGPathSegCurvetoQuadraticRel: { - prototype: SVGPathSegCurvetoQuadraticRel; - new(): SVGPathSegCurvetoQuadraticRel; -} - -interface Performance { - navigation: PerformanceNavigation; - timing: PerformanceTiming; - getEntriesByType(entryType: string): any; - toJSON(): any; - getMeasures(measureName?: string): any; - clearMarks(markName?: string): void; - getMarks(markName?: string): any; - clearResourceTimings(): void; - mark(markName: string): void; - measure(measureName: string, startMarkName?: string, endMarkName?: string): void; - getEntriesByName(name: string, entryType?: string): any; - getEntries(): any; - clearMeasures(measureName?: string): void; - setResourceTimingBufferSize(maxSize: number): void; - now(): number; -} -declare var Performance: { - prototype: Performance; - new(): Performance; -} - -interface MSDataBindingTableExtensions { - dataPageSize: number; - nextPage(): void; - firstPage(): void; - refresh(): void; - previousPage(): void; - lastPage(): void; -} - -interface CompositionEvent extends UIEvent { - data: string; - locale: string; - initCompositionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, locale: string): void; -} -declare var CompositionEvent: { - prototype: CompositionEvent; - new(): CompositionEvent; -} - -interface WindowTimers extends WindowTimersExtension { - clearTimeout(handle: number): void; - setTimeout(handler: any, timeout?: any, ...args: any[]): number; - clearInterval(handle: number): void; - setInterval(handler: any, timeout?: any, ...args: any[]): number; -} - -interface SVGMarkerElement extends SVGElement, SVGStylable, SVGLangSpace, SVGFitToViewBox, SVGExternalResourcesRequired { - orientType: SVGAnimatedEnumeration; - markerUnits: SVGAnimatedEnumeration; - markerWidth: SVGAnimatedLength; - markerHeight: SVGAnimatedLength; - orientAngle: SVGAnimatedAngle; - refY: SVGAnimatedLength; - refX: SVGAnimatedLength; - setOrientToAngle(angle: SVGAngle): void; - setOrientToAuto(): void; - SVG_MARKER_ORIENT_UNKNOWN: number; - SVG_MARKER_ORIENT_ANGLE: number; - SVG_MARKERUNITS_UNKNOWN: number; - SVG_MARKERUNITS_STROKEWIDTH: number; - SVG_MARKER_ORIENT_AUTO: number; - SVG_MARKERUNITS_USERSPACEONUSE: number; -} -declare var SVGMarkerElement: { - prototype: SVGMarkerElement; - new(): SVGMarkerElement; - SVG_MARKER_ORIENT_UNKNOWN: number; - SVG_MARKER_ORIENT_ANGLE: number; - SVG_MARKERUNITS_UNKNOWN: number; - SVG_MARKERUNITS_STROKEWIDTH: number; - SVG_MARKER_ORIENT_AUTO: number; - SVG_MARKERUNITS_USERSPACEONUSE: number; -} - -interface CSSStyleDeclaration { - backgroundAttachment: string; - visibility: string; - textAlignLast: string; - borderRightStyle: string; - counterIncrement: string; - orphans: string; - cssText: string; - borderStyle: string; - pointerEvents: string; - borderTopColor: string; - markerEnd: string; - textIndent: string; - listStyleImage: string; - cursor: string; - listStylePosition: string; - wordWrap: string; - borderTopStyle: string; - alignmentBaseline: string; - opacity: string; - direction: string; - strokeMiterlimit: string; - maxWidth: string; - color: string; - clip: string; - borderRightWidth: string; - verticalAlign: string; - overflow: string; - mask: string; - borderLeftStyle: string; - emptyCells: string; - stopOpacity: string; - paddingRight: string; - parentRule: CSSRule; - background: string; - boxSizing: string; - textJustify: string; - height: string; - paddingTop: string; - length: number; - right: string; - baselineShift: string; - borderLeft: string; - widows: string; - lineHeight: string; - left: string; - textUnderlinePosition: string; - glyphOrientationHorizontal: string; - display: string; - textAnchor: string; - cssFloat: string; - strokeDasharray: string; - rubyAlign: string; - fontSizeAdjust: string; - borderLeftColor: string; - backgroundImage: string; - listStyleType: string; - strokeWidth: string; - textOverflow: string; - fillRule: string; - borderBottomColor: string; - zIndex: string; - position: string; - listStyle: string; - msTransformOrigin: string; - dominantBaseline: string; - overflowY: string; - fill: string; - captionSide: string; - borderCollapse: string; - boxShadow: string; - quotes: string; - tableLayout: string; - unicodeBidi: string; - borderBottomWidth: string; - backgroundSize: string; - textDecoration: string; - strokeDashoffset: string; - fontSize: string; - border: string; - pageBreakBefore: string; - borderTopRightRadius: string; - msTransform: string; - borderBottomLeftRadius: string; - textTransform: string; - rubyPosition: string; - strokeLinejoin: string; - clipPath: string; - borderRightColor: string; - fontFamily: string; - clear: string; - content: string; - backgroundClip: string; - marginBottom: string; - counterReset: string; - outlineWidth: string; - marginRight: string; - paddingLeft: string; - borderBottom: string; - wordBreak: string; - marginTop: string; - top: string; - fontWeight: string; - borderRight: string; - width: string; - kerning: string; - pageBreakAfter: string; - borderBottomStyle: string; - fontStretch: string; - padding: string; - strokeOpacity: string; - markerStart: string; - bottom: string; - borderLeftWidth: string; - clipRule: string; - backgroundPosition: string; - backgroundColor: string; - pageBreakInside: string; - backgroundOrigin: string; - strokeLinecap: string; - borderTopWidth: string; - outlineStyle: string; - borderTop: string; - outlineColor: string; - paddingBottom: string; - marginLeft: string; - font: string; - outline: string; - wordSpacing: string; - maxHeight: string; - fillOpacity: string; - letterSpacing: string; - borderSpacing: string; - backgroundRepeat: string; - borderRadius: string; - borderWidth: string; - borderBottomRightRadius: string; - whiteSpace: string; - fontStyle: string; - minWidth: string; - stopColor: string; - borderTopLeftRadius: string; - borderColor: string; - marker: string; - glyphOrientationVertical: string; - markerMid: string; - fontVariant: string; - minHeight: string; - stroke: string; - rubyOverhang: string; - overflowX: string; - textAlign: string; - margin: string; - animationFillMode: string; - floodColor: string; - animationIterationCount: string; - textShadow: string; - backfaceVisibility: string; - msAnimationIterationCount: string; - animationDelay: string; - animationTimingFunction: string; - columnWidth: any; - msScrollSnapX: string; - columnRuleColor: any; - columnRuleWidth: any; - transitionDelay: string; - transition: string; - msFlowFrom: string; - msScrollSnapType: string; - msContentZoomSnapType: string; - msGridColumns: string; - msAnimationName: string; - msGridRowAlign: string; - msContentZoomChaining: string; - msGridColumn: any; - msHyphenateLimitZone: any; - msScrollRails: string; - msAnimationDelay: string; - enableBackground: string; - msWrapThrough: string; - columnRuleStyle: string; - msAnimation: string; - msFlexFlow: string; - msScrollSnapY: string; - msHyphenateLimitLines: any; - msTouchAction: string; - msScrollLimit: string; - animation: string; - transform: string; - filter: string; - colorInterpolationFilters: string; - transitionTimingFunction: string; - msBackfaceVisibility: string; - animationPlayState: string; - transformOrigin: string; - msScrollLimitYMin: any; - msFontFeatureSettings: string; - msContentZoomLimitMin: any; - columnGap: any; - transitionProperty: string; - msAnimationDuration: string; - msAnimationFillMode: string; - msFlexDirection: string; - msTransitionDuration: string; - fontFeatureSettings: string; - breakBefore: string; - msFlexWrap: string; - perspective: string; - msFlowInto: string; - msTransformStyle: string; - msScrollTranslation: string; - msTransitionProperty: string; - msUserSelect: string; - msOverflowStyle: string; - msScrollSnapPointsY: string; - animationDirection: string; - animationDuration: string; - msFlex: string; - msTransitionTimingFunction: string; - animationName: string; - columnRule: string; - msGridColumnSpan: any; - msFlexNegative: string; - columnFill: string; - msGridRow: any; - msFlexOrder: string; - msFlexItemAlign: string; - msFlexPositive: string; - msContentZoomLimitMax: any; - msScrollLimitYMax: any; - msGridColumnAlign: string; - perspectiveOrigin: string; - lightingColor: string; - columns: string; - msScrollChaining: string; - msHyphenateLimitChars: string; - msTouchSelect: string; - floodOpacity: string; - msAnimationDirection: string; - msAnimationPlayState: string; - columnSpan: string; - msContentZooming: string; - msPerspective: string; - msFlexPack: string; - msScrollSnapPointsX: string; - msContentZoomSnapPoints: string; - msGridRowSpan: any; - msContentZoomSnap: string; - msScrollLimitXMin: any; - breakInside: string; - msHighContrastAdjust: string; - msFlexLinePack: string; - msGridRows: string; - transitionDuration: string; - msHyphens: string; - breakAfter: string; - msTransition: string; - msPerspectiveOrigin: string; - msContentZoomLimit: string; - msScrollLimitXMax: any; - msFlexAlign: string; - msWrapMargin: any; - columnCount: any; - msAnimationTimingFunction: string; - msTransitionDelay: string; - transformStyle: string; - msWrapFlow: string; - msFlexPreferredSize: string; - alignItems: string; - borderImageSource: string; - flexBasis: string; - borderImageWidth: string; - borderImageRepeat: string; - order: string; - flex: string; - alignContent: string; - msImeAlign: string; - flexShrink: string; - flexGrow: string; - borderImageSlice: string; - flexWrap: string; - borderImageOutset: string; - flexDirection: string; - touchAction: string; - flexFlow: string; - borderImage: string; - justifyContent: string; - alignSelf: string; - msTextCombineHorizontal: string; - getPropertyPriority(propertyName: string): string; - getPropertyValue(propertyName: string): string; - removeProperty(propertyName: string): string; - item(index: number): string; - [index: number]: string; - setProperty(propertyName: string, value: string, priority?: string): void; -} -declare var CSSStyleDeclaration: { - prototype: CSSStyleDeclaration; - new(): CSSStyleDeclaration; -} - -interface SVGGElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { -} -declare var SVGGElement: { - prototype: SVGGElement; - new(): SVGGElement; -} - -interface MSStyleCSSProperties extends MSCSSProperties { - pixelWidth: number; - posHeight: number; - posLeft: number; - pixelTop: number; - pixelBottom: number; - textDecorationNone: boolean; - pixelLeft: number; - posTop: number; - posBottom: number; - textDecorationOverline: boolean; - posWidth: number; - textDecorationLineThrough: boolean; - pixelHeight: number; - textDecorationBlink: boolean; - posRight: number; - pixelRight: number; - textDecorationUnderline: boolean; -} -declare var MSStyleCSSProperties: { - prototype: MSStyleCSSProperties; - new(): MSStyleCSSProperties; -} - -interface Navigator extends NavigatorID, NavigatorOnLine, NavigatorContentUtils, MSNavigatorExtensions, NavigatorGeolocation, MSNavigatorDoNotTrack, NavigatorStorageUtils, MSFileSaver { - msMaxTouchPoints: number; - msPointerEnabled: boolean; - msManipulationViewsEnabled: boolean; - pointerEnabled: boolean; - maxTouchPoints: number; - msLaunchUri(uri: string, successCallback?: MSLaunchUriCallback, noHandlerCallback?: MSLaunchUriCallback): void; -} -declare var Navigator: { - prototype: Navigator; - new(): Navigator; -} - -interface SVGPathSegCurvetoCubicSmoothAbs extends SVGPathSeg { - y: number; - x2: number; - x: number; - y2: number; -} -declare var SVGPathSegCurvetoCubicSmoothAbs: { - prototype: SVGPathSegCurvetoCubicSmoothAbs; - new(): SVGPathSegCurvetoCubicSmoothAbs; -} - -interface SVGZoomEvent extends UIEvent { - zoomRectScreen: SVGRect; - previousScale: number; - newScale: number; - previousTranslate: SVGPoint; - newTranslate: SVGPoint; -} -declare var SVGZoomEvent: { - prototype: SVGZoomEvent; - new(): SVGZoomEvent; -} - -interface NodeSelector { - querySelectorAll(selectors: string): NodeList; - querySelector(selectors: string): Element; -} - -interface HTMLTableDataCellElement extends HTMLTableCellElement { -} -declare var HTMLTableDataCellElement: { - prototype: HTMLTableDataCellElement; - new(): HTMLTableDataCellElement; -} - -interface HTMLBaseElement extends HTMLElement { - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; - /** - * Gets or sets the baseline URL on which relative links are based. - */ - href: string; -} -declare var HTMLBaseElement: { - prototype: HTMLBaseElement; - new(): HTMLBaseElement; -} - -interface ClientRect { - left: number; - width: number; - right: number; - top: number; - bottom: number; - height: number; -} -declare var ClientRect: { - prototype: ClientRect; - new(): ClientRect; -} - -interface PositionErrorCallback { - (error: PositionError): void; -} - -interface DOMImplementation { - createDocumentType(qualifiedName: string, publicId: string, systemId: string): DocumentType; - createDocument(namespaceURI: string, qualifiedName: string, doctype: DocumentType): Document; - hasFeature(feature: string, version?: string): boolean; - createHTMLDocument(title: string): Document; -} -declare var DOMImplementation: { - prototype: DOMImplementation; - new(): DOMImplementation; -} - -interface SVGUnitTypes { - SVG_UNIT_TYPE_UNKNOWN: number; - SVG_UNIT_TYPE_OBJECTBOUNDINGBOX: number; - SVG_UNIT_TYPE_USERSPACEONUSE: number; -} -declare var SVGUnitTypes: SVGUnitTypes; - -interface Element extends Node, NodeSelector, ElementTraversal, GlobalEventHandlers { - scrollTop: number; - clientLeft: number; - scrollLeft: number; - tagName: string; - clientWidth: number; - scrollWidth: number; - clientHeight: number; - clientTop: number; - scrollHeight: number; - msRegionOverflow: string; - onmspointerdown: (ev: any) => any; - onmsgotpointercapture: (ev: any) => any; - onmsgesturedoubletap: (ev: any) => any; - onmspointerhover: (ev: any) => any; - onmsgesturehold: (ev: any) => any; - onmspointermove: (ev: any) => any; - onmsgesturechange: (ev: any) => any; - onmsgesturestart: (ev: any) => any; - onmspointercancel: (ev: any) => any; - onmsgestureend: (ev: any) => any; - onmsgesturetap: (ev: any) => any; - onmspointerout: (ev: any) => any; - onmsinertiastart: (ev: any) => any; - onmslostpointercapture: (ev: any) => any; - onmspointerover: (ev: any) => any; - msContentZoomFactor: number; - onmspointerup: (ev: any) => any; - onlostpointercapture: (ev: PointerEvent) => any; - onmspointerenter: (ev: any) => any; - ongotpointercapture: (ev: PointerEvent) => any; - onmspointerleave: (ev: any) => any; - getAttribute(name?: string): string; - getElementsByTagNameNS(namespaceURI: string, localName: string): NodeList; - hasAttributeNS(namespaceURI: string, localName: string): boolean; - getBoundingClientRect(): ClientRect; - getAttributeNS(namespaceURI: string, localName: string): string; - getAttributeNodeNS(namespaceURI: string, localName: string): Attr; - setAttributeNodeNS(newAttr: Attr): Attr; - msMatchesSelector(selectors: string): boolean; - hasAttribute(name: string): boolean; - removeAttribute(name?: string): void; - setAttributeNS(namespaceURI: string, qualifiedName: string, value: string): void; - getAttributeNode(name: string): Attr; - fireEvent(eventName: string, eventObj?: any): boolean; - getElementsByTagName(name: "a"): NodeListOf; - getElementsByTagName(name: "abbr"): NodeListOf; - getElementsByTagName(name: "acronym"): NodeListOf; - getElementsByTagName(name: "address"): NodeListOf; - getElementsByTagName(name: "applet"): NodeListOf; - getElementsByTagName(name: "area"): NodeListOf; - getElementsByTagName(name: "article"): NodeListOf; - getElementsByTagName(name: "aside"): NodeListOf; - getElementsByTagName(name: "audio"): NodeListOf; - getElementsByTagName(name: "b"): NodeListOf; - getElementsByTagName(name: "base"): NodeListOf; - getElementsByTagName(name: "basefont"): NodeListOf; - getElementsByTagName(name: "bdo"): NodeListOf; - getElementsByTagName(name: "bgsound"): NodeListOf; - getElementsByTagName(name: "big"): NodeListOf; - getElementsByTagName(name: "blockquote"): NodeListOf; - getElementsByTagName(name: "body"): NodeListOf; - getElementsByTagName(name: "br"): NodeListOf; - getElementsByTagName(name: "button"): NodeListOf; - getElementsByTagName(name: "canvas"): NodeListOf; - getElementsByTagName(name: "caption"): NodeListOf; - getElementsByTagName(name: "center"): NodeListOf; - getElementsByTagName(name: "cite"): NodeListOf; - getElementsByTagName(name: "code"): NodeListOf; - getElementsByTagName(name: "col"): NodeListOf; - getElementsByTagName(name: "colgroup"): NodeListOf; - getElementsByTagName(name: "datalist"): NodeListOf; - getElementsByTagName(name: "dd"): NodeListOf; - getElementsByTagName(name: "del"): NodeListOf; - getElementsByTagName(name: "dfn"): NodeListOf; - getElementsByTagName(name: "dir"): NodeListOf; - getElementsByTagName(name: "div"): NodeListOf; - getElementsByTagName(name: "dl"): NodeListOf; - getElementsByTagName(name: "dt"): NodeListOf; - getElementsByTagName(name: "em"): NodeListOf; - getElementsByTagName(name: "embed"): NodeListOf; - getElementsByTagName(name: "fieldset"): NodeListOf; - getElementsByTagName(name: "figcaption"): NodeListOf; - getElementsByTagName(name: "figure"): NodeListOf; - getElementsByTagName(name: "font"): NodeListOf; - getElementsByTagName(name: "footer"): NodeListOf; - getElementsByTagName(name: "form"): NodeListOf; - getElementsByTagName(name: "frame"): NodeListOf; - getElementsByTagName(name: "frameset"): NodeListOf; - getElementsByTagName(name: "h1"): NodeListOf; - getElementsByTagName(name: "h2"): NodeListOf; - getElementsByTagName(name: "h3"): NodeListOf; - getElementsByTagName(name: "h4"): NodeListOf; - getElementsByTagName(name: "h5"): NodeListOf; - getElementsByTagName(name: "h6"): NodeListOf; - getElementsByTagName(name: "head"): NodeListOf; - getElementsByTagName(name: "header"): NodeListOf; - getElementsByTagName(name: "hgroup"): NodeListOf; - getElementsByTagName(name: "hr"): NodeListOf; - getElementsByTagName(name: "html"): NodeListOf; - getElementsByTagName(name: "i"): NodeListOf; - getElementsByTagName(name: "iframe"): NodeListOf; - getElementsByTagName(name: "img"): NodeListOf; - getElementsByTagName(name: "input"): NodeListOf; - getElementsByTagName(name: "ins"): NodeListOf; - getElementsByTagName(name: "isindex"): NodeListOf; - getElementsByTagName(name: "kbd"): NodeListOf; - getElementsByTagName(name: "keygen"): NodeListOf; - getElementsByTagName(name: "label"): NodeListOf; - getElementsByTagName(name: "legend"): NodeListOf; - getElementsByTagName(name: "li"): NodeListOf; - getElementsByTagName(name: "link"): NodeListOf; - getElementsByTagName(name: "listing"): NodeListOf; - getElementsByTagName(name: "map"): NodeListOf; - getElementsByTagName(name: "mark"): NodeListOf; - getElementsByTagName(name: "marquee"): NodeListOf; - getElementsByTagName(name: "menu"): NodeListOf; - getElementsByTagName(name: "meta"): NodeListOf; - getElementsByTagName(name: "nav"): NodeListOf; - getElementsByTagName(name: "nextid"): NodeListOf; - getElementsByTagName(name: "nobr"): NodeListOf; - getElementsByTagName(name: "noframes"): NodeListOf; - getElementsByTagName(name: "noscript"): NodeListOf; - getElementsByTagName(name: "object"): NodeListOf; - getElementsByTagName(name: "ol"): NodeListOf; - getElementsByTagName(name: "optgroup"): NodeListOf; - getElementsByTagName(name: "option"): NodeListOf; - getElementsByTagName(name: "p"): NodeListOf; - getElementsByTagName(name: "param"): NodeListOf; - getElementsByTagName(name: "plaintext"): NodeListOf; - getElementsByTagName(name: "pre"): NodeListOf; - getElementsByTagName(name: "progress"): NodeListOf; - getElementsByTagName(name: "q"): NodeListOf; - getElementsByTagName(name: "rt"): NodeListOf; - getElementsByTagName(name: "ruby"): NodeListOf; - getElementsByTagName(name: "s"): NodeListOf; - getElementsByTagName(name: "samp"): NodeListOf; - getElementsByTagName(name: "script"): NodeListOf; - getElementsByTagName(name: "section"): NodeListOf; - getElementsByTagName(name: "select"): NodeListOf; - getElementsByTagName(name: "small"): NodeListOf; - getElementsByTagName(name: "SOURCE"): NodeListOf; - getElementsByTagName(name: "span"): NodeListOf; - getElementsByTagName(name: "strike"): NodeListOf; - getElementsByTagName(name: "strong"): NodeListOf; - getElementsByTagName(name: "style"): NodeListOf; - getElementsByTagName(name: "sub"): NodeListOf; - getElementsByTagName(name: "sup"): NodeListOf; - getElementsByTagName(name: "table"): NodeListOf; - getElementsByTagName(name: "tbody"): NodeListOf; - getElementsByTagName(name: "td"): NodeListOf; - getElementsByTagName(name: "textarea"): NodeListOf; - getElementsByTagName(name: "tfoot"): NodeListOf; - getElementsByTagName(name: "th"): NodeListOf; - getElementsByTagName(name: "thead"): NodeListOf; - getElementsByTagName(name: "title"): NodeListOf; - getElementsByTagName(name: "tr"): NodeListOf; - getElementsByTagName(name: "track"): NodeListOf; - getElementsByTagName(name: "tt"): NodeListOf; - getElementsByTagName(name: "u"): NodeListOf; - getElementsByTagName(name: "ul"): NodeListOf; - getElementsByTagName(name: "var"): NodeListOf; - getElementsByTagName(name: "video"): NodeListOf; - getElementsByTagName(name: "wbr"): NodeListOf; - getElementsByTagName(name: "x-ms-webview"): NodeListOf; - getElementsByTagName(name: "xmp"): NodeListOf; - getElementsByTagName(name: string): NodeList; - getClientRects(): ClientRectList; - setAttributeNode(newAttr: Attr): Attr; - removeAttributeNode(oldAttr: Attr): Attr; - setAttribute(name?: string, value?: string): void; - removeAttributeNS(namespaceURI: string, localName: string): void; - msGetRegionContent(): MSRangeCollection; - msReleasePointerCapture(pointerId: number): void; - msSetPointerCapture(pointerId: number): void; - msZoomTo(args: MsZoomToOptions): void; - setPointerCapture(pointerId: number): void; - msGetUntransformedBounds(): ClientRect; - releasePointerCapture(pointerId: number): void; - msRequestFullscreen(): void; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var Element: { - prototype: Element; - new(): Element; -} - -interface HTMLNextIdElement extends HTMLElement { - n: string; -} -declare var HTMLNextIdElement: { - prototype: HTMLNextIdElement; - new(): HTMLNextIdElement; -} - -interface SVGPathSegMovetoRel extends SVGPathSeg { - y: number; - x: number; -} -declare var SVGPathSegMovetoRel: { - prototype: SVGPathSegMovetoRel; - new(): SVGPathSegMovetoRel; -} - -interface SVGLineElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { - y1: SVGAnimatedLength; - x2: SVGAnimatedLength; - x1: SVGAnimatedLength; - y2: SVGAnimatedLength; -} -declare var SVGLineElement: { - prototype: SVGLineElement; - new(): SVGLineElement; -} - -interface HTMLParagraphElement extends HTMLElement, DOML2DeprecatedTextFlowControl { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; -} -declare var HTMLParagraphElement: { - prototype: HTMLParagraphElement; - new(): HTMLParagraphElement; -} - -interface HTMLAreasCollection extends HTMLCollection { - /** - * Removes an element from the collection. - */ - remove(index?: number): void; - /** - * Adds an element to the areas, controlRange, or options collection. - */ - add(element: HTMLElement, before?: any): void; -} -declare var HTMLAreasCollection: { - prototype: HTMLAreasCollection; - new(): HTMLAreasCollection; -} - -interface SVGDescElement extends SVGElement, SVGStylable, SVGLangSpace { -} -declare var SVGDescElement: { - prototype: SVGDescElement; - new(): SVGDescElement; -} - -interface Node extends EventTarget { - nodeType: number; - previousSibling: Node; - localName: string; - namespaceURI: string; - textContent: string; - parentNode: Node; - nextSibling: Node; - nodeValue: string; - lastChild: Node; - childNodes: NodeList; - nodeName: string; - ownerDocument: Document; - attributes: NamedNodeMap; - firstChild: Node; - prefix: string; - removeChild(oldChild: Node): Node; - appendChild(newChild: Node): Node; - isSupported(feature: string, version: string): boolean; - isEqualNode(arg: Node): boolean; - lookupPrefix(namespaceURI: string): string; - isDefaultNamespace(namespaceURI: string): boolean; - compareDocumentPosition(other: Node): number; - normalize(): void; - isSameNode(other: Node): boolean; - hasAttributes(): boolean; - lookupNamespaceURI(prefix: string): string; - cloneNode(deep?: boolean): Node; - hasChildNodes(): boolean; - replaceChild(newChild: Node, oldChild: Node): Node; - insertBefore(newChild: Node, refChild?: Node): Node; - ENTITY_REFERENCE_NODE: number; - ATTRIBUTE_NODE: number; - DOCUMENT_FRAGMENT_NODE: number; - TEXT_NODE: number; - ELEMENT_NODE: number; - COMMENT_NODE: number; - DOCUMENT_POSITION_DISCONNECTED: number; - DOCUMENT_POSITION_CONTAINED_BY: number; - DOCUMENT_POSITION_CONTAINS: number; - DOCUMENT_TYPE_NODE: number; - DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number; - DOCUMENT_NODE: number; - ENTITY_NODE: number; - PROCESSING_INSTRUCTION_NODE: number; - CDATA_SECTION_NODE: number; - NOTATION_NODE: number; - DOCUMENT_POSITION_FOLLOWING: number; - DOCUMENT_POSITION_PRECEDING: number; -} -declare var Node: { - prototype: Node; - new(): Node; - ENTITY_REFERENCE_NODE: number; - ATTRIBUTE_NODE: number; - DOCUMENT_FRAGMENT_NODE: number; - TEXT_NODE: number; - ELEMENT_NODE: number; - COMMENT_NODE: number; - DOCUMENT_POSITION_DISCONNECTED: number; - DOCUMENT_POSITION_CONTAINED_BY: number; - DOCUMENT_POSITION_CONTAINS: number; - DOCUMENT_TYPE_NODE: number; - DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number; - DOCUMENT_NODE: number; - ENTITY_NODE: number; - PROCESSING_INSTRUCTION_NODE: number; - CDATA_SECTION_NODE: number; - NOTATION_NODE: number; - DOCUMENT_POSITION_FOLLOWING: number; - DOCUMENT_POSITION_PRECEDING: number; -} - -interface SVGPathSegCurvetoQuadraticSmoothRel extends SVGPathSeg { - y: number; - x: number; -} -declare var SVGPathSegCurvetoQuadraticSmoothRel: { - prototype: SVGPathSegCurvetoQuadraticSmoothRel; - new(): SVGPathSegCurvetoQuadraticSmoothRel; -} - -interface DOML2DeprecatedListSpaceReduction { - compact: boolean; -} - -interface MSScriptHost { -} -declare var MSScriptHost: { - prototype: MSScriptHost; - new(): MSScriptHost; -} - -interface SVGClipPathElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { - clipPathUnits: SVGAnimatedEnumeration; -} -declare var SVGClipPathElement: { - prototype: SVGClipPathElement; - new(): SVGClipPathElement; -} - -interface MouseEvent extends UIEvent { - toElement: Element; - layerY: number; - fromElement: Element; - which: number; - pageX: number; - offsetY: number; - x: number; - y: number; - metaKey: boolean; - altKey: boolean; - ctrlKey: boolean; - offsetX: number; - screenX: number; - clientY: number; - shiftKey: boolean; - layerX: number; - screenY: number; - relatedTarget: EventTarget; - button: number; - pageY: number; - buttons: number; - clientX: number; - initMouseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget): void; - getModifierState(keyArg: string): boolean; -} -declare var MouseEvent: { - prototype: MouseEvent; - new(): MouseEvent; -} - -interface RangeException { - code: number; - message: string; - name: string; - toString(): string; - INVALID_NODE_TYPE_ERR: number; - BAD_BOUNDARYPOINTS_ERR: number; -} -declare var RangeException: { - prototype: RangeException; - new(): RangeException; - INVALID_NODE_TYPE_ERR: number; - BAD_BOUNDARYPOINTS_ERR: number; -} - -interface SVGTextPositioningElement extends SVGTextContentElement { - y: SVGAnimatedLengthList; - rotate: SVGAnimatedNumberList; - dy: SVGAnimatedLengthList; - x: SVGAnimatedLengthList; - dx: SVGAnimatedLengthList; -} -declare var SVGTextPositioningElement: { - prototype: SVGTextPositioningElement; - new(): SVGTextPositioningElement; -} - -interface HTMLAppletElement extends HTMLElement, DOML2DeprecatedMarginStyle, DOML2DeprecatedBorderStyle, DOML2DeprecatedAlignmentStyle, MSDataBindingExtensions, MSDataBindingRecordSetExtensions { - width: number; - /** - * Sets or retrieves the Internet media type for the code associated with the object. - */ - codeType: string; - object: string; - form: HTMLFormElement; - code: string; - /** - * Sets or retrieves a character string that can be used to implement your own archive functionality for the object. - */ - archive: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Sets or retrieves a message to be displayed while an object is loading. - */ - standby: string; - /** - * Sets or retrieves the class identifier for the object. - */ - classid: string; - /** - * Sets or retrieves the shape of the object. - */ - name: string; - /** - * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. - */ - useMap: string; - /** - * Sets or retrieves the URL that references the data of the object. - */ - data: string; - /** - * Sets or retrieves the height of the object. - */ - height: string; - /** - * Gets or sets the optional alternative HTML script to execute if the object fails to load. - */ - altHtml: string; - /** - * Address of a pointer to the document this page or frame contains. If there is no document, then null will be returned. - */ - contentDocument: Document; - /** - * Sets or retrieves the URL of the component. - */ - codeBase: string; - /** - * Sets or retrieves a character string that can be used to implement your own declare functionality for the object. - */ - declare: boolean; - /** - * Returns the content type of the object. - */ - type: string; - /** - * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element. - */ - BaseHref: string; -} -declare var HTMLAppletElement: { - prototype: HTMLAppletElement; - new(): HTMLAppletElement; -} - -interface TextMetrics { - width: number; -} -declare var TextMetrics: { - prototype: TextMetrics; - new(): TextMetrics; -} - -interface DocumentEvent { - createEvent(eventInterface: "AnimationEvent"): AnimationEvent; - createEvent(eventInterface: "CloseEvent"): CloseEvent; - createEvent(eventInterface: "CompositionEvent"): CompositionEvent; - createEvent(eventInterface: "CustomEvent"): CustomEvent; - createEvent(eventInterface: "DeviceMotionEvent"): DeviceMotionEvent; - createEvent(eventInterface: "DeviceOrientationEvent"): DeviceOrientationEvent; - createEvent(eventInterface: "DragEvent"): DragEvent; - createEvent(eventInterface: "ErrorEvent"): ErrorEvent; - createEvent(eventInterface: "Event"): Event; - createEvent(eventInterface: "Events"): Event; - createEvent(eventInterface: "FocusEvent"): FocusEvent; - createEvent(eventInterface: "HTMLEvents"): Event; - createEvent(eventInterface: "IDBVersionChangeEvent"): IDBVersionChangeEvent; - createEvent(eventInterface: "KeyboardEvent"): KeyboardEvent; - createEvent(eventInterface: "LongRunningScriptDetectedEvent"): LongRunningScriptDetectedEvent; - createEvent(eventInterface: "MessageEvent"): MessageEvent; - createEvent(eventInterface: "MouseEvent"): MouseEvent; - createEvent(eventInterface: "MouseEvents"): MouseEvent; - createEvent(eventInterface: "MouseWheelEvent"): MouseWheelEvent; - createEvent(eventInterface: "MSGestureEvent"): MSGestureEvent; - createEvent(eventInterface: "MSPointerEvent"): MSPointerEvent; - createEvent(eventInterface: "MutationEvent"): MutationEvent; - createEvent(eventInterface: "MutationEvents"): MutationEvent; - createEvent(eventInterface: "NavigationCompletedEvent"): NavigationCompletedEvent; - createEvent(eventInterface: "NavigationEvent"): NavigationEvent; - createEvent(eventInterface: "PageTransitionEvent"): PageTransitionEvent; - createEvent(eventInterface: "PointerEvent"): MSPointerEvent; - createEvent(eventInterface: "PopStateEvent"): PopStateEvent; - createEvent(eventInterface: "ProgressEvent"): ProgressEvent; - createEvent(eventInterface: "StorageEvent"): StorageEvent; - createEvent(eventInterface: "SVGZoomEvents"): SVGZoomEvent; - createEvent(eventInterface: "TextEvent"): TextEvent; - createEvent(eventInterface: "TrackEvent"): TrackEvent; - createEvent(eventInterface: "TransitionEvent"): TransitionEvent; - createEvent(eventInterface: "UIEvent"): UIEvent; - createEvent(eventInterface: "UIEvents"): UIEvent; - createEvent(eventInterface: "UnviewableContentIdentifiedEvent"): UnviewableContentIdentifiedEvent; - createEvent(eventInterface: "WebGLContextEvent"): WebGLContextEvent; - createEvent(eventInterface: "WheelEvent"): WheelEvent; - createEvent(eventInterface: string): Event; -} - -interface HTMLOListElement extends HTMLElement, DOML2DeprecatedListSpaceReduction, DOML2DeprecatedListNumberingAndBulletStyle { - /** - * The starting number. - */ - start: number; -} -declare var HTMLOListElement: { - prototype: HTMLOListElement; - new(): HTMLOListElement; -} - -interface SVGPathSegLinetoVerticalRel extends SVGPathSeg { - y: number; -} -declare var SVGPathSegLinetoVerticalRel: { - prototype: SVGPathSegLinetoVerticalRel; - new(): SVGPathSegLinetoVerticalRel; -} - -interface SVGAnimatedString { - animVal: string; - baseVal: string; -} -declare var SVGAnimatedString: { - prototype: SVGAnimatedString; - new(): SVGAnimatedString; -} - -interface CDATASection extends Text { -} -declare var CDATASection: { - prototype: CDATASection; - new(): CDATASection; -} - -interface StyleMedia { - type: string; - matchMedium(mediaquery: string): boolean; -} -declare var StyleMedia: { - prototype: StyleMedia; - new(): StyleMedia; -} - -interface HTMLSelectElement extends HTMLElement, MSHTMLCollectionExtensions, MSDataBindingExtensions { - options: HTMLSelectElement; - /** - * Sets or retrieves the value which is returned to the server when the form control is submitted. - */ - value: string; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Sets or retrieves the number of rows in the list box. - */ - size: number; - /** - * Sets or retrieves the number of objects in a collection. - */ - length: number; - /** - * Sets or retrieves the index of the selected option in a select object. - */ - selectedIndex: number; - /** - * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list. - */ - multiple: boolean; - /** - * Retrieves the type of select control based on the value of the MULTIPLE attribute. - */ - type: string; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - validationMessage: string; - /** - * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. - */ - autofocus: boolean; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - validity: ValidityState; - /** - * When present, marks an element that can't be submitted without a value. - */ - required: boolean; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - willValidate: boolean; - /** - * Removes an element from the collection. - * @param index Number that specifies the zero-based index of the element to remove from the collection. - */ - remove(index?: number): void; - /** - * Adds an element to the areas, controlRange, or options collection. - * @param element Variant of type Number that specifies the index position in the collection where the element is placed. If no value is given, the method places the element at the end of the collection. - * @param before Variant of type Object that specifies an element to insert before, or null to append the object to the collection. - */ - add(element: HTMLElement, before?: any): void; - /** - * Retrieves a select object or an object from an options collection. - * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is an integer, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made. - * @param index Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned. - */ - item(name?: any, index?: any): any; - /** - * Retrieves a select object or an object from an options collection. - * @param namedItem A String that specifies the name or id property of the object to retrieve. A collection is returned if more than one match is made. - */ - namedItem(name: string): any; - [name: string]: any; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; -} -declare var HTMLSelectElement: { - prototype: HTMLSelectElement; - new(): HTMLSelectElement; -} - -interface TextRange { - boundingLeft: number; - htmlText: string; - offsetLeft: number; - boundingWidth: number; - boundingHeight: number; - boundingTop: number; - text: string; - offsetTop: number; - moveToPoint(x: number, y: number): void; - queryCommandValue(cmdID: string): any; - getBookmark(): string; - move(unit: string, count?: number): number; - queryCommandIndeterm(cmdID: string): boolean; - scrollIntoView(fStart?: boolean): void; - findText(string: string, count?: number, flags?: number): boolean; - execCommand(cmdID: string, showUI?: boolean, value?: any): boolean; - getBoundingClientRect(): ClientRect; - moveToBookmark(bookmark: string): boolean; - isEqual(range: TextRange): boolean; - duplicate(): TextRange; - collapse(start?: boolean): void; - queryCommandText(cmdID: string): string; - select(): void; - pasteHTML(html: string): void; - inRange(range: TextRange): boolean; - moveEnd(unit: string, count?: number): number; - getClientRects(): ClientRectList; - moveStart(unit: string, count?: number): number; - parentElement(): Element; - queryCommandState(cmdID: string): boolean; - compareEndPoints(how: string, sourceRange: TextRange): number; - execCommandShowHelp(cmdID: string): boolean; - moveToElementText(element: Element): void; - expand(Unit: string): boolean; - queryCommandSupported(cmdID: string): boolean; - setEndPoint(how: string, SourceRange: TextRange): void; - queryCommandEnabled(cmdID: string): boolean; -} -declare var TextRange: { - prototype: TextRange; - new(): TextRange; -} - -interface SVGTests { - requiredFeatures: SVGStringList; - requiredExtensions: SVGStringList; - systemLanguage: SVGStringList; - hasExtension(extension: string): boolean; -} - -interface HTMLBlockElement extends HTMLElement, DOML2DeprecatedTextFlowControl { - /** - * Sets or retrieves the width of the object. - */ - width: number; - /** - * Sets or retrieves reference information about the object. - */ - cite: string; -} -declare var HTMLBlockElement: { - prototype: HTMLBlockElement; - new(): HTMLBlockElement; -} - -interface CSSStyleSheet extends StyleSheet { - owningElement: Element; - imports: StyleSheetList; - isAlternate: boolean; - rules: MSCSSRuleList; - isPrefAlternate: boolean; - readOnly: boolean; - cssText: string; - ownerRule: CSSRule; - href: string; - cssRules: CSSRuleList; - id: string; - pages: StyleSheetPageList; - addImport(bstrURL: string, lIndex?: number): number; - addPageRule(bstrSelector: string, bstrStyle: string, lIndex?: number): number; - insertRule(rule: string, index?: number): number; - removeRule(lIndex: number): void; - deleteRule(index?: number): void; - addRule(bstrSelector: string, bstrStyle?: string, lIndex?: number): number; - removeImport(lIndex: number): void; -} -declare var CSSStyleSheet: { - prototype: CSSStyleSheet; - new(): CSSStyleSheet; -} - -interface MSSelection { - type: string; - typeDetail: string; - createRange(): TextRange; - clear(): void; - createRangeCollection(): TextRangeCollection; - empty(): void; -} -declare var MSSelection: { - prototype: MSSelection; - new(): MSSelection; -} - -interface HTMLMetaElement extends HTMLElement { - /** - * Gets or sets information used to bind the value of a content attribute of a meta element to an HTTP response header. - */ - httpEquiv: string; - /** - * Sets or retrieves the value specified in the content attribute of the meta object. - */ - name: string; - /** - * Gets or sets meta-information to associate with httpEquiv or name. - */ - content: string; - /** - * Sets or retrieves the URL property that will be loaded after the specified time has elapsed. - */ - url: string; - /** - * Sets or retrieves a scheme to be used in interpreting the value of a property specified for the object. - */ - scheme: string; - /** - * Sets or retrieves the character set used to encode the object. - */ - charset: string; -} -declare var HTMLMetaElement: { - prototype: HTMLMetaElement; - new(): HTMLMetaElement; -} - -interface SVGPatternElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGLangSpace, SVGTests, SVGFitToViewBox, SVGExternalResourcesRequired, SVGURIReference { - patternUnits: SVGAnimatedEnumeration; - y: SVGAnimatedLength; - width: SVGAnimatedLength; - x: SVGAnimatedLength; - patternContentUnits: SVGAnimatedEnumeration; - patternTransform: SVGAnimatedTransformList; - height: SVGAnimatedLength; -} -declare var SVGPatternElement: { - prototype: SVGPatternElement; - new(): SVGPatternElement; -} - -interface SVGAnimatedAngle { - animVal: SVGAngle; - baseVal: SVGAngle; -} -declare var SVGAnimatedAngle: { - prototype: SVGAnimatedAngle; - new(): SVGAnimatedAngle; -} - -interface Selection { - isCollapsed: boolean; - anchorNode: Node; - focusNode: Node; - anchorOffset: number; - focusOffset: number; - rangeCount: number; - addRange(range: Range): void; - collapseToEnd(): void; - toString(): string; - selectAllChildren(parentNode: Node): void; - getRangeAt(index: number): Range; - collapse(parentNode: Node, offset: number): void; - removeAllRanges(): void; - collapseToStart(): void; - deleteFromDocument(): void; - removeRange(range: Range): void; -} -declare var Selection: { - prototype: Selection; - new(): Selection; -} - -interface SVGScriptElement extends SVGElement, SVGExternalResourcesRequired, SVGURIReference { - type: string; -} -declare var SVGScriptElement: { - prototype: SVGScriptElement; - new(): SVGScriptElement; -} - -interface HTMLDDElement extends HTMLElement { - /** - * Sets or retrieves whether the browser automatically performs wordwrap. - */ - noWrap: boolean; -} -declare var HTMLDDElement: { - prototype: HTMLDDElement; - new(): HTMLDDElement; -} - -interface MSDataBindingRecordSetReadonlyExtensions { - recordset: any; - namedRecordset(dataMember: string, hierarchy?: any): any; -} - -interface CSSStyleRule extends CSSRule { - selectorText: string; - style: MSStyleCSSProperties; - readOnly: boolean; -} -declare var CSSStyleRule: { - prototype: CSSStyleRule; - new(): CSSStyleRule; -} - -interface NodeIterator { - whatToShow: number; - filter: NodeFilter; - root: Node; - expandEntityReferences: boolean; - nextNode(): Node; - detach(): void; - previousNode(): Node; -} -declare var NodeIterator: { - prototype: NodeIterator; - new(): NodeIterator; -} - -interface SVGViewElement extends SVGElement, SVGZoomAndPan, SVGFitToViewBox, SVGExternalResourcesRequired { - viewTarget: SVGStringList; -} -declare var SVGViewElement: { - prototype: SVGViewElement; - new(): SVGViewElement; -} - -interface HTMLLinkElement extends HTMLElement, LinkStyle { - /** - * Sets or retrieves the relationship between the object and the destination of the link. - */ - rel: string; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; - /** - * Sets or retrieves a destination URL or an anchor point. - */ - href: string; - /** - * Sets or retrieves the media type. - */ - media: string; - /** - * Sets or retrieves the relationship between the object and the destination of the link. - */ - rev: string; - /** - * Sets or retrieves the MIME type of the object. - */ - type: string; - /** - * Sets or retrieves the character set used to encode the object. - */ - charset: string; - /** - * Sets or retrieves the language code of the object. - */ - hreflang: string; -} -declare var HTMLLinkElement: { - prototype: HTMLLinkElement; - new(): HTMLLinkElement; -} - -interface SVGLocatable { - farthestViewportElement: SVGElement; - nearestViewportElement: SVGElement; - getBBox(): SVGRect; - getTransformToElement(element: SVGElement): SVGMatrix; - getCTM(): SVGMatrix; - getScreenCTM(): SVGMatrix; -} - -interface HTMLFontElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty { - /** - * Sets or retrieves the current typeface family. - */ - face: string; -} -declare var HTMLFontElement: { - prototype: HTMLFontElement; - new(): HTMLFontElement; -} - -interface SVGTitleElement extends SVGElement, SVGStylable, SVGLangSpace { -} -declare var SVGTitleElement: { - prototype: SVGTitleElement; - new(): SVGTitleElement; -} - -interface ControlRangeCollection { - length: number; - queryCommandValue(cmdID: string): any; - remove(index: number): void; - add(item: Element): void; - queryCommandIndeterm(cmdID: string): boolean; - scrollIntoView(varargStart?: any): void; - item(index: number): Element; - [index: number]: Element; - execCommand(cmdID: string, showUI?: boolean, value?: any): boolean; - addElement(item: Element): void; - queryCommandState(cmdID: string): boolean; - queryCommandSupported(cmdID: string): boolean; - queryCommandEnabled(cmdID: string): boolean; - queryCommandText(cmdID: string): string; - select(): void; -} -declare var ControlRangeCollection: { - prototype: ControlRangeCollection; - new(): ControlRangeCollection; -} - -interface MSNamespaceInfo extends MSEventAttachmentTarget { - urn: string; - onreadystatechange: (ev: Event) => any; - name: string; - readyState: string; - doImport(implementationUrl: string): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var MSNamespaceInfo: { - prototype: MSNamespaceInfo; - new(): MSNamespaceInfo; -} - -interface WindowSessionStorage { - sessionStorage: Storage; -} - -interface SVGAnimatedTransformList { - animVal: SVGTransformList; - baseVal: SVGTransformList; -} -declare var SVGAnimatedTransformList: { - prototype: SVGAnimatedTransformList; - new(): SVGAnimatedTransformList; -} - -interface HTMLTableCaptionElement extends HTMLElement { - /** - * Sets or retrieves the alignment of the caption or legend. - */ - align: string; - /** - * Sets or retrieves whether the caption appears at the top or bottom of the table. - */ - vAlign: string; -} -declare var HTMLTableCaptionElement: { - prototype: HTMLTableCaptionElement; - new(): HTMLTableCaptionElement; -} - -interface HTMLOptionElement extends HTMLElement, MSDataBindingExtensions { - /** - * Sets or retrieves the ordinal position of an option in a list box. - */ - index: number; - /** - * Sets or retrieves the status of an option. - */ - defaultSelected: boolean; - /** - * Sets or retrieves the value which is returned to the server when the form control is submitted. - */ - value: string; - /** - * Sets or retrieves the text string specified by the option tag. - */ - text: string; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Sets or retrieves a value that you can use to implement your own label functionality for the object. - */ - label: string; - /** - * Sets or retrieves whether the option in the list box is the default item. - */ - selected: boolean; -} -declare var HTMLOptionElement: { - prototype: HTMLOptionElement; - new(): HTMLOptionElement; - create(): HTMLOptionElement; -} - -interface HTMLMapElement extends HTMLElement { - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Retrieves a collection of the area objects defined for the given map object. - */ - areas: HTMLAreasCollection; -} -declare var HTMLMapElement: { - prototype: HTMLMapElement; - new(): HTMLMapElement; -} - -interface HTMLMenuElement extends HTMLElement, DOML2DeprecatedListSpaceReduction { - type: string; -} -declare var HTMLMenuElement: { - prototype: HTMLMenuElement; - new(): HTMLMenuElement; -} - -interface MouseWheelEvent extends MouseEvent { - wheelDelta: number; - initMouseWheelEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: EventTarget, modifiersListArg: string, wheelDeltaArg: number): void; -} -declare var MouseWheelEvent: { - prototype: MouseWheelEvent; - new(): MouseWheelEvent; -} - -interface SVGFitToViewBox { - viewBox: SVGAnimatedRect; - preserveAspectRatio: SVGAnimatedPreserveAspectRatio; -} - -interface SVGPointList { - numberOfItems: number; - replaceItem(newItem: SVGPoint, index: number): SVGPoint; - getItem(index: number): SVGPoint; - clear(): void; - appendItem(newItem: SVGPoint): SVGPoint; - initialize(newItem: SVGPoint): SVGPoint; - removeItem(index: number): SVGPoint; - insertItemBefore(newItem: SVGPoint, index: number): SVGPoint; -} -declare var SVGPointList: { - prototype: SVGPointList; - new(): SVGPointList; -} - -interface SVGAnimatedLengthList { - animVal: SVGLengthList; - baseVal: SVGLengthList; -} -declare var SVGAnimatedLengthList: { - prototype: SVGAnimatedLengthList; - new(): SVGAnimatedLengthList; -} - -interface SVGAnimatedPreserveAspectRatio { - animVal: SVGPreserveAspectRatio; - baseVal: SVGPreserveAspectRatio; -} -declare var SVGAnimatedPreserveAspectRatio: { - prototype: SVGAnimatedPreserveAspectRatio; - new(): SVGAnimatedPreserveAspectRatio; -} - -interface MSSiteModeEvent extends Event { - buttonID: number; - actionURL: string; -} -declare var MSSiteModeEvent: { - prototype: MSSiteModeEvent; - new(): MSSiteModeEvent; -} - -interface DOML2DeprecatedTextFlowControl { - clear: string; -} - -interface StyleSheetPageList { - length: number; - item(index: number): CSSPageRule; - [index: number]: CSSPageRule; -} -declare var StyleSheetPageList: { - prototype: StyleSheetPageList; - new(): StyleSheetPageList; -} - -interface MSCSSProperties extends CSSStyleDeclaration { - scrollbarShadowColor: string; - scrollbarHighlightColor: string; - layoutGridChar: string; - layoutGridType: string; - textAutospace: string; - textKashidaSpace: string; - writingMode: string; - scrollbarFaceColor: string; - backgroundPositionY: string; - lineBreak: string; - imeMode: string; - msBlockProgression: string; - layoutGridLine: string; - scrollbarBaseColor: string; - layoutGrid: string; - layoutFlow: string; - textKashida: string; - filter: string; - zoom: string; - scrollbarArrowColor: string; - behavior: string; - backgroundPositionX: string; - accelerator: string; - layoutGridMode: string; - textJustifyTrim: string; - scrollbar3dLightColor: string; - msInterpolationMode: string; - scrollbarTrackColor: string; - scrollbarDarkShadowColor: string; - styleFloat: string; - getAttribute(attributeName: string, flags?: number): any; - setAttribute(attributeName: string, AttributeValue: any, flags?: number): void; - removeAttribute(attributeName: string, flags?: number): boolean; -} -declare var MSCSSProperties: { - prototype: MSCSSProperties; - new(): MSCSSProperties; -} - -interface SVGExternalResourcesRequired { - externalResourcesRequired: SVGAnimatedBoolean; -} - -interface HTMLImageElement extends HTMLElement, MSImageResourceExtensions, MSDataBindingExtensions, MSResourceMetadata { - /** - * Sets or retrieves the width of the object. - */ - width: number; - /** - * Sets or retrieves the vertical margin for the object. - */ - vspace: number; - /** - * The original height of the image resource before sizing. - */ - naturalHeight: number; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * The address or URL of the a media resource that is to be considered. - */ - src: string; - /** - * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. - */ - useMap: string; - /** - * The original width of the image resource before sizing. - */ - naturalWidth: number; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Sets or retrieves the height of the object. - */ - height: number; - /** - * Specifies the properties of a border drawn around an object. - */ - border: string; - /** - * Sets or retrieves the width of the border to draw around the object. - */ - hspace: number; - /** - * Sets or retrieves a Uniform Resource Identifier (URI) to a long description of the object. - */ - longDesc: string; - /** - * Contains the hypertext reference (HREF) of the URL. - */ - href: string; - /** - * Sets or retrieves whether the image is a server-side image map. - */ - isMap: boolean; - /** - * Retrieves whether the object is fully loaded. - */ - complete: boolean; - /** - * Gets or sets the primary DLNA PlayTo device. - */ - msPlayToPrimary: boolean; - /** - * Gets or sets whether the DLNA PlayTo device is available. - */ - msPlayToDisabled: boolean; - /** - * Gets the source associated with the media element for use by the PlayToManager. - */ - msPlayToSource: any; - crossOrigin: string; - msPlayToPreferredSourceUri: string; -} -declare var HTMLImageElement: { - prototype: HTMLImageElement; - new(): HTMLImageElement; - create(): HTMLImageElement; -} - -interface HTMLAreaElement extends HTMLElement { - /** - * Sets or retrieves the protocol portion of a URL. - */ - protocol: string; - /** - * Sets or retrieves the substring of the href property that follows the question mark. - */ - search: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Sets or retrieves the coordinates of the object. - */ - coords: string; - /** - * Sets or retrieves the host name part of the location or URL. - */ - hostname: string; - /** - * Sets or retrieves the port number associated with a URL. - */ - port: string; - /** - * Sets or retrieves the file name or path specified by the object. - */ - pathname: string; - /** - * Sets or retrieves the hostname and port number of the location or URL. - */ - host: string; - /** - * Sets or retrieves the subsection of the href property that follows the number sign (#). - */ - hash: string; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; - /** - * Sets or retrieves a destination URL or an anchor point. - */ - href: string; - /** - * Sets or gets whether clicks in this region cause action. - */ - noHref: boolean; - /** - * Sets or retrieves the shape of the object. - */ - shape: string; - /** - * Returns a string representation of an object. - */ - toString(): string; -} -declare var HTMLAreaElement: { - prototype: HTMLAreaElement; - new(): HTMLAreaElement; -} - -interface EventTarget { - removeEventListener(type: string, listener: EventListener, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; - dispatchEvent(evt: Event): boolean; -} - -interface SVGAngle { - valueAsString: string; - valueInSpecifiedUnits: number; - value: number; - unitType: number; - newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void; - convertToSpecifiedUnits(unitType: number): void; - SVG_ANGLETYPE_RAD: number; - SVG_ANGLETYPE_UNKNOWN: number; - SVG_ANGLETYPE_UNSPECIFIED: number; - SVG_ANGLETYPE_DEG: number; - SVG_ANGLETYPE_GRAD: number; -} -declare var SVGAngle: { - prototype: SVGAngle; - new(): SVGAngle; - SVG_ANGLETYPE_RAD: number; - SVG_ANGLETYPE_UNKNOWN: number; - SVG_ANGLETYPE_UNSPECIFIED: number; - SVG_ANGLETYPE_DEG: number; - SVG_ANGLETYPE_GRAD: number; -} - -interface HTMLButtonElement extends HTMLElement, MSDataBindingExtensions { - /** - * Sets or retrieves the default or selected value of the control. - */ - value: string; - status: any; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Gets the classification and default behavior of the button. - */ - type: string; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - validationMessage: string; - /** - * Overrides the target attribute on a form element. - */ - formTarget: string; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - willValidate: boolean; - /** - * Overrides the action attribute (where the data on a form is sent) on the parent form element. - */ - formAction: string; - /** - * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. - */ - autofocus: boolean; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - validity: ValidityState; - /** - * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a "save draft"-type submit option. - */ - formNoValidate: string; - /** - * Used to override the encoding (formEnctype attribute) specified on the form element. - */ - formEnctype: string; - /** - * Overrides the submit method attribute previously specified on a form element. - */ - formMethod: string; - /** - * Creates a TextRange object for the element. - */ - createTextRange(): TextRange; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; -} -declare var HTMLButtonElement: { - prototype: HTMLButtonElement; - new(): HTMLButtonElement; -} - -interface HTMLSourceElement extends HTMLElement { - /** - * The address or URL of the a media resource that is to be considered. - */ - src: string; - /** - * Gets or sets the intended media type of the media source. - */ - media: string; - /** - * Gets or sets the MIME type of a media resource. - */ - type: string; - msKeySystem: string; -} -declare var HTMLSourceElement: { - prototype: HTMLSourceElement; - new(): HTMLSourceElement; -} - -interface CanvasGradient { - addColorStop(offset: number, color: string): void; -} -declare var CanvasGradient: { - prototype: CanvasGradient; - new(): CanvasGradient; -} - -interface KeyboardEvent extends UIEvent { - location: number; - keyCode: number; - shiftKey: boolean; - which: number; - locale: string; - key: string; - altKey: boolean; - metaKey: boolean; - char: string; - ctrlKey: boolean; - repeat: boolean; - charCode: number; - getModifierState(keyArg: string): boolean; - initKeyboardEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, keyArg: string, locationArg: number, modifiersListArg: string, repeat: boolean, locale: string): void; - DOM_KEY_LOCATION_RIGHT: number; - DOM_KEY_LOCATION_STANDARD: number; - DOM_KEY_LOCATION_LEFT: number; - DOM_KEY_LOCATION_NUMPAD: number; - DOM_KEY_LOCATION_JOYSTICK: number; - DOM_KEY_LOCATION_MOBILE: number; -} -declare var KeyboardEvent: { - prototype: KeyboardEvent; - new(): KeyboardEvent; - DOM_KEY_LOCATION_RIGHT: number; - DOM_KEY_LOCATION_STANDARD: number; - DOM_KEY_LOCATION_LEFT: number; - DOM_KEY_LOCATION_NUMPAD: number; - DOM_KEY_LOCATION_JOYSTICK: number; - DOM_KEY_LOCATION_MOBILE: number; -} - -interface MessageEvent extends Event { - source: Window; - origin: string; - data: any; - ports: any; - initMessageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, dataArg: any, originArg: string, lastEventIdArg: string, sourceArg: Window): void; -} -declare var MessageEvent: { - prototype: MessageEvent; - new(): MessageEvent; -} - -interface SVGElement extends Element { - onmouseover: (ev: MouseEvent) => any; - viewportElement: SVGElement; - onmousemove: (ev: MouseEvent) => any; - onmouseout: (ev: MouseEvent) => any; - ondblclick: (ev: MouseEvent) => any; - onfocusout: (ev: FocusEvent) => any; - onfocusin: (ev: FocusEvent) => any; - xmlbase: string; - onmousedown: (ev: MouseEvent) => any; - onload: (ev: Event) => any; - onmouseup: (ev: MouseEvent) => any; - onclick: (ev: MouseEvent) => any; - ownerSVGElement: SVGSVGElement; - id: string; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var SVGElement: { - prototype: SVGElement; - new(): SVGElement; -} - -interface HTMLScriptElement extends HTMLElement { - /** - * Sets or retrieves the status of the script. - */ - defer: boolean; - /** - * Retrieves or sets the text of the object as a string. - */ - text: string; - /** - * Retrieves the URL to an external file that contains the source code or data. - */ - src: string; - /** - * Sets or retrieves the object that is bound to the event script. - */ - htmlFor: string; - /** - * Sets or retrieves the character set used to encode the object. - */ - charset: string; - /** - * Sets or retrieves the MIME type for the associated scripting engine. - */ - type: string; - /** - * Sets or retrieves the event for which the script is written. - */ - event: string; - async: boolean; -} -declare var HTMLScriptElement: { - prototype: HTMLScriptElement; - new(): HTMLScriptElement; -} - -interface HTMLTableRowElement extends HTMLElement, HTMLTableAlignment, DOML2DeprecatedBackgroundColorStyle { - /** - * Retrieves the position of the object in the rows collection for the table. - */ - rowIndex: number; - /** - * Retrieves a collection of all cells in the table row. - */ - cells: HTMLCollection; - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. - */ - borderColorLight: any; - /** - * Retrieves the position of the object in the collection. - */ - sectionRowIndex: number; - /** - * Sets or retrieves the border color of the object. - */ - borderColor: any; - /** - * Sets or retrieves the height of the object. - */ - height: any; - /** - * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. - */ - borderColorDark: any; - /** - * Removes the specified cell from the table row, as well as from the cells collection. - * @param index Number that specifies the zero-based position of the cell to remove from the table row. If no value is provided, the last cell in the cells collection is deleted. - */ - deleteCell(index?: number): void; - /** - * Creates a new cell in the table row, and adds the cell to the cells collection. - * @param index Number that specifies where to insert the cell in the tr. The default value is -1, which appends the new cell to the end of the cells collection. - */ - insertCell(index?: number): HTMLElement; -} -declare var HTMLTableRowElement: { - prototype: HTMLTableRowElement; - new(): HTMLTableRowElement; -} - -interface CanvasRenderingContext2D { - miterLimit: number; - font: string; - globalCompositeOperation: string; - msFillRule: string; - lineCap: string; - msImageSmoothingEnabled: boolean; - lineDashOffset: number; - shadowColor: string; - lineJoin: string; - shadowOffsetX: number; - lineWidth: number; - canvas: HTMLCanvasElement; - strokeStyle: any; - globalAlpha: number; - shadowOffsetY: number; - fillStyle: any; - shadowBlur: number; - textAlign: string; - textBaseline: string; - restore(): void; - setTransform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void; - save(): void; - arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void; - measureText(text: string): TextMetrics; - isPointInPath(x: number, y: number, fillRule?: string): boolean; - quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void; - putImageData(imagedata: ImageData, dx: number, dy: number, dirtyX?: number, dirtyY?: number, dirtyWidth?: number, dirtyHeight?: number): void; - rotate(angle: number): void; - fillText(text: string, x: number, y: number, maxWidth?: number): void; - translate(x: number, y: number): void; - scale(x: number, y: number): void; - createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient; - lineTo(x: number, y: number): void; - getLineDash(): number[]; - fill(fillRule?: string): void; - createImageData(imageDataOrSw: any, sh?: number): ImageData; - createPattern(image: HTMLElement, repetition: string): CanvasPattern; - closePath(): void; - rect(x: number, y: number, w: number, h: number): void; - clip(fillRule?: string): void; - clearRect(x: number, y: number, w: number, h: number): void; - moveTo(x: number, y: number): void; - getImageData(sx: number, sy: number, sw: number, sh: number): ImageData; - fillRect(x: number, y: number, w: number, h: number): void; - bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void; - drawImage(image: HTMLElement, offsetX: number, offsetY: number, width?: number, height?: number, canvasOffsetX?: number, canvasOffsetY?: number, canvasImageWidth?: number, canvasImageHeight?: number): void; - transform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void; - stroke(): void; - strokeRect(x: number, y: number, w: number, h: number): void; - setLineDash(segments: number[]): void; - strokeText(text: string, x: number, y: number, maxWidth?: number): void; - beginPath(): void; - arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void; - createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient; -} -declare var CanvasRenderingContext2D: { - prototype: CanvasRenderingContext2D; - new(): CanvasRenderingContext2D; -} - -interface MSCSSRuleList { - length: number; - item(index?: number): CSSStyleRule; - [index: number]: CSSStyleRule; -} -declare var MSCSSRuleList: { - prototype: MSCSSRuleList; - new(): MSCSSRuleList; -} - -interface SVGPathSegLinetoHorizontalAbs extends SVGPathSeg { - x: number; -} -declare var SVGPathSegLinetoHorizontalAbs: { - prototype: SVGPathSegLinetoHorizontalAbs; - new(): SVGPathSegLinetoHorizontalAbs; -} - -interface SVGPathSegArcAbs extends SVGPathSeg { - y: number; - sweepFlag: boolean; - r2: number; - x: number; - angle: number; - r1: number; - largeArcFlag: boolean; -} -declare var SVGPathSegArcAbs: { - prototype: SVGPathSegArcAbs; - new(): SVGPathSegArcAbs; -} - -interface SVGTransformList { - numberOfItems: number; - getItem(index: number): SVGTransform; - consolidate(): SVGTransform; - clear(): void; - appendItem(newItem: SVGTransform): SVGTransform; - initialize(newItem: SVGTransform): SVGTransform; - removeItem(index: number): SVGTransform; - insertItemBefore(newItem: SVGTransform, index: number): SVGTransform; - replaceItem(newItem: SVGTransform, index: number): SVGTransform; - createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform; -} -declare var SVGTransformList: { - prototype: SVGTransformList; - new(): SVGTransformList; -} - -interface HTMLHtmlElement extends HTMLElement { - /** - * Sets or retrieves the DTD version that governs the current document. - */ - version: string; -} -declare var HTMLHtmlElement: { - prototype: HTMLHtmlElement; - new(): HTMLHtmlElement; -} - -interface SVGPathSegClosePath extends SVGPathSeg { -} -declare var SVGPathSegClosePath: { - prototype: SVGPathSegClosePath; - new(): SVGPathSegClosePath; -} - -interface HTMLFrameElement extends HTMLElement, GetSVGDocument, MSDataBindingExtensions { - /** - * Sets or retrieves the width of the object. - */ - width: any; - /** - * Sets or retrieves whether the frame can be scrolled. - */ - scrolling: string; - /** - * Sets or retrieves the top and bottom margin heights before displaying the text in a frame. - */ - marginHeight: string; - /** - * Sets or retrieves the left and right margin widths before displaying the text in a frame. - */ - marginWidth: string; - /** - * Sets or retrieves the border color of the object. - */ - borderColor: any; - /** - * Sets or retrieves the amount of additional space between the frames. - */ - frameSpacing: any; - /** - * Sets or retrieves whether to display a border for the frame. - */ - frameBorder: string; - /** - * Sets or retrieves whether the user can resize the frame. - */ - noResize: boolean; - /** - * Retrieves the object of the specified. - */ - contentWindow: Window; - /** - * Sets or retrieves a URL to be loaded by the object. - */ - src: string; - /** - * Sets or retrieves the frame name. - */ - name: string; - /** - * Sets or retrieves the height of the object. - */ - height: any; - /** - * Retrieves the document object of the page or frame. - */ - contentDocument: Document; - /** - * Specifies the properties of a border drawn around an object. - */ - border: string; - /** - * Sets or retrieves a URI to a long description of the object. - */ - longDesc: string; - /** - * Raised when the object has been completely received from the server. - */ - onload: (ev: Event) => any; - /** - * Sets the value indicating whether the source file of a frame or iframe has specific security restrictions applied. - */ - security: any; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var HTMLFrameElement: { - prototype: HTMLFrameElement; - new(): HTMLFrameElement; -} - -interface SVGAnimatedLength { - animVal: SVGLength; - baseVal: SVGLength; -} -declare var SVGAnimatedLength: { - prototype: SVGAnimatedLength; - new(): SVGAnimatedLength; -} - -interface SVGAnimatedPoints { - points: SVGPointList; - animatedPoints: SVGPointList; -} - -interface SVGDefsElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { -} -declare var SVGDefsElement: { - prototype: SVGDefsElement; - new(): SVGDefsElement; -} - -interface HTMLQuoteElement extends HTMLElement { - /** - * Sets or retrieves the date and time of a modification to the object. - */ - dateTime: string; - /** - * Sets or retrieves reference information about the object. - */ - cite: string; -} -declare var HTMLQuoteElement: { - prototype: HTMLQuoteElement; - new(): HTMLQuoteElement; -} - -interface CSSMediaRule extends CSSRule { - media: MediaList; - cssRules: CSSRuleList; - insertRule(rule: string, index?: number): number; - deleteRule(index?: number): void; -} -declare var CSSMediaRule: { - prototype: CSSMediaRule; - new(): CSSMediaRule; -} - -interface WindowModal { - dialogArguments: any; - returnValue: any; -} - -interface XMLHttpRequest extends EventTarget { - responseBody: any; - status: number; - readyState: number; - responseText: string; - responseXML: any; - ontimeout: (ev: Event) => any; - statusText: string; - onreadystatechange: (ev: Event) => any; - timeout: number; - onload: (ev: Event) => any; - response: any; - withCredentials: boolean; - onprogress: (ev: ProgressEvent) => any; - onabort: (ev: UIEvent) => any; - responseType: string; - onloadend: (ev: ProgressEvent) => any; - upload: XMLHttpRequestEventTarget; - onerror: (ev: ErrorEvent) => any; - onloadstart: (ev: Event) => any; - msCaching: string; - open(method: string, url: string, async?: boolean, user?: string, password?: string): void; - send(data?: any): void; - abort(): void; - getAllResponseHeaders(): string; - setRequestHeader(header: string, value: string): void; - getResponseHeader(header: string): string; - msCachingEnabled(): boolean; - overrideMimeType(mime: string): void; - LOADING: number; - DONE: number; - UNSENT: number; - OPENED: number; - HEADERS_RECEIVED: number; - addEventListener(type: "timeout", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var XMLHttpRequest: { - prototype: XMLHttpRequest; - new(): XMLHttpRequest; - LOADING: number; - DONE: number; - UNSENT: number; - OPENED: number; - HEADERS_RECEIVED: number; - create(): XMLHttpRequest; -} - -interface HTMLTableHeaderCellElement extends HTMLTableCellElement { - /** - * Sets or retrieves the group of cells in a table to which the object's information applies. - */ - scope: string; -} -declare var HTMLTableHeaderCellElement: { - prototype: HTMLTableHeaderCellElement; - new(): HTMLTableHeaderCellElement; -} - -interface HTMLDListElement extends HTMLElement, DOML2DeprecatedListSpaceReduction { -} -declare var HTMLDListElement: { - prototype: HTMLDListElement; - new(): HTMLDListElement; -} - -interface MSDataBindingExtensions { - dataSrc: string; - dataFormatAs: string; - dataFld: string; -} - -interface SVGPathSegLinetoHorizontalRel extends SVGPathSeg { - x: number; -} -declare var SVGPathSegLinetoHorizontalRel: { - prototype: SVGPathSegLinetoHorizontalRel; - new(): SVGPathSegLinetoHorizontalRel; -} - -interface SVGEllipseElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { - ry: SVGAnimatedLength; - cx: SVGAnimatedLength; - rx: SVGAnimatedLength; - cy: SVGAnimatedLength; -} -declare var SVGEllipseElement: { - prototype: SVGEllipseElement; - new(): SVGEllipseElement; -} - -interface SVGAElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired, SVGURIReference { - target: SVGAnimatedString; -} -declare var SVGAElement: { - prototype: SVGAElement; - new(): SVGAElement; -} - -interface SVGStylable { - className: SVGAnimatedString; - style: CSSStyleDeclaration; -} - -interface SVGTransformable extends SVGLocatable { - transform: SVGAnimatedTransformList; -} - -interface HTMLFrameSetElement extends HTMLElement { - ononline: (ev: Event) => any; - /** - * Sets or retrieves the border color of the object. - */ - borderColor: any; - /** - * Sets or retrieves the frame heights of the object. - */ - rows: string; - /** - * Sets or retrieves the frame widths of the object. - */ - cols: string; - /** - * Fires when the object loses the input focus. - */ - onblur: (ev: FocusEvent) => any; - /** - * Sets or retrieves the amount of additional space between the frames. - */ - frameSpacing: any; - /** - * Fires when the object receives focus. - */ - onfocus: (ev: FocusEvent) => any; - onmessage: (ev: MessageEvent) => any; - onerror: (ev: ErrorEvent) => any; - /** - * Sets or retrieves whether to display a border for the frame. - */ - frameBorder: string; - onresize: (ev: UIEvent) => any; - name: string; - onafterprint: (ev: Event) => any; - onbeforeprint: (ev: Event) => any; - onoffline: (ev: Event) => any; - border: string; - onunload: (ev: Event) => any; - onhashchange: (ev: Event) => any; - onload: (ev: Event) => any; - onbeforeunload: (ev: BeforeUnloadEvent) => any; - onstorage: (ev: StorageEvent) => any; - onpageshow: (ev: PageTransitionEvent) => any; - onpagehide: (ev: PageTransitionEvent) => any; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "hashchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; - addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var HTMLFrameSetElement: { - prototype: HTMLFrameSetElement; - new(): HTMLFrameSetElement; -} - -interface Screen extends EventTarget { - width: number; - deviceXDPI: number; - fontSmoothingEnabled: boolean; - bufferDepth: number; - logicalXDPI: number; - systemXDPI: number; - availHeight: number; - height: number; - logicalYDPI: number; - systemYDPI: number; - updateInterval: number; - colorDepth: number; - availWidth: number; - deviceYDPI: number; - pixelDepth: number; - msOrientation: string; - onmsorientationchange: (ev: any) => any; - msLockOrientation(orientation: string): boolean; - msLockOrientation(orientations: string[]): boolean; - msUnlockOrientation(): void; - addEventListener(type: "msorientationchange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var Screen: { - prototype: Screen; - new(): Screen; -} - -interface Coordinates { - altitudeAccuracy: number; - longitude: number; - latitude: number; - speed: number; - heading: number; - altitude: number; - accuracy: number; -} -declare var Coordinates: { - prototype: Coordinates; - new(): Coordinates; -} - -interface NavigatorGeolocation { - geolocation: Geolocation; -} - -interface NavigatorContentUtils { -} - -interface EventListener { - (evt: Event): void; -} - -interface SVGLangSpace { - xmllang: string; - xmlspace: string; -} - -interface DataTransfer { - effectAllowed: string; - dropEffect: string; - types: DOMStringList; - files: FileList; - clearData(format?: string): boolean; - setData(format: string, data: string): boolean; - getData(format: string): string; -} -declare var DataTransfer: { - prototype: DataTransfer; - new(): DataTransfer; -} - -interface FocusEvent extends UIEvent { - relatedTarget: EventTarget; - initFocusEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, relatedTargetArg: EventTarget): void; -} -declare var FocusEvent: { - prototype: FocusEvent; - new(): FocusEvent; -} - -interface Range { - startOffset: number; - collapsed: boolean; - endOffset: number; - startContainer: Node; - endContainer: Node; - commonAncestorContainer: Node; - setStart(refNode: Node, offset: number): void; - setEndBefore(refNode: Node): void; - setStartBefore(refNode: Node): void; - selectNode(refNode: Node): void; - detach(): void; - getBoundingClientRect(): ClientRect; - toString(): string; - compareBoundaryPoints(how: number, sourceRange: Range): number; - insertNode(newNode: Node): void; - collapse(toStart: boolean): void; - selectNodeContents(refNode: Node): void; - cloneContents(): DocumentFragment; - setEnd(refNode: Node, offset: number): void; - cloneRange(): Range; - getClientRects(): ClientRectList; - surroundContents(newParent: Node): void; - deleteContents(): void; - setStartAfter(refNode: Node): void; - extractContents(): DocumentFragment; - setEndAfter(refNode: Node): void; - createContextualFragment(fragment: string): DocumentFragment; - END_TO_END: number; - START_TO_START: number; - START_TO_END: number; - END_TO_START: number; -} -declare var Range: { - prototype: Range; - new(): Range; - END_TO_END: number; - START_TO_START: number; - START_TO_END: number; - END_TO_START: number; -} - -interface SVGPoint { - y: number; - x: number; - matrixTransform(matrix: SVGMatrix): SVGPoint; -} -declare var SVGPoint: { - prototype: SVGPoint; - new(): SVGPoint; -} - -interface MSPluginsCollection { - length: number; - refresh(reload?: boolean): void; -} -declare var MSPluginsCollection: { - prototype: MSPluginsCollection; - new(): MSPluginsCollection; -} - -interface SVGAnimatedNumberList { - animVal: SVGNumberList; - baseVal: SVGNumberList; -} -declare var SVGAnimatedNumberList: { - prototype: SVGAnimatedNumberList; - new(): SVGAnimatedNumberList; -} - -interface SVGSVGElement extends SVGElement, SVGStylable, SVGZoomAndPan, DocumentEvent, SVGLangSpace, SVGLocatable, SVGTests, SVGFitToViewBox, SVGExternalResourcesRequired { - width: SVGAnimatedLength; - x: SVGAnimatedLength; - contentStyleType: string; - onzoom: (ev: any) => any; - y: SVGAnimatedLength; - viewport: SVGRect; - onerror: (ev: ErrorEvent) => any; - pixelUnitToMillimeterY: number; - onresize: (ev: UIEvent) => any; - screenPixelToMillimeterY: number; - height: SVGAnimatedLength; - onabort: (ev: UIEvent) => any; - contentScriptType: string; - pixelUnitToMillimeterX: number; - currentTranslate: SVGPoint; - onunload: (ev: Event) => any; - currentScale: number; - onscroll: (ev: UIEvent) => any; - screenPixelToMillimeterX: number; - setCurrentTime(seconds: number): void; - createSVGLength(): SVGLength; - getIntersectionList(rect: SVGRect, referenceElement: SVGElement): NodeList; - unpauseAnimations(): void; - createSVGRect(): SVGRect; - checkIntersection(element: SVGElement, rect: SVGRect): boolean; - unsuspendRedrawAll(): void; - pauseAnimations(): void; - suspendRedraw(maxWaitMilliseconds: number): number; - deselectAll(): void; - createSVGAngle(): SVGAngle; - getEnclosureList(rect: SVGRect, referenceElement: SVGElement): NodeList; - createSVGTransform(): SVGTransform; - unsuspendRedraw(suspendHandleID: number): void; - forceRedraw(): void; - getCurrentTime(): number; - checkEnclosure(element: SVGElement, rect: SVGRect): boolean; - createSVGMatrix(): SVGMatrix; - createSVGPoint(): SVGPoint; - createSVGNumber(): SVGNumber; - createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform; - getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; - getElementById(elementId: string): Element; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "zoom", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var SVGSVGElement: { - prototype: SVGSVGElement; - new(): SVGSVGElement; -} - -interface HTMLLabelElement extends HTMLElement, MSDataBindingExtensions { - /** - * Sets or retrieves the object to which the given label object is assigned. - */ - htmlFor: string; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; -} -declare var HTMLLabelElement: { - prototype: HTMLLabelElement; - new(): HTMLLabelElement; -} - -interface MSResourceMetadata { - protocol: string; - fileSize: string; - fileUpdatedDate: string; - nameProp: string; - fileCreatedDate: string; - fileModifiedDate: string; - mimeType: string; -} - -interface HTMLLegendElement extends HTMLElement, MSDataBindingExtensions { - /** - * Retrieves a reference to the form that the object is embedded in. - */ - align: string; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; -} -declare var HTMLLegendElement: { - prototype: HTMLLegendElement; - new(): HTMLLegendElement; -} - -interface HTMLDirectoryElement extends HTMLElement, DOML2DeprecatedListSpaceReduction, DOML2DeprecatedListNumberingAndBulletStyle { -} -declare var HTMLDirectoryElement: { - prototype: HTMLDirectoryElement; - new(): HTMLDirectoryElement; -} - -interface SVGAnimatedInteger { - animVal: number; - baseVal: number; -} -declare var SVGAnimatedInteger: { - prototype: SVGAnimatedInteger; - new(): SVGAnimatedInteger; -} - -interface SVGTextElement extends SVGTextPositioningElement, SVGTransformable { -} -declare var SVGTextElement: { - prototype: SVGTextElement; - new(): SVGTextElement; -} - -interface SVGTSpanElement extends SVGTextPositioningElement { -} -declare var SVGTSpanElement: { - prototype: SVGTSpanElement; - new(): SVGTSpanElement; -} - -interface HTMLLIElement extends HTMLElement, DOML2DeprecatedListNumberingAndBulletStyle { - /** - * Sets or retrieves the value of a list item. - */ - value: number; -} -declare var HTMLLIElement: { - prototype: HTMLLIElement; - new(): HTMLLIElement; -} - -interface SVGPathSegLinetoVerticalAbs extends SVGPathSeg { - y: number; -} -declare var SVGPathSegLinetoVerticalAbs: { - prototype: SVGPathSegLinetoVerticalAbs; - new(): SVGPathSegLinetoVerticalAbs; -} - -interface MSStorageExtensions { - remainingSpace: number; -} - -interface SVGStyleElement extends SVGElement, SVGLangSpace { - media: string; - type: string; - title: string; -} -declare var SVGStyleElement: { - prototype: SVGStyleElement; - new(): SVGStyleElement; -} - -interface MSCurrentStyleCSSProperties extends MSCSSProperties { - blockDirection: string; - clipBottom: string; - clipLeft: string; - clipRight: string; - clipTop: string; - hasLayout: string; -} -declare var MSCurrentStyleCSSProperties: { - prototype: MSCurrentStyleCSSProperties; - new(): MSCurrentStyleCSSProperties; -} - -interface MSHTMLCollectionExtensions { - urns(urn: any): any; - tags(tagName: any): any; -} - -interface Storage extends MSStorageExtensions { - length: number; - getItem(key: string): any; - [key: string]: any; - setItem(key: string, data: string): void; - clear(): void; - removeItem(key: string): void; - key(index: number): string; - [index: number]: string; -} -declare var Storage: { - prototype: Storage; - new(): Storage; -} - -interface HTMLIFrameElement extends HTMLElement, GetSVGDocument, MSDataBindingExtensions { - /** - * Sets or retrieves the width of the object. - */ - width: string; - /** - * Sets or retrieves whether the frame can be scrolled. - */ - scrolling: string; - /** - * Sets or retrieves the top and bottom margin heights before displaying the text in a frame. - */ - marginHeight: string; - /** - * Sets or retrieves the left and right margin widths before displaying the text in a frame. - */ - marginWidth: string; - /** - * Sets or retrieves the amount of additional space between the frames. - */ - frameSpacing: any; - /** - * Sets or retrieves whether to display a border for the frame. - */ - frameBorder: string; - /** - * Sets or retrieves whether the user can resize the frame. - */ - noResize: boolean; - /** - * Sets or retrieves the vertical margin for the object. - */ - vspace: number; - /** - * Retrieves the object of the specified. - */ - contentWindow: Window; - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves a URL to be loaded by the object. - */ - src: string; - /** - * Sets or retrieves the frame name. - */ - name: string; - /** - * Sets or retrieves the height of the object. - */ - height: string; - /** - * Specifies the properties of a border drawn around an object. - */ - border: string; - /** - * Retrieves the document object of the page or frame. - */ - contentDocument: Document; - /** - * Sets or retrieves the horizontal margin for the object. - */ - hspace: number; - /** - * Sets or retrieves a URI to a long description of the object. - */ - longDesc: string; - /** - * Sets the value indicating whether the source file of a frame or iframe has specific security restrictions applied. - */ - security: any; - /** - * Raised when the object has been completely received from the server. - */ - onload: (ev: Event) => any; - sandbox: DOMSettableTokenList; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var HTMLIFrameElement: { - prototype: HTMLIFrameElement; - new(): HTMLIFrameElement; -} - -interface TextRangeCollection { - length: number; - item(index: number): TextRange; - [index: number]: TextRange; -} -declare var TextRangeCollection: { - prototype: TextRangeCollection; - new(): TextRangeCollection; -} - -interface HTMLBodyElement extends HTMLElement, DOML2DeprecatedBackgroundStyle, DOML2DeprecatedBackgroundColorStyle { - scroll: string; - ononline: (ev: Event) => any; - onblur: (ev: FocusEvent) => any; - noWrap: boolean; - onfocus: (ev: FocusEvent) => any; - onmessage: (ev: MessageEvent) => any; - text: any; - onerror: (ev: ErrorEvent) => any; - bgProperties: string; - onresize: (ev: UIEvent) => any; - link: any; - aLink: any; - bottomMargin: any; - topMargin: any; - onafterprint: (ev: Event) => any; - vLink: any; - onbeforeprint: (ev: Event) => any; - onoffline: (ev: Event) => any; - onunload: (ev: Event) => any; - onhashchange: (ev: Event) => any; - onload: (ev: Event) => any; - rightMargin: any; - onbeforeunload: (ev: BeforeUnloadEvent) => any; - leftMargin: any; - onstorage: (ev: StorageEvent) => any; - onpopstate: (ev: PopStateEvent) => any; - onpageshow: (ev: PageTransitionEvent) => any; - onpagehide: (ev: PageTransitionEvent) => any; - createTextRange(): TextRange; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "hashchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; - addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var HTMLBodyElement: { - prototype: HTMLBodyElement; - new(): HTMLBodyElement; -} - -interface DocumentType extends Node { - name: string; - notations: NamedNodeMap; - systemId: string; - internalSubset: string; - entities: NamedNodeMap; - publicId: string; -} -declare var DocumentType: { - prototype: DocumentType; - new(): DocumentType; -} - -interface SVGRadialGradientElement extends SVGGradientElement { - cx: SVGAnimatedLength; - r: SVGAnimatedLength; - cy: SVGAnimatedLength; - fx: SVGAnimatedLength; - fy: SVGAnimatedLength; -} -declare var SVGRadialGradientElement: { - prototype: SVGRadialGradientElement; - new(): SVGRadialGradientElement; -} - -interface MutationEvent extends Event { - newValue: string; - attrChange: number; - attrName: string; - prevValue: string; - relatedNode: Node; - initMutationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, relatedNodeArg: Node, prevValueArg: string, newValueArg: string, attrNameArg: string, attrChangeArg: number): void; - MODIFICATION: number; - REMOVAL: number; - ADDITION: number; -} -declare var MutationEvent: { - prototype: MutationEvent; - new(): MutationEvent; - MODIFICATION: number; - REMOVAL: number; - ADDITION: number; -} - -interface DragEvent extends MouseEvent { - dataTransfer: DataTransfer; - initDragEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, dataTransferArg: DataTransfer): void; - msConvertURL(file: File, targetType: string, targetURL?: string): void; -} -declare var DragEvent: { - prototype: DragEvent; - new(): DragEvent; -} - -interface HTMLTableSectionElement extends HTMLElement, HTMLTableAlignment, DOML2DeprecatedBackgroundColorStyle { - /** - * Sets or retrieves a value that indicates the table alignment. - */ - align: string; - /** - * Sets or retrieves the number of horizontal rows contained in the object. - */ - rows: HTMLCollection; - /** - * Removes the specified row (tr) from the element and from the rows collection. - * @param index Number that specifies the zero-based position in the rows collection of the row to remove. - */ - deleteRow(index?: number): void; - /** - * Moves a table row to a new position. - * @param indexFrom Number that specifies the index in the rows collection of the table row that is moved. - * @param indexTo Number that specifies where the row is moved within the rows collection. - */ - moveRow(indexFrom?: number, indexTo?: number): any; - /** - * Creates a new row (tr) in the table, and adds the row to the rows collection. - * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection. - */ - insertRow(index?: number): HTMLElement; -} -declare var HTMLTableSectionElement: { - prototype: HTMLTableSectionElement; - new(): HTMLTableSectionElement; -} - -interface DOML2DeprecatedListNumberingAndBulletStyle { - type: string; -} - -interface HTMLInputElement extends HTMLElement, MSDataBindingExtensions { - /** - * Sets or retrieves the width of the object. - */ - width: string; - status: boolean; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Gets or sets the starting position or offset of a text selection. - */ - selectionStart: number; - indeterminate: boolean; - readOnly: boolean; - size: number; - loop: number; - /** - * Gets or sets the end position or offset of a text selection. - */ - selectionEnd: number; - /** - * Sets or retrieves the URL of the virtual reality modeling language (VRML) world to be displayed in the window. - */ - vrml: string; - /** - * Sets or retrieves a lower resolution image to display. - */ - lowsrc: string; - /** - * Sets or retrieves the vertical margin for the object. - */ - vspace: number; - /** - * Sets or retrieves a comma-separated list of content types. - */ - accept: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Sets or retrieves the state of the check box or radio button. - */ - defaultChecked: boolean; - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Returns the value of the data at the cursor's current position. - */ - value: string; - /** - * The address or URL of the a media resource that is to be considered. - */ - src: string; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. - */ - useMap: string; - /** - * Sets or retrieves the height of the object. - */ - height: string; - /** - * Sets or retrieves the width of the border to draw around the object. - */ - border: string; - dynsrc: string; - /** - * Sets or retrieves the state of the check box or radio button. - */ - checked: boolean; - /** - * Sets or retrieves the width of the border to draw around the object. - */ - hspace: number; - /** - * Sets or retrieves the maximum number of characters that the user can enter in a text control. - */ - maxLength: number; - /** - * Returns the content type of the object. - */ - type: string; - /** - * Sets or retrieves the initial contents of the object. - */ - defaultValue: string; - /** - * Retrieves whether the object is fully loaded. - */ - complete: boolean; - start: string; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - validationMessage: string; - /** - * Returns a FileList object on a file type input object. - */ - files: FileList; - /** - * Defines the maximum acceptable value for an input element with type="number".When used with the min and step attributes, lets you control the range and increment (such as only even numbers) that the user can enter into an input field. - */ - max: string; - /** - * Overrides the target attribute on a form element. - */ - formTarget: string; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - willValidate: boolean; - /** - * Defines an increment or jump between values that you want to allow the user to enter. When used with the max and min attributes, lets you control the range and increment (for example, allow only even numbers) that the user can enter into an input field. - */ - step: string; - /** - * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. - */ - autofocus: boolean; - /** - * When present, marks an element that can't be submitted without a value. - */ - required: boolean; - /** - * Used to override the encoding (formEnctype attribute) specified on the form element. - */ - formEnctype: string; - /** - * Returns the input field value as a number. - */ - valueAsNumber: number; - /** - * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field. - */ - placeholder: string; - /** - * Overrides the submit method attribute previously specified on a form element. - */ - formMethod: string; - /** - * Specifies the ID of a pre-defined datalist of options for an input element. - */ - list: HTMLElement; - /** - * Specifies whether autocomplete is applied to an editable text field. - */ - autocomplete: string; - /** - * Defines the minimum acceptable value for an input element with type="number". When used with the max and step attributes, lets you control the range and increment (such as even numbers only) that the user can enter into an input field. - */ - min: string; - /** - * Overrides the action attribute (where the data on a form is sent) on the parent form element. - */ - formAction: string; - /** - * Gets or sets a string containing a regular expression that the user's input must match. - */ - pattern: string; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - validity: ValidityState; - /** - * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a "save draft"-type submit option. - */ - formNoValidate: string; - /** - * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list. - */ - multiple: boolean; - /** - * Creates a TextRange object for the element. - */ - createTextRange(): TextRange; - /** - * Sets the start and end positions of a selection in a text field. - * @param start The offset into the text field for the start of the selection. - * @param end The offset into the text field for the end of the selection. - */ - setSelectionRange(start: number, end: number): void; - /** - * Makes the selection equal to the current object. - */ - select(): void; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Decrements a range input control's value by the value given by the Step attribute. If the optional parameter is used, it will decrement the input control's step value multiplied by the parameter's value. - * @param n Value to decrement the value by. - */ - stepDown(n?: number): void; - /** - * Increments a range input control's value by the value given by the Step attribute. If the optional parameter is used, will increment the input control's value by that value. - * @param n Value to increment the value by. - */ - stepUp(n?: number): void; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; -} -declare var HTMLInputElement: { - prototype: HTMLInputElement; - new(): HTMLInputElement; -} - -interface HTMLAnchorElement extends HTMLElement, MSDataBindingExtensions { - /** - * Sets or retrieves the relationship between the object and the destination of the link. - */ - rel: string; - /** - * Contains the protocol of the URL. - */ - protocol: string; - /** - * Sets or retrieves the substring of the href property that follows the question mark. - */ - search: string; - /** - * Sets or retrieves the coordinates of the object. - */ - coords: string; - /** - * Contains the hostname of a URL. - */ - hostname: string; - /** - * Contains the pathname of the URL. - */ - pathname: string; - Methods: string; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; - protocolLong: string; - /** - * Sets or retrieves a destination URL or an anchor point. - */ - href: string; - /** - * Sets or retrieves the shape of the object. - */ - name: string; - /** - * Sets or retrieves the character set used to encode the object. - */ - charset: string; - /** - * Sets or retrieves the language code of the object. - */ - hreflang: string; - /** - * Sets or retrieves the port number associated with a URL. - */ - port: string; - /** - * Contains the hostname and port values of the URL. - */ - host: string; - /** - * Contains the anchor portion of the URL including the hash sign (#). - */ - hash: string; - nameProp: string; - urn: string; - /** - * Sets or retrieves the relationship between the object and the destination of the link. - */ - rev: string; - /** - * Sets or retrieves the shape of the object. - */ - shape: string; - type: string; - mimeType: string; - /** - * Retrieves or sets the text of the object as a string. - */ - text: string; - /** - * Returns a string representation of an object. - */ - toString(): string; -} -declare var HTMLAnchorElement: { - prototype: HTMLAnchorElement; - new(): HTMLAnchorElement; -} - -interface HTMLParamElement extends HTMLElement { - /** - * Sets or retrieves the value of an input parameter for an element. - */ - value: string; - /** - * Sets or retrieves the name of an input parameter for an element. - */ - name: string; - /** - * Sets or retrieves the content type of the resource designated by the value attribute. - */ - type: string; - /** - * Sets or retrieves the data type of the value attribute. - */ - valueType: string; -} -declare var HTMLParamElement: { - prototype: HTMLParamElement; - new(): HTMLParamElement; -} - -interface SVGImageElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired, SVGURIReference { - y: SVGAnimatedLength; - width: SVGAnimatedLength; - preserveAspectRatio: SVGAnimatedPreserveAspectRatio; - x: SVGAnimatedLength; - height: SVGAnimatedLength; -} -declare var SVGImageElement: { - prototype: SVGImageElement; - new(): SVGImageElement; -} - -interface SVGAnimatedNumber { - animVal: number; - baseVal: number; -} -declare var SVGAnimatedNumber: { - prototype: SVGAnimatedNumber; - new(): SVGAnimatedNumber; -} - -interface PerformanceTiming { - redirectStart: number; - domainLookupEnd: number; - responseStart: number; - domComplete: number; - domainLookupStart: number; - loadEventStart: number; - msFirstPaint: number; - unloadEventEnd: number; - fetchStart: number; - requestStart: number; - domInteractive: number; - navigationStart: number; - connectEnd: number; - loadEventEnd: number; - connectStart: number; - responseEnd: number; - domLoading: number; - redirectEnd: number; - unloadEventStart: number; - domContentLoadedEventStart: number; - domContentLoadedEventEnd: number; - toJSON(): any; -} -declare var PerformanceTiming: { - prototype: PerformanceTiming; - new(): PerformanceTiming; -} - -interface HTMLPreElement extends HTMLElement, DOML2DeprecatedTextFlowControl { - /** - * Sets or gets a value that you can use to implement your own width functionality for the object. - */ - width: number; - /** - * Indicates a citation by rendering text in italic type. - */ - cite: string; -} -declare var HTMLPreElement: { - prototype: HTMLPreElement; - new(): HTMLPreElement; -} - -interface EventException { - code: number; - message: string; - name: string; - toString(): string; - DISPATCH_REQUEST_ERR: number; - UNSPECIFIED_EVENT_TYPE_ERR: number; -} -declare var EventException: { - prototype: EventException; - new(): EventException; - DISPATCH_REQUEST_ERR: number; - UNSPECIFIED_EVENT_TYPE_ERR: number; -} - -interface MSNavigatorDoNotTrack { - msDoNotTrack: string; - removeSiteSpecificTrackingException(args: ExceptionInformation): void; - removeWebWideTrackingException(args: ExceptionInformation): void; - storeWebWideTrackingException(args: StoreExceptionsInformation): void; - storeSiteSpecificTrackingException(args: StoreSiteSpecificExceptionsInformation): void; - confirmSiteSpecificTrackingException(args: ConfirmSiteSpecificExceptionsInformation): boolean; - confirmWebWideTrackingException(args: ExceptionInformation): boolean; -} - -interface NavigatorOnLine { - onLine: boolean; -} - -interface WindowLocalStorage { - localStorage: Storage; -} - -interface SVGMetadataElement extends SVGElement { -} -declare var SVGMetadataElement: { - prototype: SVGMetadataElement; - new(): SVGMetadataElement; -} - -interface SVGPathSegArcRel extends SVGPathSeg { - y: number; - sweepFlag: boolean; - r2: number; - x: number; - angle: number; - r1: number; - largeArcFlag: boolean; -} -declare var SVGPathSegArcRel: { - prototype: SVGPathSegArcRel; - new(): SVGPathSegArcRel; -} - -interface SVGPathSegMovetoAbs extends SVGPathSeg { - y: number; - x: number; -} -declare var SVGPathSegMovetoAbs: { - prototype: SVGPathSegMovetoAbs; - new(): SVGPathSegMovetoAbs; -} - -interface SVGStringList { - numberOfItems: number; - replaceItem(newItem: string, index: number): string; - getItem(index: number): string; - clear(): void; - appendItem(newItem: string): string; - initialize(newItem: string): string; - removeItem(index: number): string; - insertItemBefore(newItem: string, index: number): string; -} -declare var SVGStringList: { - prototype: SVGStringList; - new(): SVGStringList; -} - -interface XDomainRequest { - timeout: number; - onerror: (ev: ErrorEvent) => any; - onload: (ev: Event) => any; - onprogress: (ev: ProgressEvent) => any; - ontimeout: (ev: Event) => any; - responseText: string; - contentType: string; - open(method: string, url: string): void; - abort(): void; - send(data?: any): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeout", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var XDomainRequest: { - prototype: XDomainRequest; - new(): XDomainRequest; - create(): XDomainRequest; -} - -interface DOML2DeprecatedBackgroundColorStyle { - bgColor: any; -} - -interface ElementTraversal { - childElementCount: number; - previousElementSibling: Element; - lastElementChild: Element; - nextElementSibling: Element; - firstElementChild: Element; -} - -interface SVGLength { - valueAsString: string; - valueInSpecifiedUnits: number; - value: number; - unitType: number; - newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void; - convertToSpecifiedUnits(unitType: number): void; - SVG_LENGTHTYPE_NUMBER: number; - SVG_LENGTHTYPE_CM: number; - SVG_LENGTHTYPE_PC: number; - SVG_LENGTHTYPE_PERCENTAGE: number; - SVG_LENGTHTYPE_MM: number; - SVG_LENGTHTYPE_PT: number; - SVG_LENGTHTYPE_IN: number; - SVG_LENGTHTYPE_EMS: number; - SVG_LENGTHTYPE_PX: number; - SVG_LENGTHTYPE_UNKNOWN: number; - SVG_LENGTHTYPE_EXS: number; -} -declare var SVGLength: { - prototype: SVGLength; - new(): SVGLength; - SVG_LENGTHTYPE_NUMBER: number; - SVG_LENGTHTYPE_CM: number; - SVG_LENGTHTYPE_PC: number; - SVG_LENGTHTYPE_PERCENTAGE: number; - SVG_LENGTHTYPE_MM: number; - SVG_LENGTHTYPE_PT: number; - SVG_LENGTHTYPE_IN: number; - SVG_LENGTHTYPE_EMS: number; - SVG_LENGTHTYPE_PX: number; - SVG_LENGTHTYPE_UNKNOWN: number; - SVG_LENGTHTYPE_EXS: number; -} - -interface SVGPolygonElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGAnimatedPoints, SVGTests, SVGExternalResourcesRequired { -} -declare var SVGPolygonElement: { - prototype: SVGPolygonElement; - new(): SVGPolygonElement; -} - -interface HTMLPhraseElement extends HTMLElement { - /** - * Sets or retrieves the date and time of a modification to the object. - */ - dateTime: string; - /** - * Sets or retrieves reference information about the object. - */ - cite: string; -} -declare var HTMLPhraseElement: { - prototype: HTMLPhraseElement; - new(): HTMLPhraseElement; -} - -interface NavigatorStorageUtils { -} - -interface SVGPathSegCurvetoCubicRel extends SVGPathSeg { - y: number; - y1: number; - x2: number; - x: number; - x1: number; - y2: number; -} -declare var SVGPathSegCurvetoCubicRel: { - prototype: SVGPathSegCurvetoCubicRel; - new(): SVGPathSegCurvetoCubicRel; -} - -interface SVGTextContentElement extends SVGElement, SVGStylable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { - textLength: SVGAnimatedLength; - lengthAdjust: SVGAnimatedEnumeration; - getCharNumAtPosition(point: SVGPoint): number; - getStartPositionOfChar(charnum: number): SVGPoint; - getExtentOfChar(charnum: number): SVGRect; - getComputedTextLength(): number; - getSubStringLength(charnum: number, nchars: number): number; - selectSubString(charnum: number, nchars: number): void; - getNumberOfChars(): number; - getRotationOfChar(charnum: number): number; - getEndPositionOfChar(charnum: number): SVGPoint; - LENGTHADJUST_SPACING: number; - LENGTHADJUST_SPACINGANDGLYPHS: number; - LENGTHADJUST_UNKNOWN: number; -} -declare var SVGTextContentElement: { - prototype: SVGTextContentElement; - new(): SVGTextContentElement; - LENGTHADJUST_SPACING: number; - LENGTHADJUST_SPACINGANDGLYPHS: number; - LENGTHADJUST_UNKNOWN: number; -} - -interface DOML2DeprecatedColorProperty { - color: string; -} - -interface Location { - hash: string; - protocol: string; - search: string; - href: string; - hostname: string; - port: string; - pathname: string; - host: string; - reload(flag?: boolean): void; - replace(url: string): void; - assign(url: string): void; - toString(): string; -} -declare var Location: { - prototype: Location; - new(): Location; -} - -interface HTMLTitleElement extends HTMLElement { - /** - * Retrieves or sets the text of the object as a string. - */ - text: string; -} -declare var HTMLTitleElement: { - prototype: HTMLTitleElement; - new(): HTMLTitleElement; -} - -interface HTMLStyleElement extends HTMLElement, LinkStyle { - /** - * Sets or retrieves the media type. - */ - media: string; - /** - * Retrieves the CSS language in which the style sheet is written. - */ - type: string; -} -declare var HTMLStyleElement: { - prototype: HTMLStyleElement; - new(): HTMLStyleElement; -} - -interface PerformanceEntry { - name: string; - startTime: number; - duration: number; - entryType: string; -} -declare var PerformanceEntry: { - prototype: PerformanceEntry; - new(): PerformanceEntry; -} - -interface SVGTransform { - type: number; - angle: number; - matrix: SVGMatrix; - setTranslate(tx: number, ty: number): void; - setScale(sx: number, sy: number): void; - setMatrix(matrix: SVGMatrix): void; - setSkewY(angle: number): void; - setRotate(angle: number, cx: number, cy: number): void; - setSkewX(angle: number): void; - SVG_TRANSFORM_SKEWX: number; - SVG_TRANSFORM_UNKNOWN: number; - SVG_TRANSFORM_SCALE: number; - SVG_TRANSFORM_TRANSLATE: number; - SVG_TRANSFORM_MATRIX: number; - SVG_TRANSFORM_ROTATE: number; - SVG_TRANSFORM_SKEWY: number; -} -declare var SVGTransform: { - prototype: SVGTransform; - new(): SVGTransform; - SVG_TRANSFORM_SKEWX: number; - SVG_TRANSFORM_UNKNOWN: number; - SVG_TRANSFORM_SCALE: number; - SVG_TRANSFORM_TRANSLATE: number; - SVG_TRANSFORM_MATRIX: number; - SVG_TRANSFORM_ROTATE: number; - SVG_TRANSFORM_SKEWY: number; -} - -interface UIEvent extends Event { - detail: number; - view: Window; - initUIEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number): void; -} -declare var UIEvent: { - prototype: UIEvent; - new(): UIEvent; -} - -interface SVGURIReference { - href: SVGAnimatedString; -} - -interface SVGPathSeg { - pathSegType: number; - pathSegTypeAsLetter: string; - PATHSEG_MOVETO_REL: number; - PATHSEG_LINETO_VERTICAL_REL: number; - PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number; - PATHSEG_CURVETO_QUADRATIC_REL: number; - PATHSEG_CURVETO_CUBIC_ABS: number; - PATHSEG_LINETO_HORIZONTAL_ABS: number; - PATHSEG_CURVETO_QUADRATIC_ABS: number; - PATHSEG_LINETO_ABS: number; - PATHSEG_CLOSEPATH: number; - PATHSEG_LINETO_HORIZONTAL_REL: number; - PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number; - PATHSEG_LINETO_REL: number; - PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number; - PATHSEG_ARC_REL: number; - PATHSEG_CURVETO_CUBIC_REL: number; - PATHSEG_UNKNOWN: number; - PATHSEG_LINETO_VERTICAL_ABS: number; - PATHSEG_ARC_ABS: number; - PATHSEG_MOVETO_ABS: number; - PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number; -} -declare var SVGPathSeg: { - prototype: SVGPathSeg; - new(): SVGPathSeg; - PATHSEG_MOVETO_REL: number; - PATHSEG_LINETO_VERTICAL_REL: number; - PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number; - PATHSEG_CURVETO_QUADRATIC_REL: number; - PATHSEG_CURVETO_CUBIC_ABS: number; - PATHSEG_LINETO_HORIZONTAL_ABS: number; - PATHSEG_CURVETO_QUADRATIC_ABS: number; - PATHSEG_LINETO_ABS: number; - PATHSEG_CLOSEPATH: number; - PATHSEG_LINETO_HORIZONTAL_REL: number; - PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number; - PATHSEG_LINETO_REL: number; - PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number; - PATHSEG_ARC_REL: number; - PATHSEG_CURVETO_CUBIC_REL: number; - PATHSEG_UNKNOWN: number; - PATHSEG_LINETO_VERTICAL_ABS: number; - PATHSEG_ARC_ABS: number; - PATHSEG_MOVETO_ABS: number; - PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number; -} - -interface WheelEvent extends MouseEvent { - deltaZ: number; - deltaX: number; - deltaMode: number; - deltaY: number; - initWheelEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: EventTarget, modifiersListArg: string, deltaXArg: number, deltaYArg: number, deltaZArg: number, deltaMode: number): void; - getCurrentPoint(element: Element): void; - DOM_DELTA_PIXEL: number; - DOM_DELTA_LINE: number; - DOM_DELTA_PAGE: number; -} -declare var WheelEvent: { - prototype: WheelEvent; - new(): WheelEvent; - DOM_DELTA_PIXEL: number; - DOM_DELTA_LINE: number; - DOM_DELTA_PAGE: number; -} - -interface MSEventAttachmentTarget { - attachEvent(event: string, listener: EventListener): boolean; - detachEvent(event: string, listener: EventListener): void; -} - -interface SVGNumber { - value: number; -} -declare var SVGNumber: { - prototype: SVGNumber; - new(): SVGNumber; -} - -interface SVGPathElement extends SVGElement, SVGStylable, SVGAnimatedPathData, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { - getPathSegAtLength(distance: number): number; - getPointAtLength(distance: number): SVGPoint; - createSVGPathSegCurvetoQuadraticAbs(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticAbs; - createSVGPathSegLinetoRel(x: number, y: number): SVGPathSegLinetoRel; - createSVGPathSegCurvetoQuadraticRel(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticRel; - createSVGPathSegCurvetoCubicAbs(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicAbs; - createSVGPathSegLinetoAbs(x: number, y: number): SVGPathSegLinetoAbs; - createSVGPathSegClosePath(): SVGPathSegClosePath; - createSVGPathSegCurvetoCubicRel(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicRel; - createSVGPathSegCurvetoQuadraticSmoothRel(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothRel; - createSVGPathSegMovetoRel(x: number, y: number): SVGPathSegMovetoRel; - createSVGPathSegCurvetoCubicSmoothAbs(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothAbs; - createSVGPathSegMovetoAbs(x: number, y: number): SVGPathSegMovetoAbs; - createSVGPathSegLinetoVerticalRel(y: number): SVGPathSegLinetoVerticalRel; - createSVGPathSegArcRel(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcRel; - createSVGPathSegCurvetoQuadraticSmoothAbs(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothAbs; - createSVGPathSegLinetoHorizontalRel(x: number): SVGPathSegLinetoHorizontalRel; - getTotalLength(): number; - createSVGPathSegCurvetoCubicSmoothRel(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothRel; - createSVGPathSegLinetoHorizontalAbs(x: number): SVGPathSegLinetoHorizontalAbs; - createSVGPathSegLinetoVerticalAbs(y: number): SVGPathSegLinetoVerticalAbs; - createSVGPathSegArcAbs(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcAbs; -} -declare var SVGPathElement: { - prototype: SVGPathElement; - new(): SVGPathElement; -} - -interface MSCompatibleInfo { - version: string; - userAgent: string; -} -declare var MSCompatibleInfo: { - prototype: MSCompatibleInfo; - new(): MSCompatibleInfo; -} - -interface Text extends CharacterData, MSNodeExtensions { - wholeText: string; - splitText(offset: number): Text; - replaceWholeText(content: string): Text; -} -declare var Text: { - prototype: Text; - new(): Text; -} - -interface SVGAnimatedRect { - animVal: SVGRect; - baseVal: SVGRect; -} -declare var SVGAnimatedRect: { - prototype: SVGAnimatedRect; - new(): SVGAnimatedRect; -} - -interface CSSNamespaceRule extends CSSRule { - namespaceURI: string; - prefix: string; -} -declare var CSSNamespaceRule: { - prototype: CSSNamespaceRule; - new(): CSSNamespaceRule; -} - -interface SVGPathSegList { - numberOfItems: number; - replaceItem(newItem: SVGPathSeg, index: number): SVGPathSeg; - getItem(index: number): SVGPathSeg; - clear(): void; - appendItem(newItem: SVGPathSeg): SVGPathSeg; - initialize(newItem: SVGPathSeg): SVGPathSeg; - removeItem(index: number): SVGPathSeg; - insertItemBefore(newItem: SVGPathSeg, index: number): SVGPathSeg; -} -declare var SVGPathSegList: { - prototype: SVGPathSegList; - new(): SVGPathSegList; -} - -interface HTMLUnknownElement extends HTMLElement, MSDataBindingRecordSetReadonlyExtensions { -} -declare var HTMLUnknownElement: { - prototype: HTMLUnknownElement; - new(): HTMLUnknownElement; -} - -interface HTMLAudioElement extends HTMLMediaElement { -} -declare var HTMLAudioElement: { - prototype: HTMLAudioElement; - new(): HTMLAudioElement; -} - -interface MSImageResourceExtensions { - dynsrc: string; - vrml: string; - lowsrc: string; - start: string; - loop: number; -} - -interface PositionError { - code: number; - message: string; - toString(): string; - POSITION_UNAVAILABLE: number; - PERMISSION_DENIED: number; - TIMEOUT: number; -} -declare var PositionError: { - prototype: PositionError; - new(): PositionError; - POSITION_UNAVAILABLE: number; - PERMISSION_DENIED: number; - TIMEOUT: number; -} - -interface HTMLTableCellElement extends HTMLElement, HTMLTableAlignment, DOML2DeprecatedBackgroundStyle, DOML2DeprecatedBackgroundColorStyle { - /** - * Sets or retrieves the width of the object. - */ - width: number; - /** - * Sets or retrieves a list of header cells that provide information for the object. - */ - headers: string; - /** - * Retrieves the position of the object in the cells collection of a row. - */ - cellIndex: number; - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. - */ - borderColorLight: any; - /** - * Sets or retrieves the number columns in the table that the object should span. - */ - colSpan: number; - /** - * Sets or retrieves the border color of the object. - */ - borderColor: any; - /** - * Sets or retrieves a comma-delimited list of conceptual categories associated with the object. - */ - axis: string; - /** - * Sets or retrieves the height of the object. - */ - height: any; - /** - * Sets or retrieves whether the browser automatically performs wordwrap. - */ - noWrap: boolean; - /** - * Sets or retrieves abbreviated text for the object. - */ - abbr: string; - /** - * Sets or retrieves how many rows in a table the cell should span. - */ - rowSpan: number; - /** - * Sets or retrieves the group of cells in a table to which the object's information applies. - */ - scope: string; - /** - * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. - */ - borderColorDark: any; -} -declare var HTMLTableCellElement: { - prototype: HTMLTableCellElement; - new(): HTMLTableCellElement; -} - -interface SVGElementInstance extends EventTarget { - previousSibling: SVGElementInstance; - parentNode: SVGElementInstance; - lastChild: SVGElementInstance; - nextSibling: SVGElementInstance; - childNodes: SVGElementInstanceList; - correspondingUseElement: SVGUseElement; - correspondingElement: SVGElement; - firstChild: SVGElementInstance; -} -declare var SVGElementInstance: { - prototype: SVGElementInstance; - new(): SVGElementInstance; -} - -interface MSNamespaceInfoCollection { - length: number; - add(namespace?: string, urn?: string, implementationUrl?: any): any; - item(index: any): any; - // [index: any]: any; -} -declare var MSNamespaceInfoCollection: { - prototype: MSNamespaceInfoCollection; - new(): MSNamespaceInfoCollection; -} - -interface SVGCircleElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { - cx: SVGAnimatedLength; - r: SVGAnimatedLength; - cy: SVGAnimatedLength; -} -declare var SVGCircleElement: { - prototype: SVGCircleElement; - new(): SVGCircleElement; -} - -interface StyleSheetList { - length: number; - item(index?: number): StyleSheet; - [index: number]: StyleSheet; -} -declare var StyleSheetList: { - prototype: StyleSheetList; - new(): StyleSheetList; -} - -interface CSSImportRule extends CSSRule { - styleSheet: CSSStyleSheet; - href: string; - media: MediaList; -} -declare var CSSImportRule: { - prototype: CSSImportRule; - new(): CSSImportRule; -} - -interface CustomEvent extends Event { - detail: any; - initCustomEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, detailArg: any): void; -} -declare var CustomEvent: { - prototype: CustomEvent; - new(): CustomEvent; -} - -interface HTMLBaseFontElement extends HTMLElement, DOML2DeprecatedColorProperty { - /** - * Sets or retrieves the current typeface family. - */ - face: string; - /** - * Sets or retrieves the font size of the object. - */ - size: number; -} -declare var HTMLBaseFontElement: { - prototype: HTMLBaseFontElement; - new(): HTMLBaseFontElement; -} - -interface HTMLTextAreaElement extends HTMLElement, MSDataBindingExtensions { - /** - * Retrieves or sets the text in the entry field of the textArea element. - */ - value: string; - /** - * Sets or retrieves the value indicating whether the control is selected. - */ - status: any; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Gets or sets the starting position or offset of a text selection. - */ - selectionStart: number; - /** - * Sets or retrieves the number of horizontal rows contained in the object. - */ - rows: number; - /** - * Sets or retrieves the width of the object. - */ - cols: number; - /** - * Sets or retrieves the value indicated whether the content of the object is read-only. - */ - readOnly: boolean; - /** - * Sets or retrieves how to handle wordwrapping in the object. - */ - wrap: string; - /** - * Gets or sets the end position or offset of a text selection. - */ - selectionEnd: number; - /** - * Retrieves the type of control. - */ - type: string; - /** - * Sets or retrieves the initial contents of the object. - */ - defaultValue: string; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - validationMessage: string; - /** - * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. - */ - autofocus: boolean; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - validity: ValidityState; - /** - * When present, marks an element that can't be submitted without a value. - */ - required: boolean; - /** - * Sets or retrieves the maximum number of characters that the user can enter in a text control. - */ - maxLength: number; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - willValidate: boolean; - /** - * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field. - */ - placeholder: string; - /** - * Creates a TextRange object for the element. - */ - createTextRange(): TextRange; - /** - * Sets the start and end positions of a selection in a text field. - * @param start The offset into the text field for the start of the selection. - * @param end The offset into the text field for the end of the selection. - */ - setSelectionRange(start: number, end: number): void; - /** - * Highlights the input area of a form element. - */ - select(): void; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; -} -declare var HTMLTextAreaElement: { - prototype: HTMLTextAreaElement; - new(): HTMLTextAreaElement; -} - -interface Geolocation { - clearWatch(watchId: number): void; - getCurrentPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): void; - watchPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): number; -} -declare var Geolocation: { - prototype: Geolocation; - new(): Geolocation; -} - -interface DOML2DeprecatedMarginStyle { - vspace: number; - hspace: number; -} - -interface MSWindowModeless { - dialogTop: any; - dialogLeft: any; - dialogWidth: any; - dialogHeight: any; - menuArguments: any; -} - -interface DOML2DeprecatedAlignmentStyle { - align: string; -} - -interface HTMLMarqueeElement extends HTMLElement, MSDataBindingExtensions, DOML2DeprecatedBackgroundColorStyle { - width: string; - onbounce: (ev: Event) => any; - vspace: number; - trueSpeed: boolean; - scrollAmount: number; - scrollDelay: number; - behavior: string; - height: string; - loop: number; - direction: string; - hspace: number; - onstart: (ev: Event) => any; - onfinish: (ev: Event) => any; - stop(): void; - start(): void; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "bounce", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "start", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "finish", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var HTMLMarqueeElement: { - prototype: HTMLMarqueeElement; - new(): HTMLMarqueeElement; -} - -interface SVGRect { - y: number; - width: number; - x: number; - height: number; -} -declare var SVGRect: { - prototype: SVGRect; - new(): SVGRect; -} - -interface MSNodeExtensions { - swapNode(otherNode: Node): Node; - removeNode(deep?: boolean): Node; - replaceNode(replacement: Node): Node; -} - -interface History { - length: number; - state: any; - back(distance?: any): void; - forward(distance?: any): void; - go(delta?: any): void; - replaceState(statedata: any, title: string, url?: string): void; - pushState(statedata: any, title: string, url?: string): void; -} -declare var History: { - prototype: History; - new(): History; -} - -interface SVGPathSegCurvetoCubicAbs extends SVGPathSeg { - y: number; - y1: number; - x2: number; - x: number; - x1: number; - y2: number; -} -declare var SVGPathSegCurvetoCubicAbs: { - prototype: SVGPathSegCurvetoCubicAbs; - new(): SVGPathSegCurvetoCubicAbs; -} - -interface SVGPathSegCurvetoQuadraticAbs extends SVGPathSeg { - y: number; - y1: number; - x: number; - x1: number; -} -declare var SVGPathSegCurvetoQuadraticAbs: { - prototype: SVGPathSegCurvetoQuadraticAbs; - new(): SVGPathSegCurvetoQuadraticAbs; -} - -interface TimeRanges { - length: number; - start(index: number): number; - end(index: number): number; -} -declare var TimeRanges: { - prototype: TimeRanges; - new(): TimeRanges; -} - -interface CSSRule { - cssText: string; - parentStyleSheet: CSSStyleSheet; - parentRule: CSSRule; - type: number; - IMPORT_RULE: number; - MEDIA_RULE: number; - STYLE_RULE: number; - NAMESPACE_RULE: number; - PAGE_RULE: number; - UNKNOWN_RULE: number; - FONT_FACE_RULE: number; - CHARSET_RULE: number; - KEYFRAMES_RULE: number; - KEYFRAME_RULE: number; - VIEWPORT_RULE: number; -} -declare var CSSRule: { - prototype: CSSRule; - new(): CSSRule; - IMPORT_RULE: number; - MEDIA_RULE: number; - STYLE_RULE: number; - NAMESPACE_RULE: number; - PAGE_RULE: number; - UNKNOWN_RULE: number; - FONT_FACE_RULE: number; - CHARSET_RULE: number; - KEYFRAMES_RULE: number; - KEYFRAME_RULE: number; - VIEWPORT_RULE: number; -} - -interface SVGPathSegLinetoAbs extends SVGPathSeg { - y: number; - x: number; -} -declare var SVGPathSegLinetoAbs: { - prototype: SVGPathSegLinetoAbs; - new(): SVGPathSegLinetoAbs; -} - -interface HTMLModElement extends HTMLElement { - /** - * Sets or retrieves the date and time of a modification to the object. - */ - dateTime: string; - /** - * Sets or retrieves reference information about the object. - */ - cite: string; -} -declare var HTMLModElement: { - prototype: HTMLModElement; - new(): HTMLModElement; -} - -interface SVGMatrix { - e: number; - c: number; - a: number; - b: number; - d: number; - f: number; - multiply(secondMatrix: SVGMatrix): SVGMatrix; - flipY(): SVGMatrix; - skewY(angle: number): SVGMatrix; - inverse(): SVGMatrix; - scaleNonUniform(scaleFactorX: number, scaleFactorY: number): SVGMatrix; - rotate(angle: number): SVGMatrix; - flipX(): SVGMatrix; - translate(x: number, y: number): SVGMatrix; - scale(scaleFactor: number): SVGMatrix; - rotateFromVector(x: number, y: number): SVGMatrix; - skewX(angle: number): SVGMatrix; -} -declare var SVGMatrix: { - prototype: SVGMatrix; - new(): SVGMatrix; -} - -interface MSPopupWindow { - document: Document; - isOpen: boolean; - show(x: number, y: number, w: number, h: number, element?: any): void; - hide(): void; -} -declare var MSPopupWindow: { - prototype: MSPopupWindow; - new(): MSPopupWindow; -} - -interface BeforeUnloadEvent extends Event { - returnValue: string; -} -declare var BeforeUnloadEvent: { - prototype: BeforeUnloadEvent; - new(): BeforeUnloadEvent; -} - -interface SVGUseElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired, SVGURIReference { - y: SVGAnimatedLength; - width: SVGAnimatedLength; - animatedInstanceRoot: SVGElementInstance; - instanceRoot: SVGElementInstance; - x: SVGAnimatedLength; - height: SVGAnimatedLength; -} -declare var SVGUseElement: { - prototype: SVGUseElement; - new(): SVGUseElement; -} - -interface Event { - timeStamp: number; - defaultPrevented: boolean; - isTrusted: boolean; - currentTarget: EventTarget; - cancelBubble: boolean; - target: EventTarget; - eventPhase: number; - cancelable: boolean; - type: string; - srcElement: Element; - bubbles: boolean; - initEvent(eventTypeArg: string, canBubbleArg: boolean, cancelableArg: boolean): void; - stopPropagation(): void; - stopImmediatePropagation(): void; - preventDefault(): void; - CAPTURING_PHASE: number; - AT_TARGET: number; - BUBBLING_PHASE: number; -} -declare var Event: { - prototype: Event; - new(): Event; - CAPTURING_PHASE: number; - AT_TARGET: number; - BUBBLING_PHASE: number; -} - -interface ImageData { - width: number; - data: number[]; - height: number; -} -declare var ImageData: { - prototype: ImageData; - new(): ImageData; -} - -interface HTMLTableColElement extends HTMLElement, HTMLTableAlignment { - /** - * Sets or retrieves the width of the object. - */ - width: any; - /** - * Sets or retrieves the alignment of the object relative to the display or table. - */ - align: string; - /** - * Sets or retrieves the number of columns in the group. - */ - span: number; -} -declare var HTMLTableColElement: { - prototype: HTMLTableColElement; - new(): HTMLTableColElement; -} - -interface SVGException { - code: number; - message: string; - name: string; - toString(): string; - SVG_MATRIX_NOT_INVERTABLE: number; - SVG_WRONG_TYPE_ERR: number; - SVG_INVALID_VALUE_ERR: number; -} -declare var SVGException: { - prototype: SVGException; - new(): SVGException; - SVG_MATRIX_NOT_INVERTABLE: number; - SVG_WRONG_TYPE_ERR: number; - SVG_INVALID_VALUE_ERR: number; -} - -interface SVGLinearGradientElement extends SVGGradientElement { - y1: SVGAnimatedLength; - x2: SVGAnimatedLength; - x1: SVGAnimatedLength; - y2: SVGAnimatedLength; -} -declare var SVGLinearGradientElement: { - prototype: SVGLinearGradientElement; - new(): SVGLinearGradientElement; -} - -interface HTMLTableAlignment { - /** - * Sets or retrieves a value that you can use to implement your own ch functionality for the object. - */ - ch: string; - /** - * Sets or retrieves how text and other content are vertically aligned within the object that contains them. - */ - vAlign: string; - /** - * Sets or retrieves a value that you can use to implement your own chOff functionality for the object. - */ - chOff: string; -} - -interface SVGAnimatedEnumeration { - animVal: number; - baseVal: number; -} -declare var SVGAnimatedEnumeration: { - prototype: SVGAnimatedEnumeration; - new(): SVGAnimatedEnumeration; -} - -interface DOML2DeprecatedSizeProperty { - size: number; -} - -interface HTMLUListElement extends HTMLElement, DOML2DeprecatedListSpaceReduction, DOML2DeprecatedListNumberingAndBulletStyle { -} -declare var HTMLUListElement: { - prototype: HTMLUListElement; - new(): HTMLUListElement; -} - -interface SVGRectElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { - y: SVGAnimatedLength; - width: SVGAnimatedLength; - ry: SVGAnimatedLength; - rx: SVGAnimatedLength; - x: SVGAnimatedLength; - height: SVGAnimatedLength; -} -declare var SVGRectElement: { - prototype: SVGRectElement; - new(): SVGRectElement; -} - -interface ErrorEventHandler { - (event: Event, source: string, fileno: number, columnNumber: number): void; -} - -interface HTMLDivElement extends HTMLElement, MSDataBindingExtensions { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves whether the browser automatically performs wordwrap. - */ - noWrap: boolean; -} -declare var HTMLDivElement: { - prototype: HTMLDivElement; - new(): HTMLDivElement; -} - -interface DOML2DeprecatedBorderStyle { - border: string; -} - -interface NamedNodeMap { - length: number; - removeNamedItemNS(namespaceURI: string, localName: string): Attr; - item(index: number): Attr; - [index: number]: Attr; - removeNamedItem(name: string): Attr; - getNamedItem(name: string): Attr; - // [name: string]: Attr; - setNamedItem(arg: Attr): Attr; - getNamedItemNS(namespaceURI: string, localName: string): Attr; - setNamedItemNS(arg: Attr): Attr; -} -declare var NamedNodeMap: { - prototype: NamedNodeMap; - new(): NamedNodeMap; -} - -interface MediaList { - length: number; - mediaText: string; - deleteMedium(oldMedium: string): void; - appendMedium(newMedium: string): void; - item(index: number): string; - [index: number]: string; - toString(): string; -} -declare var MediaList: { - prototype: MediaList; - new(): MediaList; -} - -interface SVGPathSegCurvetoQuadraticSmoothAbs extends SVGPathSeg { - y: number; - x: number; -} -declare var SVGPathSegCurvetoQuadraticSmoothAbs: { - prototype: SVGPathSegCurvetoQuadraticSmoothAbs; - new(): SVGPathSegCurvetoQuadraticSmoothAbs; -} - -interface SVGPathSegCurvetoCubicSmoothRel extends SVGPathSeg { - y: number; - x2: number; - x: number; - y2: number; -} -declare var SVGPathSegCurvetoCubicSmoothRel: { - prototype: SVGPathSegCurvetoCubicSmoothRel; - new(): SVGPathSegCurvetoCubicSmoothRel; -} - -interface SVGLengthList { - numberOfItems: number; - replaceItem(newItem: SVGLength, index: number): SVGLength; - getItem(index: number): SVGLength; - clear(): void; - appendItem(newItem: SVGLength): SVGLength; - initialize(newItem: SVGLength): SVGLength; - removeItem(index: number): SVGLength; - insertItemBefore(newItem: SVGLength, index: number): SVGLength; -} -declare var SVGLengthList: { - prototype: SVGLengthList; - new(): SVGLengthList; -} - -interface ProcessingInstruction extends Node { - target: string; - data: string; -} -declare var ProcessingInstruction: { - prototype: ProcessingInstruction; - new(): ProcessingInstruction; -} - -interface MSWindowExtensions { - status: string; - onmouseleave: (ev: MouseEvent) => any; - screenLeft: number; - offscreenBuffering: any; - maxConnectionsPerServer: number; - onmouseenter: (ev: MouseEvent) => any; - clipboardData: DataTransfer; - defaultStatus: string; - clientInformation: Navigator; - closed: boolean; - onhelp: (ev: Event) => any; - external: External; - event: MSEventObj; - onfocusout: (ev: FocusEvent) => any; - screenTop: number; - onfocusin: (ev: FocusEvent) => any; - showModelessDialog(url?: string, argument?: any, options?: any): Window; - navigate(url: string): void; - resizeBy(x?: number, y?: number): void; - item(index: any): any; - resizeTo(x?: number, y?: number): void; - createPopup(arguments?: any): MSPopupWindow; - toStaticHTML(html: string): string; - execScript(code: string, language?: string): any; - msWriteProfilerMark(profilerMarkName: string): void; - moveTo(x?: number, y?: number): void; - moveBy(x?: number, y?: number): void; - showHelp(url: string, helpArg?: any, features?: string): void; - captureEvents(): void; - releaseEvents(): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface MSBehaviorUrnsCollection { - length: number; - item(index: number): string; -} -declare var MSBehaviorUrnsCollection: { - prototype: MSBehaviorUrnsCollection; - new(): MSBehaviorUrnsCollection; -} - -interface CSSFontFaceRule extends CSSRule { - style: CSSStyleDeclaration; -} -declare var CSSFontFaceRule: { - prototype: CSSFontFaceRule; - new(): CSSFontFaceRule; -} - -interface DOML2DeprecatedBackgroundStyle { - background: string; -} - -interface TextEvent extends UIEvent { - inputMethod: number; - data: string; - locale: string; - initTextEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, inputMethod: number, locale: string): void; - DOM_INPUT_METHOD_KEYBOARD: number; - DOM_INPUT_METHOD_DROP: number; - DOM_INPUT_METHOD_IME: number; - DOM_INPUT_METHOD_SCRIPT: number; - DOM_INPUT_METHOD_VOICE: number; - DOM_INPUT_METHOD_UNKNOWN: number; - DOM_INPUT_METHOD_PASTE: number; - DOM_INPUT_METHOD_HANDWRITING: number; - DOM_INPUT_METHOD_OPTION: number; - DOM_INPUT_METHOD_MULTIMODAL: number; -} -declare var TextEvent: { - prototype: TextEvent; - new(): TextEvent; - DOM_INPUT_METHOD_KEYBOARD: number; - DOM_INPUT_METHOD_DROP: number; - DOM_INPUT_METHOD_IME: number; - DOM_INPUT_METHOD_SCRIPT: number; - DOM_INPUT_METHOD_VOICE: number; - DOM_INPUT_METHOD_UNKNOWN: number; - DOM_INPUT_METHOD_PASTE: number; - DOM_INPUT_METHOD_HANDWRITING: number; - DOM_INPUT_METHOD_OPTION: number; - DOM_INPUT_METHOD_MULTIMODAL: number; -} - -interface DocumentFragment extends Node, NodeSelector, MSEventAttachmentTarget, MSNodeExtensions { -} -declare var DocumentFragment: { - prototype: DocumentFragment; - new(): DocumentFragment; -} - -interface SVGPolylineElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGAnimatedPoints, SVGTests, SVGExternalResourcesRequired { -} -declare var SVGPolylineElement: { - prototype: SVGPolylineElement; - new(): SVGPolylineElement; -} - -interface SVGAnimatedPathData { - pathSegList: SVGPathSegList; -} - -interface Position { - timestamp: Date; - coords: Coordinates; -} -declare var Position: { - prototype: Position; - new(): Position; -} - -interface BookmarkCollection { - length: number; - item(index: number): any; - [index: number]: any; -} -declare var BookmarkCollection: { - prototype: BookmarkCollection; - new(): BookmarkCollection; -} - -interface PerformanceMark extends PerformanceEntry { -} -declare var PerformanceMark: { - prototype: PerformanceMark; - new(): PerformanceMark; -} - -interface CSSPageRule extends CSSRule { - pseudoClass: string; - selectorText: string; - selector: string; - style: CSSStyleDeclaration; -} -declare var CSSPageRule: { - prototype: CSSPageRule; - new(): CSSPageRule; -} - -interface HTMLBRElement extends HTMLElement { - /** - * Sets or retrieves the side on which floating objects are not to be positioned when any IHTMLBlockElement is inserted into the document. - */ - clear: string; -} -declare var HTMLBRElement: { - prototype: HTMLBRElement; - new(): HTMLBRElement; -} - -interface MSNavigatorExtensions { - userLanguage: string; - plugins: MSPluginsCollection; - cookieEnabled: boolean; - appCodeName: string; - cpuClass: string; - appMinorVersion: string; - connectionSpeed: number; - browserLanguage: string; - mimeTypes: MSMimeTypesCollection; - systemLanguage: string; - language: string; - javaEnabled(): boolean; - taintEnabled(): boolean; -} - -interface HTMLSpanElement extends HTMLElement, MSDataBindingExtensions { -} -declare var HTMLSpanElement: { - prototype: HTMLSpanElement; - new(): HTMLSpanElement; -} - -interface HTMLHeadElement extends HTMLElement { - profile: string; -} -declare var HTMLHeadElement: { - prototype: HTMLHeadElement; - new(): HTMLHeadElement; -} - -interface HTMLHeadingElement extends HTMLElement, DOML2DeprecatedTextFlowControl { - /** - * Sets or retrieves a value that indicates the table alignment. - */ - align: string; -} -declare var HTMLHeadingElement: { - prototype: HTMLHeadingElement; - new(): HTMLHeadingElement; -} - -interface HTMLFormElement extends HTMLElement, MSHTMLCollectionExtensions { - /** - * Sets or retrieves the number of objects in a collection. - */ - length: number; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; - /** - * Sets or retrieves a list of character encodings for input data that must be accepted by the server processing the form. - */ - acceptCharset: string; - /** - * Sets or retrieves the encoding type for the form. - */ - enctype: string; - /** - * Retrieves a collection, in source order, of all controls in a given form. - */ - elements: HTMLCollection; - /** - * Sets or retrieves the URL to which the form content is sent for processing. - */ - action: string; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Sets or retrieves how to send the form data to the server. - */ - method: string; - /** - * Sets or retrieves the MIME encoding for the form. - */ - encoding: string; - /** - * Specifies whether autocomplete is applied to an editable text field. - */ - autocomplete: string; - /** - * Designates a form that is not validated when submitted. - */ - noValidate: boolean; - /** - * Fires when the user resets a form. - */ - reset(): void; - /** - * Retrieves a form object or an object from an elements collection. - * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is a Number, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made. - * @param index Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned. - */ - item(name?: any, index?: any): any; - /** - * Fires when a FORM is about to be submitted. - */ - submit(): void; - /** - * Retrieves a form object or an object from an elements collection. - */ - namedItem(name: string): any; - [name: string]: any; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; -} -declare var HTMLFormElement: { - prototype: HTMLFormElement; - new(): HTMLFormElement; -} - -interface SVGZoomAndPan { - zoomAndPan: number; - SVG_ZOOMANDPAN_MAGNIFY: number; - SVG_ZOOMANDPAN_UNKNOWN: number; - SVG_ZOOMANDPAN_DISABLE: number; -} -declare var SVGZoomAndPan: SVGZoomAndPan; - -interface HTMLMediaElement extends HTMLElement { - /** - * Gets the earliest possible position, in seconds, that the playback can begin. - */ - initialTime: number; - /** - * Gets TimeRanges for the current media resource that has been played. - */ - played: TimeRanges; - /** - * Gets the address or URL of the current media resource that is selected by IHTMLMediaElement. - */ - currentSrc: string; - readyState: any; - /** - * The autobuffer element is not supported by Internet Explorer 9. Use the preload element instead. - */ - autobuffer: boolean; - /** - * Gets or sets a flag to specify whether playback should restart after it completes. - */ - loop: boolean; - /** - * Gets information about whether the playback has ended or not. - */ - ended: boolean; - /** - * Gets a collection of buffered time ranges. - */ - buffered: TimeRanges; - /** - * Returns an object representing the current error state of the audio or video element. - */ - error: MediaError; - /** - * Returns a TimeRanges object that represents the ranges of the current media resource that can be seeked. - */ - seekable: TimeRanges; - /** - * Gets or sets a value that indicates whether to start playing the media automatically. - */ - autoplay: boolean; - /** - * Gets or sets a flag that indicates whether the client provides a set of controls for the media (in case the developer does not include controls for the player). - */ - controls: boolean; - /** - * Gets or sets the volume level for audio portions of the media element. - */ - volume: number; - /** - * The address or URL of the a media resource that is to be considered. - */ - src: string; - /** - * Gets or sets the current rate of speed for the media resource to play. This speed is expressed as a multiple of the normal speed of the media resource. - */ - playbackRate: number; - /** - * Returns the duration in seconds of the current media resource. A NaN value is returned if duration is not available, or Infinity if the media resource is streaming. - */ - duration: number; - /** - * Gets or sets a flag that indicates whether the audio (either audio or the audio track on video media) is muted. - */ - muted: boolean; - /** - * Gets or sets the default playback rate when the user is not using fast forward or reverse for a video or audio resource. - */ - defaultPlaybackRate: number; - /** - * Gets a flag that specifies whether playback is paused. - */ - paused: boolean; - /** - * Gets a flag that indicates whether the the client is currently moving to a new playback position in the media resource. - */ - seeking: boolean; - /** - * Gets or sets the current playback position, in seconds. - */ - currentTime: number; - /** - * Gets or sets the current playback position, in seconds. - */ - preload: string; - /** - * Gets the current network activity for the element. - */ - networkState: number; - /** - * Specifies the purpose of the audio or video media, such as background audio or alerts. - */ - msAudioCategory: string; - /** - * Specifies whether or not to enable low-latency playback on the media element. - */ - msRealTime: boolean; - /** - * Gets or sets the primary DLNA PlayTo device. - */ - msPlayToPrimary: boolean; - textTracks: TextTrackList; - /** - * Gets or sets whether the DLNA PlayTo device is available. - */ - msPlayToDisabled: boolean; - /** - * Returns an AudioTrackList object with the audio tracks for a given video element. - */ - audioTracks: AudioTrackList; - /** - * Gets the source associated with the media element for use by the PlayToManager. - */ - msPlayToSource: any; - /** - * Specifies the output device id that the audio will be sent to. - */ - msAudioDeviceType: string; - /** - * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. - */ - msPlayToPreferredSourceUri: string; - onmsneedkey: (ev: MSMediaKeyNeededEvent) => any; - /** - * Gets the MSMediaKeys object, which is used for decrypting media data, that is associated with this media element. - */ - msKeys: MSMediaKeys; - msGraphicsTrustStatus: MSGraphicsTrust; - /** - * Pauses the current playback and sets paused to TRUE. This can be used to test whether the media is playing or paused. You can also use the pause or play events to tell whether the media is playing or not. - */ - pause(): void; - /** - * Loads and starts playback of a media resource. - */ - play(): void; - /** - * Fires immediately after the client loads the object. - */ - load(): void; - /** - * Returns a string that specifies whether the client can play a given media resource type. - */ - canPlayType(type: string): string; - /** - * Clears all effects from the media pipeline. - */ - msClearEffects(): void; - /** - * Specifies the media protection manager for a given media pipeline. - */ - msSetMediaProtectionManager(mediaProtectionManager?: any): void; - /** - * Inserts the specified audio effect into media pipeline. - */ - msInsertAudioEffect(activatableClassId: string, effectRequired: boolean, config?: any): void; - msSetMediaKeys(mediaKeys: MSMediaKeys): void; - addTextTrack(kind: string, label?: string, language?: string): TextTrack; - HAVE_METADATA: number; - HAVE_CURRENT_DATA: number; - HAVE_NOTHING: number; - NETWORK_NO_SOURCE: number; - HAVE_ENOUGH_DATA: number; - NETWORK_EMPTY: number; - NETWORK_LOADING: number; - NETWORK_IDLE: number; - HAVE_FUTURE_DATA: number; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msneedkey", listener: (ev: MSMediaKeyNeededEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var HTMLMediaElement: { - prototype: HTMLMediaElement; - new(): HTMLMediaElement; - HAVE_METADATA: number; - HAVE_CURRENT_DATA: number; - HAVE_NOTHING: number; - NETWORK_NO_SOURCE: number; - HAVE_ENOUGH_DATA: number; - NETWORK_EMPTY: number; - NETWORK_LOADING: number; - NETWORK_IDLE: number; - HAVE_FUTURE_DATA: number; -} - -interface ElementCSSInlineStyle { - runtimeStyle: MSStyleCSSProperties; - currentStyle: MSCurrentStyleCSSProperties; - doScroll(component?: any): void; - componentFromPoint(x: number, y: number): string; -} - -interface DOMParser { - parseFromString(source: string, mimeType: string): Document; -} -declare var DOMParser: { - prototype: DOMParser; - new(): DOMParser; -} - -interface MSMimeTypesCollection { - length: number; -} -declare var MSMimeTypesCollection: { - prototype: MSMimeTypesCollection; - new(): MSMimeTypesCollection; -} - -interface StyleSheet { - disabled: boolean; - ownerNode: Node; - parentStyleSheet: StyleSheet; - href: string; - media: MediaList; - type: string; - title: string; -} -declare var StyleSheet: { - prototype: StyleSheet; - new(): StyleSheet; -} - -interface SVGTextPathElement extends SVGTextContentElement, SVGURIReference { - startOffset: SVGAnimatedLength; - method: SVGAnimatedEnumeration; - spacing: SVGAnimatedEnumeration; - TEXTPATH_SPACINGTYPE_EXACT: number; - TEXTPATH_METHODTYPE_STRETCH: number; - TEXTPATH_SPACINGTYPE_AUTO: number; - TEXTPATH_SPACINGTYPE_UNKNOWN: number; - TEXTPATH_METHODTYPE_UNKNOWN: number; - TEXTPATH_METHODTYPE_ALIGN: number; -} -declare var SVGTextPathElement: { - prototype: SVGTextPathElement; - new(): SVGTextPathElement; - TEXTPATH_SPACINGTYPE_EXACT: number; - TEXTPATH_METHODTYPE_STRETCH: number; - TEXTPATH_SPACINGTYPE_AUTO: number; - TEXTPATH_SPACINGTYPE_UNKNOWN: number; - TEXTPATH_METHODTYPE_UNKNOWN: number; - TEXTPATH_METHODTYPE_ALIGN: number; -} - -interface HTMLDTElement extends HTMLElement { - /** - * Sets or retrieves whether the browser automatically performs wordwrap. - */ - noWrap: boolean; -} -declare var HTMLDTElement: { - prototype: HTMLDTElement; - new(): HTMLDTElement; -} - -interface NodeList { - length: number; - item(index: number): Node; - [index: number]: Node; -} -declare var NodeList: { - prototype: NodeList; - new(): NodeList; -} - -interface XMLSerializer { - serializeToString(target: Node): string; -} -declare var XMLSerializer: { - prototype: XMLSerializer; - new(): XMLSerializer; -} - -interface PerformanceMeasure extends PerformanceEntry { -} -declare var PerformanceMeasure: { - prototype: PerformanceMeasure; - new(): PerformanceMeasure; -} - -interface SVGGradientElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGExternalResourcesRequired, SVGURIReference { - spreadMethod: SVGAnimatedEnumeration; - gradientTransform: SVGAnimatedTransformList; - gradientUnits: SVGAnimatedEnumeration; - SVG_SPREADMETHOD_REFLECT: number; - SVG_SPREADMETHOD_PAD: number; - SVG_SPREADMETHOD_UNKNOWN: number; - SVG_SPREADMETHOD_REPEAT: number; -} -declare var SVGGradientElement: { - prototype: SVGGradientElement; - new(): SVGGradientElement; - SVG_SPREADMETHOD_REFLECT: number; - SVG_SPREADMETHOD_PAD: number; - SVG_SPREADMETHOD_UNKNOWN: number; - SVG_SPREADMETHOD_REPEAT: number; -} - -interface NodeFilter { - acceptNode(n: Node): number; - SHOW_ENTITY_REFERENCE: number; - SHOW_NOTATION: number; - SHOW_ENTITY: number; - SHOW_DOCUMENT: number; - SHOW_PROCESSING_INSTRUCTION: number; - FILTER_REJECT: number; - SHOW_CDATA_SECTION: number; - FILTER_ACCEPT: number; - SHOW_ALL: number; - SHOW_DOCUMENT_TYPE: number; - SHOW_TEXT: number; - SHOW_ELEMENT: number; - SHOW_COMMENT: number; - FILTER_SKIP: number; - SHOW_ATTRIBUTE: number; - SHOW_DOCUMENT_FRAGMENT: number; -} -declare var NodeFilter: NodeFilter; - -interface SVGNumberList { - numberOfItems: number; - replaceItem(newItem: SVGNumber, index: number): SVGNumber; - getItem(index: number): SVGNumber; - clear(): void; - appendItem(newItem: SVGNumber): SVGNumber; - initialize(newItem: SVGNumber): SVGNumber; - removeItem(index: number): SVGNumber; - insertItemBefore(newItem: SVGNumber, index: number): SVGNumber; -} -declare var SVGNumberList: { - prototype: SVGNumberList; - new(): SVGNumberList; -} - -interface MediaError { - code: number; - msExtendedCode: number; - MEDIA_ERR_ABORTED: number; - MEDIA_ERR_NETWORK: number; - MEDIA_ERR_SRC_NOT_SUPPORTED: number; - MEDIA_ERR_DECODE: number; - MS_MEDIA_ERR_ENCRYPTED: number; -} -declare var MediaError: { - prototype: MediaError; - new(): MediaError; - MEDIA_ERR_ABORTED: number; - MEDIA_ERR_NETWORK: number; - MEDIA_ERR_SRC_NOT_SUPPORTED: number; - MEDIA_ERR_DECODE: number; - MS_MEDIA_ERR_ENCRYPTED: number; -} - -interface HTMLFieldSetElement extends HTMLElement { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - validationMessage: string; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - validity: ValidityState; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - willValidate: boolean; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; -} -declare var HTMLFieldSetElement: { - prototype: HTMLFieldSetElement; - new(): HTMLFieldSetElement; -} - -interface HTMLBGSoundElement extends HTMLElement { - /** - * Sets or gets the value indicating how the volume of the background sound is divided between the left speaker and the right speaker. - */ - balance: any; - /** - * Sets or gets the volume setting for the sound. - */ - volume: any; - /** - * Sets or gets the URL of a sound to play. - */ - src: string; - /** - * Sets or retrieves the number of times a sound or video clip will loop when activated. - */ - loop: number; -} -declare var HTMLBGSoundElement: { - prototype: HTMLBGSoundElement; - new(): HTMLBGSoundElement; -} - -interface Comment extends CharacterData { - text: string; -} -declare var Comment: { - prototype: Comment; - new(): Comment; -} - -interface PerformanceResourceTiming extends PerformanceEntry { - redirectStart: number; - redirectEnd: number; - domainLookupEnd: number; - responseStart: number; - domainLookupStart: number; - fetchStart: number; - requestStart: number; - connectEnd: number; - connectStart: number; - initiatorType: string; - responseEnd: number; -} -declare var PerformanceResourceTiming: { - prototype: PerformanceResourceTiming; - new(): PerformanceResourceTiming; -} - -interface CanvasPattern { -} -declare var CanvasPattern: { - prototype: CanvasPattern; - new(): CanvasPattern; -} - -interface HTMLHRElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty { - /** - * Sets or retrieves the width of the object. - */ - width: number; - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves whether the horizontal rule is drawn with 3-D shading. - */ - noShade: boolean; -} -declare var HTMLHRElement: { - prototype: HTMLHRElement; - new(): HTMLHRElement; -} - -interface HTMLObjectElement extends HTMLElement, GetSVGDocument, DOML2DeprecatedMarginStyle, DOML2DeprecatedBorderStyle, DOML2DeprecatedAlignmentStyle, MSDataBindingExtensions, MSDataBindingRecordSetExtensions { - /** - * Sets or retrieves the width of the object. - */ - width: string; - /** - * Sets or retrieves the Internet media type for the code associated with the object. - */ - codeType: string; - /** - * Retrieves the contained object. - */ - object: any; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Sets or retrieves the URL of the file containing the compiled Java class. - */ - code: string; - /** - * Sets or retrieves a character string that can be used to implement your own archive functionality for the object. - */ - archive: string; - /** - * Sets or retrieves a message to be displayed while an object is loading. - */ - standby: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Sets or retrieves the class identifier for the object. - */ - classid: string; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. - */ - useMap: string; - /** - * Sets or retrieves the URL that references the data of the object. - */ - data: string; - /** - * Sets or retrieves the height of the object. - */ - height: string; - /** - * Retrieves the document object of the page or frame. - */ - contentDocument: Document; - /** - * Gets or sets the optional alternative HTML script to execute if the object fails to load. - */ - altHtml: string; - /** - * Sets or retrieves the URL of the component. - */ - codeBase: string; - declare: boolean; - /** - * Sets or retrieves the MIME type of the object. - */ - type: string; - /** - * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element. - */ - BaseHref: string; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - validationMessage: string; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - validity: ValidityState; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - willValidate: boolean; - /** - * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. - */ - msPlayToPreferredSourceUri: string; - /** - * Gets or sets the primary DLNA PlayTo device. - */ - msPlayToPrimary: boolean; - /** - * Gets or sets whether the DLNA PlayTo device is available. - */ - msPlayToDisabled: boolean; - readyState: number; - /** - * Gets the source associated with the media element for use by the PlayToManager. - */ - msPlayToSource: any; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; -} -declare var HTMLObjectElement: { - prototype: HTMLObjectElement; - new(): HTMLObjectElement; -} - -interface HTMLEmbedElement extends HTMLElement, GetSVGDocument { - /** - * Sets or retrieves the width of the object. - */ - width: string; - /** - * Retrieves the palette used for the embedded document. - */ - palette: string; - /** - * Sets or retrieves a URL to be loaded by the object. - */ - src: string; - /** - * Sets or retrieves the name of the object. - */ - name: string; - hidden: string; - /** - * Retrieves the URL of the plug-in used to view an embedded document. - */ - pluginspage: string; - /** - * Sets or retrieves the height of the object. - */ - height: string; - /** - * Sets or retrieves the height and width units of the embed object. - */ - units: string; - /** - * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. - */ - msPlayToPreferredSourceUri: string; - /** - * Gets or sets the primary DLNA PlayTo device. - */ - msPlayToPrimary: boolean; - /** - * Gets or sets whether the DLNA PlayTo device is available. - */ - msPlayToDisabled: boolean; - readyState: string; - /** - * Gets the source associated with the media element for use by the PlayToManager. - */ - msPlayToSource: any; -} -declare var HTMLEmbedElement: { - prototype: HTMLEmbedElement; - new(): HTMLEmbedElement; -} - -interface StorageEvent extends Event { - oldValue: any; - newValue: any; - url: string; - storageArea: Storage; - key: string; - initStorageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, keyArg: string, oldValueArg: any, newValueArg: any, urlArg: string, storageAreaArg: Storage): void; -} -declare var StorageEvent: { - prototype: StorageEvent; - new(): StorageEvent; -} - -interface CharacterData extends Node { - length: number; - data: string; - deleteData(offset: number, count: number): void; - replaceData(offset: number, count: number, arg: string): void; - appendData(arg: string): void; - insertData(offset: number, arg: string): void; - substringData(offset: number, count: number): string; -} -declare var CharacterData: { - prototype: CharacterData; - new(): CharacterData; -} - -interface HTMLOptGroupElement extends HTMLElement, MSDataBindingExtensions { - /** - * Sets or retrieves the ordinal position of an option in a list box. - */ - index: number; - /** - * Sets or retrieves the status of an option. - */ - defaultSelected: boolean; - /** - * Sets or retrieves the text string specified by the option tag. - */ - text: string; - /** - * Sets or retrieves the value which is returned to the server when the form control is submitted. - */ - value: string; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Sets or retrieves a value that you can use to implement your own label functionality for the object. - */ - label: string; - /** - * Sets or retrieves whether the option in the list box is the default item. - */ - selected: boolean; -} -declare var HTMLOptGroupElement: { - prototype: HTMLOptGroupElement; - new(): HTMLOptGroupElement; -} - -interface HTMLIsIndexElement extends HTMLElement { - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Sets or retrieves the URL to which the form content is sent for processing. - */ - action: string; - prompt: string; -} -declare var HTMLIsIndexElement: { - prototype: HTMLIsIndexElement; - new(): HTMLIsIndexElement; -} - -interface SVGPathSegLinetoRel extends SVGPathSeg { - y: number; - x: number; -} -declare var SVGPathSegLinetoRel: { - prototype: SVGPathSegLinetoRel; - new(): SVGPathSegLinetoRel; -} - -interface DOMException { - code: number; - message: string; - name: string; - toString(): string; - HIERARCHY_REQUEST_ERR: number; - NO_MODIFICATION_ALLOWED_ERR: number; - INVALID_MODIFICATION_ERR: number; - NAMESPACE_ERR: number; - INVALID_CHARACTER_ERR: number; - TYPE_MISMATCH_ERR: number; - ABORT_ERR: number; - INVALID_STATE_ERR: number; - SECURITY_ERR: number; - NETWORK_ERR: number; - WRONG_DOCUMENT_ERR: number; - QUOTA_EXCEEDED_ERR: number; - INDEX_SIZE_ERR: number; - DOMSTRING_SIZE_ERR: number; - SYNTAX_ERR: number; - SERIALIZE_ERR: number; - VALIDATION_ERR: number; - NOT_FOUND_ERR: number; - URL_MISMATCH_ERR: number; - PARSE_ERR: number; - NO_DATA_ALLOWED_ERR: number; - NOT_SUPPORTED_ERR: number; - INVALID_ACCESS_ERR: number; - INUSE_ATTRIBUTE_ERR: number; - INVALID_NODE_TYPE_ERR: number; - DATA_CLONE_ERR: number; - TIMEOUT_ERR: number; -} -declare var DOMException: { - prototype: DOMException; - new(): DOMException; - HIERARCHY_REQUEST_ERR: number; - NO_MODIFICATION_ALLOWED_ERR: number; - INVALID_MODIFICATION_ERR: number; - NAMESPACE_ERR: number; - INVALID_CHARACTER_ERR: number; - TYPE_MISMATCH_ERR: number; - ABORT_ERR: number; - INVALID_STATE_ERR: number; - SECURITY_ERR: number; - NETWORK_ERR: number; - WRONG_DOCUMENT_ERR: number; - QUOTA_EXCEEDED_ERR: number; - INDEX_SIZE_ERR: number; - DOMSTRING_SIZE_ERR: number; - SYNTAX_ERR: number; - SERIALIZE_ERR: number; - VALIDATION_ERR: number; - NOT_FOUND_ERR: number; - URL_MISMATCH_ERR: number; - PARSE_ERR: number; - NO_DATA_ALLOWED_ERR: number; - NOT_SUPPORTED_ERR: number; - INVALID_ACCESS_ERR: number; - INUSE_ATTRIBUTE_ERR: number; - INVALID_NODE_TYPE_ERR: number; - DATA_CLONE_ERR: number; - TIMEOUT_ERR: number; -} - -interface SVGAnimatedBoolean { - animVal: boolean; - baseVal: boolean; -} -declare var SVGAnimatedBoolean: { - prototype: SVGAnimatedBoolean; - new(): SVGAnimatedBoolean; -} - -interface MSCompatibleInfoCollection { - length: number; - item(index: number): MSCompatibleInfo; -} -declare var MSCompatibleInfoCollection: { - prototype: MSCompatibleInfoCollection; - new(): MSCompatibleInfoCollection; -} - -interface SVGSwitchElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { -} -declare var SVGSwitchElement: { - prototype: SVGSwitchElement; - new(): SVGSwitchElement; -} - -interface SVGPreserveAspectRatio { - align: number; - meetOrSlice: number; - SVG_PRESERVEASPECTRATIO_NONE: number; - SVG_PRESERVEASPECTRATIO_XMINYMID: number; - SVG_PRESERVEASPECTRATIO_XMAXYMIN: number; - SVG_PRESERVEASPECTRATIO_XMINYMAX: number; - SVG_PRESERVEASPECTRATIO_XMAXYMAX: number; - SVG_MEETORSLICE_UNKNOWN: number; - SVG_PRESERVEASPECTRATIO_XMAXYMID: number; - SVG_PRESERVEASPECTRATIO_XMIDYMAX: number; - SVG_PRESERVEASPECTRATIO_XMINYMIN: number; - SVG_MEETORSLICE_MEET: number; - SVG_PRESERVEASPECTRATIO_XMIDYMID: number; - SVG_PRESERVEASPECTRATIO_XMIDYMIN: number; - SVG_MEETORSLICE_SLICE: number; - SVG_PRESERVEASPECTRATIO_UNKNOWN: number; -} -declare var SVGPreserveAspectRatio: { - prototype: SVGPreserveAspectRatio; - new(): SVGPreserveAspectRatio; - SVG_PRESERVEASPECTRATIO_NONE: number; - SVG_PRESERVEASPECTRATIO_XMINYMID: number; - SVG_PRESERVEASPECTRATIO_XMAXYMIN: number; - SVG_PRESERVEASPECTRATIO_XMINYMAX: number; - SVG_PRESERVEASPECTRATIO_XMAXYMAX: number; - SVG_MEETORSLICE_UNKNOWN: number; - SVG_PRESERVEASPECTRATIO_XMAXYMID: number; - SVG_PRESERVEASPECTRATIO_XMIDYMAX: number; - SVG_PRESERVEASPECTRATIO_XMINYMIN: number; - SVG_MEETORSLICE_MEET: number; - SVG_PRESERVEASPECTRATIO_XMIDYMID: number; - SVG_PRESERVEASPECTRATIO_XMIDYMIN: number; - SVG_MEETORSLICE_SLICE: number; - SVG_PRESERVEASPECTRATIO_UNKNOWN: number; -} - -interface Attr extends Node { - expando: boolean; - specified: boolean; - ownerElement: Element; - value: string; - name: string; -} -declare var Attr: { - prototype: Attr; - new(): Attr; -} - -interface PerformanceNavigation { - redirectCount: number; - type: number; - toJSON(): any; - TYPE_RELOAD: number; - TYPE_RESERVED: number; - TYPE_BACK_FORWARD: number; - TYPE_NAVIGATE: number; -} -declare var PerformanceNavigation: { - prototype: PerformanceNavigation; - new(): PerformanceNavigation; - TYPE_RELOAD: number; - TYPE_RESERVED: number; - TYPE_BACK_FORWARD: number; - TYPE_NAVIGATE: number; -} - -interface SVGStopElement extends SVGElement, SVGStylable { - offset: SVGAnimatedNumber; -} -declare var SVGStopElement: { - prototype: SVGStopElement; - new(): SVGStopElement; -} - -interface PositionCallback { - (position: Position): void; -} - -interface SVGSymbolElement extends SVGElement, SVGStylable, SVGLangSpace, SVGFitToViewBox, SVGExternalResourcesRequired { -} -declare var SVGSymbolElement: { - prototype: SVGSymbolElement; - new(): SVGSymbolElement; -} - -interface SVGElementInstanceList { - length: number; - item(index: number): SVGElementInstance; -} -declare var SVGElementInstanceList: { - prototype: SVGElementInstanceList; - new(): SVGElementInstanceList; -} - -interface CSSRuleList { - length: number; - item(index: number): CSSRule; - [index: number]: CSSRule; -} -declare var CSSRuleList: { - prototype: CSSRuleList; - new(): CSSRuleList; -} - -interface MSDataBindingRecordSetExtensions { - recordset: any; - namedRecordset(dataMember: string, hierarchy?: any): any; -} - -interface LinkStyle { - styleSheet: StyleSheet; - sheet: StyleSheet; -} - -interface HTMLVideoElement extends HTMLMediaElement { - /** - * Gets or sets the width of the video element. - */ - width: number; - /** - * Gets the intrinsic width of a video in CSS pixels, or zero if the dimensions are not known. - */ - videoWidth: number; - /** - * Gets the intrinsic height of a video in CSS pixels, or zero if the dimensions are not known. - */ - videoHeight: number; - /** - * Gets or sets the height of the video element. - */ - height: number; - /** - * Gets or sets a URL of an image to display, for example, like a movie poster. This can be a still frame from the video, or another image if no video data is available. - */ - poster: string; - msIsStereo3D: boolean; - msStereo3DPackingMode: string; - onMSVideoOptimalLayoutChanged: (ev: any) => any; - onMSVideoFrameStepCompleted: (ev: any) => any; - msStereo3DRenderMode: string; - msIsLayoutOptimalForPlayback: boolean; - msHorizontalMirror: boolean; - onMSVideoFormatChanged: (ev: any) => any; - msZoom: boolean; - msInsertVideoEffect(activatableClassId: string, effectRequired: boolean, config?: any): void; - msSetVideoRectangle(left: number, top: number, right: number, bottom: number): void; - msFrameStep(forward: boolean): void; - getVideoPlaybackQuality(): VideoPlaybackQuality; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msneedkey", listener: (ev: MSMediaKeyNeededEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSVideoOptimalLayoutChanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "MSVideoFrameStepCompleted", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "MSVideoFormatChanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var HTMLVideoElement: { - prototype: HTMLVideoElement; - new(): HTMLVideoElement; -} - -interface ClientRectList { - length: number; - item(index: number): ClientRect; - [index: number]: ClientRect; -} -declare var ClientRectList: { - prototype: ClientRectList; - new(): ClientRectList; -} - -interface SVGMaskElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { - y: SVGAnimatedLength; - width: SVGAnimatedLength; - maskUnits: SVGAnimatedEnumeration; - maskContentUnits: SVGAnimatedEnumeration; - x: SVGAnimatedLength; - height: SVGAnimatedLength; -} -declare var SVGMaskElement: { - prototype: SVGMaskElement; - new(): SVGMaskElement; -} - -interface External { -} -declare var External: { - prototype: External; - new(): External; -} - -interface MSGestureEvent extends UIEvent { - offsetY: number; - translationY: number; - velocityExpansion: number; - velocityY: number; - velocityAngular: number; - translationX: number; - velocityX: number; - hwTimestamp: number; - offsetX: number; - screenX: number; - rotation: number; - expansion: number; - clientY: number; - screenY: number; - scale: number; - gestureObject: any; - clientX: number; - initGestureEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, offsetXArg: number, offsetYArg: number, translationXArg: number, translationYArg: number, scaleArg: number, expansionArg: number, rotationArg: number, velocityXArg: number, velocityYArg: number, velocityExpansionArg: number, velocityAngularArg: number, hwTimestampArg: number): void; - MSGESTURE_FLAG_BEGIN: number; - MSGESTURE_FLAG_END: number; - MSGESTURE_FLAG_CANCEL: number; - MSGESTURE_FLAG_INERTIA: number; - MSGESTURE_FLAG_NONE: number; -} -declare var MSGestureEvent: { - prototype: MSGestureEvent; - new(): MSGestureEvent; - MSGESTURE_FLAG_BEGIN: number; - MSGESTURE_FLAG_END: number; - MSGESTURE_FLAG_CANCEL: number; - MSGESTURE_FLAG_INERTIA: number; - MSGESTURE_FLAG_NONE: number; -} - -interface ErrorEvent extends Event { - colno: number; - filename: string; - error: any; - lineno: number; - message: string; - initErrorEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, messageArg: string, filenameArg: string, linenoArg: number): void; -} -declare var ErrorEvent: { - prototype: ErrorEvent; - new(): ErrorEvent; -} - -interface SVGFilterElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGLangSpace, SVGURIReference, SVGExternalResourcesRequired { - y: SVGAnimatedLength; - width: SVGAnimatedLength; - filterResX: SVGAnimatedInteger; - filterUnits: SVGAnimatedEnumeration; - primitiveUnits: SVGAnimatedEnumeration; - x: SVGAnimatedLength; - height: SVGAnimatedLength; - filterResY: SVGAnimatedInteger; - setFilterRes(filterResX: number, filterResY: number): void; -} -declare var SVGFilterElement: { - prototype: SVGFilterElement; - new(): SVGFilterElement; -} - -interface TrackEvent extends Event { - track: any; -} -declare var TrackEvent: { - prototype: TrackEvent; - new(): TrackEvent; -} - -interface SVGFEMergeNodeElement extends SVGElement { - in1: SVGAnimatedString; -} -declare var SVGFEMergeNodeElement: { - prototype: SVGFEMergeNodeElement; - new(): SVGFEMergeNodeElement; -} - -interface SVGFEFloodElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { -} -declare var SVGFEFloodElement: { - prototype: SVGFEFloodElement; - new(): SVGFEFloodElement; -} - -interface MSGesture { - target: Element; - addPointer(pointerId: number): void; - stop(): void; -} -declare var MSGesture: { - prototype: MSGesture; - new(): MSGesture; -} - -interface TextTrackCue extends EventTarget { - onenter: (ev: Event) => any; - track: TextTrack; - endTime: number; - text: string; - pauseOnExit: boolean; - id: string; - startTime: number; - onexit: (ev: Event) => any; - getCueAsHTML(): DocumentFragment; - addEventListener(type: "enter", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "exit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var TextTrackCue: { - prototype: TextTrackCue; - new(startTime: number, endTime: number, text: string): TextTrackCue; -} - -interface MSStreamReader extends MSBaseReader { - error: DOMError; - readAsArrayBuffer(stream: MSStream, size?: number): void; - readAsBlob(stream: MSStream, size?: number): void; - readAsDataURL(stream: MSStream, size?: number): void; - readAsText(stream: MSStream, encoding?: string, size?: number): void; -} -declare var MSStreamReader: { - prototype: MSStreamReader; - new(): MSStreamReader; -} - -interface DOMTokenList { - length: number; - contains(token: string): boolean; - remove(token: string): void; - toggle(token: string): boolean; - add(token: string): void; - item(index: number): string; - [index: number]: string; - toString(): string; -} -declare var DOMTokenList: { - prototype: DOMTokenList; - new(): DOMTokenList; -} - -interface SVGFEFuncAElement extends SVGComponentTransferFunctionElement { -} -declare var SVGFEFuncAElement: { - prototype: SVGFEFuncAElement; - new(): SVGFEFuncAElement; -} - -interface SVGFETileElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - in1: SVGAnimatedString; -} -declare var SVGFETileElement: { - prototype: SVGFETileElement; - new(): SVGFETileElement; -} - -interface SVGFEBlendElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - in2: SVGAnimatedString; - mode: SVGAnimatedEnumeration; - in1: SVGAnimatedString; - SVG_FEBLEND_MODE_DARKEN: number; - SVG_FEBLEND_MODE_UNKNOWN: number; - SVG_FEBLEND_MODE_MULTIPLY: number; - SVG_FEBLEND_MODE_NORMAL: number; - SVG_FEBLEND_MODE_SCREEN: number; - SVG_FEBLEND_MODE_LIGHTEN: number; -} -declare var SVGFEBlendElement: { - prototype: SVGFEBlendElement; - new(): SVGFEBlendElement; - SVG_FEBLEND_MODE_DARKEN: number; - SVG_FEBLEND_MODE_UNKNOWN: number; - SVG_FEBLEND_MODE_MULTIPLY: number; - SVG_FEBLEND_MODE_NORMAL: number; - SVG_FEBLEND_MODE_SCREEN: number; - SVG_FEBLEND_MODE_LIGHTEN: number; -} - -interface MessageChannel { - port2: MessagePort; - port1: MessagePort; -} -declare var MessageChannel: { - prototype: MessageChannel; - new(): MessageChannel; -} - -interface SVGFEMergeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { -} -declare var SVGFEMergeElement: { - prototype: SVGFEMergeElement; - new(): SVGFEMergeElement; -} - -interface TransitionEvent extends Event { - propertyName: string; - elapsedTime: number; - initTransitionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, propertyNameArg: string, elapsedTimeArg: number): void; -} -declare var TransitionEvent: { - prototype: TransitionEvent; - new(): TransitionEvent; -} - -interface MediaQueryList { - matches: boolean; - media: string; - addListener(listener: MediaQueryListListener): void; - removeListener(listener: MediaQueryListListener): void; -} -declare var MediaQueryList: { - prototype: MediaQueryList; - new(): MediaQueryList; -} - -interface DOMError { - name: string; - toString(): string; -} -declare var DOMError: { - prototype: DOMError; - new(): DOMError; -} - -interface CloseEvent extends Event { - wasClean: boolean; - reason: string; - code: number; - initCloseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, wasCleanArg: boolean, codeArg: number, reasonArg: string): void; -} -declare var CloseEvent: { - prototype: CloseEvent; - new(): CloseEvent; -} - -interface WebSocket extends EventTarget { - protocol: string; - readyState: number; - bufferedAmount: number; - onopen: (ev: Event) => any; - extensions: string; - onmessage: (ev: MessageEvent) => any; - onclose: (ev: CloseEvent) => any; - onerror: (ev: ErrorEvent) => any; - binaryType: string; - url: string; - close(code?: number, reason?: string): void; - send(data: any): void; - OPEN: number; - CLOSING: number; - CONNECTING: number; - CLOSED: number; - addEventListener(type: "open", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "close", listener: (ev: CloseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var WebSocket: { - prototype: WebSocket; - new(url: string, protocols?: string): WebSocket; - new(url: string, protocols?: string[]): WebSocket; - OPEN: number; - CLOSING: number; - CONNECTING: number; - CLOSED: number; -} - -interface SVGFEPointLightElement extends SVGElement { - y: SVGAnimatedNumber; - x: SVGAnimatedNumber; - z: SVGAnimatedNumber; -} -declare var SVGFEPointLightElement: { - prototype: SVGFEPointLightElement; - new(): SVGFEPointLightElement; -} - -interface ProgressEvent extends Event { - loaded: number; - lengthComputable: boolean; - total: number; - initProgressEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, lengthComputableArg: boolean, loadedArg: number, totalArg: number): void; -} -declare var ProgressEvent: { - prototype: ProgressEvent; - new(): ProgressEvent; -} - -interface IDBObjectStore { - indexNames: DOMStringList; - name: string; - transaction: IDBTransaction; - keyPath: string; - count(key?: any): IDBRequest; - add(value: any, key?: any): IDBRequest; - clear(): IDBRequest; - createIndex(name: string, keyPath: string, optionalParameters?: any): IDBIndex; - put(value: any, key?: any): IDBRequest; - openCursor(range?: any, direction?: string): IDBRequest; - deleteIndex(indexName: string): void; - index(name: string): IDBIndex; - get(key: any): IDBRequest; - delete(key: any): IDBRequest; -} -declare var IDBObjectStore: { - prototype: IDBObjectStore; - new(): IDBObjectStore; -} - -interface SVGFEGaussianBlurElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - stdDeviationX: SVGAnimatedNumber; - in1: SVGAnimatedString; - stdDeviationY: SVGAnimatedNumber; - setStdDeviation(stdDeviationX: number, stdDeviationY: number): void; -} -declare var SVGFEGaussianBlurElement: { - prototype: SVGFEGaussianBlurElement; - new(): SVGFEGaussianBlurElement; -} - -interface SVGFilterPrimitiveStandardAttributes extends SVGStylable { - y: SVGAnimatedLength; - width: SVGAnimatedLength; - x: SVGAnimatedLength; - height: SVGAnimatedLength; - result: SVGAnimatedString; -} - -interface IDBVersionChangeEvent extends Event { - newVersion: number; - oldVersion: number; -} -declare var IDBVersionChangeEvent: { - prototype: IDBVersionChangeEvent; - new(): IDBVersionChangeEvent; -} - -interface IDBIndex { - unique: boolean; - name: string; - keyPath: string; - objectStore: IDBObjectStore; - count(key?: any): IDBRequest; - getKey(key: any): IDBRequest; - openKeyCursor(range?: IDBKeyRange, direction?: string): IDBRequest; - get(key: any): IDBRequest; - openCursor(range?: IDBKeyRange, direction?: string): IDBRequest; -} -declare var IDBIndex: { - prototype: IDBIndex; - new(): IDBIndex; -} - -interface FileList { - length: number; - item(index: number): File; - [index: number]: File; -} -declare var FileList: { - prototype: FileList; - new(): FileList; -} - -interface IDBCursor { - source: any; - direction: string; - key: any; - primaryKey: any; - advance(count: number): void; - delete(): IDBRequest; - continue(key?: any): void; - update(value: any): IDBRequest; - PREV: string; - PREV_NO_DUPLICATE: string; - NEXT: string; - NEXT_NO_DUPLICATE: string; -} -declare var IDBCursor: { - prototype: IDBCursor; - new(): IDBCursor; - PREV: string; - PREV_NO_DUPLICATE: string; - NEXT: string; - NEXT_NO_DUPLICATE: string; -} - -interface SVGFESpecularLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - kernelUnitLengthY: SVGAnimatedNumber; - surfaceScale: SVGAnimatedNumber; - specularExponent: SVGAnimatedNumber; - in1: SVGAnimatedString; - kernelUnitLengthX: SVGAnimatedNumber; - specularConstant: SVGAnimatedNumber; -} -declare var SVGFESpecularLightingElement: { - prototype: SVGFESpecularLightingElement; - new(): SVGFESpecularLightingElement; -} - -interface File extends Blob { - lastModifiedDate: any; - name: string; -} -declare var File: { - prototype: File; - new(): File; -} - -interface URL { - revokeObjectURL(url: string): void; - createObjectURL(object: any, options?: ObjectURLOptions): string; -} -declare var URL: URL; - -interface IDBCursorWithValue extends IDBCursor { - value: any; -} -declare var IDBCursorWithValue: { - prototype: IDBCursorWithValue; - new(): IDBCursorWithValue; -} - -interface XMLHttpRequestEventTarget extends EventTarget { - onprogress: (ev: ProgressEvent) => any; - onerror: (ev: ErrorEvent) => any; - onload: (ev: Event) => any; - ontimeout: (ev: Event) => any; - onabort: (ev: UIEvent) => any; - onloadstart: (ev: Event) => any; - onloadend: (ev: ProgressEvent) => any; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "timeout", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var XMLHttpRequestEventTarget: { - prototype: XMLHttpRequestEventTarget; - new(): XMLHttpRequestEventTarget; -} - -interface IDBEnvironment { - msIndexedDB: IDBFactory; - indexedDB: IDBFactory; -} - -interface AudioTrackList extends EventTarget { - length: number; - onchange: (ev: Event) => any; - onaddtrack: (ev: TrackEvent) => any; - onremovetrack: (ev: any /*PluginArray*/) => any; - getTrackById(id: string): AudioTrack; - item(index: number): AudioTrack; - [index: number]: AudioTrack; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "addtrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void; - addEventListener(type: "removetrack", listener: (ev: any /*PluginArray*/) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var AudioTrackList: { - prototype: AudioTrackList; - new(): AudioTrackList; -} - -interface MSBaseReader extends EventTarget { - onprogress: (ev: ProgressEvent) => any; - readyState: number; - onabort: (ev: UIEvent) => any; - onloadend: (ev: ProgressEvent) => any; - onerror: (ev: ErrorEvent) => any; - onload: (ev: Event) => any; - onloadstart: (ev: Event) => any; - result: any; - abort(): void; - LOADING: number; - EMPTY: number; - DONE: number; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface SVGFEMorphologyElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - operator: SVGAnimatedEnumeration; - radiusX: SVGAnimatedNumber; - radiusY: SVGAnimatedNumber; - in1: SVGAnimatedString; - SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number; - SVG_MORPHOLOGY_OPERATOR_ERODE: number; - SVG_MORPHOLOGY_OPERATOR_DILATE: number; -} -declare var SVGFEMorphologyElement: { - prototype: SVGFEMorphologyElement; - new(): SVGFEMorphologyElement; - SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number; - SVG_MORPHOLOGY_OPERATOR_ERODE: number; - SVG_MORPHOLOGY_OPERATOR_DILATE: number; -} - -interface SVGFEFuncRElement extends SVGComponentTransferFunctionElement { -} -declare var SVGFEFuncRElement: { - prototype: SVGFEFuncRElement; - new(): SVGFEFuncRElement; -} - -interface WindowTimersExtension { - msSetImmediate(expression: any, ...args: any[]): number; - clearImmediate(handle: number): void; - msClearImmediate(handle: number): void; - setImmediate(expression: any, ...args: any[]): number; -} - -interface SVGFEDisplacementMapElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - in2: SVGAnimatedString; - xChannelSelector: SVGAnimatedEnumeration; - yChannelSelector: SVGAnimatedEnumeration; - scale: SVGAnimatedNumber; - in1: SVGAnimatedString; - SVG_CHANNEL_B: number; - SVG_CHANNEL_R: number; - SVG_CHANNEL_G: number; - SVG_CHANNEL_UNKNOWN: number; - SVG_CHANNEL_A: number; -} -declare var SVGFEDisplacementMapElement: { - prototype: SVGFEDisplacementMapElement; - new(): SVGFEDisplacementMapElement; - SVG_CHANNEL_B: number; - SVG_CHANNEL_R: number; - SVG_CHANNEL_G: number; - SVG_CHANNEL_UNKNOWN: number; - SVG_CHANNEL_A: number; -} - -interface AnimationEvent extends Event { - animationName: string; - elapsedTime: number; - initAnimationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, animationNameArg: string, elapsedTimeArg: number): void; -} -declare var AnimationEvent: { - prototype: AnimationEvent; - new(): AnimationEvent; -} - -interface SVGComponentTransferFunctionElement extends SVGElement { - tableValues: SVGAnimatedNumberList; - slope: SVGAnimatedNumber; - type: SVGAnimatedEnumeration; - exponent: SVGAnimatedNumber; - amplitude: SVGAnimatedNumber; - intercept: SVGAnimatedNumber; - offset: SVGAnimatedNumber; - SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number; - SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number; - SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number; - SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number; - SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number; - SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number; -} -declare var SVGComponentTransferFunctionElement: { - prototype: SVGComponentTransferFunctionElement; - new(): SVGComponentTransferFunctionElement; - SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number; - SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number; - SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number; - SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number; - SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number; - SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number; -} - -interface MSRangeCollection { - length: number; - item(index: number): Range; - [index: number]: Range; -} -declare var MSRangeCollection: { - prototype: MSRangeCollection; - new(): MSRangeCollection; -} - -interface SVGFEDistantLightElement extends SVGElement { - azimuth: SVGAnimatedNumber; - elevation: SVGAnimatedNumber; -} -declare var SVGFEDistantLightElement: { - prototype: SVGFEDistantLightElement; - new(): SVGFEDistantLightElement; -} - -interface SVGFEFuncBElement extends SVGComponentTransferFunctionElement { -} -declare var SVGFEFuncBElement: { - prototype: SVGFEFuncBElement; - new(): SVGFEFuncBElement; -} - -interface IDBKeyRange { - upper: any; - upperOpen: boolean; - lower: any; - lowerOpen: boolean; -} -declare var IDBKeyRange: { - prototype: IDBKeyRange; - new(): IDBKeyRange; - bound(lower: any, upper: any, lowerOpen?: boolean, upperOpen?: boolean): IDBKeyRange; - only(value: any): IDBKeyRange; - lowerBound(bound: any, open?: boolean): IDBKeyRange; - upperBound(bound: any, open?: boolean): IDBKeyRange; -} - -interface WindowConsole { - console: Console; -} - -interface IDBTransaction extends EventTarget { - oncomplete: (ev: Event) => any; - db: IDBDatabase; - mode: string; - error: DOMError; - onerror: (ev: ErrorEvent) => any; - onabort: (ev: UIEvent) => any; - abort(): void; - objectStore(name: string): IDBObjectStore; - READ_ONLY: string; - VERSION_CHANGE: string; - READ_WRITE: string; - addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var IDBTransaction: { - prototype: IDBTransaction; - new(): IDBTransaction; - READ_ONLY: string; - VERSION_CHANGE: string; - READ_WRITE: string; -} - -interface AudioTrack { - kind: string; - language: string; - id: string; - label: string; - enabled: boolean; - sourceBuffer: SourceBuffer; -} -declare var AudioTrack: { - prototype: AudioTrack; - new(): AudioTrack; -} - -interface SVGFEConvolveMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - orderY: SVGAnimatedInteger; - kernelUnitLengthY: SVGAnimatedNumber; - orderX: SVGAnimatedInteger; - preserveAlpha: SVGAnimatedBoolean; - kernelMatrix: SVGAnimatedNumberList; - edgeMode: SVGAnimatedEnumeration; - kernelUnitLengthX: SVGAnimatedNumber; - bias: SVGAnimatedNumber; - targetX: SVGAnimatedInteger; - targetY: SVGAnimatedInteger; - divisor: SVGAnimatedNumber; - in1: SVGAnimatedString; - SVG_EDGEMODE_WRAP: number; - SVG_EDGEMODE_DUPLICATE: number; - SVG_EDGEMODE_UNKNOWN: number; - SVG_EDGEMODE_NONE: number; -} -declare var SVGFEConvolveMatrixElement: { - prototype: SVGFEConvolveMatrixElement; - new(): SVGFEConvolveMatrixElement; - SVG_EDGEMODE_WRAP: number; - SVG_EDGEMODE_DUPLICATE: number; - SVG_EDGEMODE_UNKNOWN: number; - SVG_EDGEMODE_NONE: number; -} - -interface TextTrackCueList { - length: number; - item(index: number): TextTrackCue; - [index: number]: TextTrackCue; - getCueById(id: string): TextTrackCue; -} -declare var TextTrackCueList: { - prototype: TextTrackCueList; - new(): TextTrackCueList; -} - -interface CSSKeyframesRule extends CSSRule { - name: string; - cssRules: CSSRuleList; - findRule(rule: string): CSSKeyframeRule; - deleteRule(rule: string): void; - appendRule(rule: string): void; -} -declare var CSSKeyframesRule: { - prototype: CSSKeyframesRule; - new(): CSSKeyframesRule; -} - -interface SVGFETurbulenceElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - baseFrequencyX: SVGAnimatedNumber; - numOctaves: SVGAnimatedInteger; - type: SVGAnimatedEnumeration; - baseFrequencyY: SVGAnimatedNumber; - stitchTiles: SVGAnimatedEnumeration; - seed: SVGAnimatedNumber; - SVG_STITCHTYPE_UNKNOWN: number; - SVG_STITCHTYPE_NOSTITCH: number; - SVG_TURBULENCE_TYPE_UNKNOWN: number; - SVG_TURBULENCE_TYPE_TURBULENCE: number; - SVG_TURBULENCE_TYPE_FRACTALNOISE: number; - SVG_STITCHTYPE_STITCH: number; -} -declare var SVGFETurbulenceElement: { - prototype: SVGFETurbulenceElement; - new(): SVGFETurbulenceElement; - SVG_STITCHTYPE_UNKNOWN: number; - SVG_STITCHTYPE_NOSTITCH: number; - SVG_TURBULENCE_TYPE_UNKNOWN: number; - SVG_TURBULENCE_TYPE_TURBULENCE: number; - SVG_TURBULENCE_TYPE_FRACTALNOISE: number; - SVG_STITCHTYPE_STITCH: number; -} - -interface TextTrackList extends EventTarget { - length: number; - onaddtrack: (ev: TrackEvent) => any; - item(index: number): TextTrack; - [index: number]: TextTrack; - addEventListener(type: "addtrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var TextTrackList: { - prototype: TextTrackList; - new(): TextTrackList; -} - -interface SVGFEFuncGElement extends SVGComponentTransferFunctionElement { -} -declare var SVGFEFuncGElement: { - prototype: SVGFEFuncGElement; - new(): SVGFEFuncGElement; -} - -interface SVGFEColorMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - in1: SVGAnimatedString; - type: SVGAnimatedEnumeration; - values: SVGAnimatedNumberList; - SVG_FECOLORMATRIX_TYPE_SATURATE: number; - SVG_FECOLORMATRIX_TYPE_UNKNOWN: number; - SVG_FECOLORMATRIX_TYPE_MATRIX: number; - SVG_FECOLORMATRIX_TYPE_HUEROTATE: number; - SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number; -} -declare var SVGFEColorMatrixElement: { - prototype: SVGFEColorMatrixElement; - new(): SVGFEColorMatrixElement; - SVG_FECOLORMATRIX_TYPE_SATURATE: number; - SVG_FECOLORMATRIX_TYPE_UNKNOWN: number; - SVG_FECOLORMATRIX_TYPE_MATRIX: number; - SVG_FECOLORMATRIX_TYPE_HUEROTATE: number; - SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number; -} - -interface SVGFESpotLightElement extends SVGElement { - pointsAtY: SVGAnimatedNumber; - y: SVGAnimatedNumber; - limitingConeAngle: SVGAnimatedNumber; - specularExponent: SVGAnimatedNumber; - x: SVGAnimatedNumber; - pointsAtZ: SVGAnimatedNumber; - z: SVGAnimatedNumber; - pointsAtX: SVGAnimatedNumber; -} -declare var SVGFESpotLightElement: { - prototype: SVGFESpotLightElement; - new(): SVGFESpotLightElement; -} - -interface WindowBase64 { - btoa(rawString: string): string; - atob(encodedString: string): string; -} - -interface IDBDatabase extends EventTarget { - version: string; - name: string; - objectStoreNames: DOMStringList; - onerror: (ev: ErrorEvent) => any; - onabort: (ev: UIEvent) => any; - createObjectStore(name: string, optionalParameters?: any): IDBObjectStore; - close(): void; - transaction(storeNames: any, mode?: string): IDBTransaction; - deleteObjectStore(name: string): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var IDBDatabase: { - prototype: IDBDatabase; - new(): IDBDatabase; -} - -interface DOMStringList { - length: number; - contains(str: string): boolean; - item(index: number): string; - [index: number]: string; -} -declare var DOMStringList: { - prototype: DOMStringList; - new(): DOMStringList; -} - -interface IDBOpenDBRequest extends IDBRequest { - onupgradeneeded: (ev: IDBVersionChangeEvent) => any; - onblocked: (ev: Event) => any; - addEventListener(type: "success", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "upgradeneeded", listener: (ev: IDBVersionChangeEvent) => any, useCapture?: boolean): void; - addEventListener(type: "blocked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var IDBOpenDBRequest: { - prototype: IDBOpenDBRequest; - new(): IDBOpenDBRequest; -} - -interface HTMLProgressElement extends HTMLElement { - /** - * Sets or gets the current value of a progress element. The value must be a non-negative number between 0 and the max value. - */ - value: number; - /** - * Defines the maximum, or "done" value for a progress element. - */ - max: number; - /** - * Returns the quotient of value/max when the value attribute is set (determinate progress bar), or -1 when the value attribute is missing (indeterminate progress bar). - */ - position: number; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; -} -declare var HTMLProgressElement: { - prototype: HTMLProgressElement; - new(): HTMLProgressElement; -} - -interface MSLaunchUriCallback { - (): void; -} - -interface SVGFEOffsetElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - dy: SVGAnimatedNumber; - in1: SVGAnimatedString; - dx: SVGAnimatedNumber; -} -declare var SVGFEOffsetElement: { - prototype: SVGFEOffsetElement; - new(): SVGFEOffsetElement; -} - -interface MSUnsafeFunctionCallback { - (): any; -} - -interface TextTrack extends EventTarget { - language: string; - mode: any; - readyState: number; - activeCues: TextTrackCueList; - cues: TextTrackCueList; - oncuechange: (ev: Event) => any; - kind: string; - onload: (ev: Event) => any; - onerror: (ev: ErrorEvent) => any; - label: string; - addCue(cue: TextTrackCue): void; - removeCue(cue: TextTrackCue): void; - ERROR: number; - SHOWING: number; - LOADING: number; - LOADED: number; - NONE: number; - HIDDEN: number; - DISABLED: number; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var TextTrack: { - prototype: TextTrack; - new(): TextTrack; - ERROR: number; - SHOWING: number; - LOADING: number; - LOADED: number; - NONE: number; - HIDDEN: number; - DISABLED: number; -} - -interface MediaQueryListListener { - (mql: MediaQueryList): void; -} - -interface IDBRequest extends EventTarget { - source: any; - onsuccess: (ev: Event) => any; - error: DOMError; - transaction: IDBTransaction; - onerror: (ev: ErrorEvent) => any; - readyState: string; - result: any; - addEventListener(type: "success", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var IDBRequest: { - prototype: IDBRequest; - new(): IDBRequest; -} - -interface MessagePort extends EventTarget { - onmessage: (ev: MessageEvent) => any; - close(): void; - postMessage(message?: any, ports?: any): void; - start(): void; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var MessagePort: { - prototype: MessagePort; - new(): MessagePort; -} - -interface FileReader extends MSBaseReader { - error: DOMError; - readAsArrayBuffer(blob: Blob): void; - readAsDataURL(blob: Blob): void; - readAsText(blob: Blob, encoding?: string): void; -} -declare var FileReader: { - prototype: FileReader; - new(): FileReader; -} - -interface ApplicationCache extends EventTarget { - status: number; - ondownloading: (ev: Event) => any; - onprogress: (ev: ProgressEvent) => any; - onupdateready: (ev: Event) => any; - oncached: (ev: Event) => any; - onobsolete: (ev: Event) => any; - onerror: (ev: ErrorEvent) => any; - onchecking: (ev: Event) => any; - onnoupdate: (ev: Event) => any; - swapCache(): void; - abort(): void; - update(): void; - CHECKING: number; - UNCACHED: number; - UPDATEREADY: number; - DOWNLOADING: number; - IDLE: number; - OBSOLETE: number; - addEventListener(type: "downloading", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "updateready", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cached", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "obsolete", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "checking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "noupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var ApplicationCache: { - prototype: ApplicationCache; - new(): ApplicationCache; - CHECKING: number; - UNCACHED: number; - UPDATEREADY: number; - DOWNLOADING: number; - IDLE: number; - OBSOLETE: number; -} - -interface FrameRequestCallback { - (time: number): void; -} - -interface PopStateEvent extends Event { - state: any; - initPopStateEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, stateArg: any): void; -} -declare var PopStateEvent: { - prototype: PopStateEvent; - new(): PopStateEvent; -} - -interface CSSKeyframeRule extends CSSRule { - keyText: string; - style: CSSStyleDeclaration; -} -declare var CSSKeyframeRule: { - prototype: CSSKeyframeRule; - new(): CSSKeyframeRule; -} - -interface MSFileSaver { - msSaveBlob(blob: any, defaultName?: string): boolean; - msSaveOrOpenBlob(blob: any, defaultName?: string): boolean; -} - -interface MSStream { - type: string; - msDetachStream(): any; - msClose(): void; -} -declare var MSStream: { - prototype: MSStream; - new(): MSStream; -} - -interface MSBlobBuilder { - append(data: any, endings?: string): void; - getBlob(contentType?: string): Blob; -} -declare var MSBlobBuilder: { - prototype: MSBlobBuilder; - new(): MSBlobBuilder; -} - -interface DOMSettableTokenList extends DOMTokenList { - value: string; -} -declare var DOMSettableTokenList: { - prototype: DOMSettableTokenList; - new(): DOMSettableTokenList; -} - -interface IDBFactory { - open(name: string, version?: number): IDBOpenDBRequest; - cmp(first: any, second: any): number; - deleteDatabase(name: string): IDBOpenDBRequest; -} -declare var IDBFactory: { - prototype: IDBFactory; - new(): IDBFactory; -} - -interface MSPointerEvent extends MouseEvent { - width: number; - rotation: number; - pressure: number; - pointerType: any; - isPrimary: boolean; - tiltY: number; - height: number; - intermediatePoints: any; - currentPoint: any; - tiltX: number; - hwTimestamp: number; - pointerId: number; - initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void; - getCurrentPoint(element: Element): void; - getIntermediatePoints(element: Element): void; - MSPOINTER_TYPE_PEN: number; - MSPOINTER_TYPE_MOUSE: number; - MSPOINTER_TYPE_TOUCH: number; -} -declare var MSPointerEvent: { - prototype: MSPointerEvent; - new(): MSPointerEvent; - MSPOINTER_TYPE_PEN: number; - MSPOINTER_TYPE_MOUSE: number; - MSPOINTER_TYPE_TOUCH: number; -} - -interface MSManipulationEvent extends UIEvent { - lastState: number; - currentState: number; - initMSManipulationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, lastState: number, currentState: number): void; - MS_MANIPULATION_STATE_STOPPED: number; - MS_MANIPULATION_STATE_ACTIVE: number; - MS_MANIPULATION_STATE_INERTIA: number; - MS_MANIPULATION_STATE_SELECTING: number; - MS_MANIPULATION_STATE_COMMITTED: number; - MS_MANIPULATION_STATE_PRESELECT: number; - MS_MANIPULATION_STATE_DRAGGING: number; - MS_MANIPULATION_STATE_CANCELLED: number; -} -declare var MSManipulationEvent: { - prototype: MSManipulationEvent; - new(): MSManipulationEvent; - MS_MANIPULATION_STATE_STOPPED: number; - MS_MANIPULATION_STATE_ACTIVE: number; - MS_MANIPULATION_STATE_INERTIA: number; - MS_MANIPULATION_STATE_SELECTING: number; - MS_MANIPULATION_STATE_COMMITTED: number; - MS_MANIPULATION_STATE_PRESELECT: number; - MS_MANIPULATION_STATE_DRAGGING: number; - MS_MANIPULATION_STATE_CANCELLED: number; -} - -interface FormData { - append(name: any, value: any, blobName?: string): void; -} -declare var FormData: { - prototype: FormData; - new(): FormData; -} - -interface HTMLDataListElement extends HTMLElement { - options: HTMLCollection; -} -declare var HTMLDataListElement: { - prototype: HTMLDataListElement; - new(): HTMLDataListElement; -} - -interface SVGFEImageElement extends SVGElement, SVGLangSpace, SVGFilterPrimitiveStandardAttributes, SVGURIReference, SVGExternalResourcesRequired { - preserveAspectRatio: SVGAnimatedPreserveAspectRatio; -} -declare var SVGFEImageElement: { - prototype: SVGFEImageElement; - new(): SVGFEImageElement; -} - -interface AbstractWorker extends EventTarget { - onerror: (ev: ErrorEvent) => any; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface SVGFECompositeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - operator: SVGAnimatedEnumeration; - in2: SVGAnimatedString; - k2: SVGAnimatedNumber; - k1: SVGAnimatedNumber; - k3: SVGAnimatedNumber; - in1: SVGAnimatedString; - k4: SVGAnimatedNumber; - SVG_FECOMPOSITE_OPERATOR_OUT: number; - SVG_FECOMPOSITE_OPERATOR_OVER: number; - SVG_FECOMPOSITE_OPERATOR_XOR: number; - SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number; - SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number; - SVG_FECOMPOSITE_OPERATOR_IN: number; - SVG_FECOMPOSITE_OPERATOR_ATOP: number; -} -declare var SVGFECompositeElement: { - prototype: SVGFECompositeElement; - new(): SVGFECompositeElement; - SVG_FECOMPOSITE_OPERATOR_OUT: number; - SVG_FECOMPOSITE_OPERATOR_OVER: number; - SVG_FECOMPOSITE_OPERATOR_XOR: number; - SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number; - SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number; - SVG_FECOMPOSITE_OPERATOR_IN: number; - SVG_FECOMPOSITE_OPERATOR_ATOP: number; -} - -interface ValidityState { - customError: boolean; - valueMissing: boolean; - stepMismatch: boolean; - rangeUnderflow: boolean; - rangeOverflow: boolean; - typeMismatch: boolean; - patternMismatch: boolean; - tooLong: boolean; - valid: boolean; -} -declare var ValidityState: { - prototype: ValidityState; - new(): ValidityState; -} - -interface HTMLTrackElement extends HTMLElement { - kind: string; - src: string; - srclang: string; - track: TextTrack; - label: string; - default: boolean; - readyState: number; - ERROR: number; - LOADING: number; - LOADED: number; - NONE: number; -} -declare var HTMLTrackElement: { - prototype: HTMLTrackElement; - new(): HTMLTrackElement; - ERROR: number; - LOADING: number; - LOADED: number; - NONE: number; -} - -interface MSApp { - createFileFromStorageFile(storageFile: any): File; - createBlobFromRandomAccessStream(type: string, seeker: any): Blob; - createStreamFromInputStream(type: string, inputStream: any): MSStream; - terminateApp(exceptionObject: any): void; - createDataPackage(object: any): any; - execUnsafeLocalFunction(unsafeFunction: MSUnsafeFunctionCallback): any; - getHtmlPrintDocumentSource(htmlDoc: any): any; - addPublicLocalApplicationUri(uri: string): void; - createDataPackageFromSelection(): any; - getViewOpener(): MSAppView; - suppressSubdownloadCredentialPrompts(suppress: boolean): void; - execAsyncAtPriority(asynchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): void; - isTaskScheduledAtPriorityOrHigher(priority: string): boolean; - execAtPriority(synchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): any; - createNewView(uri: string): MSAppView; - getCurrentPriority(): string; - NORMAL: string; - HIGH: string; - IDLE: string; - CURRENT: string; -} -declare var MSApp: MSApp; - -interface SVGFEComponentTransferElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - in1: SVGAnimatedString; -} -declare var SVGFEComponentTransferElement: { - prototype: SVGFEComponentTransferElement; - new(): SVGFEComponentTransferElement; -} - -interface SVGFEDiffuseLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - kernelUnitLengthY: SVGAnimatedNumber; - surfaceScale: SVGAnimatedNumber; - in1: SVGAnimatedString; - kernelUnitLengthX: SVGAnimatedNumber; - diffuseConstant: SVGAnimatedNumber; -} -declare var SVGFEDiffuseLightingElement: { - prototype: SVGFEDiffuseLightingElement; - new(): SVGFEDiffuseLightingElement; -} - -interface MSCSSMatrix { - m24: number; - m34: number; - a: number; - d: number; - m32: number; - m41: number; - m11: number; - f: number; - e: number; - m23: number; - m14: number; - m33: number; - m22: number; - m21: number; - c: number; - m12: number; - b: number; - m42: number; - m31: number; - m43: number; - m13: number; - m44: number; - multiply(secondMatrix: MSCSSMatrix): MSCSSMatrix; - skewY(angle: number): MSCSSMatrix; - setMatrixValue(value: string): void; - inverse(): MSCSSMatrix; - rotateAxisAngle(x: number, y: number, z: number, angle: number): MSCSSMatrix; - toString(): string; - rotate(angleX: number, angleY?: number, angleZ?: number): MSCSSMatrix; - translate(x: number, y: number, z?: number): MSCSSMatrix; - scale(scaleX: number, scaleY?: number, scaleZ?: number): MSCSSMatrix; - skewX(angle: number): MSCSSMatrix; -} -declare var MSCSSMatrix: { - prototype: MSCSSMatrix; - new(text?: string): MSCSSMatrix; -} - -interface Worker extends AbstractWorker { - onmessage: (ev: MessageEvent) => any; - postMessage(message: any, ports?: any): void; - terminate(): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var Worker: { - prototype: Worker; - new(stringUrl: string): Worker; -} - -interface MSExecAtPriorityFunctionCallback { - (...args: any[]): any; -} - -interface MSGraphicsTrust { - status: string; - constrictionActive: boolean; -} -declare var MSGraphicsTrust: { - prototype: MSGraphicsTrust; - new(): MSGraphicsTrust; -} - -interface SubtleCrypto { - unwrapKey(wrappedKey: ArrayBufferView, keyAlgorithm: any, keyEncryptionKey: Key, extractable?: boolean, keyUsages?: string[]): KeyOperation; - encrypt(algorithm: any, key: Key, buffer?: ArrayBufferView): CryptoOperation; - importKey(format: string, keyData: ArrayBufferView, algorithm: any, extractable?: boolean, keyUsages?: string[]): KeyOperation; - wrapKey(key: Key, keyEncryptionKey: Key, keyWrappingAlgorithm: any): KeyOperation; - verify(algorithm: any, key: Key, signature: ArrayBufferView, buffer?: ArrayBufferView): CryptoOperation; - deriveKey(algorithm: any, baseKey: Key, derivedKeyType: any, extractable?: boolean, keyUsages?: string[]): KeyOperation; - digest(algorithm: any, buffer?: ArrayBufferView): CryptoOperation; - exportKey(format: string, key: Key): KeyOperation; - generateKey(algorithm: any, extractable?: boolean, keyUsages?: string[]): KeyOperation; - sign(algorithm: any, key: Key, buffer?: ArrayBufferView): CryptoOperation; - decrypt(algorithm: any, key: Key, buffer?: ArrayBufferView): CryptoOperation; -} -declare var SubtleCrypto: { - prototype: SubtleCrypto; - new(): SubtleCrypto; -} - -interface Crypto extends RandomSource { - subtle: SubtleCrypto; -} -declare var Crypto: { - prototype: Crypto; - new(): Crypto; -} - -interface VideoPlaybackQuality { - totalFrameDelay: number; - creationTime: number; - totalVideoFrames: number; - droppedVideoFrames: number; -} -declare var VideoPlaybackQuality: { - prototype: VideoPlaybackQuality; - new(): VideoPlaybackQuality; -} - -interface GlobalEventHandlers { - onpointerenter: (ev: PointerEvent) => any; - onpointerout: (ev: PointerEvent) => any; - onpointerdown: (ev: PointerEvent) => any; - onpointerup: (ev: PointerEvent) => any; - onpointercancel: (ev: PointerEvent) => any; - onpointerover: (ev: PointerEvent) => any; - onpointermove: (ev: PointerEvent) => any; - onpointerleave: (ev: PointerEvent) => any; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface Key { - algorithm: Algorithm; - type: string; - extractable: boolean; - keyUsage: string[]; -} -declare var Key: { - prototype: Key; - new(): Key; -} - -interface DeviceAcceleration { - y: number; - x: number; - z: number; -} -declare var DeviceAcceleration: { - prototype: DeviceAcceleration; - new(): DeviceAcceleration; -} - -interface HTMLAllCollection extends HTMLCollection { - namedItem(name: string): Element; - // [name: string]: Element; -} -declare var HTMLAllCollection: { - prototype: HTMLAllCollection; - new(): HTMLAllCollection; -} - -interface AesGcmEncryptResult { - ciphertext: ArrayBuffer; - tag: ArrayBuffer; -} -declare var AesGcmEncryptResult: { - prototype: AesGcmEncryptResult; - new(): AesGcmEncryptResult; -} - -interface NavigationCompletedEvent extends NavigationEvent { - webErrorStatus: number; - isSuccess: boolean; -} -declare var NavigationCompletedEvent: { - prototype: NavigationCompletedEvent; - new(): NavigationCompletedEvent; -} - -interface MutationRecord { - oldValue: string; - previousSibling: Node; - addedNodes: NodeList; - attributeName: string; - removedNodes: NodeList; - target: Node; - nextSibling: Node; - attributeNamespace: string; - type: string; -} -declare var MutationRecord: { - prototype: MutationRecord; - new(): MutationRecord; -} - -interface MimeTypeArray { - length: number; - item(index: number): Plugin; - [index: number]: Plugin; - namedItem(type: string): Plugin; - // [type: string]: Plugin; -} -declare var MimeTypeArray: { - prototype: MimeTypeArray; - new(): MimeTypeArray; -} - -interface KeyOperation extends EventTarget { - oncomplete: (ev: Event) => any; - onerror: (ev: ErrorEvent) => any; - result: any; - addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var KeyOperation: { - prototype: KeyOperation; - new(): KeyOperation; -} - -interface DOMStringMap { -} -declare var DOMStringMap: { - prototype: DOMStringMap; - new(): DOMStringMap; -} - -interface DeviceOrientationEvent extends Event { - gamma: number; - alpha: number; - absolute: boolean; - beta: number; - initDeviceOrientationEvent(type: string, bubbles: boolean, cancelable: boolean, alpha: number, beta: number, gamma: number, absolute: boolean): void; -} -declare var DeviceOrientationEvent: { - prototype: DeviceOrientationEvent; - new(): DeviceOrientationEvent; -} - -interface MSMediaKeys { - keySystem: string; - createSession(type: string, initData: Uint8Array, cdmData?: Uint8Array): MSMediaKeySession; -} -declare var MSMediaKeys: { - prototype: MSMediaKeys; - new(keySystem: string): MSMediaKeys; - isTypeSupported(keySystem: string, type?: string): boolean; -} - -interface MSMediaKeyMessageEvent extends Event { - destinationURL: string; - message: Uint8Array; -} -declare var MSMediaKeyMessageEvent: { - prototype: MSMediaKeyMessageEvent; - new(): MSMediaKeyMessageEvent; -} - -interface MSHTMLWebViewElement extends HTMLElement { - documentTitle: string; - width: number; - src: string; - canGoForward: boolean; - height: number; - canGoBack: boolean; - navigateWithHttpRequestMessage(requestMessage: any): void; - goBack(): void; - navigate(uri: string): void; - stop(): void; - navigateToString(contents: string): void; - captureSelectedContentToDataPackageAsync(): MSWebViewAsyncOperation; - capturePreviewToBlobAsync(): MSWebViewAsyncOperation; - refresh(): void; - goForward(): void; - navigateToLocalStreamUri(source: string, streamResolver: any): void; - invokeScriptAsync(scriptName: string, ...args: any[]): MSWebViewAsyncOperation; - buildLocalStreamUri(contentIdentifier: string, relativePath: string): string; -} -declare var MSHTMLWebViewElement: { - prototype: MSHTMLWebViewElement; - new(): MSHTMLWebViewElement; -} - -interface NavigationEvent extends Event { - uri: string; -} -declare var NavigationEvent: { - prototype: NavigationEvent; - new(): NavigationEvent; -} - -interface RandomSource { - getRandomValues(array: ArrayBufferView): ArrayBufferView; -} - -interface SourceBuffer extends EventTarget { - updating: boolean; - appendWindowStart: number; - appendWindowEnd: number; - buffered: TimeRanges; - timestampOffset: number; - audioTracks: AudioTrackList; - appendBuffer(data: ArrayBuffer): void; - remove(start: number, end: number): void; - abort(): void; - appendStream(stream: MSStream, maxSize?: number): void; -} -declare var SourceBuffer: { - prototype: SourceBuffer; - new(): SourceBuffer; -} - -interface MSInputMethodContext extends EventTarget { - oncandidatewindowshow: (ev: any) => any; - target: HTMLElement; - compositionStartOffset: number; - oncandidatewindowhide: (ev: any) => any; - oncandidatewindowupdate: (ev: any) => any; - compositionEndOffset: number; - getCompositionAlternatives(): string[]; - getCandidateWindowClientRect(): ClientRect; - hasComposition(): boolean; - isCandidateWindowVisible(): boolean; - addEventListener(type: "candidatewindowshow", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "candidatewindowhide", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "candidatewindowupdate", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var MSInputMethodContext: { - prototype: MSInputMethodContext; - new(): MSInputMethodContext; -} - -interface DeviceRotationRate { - gamma: number; - alpha: number; - beta: number; -} -declare var DeviceRotationRate: { - prototype: DeviceRotationRate; - new(): DeviceRotationRate; -} - -interface PluginArray { - length: number; - refresh(reload?: boolean): void; - item(index: number): Plugin; - [index: number]: Plugin; - namedItem(name: string): Plugin; - // [name: string]: Plugin; -} -declare var PluginArray: { - prototype: PluginArray; - new(): PluginArray; -} - -interface MSMediaKeyError { - systemCode: number; - code: number; - MS_MEDIA_KEYERR_SERVICE: number; - MS_MEDIA_KEYERR_HARDWARECHANGE: number; - MS_MEDIA_KEYERR_OUTPUT: number; - MS_MEDIA_KEYERR_DOMAIN: number; - MS_MEDIA_KEYERR_UNKNOWN: number; - MS_MEDIA_KEYERR_CLIENT: number; -} -declare var MSMediaKeyError: { - prototype: MSMediaKeyError; - new(): MSMediaKeyError; - MS_MEDIA_KEYERR_SERVICE: number; - MS_MEDIA_KEYERR_HARDWARECHANGE: number; - MS_MEDIA_KEYERR_OUTPUT: number; - MS_MEDIA_KEYERR_DOMAIN: number; - MS_MEDIA_KEYERR_UNKNOWN: number; - MS_MEDIA_KEYERR_CLIENT: number; -} - -interface Plugin { - length: number; - filename: string; - version: string; - name: string; - description: string; - item(index: number): MimeType; - [index: number]: MimeType; - namedItem(type: string): MimeType; - // [type: string]: MimeType; -} -declare var Plugin: { - prototype: Plugin; - new(): Plugin; -} - -interface MediaSource extends EventTarget { - sourceBuffers: SourceBufferList; - duration: number; - readyState: string; - activeSourceBuffers: SourceBufferList; - addSourceBuffer(type: string): SourceBuffer; - endOfStream(error?: string): void; - removeSourceBuffer(sourceBuffer: SourceBuffer): void; -} -declare var MediaSource: { - prototype: MediaSource; - new(): MediaSource; - isTypeSupported(type: string): boolean; -} - -interface SourceBufferList extends EventTarget { - length: number; - item(index: number): SourceBuffer; - [index: number]: SourceBuffer; -} -declare var SourceBufferList: { - prototype: SourceBufferList; - new(): SourceBufferList; -} - -interface XMLDocument extends Document { -} -declare var XMLDocument: { - prototype: XMLDocument; - new(): XMLDocument; -} - -interface DeviceMotionEvent extends Event { - rotationRate: DeviceRotationRate; - acceleration: DeviceAcceleration; - interval: number; - accelerationIncludingGravity: DeviceAcceleration; - initDeviceMotionEvent(type: string, bubbles: boolean, cancelable: boolean, acceleration: DeviceAccelerationDict, accelerationIncludingGravity: DeviceAccelerationDict, rotationRate: DeviceRotationRateDict, interval: number): void; -} -declare var DeviceMotionEvent: { - prototype: DeviceMotionEvent; - new(): DeviceMotionEvent; -} - -interface MimeType { - enabledPlugin: Plugin; - suffixes: string; - type: string; - description: string; -} -declare var MimeType: { - prototype: MimeType; - new(): MimeType; -} - -interface PointerEvent extends MouseEvent { - width: number; - rotation: number; - pressure: number; - pointerType: any; - isPrimary: boolean; - tiltY: number; - height: number; - intermediatePoints: any; - currentPoint: any; - tiltX: number; - hwTimestamp: number; - pointerId: number; - initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void; - getCurrentPoint(element: Element): void; - getIntermediatePoints(element: Element): void; -} -declare var PointerEvent: { - prototype: PointerEvent; - new(): PointerEvent; -} - -interface MSDocumentExtensions { - captureEvents(): void; - releaseEvents(): void; -} - -interface MutationObserver { - observe(target: Node, options: MutationObserverInit): void; - takeRecords(): MutationRecord[]; - disconnect(): void; -} -declare var MutationObserver: { - prototype: MutationObserver; - new (callback: (arr: MutationRecord[], observer: MutationObserver)=>any): MutationObserver; -} - -interface MSWebViewAsyncOperation extends EventTarget { - target: MSHTMLWebViewElement; - oncomplete: (ev: Event) => any; - error: DOMError; - onerror: (ev: ErrorEvent) => any; - readyState: number; - type: number; - result: any; - start(): void; - ERROR: number; - TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number; - TYPE_INVOKE_SCRIPT: number; - COMPLETED: number; - TYPE_CAPTURE_PREVIEW_TO_RANDOM_ACCESS_STREAM: number; - STARTED: number; - addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var MSWebViewAsyncOperation: { - prototype: MSWebViewAsyncOperation; - new(): MSWebViewAsyncOperation; - ERROR: number; - TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number; - TYPE_INVOKE_SCRIPT: number; - COMPLETED: number; - TYPE_CAPTURE_PREVIEW_TO_RANDOM_ACCESS_STREAM: number; - STARTED: number; -} - -interface ScriptNotifyEvent extends Event { - value: string; - callingUri: string; -} -declare var ScriptNotifyEvent: { - prototype: ScriptNotifyEvent; - new(): ScriptNotifyEvent; -} - -interface PerformanceNavigationTiming extends PerformanceEntry { - redirectStart: number; - domainLookupEnd: number; - responseStart: number; - domComplete: number; - domainLookupStart: number; - loadEventStart: number; - unloadEventEnd: number; - fetchStart: number; - requestStart: number; - domInteractive: number; - navigationStart: number; - connectEnd: number; - loadEventEnd: number; - connectStart: number; - responseEnd: number; - domLoading: number; - redirectEnd: number; - redirectCount: number; - unloadEventStart: number; - domContentLoadedEventStart: number; - domContentLoadedEventEnd: number; - type: string; -} -declare var PerformanceNavigationTiming: { - prototype: PerformanceNavigationTiming; - new(): PerformanceNavigationTiming; -} - -interface MSMediaKeyNeededEvent extends Event { - initData: Uint8Array; -} -declare var MSMediaKeyNeededEvent: { - prototype: MSMediaKeyNeededEvent; - new(): MSMediaKeyNeededEvent; -} - -interface LongRunningScriptDetectedEvent extends Event { - stopPageScriptExecution: boolean; - executionTime: number; -} -declare var LongRunningScriptDetectedEvent: { - prototype: LongRunningScriptDetectedEvent; - new(): LongRunningScriptDetectedEvent; -} - -interface MSAppView { - viewId: number; - close(): void; - postMessage(message: any, targetOrigin: string, ports?: any): void; -} -declare var MSAppView: { - prototype: MSAppView; - new(): MSAppView; -} - -interface PerfWidgetExternal { - maxCpuSpeed: number; - independentRenderingEnabled: boolean; - irDisablingContentString: string; - irStatusAvailable: boolean; - performanceCounter: number; - averagePaintTime: number; - activeNetworkRequestCount: number; - paintRequestsPerSecond: number; - extraInformationEnabled: boolean; - performanceCounterFrequency: number; - averageFrameTime: number; - repositionWindow(x: number, y: number): void; - getRecentMemoryUsage(last: number): any; - getMemoryUsage(): number; - resizeWindow(width: number, height: number): void; - getProcessCpuUsage(): number; - removeEventListener(eventType: string, callback: (ev: any) => any): void; - getRecentCpuUsage(last: number): any; - addEventListener(eventType: string, callback: (ev: any) => any): void; - getRecentFrames(last: number): any; - getRecentPaintRequests(last: number): any; -} -declare var PerfWidgetExternal: { - prototype: PerfWidgetExternal; - new(): PerfWidgetExternal; -} - -interface PageTransitionEvent extends Event { - persisted: boolean; -} -declare var PageTransitionEvent: { - prototype: PageTransitionEvent; - new(): PageTransitionEvent; -} - -interface MutationCallback { - (mutations: MutationRecord[], observer: MutationObserver): void; -} - -interface HTMLDocument extends Document { -} -declare var HTMLDocument: { - prototype: HTMLDocument; - new(): HTMLDocument; -} - -interface KeyPair { - privateKey: Key; - publicKey: Key; -} -declare var KeyPair: { - prototype: KeyPair; - new(): KeyPair; -} - -interface MSMediaKeySession extends EventTarget { - sessionId: string; - error: MSMediaKeyError; - keySystem: string; - close(): void; - update(key: Uint8Array): void; -} -declare var MSMediaKeySession: { - prototype: MSMediaKeySession; - new(): MSMediaKeySession; -} - -interface UnviewableContentIdentifiedEvent extends NavigationEvent { - referrer: string; -} -declare var UnviewableContentIdentifiedEvent: { - prototype: UnviewableContentIdentifiedEvent; - new(): UnviewableContentIdentifiedEvent; -} - -interface CryptoOperation extends EventTarget { - algorithm: Algorithm; - oncomplete: (ev: Event) => any; - onerror: (ev: ErrorEvent) => any; - onprogress: (ev: ProgressEvent) => any; - onabort: (ev: UIEvent) => any; - key: Key; - result: any; - abort(): void; - finish(): void; - process(buffer: ArrayBufferView): void; - addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var CryptoOperation: { - prototype: CryptoOperation; - new(): CryptoOperation; -} - -interface WebGLTexture extends WebGLObject { -} -declare var WebGLTexture: { - prototype: WebGLTexture; - new(): WebGLTexture; -} - -interface OES_texture_float { -} -declare var OES_texture_float: { - prototype: OES_texture_float; - new(): OES_texture_float; -} - -interface WebGLContextEvent extends Event { - statusMessage: string; -} -declare var WebGLContextEvent: { - prototype: WebGLContextEvent; - new(): WebGLContextEvent; -} - -interface WebGLRenderbuffer extends WebGLObject { -} -declare var WebGLRenderbuffer: { - prototype: WebGLRenderbuffer; - new(): WebGLRenderbuffer; -} - -interface WebGLUniformLocation { -} -declare var WebGLUniformLocation: { - prototype: WebGLUniformLocation; - new(): WebGLUniformLocation; -} - -interface WebGLActiveInfo { - name: string; - type: number; - size: number; -} -declare var WebGLActiveInfo: { - prototype: WebGLActiveInfo; - new(): WebGLActiveInfo; -} - -interface WEBGL_compressed_texture_s3tc { - COMPRESSED_RGBA_S3TC_DXT1_EXT: number; - COMPRESSED_RGBA_S3TC_DXT5_EXT: number; - COMPRESSED_RGBA_S3TC_DXT3_EXT: number; - COMPRESSED_RGB_S3TC_DXT1_EXT: number; -} -declare var WEBGL_compressed_texture_s3tc: { - prototype: WEBGL_compressed_texture_s3tc; - new(): WEBGL_compressed_texture_s3tc; - COMPRESSED_RGBA_S3TC_DXT1_EXT: number; - COMPRESSED_RGBA_S3TC_DXT5_EXT: number; - COMPRESSED_RGBA_S3TC_DXT3_EXT: number; - COMPRESSED_RGB_S3TC_DXT1_EXT: number; -} - -interface WebGLRenderingContext { - drawingBufferWidth: number; - drawingBufferHeight: number; - canvas: HTMLCanvasElement; - getUniformLocation(program: WebGLProgram, name: string): WebGLUniformLocation; - bindTexture(target: number, texture: WebGLTexture): void; - bufferData(target: number, data: ArrayBufferView, usage: number): void; - bufferData(target: number, data: ArrayBuffer, usage: number): void; - bufferData(target: number, size: number, usage: number): void; - depthMask(flag: boolean): void; - getUniform(program: WebGLProgram, location: WebGLUniformLocation): any; - vertexAttrib3fv(indx: number, values: number[]): void; - vertexAttrib3fv(indx: number, values: Float32Array): void; - linkProgram(program: WebGLProgram): void; - getSupportedExtensions(): string[]; - bufferSubData(target: number, offset: number, data: ArrayBuffer): void; - bufferSubData(target: number, offset: number, data: ArrayBufferView): void; - vertexAttribPointer(indx: number, size: number, type: number, normalized: boolean, stride: number, offset: number): void; - polygonOffset(factor: number, units: number): void; - blendColor(red: number, green: number, blue: number, alpha: number): void; - createTexture(): WebGLTexture; - hint(target: number, mode: number): void; - getVertexAttrib(index: number, pname: number): any; - enableVertexAttribArray(index: number): void; - depthRange(zNear: number, zFar: number): void; - cullFace(mode: number): void; - createFramebuffer(): WebGLFramebuffer; - uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: number[]): void; - uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array): void; - framebufferTexture2D(target: number, attachment: number, textarget: number, texture: WebGLTexture, level: number): void; - deleteFramebuffer(framebuffer: WebGLFramebuffer): void; - colorMask(red: boolean, green: boolean, blue: boolean, alpha: boolean): void; - compressedTexImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, data: ArrayBufferView): void; - uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: number[]): void; - uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array): void; - getExtension(name: string): any; - createProgram(): WebGLProgram; - deleteShader(shader: WebGLShader): void; - getAttachedShaders(program: WebGLProgram): WebGLShader[]; - enable(cap: number): void; - blendEquation(mode: number): void; - texImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, format: number, type: number, pixels: ArrayBufferView): void; - texImage2D(target: number, level: number, internalformat: number, format: number, type: number, image: HTMLImageElement): void; - texImage2D(target: number, level: number, internalformat: number, format: number, type: number, canvas: HTMLCanvasElement): void; - texImage2D(target: number, level: number, internalformat: number, format: number, type: number, video: HTMLVideoElement): void; - texImage2D(target: number, level: number, internalformat: number, format: number, type: number, pixels: ImageData): void; - createBuffer(): WebGLBuffer; - deleteTexture(texture: WebGLTexture): void; - useProgram(program: WebGLProgram): void; - vertexAttrib2fv(indx: number, values: number[]): void; - vertexAttrib2fv(indx: number, values: Float32Array): void; - checkFramebufferStatus(target: number): number; - frontFace(mode: number): void; - getBufferParameter(target: number, pname: number): any; - texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView): void; - texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, image: HTMLImageElement): void; - texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, canvas: HTMLCanvasElement): void; - texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, video: HTMLVideoElement): void; - texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, pixels: ImageData): void; - copyTexImage2D(target: number, level: number, internalformat: number, x: number, y: number, width: number, height: number, border: number): void; - getVertexAttribOffset(index: number, pname: number): number; - disableVertexAttribArray(index: number): void; - blendFunc(sfactor: number, dfactor: number): void; - drawElements(mode: number, count: number, type: number, offset: number): void; - isFramebuffer(framebuffer: WebGLFramebuffer): boolean; - uniform3iv(location: WebGLUniformLocation, v: number[]): void; - uniform3iv(location: WebGLUniformLocation, v: Int32Array): void; - lineWidth(width: number): void; - getShaderInfoLog(shader: WebGLShader): string; - getTexParameter(target: number, pname: number): any; - getParameter(pname: number): any; - getShaderPrecisionFormat(shadertype: number, precisiontype: number): WebGLShaderPrecisionFormat; - getContextAttributes(): WebGLContextAttributes; - vertexAttrib1f(indx: number, x: number): void; - bindFramebuffer(target: number, framebuffer: WebGLFramebuffer): void; - compressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, data: ArrayBufferView): void; - isContextLost(): boolean; - uniform1iv(location: WebGLUniformLocation, v: number[]): void; - uniform1iv(location: WebGLUniformLocation, v: Int32Array): void; - getRenderbufferParameter(target: number, pname: number): any; - uniform2fv(location: WebGLUniformLocation, v: number[]): void; - uniform2fv(location: WebGLUniformLocation, v: Float32Array): void; - isTexture(texture: WebGLTexture): boolean; - getError(): number; - shaderSource(shader: WebGLShader, source: string): void; - deleteRenderbuffer(renderbuffer: WebGLRenderbuffer): void; - stencilMask(mask: number): void; - bindBuffer(target: number, buffer: WebGLBuffer): void; - getAttribLocation(program: WebGLProgram, name: string): number; - uniform3i(location: WebGLUniformLocation, x: number, y: number, z: number): void; - blendEquationSeparate(modeRGB: number, modeAlpha: number): void; - clear(mask: number): void; - blendFuncSeparate(srcRGB: number, dstRGB: number, srcAlpha: number, dstAlpha: number): void; - stencilFuncSeparate(face: number, func: number, ref: number, mask: number): void; - readPixels(x: number, y: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView): void; - scissor(x: number, y: number, width: number, height: number): void; - uniform2i(location: WebGLUniformLocation, x: number, y: number): void; - getActiveAttrib(program: WebGLProgram, index: number): WebGLActiveInfo; - getShaderSource(shader: WebGLShader): string; - generateMipmap(target: number): void; - bindAttribLocation(program: WebGLProgram, index: number, name: string): void; - uniform1fv(location: WebGLUniformLocation, v: number[]): void; - uniform1fv(location: WebGLUniformLocation, v: Float32Array): void; - uniform2iv(location: WebGLUniformLocation, v: number[]): void; - uniform2iv(location: WebGLUniformLocation, v: Int32Array): void; - stencilOp(fail: number, zfail: number, zpass: number): void; - uniform4fv(location: WebGLUniformLocation, v: number[]): void; - uniform4fv(location: WebGLUniformLocation, v: Float32Array): void; - vertexAttrib1fv(indx: number, values: number[]): void; - vertexAttrib1fv(indx: number, values: Float32Array): void; - flush(): void; - uniform4f(location: WebGLUniformLocation, x: number, y: number, z: number, w: number): void; - deleteProgram(program: WebGLProgram): void; - isRenderbuffer(renderbuffer: WebGLRenderbuffer): boolean; - uniform1i(location: WebGLUniformLocation, x: number): void; - getProgramParameter(program: WebGLProgram, pname: number): any; - getActiveUniform(program: WebGLProgram, index: number): WebGLActiveInfo; - stencilFunc(func: number, ref: number, mask: number): void; - pixelStorei(pname: number, param: number): void; - disable(cap: number): void; - vertexAttrib4fv(indx: number, values: number[]): void; - vertexAttrib4fv(indx: number, values: Float32Array): void; - createRenderbuffer(): WebGLRenderbuffer; - isBuffer(buffer: WebGLBuffer): boolean; - stencilOpSeparate(face: number, fail: number, zfail: number, zpass: number): void; - getFramebufferAttachmentParameter(target: number, attachment: number, pname: number): any; - uniform4i(location: WebGLUniformLocation, x: number, y: number, z: number, w: number): void; - sampleCoverage(value: number, invert: boolean): void; - depthFunc(func: number): void; - texParameterf(target: number, pname: number, param: number): void; - vertexAttrib3f(indx: number, x: number, y: number, z: number): void; - drawArrays(mode: number, first: number, count: number): void; - texParameteri(target: number, pname: number, param: number): void; - vertexAttrib4f(indx: number, x: number, y: number, z: number, w: number): void; - getShaderParameter(shader: WebGLShader, pname: number): any; - clearDepth(depth: number): void; - activeTexture(texture: number): void; - viewport(x: number, y: number, width: number, height: number): void; - detachShader(program: WebGLProgram, shader: WebGLShader): void; - uniform1f(location: WebGLUniformLocation, x: number): void; - uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: number[]): void; - uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array): void; - deleteBuffer(buffer: WebGLBuffer): void; - copyTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, x: number, y: number, width: number, height: number): void; - uniform3fv(location: WebGLUniformLocation, v: number[]): void; - uniform3fv(location: WebGLUniformLocation, v: Float32Array): void; - stencilMaskSeparate(face: number, mask: number): void; - attachShader(program: WebGLProgram, shader: WebGLShader): void; - compileShader(shader: WebGLShader): void; - clearColor(red: number, green: number, blue: number, alpha: number): void; - isShader(shader: WebGLShader): boolean; - clearStencil(s: number): void; - framebufferRenderbuffer(target: number, attachment: number, renderbuffertarget: number, renderbuffer: WebGLRenderbuffer): void; - finish(): void; - uniform2f(location: WebGLUniformLocation, x: number, y: number): void; - renderbufferStorage(target: number, internalformat: number, width: number, height: number): void; - uniform3f(location: WebGLUniformLocation, x: number, y: number, z: number): void; - getProgramInfoLog(program: WebGLProgram): string; - validateProgram(program: WebGLProgram): void; - isEnabled(cap: number): boolean; - vertexAttrib2f(indx: number, x: number, y: number): void; - isProgram(program: WebGLProgram): boolean; - createShader(type: number): WebGLShader; - bindRenderbuffer(target: number, renderbuffer: WebGLRenderbuffer): void; - uniform4iv(location: WebGLUniformLocation, v: number[]): void; - uniform4iv(location: WebGLUniformLocation, v: Int32Array): void; - DEPTH_FUNC: number; - DEPTH_COMPONENT16: number; - REPLACE: number; - REPEAT: number; - VERTEX_ATTRIB_ARRAY_ENABLED: number; - FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number; - STENCIL_BUFFER_BIT: number; - RENDERER: number; - STENCIL_BACK_REF: number; - TEXTURE26: number; - RGB565: number; - DITHER: number; - CONSTANT_COLOR: number; - GENERATE_MIPMAP_HINT: number; - POINTS: number; - DECR: number; - INT_VEC3: number; - TEXTURE28: number; - ONE_MINUS_CONSTANT_ALPHA: number; - BACK: number; - RENDERBUFFER_STENCIL_SIZE: number; - UNPACK_FLIP_Y_WEBGL: number; - BLEND: number; - TEXTURE9: number; - ARRAY_BUFFER_BINDING: number; - MAX_VIEWPORT_DIMS: number; - INVALID_FRAMEBUFFER_OPERATION: number; - TEXTURE: number; - TEXTURE0: number; - TEXTURE31: number; - TEXTURE24: number; - HIGH_INT: number; - RENDERBUFFER_BINDING: number; - BLEND_COLOR: number; - FASTEST: number; - STENCIL_WRITEMASK: number; - ALIASED_POINT_SIZE_RANGE: number; - TEXTURE12: number; - DST_ALPHA: number; - BLEND_EQUATION_RGB: number; - FRAMEBUFFER_COMPLETE: number; - NEAREST_MIPMAP_NEAREST: number; - VERTEX_ATTRIB_ARRAY_SIZE: number; - TEXTURE3: number; - DEPTH_WRITEMASK: number; - CONTEXT_LOST_WEBGL: number; - INVALID_VALUE: number; - TEXTURE_MAG_FILTER: number; - ONE_MINUS_CONSTANT_COLOR: number; - ONE_MINUS_SRC_ALPHA: number; - TEXTURE_CUBE_MAP_POSITIVE_Z: number; - NOTEQUAL: number; - ALPHA: number; - DEPTH_STENCIL: number; - MAX_VERTEX_UNIFORM_VECTORS: number; - DEPTH_COMPONENT: number; - RENDERBUFFER_RED_SIZE: number; - TEXTURE20: number; - RED_BITS: number; - RENDERBUFFER_BLUE_SIZE: number; - SCISSOR_BOX: number; - VENDOR: number; - FRONT_AND_BACK: number; - CONSTANT_ALPHA: number; - VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number; - NEAREST: number; - CULL_FACE: number; - ALIASED_LINE_WIDTH_RANGE: number; - TEXTURE19: number; - FRONT: number; - DEPTH_CLEAR_VALUE: number; - GREEN_BITS: number; - TEXTURE29: number; - TEXTURE23: number; - MAX_RENDERBUFFER_SIZE: number; - STENCIL_ATTACHMENT: number; - TEXTURE27: number; - BOOL_VEC2: number; - OUT_OF_MEMORY: number; - MIRRORED_REPEAT: number; - POLYGON_OFFSET_UNITS: number; - TEXTURE_MIN_FILTER: number; - STENCIL_BACK_PASS_DEPTH_PASS: number; - LINE_LOOP: number; - FLOAT_MAT3: number; - TEXTURE14: number; - LINEAR: number; - RGB5_A1: number; - ONE_MINUS_SRC_COLOR: number; - SAMPLE_COVERAGE_INVERT: number; - DONT_CARE: number; - FRAMEBUFFER_BINDING: number; - RENDERBUFFER_ALPHA_SIZE: number; - STENCIL_REF: number; - ZERO: number; - DECR_WRAP: number; - SAMPLE_COVERAGE: number; - STENCIL_BACK_FUNC: number; - TEXTURE30: number; - VIEWPORT: number; - STENCIL_BITS: number; - FLOAT: number; - COLOR_WRITEMASK: number; - SAMPLE_COVERAGE_VALUE: number; - TEXTURE_CUBE_MAP_NEGATIVE_Y: number; - STENCIL_BACK_FAIL: number; - FLOAT_MAT4: number; - UNSIGNED_SHORT_4_4_4_4: number; - TEXTURE6: number; - RENDERBUFFER_WIDTH: number; - RGBA4: number; - ALWAYS: number; - BLEND_EQUATION_ALPHA: number; - COLOR_BUFFER_BIT: number; - TEXTURE_CUBE_MAP: number; - DEPTH_BUFFER_BIT: number; - STENCIL_CLEAR_VALUE: number; - BLEND_EQUATION: number; - RENDERBUFFER_GREEN_SIZE: number; - NEAREST_MIPMAP_LINEAR: number; - VERTEX_ATTRIB_ARRAY_TYPE: number; - INCR_WRAP: number; - ONE_MINUS_DST_COLOR: number; - HIGH_FLOAT: number; - BYTE: number; - FRONT_FACE: number; - SAMPLE_ALPHA_TO_COVERAGE: number; - CCW: number; - TEXTURE13: number; - MAX_VERTEX_ATTRIBS: number; - MAX_VERTEX_TEXTURE_IMAGE_UNITS: number; - TEXTURE_WRAP_T: number; - UNPACK_PREMULTIPLY_ALPHA_WEBGL: number; - FLOAT_VEC2: number; - LUMINANCE: number; - GREATER: number; - INT_VEC2: number; - VALIDATE_STATUS: number; - FRAMEBUFFER: number; - FRAMEBUFFER_UNSUPPORTED: number; - TEXTURE5: number; - FUNC_SUBTRACT: number; - BLEND_DST_ALPHA: number; - SAMPLER_CUBE: number; - ONE_MINUS_DST_ALPHA: number; - LESS: number; - TEXTURE_CUBE_MAP_POSITIVE_X: number; - BLUE_BITS: number; - DEPTH_TEST: number; - VERTEX_ATTRIB_ARRAY_STRIDE: number; - DELETE_STATUS: number; - TEXTURE18: number; - POLYGON_OFFSET_FACTOR: number; - UNSIGNED_INT: number; - TEXTURE_2D: number; - DST_COLOR: number; - FLOAT_MAT2: number; - COMPRESSED_TEXTURE_FORMATS: number; - MAX_FRAGMENT_UNIFORM_VECTORS: number; - DEPTH_STENCIL_ATTACHMENT: number; - LUMINANCE_ALPHA: number; - CW: number; - VERTEX_ATTRIB_ARRAY_NORMALIZED: number; - TEXTURE_CUBE_MAP_NEGATIVE_Z: number; - LINEAR_MIPMAP_LINEAR: number; - BUFFER_SIZE: number; - SAMPLE_BUFFERS: number; - TEXTURE15: number; - ACTIVE_TEXTURE: number; - VERTEX_SHADER: number; - TEXTURE22: number; - VERTEX_ATTRIB_ARRAY_POINTER: number; - INCR: number; - COMPILE_STATUS: number; - MAX_COMBINED_TEXTURE_IMAGE_UNITS: number; - TEXTURE7: number; - UNSIGNED_SHORT_5_5_5_1: number; - DEPTH_BITS: number; - RGBA: number; - TRIANGLE_STRIP: number; - COLOR_CLEAR_VALUE: number; - BROWSER_DEFAULT_WEBGL: number; - INVALID_ENUM: number; - SCISSOR_TEST: number; - LINE_STRIP: number; - FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number; - STENCIL_FUNC: number; - FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number; - RENDERBUFFER_HEIGHT: number; - TEXTURE8: number; - TRIANGLES: number; - FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number; - STENCIL_BACK_VALUE_MASK: number; - TEXTURE25: number; - RENDERBUFFER: number; - LEQUAL: number; - TEXTURE1: number; - STENCIL_INDEX8: number; - FUNC_ADD: number; - STENCIL_FAIL: number; - BLEND_SRC_ALPHA: number; - BOOL: number; - ALPHA_BITS: number; - LOW_INT: number; - TEXTURE10: number; - SRC_COLOR: number; - MAX_VARYING_VECTORS: number; - BLEND_DST_RGB: number; - TEXTURE_BINDING_CUBE_MAP: number; - STENCIL_INDEX: number; - TEXTURE_BINDING_2D: number; - MEDIUM_INT: number; - SHADER_TYPE: number; - POLYGON_OFFSET_FILL: number; - DYNAMIC_DRAW: number; - TEXTURE4: number; - STENCIL_BACK_PASS_DEPTH_FAIL: number; - STREAM_DRAW: number; - MAX_CUBE_MAP_TEXTURE_SIZE: number; - TEXTURE17: number; - TRIANGLE_FAN: number; - UNPACK_ALIGNMENT: number; - CURRENT_PROGRAM: number; - LINES: number; - INVALID_OPERATION: number; - FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number; - LINEAR_MIPMAP_NEAREST: number; - CLAMP_TO_EDGE: number; - RENDERBUFFER_DEPTH_SIZE: number; - TEXTURE_WRAP_S: number; - ELEMENT_ARRAY_BUFFER: number; - UNSIGNED_SHORT_5_6_5: number; - ACTIVE_UNIFORMS: number; - FLOAT_VEC3: number; - NO_ERROR: number; - ATTACHED_SHADERS: number; - DEPTH_ATTACHMENT: number; - TEXTURE11: number; - STENCIL_TEST: number; - ONE: number; - FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number; - STATIC_DRAW: number; - GEQUAL: number; - BOOL_VEC4: number; - COLOR_ATTACHMENT0: number; - PACK_ALIGNMENT: number; - MAX_TEXTURE_SIZE: number; - STENCIL_PASS_DEPTH_FAIL: number; - CULL_FACE_MODE: number; - TEXTURE16: number; - STENCIL_BACK_WRITEMASK: number; - SRC_ALPHA: number; - UNSIGNED_SHORT: number; - TEXTURE21: number; - FUNC_REVERSE_SUBTRACT: number; - SHADING_LANGUAGE_VERSION: number; - EQUAL: number; - FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number; - BOOL_VEC3: number; - SAMPLER_2D: number; - TEXTURE_CUBE_MAP_NEGATIVE_X: number; - MAX_TEXTURE_IMAGE_UNITS: number; - TEXTURE_CUBE_MAP_POSITIVE_Y: number; - RENDERBUFFER_INTERNAL_FORMAT: number; - STENCIL_VALUE_MASK: number; - ELEMENT_ARRAY_BUFFER_BINDING: number; - ARRAY_BUFFER: number; - DEPTH_RANGE: number; - NICEST: number; - ACTIVE_ATTRIBUTES: number; - NEVER: number; - FLOAT_VEC4: number; - CURRENT_VERTEX_ATTRIB: number; - STENCIL_PASS_DEPTH_PASS: number; - INVERT: number; - LINK_STATUS: number; - RGB: number; - INT_VEC4: number; - TEXTURE2: number; - UNPACK_COLORSPACE_CONVERSION_WEBGL: number; - MEDIUM_FLOAT: number; - SRC_ALPHA_SATURATE: number; - BUFFER_USAGE: number; - SHORT: number; - NONE: number; - UNSIGNED_BYTE: number; - INT: number; - SUBPIXEL_BITS: number; - KEEP: number; - SAMPLES: number; - FRAGMENT_SHADER: number; - LINE_WIDTH: number; - BLEND_SRC_RGB: number; - LOW_FLOAT: number; - VERSION: number; -} -declare var WebGLRenderingContext: { - prototype: WebGLRenderingContext; - new(): WebGLRenderingContext; - DEPTH_FUNC: number; - DEPTH_COMPONENT16: number; - REPLACE: number; - REPEAT: number; - VERTEX_ATTRIB_ARRAY_ENABLED: number; - FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number; - STENCIL_BUFFER_BIT: number; - RENDERER: number; - STENCIL_BACK_REF: number; - TEXTURE26: number; - RGB565: number; - DITHER: number; - CONSTANT_COLOR: number; - GENERATE_MIPMAP_HINT: number; - POINTS: number; - DECR: number; - INT_VEC3: number; - TEXTURE28: number; - ONE_MINUS_CONSTANT_ALPHA: number; - BACK: number; - RENDERBUFFER_STENCIL_SIZE: number; - UNPACK_FLIP_Y_WEBGL: number; - BLEND: number; - TEXTURE9: number; - ARRAY_BUFFER_BINDING: number; - MAX_VIEWPORT_DIMS: number; - INVALID_FRAMEBUFFER_OPERATION: number; - TEXTURE: number; - TEXTURE0: number; - TEXTURE31: number; - TEXTURE24: number; - HIGH_INT: number; - RENDERBUFFER_BINDING: number; - BLEND_COLOR: number; - FASTEST: number; - STENCIL_WRITEMASK: number; - ALIASED_POINT_SIZE_RANGE: number; - TEXTURE12: number; - DST_ALPHA: number; - BLEND_EQUATION_RGB: number; - FRAMEBUFFER_COMPLETE: number; - NEAREST_MIPMAP_NEAREST: number; - VERTEX_ATTRIB_ARRAY_SIZE: number; - TEXTURE3: number; - DEPTH_WRITEMASK: number; - CONTEXT_LOST_WEBGL: number; - INVALID_VALUE: number; - TEXTURE_MAG_FILTER: number; - ONE_MINUS_CONSTANT_COLOR: number; - ONE_MINUS_SRC_ALPHA: number; - TEXTURE_CUBE_MAP_POSITIVE_Z: number; - NOTEQUAL: number; - ALPHA: number; - DEPTH_STENCIL: number; - MAX_VERTEX_UNIFORM_VECTORS: number; - DEPTH_COMPONENT: number; - RENDERBUFFER_RED_SIZE: number; - TEXTURE20: number; - RED_BITS: number; - RENDERBUFFER_BLUE_SIZE: number; - SCISSOR_BOX: number; - VENDOR: number; - FRONT_AND_BACK: number; - CONSTANT_ALPHA: number; - VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number; - NEAREST: number; - CULL_FACE: number; - ALIASED_LINE_WIDTH_RANGE: number; - TEXTURE19: number; - FRONT: number; - DEPTH_CLEAR_VALUE: number; - GREEN_BITS: number; - TEXTURE29: number; - TEXTURE23: number; - MAX_RENDERBUFFER_SIZE: number; - STENCIL_ATTACHMENT: number; - TEXTURE27: number; - BOOL_VEC2: number; - OUT_OF_MEMORY: number; - MIRRORED_REPEAT: number; - POLYGON_OFFSET_UNITS: number; - TEXTURE_MIN_FILTER: number; - STENCIL_BACK_PASS_DEPTH_PASS: number; - LINE_LOOP: number; - FLOAT_MAT3: number; - TEXTURE14: number; - LINEAR: number; - RGB5_A1: number; - ONE_MINUS_SRC_COLOR: number; - SAMPLE_COVERAGE_INVERT: number; - DONT_CARE: number; - FRAMEBUFFER_BINDING: number; - RENDERBUFFER_ALPHA_SIZE: number; - STENCIL_REF: number; - ZERO: number; - DECR_WRAP: number; - SAMPLE_COVERAGE: number; - STENCIL_BACK_FUNC: number; - TEXTURE30: number; - VIEWPORT: number; - STENCIL_BITS: number; - FLOAT: number; - COLOR_WRITEMASK: number; - SAMPLE_COVERAGE_VALUE: number; - TEXTURE_CUBE_MAP_NEGATIVE_Y: number; - STENCIL_BACK_FAIL: number; - FLOAT_MAT4: number; - UNSIGNED_SHORT_4_4_4_4: number; - TEXTURE6: number; - RENDERBUFFER_WIDTH: number; - RGBA4: number; - ALWAYS: number; - BLEND_EQUATION_ALPHA: number; - COLOR_BUFFER_BIT: number; - TEXTURE_CUBE_MAP: number; - DEPTH_BUFFER_BIT: number; - STENCIL_CLEAR_VALUE: number; - BLEND_EQUATION: number; - RENDERBUFFER_GREEN_SIZE: number; - NEAREST_MIPMAP_LINEAR: number; - VERTEX_ATTRIB_ARRAY_TYPE: number; - INCR_WRAP: number; - ONE_MINUS_DST_COLOR: number; - HIGH_FLOAT: number; - BYTE: number; - FRONT_FACE: number; - SAMPLE_ALPHA_TO_COVERAGE: number; - CCW: number; - TEXTURE13: number; - MAX_VERTEX_ATTRIBS: number; - MAX_VERTEX_TEXTURE_IMAGE_UNITS: number; - TEXTURE_WRAP_T: number; - UNPACK_PREMULTIPLY_ALPHA_WEBGL: number; - FLOAT_VEC2: number; - LUMINANCE: number; - GREATER: number; - INT_VEC2: number; - VALIDATE_STATUS: number; - FRAMEBUFFER: number; - FRAMEBUFFER_UNSUPPORTED: number; - TEXTURE5: number; - FUNC_SUBTRACT: number; - BLEND_DST_ALPHA: number; - SAMPLER_CUBE: number; - ONE_MINUS_DST_ALPHA: number; - LESS: number; - TEXTURE_CUBE_MAP_POSITIVE_X: number; - BLUE_BITS: number; - DEPTH_TEST: number; - VERTEX_ATTRIB_ARRAY_STRIDE: number; - DELETE_STATUS: number; - TEXTURE18: number; - POLYGON_OFFSET_FACTOR: number; - UNSIGNED_INT: number; - TEXTURE_2D: number; - DST_COLOR: number; - FLOAT_MAT2: number; - COMPRESSED_TEXTURE_FORMATS: number; - MAX_FRAGMENT_UNIFORM_VECTORS: number; - DEPTH_STENCIL_ATTACHMENT: number; - LUMINANCE_ALPHA: number; - CW: number; - VERTEX_ATTRIB_ARRAY_NORMALIZED: number; - TEXTURE_CUBE_MAP_NEGATIVE_Z: number; - LINEAR_MIPMAP_LINEAR: number; - BUFFER_SIZE: number; - SAMPLE_BUFFERS: number; - TEXTURE15: number; - ACTIVE_TEXTURE: number; - VERTEX_SHADER: number; - TEXTURE22: number; - VERTEX_ATTRIB_ARRAY_POINTER: number; - INCR: number; - COMPILE_STATUS: number; - MAX_COMBINED_TEXTURE_IMAGE_UNITS: number; - TEXTURE7: number; - UNSIGNED_SHORT_5_5_5_1: number; - DEPTH_BITS: number; - RGBA: number; - TRIANGLE_STRIP: number; - COLOR_CLEAR_VALUE: number; - BROWSER_DEFAULT_WEBGL: number; - INVALID_ENUM: number; - SCISSOR_TEST: number; - LINE_STRIP: number; - FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number; - STENCIL_FUNC: number; - FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number; - RENDERBUFFER_HEIGHT: number; - TEXTURE8: number; - TRIANGLES: number; - FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number; - STENCIL_BACK_VALUE_MASK: number; - TEXTURE25: number; - RENDERBUFFER: number; - LEQUAL: number; - TEXTURE1: number; - STENCIL_INDEX8: number; - FUNC_ADD: number; - STENCIL_FAIL: number; - BLEND_SRC_ALPHA: number; - BOOL: number; - ALPHA_BITS: number; - LOW_INT: number; - TEXTURE10: number; - SRC_COLOR: number; - MAX_VARYING_VECTORS: number; - BLEND_DST_RGB: number; - TEXTURE_BINDING_CUBE_MAP: number; - STENCIL_INDEX: number; - TEXTURE_BINDING_2D: number; - MEDIUM_INT: number; - SHADER_TYPE: number; - POLYGON_OFFSET_FILL: number; - DYNAMIC_DRAW: number; - TEXTURE4: number; - STENCIL_BACK_PASS_DEPTH_FAIL: number; - STREAM_DRAW: number; - MAX_CUBE_MAP_TEXTURE_SIZE: number; - TEXTURE17: number; - TRIANGLE_FAN: number; - UNPACK_ALIGNMENT: number; - CURRENT_PROGRAM: number; - LINES: number; - INVALID_OPERATION: number; - FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number; - LINEAR_MIPMAP_NEAREST: number; - CLAMP_TO_EDGE: number; - RENDERBUFFER_DEPTH_SIZE: number; - TEXTURE_WRAP_S: number; - ELEMENT_ARRAY_BUFFER: number; - UNSIGNED_SHORT_5_6_5: number; - ACTIVE_UNIFORMS: number; - FLOAT_VEC3: number; - NO_ERROR: number; - ATTACHED_SHADERS: number; - DEPTH_ATTACHMENT: number; - TEXTURE11: number; - STENCIL_TEST: number; - ONE: number; - FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number; - STATIC_DRAW: number; - GEQUAL: number; - BOOL_VEC4: number; - COLOR_ATTACHMENT0: number; - PACK_ALIGNMENT: number; - MAX_TEXTURE_SIZE: number; - STENCIL_PASS_DEPTH_FAIL: number; - CULL_FACE_MODE: number; - TEXTURE16: number; - STENCIL_BACK_WRITEMASK: number; - SRC_ALPHA: number; - UNSIGNED_SHORT: number; - TEXTURE21: number; - FUNC_REVERSE_SUBTRACT: number; - SHADING_LANGUAGE_VERSION: number; - EQUAL: number; - FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number; - BOOL_VEC3: number; - SAMPLER_2D: number; - TEXTURE_CUBE_MAP_NEGATIVE_X: number; - MAX_TEXTURE_IMAGE_UNITS: number; - TEXTURE_CUBE_MAP_POSITIVE_Y: number; - RENDERBUFFER_INTERNAL_FORMAT: number; - STENCIL_VALUE_MASK: number; - ELEMENT_ARRAY_BUFFER_BINDING: number; - ARRAY_BUFFER: number; - DEPTH_RANGE: number; - NICEST: number; - ACTIVE_ATTRIBUTES: number; - NEVER: number; - FLOAT_VEC4: number; - CURRENT_VERTEX_ATTRIB: number; - STENCIL_PASS_DEPTH_PASS: number; - INVERT: number; - LINK_STATUS: number; - RGB: number; - INT_VEC4: number; - TEXTURE2: number; - UNPACK_COLORSPACE_CONVERSION_WEBGL: number; - MEDIUM_FLOAT: number; - SRC_ALPHA_SATURATE: number; - BUFFER_USAGE: number; - SHORT: number; - NONE: number; - UNSIGNED_BYTE: number; - INT: number; - SUBPIXEL_BITS: number; - KEEP: number; - SAMPLES: number; - FRAGMENT_SHADER: number; - LINE_WIDTH: number; - BLEND_SRC_RGB: number; - LOW_FLOAT: number; - VERSION: number; -} - -interface WebGLProgram extends WebGLObject { -} -declare var WebGLProgram: { - prototype: WebGLProgram; - new(): WebGLProgram; -} - -interface OES_standard_derivatives { - FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number; -} -declare var OES_standard_derivatives: { - prototype: OES_standard_derivatives; - new(): OES_standard_derivatives; - FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number; -} - -interface WebGLFramebuffer extends WebGLObject { -} -declare var WebGLFramebuffer: { - prototype: WebGLFramebuffer; - new(): WebGLFramebuffer; -} - -interface WebGLShader extends WebGLObject { -} -declare var WebGLShader: { - prototype: WebGLShader; - new(): WebGLShader; -} - -interface OES_texture_float_linear { -} -declare var OES_texture_float_linear: { - prototype: OES_texture_float_linear; - new(): OES_texture_float_linear; -} - -interface WebGLObject { -} -declare var WebGLObject: { - prototype: WebGLObject; - new(): WebGLObject; -} - -interface WebGLBuffer extends WebGLObject { -} -declare var WebGLBuffer: { - prototype: WebGLBuffer; - new(): WebGLBuffer; -} - -interface WebGLShaderPrecisionFormat { - rangeMin: number; - rangeMax: number; - precision: number; -} -declare var WebGLShaderPrecisionFormat: { - prototype: WebGLShaderPrecisionFormat; - new(): WebGLShaderPrecisionFormat; -} - -interface EXT_texture_filter_anisotropic { - TEXTURE_MAX_ANISOTROPY_EXT: number; - MAX_TEXTURE_MAX_ANISOTROPY_EXT: number; -} -declare var EXT_texture_filter_anisotropic: { - prototype: EXT_texture_filter_anisotropic; - new(): EXT_texture_filter_anisotropic; - TEXTURE_MAX_ANISOTROPY_EXT: number; - MAX_TEXTURE_MAX_ANISOTROPY_EXT: number; -} - -declare var Option: { new(text?: string, value?: string, defaultSelected?: boolean, selected?:boolean): HTMLOptionElement; }; -declare var Image: { new(width?: number, height?: number): HTMLImageElement; }; -declare var Audio: { new(src?: string): HTMLAudioElement; }; - -declare var ondragend: (ev: DragEvent) => any; -declare var onkeydown: (ev: KeyboardEvent) => any; -declare var ondragover: (ev: DragEvent) => any; -declare var onkeyup: (ev: KeyboardEvent) => any; -declare var onreset: (ev: Event) => any; -declare var onmouseup: (ev: MouseEvent) => any; -declare var ondragstart: (ev: DragEvent) => any; -declare var ondrag: (ev: DragEvent) => any; -declare var screenX: number; -declare var onmouseover: (ev: MouseEvent) => any; -declare var ondragleave: (ev: DragEvent) => any; -declare var history: History; -declare var pageXOffset: number; -declare var name: string; -declare var onafterprint: (ev: Event) => any; -declare var onpause: (ev: Event) => any; -declare var onbeforeprint: (ev: Event) => any; -declare var top: Window; -declare var onmousedown: (ev: MouseEvent) => any; -declare var onseeked: (ev: Event) => any; -declare var opener: Window; -declare var onclick: (ev: MouseEvent) => any; -declare var innerHeight: number; -declare var onwaiting: (ev: Event) => any; -declare var ononline: (ev: Event) => any; -declare var ondurationchange: (ev: Event) => any; -declare var frames: Window; -declare var onblur: (ev: FocusEvent) => any; -declare var onemptied: (ev: Event) => any; -declare var onseeking: (ev: Event) => any; -declare var oncanplay: (ev: Event) => any; -declare var outerWidth: number; -declare var onstalled: (ev: Event) => any; -declare var onmousemove: (ev: MouseEvent) => any; -declare var innerWidth: number; -declare var onoffline: (ev: Event) => any; -declare var length: number; -declare var screen: Screen; -declare var onbeforeunload: (ev: BeforeUnloadEvent) => any; -declare var onratechange: (ev: Event) => any; -declare var onstorage: (ev: StorageEvent) => any; -declare var onloadstart: (ev: Event) => any; -declare var ondragenter: (ev: DragEvent) => any; -declare var onsubmit: (ev: Event) => any; -declare var self: Window; -declare var document: Document; -declare var onprogress: (ev: ProgressEvent) => any; -declare var ondblclick: (ev: MouseEvent) => any; -declare var pageYOffset: number; -declare var oncontextmenu: (ev: MouseEvent) => any; -declare var onchange: (ev: Event) => any; -declare var onloadedmetadata: (ev: Event) => any; -declare var onplay: (ev: Event) => any; -declare var onerror: ErrorEventHandler; -declare var onplaying: (ev: Event) => any; -declare var parent: Window; -declare var location: Location; -declare var oncanplaythrough: (ev: Event) => any; -declare var onabort: (ev: UIEvent) => any; -declare var onreadystatechange: (ev: Event) => any; -declare var outerHeight: number; -declare var onkeypress: (ev: KeyboardEvent) => any; -declare var frameElement: Element; -declare var onloadeddata: (ev: Event) => any; -declare var onsuspend: (ev: Event) => any; -declare var window: Window; -declare var onfocus: (ev: FocusEvent) => any; -declare var onmessage: (ev: MessageEvent) => any; -declare var ontimeupdate: (ev: Event) => any; -declare var onresize: (ev: UIEvent) => any; -declare var onselect: (ev: UIEvent) => any; -declare var navigator: Navigator; -declare var styleMedia: StyleMedia; -declare var ondrop: (ev: DragEvent) => any; -declare var onmouseout: (ev: MouseEvent) => any; -declare var onended: (ev: Event) => any; -declare var onhashchange: (ev: Event) => any; -declare var onunload: (ev: Event) => any; -declare var onscroll: (ev: UIEvent) => any; -declare var screenY: number; -declare var onmousewheel: (ev: MouseWheelEvent) => any; -declare var onload: (ev: Event) => any; -declare var onvolumechange: (ev: Event) => any; -declare var oninput: (ev: Event) => any; -declare var performance: Performance; -declare var onmspointerdown: (ev: any) => any; -declare var animationStartTime: number; -declare var onmsgesturedoubletap: (ev: any) => any; -declare var onmspointerhover: (ev: any) => any; -declare var onmsgesturehold: (ev: any) => any; -declare var onmspointermove: (ev: any) => any; -declare var onmsgesturechange: (ev: any) => any; -declare var onmsgesturestart: (ev: any) => any; -declare var onmspointercancel: (ev: any) => any; -declare var onmsgestureend: (ev: any) => any; -declare var onmsgesturetap: (ev: any) => any; -declare var onmspointerout: (ev: any) => any; -declare var msAnimationStartTime: number; -declare var applicationCache: ApplicationCache; -declare var onmsinertiastart: (ev: any) => any; -declare var onmspointerover: (ev: any) => any; -declare var onpopstate: (ev: PopStateEvent) => any; -declare var onmspointerup: (ev: any) => any; -declare var onpageshow: (ev: PageTransitionEvent) => any; -declare var ondevicemotion: (ev: DeviceMotionEvent) => any; -declare var devicePixelRatio: number; -declare var msCrypto: Crypto; -declare var ondeviceorientation: (ev: DeviceOrientationEvent) => any; -declare var doNotTrack: string; -declare var onmspointerenter: (ev: any) => any; -declare var onpagehide: (ev: PageTransitionEvent) => any; -declare var onmspointerleave: (ev: any) => any; -declare function alert(message?: any): void; -declare function scroll(x?: number, y?: number): void; -declare function focus(): void; -declare function scrollTo(x?: number, y?: number): void; -declare function print(): void; -declare function prompt(message?: string, _default?: string): string; -declare function toString(): string; -declare function open(url?: string, target?: string, features?: string, replace?: boolean): Window; -declare function scrollBy(x?: number, y?: number): void; -declare function confirm(message?: string): boolean; -declare function close(): void; -declare function postMessage(message: any, targetOrigin: string, ports?: any): void; -declare function showModalDialog(url?: string, argument?: any, options?: any): any; -declare function blur(): void; -declare function getSelection(): Selection; -declare function getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; -declare function msCancelRequestAnimationFrame(handle: number): void; -declare function matchMedia(mediaQuery: string): MediaQueryList; -declare function cancelAnimationFrame(handle: number): void; -declare function msIsStaticHTML(html: string): boolean; -declare function msMatchMedia(mediaQuery: string): MediaQueryList; -declare function requestAnimationFrame(callback: FrameRequestCallback): number; -declare function msRequestAnimationFrame(callback: FrameRequestCallback): number; -declare function removeEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -declare function dispatchEvent(evt: Event): boolean; -declare function attachEvent(event: string, listener: EventListener): boolean; -declare function detachEvent(event: string, listener: EventListener): void; -declare var localStorage: Storage; -declare var status: string; -declare var onmouseleave: (ev: MouseEvent) => any; -declare var screenLeft: number; -declare var offscreenBuffering: any; -declare var maxConnectionsPerServer: number; -declare var onmouseenter: (ev: MouseEvent) => any; -declare var clipboardData: DataTransfer; -declare var defaultStatus: string; -declare var clientInformation: Navigator; -declare var closed: boolean; -declare var onhelp: (ev: Event) => any; -declare var external: External; -declare var event: MSEventObj; -declare var onfocusout: (ev: FocusEvent) => any; -declare var screenTop: number; -declare var onfocusin: (ev: FocusEvent) => any; -declare function showModelessDialog(url?: string, argument?: any, options?: any): Window; -declare function navigate(url: string): void; -declare function resizeBy(x?: number, y?: number): void; -declare function item(index: any): any; -declare function resizeTo(x?: number, y?: number): void; -declare function createPopup(arguments?: any): MSPopupWindow; -declare function toStaticHTML(html: string): string; -declare function execScript(code: string, language?: string): any; -declare function msWriteProfilerMark(profilerMarkName: string): void; -declare function moveTo(x?: number, y?: number): void; -declare function moveBy(x?: number, y?: number): void; -declare function showHelp(url: string, helpArg?: any, features?: string): void; -declare function captureEvents(): void; -declare function releaseEvents(): void; -declare var sessionStorage: Storage; -declare function clearTimeout(handle: number): void; -declare function setTimeout(handler: any, timeout?: any, ...args: any[]): number; -declare function clearInterval(handle: number): void; -declare function setInterval(handler: any, timeout?: any, ...args: any[]): number; -declare function msSetImmediate(expression: any, ...args: any[]): number; -declare function clearImmediate(handle: number): void; -declare function msClearImmediate(handle: number): void; -declare function setImmediate(expression: any, ...args: any[]): number; -declare function btoa(rawString: string): string; -declare function atob(encodedString: string): string; -declare var msIndexedDB: IDBFactory; -declare var indexedDB: IDBFactory; -declare var console: Console; -declare var onpointerenter: (ev: PointerEvent) => any; -declare var onpointerout: (ev: PointerEvent) => any; -declare var onpointerdown: (ev: PointerEvent) => any; -declare var onpointerup: (ev: PointerEvent) => any; -declare var onpointercancel: (ev: PointerEvent) => any; -declare var onpointerover: (ev: PointerEvent) => any; -declare var onpointermove: (ev: PointerEvent) => any; -declare var onpointerleave: (ev: PointerEvent) => any; -declare function addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "hashchange", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "devicemotion", listener: (ev: DeviceMotionEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "deviceorientation", listener: (ev: DeviceOrientationEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; - -///////////////////////////// -/// WorkerGlobalScope APIs -///////////////////////////// -// These are only available in a Web Worker -declare function importScripts(...urls: string[]): void; - - -///////////////////////////// -/// Windows Script Host APIS -///////////////////////////// - -declare var ActiveXObject: { new (s: string): any; }; - -interface ITextWriter { - Write(s: string): void; - WriteLine(s: string): void; - Close(): void; -} - -declare var WScript: { - Echo(s: any): void; - StdErr: ITextWriter; - StdOut: ITextWriter; - Arguments: { length: number; Item(n: number): string; }; - ScriptFullName: string; - Quit(exitCode?: number): number; -} diff --git a/pages/third_party/typescript/bin/lib.dom.d.ts b/pages/third_party/typescript/bin/lib.dom.d.ts deleted file mode 100644 index 26d30d3a02..0000000000 --- a/pages/third_party/typescript/bin/lib.dom.d.ts +++ /dev/null @@ -1,13038 +0,0 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - -/// - -///////////////////////////// -/// IE10 ECMAScript Extensions -///////////////////////////// - -/** - * Represents a raw buffer of binary data, which is used to store data for the - * different typed arrays. ArrayBuffers cannot be read from or written to directly, - * but can be passed to a typed array or DataView Object to interpret the raw - * buffer as needed. - */ -interface ArrayBuffer { - /** - * Read-only. The length of the ArrayBuffer (in bytes). - */ - byteLength: number; - - /** - * Returns a section of an ArrayBuffer. - */ - slice(begin:number, end?:number): ArrayBuffer; -} - -declare var ArrayBuffer: { - prototype: ArrayBuffer; - new (byteLength: number): ArrayBuffer; -} - -interface ArrayBufferView { - buffer: ArrayBuffer; - byteOffset: number; - byteLength: number; -} - -/** - * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Int8Array extends ArrayBufferView { - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * The length of the array. - */ - length: number; - - [index: number]: number; - - /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. - */ - get(index: number): number; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: Int8Array, offset?: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: number[], offset?: number): void; - - /** - * Gets a new Int8Array view of the ArrayBuffer store for this array, referencing the elements at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Int8Array; -} -declare var Int8Array: { - prototype: Int8Array; - new (length: number): Int8Array; - new (array: Int8Array): Int8Array; - new (array: number[]): Int8Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int8Array; - BYTES_PER_ELEMENT: number; -} - -/** - * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Uint8Array extends ArrayBufferView { - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * The length of the array. - */ - length: number; - [index: number]: number; - - /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. - */ - get(index: number): number; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: Uint8Array, offset?: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: number[], offset?: number): void; - - /** - * Gets a new Uint8Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Uint8Array; -} -declare var Uint8Array: { - prototype: Uint8Array; - new (length: number): Uint8Array; - new (array: Uint8Array): Uint8Array; - new (array: number[]): Uint8Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint8Array; - BYTES_PER_ELEMENT: number; -} - -/** - * A typed array of 16-bit integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Int16Array extends ArrayBufferView { - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * The length of the array. - */ - length: number; - [index: number]: number; - - /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. - */ - get(index: number): number; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: Int16Array, offset?: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: number[], offset?: number): void; - - /** - * Gets a new Int16Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Int16Array; -} -declare var Int16Array: { - prototype: Int16Array; - new (length: number): Int16Array; - new (array: Int16Array): Int16Array; - new (array: number[]): Int16Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int16Array; - BYTES_PER_ELEMENT: number; -} - -/** - * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Uint16Array extends ArrayBufferView { - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * The length of the array. - */ - length: number; - [index: number]: number; - - /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. - */ - get(index: number): number; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: Uint16Array, offset?: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: number[], offset?: number): void; - - /** - * Gets a new Uint16Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Uint16Array; -} -declare var Uint16Array: { - prototype: Uint16Array; - new (length: number): Uint16Array; - new (array: Uint16Array): Uint16Array; - new (array: number[]): Uint16Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint16Array; - BYTES_PER_ELEMENT: number; -} - -/** - * A typed array of 32-bit integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Int32Array extends ArrayBufferView { - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * The length of the array. - */ - length: number; - [index: number]: number; - - /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. - */ - get(index: number): number; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: Int32Array, offset?: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: number[], offset?: number): void; - - /** - * Gets a new Int32Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Int32Array; -} -declare var Int32Array: { - prototype: Int32Array; - new (length: number): Int32Array; - new (array: Int32Array): Int32Array; - new (array: number[]): Int32Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int32Array; - BYTES_PER_ELEMENT: number; -} - -/** - * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Uint32Array extends ArrayBufferView { - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * The length of the array. - */ - length: number; - [index: number]: number; - - /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. - */ - get(index: number): number; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: Uint32Array, offset?: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: number[], offset?: number): void; - - /** - * Gets a new Int8Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Uint32Array; -} -declare var Uint32Array: { - prototype: Uint32Array; - new (length: number): Uint32Array; - new (array: Uint32Array): Uint32Array; - new (array: number[]): Uint32Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint32Array; - BYTES_PER_ELEMENT: number; -} - -/** - * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Float32Array extends ArrayBufferView { - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * The length of the array. - */ - length: number; - [index: number]: number; - - /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. - */ - get(index: number): number; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: Float32Array, offset?: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: number[], offset?: number): void; - - /** - * Gets a new Float32Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Float32Array; -} -declare var Float32Array: { - prototype: Float32Array; - new (length: number): Float32Array; - new (array: Float32Array): Float32Array; - new (array: number[]): Float32Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float32Array; - BYTES_PER_ELEMENT: number; -} - -/** - * A typed array of 64-bit float values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Float64Array extends ArrayBufferView { - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * The length of the array. - */ - length: number; - [index: number]: number; - - /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. - */ - get(index: number): number; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: Float64Array, offset?: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: number[], offset?: number): void; - - /** - * Gets a new Float64Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Float64Array; -} -declare var Float64Array: { - prototype: Float64Array; - new (length: number): Float64Array; - new (array: Float64Array): Float64Array; - new (array: number[]): Float64Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float64Array; - BYTES_PER_ELEMENT: number; -} - -/** - * You can use a DataView object to read and write the different kinds of binary data to any location in the ArrayBuffer. - */ -interface DataView extends ArrayBufferView { - /** - * Gets the Int8 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getInt8(byteOffset: number): number; - - /** - * Gets the Uint8 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getUint8(byteOffset: number): number; - - /** - * Gets the Int16 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getInt16(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Uint16 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getUint16(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Int32 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getInt32(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Uint32 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getUint32(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Float32 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getFloat32(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Float64 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getFloat64(byteOffset: number, littleEndian?: boolean): number; - - /** - * Stores an Int8 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - */ - setInt8(byteOffset: number, value: number): void; - - /** - * Stores an Uint8 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - */ - setUint8(byteOffset: number, value: number): void; - - /** - * Stores an Int16 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. - */ - setInt16(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Uint16 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. - */ - setUint16(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Int32 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. - */ - setInt32(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Uint32 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. - */ - setUint32(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Float32 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. - */ - setFloat32(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Float64 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. - */ - setFloat64(byteOffset: number, value: number, littleEndian?: boolean): void; -} -declare var DataView: { - prototype: DataView; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): DataView; -} - -///////////////////////////// -/// IE11 ECMAScript Extensions -///////////////////////////// - -interface Map { - clear(): void; - delete(key: K): boolean; - forEach(callbackfn: (value: V, index: K, map: Map) => void, thisArg?: any): void; - get(key: K): V; - has(key: K): boolean; - set(key: K, value: V): Map; - size: number; -} -declare var Map: { - new (): Map; -} - -interface WeakMap { - clear(): void; - delete(key: K): boolean; - get(key: K): V; - has(key: K): boolean; - set(key: K, value: V): WeakMap; -} -declare var WeakMap: { - new (): WeakMap; -} - -interface Set { - add(value: T): Set; - clear(): void; - delete(value: T): boolean; - forEach(callbackfn: (value: T, index: T, set: Set) => void, thisArg?: any): void; - has(value: T): boolean; - size: number; -} -declare var Set: { - new (): Set; -} - -declare module Intl { - - interface CollatorOptions { - usage?: string; - localeMatcher?: string; - numeric?: boolean; - caseFirst?: string; - sensitivity?: string; - ignorePunctuation?: boolean; - } - - interface ResolvedCollatorOptions { - locale: string; - usage: string; - sensitivity: string; - ignorePunctuation: boolean; - collation: string; - caseFirst: string; - numeric: boolean; - } - - interface Collator { - compare(x: string, y: string): number; - resolvedOptions(): ResolvedCollatorOptions; - } - var Collator: { - new (locales?: string[], options?: CollatorOptions): Collator; - new (locale?: string, options?: CollatorOptions): Collator; - (locales?: string[], options?: CollatorOptions): Collator; - (locale?: string, options?: CollatorOptions): Collator; - supportedLocalesOf(locales: string[], options?: CollatorOptions): string[]; - supportedLocalesOf(locale: string, options?: CollatorOptions): string[]; - } - - interface NumberFormatOptions { - localeMatcher?: string; - style?: string; - currency?: string; - currencyDisplay?: string; - useGrouping?: boolean; - } - - interface ResolvedNumberFormatOptions { - locale: string; - numberingSystem: string; - style: string; - currency?: string; - currencyDisplay?: string; - minimumintegerDigits: number; - minimumFractionDigits: number; - maximumFractionDigits: number; - minimumSignificantDigits?: number; - maximumSignificantDigits?: number; - useGrouping: boolean; - } - - interface NumberFormat { - format(value: number): string; - resolvedOptions(): ResolvedNumberFormatOptions; - } - var NumberFormat: { - new (locales?: string[], options?: NumberFormatOptions): Collator; - new (locale?: string, options?: NumberFormatOptions): Collator; - (locales?: string[], options?: NumberFormatOptions): Collator; - (locale?: string, options?: NumberFormatOptions): Collator; - supportedLocalesOf(locales: string[], options?: NumberFormatOptions): string[]; - supportedLocalesOf(locale: string, options?: NumberFormatOptions): string[]; - } - - interface DateTimeFormatOptions { - localeMatcher?: string; - weekday?: string; - era?: string; - year?: string; - month?: string; - day?: string; - hour?: string; - minute?: string; - second?: string; - timeZoneName?: string; - formatMatcher?: string; - hour12: boolean; - } - - interface ResolvedDateTimeFormatOptions { - locale: string; - calendar: string; - numberingSystem: string; - timeZone: string; - hour12?: boolean; - weekday?: string; - era?: string; - year?: string; - month?: string; - day?: string; - hour?: string; - minute?: string; - second?: string; - timeZoneName?: string; - } - - interface DateTimeFormat { - format(date: number): string; - resolvedOptions(): ResolvedDateTimeFormatOptions; - } - var DateTimeFormat: { - new (locales?: string[], options?: DateTimeFormatOptions): Collator; - new (locale?: string, options?: DateTimeFormatOptions): Collator; - (locales?: string[], options?: DateTimeFormatOptions): Collator; - (locale?: string, options?: DateTimeFormatOptions): Collator; - supportedLocalesOf(locales: string[], options?: DateTimeFormatOptions): string[]; - supportedLocalesOf(locale: string, options?: DateTimeFormatOptions): string[]; - } -} - -interface String { - /** - * Determines whether two strings are equivalent in the current locale. - * @param that String to compare to target string - * @param locales An array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details. - * @param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details. - */ - localeCompare(that: string, locales: string[], options?: Intl.CollatorOptions): number; - - /** - * Determines whether two strings are equivalent in the current locale. - * @param that String to compare to target string - * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details. - * @param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details. - */ - localeCompare(that: string, locale: string, options?: Intl.CollatorOptions): number; -} - -interface Number { - /** - * Converts a number to a string by using the current or specified locale. - * @param locales An array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. - * @param options An object that contains one or more properties that specify comparison options. - */ - toLocaleString(locales?: string[], options?: Intl.NumberFormatOptions): string; - - /** - * Converts a number to a string by using the current or specified locale. - * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used. - * @param options An object that contains one or more properties that specify comparison options. - */ - toLocaleString(locale?: string, options?: Intl.NumberFormatOptions): string; -} - -interface Date { - /** - * Converts a date to a string by using the current or specified locale. - * @param locales An array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. - * @param options An object that contains one or more properties that specify comparison options. - */ - toLocaleString(locales?: string[], options?: Intl.DateTimeFormatOptions): string; - - /** - * Converts a date to a string by using the current or specified locale. - * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used. - * @param options An object that contains one or more properties that specify comparison options. - */ - toLocaleString(locale?: string, options?: Intl.DateTimeFormatOptions): string; -} - -///////////////////////////// -/// IE DOM APIs -///////////////////////////// - - -interface PositionOptions { - enableHighAccuracy?: boolean; - timeout?: number; - maximumAge?: number; -} - -interface ObjectURLOptions { - oneTimeOnly?: boolean; -} - -interface StoreExceptionsInformation extends ExceptionInformation { - siteName?: string; - explanationString?: string; - detailURI?: string; -} - -interface StoreSiteSpecificExceptionsInformation extends StoreExceptionsInformation { - arrayOfDomainStrings?: string[]; -} - -interface ConfirmSiteSpecificExceptionsInformation extends ExceptionInformation { - arrayOfDomainStrings?: string[]; -} - -interface AlgorithmParameters { -} - -interface MutationObserverInit { - childList?: boolean; - attributes?: boolean; - characterData?: boolean; - subtree?: boolean; - attributeOldValue?: boolean; - characterDataOldValue?: boolean; - attributeFilter?: string[]; -} - -interface PointerEventInit extends MouseEventInit { - pointerId?: number; - width?: number; - height?: number; - pressure?: number; - tiltX?: number; - tiltY?: number; - pointerType?: string; - isPrimary?: boolean; -} - -interface ExceptionInformation { - domain?: string; -} - -interface DeviceAccelerationDict { - x?: number; - y?: number; - z?: number; -} - -interface MsZoomToOptions { - contentX?: number; - contentY?: number; - viewportX?: string; - viewportY?: string; - scaleFactor?: number; - animate?: string; -} - -interface DeviceRotationRateDict { - alpha?: number; - beta?: number; - gamma?: number; -} - -interface Algorithm { - name?: string; - params?: AlgorithmParameters; -} - -interface MouseEventInit { - bubbles?: boolean; - cancelable?: boolean; - view?: Window; - detail?: number; - screenX?: number; - screenY?: number; - clientX?: number; - clientY?: number; - ctrlKey?: boolean; - shiftKey?: boolean; - altKey?: boolean; - metaKey?: boolean; - button?: number; - buttons?: number; - relatedTarget?: EventTarget; -} - -interface WebGLContextAttributes { - alpha?: boolean; - depth?: boolean; - stencil?: boolean; - antialias?: boolean; - premultipliedAlpha?: boolean; - preserveDrawingBuffer?: boolean; -} - -interface NodeListOf extends NodeList { - length: number; - item(index: number): TNode; - [index: number]: TNode; -} - -interface HTMLElement extends Element, ElementCSSInlineStyle, MSEventAttachmentTarget, MSNodeExtensions { - hidden: any; - readyState: any; - onmouseleave: (ev: MouseEvent) => any; - onbeforecut: (ev: DragEvent) => any; - onkeydown: (ev: KeyboardEvent) => any; - onmove: (ev: MSEventObj) => any; - onkeyup: (ev: KeyboardEvent) => any; - onreset: (ev: Event) => any; - onhelp: (ev: Event) => any; - ondragleave: (ev: DragEvent) => any; - className: string; - onfocusin: (ev: FocusEvent) => any; - onseeked: (ev: Event) => any; - recordNumber: any; - title: string; - parentTextEdit: Element; - outerHTML: string; - ondurationchange: (ev: Event) => any; - offsetHeight: number; - all: HTMLCollection; - onblur: (ev: FocusEvent) => any; - dir: string; - onemptied: (ev: Event) => any; - onseeking: (ev: Event) => any; - oncanplay: (ev: Event) => any; - ondeactivate: (ev: UIEvent) => any; - ondatasetchanged: (ev: MSEventObj) => any; - onrowsdelete: (ev: MSEventObj) => any; - sourceIndex: number; - onloadstart: (ev: Event) => any; - onlosecapture: (ev: MSEventObj) => any; - ondragenter: (ev: DragEvent) => any; - oncontrolselect: (ev: MSEventObj) => any; - onsubmit: (ev: Event) => any; - behaviorUrns: MSBehaviorUrnsCollection; - scopeName: string; - onchange: (ev: Event) => any; - id: string; - onlayoutcomplete: (ev: MSEventObj) => any; - uniqueID: string; - onbeforeactivate: (ev: UIEvent) => any; - oncanplaythrough: (ev: Event) => any; - onbeforeupdate: (ev: MSEventObj) => any; - onfilterchange: (ev: MSEventObj) => any; - offsetParent: Element; - ondatasetcomplete: (ev: MSEventObj) => any; - onsuspend: (ev: Event) => any; - onmouseenter: (ev: MouseEvent) => any; - innerText: string; - onerrorupdate: (ev: MSEventObj) => any; - onmouseout: (ev: MouseEvent) => any; - parentElement: HTMLElement; - onmousewheel: (ev: MouseWheelEvent) => any; - onvolumechange: (ev: Event) => any; - oncellchange: (ev: MSEventObj) => any; - onrowexit: (ev: MSEventObj) => any; - onrowsinserted: (ev: MSEventObj) => any; - onpropertychange: (ev: MSEventObj) => any; - filters: any; - children: HTMLCollection; - ondragend: (ev: DragEvent) => any; - onbeforepaste: (ev: DragEvent) => any; - ondragover: (ev: DragEvent) => any; - offsetTop: number; - onmouseup: (ev: MouseEvent) => any; - ondragstart: (ev: DragEvent) => any; - onbeforecopy: (ev: DragEvent) => any; - ondrag: (ev: DragEvent) => any; - innerHTML: string; - onmouseover: (ev: MouseEvent) => any; - lang: string; - uniqueNumber: number; - onpause: (ev: Event) => any; - tagUrn: string; - onmousedown: (ev: MouseEvent) => any; - onclick: (ev: MouseEvent) => any; - onwaiting: (ev: Event) => any; - onresizestart: (ev: MSEventObj) => any; - offsetLeft: number; - isTextEdit: boolean; - isDisabled: boolean; - onpaste: (ev: DragEvent) => any; - canHaveHTML: boolean; - onmoveend: (ev: MSEventObj) => any; - language: string; - onstalled: (ev: Event) => any; - onmousemove: (ev: MouseEvent) => any; - style: MSStyleCSSProperties; - isContentEditable: boolean; - onbeforeeditfocus: (ev: MSEventObj) => any; - onratechange: (ev: Event) => any; - contentEditable: string; - tabIndex: number; - document: Document; - onprogress: (ev: ProgressEvent) => any; - ondblclick: (ev: MouseEvent) => any; - oncontextmenu: (ev: MouseEvent) => any; - onloadedmetadata: (ev: Event) => any; - onafterupdate: (ev: MSEventObj) => any; - onerror: (ev: ErrorEvent) => any; - onplay: (ev: Event) => any; - onresizeend: (ev: MSEventObj) => any; - onplaying: (ev: Event) => any; - isMultiLine: boolean; - onfocusout: (ev: FocusEvent) => any; - onabort: (ev: UIEvent) => any; - ondataavailable: (ev: MSEventObj) => any; - hideFocus: boolean; - onreadystatechange: (ev: Event) => any; - onkeypress: (ev: KeyboardEvent) => any; - onloadeddata: (ev: Event) => any; - onbeforedeactivate: (ev: UIEvent) => any; - outerText: string; - disabled: boolean; - onactivate: (ev: UIEvent) => any; - accessKey: string; - onmovestart: (ev: MSEventObj) => any; - onselectstart: (ev: Event) => any; - onfocus: (ev: FocusEvent) => any; - ontimeupdate: (ev: Event) => any; - onresize: (ev: UIEvent) => any; - oncut: (ev: DragEvent) => any; - onselect: (ev: UIEvent) => any; - ondrop: (ev: DragEvent) => any; - offsetWidth: number; - oncopy: (ev: DragEvent) => any; - onended: (ev: Event) => any; - onscroll: (ev: UIEvent) => any; - onrowenter: (ev: MSEventObj) => any; - onload: (ev: Event) => any; - canHaveChildren: boolean; - oninput: (ev: Event) => any; - onmscontentzoom: (ev: MSEventObj) => any; - oncuechange: (ev: Event) => any; - spellcheck: boolean; - classList: DOMTokenList; - onmsmanipulationstatechanged: (ev: any) => any; - draggable: boolean; - dataset: DOMStringMap; - dragDrop(): boolean; - scrollIntoView(top?: boolean): void; - addFilter(filter: any): void; - setCapture(containerCapture?: boolean): void; - focus(): void; - getAdjacentText(where: string): string; - insertAdjacentText(where: string, text: string): void; - getElementsByClassName(classNames: string): NodeList; - setActive(): void; - removeFilter(filter: any): void; - blur(): void; - clearAttributes(): void; - releaseCapture(): void; - createControlRange(): ControlRangeCollection; - removeBehavior(cookie: number): boolean; - contains(child: HTMLElement): boolean; - click(): void; - insertAdjacentElement(position: string, insertedElement: Element): Element; - mergeAttributes(source: HTMLElement, preserveIdentity?: boolean): void; - replaceAdjacentText(where: string, newText: string): string; - applyElement(apply: Element, where?: string): Element; - addBehavior(bstrUrl: string, factory?: any): number; - insertAdjacentHTML(where: string, html: string): void; - msGetInputContext(): MSInputMethodContext; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var HTMLElement: { - prototype: HTMLElement; - new(): HTMLElement; -} - -interface Document extends Node, NodeSelector, MSEventAttachmentTarget, DocumentEvent, MSResourceMetadata, MSNodeExtensions, MSDocumentExtensions, GlobalEventHandlers { - /** - * Gets a reference to the root node of the document. - */ - documentElement: HTMLElement; - /** - * Retrieves the collection of user agents and versions declared in the X-UA-Compatible - */ - compatible: MSCompatibleInfoCollection; - /** - * Fires when the user presses a key. - * @param ev The keyboard event - */ - onkeydown: (ev: KeyboardEvent) => any; - /** - * Fires when the user releases a key. - * @param ev The keyboard event - */ - onkeyup: (ev: KeyboardEvent) => any; - /** - * Gets the implementation object of the current document. - */ - implementation: DOMImplementation; - /** - * Fires when the user resets a form. - * @param ev The event. - */ - onreset: (ev: Event) => any; - /** - * Retrieves a collection of all script objects in the document. - */ - scripts: HTMLCollection; - /** - * Fires when the user presses the F1 key while the browser is the active window. - * @param ev The event. - */ - onhelp: (ev: Event) => any; - /** - * Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation. - * @param ev The drag event. - */ - ondragleave: (ev: DragEvent) => any; - /** - * Gets or sets the character set used to encode the object. - */ - charset: string; - /** - * Fires for an element just prior to setting focus on that element. - * @param ev The focus event - */ - onfocusin: (ev: FocusEvent) => any; - /** - * Sets or gets the color of the links that the user has visited. - */ - vlinkColor: string; - /** - * Occurs when the seek operation ends. - * @param ev The event. - */ - onseeked: (ev: Event) => any; - security: string; - /** - * Contains the title of the document. - */ - title: string; - /** - * Retrieves a collection of namespace objects. - */ - namespaces: MSNamespaceInfoCollection; - /** - * Gets the default character set from the current regional language settings. - */ - defaultCharset: string; - /** - * Retrieves a collection of all embed objects in the document. - */ - embeds: HTMLCollection; - /** - * Retrieves a collection of styleSheet objects representing the style sheets that correspond to each instance of a link or style object in the document. - */ - styleSheets: StyleSheetList; - /** - * Retrieves a collection of all window objects defined by the given document or defined by the document associated with the given window. - */ - frames: Window; - /** - * Occurs when the duration attribute is updated. - * @param ev The event. - */ - ondurationchange: (ev: Event) => any; - /** - * Returns a reference to the collection of elements contained by the object. - */ - all: HTMLCollection; - /** - * Retrieves a collection, in source order, of all form objects in the document. - */ - forms: HTMLCollection; - /** - * Fires when the object loses the input focus. - * @param ev The focus event. - */ - onblur: (ev: FocusEvent) => any; - /** - * Sets or retrieves a value that indicates the reading order of the object. - */ - dir: string; - /** - * Occurs when the media element is reset to its initial state. - * @param ev The event. - */ - onemptied: (ev: Event) => any; - /** - * Sets or gets a value that indicates whether the document can be edited. - */ - designMode: string; - /** - * Occurs when the current playback position is moved. - * @param ev The event. - */ - onseeking: (ev: Event) => any; - /** - * Fires when the activeElement is changed from the current object to another object in the parent document. - * @param ev The UI Event - */ - ondeactivate: (ev: UIEvent) => any; - /** - * Occurs when playback is possible, but would require further buffering. - * @param ev The event. - */ - oncanplay: (ev: Event) => any; - /** - * Fires when the data set exposed by a data source object changes. - * @param ev The event. - */ - ondatasetchanged: (ev: MSEventObj) => any; - /** - * Fires when rows are about to be deleted from the recordset. - * @param ev The event - */ - onrowsdelete: (ev: MSEventObj) => any; - Script: MSScriptHost; - /** - * Occurs when Internet Explorer begins looking for media data. - * @param ev The event. - */ - onloadstart: (ev: Event) => any; - /** - * Gets the URL for the document, stripped of any character encoding. - */ - URLUnencoded: string; - defaultView: Window; - /** - * Fires when the user is about to make a control selection of the object. - * @param ev The event. - */ - oncontrolselect: (ev: MSEventObj) => any; - /** - * Fires on the target element when the user drags the object to a valid drop target. - * @param ev The drag event. - */ - ondragenter: (ev: DragEvent) => any; - onsubmit: (ev: Event) => any; - /** - * Returns the character encoding used to create the webpage that is loaded into the document object. - */ - inputEncoding: string; - /** - * Gets the object that has the focus when the parent document has focus. - */ - activeElement: Element; - /** - * Fires when the contents of the object or selection have changed. - * @param ev The event. - */ - onchange: (ev: Event) => any; - /** - * Retrieves a collection of all a objects that specify the href property and all area objects in the document. - */ - links: HTMLCollection; - /** - * Retrieves an autogenerated, unique identifier for the object. - */ - uniqueID: string; - /** - * Sets or gets the URL for the current document. - */ - URL: string; - /** - * Fires immediately before the object is set as the active element. - * @param ev The event. - */ - onbeforeactivate: (ev: UIEvent) => any; - head: HTMLHeadElement; - cookie: string; - xmlEncoding: string; - oncanplaythrough: (ev: Event) => any; - /** - * Retrieves the document compatibility mode of the document. - */ - documentMode: number; - characterSet: string; - /** - * Retrieves a collection of all a objects that have a name and/or id property. Objects in this collection are in HTML source order. - */ - anchors: HTMLCollection; - onbeforeupdate: (ev: MSEventObj) => any; - /** - * Fires to indicate that all data is available from the data source object. - * @param ev The event. - */ - ondatasetcomplete: (ev: MSEventObj) => any; - plugins: HTMLCollection; - /** - * Occurs if the load operation has been intentionally halted. - * @param ev The event. - */ - onsuspend: (ev: Event) => any; - /** - * Gets the root svg element in the document hierarchy. - */ - rootElement: SVGSVGElement; - /** - * Retrieves a value that indicates the current state of the object. - */ - readyState: string; - /** - * Gets the URL of the location that referred the user to the current page. - */ - referrer: string; - /** - * Sets or gets the color of all active links in the document. - */ - alinkColor: string; - /** - * Fires on a databound object when an error occurs while updating the associated data in the data source object. - * @param ev The event. - */ - onerrorupdate: (ev: MSEventObj) => any; - /** - * Gets a reference to the container object of the window. - */ - parentWindow: Window; - /** - * Fires when the user moves the mouse pointer outside the boundaries of the object. - * @param ev The mouse event. - */ - onmouseout: (ev: MouseEvent) => any; - /** - * Occurs when a user clicks a button in a Thumbnail Toolbar of a webpage running in Site Mode. - * @param ev The event. - */ - onmsthumbnailclick: (ev: MSSiteModeEvent) => any; - /** - * Fires when the wheel button is rotated. - * @param ev The mouse event - */ - onmousewheel: (ev: MouseWheelEvent) => any; - /** - * Occurs when the volume is changed, or playback is muted or unmuted. - * @param ev The event. - */ - onvolumechange: (ev: Event) => any; - /** - * Fires when data changes in the data provider. - * @param ev The event. - */ - oncellchange: (ev: MSEventObj) => any; - /** - * Fires just before the data source control changes the current row in the object. - * @param ev The event. - */ - onrowexit: (ev: MSEventObj) => any; - /** - * Fires just after new rows are inserted in the current recordset. - * @param ev The event. - */ - onrowsinserted: (ev: MSEventObj) => any; - /** - * Gets or sets the version attribute specified in the declaration of an XML document. - */ - xmlVersion: string; - msCapsLockWarningOff: boolean; - /** - * Fires when a property changes on the object. - * @param ev The event. - */ - onpropertychange: (ev: MSEventObj) => any; - /** - * Fires on the source object when the user releases the mouse at the close of a drag operation. - * @param ev The event. - */ - ondragend: (ev: DragEvent) => any; - /** - * Gets an object representing the document type declaration associated with the current document. - */ - doctype: DocumentType; - /** - * Fires on the target element continuously while the user drags the object over a valid drop target. - * @param ev The event. - */ - ondragover: (ev: DragEvent) => any; - /** - * Deprecated. Sets or retrieves a value that indicates the background color behind the object. - */ - bgColor: string; - /** - * Fires on the source object when the user starts to drag a text selection or selected object. - * @param ev The event. - */ - ondragstart: (ev: DragEvent) => any; - /** - * Fires when the user releases a mouse button while the mouse is over the object. - * @param ev The mouse event. - */ - onmouseup: (ev: MouseEvent) => any; - /** - * Fires on the source object continuously during a drag operation. - * @param ev The event. - */ - ondrag: (ev: DragEvent) => any; - /** - * Fires when the user moves the mouse pointer into the object. - * @param ev The mouse event. - */ - onmouseover: (ev: MouseEvent) => any; - /** - * Sets or gets the color of the document links. - */ - linkColor: string; - /** - * Occurs when playback is paused. - * @param ev The event. - */ - onpause: (ev: Event) => any; - /** - * Fires when the user clicks the object with either mouse button. - * @param ev The mouse event. - */ - onmousedown: (ev: MouseEvent) => any; - /** - * Fires when the user clicks the left mouse button on the object - * @param ev The mouse event. - */ - onclick: (ev: MouseEvent) => any; - /** - * Occurs when playback stops because the next frame of a video resource is not available. - * @param ev The event. - */ - onwaiting: (ev: Event) => any; - /** - * Fires when the user clicks the Stop button or leaves the Web page. - * @param ev The event. - */ - onstop: (ev: Event) => any; - /** - * Occurs when an item is removed from a Jump List of a webpage running in Site Mode. - * @param ev The event. - */ - onmssitemodejumplistitemremoved: (ev: MSSiteModeEvent) => any; - /** - * Retrieves a collection of all applet objects in the document. - */ - applets: HTMLCollection; - /** - * Specifies the beginning and end of the document body. - */ - body: HTMLElement; - /** - * Sets or gets the security domain of the document. - */ - domain: string; - xmlStandalone: boolean; - /** - * Represents the active selection, which is a highlighted block of text or other elements in the document that a user or a script can carry out some action on. - */ - selection: MSSelection; - /** - * Occurs when the download has stopped. - * @param ev The event. - */ - onstalled: (ev: Event) => any; - /** - * Fires when the user moves the mouse over the object. - * @param ev The mouse event. - */ - onmousemove: (ev: MouseEvent) => any; - /** - * Fires before an object contained in an editable element enters a UI-activated state or when an editable container object is control selected. - * @param ev The event. - */ - onbeforeeditfocus: (ev: MSEventObj) => any; - /** - * Occurs when the playback rate is increased or decreased. - * @param ev The event. - */ - onratechange: (ev: Event) => any; - /** - * Occurs to indicate progress while downloading media data. - * @param ev The event. - */ - onprogress: (ev: ProgressEvent) => any; - /** - * Fires when the user double-clicks the object. - * @param ev The mouse event. - */ - ondblclick: (ev: MouseEvent) => any; - /** - * Fires when the user clicks the right mouse button in the client area, opening the context menu. - * @param ev The mouse event. - */ - oncontextmenu: (ev: MouseEvent) => any; - /** - * Occurs when the duration and dimensions of the media have been determined. - * @param ev The event. - */ - onloadedmetadata: (ev: Event) => any; - media: string; - /** - * Fires when an error occurs during object loading. - * @param ev The event. - */ - onerror: (ev: ErrorEvent) => any; - /** - * Occurs when the play method is requested. - * @param ev The event. - */ - onplay: (ev: Event) => any; - onafterupdate: (ev: MSEventObj) => any; - /** - * Occurs when the audio or video has started playing. - * @param ev The event. - */ - onplaying: (ev: Event) => any; - /** - * Retrieves a collection, in source order, of img objects in the document. - */ - images: HTMLCollection; - /** - * Contains information about the current URL. - */ - location: Location; - /** - * Fires when the user aborts the download. - * @param ev The event. - */ - onabort: (ev: UIEvent) => any; - /** - * Fires for the current element with focus immediately after moving focus to another element. - * @param ev The event. - */ - onfocusout: (ev: FocusEvent) => any; - /** - * Fires when the selection state of a document changes. - * @param ev The event. - */ - onselectionchange: (ev: Event) => any; - /** - * Fires when a local DOM Storage area is written to disk. - * @param ev The event. - */ - onstoragecommit: (ev: StorageEvent) => any; - /** - * Fires periodically as data arrives from data source objects that asynchronously transmit their data. - * @param ev The event. - */ - ondataavailable: (ev: MSEventObj) => any; - /** - * Fires when the state of the object has changed. - * @param ev The event - */ - onreadystatechange: (ev: Event) => any; - /** - * Gets the date that the page was last modified, if the page supplies one. - */ - lastModified: string; - /** - * Fires when the user presses an alphanumeric key. - * @param ev The event. - */ - onkeypress: (ev: KeyboardEvent) => any; - /** - * Occurs when media data is loaded at the current playback position. - * @param ev The event. - */ - onloadeddata: (ev: Event) => any; - /** - * Fires immediately before the activeElement is changed from the current object to another object in the parent document. - * @param ev The event. - */ - onbeforedeactivate: (ev: UIEvent) => any; - /** - * Fires when the object is set as the active element. - * @param ev The event. - */ - onactivate: (ev: UIEvent) => any; - onselectstart: (ev: Event) => any; - /** - * Fires when the object receives focus. - * @param ev The event. - */ - onfocus: (ev: FocusEvent) => any; - /** - * Sets or gets the foreground (text) color of the document. - */ - fgColor: string; - /** - * Occurs to indicate the current playback position. - * @param ev The event. - */ - ontimeupdate: (ev: Event) => any; - /** - * Fires when the current selection changes. - * @param ev The event. - */ - onselect: (ev: UIEvent) => any; - ondrop: (ev: DragEvent) => any; - /** - * Occurs when the end of playback is reached. - * @param ev The event - */ - onended: (ev: Event) => any; - /** - * Gets a value that indicates whether standards-compliant mode is switched on for the object. - */ - compatMode: string; - /** - * Fires when the user repositions the scroll box in the scroll bar on the object. - * @param ev The event. - */ - onscroll: (ev: UIEvent) => any; - /** - * Fires to indicate that the current row has changed in the data source and new data values are available on the object. - * @param ev The event. - */ - onrowenter: (ev: MSEventObj) => any; - /** - * Fires immediately after the browser loads the object. - * @param ev The event. - */ - onload: (ev: Event) => any; - oninput: (ev: Event) => any; - onmspointerdown: (ev: any) => any; - msHidden: boolean; - msVisibilityState: string; - onmsgesturedoubletap: (ev: any) => any; - visibilityState: string; - onmsmanipulationstatechanged: (ev: any) => any; - onmspointerhover: (ev: any) => any; - onmscontentzoom: (ev: MSEventObj) => any; - onmspointermove: (ev: any) => any; - onmsgesturehold: (ev: any) => any; - onmsgesturechange: (ev: any) => any; - onmsgesturestart: (ev: any) => any; - onmspointercancel: (ev: any) => any; - onmsgestureend: (ev: any) => any; - onmsgesturetap: (ev: any) => any; - onmspointerout: (ev: any) => any; - onmsinertiastart: (ev: any) => any; - msCSSOMElementFloatMetrics: boolean; - onmspointerover: (ev: any) => any; - hidden: boolean; - onmspointerup: (ev: any) => any; - msFullscreenEnabled: boolean; - onmsfullscreenerror: (ev: any) => any; - onmspointerenter: (ev: any) => any; - msFullscreenElement: Element; - onmsfullscreenchange: (ev: any) => any; - onmspointerleave: (ev: any) => any; - /** - * Returns a reference to the first object with the specified value of the ID or NAME attribute. - * @param elementId String that specifies the ID value. Case-insensitive. - */ - getElementById(elementId: string): HTMLElement; - /** - * Returns the current value of the document, range, or current selection for the given command. - * @param commandId String that specifies a command identifier. - */ - queryCommandValue(commandId: string): string; - adoptNode(source: Node): Node; - /** - * Returns a Boolean value that indicates whether the specified command is in the indeterminate state. - * @param commandId String that specifies a command identifier. - */ - queryCommandIndeterm(commandId: string): boolean; - getElementsByTagNameNS(namespaceURI: string, localName: string): NodeList; - createProcessingInstruction(target: string, data: string): ProcessingInstruction; - /** - * Executes a command on the current document, current selection, or the given range. - * @param commandId String that specifies the command to execute. This command can be any of the command identifiers that can be executed in script. - * @param showUI Display the user interface, defaults to false. - * @param value Value to assign. - */ - execCommand(commandId: string, showUI?: boolean, value?: any): boolean; - /** - * Returns the element for the specified x coordinate and the specified y coordinate. - * @param x The x-offset - * @param y The y-offset - */ - elementFromPoint(x: number, y: number): Element; - createCDATASection(data: string): CDATASection; - /** - * Retrieves the string associated with a command. - * @param commandId String that contains the identifier of a command. This can be any command identifier given in the list of Command Identifiers. - */ - queryCommandText(commandId: string): string; - /** - * Writes one or more HTML expressions to a document in the specified window. - * @param content Specifies the text and HTML tags to write. - */ - write(...content: string[]): void; - /** - * Allows updating the print settings for the page. - */ - updateSettings(): void; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "a"): HTMLAnchorElement; - createElement(tagName: "abbr"): HTMLPhraseElement; - createElement(tagName: "acronym"): HTMLPhraseElement; - createElement(tagName: "address"): HTMLBlockElement; - createElement(tagName: "applet"): HTMLAppletElement; - createElement(tagName: "area"): HTMLAreaElement; - createElement(tagName: "article"): HTMLElement; - createElement(tagName: "aside"): HTMLElement; - createElement(tagName: "audio"): HTMLAudioElement; - createElement(tagName: "b"): HTMLPhraseElement; - createElement(tagName: "base"): HTMLBaseElement; - createElement(tagName: "basefont"): HTMLBaseFontElement; - createElement(tagName: "bdo"): HTMLPhraseElement; - createElement(tagName: "bgsound"): HTMLBGSoundElement; - createElement(tagName: "big"): HTMLPhraseElement; - createElement(tagName: "blockquote"): HTMLBlockElement; - createElement(tagName: "body"): HTMLBodyElement; - createElement(tagName: "br"): HTMLBRElement; - createElement(tagName: "button"): HTMLButtonElement; - createElement(tagName: "canvas"): HTMLCanvasElement; - createElement(tagName: "caption"): HTMLTableCaptionElement; - createElement(tagName: "center"): HTMLBlockElement; - createElement(tagName: "cite"): HTMLPhraseElement; - createElement(tagName: "code"): HTMLPhraseElement; - createElement(tagName: "col"): HTMLTableColElement; - createElement(tagName: "colgroup"): HTMLTableColElement; - createElement(tagName: "datalist"): HTMLDataListElement; - createElement(tagName: "dd"): HTMLDDElement; - createElement(tagName: "del"): HTMLModElement; - createElement(tagName: "dfn"): HTMLPhraseElement; - createElement(tagName: "dir"): HTMLDirectoryElement; - createElement(tagName: "div"): HTMLDivElement; - createElement(tagName: "dl"): HTMLDListElement; - createElement(tagName: "dt"): HTMLDTElement; - createElement(tagName: "em"): HTMLPhraseElement; - createElement(tagName: "embed"): HTMLEmbedElement; - createElement(tagName: "fieldset"): HTMLFieldSetElement; - createElement(tagName: "figcaption"): HTMLElement; - createElement(tagName: "figure"): HTMLElement; - createElement(tagName: "font"): HTMLFontElement; - createElement(tagName: "footer"): HTMLElement; - createElement(tagName: "form"): HTMLFormElement; - createElement(tagName: "frame"): HTMLFrameElement; - createElement(tagName: "frameset"): HTMLFrameSetElement; - createElement(tagName: "h1"): HTMLHeadingElement; - createElement(tagName: "h2"): HTMLHeadingElement; - createElement(tagName: "h3"): HTMLHeadingElement; - createElement(tagName: "h4"): HTMLHeadingElement; - createElement(tagName: "h5"): HTMLHeadingElement; - createElement(tagName: "h6"): HTMLHeadingElement; - createElement(tagName: "head"): HTMLHeadElement; - createElement(tagName: "header"): HTMLElement; - createElement(tagName: "hgroup"): HTMLElement; - createElement(tagName: "hr"): HTMLHRElement; - createElement(tagName: "html"): HTMLHtmlElement; - createElement(tagName: "i"): HTMLPhraseElement; - createElement(tagName: "iframe"): HTMLIFrameElement; - createElement(tagName: "img"): HTMLImageElement; - createElement(tagName: "input"): HTMLInputElement; - createElement(tagName: "ins"): HTMLModElement; - createElement(tagName: "isindex"): HTMLIsIndexElement; - createElement(tagName: "kbd"): HTMLPhraseElement; - createElement(tagName: "keygen"): HTMLBlockElement; - createElement(tagName: "label"): HTMLLabelElement; - createElement(tagName: "legend"): HTMLLegendElement; - createElement(tagName: "li"): HTMLLIElement; - createElement(tagName: "link"): HTMLLinkElement; - createElement(tagName: "listing"): HTMLBlockElement; - createElement(tagName: "map"): HTMLMapElement; - createElement(tagName: "mark"): HTMLElement; - createElement(tagName: "marquee"): HTMLMarqueeElement; - createElement(tagName: "menu"): HTMLMenuElement; - createElement(tagName: "meta"): HTMLMetaElement; - createElement(tagName: "nav"): HTMLElement; - createElement(tagName: "nextid"): HTMLNextIdElement; - createElement(tagName: "nobr"): HTMLPhraseElement; - createElement(tagName: "noframes"): HTMLElement; - createElement(tagName: "noscript"): HTMLElement; - createElement(tagName: "object"): HTMLObjectElement; - createElement(tagName: "ol"): HTMLOListElement; - createElement(tagName: "optgroup"): HTMLOptGroupElement; - createElement(tagName: "option"): HTMLOptionElement; - createElement(tagName: "p"): HTMLParagraphElement; - createElement(tagName: "param"): HTMLParamElement; - createElement(tagName: "plaintext"): HTMLBlockElement; - createElement(tagName: "pre"): HTMLPreElement; - createElement(tagName: "progress"): HTMLProgressElement; - createElement(tagName: "q"): HTMLQuoteElement; - createElement(tagName: "rt"): HTMLPhraseElement; - createElement(tagName: "ruby"): HTMLPhraseElement; - createElement(tagName: "s"): HTMLPhraseElement; - createElement(tagName: "samp"): HTMLPhraseElement; - createElement(tagName: "script"): HTMLScriptElement; - createElement(tagName: "section"): HTMLElement; - createElement(tagName: "select"): HTMLSelectElement; - createElement(tagName: "small"): HTMLPhraseElement; - createElement(tagName: "SOURCE"): HTMLSourceElement; - createElement(tagName: "span"): HTMLSpanElement; - createElement(tagName: "strike"): HTMLPhraseElement; - createElement(tagName: "strong"): HTMLPhraseElement; - createElement(tagName: "style"): HTMLStyleElement; - createElement(tagName: "sub"): HTMLPhraseElement; - createElement(tagName: "sup"): HTMLPhraseElement; - createElement(tagName: "table"): HTMLTableElement; - createElement(tagName: "tbody"): HTMLTableSectionElement; - createElement(tagName: "td"): HTMLTableDataCellElement; - createElement(tagName: "textarea"): HTMLTextAreaElement; - createElement(tagName: "tfoot"): HTMLTableSectionElement; - createElement(tagName: "th"): HTMLTableHeaderCellElement; - createElement(tagName: "thead"): HTMLTableSectionElement; - createElement(tagName: "title"): HTMLTitleElement; - createElement(tagName: "tr"): HTMLTableRowElement; - createElement(tagName: "track"): HTMLTrackElement; - createElement(tagName: "tt"): HTMLPhraseElement; - createElement(tagName: "u"): HTMLPhraseElement; - createElement(tagName: "ul"): HTMLUListElement; - createElement(tagName: "var"): HTMLPhraseElement; - createElement(tagName: "video"): HTMLVideoElement; - createElement(tagName: "wbr"): HTMLElement; - createElement(tagName: "x-ms-webview"): MSHTMLWebViewElement; - createElement(tagName: "xmp"): HTMLBlockElement; - createElement(tagName: string): HTMLElement; - /** - * Removes mouse capture from the object in the current document. - */ - releaseCapture(): void; - /** - * Writes one or more HTML expressions, followed by a carriage return, to a document in the specified window. - * @param content The text and HTML tags to write. - */ - writeln(...content: string[]): void; - createElementNS(namespaceURI: string, qualifiedName: string): Element; - /** - * Opens a new window and loads a document specified by a given URL. Also, opens a new window that uses the url parameter and the name parameter to collect the output of the write method and the writeln method. - * @param url Specifies a MIME type for the document. - * @param name Specifies the name of the window. This name is used as the value for the TARGET attribute on a form or an anchor element. - * @param features Contains a list of items separated by commas. Each item consists of an option and a value, separated by an equals sign (for example, "fullscreen=yes, toolbar=yes"). The following values are supported. - * @param replace Specifies whether the existing entry for the document is replaced in the history list. - */ - open(url?: string, name?: string, features?: string, replace?: boolean): any; - /** - * Returns a Boolean value that indicates whether the current command is supported on the current range. - * @param commandId Specifies a command identifier. - */ - queryCommandSupported(commandId: string): boolean; - /** - * Creates a TreeWalker object that you can use to traverse filtered lists of nodes or elements in a document. - * @param root The root element or node to start traversing on. - * @param whatToShow The type of nodes or elements to appear in the node list. For more information, see whatToShow. - * @param filter A custom NodeFilter function to use. - * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded. - */ - createTreeWalker(root: Node, whatToShow: number, filter: NodeFilter, entityReferenceExpansion: boolean): TreeWalker; - createAttributeNS(namespaceURI: string, qualifiedName: string): Attr; - /** - * Returns a Boolean value that indicates whether a specified command can be successfully executed using execCommand, given the current state of the document. - * @param commandId Specifies a command identifier. - */ - queryCommandEnabled(commandId: string): boolean; - /** - * Causes the element to receive the focus and executes the code specified by the onfocus event. - */ - focus(): void; - /** - * Closes an output stream and forces the sent data to display. - */ - close(): void; - getElementsByClassName(classNames: string): NodeList; - importNode(importedNode: Node, deep: boolean): Node; - /** - * Returns an empty range object that has both of its boundary points positioned at the beginning of the document. - */ - createRange(): Range; - /** - * Fires a specified event on the object. - * @param eventName Specifies the name of the event to fire. - * @param eventObj Object that specifies the event object from which to obtain event object properties. - */ - fireEvent(eventName: string, eventObj?: any): boolean; - /** - * Creates a comment object with the specified data. - * @param data Sets the comment object's data. - */ - createComment(data: string): Comment; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "a"): NodeListOf; - getElementsByTagName(name: "abbr"): NodeListOf; - getElementsByTagName(name: "acronym"): NodeListOf; - getElementsByTagName(name: "address"): NodeListOf; - getElementsByTagName(name: "applet"): NodeListOf; - getElementsByTagName(name: "area"): NodeListOf; - getElementsByTagName(name: "article"): NodeListOf; - getElementsByTagName(name: "aside"): NodeListOf; - getElementsByTagName(name: "audio"): NodeListOf; - getElementsByTagName(name: "b"): NodeListOf; - getElementsByTagName(name: "base"): NodeListOf; - getElementsByTagName(name: "basefont"): NodeListOf; - getElementsByTagName(name: "bdo"): NodeListOf; - getElementsByTagName(name: "bgsound"): NodeListOf; - getElementsByTagName(name: "big"): NodeListOf; - getElementsByTagName(name: "blockquote"): NodeListOf; - getElementsByTagName(name: "body"): NodeListOf; - getElementsByTagName(name: "br"): NodeListOf; - getElementsByTagName(name: "button"): NodeListOf; - getElementsByTagName(name: "canvas"): NodeListOf; - getElementsByTagName(name: "caption"): NodeListOf; - getElementsByTagName(name: "center"): NodeListOf; - getElementsByTagName(name: "cite"): NodeListOf; - getElementsByTagName(name: "code"): NodeListOf; - getElementsByTagName(name: "col"): NodeListOf; - getElementsByTagName(name: "colgroup"): NodeListOf; - getElementsByTagName(name: "datalist"): NodeListOf; - getElementsByTagName(name: "dd"): NodeListOf; - getElementsByTagName(name: "del"): NodeListOf; - getElementsByTagName(name: "dfn"): NodeListOf; - getElementsByTagName(name: "dir"): NodeListOf; - getElementsByTagName(name: "div"): NodeListOf; - getElementsByTagName(name: "dl"): NodeListOf; - getElementsByTagName(name: "dt"): NodeListOf; - getElementsByTagName(name: "em"): NodeListOf; - getElementsByTagName(name: "embed"): NodeListOf; - getElementsByTagName(name: "fieldset"): NodeListOf; - getElementsByTagName(name: "figcaption"): NodeListOf; - getElementsByTagName(name: "figure"): NodeListOf; - getElementsByTagName(name: "font"): NodeListOf; - getElementsByTagName(name: "footer"): NodeListOf; - getElementsByTagName(name: "form"): NodeListOf; - getElementsByTagName(name: "frame"): NodeListOf; - getElementsByTagName(name: "frameset"): NodeListOf; - getElementsByTagName(name: "h1"): NodeListOf; - getElementsByTagName(name: "h2"): NodeListOf; - getElementsByTagName(name: "h3"): NodeListOf; - getElementsByTagName(name: "h4"): NodeListOf; - getElementsByTagName(name: "h5"): NodeListOf; - getElementsByTagName(name: "h6"): NodeListOf; - getElementsByTagName(name: "head"): NodeListOf; - getElementsByTagName(name: "header"): NodeListOf; - getElementsByTagName(name: "hgroup"): NodeListOf; - getElementsByTagName(name: "hr"): NodeListOf; - getElementsByTagName(name: "html"): NodeListOf; - getElementsByTagName(name: "i"): NodeListOf; - getElementsByTagName(name: "iframe"): NodeListOf; - getElementsByTagName(name: "img"): NodeListOf; - getElementsByTagName(name: "input"): NodeListOf; - getElementsByTagName(name: "ins"): NodeListOf; - getElementsByTagName(name: "isindex"): NodeListOf; - getElementsByTagName(name: "kbd"): NodeListOf; - getElementsByTagName(name: "keygen"): NodeListOf; - getElementsByTagName(name: "label"): NodeListOf; - getElementsByTagName(name: "legend"): NodeListOf; - getElementsByTagName(name: "li"): NodeListOf; - getElementsByTagName(name: "link"): NodeListOf; - getElementsByTagName(name: "listing"): NodeListOf; - getElementsByTagName(name: "map"): NodeListOf; - getElementsByTagName(name: "mark"): NodeListOf; - getElementsByTagName(name: "marquee"): NodeListOf; - getElementsByTagName(name: "menu"): NodeListOf; - getElementsByTagName(name: "meta"): NodeListOf; - getElementsByTagName(name: "nav"): NodeListOf; - getElementsByTagName(name: "nextid"): NodeListOf; - getElementsByTagName(name: "nobr"): NodeListOf; - getElementsByTagName(name: "noframes"): NodeListOf; - getElementsByTagName(name: "noscript"): NodeListOf; - getElementsByTagName(name: "object"): NodeListOf; - getElementsByTagName(name: "ol"): NodeListOf; - getElementsByTagName(name: "optgroup"): NodeListOf; - getElementsByTagName(name: "option"): NodeListOf; - getElementsByTagName(name: "p"): NodeListOf; - getElementsByTagName(name: "param"): NodeListOf; - getElementsByTagName(name: "plaintext"): NodeListOf; - getElementsByTagName(name: "pre"): NodeListOf; - getElementsByTagName(name: "progress"): NodeListOf; - getElementsByTagName(name: "q"): NodeListOf; - getElementsByTagName(name: "rt"): NodeListOf; - getElementsByTagName(name: "ruby"): NodeListOf; - getElementsByTagName(name: "s"): NodeListOf; - getElementsByTagName(name: "samp"): NodeListOf; - getElementsByTagName(name: "script"): NodeListOf; - getElementsByTagName(name: "section"): NodeListOf; - getElementsByTagName(name: "select"): NodeListOf; - getElementsByTagName(name: "small"): NodeListOf; - getElementsByTagName(name: "SOURCE"): NodeListOf; - getElementsByTagName(name: "span"): NodeListOf; - getElementsByTagName(name: "strike"): NodeListOf; - getElementsByTagName(name: "strong"): NodeListOf; - getElementsByTagName(name: "style"): NodeListOf; - getElementsByTagName(name: "sub"): NodeListOf; - getElementsByTagName(name: "sup"): NodeListOf; - getElementsByTagName(name: "table"): NodeListOf; - getElementsByTagName(name: "tbody"): NodeListOf; - getElementsByTagName(name: "td"): NodeListOf; - getElementsByTagName(name: "textarea"): NodeListOf; - getElementsByTagName(name: "tfoot"): NodeListOf; - getElementsByTagName(name: "th"): NodeListOf; - getElementsByTagName(name: "thead"): NodeListOf; - getElementsByTagName(name: "title"): NodeListOf; - getElementsByTagName(name: "tr"): NodeListOf; - getElementsByTagName(name: "track"): NodeListOf; - getElementsByTagName(name: "tt"): NodeListOf; - getElementsByTagName(name: "u"): NodeListOf; - getElementsByTagName(name: "ul"): NodeListOf; - getElementsByTagName(name: "var"): NodeListOf; - getElementsByTagName(name: "video"): NodeListOf; - getElementsByTagName(name: "wbr"): NodeListOf; - getElementsByTagName(name: "x-ms-webview"): NodeListOf; - getElementsByTagName(name: "xmp"): NodeListOf; - getElementsByTagName(name: string): NodeList; - /** - * Creates a new document. - */ - createDocumentFragment(): DocumentFragment; - /** - * Creates a style sheet for the document. - * @param href Specifies how to add the style sheet to the document. If a file name is specified for the URL, the style information is added as a link object. If the URL contains style information, it is added to the style object. - * @param index Specifies the index that indicates where the new style sheet is inserted in the styleSheets collection. The default is to insert the new style sheet at the end of the collection. - */ - createStyleSheet(href?: string, index?: number): CSSStyleSheet; - /** - * Gets a collection of objects based on the value of the NAME or ID attribute. - * @param elementName Gets a collection of objects based on the value of the NAME or ID attribute. - */ - getElementsByName(elementName: string): NodeList; - /** - * Returns a Boolean value that indicates the current state of the command. - * @param commandId String that specifies a command identifier. - */ - queryCommandState(commandId: string): boolean; - /** - * Gets a value indicating whether the object currently has focus. - */ - hasFocus(): boolean; - /** - * Displays help information for the given command identifier. - * @param commandId Displays help information for the given command identifier. - */ - execCommandShowHelp(commandId: string): boolean; - /** - * Creates an attribute object with a specified name. - * @param name String that sets the attribute object's name. - */ - createAttribute(name: string): Attr; - /** - * Creates a text string from the specified value. - * @param data String that specifies the nodeValue property of the text node. - */ - createTextNode(data: string): Text; - /** - * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document. - * @param root The root element or node to start traversing on. - * @param whatToShow The type of nodes or elements to appear in the node list - * @param filter A custom NodeFilter function to use. For more information, see filter. Use null for no filter. - * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded. - */ - createNodeIterator(root: Node, whatToShow: number, filter: NodeFilter, entityReferenceExpansion: boolean): NodeIterator; - /** - * Generates an event object to pass event context information when you use the fireEvent method. - * @param eventObj An object that specifies an existing event object on which to base the new object. - */ - createEventObject(eventObj?: any): MSEventObj; - /** - * Returns an object representing the current selection of the document that is loaded into the object displaying a webpage. - */ - getSelection(): Selection; - msElementsFromPoint(x: number, y: number): NodeList; - msElementsFromRect(left: number, top: number, width: number, height: number): NodeList; - clear(): void; - msExitFullscreen(): void; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "msthumbnailclick", listener: (ev: MSSiteModeEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "stop", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mssitemodejumplistitemremoved", listener: (ev: MSSiteModeEvent) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "selectionchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "storagecommit", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msfullscreenerror", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msfullscreenchange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var Document: { - prototype: Document; - new(): Document; -} - -interface Console { - info(message?: any, ...optionalParams: any[]): void; - warn(message?: any, ...optionalParams: any[]): void; - error(message?: any, ...optionalParams: any[]): void; - log(message?: any, ...optionalParams: any[]): void; - profile(reportName?: string): void; - assert(test?: boolean, message?: string, ...optionalParams: any[]): void; - msIsIndependentlyComposed(element: Element): boolean; - clear(): void; - dir(value?: any, ...optionalParams: any[]): void; - profileEnd(): void; - count(countTitle?: string): void; - groupEnd(): void; - time(timerName?: string): void; - timeEnd(timerName?: string): void; - trace(): void; - group(groupTitle?: string): void; - dirxml(value: any): void; - debug(message?: string, ...optionalParams: any[]): void; - groupCollapsed(groupTitle?: string): void; - select(element: Element): void; -} -declare var Console: { - prototype: Console; - new(): Console; -} - -interface MSEventObj extends Event { - nextPage: string; - keyCode: number; - toElement: Element; - returnValue: any; - dataFld: string; - y: number; - dataTransfer: DataTransfer; - propertyName: string; - url: string; - offsetX: number; - recordset: any; - screenX: number; - buttonID: number; - wheelDelta: number; - reason: number; - origin: string; - data: string; - srcFilter: any; - boundElements: HTMLCollection; - cancelBubble: boolean; - altLeft: boolean; - behaviorCookie: number; - bookmarks: BookmarkCollection; - type: string; - repeat: boolean; - srcElement: Element; - source: Window; - fromElement: Element; - offsetY: number; - x: number; - behaviorPart: number; - qualifier: string; - altKey: boolean; - ctrlKey: boolean; - clientY: number; - shiftKey: boolean; - shiftLeft: boolean; - contentOverflow: boolean; - screenY: number; - ctrlLeft: boolean; - button: number; - srcUrn: string; - clientX: number; - actionURL: string; - getAttribute(strAttributeName: string, lFlags?: number): any; - setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; - removeAttribute(strAttributeName: string, lFlags?: number): boolean; -} -declare var MSEventObj: { - prototype: MSEventObj; - new(): MSEventObj; -} - -interface HTMLCanvasElement extends HTMLElement { - /** - * Gets or sets the width of a canvas element on a document. - */ - width: number; - /** - * Gets or sets the height of a canvas element on a document. - */ - height: number; - /** - * Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas. - * @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext("2d"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext("experimental-webgl"); - */ - getContext(contextId: "2d"): CanvasRenderingContext2D; - /** - * Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas. - * @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext("2d"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext("experimental-webgl"); - */ - getContext(contextId: "experimental-webgl"): WebGLRenderingContext; - /** - * Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas. - * @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext("2d"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext("experimental-webgl"); - */ - getContext(contextId: string, ...args: any[]): any; - /** - * Returns the content of the current canvas as an image that you can use as a source for another canvas or an HTML element. - * @param type The standard MIME type for the image format to return. If you do not specify this parameter, the default value is a PNG format image. - */ - toDataURL(type?: string, ...args: any[]): string; - /** - * Returns a blob object encoded as a Portable Network Graphics (PNG) format from a canvas image or drawing. - */ - msToBlob(): Blob; -} -declare var HTMLCanvasElement: { - prototype: HTMLCanvasElement; - new(): HTMLCanvasElement; -} - -interface Window extends EventTarget, MSEventAttachmentTarget, WindowLocalStorage, MSWindowExtensions, WindowSessionStorage, WindowTimers, WindowBase64, IDBEnvironment, WindowConsole, GlobalEventHandlers { - ondragend: (ev: DragEvent) => any; - onkeydown: (ev: KeyboardEvent) => any; - ondragover: (ev: DragEvent) => any; - onkeyup: (ev: KeyboardEvent) => any; - onreset: (ev: Event) => any; - onmouseup: (ev: MouseEvent) => any; - ondragstart: (ev: DragEvent) => any; - ondrag: (ev: DragEvent) => any; - screenX: number; - onmouseover: (ev: MouseEvent) => any; - ondragleave: (ev: DragEvent) => any; - history: History; - pageXOffset: number; - name: string; - onafterprint: (ev: Event) => any; - onpause: (ev: Event) => any; - onbeforeprint: (ev: Event) => any; - top: Window; - onmousedown: (ev: MouseEvent) => any; - onseeked: (ev: Event) => any; - opener: Window; - onclick: (ev: MouseEvent) => any; - innerHeight: number; - onwaiting: (ev: Event) => any; - ononline: (ev: Event) => any; - ondurationchange: (ev: Event) => any; - frames: Window; - onblur: (ev: FocusEvent) => any; - onemptied: (ev: Event) => any; - onseeking: (ev: Event) => any; - oncanplay: (ev: Event) => any; - outerWidth: number; - onstalled: (ev: Event) => any; - onmousemove: (ev: MouseEvent) => any; - innerWidth: number; - onoffline: (ev: Event) => any; - length: number; - screen: Screen; - onbeforeunload: (ev: BeforeUnloadEvent) => any; - onratechange: (ev: Event) => any; - onstorage: (ev: StorageEvent) => any; - onloadstart: (ev: Event) => any; - ondragenter: (ev: DragEvent) => any; - onsubmit: (ev: Event) => any; - self: Window; - document: Document; - onprogress: (ev: ProgressEvent) => any; - ondblclick: (ev: MouseEvent) => any; - pageYOffset: number; - oncontextmenu: (ev: MouseEvent) => any; - onchange: (ev: Event) => any; - onloadedmetadata: (ev: Event) => any; - onplay: (ev: Event) => any; - onerror: ErrorEventHandler; - onplaying: (ev: Event) => any; - parent: Window; - location: Location; - oncanplaythrough: (ev: Event) => any; - onabort: (ev: UIEvent) => any; - onreadystatechange: (ev: Event) => any; - outerHeight: number; - onkeypress: (ev: KeyboardEvent) => any; - frameElement: Element; - onloadeddata: (ev: Event) => any; - onsuspend: (ev: Event) => any; - window: Window; - onfocus: (ev: FocusEvent) => any; - onmessage: (ev: MessageEvent) => any; - ontimeupdate: (ev: Event) => any; - onresize: (ev: UIEvent) => any; - onselect: (ev: UIEvent) => any; - navigator: Navigator; - styleMedia: StyleMedia; - ondrop: (ev: DragEvent) => any; - onmouseout: (ev: MouseEvent) => any; - onended: (ev: Event) => any; - onhashchange: (ev: Event) => any; - onunload: (ev: Event) => any; - onscroll: (ev: UIEvent) => any; - screenY: number; - onmousewheel: (ev: MouseWheelEvent) => any; - onload: (ev: Event) => any; - onvolumechange: (ev: Event) => any; - oninput: (ev: Event) => any; - performance: Performance; - onmspointerdown: (ev: any) => any; - animationStartTime: number; - onmsgesturedoubletap: (ev: any) => any; - onmspointerhover: (ev: any) => any; - onmsgesturehold: (ev: any) => any; - onmspointermove: (ev: any) => any; - onmsgesturechange: (ev: any) => any; - onmsgesturestart: (ev: any) => any; - onmspointercancel: (ev: any) => any; - onmsgestureend: (ev: any) => any; - onmsgesturetap: (ev: any) => any; - onmspointerout: (ev: any) => any; - msAnimationStartTime: number; - applicationCache: ApplicationCache; - onmsinertiastart: (ev: any) => any; - onmspointerover: (ev: any) => any; - onpopstate: (ev: PopStateEvent) => any; - onmspointerup: (ev: any) => any; - onpageshow: (ev: PageTransitionEvent) => any; - ondevicemotion: (ev: DeviceMotionEvent) => any; - devicePixelRatio: number; - msCrypto: Crypto; - ondeviceorientation: (ev: DeviceOrientationEvent) => any; - doNotTrack: string; - onmspointerenter: (ev: any) => any; - onpagehide: (ev: PageTransitionEvent) => any; - onmspointerleave: (ev: any) => any; - alert(message?: any): void; - scroll(x?: number, y?: number): void; - focus(): void; - scrollTo(x?: number, y?: number): void; - print(): void; - prompt(message?: string, _default?: string): string; - toString(): string; - open(url?: string, target?: string, features?: string, replace?: boolean): Window; - scrollBy(x?: number, y?: number): void; - confirm(message?: string): boolean; - close(): void; - postMessage(message: any, targetOrigin: string, ports?: any): void; - showModalDialog(url?: string, argument?: any, options?: any): any; - blur(): void; - getSelection(): Selection; - getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; - msCancelRequestAnimationFrame(handle: number): void; - matchMedia(mediaQuery: string): MediaQueryList; - cancelAnimationFrame(handle: number): void; - msIsStaticHTML(html: string): boolean; - msMatchMedia(mediaQuery: string): MediaQueryList; - requestAnimationFrame(callback: FrameRequestCallback): number; - msRequestAnimationFrame(callback: FrameRequestCallback): number; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "hashchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: "devicemotion", listener: (ev: DeviceMotionEvent) => any, useCapture?: boolean): void; - addEventListener(type: "deviceorientation", listener: (ev: DeviceOrientationEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var Window: { - prototype: Window; - new(): Window; -} - -interface HTMLCollection extends MSHTMLCollectionExtensions { - /** - * Sets or retrieves the number of objects in a collection. - */ - length: number; - /** - * Retrieves an object from various collections. - */ - item(nameOrIndex?: any, optionalIndex?: any): Element; - /** - * Retrieves a select object or an object from an options collection. - */ - namedItem(name: string): Element; - // [name: string]: Element; - [index: number]: Element; -} -declare var HTMLCollection: { - prototype: HTMLCollection; - new(): HTMLCollection; -} - -interface BlobPropertyBag { - type?: string; - endings?: string; -} - -interface Blob { - type: string; - size: number; - msDetachStream(): any; - slice(start?: number, end?: number, contentType?: string): Blob; - msClose(): void; -} -declare var Blob: { - prototype: Blob; - new (blobParts?: any[], options?: BlobPropertyBag): Blob; -} - -interface NavigatorID { - appVersion: string; - appName: string; - userAgent: string; - platform: string; - product: string; - vendor: string; -} - -interface HTMLTableElement extends HTMLElement, MSDataBindingTableExtensions, MSDataBindingExtensions, DOML2DeprecatedBackgroundStyle, DOML2DeprecatedBackgroundColorStyle { - /** - * Sets or retrieves the width of the object. - */ - width: string; - /** - * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. - */ - borderColorLight: any; - /** - * Sets or retrieves the amount of space between cells in a table. - */ - cellSpacing: string; - /** - * Retrieves the tFoot object of the table. - */ - tFoot: HTMLTableSectionElement; - /** - * Sets or retrieves the way the border frame around the table is displayed. - */ - frame: string; - /** - * Sets or retrieves the border color of the object. - */ - borderColor: any; - /** - * Sets or retrieves the number of horizontal rows contained in the object. - */ - rows: HTMLCollection; - /** - * Sets or retrieves which dividing lines (inner borders) are displayed. - */ - rules: string; - /** - * Sets or retrieves the number of columns in the table. - */ - cols: number; - /** - * Sets or retrieves a description and/or structure of the object. - */ - summary: string; - /** - * Retrieves the caption object of a table. - */ - caption: HTMLTableCaptionElement; - /** - * Retrieves a collection of all tBody objects in the table. Objects in this collection are in source order. - */ - tBodies: HTMLCollection; - /** - * Retrieves the tHead object of the table. - */ - tHead: HTMLTableSectionElement; - /** - * Sets or retrieves a value that indicates the table alignment. - */ - align: string; - /** - * Retrieves a collection of all cells in the table row or in the entire table. - */ - cells: HTMLCollection; - /** - * Sets or retrieves the height of the object. - */ - height: any; - /** - * Sets or retrieves the amount of space between the border of the cell and the content of the cell. - */ - cellPadding: string; - /** - * Sets or retrieves the width of the border to draw around the object. - */ - border: string; - /** - * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. - */ - borderColorDark: any; - /** - * Removes the specified row (tr) from the element and from the rows collection. - * @param index Number that specifies the zero-based position in the rows collection of the row to remove. - */ - deleteRow(index?: number): void; - /** - * Creates an empty tBody element in the table. - */ - createTBody(): HTMLElement; - /** - * Deletes the caption element and its contents from the table. - */ - deleteCaption(): void; - /** - * Creates a new row (tr) in the table, and adds the row to the rows collection. - * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection. - */ - insertRow(index?: number): HTMLElement; - /** - * Deletes the tFoot element and its contents from the table. - */ - deleteTFoot(): void; - /** - * Returns the tHead element object if successful, or null otherwise. - */ - createTHead(): HTMLElement; - /** - * Deletes the tHead element and its contents from the table. - */ - deleteTHead(): void; - /** - * Creates an empty caption element in the table. - */ - createCaption(): HTMLElement; - /** - * Moves a table row to a new position. - * @param indexFrom Number that specifies the index in the rows collection of the table row that is moved. - * @param indexTo Number that specifies where the row is moved within the rows collection. - */ - moveRow(indexFrom?: number, indexTo?: number): any; - /** - * Creates an empty tFoot element in the table. - */ - createTFoot(): HTMLElement; -} -declare var HTMLTableElement: { - prototype: HTMLTableElement; - new(): HTMLTableElement; -} - -interface TreeWalker { - whatToShow: number; - filter: NodeFilter; - root: Node; - currentNode: Node; - expandEntityReferences: boolean; - previousSibling(): Node; - lastChild(): Node; - nextSibling(): Node; - nextNode(): Node; - parentNode(): Node; - firstChild(): Node; - previousNode(): Node; -} -declare var TreeWalker: { - prototype: TreeWalker; - new(): TreeWalker; -} - -interface GetSVGDocument { - getSVGDocument(): Document; -} - -interface SVGPathSegCurvetoQuadraticRel extends SVGPathSeg { - y: number; - y1: number; - x: number; - x1: number; -} -declare var SVGPathSegCurvetoQuadraticRel: { - prototype: SVGPathSegCurvetoQuadraticRel; - new(): SVGPathSegCurvetoQuadraticRel; -} - -interface Performance { - navigation: PerformanceNavigation; - timing: PerformanceTiming; - getEntriesByType(entryType: string): any; - toJSON(): any; - getMeasures(measureName?: string): any; - clearMarks(markName?: string): void; - getMarks(markName?: string): any; - clearResourceTimings(): void; - mark(markName: string): void; - measure(measureName: string, startMarkName?: string, endMarkName?: string): void; - getEntriesByName(name: string, entryType?: string): any; - getEntries(): any; - clearMeasures(measureName?: string): void; - setResourceTimingBufferSize(maxSize: number): void; - now(): number; -} -declare var Performance: { - prototype: Performance; - new(): Performance; -} - -interface MSDataBindingTableExtensions { - dataPageSize: number; - nextPage(): void; - firstPage(): void; - refresh(): void; - previousPage(): void; - lastPage(): void; -} - -interface CompositionEvent extends UIEvent { - data: string; - locale: string; - initCompositionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, locale: string): void; -} -declare var CompositionEvent: { - prototype: CompositionEvent; - new(): CompositionEvent; -} - -interface WindowTimers extends WindowTimersExtension { - clearTimeout(handle: number): void; - setTimeout(handler: any, timeout?: any, ...args: any[]): number; - clearInterval(handle: number): void; - setInterval(handler: any, timeout?: any, ...args: any[]): number; -} - -interface SVGMarkerElement extends SVGElement, SVGStylable, SVGLangSpace, SVGFitToViewBox, SVGExternalResourcesRequired { - orientType: SVGAnimatedEnumeration; - markerUnits: SVGAnimatedEnumeration; - markerWidth: SVGAnimatedLength; - markerHeight: SVGAnimatedLength; - orientAngle: SVGAnimatedAngle; - refY: SVGAnimatedLength; - refX: SVGAnimatedLength; - setOrientToAngle(angle: SVGAngle): void; - setOrientToAuto(): void; - SVG_MARKER_ORIENT_UNKNOWN: number; - SVG_MARKER_ORIENT_ANGLE: number; - SVG_MARKERUNITS_UNKNOWN: number; - SVG_MARKERUNITS_STROKEWIDTH: number; - SVG_MARKER_ORIENT_AUTO: number; - SVG_MARKERUNITS_USERSPACEONUSE: number; -} -declare var SVGMarkerElement: { - prototype: SVGMarkerElement; - new(): SVGMarkerElement; - SVG_MARKER_ORIENT_UNKNOWN: number; - SVG_MARKER_ORIENT_ANGLE: number; - SVG_MARKERUNITS_UNKNOWN: number; - SVG_MARKERUNITS_STROKEWIDTH: number; - SVG_MARKER_ORIENT_AUTO: number; - SVG_MARKERUNITS_USERSPACEONUSE: number; -} - -interface CSSStyleDeclaration { - backgroundAttachment: string; - visibility: string; - textAlignLast: string; - borderRightStyle: string; - counterIncrement: string; - orphans: string; - cssText: string; - borderStyle: string; - pointerEvents: string; - borderTopColor: string; - markerEnd: string; - textIndent: string; - listStyleImage: string; - cursor: string; - listStylePosition: string; - wordWrap: string; - borderTopStyle: string; - alignmentBaseline: string; - opacity: string; - direction: string; - strokeMiterlimit: string; - maxWidth: string; - color: string; - clip: string; - borderRightWidth: string; - verticalAlign: string; - overflow: string; - mask: string; - borderLeftStyle: string; - emptyCells: string; - stopOpacity: string; - paddingRight: string; - parentRule: CSSRule; - background: string; - boxSizing: string; - textJustify: string; - height: string; - paddingTop: string; - length: number; - right: string; - baselineShift: string; - borderLeft: string; - widows: string; - lineHeight: string; - left: string; - textUnderlinePosition: string; - glyphOrientationHorizontal: string; - display: string; - textAnchor: string; - cssFloat: string; - strokeDasharray: string; - rubyAlign: string; - fontSizeAdjust: string; - borderLeftColor: string; - backgroundImage: string; - listStyleType: string; - strokeWidth: string; - textOverflow: string; - fillRule: string; - borderBottomColor: string; - zIndex: string; - position: string; - listStyle: string; - msTransformOrigin: string; - dominantBaseline: string; - overflowY: string; - fill: string; - captionSide: string; - borderCollapse: string; - boxShadow: string; - quotes: string; - tableLayout: string; - unicodeBidi: string; - borderBottomWidth: string; - backgroundSize: string; - textDecoration: string; - strokeDashoffset: string; - fontSize: string; - border: string; - pageBreakBefore: string; - borderTopRightRadius: string; - msTransform: string; - borderBottomLeftRadius: string; - textTransform: string; - rubyPosition: string; - strokeLinejoin: string; - clipPath: string; - borderRightColor: string; - fontFamily: string; - clear: string; - content: string; - backgroundClip: string; - marginBottom: string; - counterReset: string; - outlineWidth: string; - marginRight: string; - paddingLeft: string; - borderBottom: string; - wordBreak: string; - marginTop: string; - top: string; - fontWeight: string; - borderRight: string; - width: string; - kerning: string; - pageBreakAfter: string; - borderBottomStyle: string; - fontStretch: string; - padding: string; - strokeOpacity: string; - markerStart: string; - bottom: string; - borderLeftWidth: string; - clipRule: string; - backgroundPosition: string; - backgroundColor: string; - pageBreakInside: string; - backgroundOrigin: string; - strokeLinecap: string; - borderTopWidth: string; - outlineStyle: string; - borderTop: string; - outlineColor: string; - paddingBottom: string; - marginLeft: string; - font: string; - outline: string; - wordSpacing: string; - maxHeight: string; - fillOpacity: string; - letterSpacing: string; - borderSpacing: string; - backgroundRepeat: string; - borderRadius: string; - borderWidth: string; - borderBottomRightRadius: string; - whiteSpace: string; - fontStyle: string; - minWidth: string; - stopColor: string; - borderTopLeftRadius: string; - borderColor: string; - marker: string; - glyphOrientationVertical: string; - markerMid: string; - fontVariant: string; - minHeight: string; - stroke: string; - rubyOverhang: string; - overflowX: string; - textAlign: string; - margin: string; - animationFillMode: string; - floodColor: string; - animationIterationCount: string; - textShadow: string; - backfaceVisibility: string; - msAnimationIterationCount: string; - animationDelay: string; - animationTimingFunction: string; - columnWidth: any; - msScrollSnapX: string; - columnRuleColor: any; - columnRuleWidth: any; - transitionDelay: string; - transition: string; - msFlowFrom: string; - msScrollSnapType: string; - msContentZoomSnapType: string; - msGridColumns: string; - msAnimationName: string; - msGridRowAlign: string; - msContentZoomChaining: string; - msGridColumn: any; - msHyphenateLimitZone: any; - msScrollRails: string; - msAnimationDelay: string; - enableBackground: string; - msWrapThrough: string; - columnRuleStyle: string; - msAnimation: string; - msFlexFlow: string; - msScrollSnapY: string; - msHyphenateLimitLines: any; - msTouchAction: string; - msScrollLimit: string; - animation: string; - transform: string; - filter: string; - colorInterpolationFilters: string; - transitionTimingFunction: string; - msBackfaceVisibility: string; - animationPlayState: string; - transformOrigin: string; - msScrollLimitYMin: any; - msFontFeatureSettings: string; - msContentZoomLimitMin: any; - columnGap: any; - transitionProperty: string; - msAnimationDuration: string; - msAnimationFillMode: string; - msFlexDirection: string; - msTransitionDuration: string; - fontFeatureSettings: string; - breakBefore: string; - msFlexWrap: string; - perspective: string; - msFlowInto: string; - msTransformStyle: string; - msScrollTranslation: string; - msTransitionProperty: string; - msUserSelect: string; - msOverflowStyle: string; - msScrollSnapPointsY: string; - animationDirection: string; - animationDuration: string; - msFlex: string; - msTransitionTimingFunction: string; - animationName: string; - columnRule: string; - msGridColumnSpan: any; - msFlexNegative: string; - columnFill: string; - msGridRow: any; - msFlexOrder: string; - msFlexItemAlign: string; - msFlexPositive: string; - msContentZoomLimitMax: any; - msScrollLimitYMax: any; - msGridColumnAlign: string; - perspectiveOrigin: string; - lightingColor: string; - columns: string; - msScrollChaining: string; - msHyphenateLimitChars: string; - msTouchSelect: string; - floodOpacity: string; - msAnimationDirection: string; - msAnimationPlayState: string; - columnSpan: string; - msContentZooming: string; - msPerspective: string; - msFlexPack: string; - msScrollSnapPointsX: string; - msContentZoomSnapPoints: string; - msGridRowSpan: any; - msContentZoomSnap: string; - msScrollLimitXMin: any; - breakInside: string; - msHighContrastAdjust: string; - msFlexLinePack: string; - msGridRows: string; - transitionDuration: string; - msHyphens: string; - breakAfter: string; - msTransition: string; - msPerspectiveOrigin: string; - msContentZoomLimit: string; - msScrollLimitXMax: any; - msFlexAlign: string; - msWrapMargin: any; - columnCount: any; - msAnimationTimingFunction: string; - msTransitionDelay: string; - transformStyle: string; - msWrapFlow: string; - msFlexPreferredSize: string; - alignItems: string; - borderImageSource: string; - flexBasis: string; - borderImageWidth: string; - borderImageRepeat: string; - order: string; - flex: string; - alignContent: string; - msImeAlign: string; - flexShrink: string; - flexGrow: string; - borderImageSlice: string; - flexWrap: string; - borderImageOutset: string; - flexDirection: string; - touchAction: string; - flexFlow: string; - borderImage: string; - justifyContent: string; - alignSelf: string; - msTextCombineHorizontal: string; - getPropertyPriority(propertyName: string): string; - getPropertyValue(propertyName: string): string; - removeProperty(propertyName: string): string; - item(index: number): string; - [index: number]: string; - setProperty(propertyName: string, value: string, priority?: string): void; -} -declare var CSSStyleDeclaration: { - prototype: CSSStyleDeclaration; - new(): CSSStyleDeclaration; -} - -interface SVGGElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { -} -declare var SVGGElement: { - prototype: SVGGElement; - new(): SVGGElement; -} - -interface MSStyleCSSProperties extends MSCSSProperties { - pixelWidth: number; - posHeight: number; - posLeft: number; - pixelTop: number; - pixelBottom: number; - textDecorationNone: boolean; - pixelLeft: number; - posTop: number; - posBottom: number; - textDecorationOverline: boolean; - posWidth: number; - textDecorationLineThrough: boolean; - pixelHeight: number; - textDecorationBlink: boolean; - posRight: number; - pixelRight: number; - textDecorationUnderline: boolean; -} -declare var MSStyleCSSProperties: { - prototype: MSStyleCSSProperties; - new(): MSStyleCSSProperties; -} - -interface Navigator extends NavigatorID, NavigatorOnLine, NavigatorContentUtils, MSNavigatorExtensions, NavigatorGeolocation, MSNavigatorDoNotTrack, NavigatorStorageUtils, MSFileSaver { - msMaxTouchPoints: number; - msPointerEnabled: boolean; - msManipulationViewsEnabled: boolean; - pointerEnabled: boolean; - maxTouchPoints: number; - msLaunchUri(uri: string, successCallback?: MSLaunchUriCallback, noHandlerCallback?: MSLaunchUriCallback): void; -} -declare var Navigator: { - prototype: Navigator; - new(): Navigator; -} - -interface SVGPathSegCurvetoCubicSmoothAbs extends SVGPathSeg { - y: number; - x2: number; - x: number; - y2: number; -} -declare var SVGPathSegCurvetoCubicSmoothAbs: { - prototype: SVGPathSegCurvetoCubicSmoothAbs; - new(): SVGPathSegCurvetoCubicSmoothAbs; -} - -interface SVGZoomEvent extends UIEvent { - zoomRectScreen: SVGRect; - previousScale: number; - newScale: number; - previousTranslate: SVGPoint; - newTranslate: SVGPoint; -} -declare var SVGZoomEvent: { - prototype: SVGZoomEvent; - new(): SVGZoomEvent; -} - -interface NodeSelector { - querySelectorAll(selectors: string): NodeList; - querySelector(selectors: string): Element; -} - -interface HTMLTableDataCellElement extends HTMLTableCellElement { -} -declare var HTMLTableDataCellElement: { - prototype: HTMLTableDataCellElement; - new(): HTMLTableDataCellElement; -} - -interface HTMLBaseElement extends HTMLElement { - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; - /** - * Gets or sets the baseline URL on which relative links are based. - */ - href: string; -} -declare var HTMLBaseElement: { - prototype: HTMLBaseElement; - new(): HTMLBaseElement; -} - -interface ClientRect { - left: number; - width: number; - right: number; - top: number; - bottom: number; - height: number; -} -declare var ClientRect: { - prototype: ClientRect; - new(): ClientRect; -} - -interface PositionErrorCallback { - (error: PositionError): void; -} - -interface DOMImplementation { - createDocumentType(qualifiedName: string, publicId: string, systemId: string): DocumentType; - createDocument(namespaceURI: string, qualifiedName: string, doctype: DocumentType): Document; - hasFeature(feature: string, version?: string): boolean; - createHTMLDocument(title: string): Document; -} -declare var DOMImplementation: { - prototype: DOMImplementation; - new(): DOMImplementation; -} - -interface SVGUnitTypes { - SVG_UNIT_TYPE_UNKNOWN: number; - SVG_UNIT_TYPE_OBJECTBOUNDINGBOX: number; - SVG_UNIT_TYPE_USERSPACEONUSE: number; -} -declare var SVGUnitTypes: SVGUnitTypes; - -interface Element extends Node, NodeSelector, ElementTraversal, GlobalEventHandlers { - scrollTop: number; - clientLeft: number; - scrollLeft: number; - tagName: string; - clientWidth: number; - scrollWidth: number; - clientHeight: number; - clientTop: number; - scrollHeight: number; - msRegionOverflow: string; - onmspointerdown: (ev: any) => any; - onmsgotpointercapture: (ev: any) => any; - onmsgesturedoubletap: (ev: any) => any; - onmspointerhover: (ev: any) => any; - onmsgesturehold: (ev: any) => any; - onmspointermove: (ev: any) => any; - onmsgesturechange: (ev: any) => any; - onmsgesturestart: (ev: any) => any; - onmspointercancel: (ev: any) => any; - onmsgestureend: (ev: any) => any; - onmsgesturetap: (ev: any) => any; - onmspointerout: (ev: any) => any; - onmsinertiastart: (ev: any) => any; - onmslostpointercapture: (ev: any) => any; - onmspointerover: (ev: any) => any; - msContentZoomFactor: number; - onmspointerup: (ev: any) => any; - onlostpointercapture: (ev: PointerEvent) => any; - onmspointerenter: (ev: any) => any; - ongotpointercapture: (ev: PointerEvent) => any; - onmspointerleave: (ev: any) => any; - getAttribute(name?: string): string; - getElementsByTagNameNS(namespaceURI: string, localName: string): NodeList; - hasAttributeNS(namespaceURI: string, localName: string): boolean; - getBoundingClientRect(): ClientRect; - getAttributeNS(namespaceURI: string, localName: string): string; - getAttributeNodeNS(namespaceURI: string, localName: string): Attr; - setAttributeNodeNS(newAttr: Attr): Attr; - msMatchesSelector(selectors: string): boolean; - hasAttribute(name: string): boolean; - removeAttribute(name?: string): void; - setAttributeNS(namespaceURI: string, qualifiedName: string, value: string): void; - getAttributeNode(name: string): Attr; - fireEvent(eventName: string, eventObj?: any): boolean; - getElementsByTagName(name: "a"): NodeListOf; - getElementsByTagName(name: "abbr"): NodeListOf; - getElementsByTagName(name: "acronym"): NodeListOf; - getElementsByTagName(name: "address"): NodeListOf; - getElementsByTagName(name: "applet"): NodeListOf; - getElementsByTagName(name: "area"): NodeListOf; - getElementsByTagName(name: "article"): NodeListOf; - getElementsByTagName(name: "aside"): NodeListOf; - getElementsByTagName(name: "audio"): NodeListOf; - getElementsByTagName(name: "b"): NodeListOf; - getElementsByTagName(name: "base"): NodeListOf; - getElementsByTagName(name: "basefont"): NodeListOf; - getElementsByTagName(name: "bdo"): NodeListOf; - getElementsByTagName(name: "bgsound"): NodeListOf; - getElementsByTagName(name: "big"): NodeListOf; - getElementsByTagName(name: "blockquote"): NodeListOf; - getElementsByTagName(name: "body"): NodeListOf; - getElementsByTagName(name: "br"): NodeListOf; - getElementsByTagName(name: "button"): NodeListOf; - getElementsByTagName(name: "canvas"): NodeListOf; - getElementsByTagName(name: "caption"): NodeListOf; - getElementsByTagName(name: "center"): NodeListOf; - getElementsByTagName(name: "cite"): NodeListOf; - getElementsByTagName(name: "code"): NodeListOf; - getElementsByTagName(name: "col"): NodeListOf; - getElementsByTagName(name: "colgroup"): NodeListOf; - getElementsByTagName(name: "datalist"): NodeListOf; - getElementsByTagName(name: "dd"): NodeListOf; - getElementsByTagName(name: "del"): NodeListOf; - getElementsByTagName(name: "dfn"): NodeListOf; - getElementsByTagName(name: "dir"): NodeListOf; - getElementsByTagName(name: "div"): NodeListOf; - getElementsByTagName(name: "dl"): NodeListOf; - getElementsByTagName(name: "dt"): NodeListOf; - getElementsByTagName(name: "em"): NodeListOf; - getElementsByTagName(name: "embed"): NodeListOf; - getElementsByTagName(name: "fieldset"): NodeListOf; - getElementsByTagName(name: "figcaption"): NodeListOf; - getElementsByTagName(name: "figure"): NodeListOf; - getElementsByTagName(name: "font"): NodeListOf; - getElementsByTagName(name: "footer"): NodeListOf; - getElementsByTagName(name: "form"): NodeListOf; - getElementsByTagName(name: "frame"): NodeListOf; - getElementsByTagName(name: "frameset"): NodeListOf; - getElementsByTagName(name: "h1"): NodeListOf; - getElementsByTagName(name: "h2"): NodeListOf; - getElementsByTagName(name: "h3"): NodeListOf; - getElementsByTagName(name: "h4"): NodeListOf; - getElementsByTagName(name: "h5"): NodeListOf; - getElementsByTagName(name: "h6"): NodeListOf; - getElementsByTagName(name: "head"): NodeListOf; - getElementsByTagName(name: "header"): NodeListOf; - getElementsByTagName(name: "hgroup"): NodeListOf; - getElementsByTagName(name: "hr"): NodeListOf; - getElementsByTagName(name: "html"): NodeListOf; - getElementsByTagName(name: "i"): NodeListOf; - getElementsByTagName(name: "iframe"): NodeListOf; - getElementsByTagName(name: "img"): NodeListOf; - getElementsByTagName(name: "input"): NodeListOf; - getElementsByTagName(name: "ins"): NodeListOf; - getElementsByTagName(name: "isindex"): NodeListOf; - getElementsByTagName(name: "kbd"): NodeListOf; - getElementsByTagName(name: "keygen"): NodeListOf; - getElementsByTagName(name: "label"): NodeListOf; - getElementsByTagName(name: "legend"): NodeListOf; - getElementsByTagName(name: "li"): NodeListOf; - getElementsByTagName(name: "link"): NodeListOf; - getElementsByTagName(name: "listing"): NodeListOf; - getElementsByTagName(name: "map"): NodeListOf; - getElementsByTagName(name: "mark"): NodeListOf; - getElementsByTagName(name: "marquee"): NodeListOf; - getElementsByTagName(name: "menu"): NodeListOf; - getElementsByTagName(name: "meta"): NodeListOf; - getElementsByTagName(name: "nav"): NodeListOf; - getElementsByTagName(name: "nextid"): NodeListOf; - getElementsByTagName(name: "nobr"): NodeListOf; - getElementsByTagName(name: "noframes"): NodeListOf; - getElementsByTagName(name: "noscript"): NodeListOf; - getElementsByTagName(name: "object"): NodeListOf; - getElementsByTagName(name: "ol"): NodeListOf; - getElementsByTagName(name: "optgroup"): NodeListOf; - getElementsByTagName(name: "option"): NodeListOf; - getElementsByTagName(name: "p"): NodeListOf; - getElementsByTagName(name: "param"): NodeListOf; - getElementsByTagName(name: "plaintext"): NodeListOf; - getElementsByTagName(name: "pre"): NodeListOf; - getElementsByTagName(name: "progress"): NodeListOf; - getElementsByTagName(name: "q"): NodeListOf; - getElementsByTagName(name: "rt"): NodeListOf; - getElementsByTagName(name: "ruby"): NodeListOf; - getElementsByTagName(name: "s"): NodeListOf; - getElementsByTagName(name: "samp"): NodeListOf; - getElementsByTagName(name: "script"): NodeListOf; - getElementsByTagName(name: "section"): NodeListOf; - getElementsByTagName(name: "select"): NodeListOf; - getElementsByTagName(name: "small"): NodeListOf; - getElementsByTagName(name: "SOURCE"): NodeListOf; - getElementsByTagName(name: "span"): NodeListOf; - getElementsByTagName(name: "strike"): NodeListOf; - getElementsByTagName(name: "strong"): NodeListOf; - getElementsByTagName(name: "style"): NodeListOf; - getElementsByTagName(name: "sub"): NodeListOf; - getElementsByTagName(name: "sup"): NodeListOf; - getElementsByTagName(name: "table"): NodeListOf; - getElementsByTagName(name: "tbody"): NodeListOf; - getElementsByTagName(name: "td"): NodeListOf; - getElementsByTagName(name: "textarea"): NodeListOf; - getElementsByTagName(name: "tfoot"): NodeListOf; - getElementsByTagName(name: "th"): NodeListOf; - getElementsByTagName(name: "thead"): NodeListOf; - getElementsByTagName(name: "title"): NodeListOf; - getElementsByTagName(name: "tr"): NodeListOf; - getElementsByTagName(name: "track"): NodeListOf; - getElementsByTagName(name: "tt"): NodeListOf; - getElementsByTagName(name: "u"): NodeListOf; - getElementsByTagName(name: "ul"): NodeListOf; - getElementsByTagName(name: "var"): NodeListOf; - getElementsByTagName(name: "video"): NodeListOf; - getElementsByTagName(name: "wbr"): NodeListOf; - getElementsByTagName(name: "x-ms-webview"): NodeListOf; - getElementsByTagName(name: "xmp"): NodeListOf; - getElementsByTagName(name: string): NodeList; - getClientRects(): ClientRectList; - setAttributeNode(newAttr: Attr): Attr; - removeAttributeNode(oldAttr: Attr): Attr; - setAttribute(name?: string, value?: string): void; - removeAttributeNS(namespaceURI: string, localName: string): void; - msGetRegionContent(): MSRangeCollection; - msReleasePointerCapture(pointerId: number): void; - msSetPointerCapture(pointerId: number): void; - msZoomTo(args: MsZoomToOptions): void; - setPointerCapture(pointerId: number): void; - msGetUntransformedBounds(): ClientRect; - releasePointerCapture(pointerId: number): void; - msRequestFullscreen(): void; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var Element: { - prototype: Element; - new(): Element; -} - -interface HTMLNextIdElement extends HTMLElement { - n: string; -} -declare var HTMLNextIdElement: { - prototype: HTMLNextIdElement; - new(): HTMLNextIdElement; -} - -interface SVGPathSegMovetoRel extends SVGPathSeg { - y: number; - x: number; -} -declare var SVGPathSegMovetoRel: { - prototype: SVGPathSegMovetoRel; - new(): SVGPathSegMovetoRel; -} - -interface SVGLineElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { - y1: SVGAnimatedLength; - x2: SVGAnimatedLength; - x1: SVGAnimatedLength; - y2: SVGAnimatedLength; -} -declare var SVGLineElement: { - prototype: SVGLineElement; - new(): SVGLineElement; -} - -interface HTMLParagraphElement extends HTMLElement, DOML2DeprecatedTextFlowControl { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; -} -declare var HTMLParagraphElement: { - prototype: HTMLParagraphElement; - new(): HTMLParagraphElement; -} - -interface HTMLAreasCollection extends HTMLCollection { - /** - * Removes an element from the collection. - */ - remove(index?: number): void; - /** - * Adds an element to the areas, controlRange, or options collection. - */ - add(element: HTMLElement, before?: any): void; -} -declare var HTMLAreasCollection: { - prototype: HTMLAreasCollection; - new(): HTMLAreasCollection; -} - -interface SVGDescElement extends SVGElement, SVGStylable, SVGLangSpace { -} -declare var SVGDescElement: { - prototype: SVGDescElement; - new(): SVGDescElement; -} - -interface Node extends EventTarget { - nodeType: number; - previousSibling: Node; - localName: string; - namespaceURI: string; - textContent: string; - parentNode: Node; - nextSibling: Node; - nodeValue: string; - lastChild: Node; - childNodes: NodeList; - nodeName: string; - ownerDocument: Document; - attributes: NamedNodeMap; - firstChild: Node; - prefix: string; - removeChild(oldChild: Node): Node; - appendChild(newChild: Node): Node; - isSupported(feature: string, version: string): boolean; - isEqualNode(arg: Node): boolean; - lookupPrefix(namespaceURI: string): string; - isDefaultNamespace(namespaceURI: string): boolean; - compareDocumentPosition(other: Node): number; - normalize(): void; - isSameNode(other: Node): boolean; - hasAttributes(): boolean; - lookupNamespaceURI(prefix: string): string; - cloneNode(deep?: boolean): Node; - hasChildNodes(): boolean; - replaceChild(newChild: Node, oldChild: Node): Node; - insertBefore(newChild: Node, refChild?: Node): Node; - ENTITY_REFERENCE_NODE: number; - ATTRIBUTE_NODE: number; - DOCUMENT_FRAGMENT_NODE: number; - TEXT_NODE: number; - ELEMENT_NODE: number; - COMMENT_NODE: number; - DOCUMENT_POSITION_DISCONNECTED: number; - DOCUMENT_POSITION_CONTAINED_BY: number; - DOCUMENT_POSITION_CONTAINS: number; - DOCUMENT_TYPE_NODE: number; - DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number; - DOCUMENT_NODE: number; - ENTITY_NODE: number; - PROCESSING_INSTRUCTION_NODE: number; - CDATA_SECTION_NODE: number; - NOTATION_NODE: number; - DOCUMENT_POSITION_FOLLOWING: number; - DOCUMENT_POSITION_PRECEDING: number; -} -declare var Node: { - prototype: Node; - new(): Node; - ENTITY_REFERENCE_NODE: number; - ATTRIBUTE_NODE: number; - DOCUMENT_FRAGMENT_NODE: number; - TEXT_NODE: number; - ELEMENT_NODE: number; - COMMENT_NODE: number; - DOCUMENT_POSITION_DISCONNECTED: number; - DOCUMENT_POSITION_CONTAINED_BY: number; - DOCUMENT_POSITION_CONTAINS: number; - DOCUMENT_TYPE_NODE: number; - DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number; - DOCUMENT_NODE: number; - ENTITY_NODE: number; - PROCESSING_INSTRUCTION_NODE: number; - CDATA_SECTION_NODE: number; - NOTATION_NODE: number; - DOCUMENT_POSITION_FOLLOWING: number; - DOCUMENT_POSITION_PRECEDING: number; -} - -interface SVGPathSegCurvetoQuadraticSmoothRel extends SVGPathSeg { - y: number; - x: number; -} -declare var SVGPathSegCurvetoQuadraticSmoothRel: { - prototype: SVGPathSegCurvetoQuadraticSmoothRel; - new(): SVGPathSegCurvetoQuadraticSmoothRel; -} - -interface DOML2DeprecatedListSpaceReduction { - compact: boolean; -} - -interface MSScriptHost { -} -declare var MSScriptHost: { - prototype: MSScriptHost; - new(): MSScriptHost; -} - -interface SVGClipPathElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { - clipPathUnits: SVGAnimatedEnumeration; -} -declare var SVGClipPathElement: { - prototype: SVGClipPathElement; - new(): SVGClipPathElement; -} - -interface MouseEvent extends UIEvent { - toElement: Element; - layerY: number; - fromElement: Element; - which: number; - pageX: number; - offsetY: number; - x: number; - y: number; - metaKey: boolean; - altKey: boolean; - ctrlKey: boolean; - offsetX: number; - screenX: number; - clientY: number; - shiftKey: boolean; - layerX: number; - screenY: number; - relatedTarget: EventTarget; - button: number; - pageY: number; - buttons: number; - clientX: number; - initMouseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget): void; - getModifierState(keyArg: string): boolean; -} -declare var MouseEvent: { - prototype: MouseEvent; - new(): MouseEvent; -} - -interface RangeException { - code: number; - message: string; - name: string; - toString(): string; - INVALID_NODE_TYPE_ERR: number; - BAD_BOUNDARYPOINTS_ERR: number; -} -declare var RangeException: { - prototype: RangeException; - new(): RangeException; - INVALID_NODE_TYPE_ERR: number; - BAD_BOUNDARYPOINTS_ERR: number; -} - -interface SVGTextPositioningElement extends SVGTextContentElement { - y: SVGAnimatedLengthList; - rotate: SVGAnimatedNumberList; - dy: SVGAnimatedLengthList; - x: SVGAnimatedLengthList; - dx: SVGAnimatedLengthList; -} -declare var SVGTextPositioningElement: { - prototype: SVGTextPositioningElement; - new(): SVGTextPositioningElement; -} - -interface HTMLAppletElement extends HTMLElement, DOML2DeprecatedMarginStyle, DOML2DeprecatedBorderStyle, DOML2DeprecatedAlignmentStyle, MSDataBindingExtensions, MSDataBindingRecordSetExtensions { - width: number; - /** - * Sets or retrieves the Internet media type for the code associated with the object. - */ - codeType: string; - object: string; - form: HTMLFormElement; - code: string; - /** - * Sets or retrieves a character string that can be used to implement your own archive functionality for the object. - */ - archive: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Sets or retrieves a message to be displayed while an object is loading. - */ - standby: string; - /** - * Sets or retrieves the class identifier for the object. - */ - classid: string; - /** - * Sets or retrieves the shape of the object. - */ - name: string; - /** - * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. - */ - useMap: string; - /** - * Sets or retrieves the URL that references the data of the object. - */ - data: string; - /** - * Sets or retrieves the height of the object. - */ - height: string; - /** - * Gets or sets the optional alternative HTML script to execute if the object fails to load. - */ - altHtml: string; - /** - * Address of a pointer to the document this page or frame contains. If there is no document, then null will be returned. - */ - contentDocument: Document; - /** - * Sets or retrieves the URL of the component. - */ - codeBase: string; - /** - * Sets or retrieves a character string that can be used to implement your own declare functionality for the object. - */ - declare: boolean; - /** - * Returns the content type of the object. - */ - type: string; - /** - * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element. - */ - BaseHref: string; -} -declare var HTMLAppletElement: { - prototype: HTMLAppletElement; - new(): HTMLAppletElement; -} - -interface TextMetrics { - width: number; -} -declare var TextMetrics: { - prototype: TextMetrics; - new(): TextMetrics; -} - -interface DocumentEvent { - createEvent(eventInterface: "AnimationEvent"): AnimationEvent; - createEvent(eventInterface: "CloseEvent"): CloseEvent; - createEvent(eventInterface: "CompositionEvent"): CompositionEvent; - createEvent(eventInterface: "CustomEvent"): CustomEvent; - createEvent(eventInterface: "DeviceMotionEvent"): DeviceMotionEvent; - createEvent(eventInterface: "DeviceOrientationEvent"): DeviceOrientationEvent; - createEvent(eventInterface: "DragEvent"): DragEvent; - createEvent(eventInterface: "ErrorEvent"): ErrorEvent; - createEvent(eventInterface: "Event"): Event; - createEvent(eventInterface: "Events"): Event; - createEvent(eventInterface: "FocusEvent"): FocusEvent; - createEvent(eventInterface: "HTMLEvents"): Event; - createEvent(eventInterface: "IDBVersionChangeEvent"): IDBVersionChangeEvent; - createEvent(eventInterface: "KeyboardEvent"): KeyboardEvent; - createEvent(eventInterface: "LongRunningScriptDetectedEvent"): LongRunningScriptDetectedEvent; - createEvent(eventInterface: "MessageEvent"): MessageEvent; - createEvent(eventInterface: "MouseEvent"): MouseEvent; - createEvent(eventInterface: "MouseEvents"): MouseEvent; - createEvent(eventInterface: "MouseWheelEvent"): MouseWheelEvent; - createEvent(eventInterface: "MSGestureEvent"): MSGestureEvent; - createEvent(eventInterface: "MSPointerEvent"): MSPointerEvent; - createEvent(eventInterface: "MutationEvent"): MutationEvent; - createEvent(eventInterface: "MutationEvents"): MutationEvent; - createEvent(eventInterface: "NavigationCompletedEvent"): NavigationCompletedEvent; - createEvent(eventInterface: "NavigationEvent"): NavigationEvent; - createEvent(eventInterface: "PageTransitionEvent"): PageTransitionEvent; - createEvent(eventInterface: "PointerEvent"): MSPointerEvent; - createEvent(eventInterface: "PopStateEvent"): PopStateEvent; - createEvent(eventInterface: "ProgressEvent"): ProgressEvent; - createEvent(eventInterface: "StorageEvent"): StorageEvent; - createEvent(eventInterface: "SVGZoomEvents"): SVGZoomEvent; - createEvent(eventInterface: "TextEvent"): TextEvent; - createEvent(eventInterface: "TrackEvent"): TrackEvent; - createEvent(eventInterface: "TransitionEvent"): TransitionEvent; - createEvent(eventInterface: "UIEvent"): UIEvent; - createEvent(eventInterface: "UIEvents"): UIEvent; - createEvent(eventInterface: "UnviewableContentIdentifiedEvent"): UnviewableContentIdentifiedEvent; - createEvent(eventInterface: "WebGLContextEvent"): WebGLContextEvent; - createEvent(eventInterface: "WheelEvent"): WheelEvent; - createEvent(eventInterface: string): Event; -} - -interface HTMLOListElement extends HTMLElement, DOML2DeprecatedListSpaceReduction, DOML2DeprecatedListNumberingAndBulletStyle { - /** - * The starting number. - */ - start: number; -} -declare var HTMLOListElement: { - prototype: HTMLOListElement; - new(): HTMLOListElement; -} - -interface SVGPathSegLinetoVerticalRel extends SVGPathSeg { - y: number; -} -declare var SVGPathSegLinetoVerticalRel: { - prototype: SVGPathSegLinetoVerticalRel; - new(): SVGPathSegLinetoVerticalRel; -} - -interface SVGAnimatedString { - animVal: string; - baseVal: string; -} -declare var SVGAnimatedString: { - prototype: SVGAnimatedString; - new(): SVGAnimatedString; -} - -interface CDATASection extends Text { -} -declare var CDATASection: { - prototype: CDATASection; - new(): CDATASection; -} - -interface StyleMedia { - type: string; - matchMedium(mediaquery: string): boolean; -} -declare var StyleMedia: { - prototype: StyleMedia; - new(): StyleMedia; -} - -interface HTMLSelectElement extends HTMLElement, MSHTMLCollectionExtensions, MSDataBindingExtensions { - options: HTMLSelectElement; - /** - * Sets or retrieves the value which is returned to the server when the form control is submitted. - */ - value: string; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Sets or retrieves the number of rows in the list box. - */ - size: number; - /** - * Sets or retrieves the number of objects in a collection. - */ - length: number; - /** - * Sets or retrieves the index of the selected option in a select object. - */ - selectedIndex: number; - /** - * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list. - */ - multiple: boolean; - /** - * Retrieves the type of select control based on the value of the MULTIPLE attribute. - */ - type: string; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - validationMessage: string; - /** - * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. - */ - autofocus: boolean; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - validity: ValidityState; - /** - * When present, marks an element that can't be submitted without a value. - */ - required: boolean; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - willValidate: boolean; - /** - * Removes an element from the collection. - * @param index Number that specifies the zero-based index of the element to remove from the collection. - */ - remove(index?: number): void; - /** - * Adds an element to the areas, controlRange, or options collection. - * @param element Variant of type Number that specifies the index position in the collection where the element is placed. If no value is given, the method places the element at the end of the collection. - * @param before Variant of type Object that specifies an element to insert before, or null to append the object to the collection. - */ - add(element: HTMLElement, before?: any): void; - /** - * Retrieves a select object or an object from an options collection. - * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is an integer, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made. - * @param index Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned. - */ - item(name?: any, index?: any): any; - /** - * Retrieves a select object or an object from an options collection. - * @param namedItem A String that specifies the name or id property of the object to retrieve. A collection is returned if more than one match is made. - */ - namedItem(name: string): any; - [name: string]: any; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; -} -declare var HTMLSelectElement: { - prototype: HTMLSelectElement; - new(): HTMLSelectElement; -} - -interface TextRange { - boundingLeft: number; - htmlText: string; - offsetLeft: number; - boundingWidth: number; - boundingHeight: number; - boundingTop: number; - text: string; - offsetTop: number; - moveToPoint(x: number, y: number): void; - queryCommandValue(cmdID: string): any; - getBookmark(): string; - move(unit: string, count?: number): number; - queryCommandIndeterm(cmdID: string): boolean; - scrollIntoView(fStart?: boolean): void; - findText(string: string, count?: number, flags?: number): boolean; - execCommand(cmdID: string, showUI?: boolean, value?: any): boolean; - getBoundingClientRect(): ClientRect; - moveToBookmark(bookmark: string): boolean; - isEqual(range: TextRange): boolean; - duplicate(): TextRange; - collapse(start?: boolean): void; - queryCommandText(cmdID: string): string; - select(): void; - pasteHTML(html: string): void; - inRange(range: TextRange): boolean; - moveEnd(unit: string, count?: number): number; - getClientRects(): ClientRectList; - moveStart(unit: string, count?: number): number; - parentElement(): Element; - queryCommandState(cmdID: string): boolean; - compareEndPoints(how: string, sourceRange: TextRange): number; - execCommandShowHelp(cmdID: string): boolean; - moveToElementText(element: Element): void; - expand(Unit: string): boolean; - queryCommandSupported(cmdID: string): boolean; - setEndPoint(how: string, SourceRange: TextRange): void; - queryCommandEnabled(cmdID: string): boolean; -} -declare var TextRange: { - prototype: TextRange; - new(): TextRange; -} - -interface SVGTests { - requiredFeatures: SVGStringList; - requiredExtensions: SVGStringList; - systemLanguage: SVGStringList; - hasExtension(extension: string): boolean; -} - -interface HTMLBlockElement extends HTMLElement, DOML2DeprecatedTextFlowControl { - /** - * Sets or retrieves the width of the object. - */ - width: number; - /** - * Sets or retrieves reference information about the object. - */ - cite: string; -} -declare var HTMLBlockElement: { - prototype: HTMLBlockElement; - new(): HTMLBlockElement; -} - -interface CSSStyleSheet extends StyleSheet { - owningElement: Element; - imports: StyleSheetList; - isAlternate: boolean; - rules: MSCSSRuleList; - isPrefAlternate: boolean; - readOnly: boolean; - cssText: string; - ownerRule: CSSRule; - href: string; - cssRules: CSSRuleList; - id: string; - pages: StyleSheetPageList; - addImport(bstrURL: string, lIndex?: number): number; - addPageRule(bstrSelector: string, bstrStyle: string, lIndex?: number): number; - insertRule(rule: string, index?: number): number; - removeRule(lIndex: number): void; - deleteRule(index?: number): void; - addRule(bstrSelector: string, bstrStyle?: string, lIndex?: number): number; - removeImport(lIndex: number): void; -} -declare var CSSStyleSheet: { - prototype: CSSStyleSheet; - new(): CSSStyleSheet; -} - -interface MSSelection { - type: string; - typeDetail: string; - createRange(): TextRange; - clear(): void; - createRangeCollection(): TextRangeCollection; - empty(): void; -} -declare var MSSelection: { - prototype: MSSelection; - new(): MSSelection; -} - -interface HTMLMetaElement extends HTMLElement { - /** - * Gets or sets information used to bind the value of a content attribute of a meta element to an HTTP response header. - */ - httpEquiv: string; - /** - * Sets or retrieves the value specified in the content attribute of the meta object. - */ - name: string; - /** - * Gets or sets meta-information to associate with httpEquiv or name. - */ - content: string; - /** - * Sets or retrieves the URL property that will be loaded after the specified time has elapsed. - */ - url: string; - /** - * Sets or retrieves a scheme to be used in interpreting the value of a property specified for the object. - */ - scheme: string; - /** - * Sets or retrieves the character set used to encode the object. - */ - charset: string; -} -declare var HTMLMetaElement: { - prototype: HTMLMetaElement; - new(): HTMLMetaElement; -} - -interface SVGPatternElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGLangSpace, SVGTests, SVGFitToViewBox, SVGExternalResourcesRequired, SVGURIReference { - patternUnits: SVGAnimatedEnumeration; - y: SVGAnimatedLength; - width: SVGAnimatedLength; - x: SVGAnimatedLength; - patternContentUnits: SVGAnimatedEnumeration; - patternTransform: SVGAnimatedTransformList; - height: SVGAnimatedLength; -} -declare var SVGPatternElement: { - prototype: SVGPatternElement; - new(): SVGPatternElement; -} - -interface SVGAnimatedAngle { - animVal: SVGAngle; - baseVal: SVGAngle; -} -declare var SVGAnimatedAngle: { - prototype: SVGAnimatedAngle; - new(): SVGAnimatedAngle; -} - -interface Selection { - isCollapsed: boolean; - anchorNode: Node; - focusNode: Node; - anchorOffset: number; - focusOffset: number; - rangeCount: number; - addRange(range: Range): void; - collapseToEnd(): void; - toString(): string; - selectAllChildren(parentNode: Node): void; - getRangeAt(index: number): Range; - collapse(parentNode: Node, offset: number): void; - removeAllRanges(): void; - collapseToStart(): void; - deleteFromDocument(): void; - removeRange(range: Range): void; -} -declare var Selection: { - prototype: Selection; - new(): Selection; -} - -interface SVGScriptElement extends SVGElement, SVGExternalResourcesRequired, SVGURIReference { - type: string; -} -declare var SVGScriptElement: { - prototype: SVGScriptElement; - new(): SVGScriptElement; -} - -interface HTMLDDElement extends HTMLElement { - /** - * Sets or retrieves whether the browser automatically performs wordwrap. - */ - noWrap: boolean; -} -declare var HTMLDDElement: { - prototype: HTMLDDElement; - new(): HTMLDDElement; -} - -interface MSDataBindingRecordSetReadonlyExtensions { - recordset: any; - namedRecordset(dataMember: string, hierarchy?: any): any; -} - -interface CSSStyleRule extends CSSRule { - selectorText: string; - style: MSStyleCSSProperties; - readOnly: boolean; -} -declare var CSSStyleRule: { - prototype: CSSStyleRule; - new(): CSSStyleRule; -} - -interface NodeIterator { - whatToShow: number; - filter: NodeFilter; - root: Node; - expandEntityReferences: boolean; - nextNode(): Node; - detach(): void; - previousNode(): Node; -} -declare var NodeIterator: { - prototype: NodeIterator; - new(): NodeIterator; -} - -interface SVGViewElement extends SVGElement, SVGZoomAndPan, SVGFitToViewBox, SVGExternalResourcesRequired { - viewTarget: SVGStringList; -} -declare var SVGViewElement: { - prototype: SVGViewElement; - new(): SVGViewElement; -} - -interface HTMLLinkElement extends HTMLElement, LinkStyle { - /** - * Sets or retrieves the relationship between the object and the destination of the link. - */ - rel: string; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; - /** - * Sets or retrieves a destination URL or an anchor point. - */ - href: string; - /** - * Sets or retrieves the media type. - */ - media: string; - /** - * Sets or retrieves the relationship between the object and the destination of the link. - */ - rev: string; - /** - * Sets or retrieves the MIME type of the object. - */ - type: string; - /** - * Sets or retrieves the character set used to encode the object. - */ - charset: string; - /** - * Sets or retrieves the language code of the object. - */ - hreflang: string; -} -declare var HTMLLinkElement: { - prototype: HTMLLinkElement; - new(): HTMLLinkElement; -} - -interface SVGLocatable { - farthestViewportElement: SVGElement; - nearestViewportElement: SVGElement; - getBBox(): SVGRect; - getTransformToElement(element: SVGElement): SVGMatrix; - getCTM(): SVGMatrix; - getScreenCTM(): SVGMatrix; -} - -interface HTMLFontElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty { - /** - * Sets or retrieves the current typeface family. - */ - face: string; -} -declare var HTMLFontElement: { - prototype: HTMLFontElement; - new(): HTMLFontElement; -} - -interface SVGTitleElement extends SVGElement, SVGStylable, SVGLangSpace { -} -declare var SVGTitleElement: { - prototype: SVGTitleElement; - new(): SVGTitleElement; -} - -interface ControlRangeCollection { - length: number; - queryCommandValue(cmdID: string): any; - remove(index: number): void; - add(item: Element): void; - queryCommandIndeterm(cmdID: string): boolean; - scrollIntoView(varargStart?: any): void; - item(index: number): Element; - [index: number]: Element; - execCommand(cmdID: string, showUI?: boolean, value?: any): boolean; - addElement(item: Element): void; - queryCommandState(cmdID: string): boolean; - queryCommandSupported(cmdID: string): boolean; - queryCommandEnabled(cmdID: string): boolean; - queryCommandText(cmdID: string): string; - select(): void; -} -declare var ControlRangeCollection: { - prototype: ControlRangeCollection; - new(): ControlRangeCollection; -} - -interface MSNamespaceInfo extends MSEventAttachmentTarget { - urn: string; - onreadystatechange: (ev: Event) => any; - name: string; - readyState: string; - doImport(implementationUrl: string): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var MSNamespaceInfo: { - prototype: MSNamespaceInfo; - new(): MSNamespaceInfo; -} - -interface WindowSessionStorage { - sessionStorage: Storage; -} - -interface SVGAnimatedTransformList { - animVal: SVGTransformList; - baseVal: SVGTransformList; -} -declare var SVGAnimatedTransformList: { - prototype: SVGAnimatedTransformList; - new(): SVGAnimatedTransformList; -} - -interface HTMLTableCaptionElement extends HTMLElement { - /** - * Sets or retrieves the alignment of the caption or legend. - */ - align: string; - /** - * Sets or retrieves whether the caption appears at the top or bottom of the table. - */ - vAlign: string; -} -declare var HTMLTableCaptionElement: { - prototype: HTMLTableCaptionElement; - new(): HTMLTableCaptionElement; -} - -interface HTMLOptionElement extends HTMLElement, MSDataBindingExtensions { - /** - * Sets or retrieves the ordinal position of an option in a list box. - */ - index: number; - /** - * Sets or retrieves the status of an option. - */ - defaultSelected: boolean; - /** - * Sets or retrieves the value which is returned to the server when the form control is submitted. - */ - value: string; - /** - * Sets or retrieves the text string specified by the option tag. - */ - text: string; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Sets or retrieves a value that you can use to implement your own label functionality for the object. - */ - label: string; - /** - * Sets or retrieves whether the option in the list box is the default item. - */ - selected: boolean; -} -declare var HTMLOptionElement: { - prototype: HTMLOptionElement; - new(): HTMLOptionElement; - create(): HTMLOptionElement; -} - -interface HTMLMapElement extends HTMLElement { - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Retrieves a collection of the area objects defined for the given map object. - */ - areas: HTMLAreasCollection; -} -declare var HTMLMapElement: { - prototype: HTMLMapElement; - new(): HTMLMapElement; -} - -interface HTMLMenuElement extends HTMLElement, DOML2DeprecatedListSpaceReduction { - type: string; -} -declare var HTMLMenuElement: { - prototype: HTMLMenuElement; - new(): HTMLMenuElement; -} - -interface MouseWheelEvent extends MouseEvent { - wheelDelta: number; - initMouseWheelEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: EventTarget, modifiersListArg: string, wheelDeltaArg: number): void; -} -declare var MouseWheelEvent: { - prototype: MouseWheelEvent; - new(): MouseWheelEvent; -} - -interface SVGFitToViewBox { - viewBox: SVGAnimatedRect; - preserveAspectRatio: SVGAnimatedPreserveAspectRatio; -} - -interface SVGPointList { - numberOfItems: number; - replaceItem(newItem: SVGPoint, index: number): SVGPoint; - getItem(index: number): SVGPoint; - clear(): void; - appendItem(newItem: SVGPoint): SVGPoint; - initialize(newItem: SVGPoint): SVGPoint; - removeItem(index: number): SVGPoint; - insertItemBefore(newItem: SVGPoint, index: number): SVGPoint; -} -declare var SVGPointList: { - prototype: SVGPointList; - new(): SVGPointList; -} - -interface SVGAnimatedLengthList { - animVal: SVGLengthList; - baseVal: SVGLengthList; -} -declare var SVGAnimatedLengthList: { - prototype: SVGAnimatedLengthList; - new(): SVGAnimatedLengthList; -} - -interface SVGAnimatedPreserveAspectRatio { - animVal: SVGPreserveAspectRatio; - baseVal: SVGPreserveAspectRatio; -} -declare var SVGAnimatedPreserveAspectRatio: { - prototype: SVGAnimatedPreserveAspectRatio; - new(): SVGAnimatedPreserveAspectRatio; -} - -interface MSSiteModeEvent extends Event { - buttonID: number; - actionURL: string; -} -declare var MSSiteModeEvent: { - prototype: MSSiteModeEvent; - new(): MSSiteModeEvent; -} - -interface DOML2DeprecatedTextFlowControl { - clear: string; -} - -interface StyleSheetPageList { - length: number; - item(index: number): CSSPageRule; - [index: number]: CSSPageRule; -} -declare var StyleSheetPageList: { - prototype: StyleSheetPageList; - new(): StyleSheetPageList; -} - -interface MSCSSProperties extends CSSStyleDeclaration { - scrollbarShadowColor: string; - scrollbarHighlightColor: string; - layoutGridChar: string; - layoutGridType: string; - textAutospace: string; - textKashidaSpace: string; - writingMode: string; - scrollbarFaceColor: string; - backgroundPositionY: string; - lineBreak: string; - imeMode: string; - msBlockProgression: string; - layoutGridLine: string; - scrollbarBaseColor: string; - layoutGrid: string; - layoutFlow: string; - textKashida: string; - filter: string; - zoom: string; - scrollbarArrowColor: string; - behavior: string; - backgroundPositionX: string; - accelerator: string; - layoutGridMode: string; - textJustifyTrim: string; - scrollbar3dLightColor: string; - msInterpolationMode: string; - scrollbarTrackColor: string; - scrollbarDarkShadowColor: string; - styleFloat: string; - getAttribute(attributeName: string, flags?: number): any; - setAttribute(attributeName: string, AttributeValue: any, flags?: number): void; - removeAttribute(attributeName: string, flags?: number): boolean; -} -declare var MSCSSProperties: { - prototype: MSCSSProperties; - new(): MSCSSProperties; -} - -interface SVGExternalResourcesRequired { - externalResourcesRequired: SVGAnimatedBoolean; -} - -interface HTMLImageElement extends HTMLElement, MSImageResourceExtensions, MSDataBindingExtensions, MSResourceMetadata { - /** - * Sets or retrieves the width of the object. - */ - width: number; - /** - * Sets or retrieves the vertical margin for the object. - */ - vspace: number; - /** - * The original height of the image resource before sizing. - */ - naturalHeight: number; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * The address or URL of the a media resource that is to be considered. - */ - src: string; - /** - * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. - */ - useMap: string; - /** - * The original width of the image resource before sizing. - */ - naturalWidth: number; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Sets or retrieves the height of the object. - */ - height: number; - /** - * Specifies the properties of a border drawn around an object. - */ - border: string; - /** - * Sets or retrieves the width of the border to draw around the object. - */ - hspace: number; - /** - * Sets or retrieves a Uniform Resource Identifier (URI) to a long description of the object. - */ - longDesc: string; - /** - * Contains the hypertext reference (HREF) of the URL. - */ - href: string; - /** - * Sets or retrieves whether the image is a server-side image map. - */ - isMap: boolean; - /** - * Retrieves whether the object is fully loaded. - */ - complete: boolean; - /** - * Gets or sets the primary DLNA PlayTo device. - */ - msPlayToPrimary: boolean; - /** - * Gets or sets whether the DLNA PlayTo device is available. - */ - msPlayToDisabled: boolean; - /** - * Gets the source associated with the media element for use by the PlayToManager. - */ - msPlayToSource: any; - crossOrigin: string; - msPlayToPreferredSourceUri: string; -} -declare var HTMLImageElement: { - prototype: HTMLImageElement; - new(): HTMLImageElement; - create(): HTMLImageElement; -} - -interface HTMLAreaElement extends HTMLElement { - /** - * Sets or retrieves the protocol portion of a URL. - */ - protocol: string; - /** - * Sets or retrieves the substring of the href property that follows the question mark. - */ - search: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Sets or retrieves the coordinates of the object. - */ - coords: string; - /** - * Sets or retrieves the host name part of the location or URL. - */ - hostname: string; - /** - * Sets or retrieves the port number associated with a URL. - */ - port: string; - /** - * Sets or retrieves the file name or path specified by the object. - */ - pathname: string; - /** - * Sets or retrieves the hostname and port number of the location or URL. - */ - host: string; - /** - * Sets or retrieves the subsection of the href property that follows the number sign (#). - */ - hash: string; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; - /** - * Sets or retrieves a destination URL or an anchor point. - */ - href: string; - /** - * Sets or gets whether clicks in this region cause action. - */ - noHref: boolean; - /** - * Sets or retrieves the shape of the object. - */ - shape: string; - /** - * Returns a string representation of an object. - */ - toString(): string; -} -declare var HTMLAreaElement: { - prototype: HTMLAreaElement; - new(): HTMLAreaElement; -} - -interface EventTarget { - removeEventListener(type: string, listener: EventListener, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; - dispatchEvent(evt: Event): boolean; -} - -interface SVGAngle { - valueAsString: string; - valueInSpecifiedUnits: number; - value: number; - unitType: number; - newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void; - convertToSpecifiedUnits(unitType: number): void; - SVG_ANGLETYPE_RAD: number; - SVG_ANGLETYPE_UNKNOWN: number; - SVG_ANGLETYPE_UNSPECIFIED: number; - SVG_ANGLETYPE_DEG: number; - SVG_ANGLETYPE_GRAD: number; -} -declare var SVGAngle: { - prototype: SVGAngle; - new(): SVGAngle; - SVG_ANGLETYPE_RAD: number; - SVG_ANGLETYPE_UNKNOWN: number; - SVG_ANGLETYPE_UNSPECIFIED: number; - SVG_ANGLETYPE_DEG: number; - SVG_ANGLETYPE_GRAD: number; -} - -interface HTMLButtonElement extends HTMLElement, MSDataBindingExtensions { - /** - * Sets or retrieves the default or selected value of the control. - */ - value: string; - status: any; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Gets the classification and default behavior of the button. - */ - type: string; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - validationMessage: string; - /** - * Overrides the target attribute on a form element. - */ - formTarget: string; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - willValidate: boolean; - /** - * Overrides the action attribute (where the data on a form is sent) on the parent form element. - */ - formAction: string; - /** - * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. - */ - autofocus: boolean; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - validity: ValidityState; - /** - * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a "save draft"-type submit option. - */ - formNoValidate: string; - /** - * Used to override the encoding (formEnctype attribute) specified on the form element. - */ - formEnctype: string; - /** - * Overrides the submit method attribute previously specified on a form element. - */ - formMethod: string; - /** - * Creates a TextRange object for the element. - */ - createTextRange(): TextRange; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; -} -declare var HTMLButtonElement: { - prototype: HTMLButtonElement; - new(): HTMLButtonElement; -} - -interface HTMLSourceElement extends HTMLElement { - /** - * The address or URL of the a media resource that is to be considered. - */ - src: string; - /** - * Gets or sets the intended media type of the media source. - */ - media: string; - /** - * Gets or sets the MIME type of a media resource. - */ - type: string; - msKeySystem: string; -} -declare var HTMLSourceElement: { - prototype: HTMLSourceElement; - new(): HTMLSourceElement; -} - -interface CanvasGradient { - addColorStop(offset: number, color: string): void; -} -declare var CanvasGradient: { - prototype: CanvasGradient; - new(): CanvasGradient; -} - -interface KeyboardEvent extends UIEvent { - location: number; - keyCode: number; - shiftKey: boolean; - which: number; - locale: string; - key: string; - altKey: boolean; - metaKey: boolean; - char: string; - ctrlKey: boolean; - repeat: boolean; - charCode: number; - getModifierState(keyArg: string): boolean; - initKeyboardEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, keyArg: string, locationArg: number, modifiersListArg: string, repeat: boolean, locale: string): void; - DOM_KEY_LOCATION_RIGHT: number; - DOM_KEY_LOCATION_STANDARD: number; - DOM_KEY_LOCATION_LEFT: number; - DOM_KEY_LOCATION_NUMPAD: number; - DOM_KEY_LOCATION_JOYSTICK: number; - DOM_KEY_LOCATION_MOBILE: number; -} -declare var KeyboardEvent: { - prototype: KeyboardEvent; - new(): KeyboardEvent; - DOM_KEY_LOCATION_RIGHT: number; - DOM_KEY_LOCATION_STANDARD: number; - DOM_KEY_LOCATION_LEFT: number; - DOM_KEY_LOCATION_NUMPAD: number; - DOM_KEY_LOCATION_JOYSTICK: number; - DOM_KEY_LOCATION_MOBILE: number; -} - -interface MessageEvent extends Event { - source: Window; - origin: string; - data: any; - ports: any; - initMessageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, dataArg: any, originArg: string, lastEventIdArg: string, sourceArg: Window): void; -} -declare var MessageEvent: { - prototype: MessageEvent; - new(): MessageEvent; -} - -interface SVGElement extends Element { - onmouseover: (ev: MouseEvent) => any; - viewportElement: SVGElement; - onmousemove: (ev: MouseEvent) => any; - onmouseout: (ev: MouseEvent) => any; - ondblclick: (ev: MouseEvent) => any; - onfocusout: (ev: FocusEvent) => any; - onfocusin: (ev: FocusEvent) => any; - xmlbase: string; - onmousedown: (ev: MouseEvent) => any; - onload: (ev: Event) => any; - onmouseup: (ev: MouseEvent) => any; - onclick: (ev: MouseEvent) => any; - ownerSVGElement: SVGSVGElement; - id: string; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var SVGElement: { - prototype: SVGElement; - new(): SVGElement; -} - -interface HTMLScriptElement extends HTMLElement { - /** - * Sets or retrieves the status of the script. - */ - defer: boolean; - /** - * Retrieves or sets the text of the object as a string. - */ - text: string; - /** - * Retrieves the URL to an external file that contains the source code or data. - */ - src: string; - /** - * Sets or retrieves the object that is bound to the event script. - */ - htmlFor: string; - /** - * Sets or retrieves the character set used to encode the object. - */ - charset: string; - /** - * Sets or retrieves the MIME type for the associated scripting engine. - */ - type: string; - /** - * Sets or retrieves the event for which the script is written. - */ - event: string; - async: boolean; -} -declare var HTMLScriptElement: { - prototype: HTMLScriptElement; - new(): HTMLScriptElement; -} - -interface HTMLTableRowElement extends HTMLElement, HTMLTableAlignment, DOML2DeprecatedBackgroundColorStyle { - /** - * Retrieves the position of the object in the rows collection for the table. - */ - rowIndex: number; - /** - * Retrieves a collection of all cells in the table row. - */ - cells: HTMLCollection; - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. - */ - borderColorLight: any; - /** - * Retrieves the position of the object in the collection. - */ - sectionRowIndex: number; - /** - * Sets or retrieves the border color of the object. - */ - borderColor: any; - /** - * Sets or retrieves the height of the object. - */ - height: any; - /** - * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. - */ - borderColorDark: any; - /** - * Removes the specified cell from the table row, as well as from the cells collection. - * @param index Number that specifies the zero-based position of the cell to remove from the table row. If no value is provided, the last cell in the cells collection is deleted. - */ - deleteCell(index?: number): void; - /** - * Creates a new cell in the table row, and adds the cell to the cells collection. - * @param index Number that specifies where to insert the cell in the tr. The default value is -1, which appends the new cell to the end of the cells collection. - */ - insertCell(index?: number): HTMLElement; -} -declare var HTMLTableRowElement: { - prototype: HTMLTableRowElement; - new(): HTMLTableRowElement; -} - -interface CanvasRenderingContext2D { - miterLimit: number; - font: string; - globalCompositeOperation: string; - msFillRule: string; - lineCap: string; - msImageSmoothingEnabled: boolean; - lineDashOffset: number; - shadowColor: string; - lineJoin: string; - shadowOffsetX: number; - lineWidth: number; - canvas: HTMLCanvasElement; - strokeStyle: any; - globalAlpha: number; - shadowOffsetY: number; - fillStyle: any; - shadowBlur: number; - textAlign: string; - textBaseline: string; - restore(): void; - setTransform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void; - save(): void; - arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void; - measureText(text: string): TextMetrics; - isPointInPath(x: number, y: number, fillRule?: string): boolean; - quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void; - putImageData(imagedata: ImageData, dx: number, dy: number, dirtyX?: number, dirtyY?: number, dirtyWidth?: number, dirtyHeight?: number): void; - rotate(angle: number): void; - fillText(text: string, x: number, y: number, maxWidth?: number): void; - translate(x: number, y: number): void; - scale(x: number, y: number): void; - createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient; - lineTo(x: number, y: number): void; - getLineDash(): number[]; - fill(fillRule?: string): void; - createImageData(imageDataOrSw: any, sh?: number): ImageData; - createPattern(image: HTMLElement, repetition: string): CanvasPattern; - closePath(): void; - rect(x: number, y: number, w: number, h: number): void; - clip(fillRule?: string): void; - clearRect(x: number, y: number, w: number, h: number): void; - moveTo(x: number, y: number): void; - getImageData(sx: number, sy: number, sw: number, sh: number): ImageData; - fillRect(x: number, y: number, w: number, h: number): void; - bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void; - drawImage(image: HTMLElement, offsetX: number, offsetY: number, width?: number, height?: number, canvasOffsetX?: number, canvasOffsetY?: number, canvasImageWidth?: number, canvasImageHeight?: number): void; - transform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void; - stroke(): void; - strokeRect(x: number, y: number, w: number, h: number): void; - setLineDash(segments: number[]): void; - strokeText(text: string, x: number, y: number, maxWidth?: number): void; - beginPath(): void; - arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void; - createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient; -} -declare var CanvasRenderingContext2D: { - prototype: CanvasRenderingContext2D; - new(): CanvasRenderingContext2D; -} - -interface MSCSSRuleList { - length: number; - item(index?: number): CSSStyleRule; - [index: number]: CSSStyleRule; -} -declare var MSCSSRuleList: { - prototype: MSCSSRuleList; - new(): MSCSSRuleList; -} - -interface SVGPathSegLinetoHorizontalAbs extends SVGPathSeg { - x: number; -} -declare var SVGPathSegLinetoHorizontalAbs: { - prototype: SVGPathSegLinetoHorizontalAbs; - new(): SVGPathSegLinetoHorizontalAbs; -} - -interface SVGPathSegArcAbs extends SVGPathSeg { - y: number; - sweepFlag: boolean; - r2: number; - x: number; - angle: number; - r1: number; - largeArcFlag: boolean; -} -declare var SVGPathSegArcAbs: { - prototype: SVGPathSegArcAbs; - new(): SVGPathSegArcAbs; -} - -interface SVGTransformList { - numberOfItems: number; - getItem(index: number): SVGTransform; - consolidate(): SVGTransform; - clear(): void; - appendItem(newItem: SVGTransform): SVGTransform; - initialize(newItem: SVGTransform): SVGTransform; - removeItem(index: number): SVGTransform; - insertItemBefore(newItem: SVGTransform, index: number): SVGTransform; - replaceItem(newItem: SVGTransform, index: number): SVGTransform; - createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform; -} -declare var SVGTransformList: { - prototype: SVGTransformList; - new(): SVGTransformList; -} - -interface HTMLHtmlElement extends HTMLElement { - /** - * Sets or retrieves the DTD version that governs the current document. - */ - version: string; -} -declare var HTMLHtmlElement: { - prototype: HTMLHtmlElement; - new(): HTMLHtmlElement; -} - -interface SVGPathSegClosePath extends SVGPathSeg { -} -declare var SVGPathSegClosePath: { - prototype: SVGPathSegClosePath; - new(): SVGPathSegClosePath; -} - -interface HTMLFrameElement extends HTMLElement, GetSVGDocument, MSDataBindingExtensions { - /** - * Sets or retrieves the width of the object. - */ - width: any; - /** - * Sets or retrieves whether the frame can be scrolled. - */ - scrolling: string; - /** - * Sets or retrieves the top and bottom margin heights before displaying the text in a frame. - */ - marginHeight: string; - /** - * Sets or retrieves the left and right margin widths before displaying the text in a frame. - */ - marginWidth: string; - /** - * Sets or retrieves the border color of the object. - */ - borderColor: any; - /** - * Sets or retrieves the amount of additional space between the frames. - */ - frameSpacing: any; - /** - * Sets or retrieves whether to display a border for the frame. - */ - frameBorder: string; - /** - * Sets or retrieves whether the user can resize the frame. - */ - noResize: boolean; - /** - * Retrieves the object of the specified. - */ - contentWindow: Window; - /** - * Sets or retrieves a URL to be loaded by the object. - */ - src: string; - /** - * Sets or retrieves the frame name. - */ - name: string; - /** - * Sets or retrieves the height of the object. - */ - height: any; - /** - * Retrieves the document object of the page or frame. - */ - contentDocument: Document; - /** - * Specifies the properties of a border drawn around an object. - */ - border: string; - /** - * Sets or retrieves a URI to a long description of the object. - */ - longDesc: string; - /** - * Raised when the object has been completely received from the server. - */ - onload: (ev: Event) => any; - /** - * Sets the value indicating whether the source file of a frame or iframe has specific security restrictions applied. - */ - security: any; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var HTMLFrameElement: { - prototype: HTMLFrameElement; - new(): HTMLFrameElement; -} - -interface SVGAnimatedLength { - animVal: SVGLength; - baseVal: SVGLength; -} -declare var SVGAnimatedLength: { - prototype: SVGAnimatedLength; - new(): SVGAnimatedLength; -} - -interface SVGAnimatedPoints { - points: SVGPointList; - animatedPoints: SVGPointList; -} - -interface SVGDefsElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { -} -declare var SVGDefsElement: { - prototype: SVGDefsElement; - new(): SVGDefsElement; -} - -interface HTMLQuoteElement extends HTMLElement { - /** - * Sets or retrieves the date and time of a modification to the object. - */ - dateTime: string; - /** - * Sets or retrieves reference information about the object. - */ - cite: string; -} -declare var HTMLQuoteElement: { - prototype: HTMLQuoteElement; - new(): HTMLQuoteElement; -} - -interface CSSMediaRule extends CSSRule { - media: MediaList; - cssRules: CSSRuleList; - insertRule(rule: string, index?: number): number; - deleteRule(index?: number): void; -} -declare var CSSMediaRule: { - prototype: CSSMediaRule; - new(): CSSMediaRule; -} - -interface WindowModal { - dialogArguments: any; - returnValue: any; -} - -interface XMLHttpRequest extends EventTarget { - responseBody: any; - status: number; - readyState: number; - responseText: string; - responseXML: any; - ontimeout: (ev: Event) => any; - statusText: string; - onreadystatechange: (ev: Event) => any; - timeout: number; - onload: (ev: Event) => any; - response: any; - withCredentials: boolean; - onprogress: (ev: ProgressEvent) => any; - onabort: (ev: UIEvent) => any; - responseType: string; - onloadend: (ev: ProgressEvent) => any; - upload: XMLHttpRequestEventTarget; - onerror: (ev: ErrorEvent) => any; - onloadstart: (ev: Event) => any; - msCaching: string; - open(method: string, url: string, async?: boolean, user?: string, password?: string): void; - send(data?: any): void; - abort(): void; - getAllResponseHeaders(): string; - setRequestHeader(header: string, value: string): void; - getResponseHeader(header: string): string; - msCachingEnabled(): boolean; - overrideMimeType(mime: string): void; - LOADING: number; - DONE: number; - UNSENT: number; - OPENED: number; - HEADERS_RECEIVED: number; - addEventListener(type: "timeout", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var XMLHttpRequest: { - prototype: XMLHttpRequest; - new(): XMLHttpRequest; - LOADING: number; - DONE: number; - UNSENT: number; - OPENED: number; - HEADERS_RECEIVED: number; - create(): XMLHttpRequest; -} - -interface HTMLTableHeaderCellElement extends HTMLTableCellElement { - /** - * Sets or retrieves the group of cells in a table to which the object's information applies. - */ - scope: string; -} -declare var HTMLTableHeaderCellElement: { - prototype: HTMLTableHeaderCellElement; - new(): HTMLTableHeaderCellElement; -} - -interface HTMLDListElement extends HTMLElement, DOML2DeprecatedListSpaceReduction { -} -declare var HTMLDListElement: { - prototype: HTMLDListElement; - new(): HTMLDListElement; -} - -interface MSDataBindingExtensions { - dataSrc: string; - dataFormatAs: string; - dataFld: string; -} - -interface SVGPathSegLinetoHorizontalRel extends SVGPathSeg { - x: number; -} -declare var SVGPathSegLinetoHorizontalRel: { - prototype: SVGPathSegLinetoHorizontalRel; - new(): SVGPathSegLinetoHorizontalRel; -} - -interface SVGEllipseElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { - ry: SVGAnimatedLength; - cx: SVGAnimatedLength; - rx: SVGAnimatedLength; - cy: SVGAnimatedLength; -} -declare var SVGEllipseElement: { - prototype: SVGEllipseElement; - new(): SVGEllipseElement; -} - -interface SVGAElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired, SVGURIReference { - target: SVGAnimatedString; -} -declare var SVGAElement: { - prototype: SVGAElement; - new(): SVGAElement; -} - -interface SVGStylable { - className: SVGAnimatedString; - style: CSSStyleDeclaration; -} - -interface SVGTransformable extends SVGLocatable { - transform: SVGAnimatedTransformList; -} - -interface HTMLFrameSetElement extends HTMLElement { - ononline: (ev: Event) => any; - /** - * Sets or retrieves the border color of the object. - */ - borderColor: any; - /** - * Sets or retrieves the frame heights of the object. - */ - rows: string; - /** - * Sets or retrieves the frame widths of the object. - */ - cols: string; - /** - * Fires when the object loses the input focus. - */ - onblur: (ev: FocusEvent) => any; - /** - * Sets or retrieves the amount of additional space between the frames. - */ - frameSpacing: any; - /** - * Fires when the object receives focus. - */ - onfocus: (ev: FocusEvent) => any; - onmessage: (ev: MessageEvent) => any; - onerror: (ev: ErrorEvent) => any; - /** - * Sets or retrieves whether to display a border for the frame. - */ - frameBorder: string; - onresize: (ev: UIEvent) => any; - name: string; - onafterprint: (ev: Event) => any; - onbeforeprint: (ev: Event) => any; - onoffline: (ev: Event) => any; - border: string; - onunload: (ev: Event) => any; - onhashchange: (ev: Event) => any; - onload: (ev: Event) => any; - onbeforeunload: (ev: BeforeUnloadEvent) => any; - onstorage: (ev: StorageEvent) => any; - onpageshow: (ev: PageTransitionEvent) => any; - onpagehide: (ev: PageTransitionEvent) => any; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "hashchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; - addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var HTMLFrameSetElement: { - prototype: HTMLFrameSetElement; - new(): HTMLFrameSetElement; -} - -interface Screen extends EventTarget { - width: number; - deviceXDPI: number; - fontSmoothingEnabled: boolean; - bufferDepth: number; - logicalXDPI: number; - systemXDPI: number; - availHeight: number; - height: number; - logicalYDPI: number; - systemYDPI: number; - updateInterval: number; - colorDepth: number; - availWidth: number; - deviceYDPI: number; - pixelDepth: number; - msOrientation: string; - onmsorientationchange: (ev: any) => any; - msLockOrientation(orientation: string): boolean; - msLockOrientation(orientations: string[]): boolean; - msUnlockOrientation(): void; - addEventListener(type: "msorientationchange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var Screen: { - prototype: Screen; - new(): Screen; -} - -interface Coordinates { - altitudeAccuracy: number; - longitude: number; - latitude: number; - speed: number; - heading: number; - altitude: number; - accuracy: number; -} -declare var Coordinates: { - prototype: Coordinates; - new(): Coordinates; -} - -interface NavigatorGeolocation { - geolocation: Geolocation; -} - -interface NavigatorContentUtils { -} - -interface EventListener { - (evt: Event): void; -} - -interface SVGLangSpace { - xmllang: string; - xmlspace: string; -} - -interface DataTransfer { - effectAllowed: string; - dropEffect: string; - types: DOMStringList; - files: FileList; - clearData(format?: string): boolean; - setData(format: string, data: string): boolean; - getData(format: string): string; -} -declare var DataTransfer: { - prototype: DataTransfer; - new(): DataTransfer; -} - -interface FocusEvent extends UIEvent { - relatedTarget: EventTarget; - initFocusEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, relatedTargetArg: EventTarget): void; -} -declare var FocusEvent: { - prototype: FocusEvent; - new(): FocusEvent; -} - -interface Range { - startOffset: number; - collapsed: boolean; - endOffset: number; - startContainer: Node; - endContainer: Node; - commonAncestorContainer: Node; - setStart(refNode: Node, offset: number): void; - setEndBefore(refNode: Node): void; - setStartBefore(refNode: Node): void; - selectNode(refNode: Node): void; - detach(): void; - getBoundingClientRect(): ClientRect; - toString(): string; - compareBoundaryPoints(how: number, sourceRange: Range): number; - insertNode(newNode: Node): void; - collapse(toStart: boolean): void; - selectNodeContents(refNode: Node): void; - cloneContents(): DocumentFragment; - setEnd(refNode: Node, offset: number): void; - cloneRange(): Range; - getClientRects(): ClientRectList; - surroundContents(newParent: Node): void; - deleteContents(): void; - setStartAfter(refNode: Node): void; - extractContents(): DocumentFragment; - setEndAfter(refNode: Node): void; - createContextualFragment(fragment: string): DocumentFragment; - END_TO_END: number; - START_TO_START: number; - START_TO_END: number; - END_TO_START: number; -} -declare var Range: { - prototype: Range; - new(): Range; - END_TO_END: number; - START_TO_START: number; - START_TO_END: number; - END_TO_START: number; -} - -interface SVGPoint { - y: number; - x: number; - matrixTransform(matrix: SVGMatrix): SVGPoint; -} -declare var SVGPoint: { - prototype: SVGPoint; - new(): SVGPoint; -} - -interface MSPluginsCollection { - length: number; - refresh(reload?: boolean): void; -} -declare var MSPluginsCollection: { - prototype: MSPluginsCollection; - new(): MSPluginsCollection; -} - -interface SVGAnimatedNumberList { - animVal: SVGNumberList; - baseVal: SVGNumberList; -} -declare var SVGAnimatedNumberList: { - prototype: SVGAnimatedNumberList; - new(): SVGAnimatedNumberList; -} - -interface SVGSVGElement extends SVGElement, SVGStylable, SVGZoomAndPan, DocumentEvent, SVGLangSpace, SVGLocatable, SVGTests, SVGFitToViewBox, SVGExternalResourcesRequired { - width: SVGAnimatedLength; - x: SVGAnimatedLength; - contentStyleType: string; - onzoom: (ev: any) => any; - y: SVGAnimatedLength; - viewport: SVGRect; - onerror: (ev: ErrorEvent) => any; - pixelUnitToMillimeterY: number; - onresize: (ev: UIEvent) => any; - screenPixelToMillimeterY: number; - height: SVGAnimatedLength; - onabort: (ev: UIEvent) => any; - contentScriptType: string; - pixelUnitToMillimeterX: number; - currentTranslate: SVGPoint; - onunload: (ev: Event) => any; - currentScale: number; - onscroll: (ev: UIEvent) => any; - screenPixelToMillimeterX: number; - setCurrentTime(seconds: number): void; - createSVGLength(): SVGLength; - getIntersectionList(rect: SVGRect, referenceElement: SVGElement): NodeList; - unpauseAnimations(): void; - createSVGRect(): SVGRect; - checkIntersection(element: SVGElement, rect: SVGRect): boolean; - unsuspendRedrawAll(): void; - pauseAnimations(): void; - suspendRedraw(maxWaitMilliseconds: number): number; - deselectAll(): void; - createSVGAngle(): SVGAngle; - getEnclosureList(rect: SVGRect, referenceElement: SVGElement): NodeList; - createSVGTransform(): SVGTransform; - unsuspendRedraw(suspendHandleID: number): void; - forceRedraw(): void; - getCurrentTime(): number; - checkEnclosure(element: SVGElement, rect: SVGRect): boolean; - createSVGMatrix(): SVGMatrix; - createSVGPoint(): SVGPoint; - createSVGNumber(): SVGNumber; - createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform; - getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; - getElementById(elementId: string): Element; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "zoom", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var SVGSVGElement: { - prototype: SVGSVGElement; - new(): SVGSVGElement; -} - -interface HTMLLabelElement extends HTMLElement, MSDataBindingExtensions { - /** - * Sets or retrieves the object to which the given label object is assigned. - */ - htmlFor: string; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; -} -declare var HTMLLabelElement: { - prototype: HTMLLabelElement; - new(): HTMLLabelElement; -} - -interface MSResourceMetadata { - protocol: string; - fileSize: string; - fileUpdatedDate: string; - nameProp: string; - fileCreatedDate: string; - fileModifiedDate: string; - mimeType: string; -} - -interface HTMLLegendElement extends HTMLElement, MSDataBindingExtensions { - /** - * Retrieves a reference to the form that the object is embedded in. - */ - align: string; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; -} -declare var HTMLLegendElement: { - prototype: HTMLLegendElement; - new(): HTMLLegendElement; -} - -interface HTMLDirectoryElement extends HTMLElement, DOML2DeprecatedListSpaceReduction, DOML2DeprecatedListNumberingAndBulletStyle { -} -declare var HTMLDirectoryElement: { - prototype: HTMLDirectoryElement; - new(): HTMLDirectoryElement; -} - -interface SVGAnimatedInteger { - animVal: number; - baseVal: number; -} -declare var SVGAnimatedInteger: { - prototype: SVGAnimatedInteger; - new(): SVGAnimatedInteger; -} - -interface SVGTextElement extends SVGTextPositioningElement, SVGTransformable { -} -declare var SVGTextElement: { - prototype: SVGTextElement; - new(): SVGTextElement; -} - -interface SVGTSpanElement extends SVGTextPositioningElement { -} -declare var SVGTSpanElement: { - prototype: SVGTSpanElement; - new(): SVGTSpanElement; -} - -interface HTMLLIElement extends HTMLElement, DOML2DeprecatedListNumberingAndBulletStyle { - /** - * Sets or retrieves the value of a list item. - */ - value: number; -} -declare var HTMLLIElement: { - prototype: HTMLLIElement; - new(): HTMLLIElement; -} - -interface SVGPathSegLinetoVerticalAbs extends SVGPathSeg { - y: number; -} -declare var SVGPathSegLinetoVerticalAbs: { - prototype: SVGPathSegLinetoVerticalAbs; - new(): SVGPathSegLinetoVerticalAbs; -} - -interface MSStorageExtensions { - remainingSpace: number; -} - -interface SVGStyleElement extends SVGElement, SVGLangSpace { - media: string; - type: string; - title: string; -} -declare var SVGStyleElement: { - prototype: SVGStyleElement; - new(): SVGStyleElement; -} - -interface MSCurrentStyleCSSProperties extends MSCSSProperties { - blockDirection: string; - clipBottom: string; - clipLeft: string; - clipRight: string; - clipTop: string; - hasLayout: string; -} -declare var MSCurrentStyleCSSProperties: { - prototype: MSCurrentStyleCSSProperties; - new(): MSCurrentStyleCSSProperties; -} - -interface MSHTMLCollectionExtensions { - urns(urn: any): any; - tags(tagName: any): any; -} - -interface Storage extends MSStorageExtensions { - length: number; - getItem(key: string): any; - [key: string]: any; - setItem(key: string, data: string): void; - clear(): void; - removeItem(key: string): void; - key(index: number): string; - [index: number]: string; -} -declare var Storage: { - prototype: Storage; - new(): Storage; -} - -interface HTMLIFrameElement extends HTMLElement, GetSVGDocument, MSDataBindingExtensions { - /** - * Sets or retrieves the width of the object. - */ - width: string; - /** - * Sets or retrieves whether the frame can be scrolled. - */ - scrolling: string; - /** - * Sets or retrieves the top and bottom margin heights before displaying the text in a frame. - */ - marginHeight: string; - /** - * Sets or retrieves the left and right margin widths before displaying the text in a frame. - */ - marginWidth: string; - /** - * Sets or retrieves the amount of additional space between the frames. - */ - frameSpacing: any; - /** - * Sets or retrieves whether to display a border for the frame. - */ - frameBorder: string; - /** - * Sets or retrieves whether the user can resize the frame. - */ - noResize: boolean; - /** - * Sets or retrieves the vertical margin for the object. - */ - vspace: number; - /** - * Retrieves the object of the specified. - */ - contentWindow: Window; - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves a URL to be loaded by the object. - */ - src: string; - /** - * Sets or retrieves the frame name. - */ - name: string; - /** - * Sets or retrieves the height of the object. - */ - height: string; - /** - * Specifies the properties of a border drawn around an object. - */ - border: string; - /** - * Retrieves the document object of the page or frame. - */ - contentDocument: Document; - /** - * Sets or retrieves the horizontal margin for the object. - */ - hspace: number; - /** - * Sets or retrieves a URI to a long description of the object. - */ - longDesc: string; - /** - * Sets the value indicating whether the source file of a frame or iframe has specific security restrictions applied. - */ - security: any; - /** - * Raised when the object has been completely received from the server. - */ - onload: (ev: Event) => any; - sandbox: DOMSettableTokenList; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var HTMLIFrameElement: { - prototype: HTMLIFrameElement; - new(): HTMLIFrameElement; -} - -interface TextRangeCollection { - length: number; - item(index: number): TextRange; - [index: number]: TextRange; -} -declare var TextRangeCollection: { - prototype: TextRangeCollection; - new(): TextRangeCollection; -} - -interface HTMLBodyElement extends HTMLElement, DOML2DeprecatedBackgroundStyle, DOML2DeprecatedBackgroundColorStyle { - scroll: string; - ononline: (ev: Event) => any; - onblur: (ev: FocusEvent) => any; - noWrap: boolean; - onfocus: (ev: FocusEvent) => any; - onmessage: (ev: MessageEvent) => any; - text: any; - onerror: (ev: ErrorEvent) => any; - bgProperties: string; - onresize: (ev: UIEvent) => any; - link: any; - aLink: any; - bottomMargin: any; - topMargin: any; - onafterprint: (ev: Event) => any; - vLink: any; - onbeforeprint: (ev: Event) => any; - onoffline: (ev: Event) => any; - onunload: (ev: Event) => any; - onhashchange: (ev: Event) => any; - onload: (ev: Event) => any; - rightMargin: any; - onbeforeunload: (ev: BeforeUnloadEvent) => any; - leftMargin: any; - onstorage: (ev: StorageEvent) => any; - onpopstate: (ev: PopStateEvent) => any; - onpageshow: (ev: PageTransitionEvent) => any; - onpagehide: (ev: PageTransitionEvent) => any; - createTextRange(): TextRange; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "hashchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; - addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var HTMLBodyElement: { - prototype: HTMLBodyElement; - new(): HTMLBodyElement; -} - -interface DocumentType extends Node { - name: string; - notations: NamedNodeMap; - systemId: string; - internalSubset: string; - entities: NamedNodeMap; - publicId: string; -} -declare var DocumentType: { - prototype: DocumentType; - new(): DocumentType; -} - -interface SVGRadialGradientElement extends SVGGradientElement { - cx: SVGAnimatedLength; - r: SVGAnimatedLength; - cy: SVGAnimatedLength; - fx: SVGAnimatedLength; - fy: SVGAnimatedLength; -} -declare var SVGRadialGradientElement: { - prototype: SVGRadialGradientElement; - new(): SVGRadialGradientElement; -} - -interface MutationEvent extends Event { - newValue: string; - attrChange: number; - attrName: string; - prevValue: string; - relatedNode: Node; - initMutationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, relatedNodeArg: Node, prevValueArg: string, newValueArg: string, attrNameArg: string, attrChangeArg: number): void; - MODIFICATION: number; - REMOVAL: number; - ADDITION: number; -} -declare var MutationEvent: { - prototype: MutationEvent; - new(): MutationEvent; - MODIFICATION: number; - REMOVAL: number; - ADDITION: number; -} - -interface DragEvent extends MouseEvent { - dataTransfer: DataTransfer; - initDragEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, dataTransferArg: DataTransfer): void; - msConvertURL(file: File, targetType: string, targetURL?: string): void; -} -declare var DragEvent: { - prototype: DragEvent; - new(): DragEvent; -} - -interface HTMLTableSectionElement extends HTMLElement, HTMLTableAlignment, DOML2DeprecatedBackgroundColorStyle { - /** - * Sets or retrieves a value that indicates the table alignment. - */ - align: string; - /** - * Sets or retrieves the number of horizontal rows contained in the object. - */ - rows: HTMLCollection; - /** - * Removes the specified row (tr) from the element and from the rows collection. - * @param index Number that specifies the zero-based position in the rows collection of the row to remove. - */ - deleteRow(index?: number): void; - /** - * Moves a table row to a new position. - * @param indexFrom Number that specifies the index in the rows collection of the table row that is moved. - * @param indexTo Number that specifies where the row is moved within the rows collection. - */ - moveRow(indexFrom?: number, indexTo?: number): any; - /** - * Creates a new row (tr) in the table, and adds the row to the rows collection. - * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection. - */ - insertRow(index?: number): HTMLElement; -} -declare var HTMLTableSectionElement: { - prototype: HTMLTableSectionElement; - new(): HTMLTableSectionElement; -} - -interface DOML2DeprecatedListNumberingAndBulletStyle { - type: string; -} - -interface HTMLInputElement extends HTMLElement, MSDataBindingExtensions { - /** - * Sets or retrieves the width of the object. - */ - width: string; - status: boolean; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Gets or sets the starting position or offset of a text selection. - */ - selectionStart: number; - indeterminate: boolean; - readOnly: boolean; - size: number; - loop: number; - /** - * Gets or sets the end position or offset of a text selection. - */ - selectionEnd: number; - /** - * Sets or retrieves the URL of the virtual reality modeling language (VRML) world to be displayed in the window. - */ - vrml: string; - /** - * Sets or retrieves a lower resolution image to display. - */ - lowsrc: string; - /** - * Sets or retrieves the vertical margin for the object. - */ - vspace: number; - /** - * Sets or retrieves a comma-separated list of content types. - */ - accept: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Sets or retrieves the state of the check box or radio button. - */ - defaultChecked: boolean; - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Returns the value of the data at the cursor's current position. - */ - value: string; - /** - * The address or URL of the a media resource that is to be considered. - */ - src: string; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. - */ - useMap: string; - /** - * Sets or retrieves the height of the object. - */ - height: string; - /** - * Sets or retrieves the width of the border to draw around the object. - */ - border: string; - dynsrc: string; - /** - * Sets or retrieves the state of the check box or radio button. - */ - checked: boolean; - /** - * Sets or retrieves the width of the border to draw around the object. - */ - hspace: number; - /** - * Sets or retrieves the maximum number of characters that the user can enter in a text control. - */ - maxLength: number; - /** - * Returns the content type of the object. - */ - type: string; - /** - * Sets or retrieves the initial contents of the object. - */ - defaultValue: string; - /** - * Retrieves whether the object is fully loaded. - */ - complete: boolean; - start: string; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - validationMessage: string; - /** - * Returns a FileList object on a file type input object. - */ - files: FileList; - /** - * Defines the maximum acceptable value for an input element with type="number".When used with the min and step attributes, lets you control the range and increment (such as only even numbers) that the user can enter into an input field. - */ - max: string; - /** - * Overrides the target attribute on a form element. - */ - formTarget: string; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - willValidate: boolean; - /** - * Defines an increment or jump between values that you want to allow the user to enter. When used with the max and min attributes, lets you control the range and increment (for example, allow only even numbers) that the user can enter into an input field. - */ - step: string; - /** - * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. - */ - autofocus: boolean; - /** - * When present, marks an element that can't be submitted without a value. - */ - required: boolean; - /** - * Used to override the encoding (formEnctype attribute) specified on the form element. - */ - formEnctype: string; - /** - * Returns the input field value as a number. - */ - valueAsNumber: number; - /** - * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field. - */ - placeholder: string; - /** - * Overrides the submit method attribute previously specified on a form element. - */ - formMethod: string; - /** - * Specifies the ID of a pre-defined datalist of options for an input element. - */ - list: HTMLElement; - /** - * Specifies whether autocomplete is applied to an editable text field. - */ - autocomplete: string; - /** - * Defines the minimum acceptable value for an input element with type="number". When used with the max and step attributes, lets you control the range and increment (such as even numbers only) that the user can enter into an input field. - */ - min: string; - /** - * Overrides the action attribute (where the data on a form is sent) on the parent form element. - */ - formAction: string; - /** - * Gets or sets a string containing a regular expression that the user's input must match. - */ - pattern: string; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - validity: ValidityState; - /** - * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a "save draft"-type submit option. - */ - formNoValidate: string; - /** - * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list. - */ - multiple: boolean; - /** - * Creates a TextRange object for the element. - */ - createTextRange(): TextRange; - /** - * Sets the start and end positions of a selection in a text field. - * @param start The offset into the text field for the start of the selection. - * @param end The offset into the text field for the end of the selection. - */ - setSelectionRange(start: number, end: number): void; - /** - * Makes the selection equal to the current object. - */ - select(): void; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Decrements a range input control's value by the value given by the Step attribute. If the optional parameter is used, it will decrement the input control's step value multiplied by the parameter's value. - * @param n Value to decrement the value by. - */ - stepDown(n?: number): void; - /** - * Increments a range input control's value by the value given by the Step attribute. If the optional parameter is used, will increment the input control's value by that value. - * @param n Value to increment the value by. - */ - stepUp(n?: number): void; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; -} -declare var HTMLInputElement: { - prototype: HTMLInputElement; - new(): HTMLInputElement; -} - -interface HTMLAnchorElement extends HTMLElement, MSDataBindingExtensions { - /** - * Sets or retrieves the relationship between the object and the destination of the link. - */ - rel: string; - /** - * Contains the protocol of the URL. - */ - protocol: string; - /** - * Sets or retrieves the substring of the href property that follows the question mark. - */ - search: string; - /** - * Sets or retrieves the coordinates of the object. - */ - coords: string; - /** - * Contains the hostname of a URL. - */ - hostname: string; - /** - * Contains the pathname of the URL. - */ - pathname: string; - Methods: string; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; - protocolLong: string; - /** - * Sets or retrieves a destination URL or an anchor point. - */ - href: string; - /** - * Sets or retrieves the shape of the object. - */ - name: string; - /** - * Sets or retrieves the character set used to encode the object. - */ - charset: string; - /** - * Sets or retrieves the language code of the object. - */ - hreflang: string; - /** - * Sets or retrieves the port number associated with a URL. - */ - port: string; - /** - * Contains the hostname and port values of the URL. - */ - host: string; - /** - * Contains the anchor portion of the URL including the hash sign (#). - */ - hash: string; - nameProp: string; - urn: string; - /** - * Sets or retrieves the relationship between the object and the destination of the link. - */ - rev: string; - /** - * Sets or retrieves the shape of the object. - */ - shape: string; - type: string; - mimeType: string; - /** - * Retrieves or sets the text of the object as a string. - */ - text: string; - /** - * Returns a string representation of an object. - */ - toString(): string; -} -declare var HTMLAnchorElement: { - prototype: HTMLAnchorElement; - new(): HTMLAnchorElement; -} - -interface HTMLParamElement extends HTMLElement { - /** - * Sets or retrieves the value of an input parameter for an element. - */ - value: string; - /** - * Sets or retrieves the name of an input parameter for an element. - */ - name: string; - /** - * Sets or retrieves the content type of the resource designated by the value attribute. - */ - type: string; - /** - * Sets or retrieves the data type of the value attribute. - */ - valueType: string; -} -declare var HTMLParamElement: { - prototype: HTMLParamElement; - new(): HTMLParamElement; -} - -interface SVGImageElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired, SVGURIReference { - y: SVGAnimatedLength; - width: SVGAnimatedLength; - preserveAspectRatio: SVGAnimatedPreserveAspectRatio; - x: SVGAnimatedLength; - height: SVGAnimatedLength; -} -declare var SVGImageElement: { - prototype: SVGImageElement; - new(): SVGImageElement; -} - -interface SVGAnimatedNumber { - animVal: number; - baseVal: number; -} -declare var SVGAnimatedNumber: { - prototype: SVGAnimatedNumber; - new(): SVGAnimatedNumber; -} - -interface PerformanceTiming { - redirectStart: number; - domainLookupEnd: number; - responseStart: number; - domComplete: number; - domainLookupStart: number; - loadEventStart: number; - msFirstPaint: number; - unloadEventEnd: number; - fetchStart: number; - requestStart: number; - domInteractive: number; - navigationStart: number; - connectEnd: number; - loadEventEnd: number; - connectStart: number; - responseEnd: number; - domLoading: number; - redirectEnd: number; - unloadEventStart: number; - domContentLoadedEventStart: number; - domContentLoadedEventEnd: number; - toJSON(): any; -} -declare var PerformanceTiming: { - prototype: PerformanceTiming; - new(): PerformanceTiming; -} - -interface HTMLPreElement extends HTMLElement, DOML2DeprecatedTextFlowControl { - /** - * Sets or gets a value that you can use to implement your own width functionality for the object. - */ - width: number; - /** - * Indicates a citation by rendering text in italic type. - */ - cite: string; -} -declare var HTMLPreElement: { - prototype: HTMLPreElement; - new(): HTMLPreElement; -} - -interface EventException { - code: number; - message: string; - name: string; - toString(): string; - DISPATCH_REQUEST_ERR: number; - UNSPECIFIED_EVENT_TYPE_ERR: number; -} -declare var EventException: { - prototype: EventException; - new(): EventException; - DISPATCH_REQUEST_ERR: number; - UNSPECIFIED_EVENT_TYPE_ERR: number; -} - -interface MSNavigatorDoNotTrack { - msDoNotTrack: string; - removeSiteSpecificTrackingException(args: ExceptionInformation): void; - removeWebWideTrackingException(args: ExceptionInformation): void; - storeWebWideTrackingException(args: StoreExceptionsInformation): void; - storeSiteSpecificTrackingException(args: StoreSiteSpecificExceptionsInformation): void; - confirmSiteSpecificTrackingException(args: ConfirmSiteSpecificExceptionsInformation): boolean; - confirmWebWideTrackingException(args: ExceptionInformation): boolean; -} - -interface NavigatorOnLine { - onLine: boolean; -} - -interface WindowLocalStorage { - localStorage: Storage; -} - -interface SVGMetadataElement extends SVGElement { -} -declare var SVGMetadataElement: { - prototype: SVGMetadataElement; - new(): SVGMetadataElement; -} - -interface SVGPathSegArcRel extends SVGPathSeg { - y: number; - sweepFlag: boolean; - r2: number; - x: number; - angle: number; - r1: number; - largeArcFlag: boolean; -} -declare var SVGPathSegArcRel: { - prototype: SVGPathSegArcRel; - new(): SVGPathSegArcRel; -} - -interface SVGPathSegMovetoAbs extends SVGPathSeg { - y: number; - x: number; -} -declare var SVGPathSegMovetoAbs: { - prototype: SVGPathSegMovetoAbs; - new(): SVGPathSegMovetoAbs; -} - -interface SVGStringList { - numberOfItems: number; - replaceItem(newItem: string, index: number): string; - getItem(index: number): string; - clear(): void; - appendItem(newItem: string): string; - initialize(newItem: string): string; - removeItem(index: number): string; - insertItemBefore(newItem: string, index: number): string; -} -declare var SVGStringList: { - prototype: SVGStringList; - new(): SVGStringList; -} - -interface XDomainRequest { - timeout: number; - onerror: (ev: ErrorEvent) => any; - onload: (ev: Event) => any; - onprogress: (ev: ProgressEvent) => any; - ontimeout: (ev: Event) => any; - responseText: string; - contentType: string; - open(method: string, url: string): void; - abort(): void; - send(data?: any): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeout", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var XDomainRequest: { - prototype: XDomainRequest; - new(): XDomainRequest; - create(): XDomainRequest; -} - -interface DOML2DeprecatedBackgroundColorStyle { - bgColor: any; -} - -interface ElementTraversal { - childElementCount: number; - previousElementSibling: Element; - lastElementChild: Element; - nextElementSibling: Element; - firstElementChild: Element; -} - -interface SVGLength { - valueAsString: string; - valueInSpecifiedUnits: number; - value: number; - unitType: number; - newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void; - convertToSpecifiedUnits(unitType: number): void; - SVG_LENGTHTYPE_NUMBER: number; - SVG_LENGTHTYPE_CM: number; - SVG_LENGTHTYPE_PC: number; - SVG_LENGTHTYPE_PERCENTAGE: number; - SVG_LENGTHTYPE_MM: number; - SVG_LENGTHTYPE_PT: number; - SVG_LENGTHTYPE_IN: number; - SVG_LENGTHTYPE_EMS: number; - SVG_LENGTHTYPE_PX: number; - SVG_LENGTHTYPE_UNKNOWN: number; - SVG_LENGTHTYPE_EXS: number; -} -declare var SVGLength: { - prototype: SVGLength; - new(): SVGLength; - SVG_LENGTHTYPE_NUMBER: number; - SVG_LENGTHTYPE_CM: number; - SVG_LENGTHTYPE_PC: number; - SVG_LENGTHTYPE_PERCENTAGE: number; - SVG_LENGTHTYPE_MM: number; - SVG_LENGTHTYPE_PT: number; - SVG_LENGTHTYPE_IN: number; - SVG_LENGTHTYPE_EMS: number; - SVG_LENGTHTYPE_PX: number; - SVG_LENGTHTYPE_UNKNOWN: number; - SVG_LENGTHTYPE_EXS: number; -} - -interface SVGPolygonElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGAnimatedPoints, SVGTests, SVGExternalResourcesRequired { -} -declare var SVGPolygonElement: { - prototype: SVGPolygonElement; - new(): SVGPolygonElement; -} - -interface HTMLPhraseElement extends HTMLElement { - /** - * Sets or retrieves the date and time of a modification to the object. - */ - dateTime: string; - /** - * Sets or retrieves reference information about the object. - */ - cite: string; -} -declare var HTMLPhraseElement: { - prototype: HTMLPhraseElement; - new(): HTMLPhraseElement; -} - -interface NavigatorStorageUtils { -} - -interface SVGPathSegCurvetoCubicRel extends SVGPathSeg { - y: number; - y1: number; - x2: number; - x: number; - x1: number; - y2: number; -} -declare var SVGPathSegCurvetoCubicRel: { - prototype: SVGPathSegCurvetoCubicRel; - new(): SVGPathSegCurvetoCubicRel; -} - -interface SVGTextContentElement extends SVGElement, SVGStylable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { - textLength: SVGAnimatedLength; - lengthAdjust: SVGAnimatedEnumeration; - getCharNumAtPosition(point: SVGPoint): number; - getStartPositionOfChar(charnum: number): SVGPoint; - getExtentOfChar(charnum: number): SVGRect; - getComputedTextLength(): number; - getSubStringLength(charnum: number, nchars: number): number; - selectSubString(charnum: number, nchars: number): void; - getNumberOfChars(): number; - getRotationOfChar(charnum: number): number; - getEndPositionOfChar(charnum: number): SVGPoint; - LENGTHADJUST_SPACING: number; - LENGTHADJUST_SPACINGANDGLYPHS: number; - LENGTHADJUST_UNKNOWN: number; -} -declare var SVGTextContentElement: { - prototype: SVGTextContentElement; - new(): SVGTextContentElement; - LENGTHADJUST_SPACING: number; - LENGTHADJUST_SPACINGANDGLYPHS: number; - LENGTHADJUST_UNKNOWN: number; -} - -interface DOML2DeprecatedColorProperty { - color: string; -} - -interface Location { - hash: string; - protocol: string; - search: string; - href: string; - hostname: string; - port: string; - pathname: string; - host: string; - reload(flag?: boolean): void; - replace(url: string): void; - assign(url: string): void; - toString(): string; -} -declare var Location: { - prototype: Location; - new(): Location; -} - -interface HTMLTitleElement extends HTMLElement { - /** - * Retrieves or sets the text of the object as a string. - */ - text: string; -} -declare var HTMLTitleElement: { - prototype: HTMLTitleElement; - new(): HTMLTitleElement; -} - -interface HTMLStyleElement extends HTMLElement, LinkStyle { - /** - * Sets or retrieves the media type. - */ - media: string; - /** - * Retrieves the CSS language in which the style sheet is written. - */ - type: string; -} -declare var HTMLStyleElement: { - prototype: HTMLStyleElement; - new(): HTMLStyleElement; -} - -interface PerformanceEntry { - name: string; - startTime: number; - duration: number; - entryType: string; -} -declare var PerformanceEntry: { - prototype: PerformanceEntry; - new(): PerformanceEntry; -} - -interface SVGTransform { - type: number; - angle: number; - matrix: SVGMatrix; - setTranslate(tx: number, ty: number): void; - setScale(sx: number, sy: number): void; - setMatrix(matrix: SVGMatrix): void; - setSkewY(angle: number): void; - setRotate(angle: number, cx: number, cy: number): void; - setSkewX(angle: number): void; - SVG_TRANSFORM_SKEWX: number; - SVG_TRANSFORM_UNKNOWN: number; - SVG_TRANSFORM_SCALE: number; - SVG_TRANSFORM_TRANSLATE: number; - SVG_TRANSFORM_MATRIX: number; - SVG_TRANSFORM_ROTATE: number; - SVG_TRANSFORM_SKEWY: number; -} -declare var SVGTransform: { - prototype: SVGTransform; - new(): SVGTransform; - SVG_TRANSFORM_SKEWX: number; - SVG_TRANSFORM_UNKNOWN: number; - SVG_TRANSFORM_SCALE: number; - SVG_TRANSFORM_TRANSLATE: number; - SVG_TRANSFORM_MATRIX: number; - SVG_TRANSFORM_ROTATE: number; - SVG_TRANSFORM_SKEWY: number; -} - -interface UIEvent extends Event { - detail: number; - view: Window; - initUIEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number): void; -} -declare var UIEvent: { - prototype: UIEvent; - new(): UIEvent; -} - -interface SVGURIReference { - href: SVGAnimatedString; -} - -interface SVGPathSeg { - pathSegType: number; - pathSegTypeAsLetter: string; - PATHSEG_MOVETO_REL: number; - PATHSEG_LINETO_VERTICAL_REL: number; - PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number; - PATHSEG_CURVETO_QUADRATIC_REL: number; - PATHSEG_CURVETO_CUBIC_ABS: number; - PATHSEG_LINETO_HORIZONTAL_ABS: number; - PATHSEG_CURVETO_QUADRATIC_ABS: number; - PATHSEG_LINETO_ABS: number; - PATHSEG_CLOSEPATH: number; - PATHSEG_LINETO_HORIZONTAL_REL: number; - PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number; - PATHSEG_LINETO_REL: number; - PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number; - PATHSEG_ARC_REL: number; - PATHSEG_CURVETO_CUBIC_REL: number; - PATHSEG_UNKNOWN: number; - PATHSEG_LINETO_VERTICAL_ABS: number; - PATHSEG_ARC_ABS: number; - PATHSEG_MOVETO_ABS: number; - PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number; -} -declare var SVGPathSeg: { - prototype: SVGPathSeg; - new(): SVGPathSeg; - PATHSEG_MOVETO_REL: number; - PATHSEG_LINETO_VERTICAL_REL: number; - PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number; - PATHSEG_CURVETO_QUADRATIC_REL: number; - PATHSEG_CURVETO_CUBIC_ABS: number; - PATHSEG_LINETO_HORIZONTAL_ABS: number; - PATHSEG_CURVETO_QUADRATIC_ABS: number; - PATHSEG_LINETO_ABS: number; - PATHSEG_CLOSEPATH: number; - PATHSEG_LINETO_HORIZONTAL_REL: number; - PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number; - PATHSEG_LINETO_REL: number; - PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number; - PATHSEG_ARC_REL: number; - PATHSEG_CURVETO_CUBIC_REL: number; - PATHSEG_UNKNOWN: number; - PATHSEG_LINETO_VERTICAL_ABS: number; - PATHSEG_ARC_ABS: number; - PATHSEG_MOVETO_ABS: number; - PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number; -} - -interface WheelEvent extends MouseEvent { - deltaZ: number; - deltaX: number; - deltaMode: number; - deltaY: number; - initWheelEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: EventTarget, modifiersListArg: string, deltaXArg: number, deltaYArg: number, deltaZArg: number, deltaMode: number): void; - getCurrentPoint(element: Element): void; - DOM_DELTA_PIXEL: number; - DOM_DELTA_LINE: number; - DOM_DELTA_PAGE: number; -} -declare var WheelEvent: { - prototype: WheelEvent; - new(): WheelEvent; - DOM_DELTA_PIXEL: number; - DOM_DELTA_LINE: number; - DOM_DELTA_PAGE: number; -} - -interface MSEventAttachmentTarget { - attachEvent(event: string, listener: EventListener): boolean; - detachEvent(event: string, listener: EventListener): void; -} - -interface SVGNumber { - value: number; -} -declare var SVGNumber: { - prototype: SVGNumber; - new(): SVGNumber; -} - -interface SVGPathElement extends SVGElement, SVGStylable, SVGAnimatedPathData, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { - getPathSegAtLength(distance: number): number; - getPointAtLength(distance: number): SVGPoint; - createSVGPathSegCurvetoQuadraticAbs(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticAbs; - createSVGPathSegLinetoRel(x: number, y: number): SVGPathSegLinetoRel; - createSVGPathSegCurvetoQuadraticRel(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticRel; - createSVGPathSegCurvetoCubicAbs(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicAbs; - createSVGPathSegLinetoAbs(x: number, y: number): SVGPathSegLinetoAbs; - createSVGPathSegClosePath(): SVGPathSegClosePath; - createSVGPathSegCurvetoCubicRel(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicRel; - createSVGPathSegCurvetoQuadraticSmoothRel(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothRel; - createSVGPathSegMovetoRel(x: number, y: number): SVGPathSegMovetoRel; - createSVGPathSegCurvetoCubicSmoothAbs(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothAbs; - createSVGPathSegMovetoAbs(x: number, y: number): SVGPathSegMovetoAbs; - createSVGPathSegLinetoVerticalRel(y: number): SVGPathSegLinetoVerticalRel; - createSVGPathSegArcRel(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcRel; - createSVGPathSegCurvetoQuadraticSmoothAbs(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothAbs; - createSVGPathSegLinetoHorizontalRel(x: number): SVGPathSegLinetoHorizontalRel; - getTotalLength(): number; - createSVGPathSegCurvetoCubicSmoothRel(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothRel; - createSVGPathSegLinetoHorizontalAbs(x: number): SVGPathSegLinetoHorizontalAbs; - createSVGPathSegLinetoVerticalAbs(y: number): SVGPathSegLinetoVerticalAbs; - createSVGPathSegArcAbs(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcAbs; -} -declare var SVGPathElement: { - prototype: SVGPathElement; - new(): SVGPathElement; -} - -interface MSCompatibleInfo { - version: string; - userAgent: string; -} -declare var MSCompatibleInfo: { - prototype: MSCompatibleInfo; - new(): MSCompatibleInfo; -} - -interface Text extends CharacterData, MSNodeExtensions { - wholeText: string; - splitText(offset: number): Text; - replaceWholeText(content: string): Text; -} -declare var Text: { - prototype: Text; - new(): Text; -} - -interface SVGAnimatedRect { - animVal: SVGRect; - baseVal: SVGRect; -} -declare var SVGAnimatedRect: { - prototype: SVGAnimatedRect; - new(): SVGAnimatedRect; -} - -interface CSSNamespaceRule extends CSSRule { - namespaceURI: string; - prefix: string; -} -declare var CSSNamespaceRule: { - prototype: CSSNamespaceRule; - new(): CSSNamespaceRule; -} - -interface SVGPathSegList { - numberOfItems: number; - replaceItem(newItem: SVGPathSeg, index: number): SVGPathSeg; - getItem(index: number): SVGPathSeg; - clear(): void; - appendItem(newItem: SVGPathSeg): SVGPathSeg; - initialize(newItem: SVGPathSeg): SVGPathSeg; - removeItem(index: number): SVGPathSeg; - insertItemBefore(newItem: SVGPathSeg, index: number): SVGPathSeg; -} -declare var SVGPathSegList: { - prototype: SVGPathSegList; - new(): SVGPathSegList; -} - -interface HTMLUnknownElement extends HTMLElement, MSDataBindingRecordSetReadonlyExtensions { -} -declare var HTMLUnknownElement: { - prototype: HTMLUnknownElement; - new(): HTMLUnknownElement; -} - -interface HTMLAudioElement extends HTMLMediaElement { -} -declare var HTMLAudioElement: { - prototype: HTMLAudioElement; - new(): HTMLAudioElement; -} - -interface MSImageResourceExtensions { - dynsrc: string; - vrml: string; - lowsrc: string; - start: string; - loop: number; -} - -interface PositionError { - code: number; - message: string; - toString(): string; - POSITION_UNAVAILABLE: number; - PERMISSION_DENIED: number; - TIMEOUT: number; -} -declare var PositionError: { - prototype: PositionError; - new(): PositionError; - POSITION_UNAVAILABLE: number; - PERMISSION_DENIED: number; - TIMEOUT: number; -} - -interface HTMLTableCellElement extends HTMLElement, HTMLTableAlignment, DOML2DeprecatedBackgroundStyle, DOML2DeprecatedBackgroundColorStyle { - /** - * Sets or retrieves the width of the object. - */ - width: number; - /** - * Sets or retrieves a list of header cells that provide information for the object. - */ - headers: string; - /** - * Retrieves the position of the object in the cells collection of a row. - */ - cellIndex: number; - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. - */ - borderColorLight: any; - /** - * Sets or retrieves the number columns in the table that the object should span. - */ - colSpan: number; - /** - * Sets or retrieves the border color of the object. - */ - borderColor: any; - /** - * Sets or retrieves a comma-delimited list of conceptual categories associated with the object. - */ - axis: string; - /** - * Sets or retrieves the height of the object. - */ - height: any; - /** - * Sets or retrieves whether the browser automatically performs wordwrap. - */ - noWrap: boolean; - /** - * Sets or retrieves abbreviated text for the object. - */ - abbr: string; - /** - * Sets or retrieves how many rows in a table the cell should span. - */ - rowSpan: number; - /** - * Sets or retrieves the group of cells in a table to which the object's information applies. - */ - scope: string; - /** - * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. - */ - borderColorDark: any; -} -declare var HTMLTableCellElement: { - prototype: HTMLTableCellElement; - new(): HTMLTableCellElement; -} - -interface SVGElementInstance extends EventTarget { - previousSibling: SVGElementInstance; - parentNode: SVGElementInstance; - lastChild: SVGElementInstance; - nextSibling: SVGElementInstance; - childNodes: SVGElementInstanceList; - correspondingUseElement: SVGUseElement; - correspondingElement: SVGElement; - firstChild: SVGElementInstance; -} -declare var SVGElementInstance: { - prototype: SVGElementInstance; - new(): SVGElementInstance; -} - -interface MSNamespaceInfoCollection { - length: number; - add(namespace?: string, urn?: string, implementationUrl?: any): any; - item(index: any): any; - // [index: any]: any; -} -declare var MSNamespaceInfoCollection: { - prototype: MSNamespaceInfoCollection; - new(): MSNamespaceInfoCollection; -} - -interface SVGCircleElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { - cx: SVGAnimatedLength; - r: SVGAnimatedLength; - cy: SVGAnimatedLength; -} -declare var SVGCircleElement: { - prototype: SVGCircleElement; - new(): SVGCircleElement; -} - -interface StyleSheetList { - length: number; - item(index?: number): StyleSheet; - [index: number]: StyleSheet; -} -declare var StyleSheetList: { - prototype: StyleSheetList; - new(): StyleSheetList; -} - -interface CSSImportRule extends CSSRule { - styleSheet: CSSStyleSheet; - href: string; - media: MediaList; -} -declare var CSSImportRule: { - prototype: CSSImportRule; - new(): CSSImportRule; -} - -interface CustomEvent extends Event { - detail: any; - initCustomEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, detailArg: any): void; -} -declare var CustomEvent: { - prototype: CustomEvent; - new(): CustomEvent; -} - -interface HTMLBaseFontElement extends HTMLElement, DOML2DeprecatedColorProperty { - /** - * Sets or retrieves the current typeface family. - */ - face: string; - /** - * Sets or retrieves the font size of the object. - */ - size: number; -} -declare var HTMLBaseFontElement: { - prototype: HTMLBaseFontElement; - new(): HTMLBaseFontElement; -} - -interface HTMLTextAreaElement extends HTMLElement, MSDataBindingExtensions { - /** - * Retrieves or sets the text in the entry field of the textArea element. - */ - value: string; - /** - * Sets or retrieves the value indicating whether the control is selected. - */ - status: any; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Gets or sets the starting position or offset of a text selection. - */ - selectionStart: number; - /** - * Sets or retrieves the number of horizontal rows contained in the object. - */ - rows: number; - /** - * Sets or retrieves the width of the object. - */ - cols: number; - /** - * Sets or retrieves the value indicated whether the content of the object is read-only. - */ - readOnly: boolean; - /** - * Sets or retrieves how to handle wordwrapping in the object. - */ - wrap: string; - /** - * Gets or sets the end position or offset of a text selection. - */ - selectionEnd: number; - /** - * Retrieves the type of control. - */ - type: string; - /** - * Sets or retrieves the initial contents of the object. - */ - defaultValue: string; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - validationMessage: string; - /** - * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. - */ - autofocus: boolean; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - validity: ValidityState; - /** - * When present, marks an element that can't be submitted without a value. - */ - required: boolean; - /** - * Sets or retrieves the maximum number of characters that the user can enter in a text control. - */ - maxLength: number; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - willValidate: boolean; - /** - * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field. - */ - placeholder: string; - /** - * Creates a TextRange object for the element. - */ - createTextRange(): TextRange; - /** - * Sets the start and end positions of a selection in a text field. - * @param start The offset into the text field for the start of the selection. - * @param end The offset into the text field for the end of the selection. - */ - setSelectionRange(start: number, end: number): void; - /** - * Highlights the input area of a form element. - */ - select(): void; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; -} -declare var HTMLTextAreaElement: { - prototype: HTMLTextAreaElement; - new(): HTMLTextAreaElement; -} - -interface Geolocation { - clearWatch(watchId: number): void; - getCurrentPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): void; - watchPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): number; -} -declare var Geolocation: { - prototype: Geolocation; - new(): Geolocation; -} - -interface DOML2DeprecatedMarginStyle { - vspace: number; - hspace: number; -} - -interface MSWindowModeless { - dialogTop: any; - dialogLeft: any; - dialogWidth: any; - dialogHeight: any; - menuArguments: any; -} - -interface DOML2DeprecatedAlignmentStyle { - align: string; -} - -interface HTMLMarqueeElement extends HTMLElement, MSDataBindingExtensions, DOML2DeprecatedBackgroundColorStyle { - width: string; - onbounce: (ev: Event) => any; - vspace: number; - trueSpeed: boolean; - scrollAmount: number; - scrollDelay: number; - behavior: string; - height: string; - loop: number; - direction: string; - hspace: number; - onstart: (ev: Event) => any; - onfinish: (ev: Event) => any; - stop(): void; - start(): void; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "bounce", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "start", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "finish", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var HTMLMarqueeElement: { - prototype: HTMLMarqueeElement; - new(): HTMLMarqueeElement; -} - -interface SVGRect { - y: number; - width: number; - x: number; - height: number; -} -declare var SVGRect: { - prototype: SVGRect; - new(): SVGRect; -} - -interface MSNodeExtensions { - swapNode(otherNode: Node): Node; - removeNode(deep?: boolean): Node; - replaceNode(replacement: Node): Node; -} - -interface History { - length: number; - state: any; - back(distance?: any): void; - forward(distance?: any): void; - go(delta?: any): void; - replaceState(statedata: any, title: string, url?: string): void; - pushState(statedata: any, title: string, url?: string): void; -} -declare var History: { - prototype: History; - new(): History; -} - -interface SVGPathSegCurvetoCubicAbs extends SVGPathSeg { - y: number; - y1: number; - x2: number; - x: number; - x1: number; - y2: number; -} -declare var SVGPathSegCurvetoCubicAbs: { - prototype: SVGPathSegCurvetoCubicAbs; - new(): SVGPathSegCurvetoCubicAbs; -} - -interface SVGPathSegCurvetoQuadraticAbs extends SVGPathSeg { - y: number; - y1: number; - x: number; - x1: number; -} -declare var SVGPathSegCurvetoQuadraticAbs: { - prototype: SVGPathSegCurvetoQuadraticAbs; - new(): SVGPathSegCurvetoQuadraticAbs; -} - -interface TimeRanges { - length: number; - start(index: number): number; - end(index: number): number; -} -declare var TimeRanges: { - prototype: TimeRanges; - new(): TimeRanges; -} - -interface CSSRule { - cssText: string; - parentStyleSheet: CSSStyleSheet; - parentRule: CSSRule; - type: number; - IMPORT_RULE: number; - MEDIA_RULE: number; - STYLE_RULE: number; - NAMESPACE_RULE: number; - PAGE_RULE: number; - UNKNOWN_RULE: number; - FONT_FACE_RULE: number; - CHARSET_RULE: number; - KEYFRAMES_RULE: number; - KEYFRAME_RULE: number; - VIEWPORT_RULE: number; -} -declare var CSSRule: { - prototype: CSSRule; - new(): CSSRule; - IMPORT_RULE: number; - MEDIA_RULE: number; - STYLE_RULE: number; - NAMESPACE_RULE: number; - PAGE_RULE: number; - UNKNOWN_RULE: number; - FONT_FACE_RULE: number; - CHARSET_RULE: number; - KEYFRAMES_RULE: number; - KEYFRAME_RULE: number; - VIEWPORT_RULE: number; -} - -interface SVGPathSegLinetoAbs extends SVGPathSeg { - y: number; - x: number; -} -declare var SVGPathSegLinetoAbs: { - prototype: SVGPathSegLinetoAbs; - new(): SVGPathSegLinetoAbs; -} - -interface HTMLModElement extends HTMLElement { - /** - * Sets or retrieves the date and time of a modification to the object. - */ - dateTime: string; - /** - * Sets or retrieves reference information about the object. - */ - cite: string; -} -declare var HTMLModElement: { - prototype: HTMLModElement; - new(): HTMLModElement; -} - -interface SVGMatrix { - e: number; - c: number; - a: number; - b: number; - d: number; - f: number; - multiply(secondMatrix: SVGMatrix): SVGMatrix; - flipY(): SVGMatrix; - skewY(angle: number): SVGMatrix; - inverse(): SVGMatrix; - scaleNonUniform(scaleFactorX: number, scaleFactorY: number): SVGMatrix; - rotate(angle: number): SVGMatrix; - flipX(): SVGMatrix; - translate(x: number, y: number): SVGMatrix; - scale(scaleFactor: number): SVGMatrix; - rotateFromVector(x: number, y: number): SVGMatrix; - skewX(angle: number): SVGMatrix; -} -declare var SVGMatrix: { - prototype: SVGMatrix; - new(): SVGMatrix; -} - -interface MSPopupWindow { - document: Document; - isOpen: boolean; - show(x: number, y: number, w: number, h: number, element?: any): void; - hide(): void; -} -declare var MSPopupWindow: { - prototype: MSPopupWindow; - new(): MSPopupWindow; -} - -interface BeforeUnloadEvent extends Event { - returnValue: string; -} -declare var BeforeUnloadEvent: { - prototype: BeforeUnloadEvent; - new(): BeforeUnloadEvent; -} - -interface SVGUseElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired, SVGURIReference { - y: SVGAnimatedLength; - width: SVGAnimatedLength; - animatedInstanceRoot: SVGElementInstance; - instanceRoot: SVGElementInstance; - x: SVGAnimatedLength; - height: SVGAnimatedLength; -} -declare var SVGUseElement: { - prototype: SVGUseElement; - new(): SVGUseElement; -} - -interface Event { - timeStamp: number; - defaultPrevented: boolean; - isTrusted: boolean; - currentTarget: EventTarget; - cancelBubble: boolean; - target: EventTarget; - eventPhase: number; - cancelable: boolean; - type: string; - srcElement: Element; - bubbles: boolean; - initEvent(eventTypeArg: string, canBubbleArg: boolean, cancelableArg: boolean): void; - stopPropagation(): void; - stopImmediatePropagation(): void; - preventDefault(): void; - CAPTURING_PHASE: number; - AT_TARGET: number; - BUBBLING_PHASE: number; -} -declare var Event: { - prototype: Event; - new(): Event; - CAPTURING_PHASE: number; - AT_TARGET: number; - BUBBLING_PHASE: number; -} - -interface ImageData { - width: number; - data: number[]; - height: number; -} -declare var ImageData: { - prototype: ImageData; - new(): ImageData; -} - -interface HTMLTableColElement extends HTMLElement, HTMLTableAlignment { - /** - * Sets or retrieves the width of the object. - */ - width: any; - /** - * Sets or retrieves the alignment of the object relative to the display or table. - */ - align: string; - /** - * Sets or retrieves the number of columns in the group. - */ - span: number; -} -declare var HTMLTableColElement: { - prototype: HTMLTableColElement; - new(): HTMLTableColElement; -} - -interface SVGException { - code: number; - message: string; - name: string; - toString(): string; - SVG_MATRIX_NOT_INVERTABLE: number; - SVG_WRONG_TYPE_ERR: number; - SVG_INVALID_VALUE_ERR: number; -} -declare var SVGException: { - prototype: SVGException; - new(): SVGException; - SVG_MATRIX_NOT_INVERTABLE: number; - SVG_WRONG_TYPE_ERR: number; - SVG_INVALID_VALUE_ERR: number; -} - -interface SVGLinearGradientElement extends SVGGradientElement { - y1: SVGAnimatedLength; - x2: SVGAnimatedLength; - x1: SVGAnimatedLength; - y2: SVGAnimatedLength; -} -declare var SVGLinearGradientElement: { - prototype: SVGLinearGradientElement; - new(): SVGLinearGradientElement; -} - -interface HTMLTableAlignment { - /** - * Sets or retrieves a value that you can use to implement your own ch functionality for the object. - */ - ch: string; - /** - * Sets or retrieves how text and other content are vertically aligned within the object that contains them. - */ - vAlign: string; - /** - * Sets or retrieves a value that you can use to implement your own chOff functionality for the object. - */ - chOff: string; -} - -interface SVGAnimatedEnumeration { - animVal: number; - baseVal: number; -} -declare var SVGAnimatedEnumeration: { - prototype: SVGAnimatedEnumeration; - new(): SVGAnimatedEnumeration; -} - -interface DOML2DeprecatedSizeProperty { - size: number; -} - -interface HTMLUListElement extends HTMLElement, DOML2DeprecatedListSpaceReduction, DOML2DeprecatedListNumberingAndBulletStyle { -} -declare var HTMLUListElement: { - prototype: HTMLUListElement; - new(): HTMLUListElement; -} - -interface SVGRectElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { - y: SVGAnimatedLength; - width: SVGAnimatedLength; - ry: SVGAnimatedLength; - rx: SVGAnimatedLength; - x: SVGAnimatedLength; - height: SVGAnimatedLength; -} -declare var SVGRectElement: { - prototype: SVGRectElement; - new(): SVGRectElement; -} - -interface ErrorEventHandler { - (event: Event, source: string, fileno: number, columnNumber: number): void; -} - -interface HTMLDivElement extends HTMLElement, MSDataBindingExtensions { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves whether the browser automatically performs wordwrap. - */ - noWrap: boolean; -} -declare var HTMLDivElement: { - prototype: HTMLDivElement; - new(): HTMLDivElement; -} - -interface DOML2DeprecatedBorderStyle { - border: string; -} - -interface NamedNodeMap { - length: number; - removeNamedItemNS(namespaceURI: string, localName: string): Attr; - item(index: number): Attr; - [index: number]: Attr; - removeNamedItem(name: string): Attr; - getNamedItem(name: string): Attr; - // [name: string]: Attr; - setNamedItem(arg: Attr): Attr; - getNamedItemNS(namespaceURI: string, localName: string): Attr; - setNamedItemNS(arg: Attr): Attr; -} -declare var NamedNodeMap: { - prototype: NamedNodeMap; - new(): NamedNodeMap; -} - -interface MediaList { - length: number; - mediaText: string; - deleteMedium(oldMedium: string): void; - appendMedium(newMedium: string): void; - item(index: number): string; - [index: number]: string; - toString(): string; -} -declare var MediaList: { - prototype: MediaList; - new(): MediaList; -} - -interface SVGPathSegCurvetoQuadraticSmoothAbs extends SVGPathSeg { - y: number; - x: number; -} -declare var SVGPathSegCurvetoQuadraticSmoothAbs: { - prototype: SVGPathSegCurvetoQuadraticSmoothAbs; - new(): SVGPathSegCurvetoQuadraticSmoothAbs; -} - -interface SVGPathSegCurvetoCubicSmoothRel extends SVGPathSeg { - y: number; - x2: number; - x: number; - y2: number; -} -declare var SVGPathSegCurvetoCubicSmoothRel: { - prototype: SVGPathSegCurvetoCubicSmoothRel; - new(): SVGPathSegCurvetoCubicSmoothRel; -} - -interface SVGLengthList { - numberOfItems: number; - replaceItem(newItem: SVGLength, index: number): SVGLength; - getItem(index: number): SVGLength; - clear(): void; - appendItem(newItem: SVGLength): SVGLength; - initialize(newItem: SVGLength): SVGLength; - removeItem(index: number): SVGLength; - insertItemBefore(newItem: SVGLength, index: number): SVGLength; -} -declare var SVGLengthList: { - prototype: SVGLengthList; - new(): SVGLengthList; -} - -interface ProcessingInstruction extends Node { - target: string; - data: string; -} -declare var ProcessingInstruction: { - prototype: ProcessingInstruction; - new(): ProcessingInstruction; -} - -interface MSWindowExtensions { - status: string; - onmouseleave: (ev: MouseEvent) => any; - screenLeft: number; - offscreenBuffering: any; - maxConnectionsPerServer: number; - onmouseenter: (ev: MouseEvent) => any; - clipboardData: DataTransfer; - defaultStatus: string; - clientInformation: Navigator; - closed: boolean; - onhelp: (ev: Event) => any; - external: External; - event: MSEventObj; - onfocusout: (ev: FocusEvent) => any; - screenTop: number; - onfocusin: (ev: FocusEvent) => any; - showModelessDialog(url?: string, argument?: any, options?: any): Window; - navigate(url: string): void; - resizeBy(x?: number, y?: number): void; - item(index: any): any; - resizeTo(x?: number, y?: number): void; - createPopup(arguments?: any): MSPopupWindow; - toStaticHTML(html: string): string; - execScript(code: string, language?: string): any; - msWriteProfilerMark(profilerMarkName: string): void; - moveTo(x?: number, y?: number): void; - moveBy(x?: number, y?: number): void; - showHelp(url: string, helpArg?: any, features?: string): void; - captureEvents(): void; - releaseEvents(): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface MSBehaviorUrnsCollection { - length: number; - item(index: number): string; -} -declare var MSBehaviorUrnsCollection: { - prototype: MSBehaviorUrnsCollection; - new(): MSBehaviorUrnsCollection; -} - -interface CSSFontFaceRule extends CSSRule { - style: CSSStyleDeclaration; -} -declare var CSSFontFaceRule: { - prototype: CSSFontFaceRule; - new(): CSSFontFaceRule; -} - -interface DOML2DeprecatedBackgroundStyle { - background: string; -} - -interface TextEvent extends UIEvent { - inputMethod: number; - data: string; - locale: string; - initTextEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, inputMethod: number, locale: string): void; - DOM_INPUT_METHOD_KEYBOARD: number; - DOM_INPUT_METHOD_DROP: number; - DOM_INPUT_METHOD_IME: number; - DOM_INPUT_METHOD_SCRIPT: number; - DOM_INPUT_METHOD_VOICE: number; - DOM_INPUT_METHOD_UNKNOWN: number; - DOM_INPUT_METHOD_PASTE: number; - DOM_INPUT_METHOD_HANDWRITING: number; - DOM_INPUT_METHOD_OPTION: number; - DOM_INPUT_METHOD_MULTIMODAL: number; -} -declare var TextEvent: { - prototype: TextEvent; - new(): TextEvent; - DOM_INPUT_METHOD_KEYBOARD: number; - DOM_INPUT_METHOD_DROP: number; - DOM_INPUT_METHOD_IME: number; - DOM_INPUT_METHOD_SCRIPT: number; - DOM_INPUT_METHOD_VOICE: number; - DOM_INPUT_METHOD_UNKNOWN: number; - DOM_INPUT_METHOD_PASTE: number; - DOM_INPUT_METHOD_HANDWRITING: number; - DOM_INPUT_METHOD_OPTION: number; - DOM_INPUT_METHOD_MULTIMODAL: number; -} - -interface DocumentFragment extends Node, NodeSelector, MSEventAttachmentTarget, MSNodeExtensions { -} -declare var DocumentFragment: { - prototype: DocumentFragment; - new(): DocumentFragment; -} - -interface SVGPolylineElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGAnimatedPoints, SVGTests, SVGExternalResourcesRequired { -} -declare var SVGPolylineElement: { - prototype: SVGPolylineElement; - new(): SVGPolylineElement; -} - -interface SVGAnimatedPathData { - pathSegList: SVGPathSegList; -} - -interface Position { - timestamp: Date; - coords: Coordinates; -} -declare var Position: { - prototype: Position; - new(): Position; -} - -interface BookmarkCollection { - length: number; - item(index: number): any; - [index: number]: any; -} -declare var BookmarkCollection: { - prototype: BookmarkCollection; - new(): BookmarkCollection; -} - -interface PerformanceMark extends PerformanceEntry { -} -declare var PerformanceMark: { - prototype: PerformanceMark; - new(): PerformanceMark; -} - -interface CSSPageRule extends CSSRule { - pseudoClass: string; - selectorText: string; - selector: string; - style: CSSStyleDeclaration; -} -declare var CSSPageRule: { - prototype: CSSPageRule; - new(): CSSPageRule; -} - -interface HTMLBRElement extends HTMLElement { - /** - * Sets or retrieves the side on which floating objects are not to be positioned when any IHTMLBlockElement is inserted into the document. - */ - clear: string; -} -declare var HTMLBRElement: { - prototype: HTMLBRElement; - new(): HTMLBRElement; -} - -interface MSNavigatorExtensions { - userLanguage: string; - plugins: MSPluginsCollection; - cookieEnabled: boolean; - appCodeName: string; - cpuClass: string; - appMinorVersion: string; - connectionSpeed: number; - browserLanguage: string; - mimeTypes: MSMimeTypesCollection; - systemLanguage: string; - language: string; - javaEnabled(): boolean; - taintEnabled(): boolean; -} - -interface HTMLSpanElement extends HTMLElement, MSDataBindingExtensions { -} -declare var HTMLSpanElement: { - prototype: HTMLSpanElement; - new(): HTMLSpanElement; -} - -interface HTMLHeadElement extends HTMLElement { - profile: string; -} -declare var HTMLHeadElement: { - prototype: HTMLHeadElement; - new(): HTMLHeadElement; -} - -interface HTMLHeadingElement extends HTMLElement, DOML2DeprecatedTextFlowControl { - /** - * Sets or retrieves a value that indicates the table alignment. - */ - align: string; -} -declare var HTMLHeadingElement: { - prototype: HTMLHeadingElement; - new(): HTMLHeadingElement; -} - -interface HTMLFormElement extends HTMLElement, MSHTMLCollectionExtensions { - /** - * Sets or retrieves the number of objects in a collection. - */ - length: number; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; - /** - * Sets or retrieves a list of character encodings for input data that must be accepted by the server processing the form. - */ - acceptCharset: string; - /** - * Sets or retrieves the encoding type for the form. - */ - enctype: string; - /** - * Retrieves a collection, in source order, of all controls in a given form. - */ - elements: HTMLCollection; - /** - * Sets or retrieves the URL to which the form content is sent for processing. - */ - action: string; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Sets or retrieves how to send the form data to the server. - */ - method: string; - /** - * Sets or retrieves the MIME encoding for the form. - */ - encoding: string; - /** - * Specifies whether autocomplete is applied to an editable text field. - */ - autocomplete: string; - /** - * Designates a form that is not validated when submitted. - */ - noValidate: boolean; - /** - * Fires when the user resets a form. - */ - reset(): void; - /** - * Retrieves a form object or an object from an elements collection. - * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is a Number, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made. - * @param index Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned. - */ - item(name?: any, index?: any): any; - /** - * Fires when a FORM is about to be submitted. - */ - submit(): void; - /** - * Retrieves a form object or an object from an elements collection. - */ - namedItem(name: string): any; - [name: string]: any; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; -} -declare var HTMLFormElement: { - prototype: HTMLFormElement; - new(): HTMLFormElement; -} - -interface SVGZoomAndPan { - zoomAndPan: number; - SVG_ZOOMANDPAN_MAGNIFY: number; - SVG_ZOOMANDPAN_UNKNOWN: number; - SVG_ZOOMANDPAN_DISABLE: number; -} -declare var SVGZoomAndPan: SVGZoomAndPan; - -interface HTMLMediaElement extends HTMLElement { - /** - * Gets the earliest possible position, in seconds, that the playback can begin. - */ - initialTime: number; - /** - * Gets TimeRanges for the current media resource that has been played. - */ - played: TimeRanges; - /** - * Gets the address or URL of the current media resource that is selected by IHTMLMediaElement. - */ - currentSrc: string; - readyState: any; - /** - * The autobuffer element is not supported by Internet Explorer 9. Use the preload element instead. - */ - autobuffer: boolean; - /** - * Gets or sets a flag to specify whether playback should restart after it completes. - */ - loop: boolean; - /** - * Gets information about whether the playback has ended or not. - */ - ended: boolean; - /** - * Gets a collection of buffered time ranges. - */ - buffered: TimeRanges; - /** - * Returns an object representing the current error state of the audio or video element. - */ - error: MediaError; - /** - * Returns a TimeRanges object that represents the ranges of the current media resource that can be seeked. - */ - seekable: TimeRanges; - /** - * Gets or sets a value that indicates whether to start playing the media automatically. - */ - autoplay: boolean; - /** - * Gets or sets a flag that indicates whether the client provides a set of controls for the media (in case the developer does not include controls for the player). - */ - controls: boolean; - /** - * Gets or sets the volume level for audio portions of the media element. - */ - volume: number; - /** - * The address or URL of the a media resource that is to be considered. - */ - src: string; - /** - * Gets or sets the current rate of speed for the media resource to play. This speed is expressed as a multiple of the normal speed of the media resource. - */ - playbackRate: number; - /** - * Returns the duration in seconds of the current media resource. A NaN value is returned if duration is not available, or Infinity if the media resource is streaming. - */ - duration: number; - /** - * Gets or sets a flag that indicates whether the audio (either audio or the audio track on video media) is muted. - */ - muted: boolean; - /** - * Gets or sets the default playback rate when the user is not using fast forward or reverse for a video or audio resource. - */ - defaultPlaybackRate: number; - /** - * Gets a flag that specifies whether playback is paused. - */ - paused: boolean; - /** - * Gets a flag that indicates whether the the client is currently moving to a new playback position in the media resource. - */ - seeking: boolean; - /** - * Gets or sets the current playback position, in seconds. - */ - currentTime: number; - /** - * Gets or sets the current playback position, in seconds. - */ - preload: string; - /** - * Gets the current network activity for the element. - */ - networkState: number; - /** - * Specifies the purpose of the audio or video media, such as background audio or alerts. - */ - msAudioCategory: string; - /** - * Specifies whether or not to enable low-latency playback on the media element. - */ - msRealTime: boolean; - /** - * Gets or sets the primary DLNA PlayTo device. - */ - msPlayToPrimary: boolean; - textTracks: TextTrackList; - /** - * Gets or sets whether the DLNA PlayTo device is available. - */ - msPlayToDisabled: boolean; - /** - * Returns an AudioTrackList object with the audio tracks for a given video element. - */ - audioTracks: AudioTrackList; - /** - * Gets the source associated with the media element for use by the PlayToManager. - */ - msPlayToSource: any; - /** - * Specifies the output device id that the audio will be sent to. - */ - msAudioDeviceType: string; - /** - * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. - */ - msPlayToPreferredSourceUri: string; - onmsneedkey: (ev: MSMediaKeyNeededEvent) => any; - /** - * Gets the MSMediaKeys object, which is used for decrypting media data, that is associated with this media element. - */ - msKeys: MSMediaKeys; - msGraphicsTrustStatus: MSGraphicsTrust; - /** - * Pauses the current playback and sets paused to TRUE. This can be used to test whether the media is playing or paused. You can also use the pause or play events to tell whether the media is playing or not. - */ - pause(): void; - /** - * Loads and starts playback of a media resource. - */ - play(): void; - /** - * Fires immediately after the client loads the object. - */ - load(): void; - /** - * Returns a string that specifies whether the client can play a given media resource type. - */ - canPlayType(type: string): string; - /** - * Clears all effects from the media pipeline. - */ - msClearEffects(): void; - /** - * Specifies the media protection manager for a given media pipeline. - */ - msSetMediaProtectionManager(mediaProtectionManager?: any): void; - /** - * Inserts the specified audio effect into media pipeline. - */ - msInsertAudioEffect(activatableClassId: string, effectRequired: boolean, config?: any): void; - msSetMediaKeys(mediaKeys: MSMediaKeys): void; - addTextTrack(kind: string, label?: string, language?: string): TextTrack; - HAVE_METADATA: number; - HAVE_CURRENT_DATA: number; - HAVE_NOTHING: number; - NETWORK_NO_SOURCE: number; - HAVE_ENOUGH_DATA: number; - NETWORK_EMPTY: number; - NETWORK_LOADING: number; - NETWORK_IDLE: number; - HAVE_FUTURE_DATA: number; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msneedkey", listener: (ev: MSMediaKeyNeededEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var HTMLMediaElement: { - prototype: HTMLMediaElement; - new(): HTMLMediaElement; - HAVE_METADATA: number; - HAVE_CURRENT_DATA: number; - HAVE_NOTHING: number; - NETWORK_NO_SOURCE: number; - HAVE_ENOUGH_DATA: number; - NETWORK_EMPTY: number; - NETWORK_LOADING: number; - NETWORK_IDLE: number; - HAVE_FUTURE_DATA: number; -} - -interface ElementCSSInlineStyle { - runtimeStyle: MSStyleCSSProperties; - currentStyle: MSCurrentStyleCSSProperties; - doScroll(component?: any): void; - componentFromPoint(x: number, y: number): string; -} - -interface DOMParser { - parseFromString(source: string, mimeType: string): Document; -} -declare var DOMParser: { - prototype: DOMParser; - new(): DOMParser; -} - -interface MSMimeTypesCollection { - length: number; -} -declare var MSMimeTypesCollection: { - prototype: MSMimeTypesCollection; - new(): MSMimeTypesCollection; -} - -interface StyleSheet { - disabled: boolean; - ownerNode: Node; - parentStyleSheet: StyleSheet; - href: string; - media: MediaList; - type: string; - title: string; -} -declare var StyleSheet: { - prototype: StyleSheet; - new(): StyleSheet; -} - -interface SVGTextPathElement extends SVGTextContentElement, SVGURIReference { - startOffset: SVGAnimatedLength; - method: SVGAnimatedEnumeration; - spacing: SVGAnimatedEnumeration; - TEXTPATH_SPACINGTYPE_EXACT: number; - TEXTPATH_METHODTYPE_STRETCH: number; - TEXTPATH_SPACINGTYPE_AUTO: number; - TEXTPATH_SPACINGTYPE_UNKNOWN: number; - TEXTPATH_METHODTYPE_UNKNOWN: number; - TEXTPATH_METHODTYPE_ALIGN: number; -} -declare var SVGTextPathElement: { - prototype: SVGTextPathElement; - new(): SVGTextPathElement; - TEXTPATH_SPACINGTYPE_EXACT: number; - TEXTPATH_METHODTYPE_STRETCH: number; - TEXTPATH_SPACINGTYPE_AUTO: number; - TEXTPATH_SPACINGTYPE_UNKNOWN: number; - TEXTPATH_METHODTYPE_UNKNOWN: number; - TEXTPATH_METHODTYPE_ALIGN: number; -} - -interface HTMLDTElement extends HTMLElement { - /** - * Sets or retrieves whether the browser automatically performs wordwrap. - */ - noWrap: boolean; -} -declare var HTMLDTElement: { - prototype: HTMLDTElement; - new(): HTMLDTElement; -} - -interface NodeList { - length: number; - item(index: number): Node; - [index: number]: Node; -} -declare var NodeList: { - prototype: NodeList; - new(): NodeList; -} - -interface XMLSerializer { - serializeToString(target: Node): string; -} -declare var XMLSerializer: { - prototype: XMLSerializer; - new(): XMLSerializer; -} - -interface PerformanceMeasure extends PerformanceEntry { -} -declare var PerformanceMeasure: { - prototype: PerformanceMeasure; - new(): PerformanceMeasure; -} - -interface SVGGradientElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGExternalResourcesRequired, SVGURIReference { - spreadMethod: SVGAnimatedEnumeration; - gradientTransform: SVGAnimatedTransformList; - gradientUnits: SVGAnimatedEnumeration; - SVG_SPREADMETHOD_REFLECT: number; - SVG_SPREADMETHOD_PAD: number; - SVG_SPREADMETHOD_UNKNOWN: number; - SVG_SPREADMETHOD_REPEAT: number; -} -declare var SVGGradientElement: { - prototype: SVGGradientElement; - new(): SVGGradientElement; - SVG_SPREADMETHOD_REFLECT: number; - SVG_SPREADMETHOD_PAD: number; - SVG_SPREADMETHOD_UNKNOWN: number; - SVG_SPREADMETHOD_REPEAT: number; -} - -interface NodeFilter { - acceptNode(n: Node): number; - SHOW_ENTITY_REFERENCE: number; - SHOW_NOTATION: number; - SHOW_ENTITY: number; - SHOW_DOCUMENT: number; - SHOW_PROCESSING_INSTRUCTION: number; - FILTER_REJECT: number; - SHOW_CDATA_SECTION: number; - FILTER_ACCEPT: number; - SHOW_ALL: number; - SHOW_DOCUMENT_TYPE: number; - SHOW_TEXT: number; - SHOW_ELEMENT: number; - SHOW_COMMENT: number; - FILTER_SKIP: number; - SHOW_ATTRIBUTE: number; - SHOW_DOCUMENT_FRAGMENT: number; -} -declare var NodeFilter: NodeFilter; - -interface SVGNumberList { - numberOfItems: number; - replaceItem(newItem: SVGNumber, index: number): SVGNumber; - getItem(index: number): SVGNumber; - clear(): void; - appendItem(newItem: SVGNumber): SVGNumber; - initialize(newItem: SVGNumber): SVGNumber; - removeItem(index: number): SVGNumber; - insertItemBefore(newItem: SVGNumber, index: number): SVGNumber; -} -declare var SVGNumberList: { - prototype: SVGNumberList; - new(): SVGNumberList; -} - -interface MediaError { - code: number; - msExtendedCode: number; - MEDIA_ERR_ABORTED: number; - MEDIA_ERR_NETWORK: number; - MEDIA_ERR_SRC_NOT_SUPPORTED: number; - MEDIA_ERR_DECODE: number; - MS_MEDIA_ERR_ENCRYPTED: number; -} -declare var MediaError: { - prototype: MediaError; - new(): MediaError; - MEDIA_ERR_ABORTED: number; - MEDIA_ERR_NETWORK: number; - MEDIA_ERR_SRC_NOT_SUPPORTED: number; - MEDIA_ERR_DECODE: number; - MS_MEDIA_ERR_ENCRYPTED: number; -} - -interface HTMLFieldSetElement extends HTMLElement { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - validationMessage: string; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - validity: ValidityState; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - willValidate: boolean; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; -} -declare var HTMLFieldSetElement: { - prototype: HTMLFieldSetElement; - new(): HTMLFieldSetElement; -} - -interface HTMLBGSoundElement extends HTMLElement { - /** - * Sets or gets the value indicating how the volume of the background sound is divided between the left speaker and the right speaker. - */ - balance: any; - /** - * Sets or gets the volume setting for the sound. - */ - volume: any; - /** - * Sets or gets the URL of a sound to play. - */ - src: string; - /** - * Sets or retrieves the number of times a sound or video clip will loop when activated. - */ - loop: number; -} -declare var HTMLBGSoundElement: { - prototype: HTMLBGSoundElement; - new(): HTMLBGSoundElement; -} - -interface Comment extends CharacterData { - text: string; -} -declare var Comment: { - prototype: Comment; - new(): Comment; -} - -interface PerformanceResourceTiming extends PerformanceEntry { - redirectStart: number; - redirectEnd: number; - domainLookupEnd: number; - responseStart: number; - domainLookupStart: number; - fetchStart: number; - requestStart: number; - connectEnd: number; - connectStart: number; - initiatorType: string; - responseEnd: number; -} -declare var PerformanceResourceTiming: { - prototype: PerformanceResourceTiming; - new(): PerformanceResourceTiming; -} - -interface CanvasPattern { -} -declare var CanvasPattern: { - prototype: CanvasPattern; - new(): CanvasPattern; -} - -interface HTMLHRElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty { - /** - * Sets or retrieves the width of the object. - */ - width: number; - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves whether the horizontal rule is drawn with 3-D shading. - */ - noShade: boolean; -} -declare var HTMLHRElement: { - prototype: HTMLHRElement; - new(): HTMLHRElement; -} - -interface HTMLObjectElement extends HTMLElement, GetSVGDocument, DOML2DeprecatedMarginStyle, DOML2DeprecatedBorderStyle, DOML2DeprecatedAlignmentStyle, MSDataBindingExtensions, MSDataBindingRecordSetExtensions { - /** - * Sets or retrieves the width of the object. - */ - width: string; - /** - * Sets or retrieves the Internet media type for the code associated with the object. - */ - codeType: string; - /** - * Retrieves the contained object. - */ - object: any; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Sets or retrieves the URL of the file containing the compiled Java class. - */ - code: string; - /** - * Sets or retrieves a character string that can be used to implement your own archive functionality for the object. - */ - archive: string; - /** - * Sets or retrieves a message to be displayed while an object is loading. - */ - standby: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Sets or retrieves the class identifier for the object. - */ - classid: string; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. - */ - useMap: string; - /** - * Sets or retrieves the URL that references the data of the object. - */ - data: string; - /** - * Sets or retrieves the height of the object. - */ - height: string; - /** - * Retrieves the document object of the page or frame. - */ - contentDocument: Document; - /** - * Gets or sets the optional alternative HTML script to execute if the object fails to load. - */ - altHtml: string; - /** - * Sets or retrieves the URL of the component. - */ - codeBase: string; - declare: boolean; - /** - * Sets or retrieves the MIME type of the object. - */ - type: string; - /** - * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element. - */ - BaseHref: string; - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - validationMessage: string; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - validity: ValidityState; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - willValidate: boolean; - /** - * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. - */ - msPlayToPreferredSourceUri: string; - /** - * Gets or sets the primary DLNA PlayTo device. - */ - msPlayToPrimary: boolean; - /** - * Gets or sets whether the DLNA PlayTo device is available. - */ - msPlayToDisabled: boolean; - readyState: number; - /** - * Gets the source associated with the media element for use by the PlayToManager. - */ - msPlayToSource: any; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; -} -declare var HTMLObjectElement: { - prototype: HTMLObjectElement; - new(): HTMLObjectElement; -} - -interface HTMLEmbedElement extends HTMLElement, GetSVGDocument { - /** - * Sets or retrieves the width of the object. - */ - width: string; - /** - * Retrieves the palette used for the embedded document. - */ - palette: string; - /** - * Sets or retrieves a URL to be loaded by the object. - */ - src: string; - /** - * Sets or retrieves the name of the object. - */ - name: string; - hidden: string; - /** - * Retrieves the URL of the plug-in used to view an embedded document. - */ - pluginspage: string; - /** - * Sets or retrieves the height of the object. - */ - height: string; - /** - * Sets or retrieves the height and width units of the embed object. - */ - units: string; - /** - * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. - */ - msPlayToPreferredSourceUri: string; - /** - * Gets or sets the primary DLNA PlayTo device. - */ - msPlayToPrimary: boolean; - /** - * Gets or sets whether the DLNA PlayTo device is available. - */ - msPlayToDisabled: boolean; - readyState: string; - /** - * Gets the source associated with the media element for use by the PlayToManager. - */ - msPlayToSource: any; -} -declare var HTMLEmbedElement: { - prototype: HTMLEmbedElement; - new(): HTMLEmbedElement; -} - -interface StorageEvent extends Event { - oldValue: any; - newValue: any; - url: string; - storageArea: Storage; - key: string; - initStorageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, keyArg: string, oldValueArg: any, newValueArg: any, urlArg: string, storageAreaArg: Storage): void; -} -declare var StorageEvent: { - prototype: StorageEvent; - new(): StorageEvent; -} - -interface CharacterData extends Node { - length: number; - data: string; - deleteData(offset: number, count: number): void; - replaceData(offset: number, count: number, arg: string): void; - appendData(arg: string): void; - insertData(offset: number, arg: string): void; - substringData(offset: number, count: number): string; -} -declare var CharacterData: { - prototype: CharacterData; - new(): CharacterData; -} - -interface HTMLOptGroupElement extends HTMLElement, MSDataBindingExtensions { - /** - * Sets or retrieves the ordinal position of an option in a list box. - */ - index: number; - /** - * Sets or retrieves the status of an option. - */ - defaultSelected: boolean; - /** - * Sets or retrieves the text string specified by the option tag. - */ - text: string; - /** - * Sets or retrieves the value which is returned to the server when the form control is submitted. - */ - value: string; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Sets or retrieves a value that you can use to implement your own label functionality for the object. - */ - label: string; - /** - * Sets or retrieves whether the option in the list box is the default item. - */ - selected: boolean; -} -declare var HTMLOptGroupElement: { - prototype: HTMLOptGroupElement; - new(): HTMLOptGroupElement; -} - -interface HTMLIsIndexElement extends HTMLElement { - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Sets or retrieves the URL to which the form content is sent for processing. - */ - action: string; - prompt: string; -} -declare var HTMLIsIndexElement: { - prototype: HTMLIsIndexElement; - new(): HTMLIsIndexElement; -} - -interface SVGPathSegLinetoRel extends SVGPathSeg { - y: number; - x: number; -} -declare var SVGPathSegLinetoRel: { - prototype: SVGPathSegLinetoRel; - new(): SVGPathSegLinetoRel; -} - -interface DOMException { - code: number; - message: string; - name: string; - toString(): string; - HIERARCHY_REQUEST_ERR: number; - NO_MODIFICATION_ALLOWED_ERR: number; - INVALID_MODIFICATION_ERR: number; - NAMESPACE_ERR: number; - INVALID_CHARACTER_ERR: number; - TYPE_MISMATCH_ERR: number; - ABORT_ERR: number; - INVALID_STATE_ERR: number; - SECURITY_ERR: number; - NETWORK_ERR: number; - WRONG_DOCUMENT_ERR: number; - QUOTA_EXCEEDED_ERR: number; - INDEX_SIZE_ERR: number; - DOMSTRING_SIZE_ERR: number; - SYNTAX_ERR: number; - SERIALIZE_ERR: number; - VALIDATION_ERR: number; - NOT_FOUND_ERR: number; - URL_MISMATCH_ERR: number; - PARSE_ERR: number; - NO_DATA_ALLOWED_ERR: number; - NOT_SUPPORTED_ERR: number; - INVALID_ACCESS_ERR: number; - INUSE_ATTRIBUTE_ERR: number; - INVALID_NODE_TYPE_ERR: number; - DATA_CLONE_ERR: number; - TIMEOUT_ERR: number; -} -declare var DOMException: { - prototype: DOMException; - new(): DOMException; - HIERARCHY_REQUEST_ERR: number; - NO_MODIFICATION_ALLOWED_ERR: number; - INVALID_MODIFICATION_ERR: number; - NAMESPACE_ERR: number; - INVALID_CHARACTER_ERR: number; - TYPE_MISMATCH_ERR: number; - ABORT_ERR: number; - INVALID_STATE_ERR: number; - SECURITY_ERR: number; - NETWORK_ERR: number; - WRONG_DOCUMENT_ERR: number; - QUOTA_EXCEEDED_ERR: number; - INDEX_SIZE_ERR: number; - DOMSTRING_SIZE_ERR: number; - SYNTAX_ERR: number; - SERIALIZE_ERR: number; - VALIDATION_ERR: number; - NOT_FOUND_ERR: number; - URL_MISMATCH_ERR: number; - PARSE_ERR: number; - NO_DATA_ALLOWED_ERR: number; - NOT_SUPPORTED_ERR: number; - INVALID_ACCESS_ERR: number; - INUSE_ATTRIBUTE_ERR: number; - INVALID_NODE_TYPE_ERR: number; - DATA_CLONE_ERR: number; - TIMEOUT_ERR: number; -} - -interface SVGAnimatedBoolean { - animVal: boolean; - baseVal: boolean; -} -declare var SVGAnimatedBoolean: { - prototype: SVGAnimatedBoolean; - new(): SVGAnimatedBoolean; -} - -interface MSCompatibleInfoCollection { - length: number; - item(index: number): MSCompatibleInfo; -} -declare var MSCompatibleInfoCollection: { - prototype: MSCompatibleInfoCollection; - new(): MSCompatibleInfoCollection; -} - -interface SVGSwitchElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { -} -declare var SVGSwitchElement: { - prototype: SVGSwitchElement; - new(): SVGSwitchElement; -} - -interface SVGPreserveAspectRatio { - align: number; - meetOrSlice: number; - SVG_PRESERVEASPECTRATIO_NONE: number; - SVG_PRESERVEASPECTRATIO_XMINYMID: number; - SVG_PRESERVEASPECTRATIO_XMAXYMIN: number; - SVG_PRESERVEASPECTRATIO_XMINYMAX: number; - SVG_PRESERVEASPECTRATIO_XMAXYMAX: number; - SVG_MEETORSLICE_UNKNOWN: number; - SVG_PRESERVEASPECTRATIO_XMAXYMID: number; - SVG_PRESERVEASPECTRATIO_XMIDYMAX: number; - SVG_PRESERVEASPECTRATIO_XMINYMIN: number; - SVG_MEETORSLICE_MEET: number; - SVG_PRESERVEASPECTRATIO_XMIDYMID: number; - SVG_PRESERVEASPECTRATIO_XMIDYMIN: number; - SVG_MEETORSLICE_SLICE: number; - SVG_PRESERVEASPECTRATIO_UNKNOWN: number; -} -declare var SVGPreserveAspectRatio: { - prototype: SVGPreserveAspectRatio; - new(): SVGPreserveAspectRatio; - SVG_PRESERVEASPECTRATIO_NONE: number; - SVG_PRESERVEASPECTRATIO_XMINYMID: number; - SVG_PRESERVEASPECTRATIO_XMAXYMIN: number; - SVG_PRESERVEASPECTRATIO_XMINYMAX: number; - SVG_PRESERVEASPECTRATIO_XMAXYMAX: number; - SVG_MEETORSLICE_UNKNOWN: number; - SVG_PRESERVEASPECTRATIO_XMAXYMID: number; - SVG_PRESERVEASPECTRATIO_XMIDYMAX: number; - SVG_PRESERVEASPECTRATIO_XMINYMIN: number; - SVG_MEETORSLICE_MEET: number; - SVG_PRESERVEASPECTRATIO_XMIDYMID: number; - SVG_PRESERVEASPECTRATIO_XMIDYMIN: number; - SVG_MEETORSLICE_SLICE: number; - SVG_PRESERVEASPECTRATIO_UNKNOWN: number; -} - -interface Attr extends Node { - expando: boolean; - specified: boolean; - ownerElement: Element; - value: string; - name: string; -} -declare var Attr: { - prototype: Attr; - new(): Attr; -} - -interface PerformanceNavigation { - redirectCount: number; - type: number; - toJSON(): any; - TYPE_RELOAD: number; - TYPE_RESERVED: number; - TYPE_BACK_FORWARD: number; - TYPE_NAVIGATE: number; -} -declare var PerformanceNavigation: { - prototype: PerformanceNavigation; - new(): PerformanceNavigation; - TYPE_RELOAD: number; - TYPE_RESERVED: number; - TYPE_BACK_FORWARD: number; - TYPE_NAVIGATE: number; -} - -interface SVGStopElement extends SVGElement, SVGStylable { - offset: SVGAnimatedNumber; -} -declare var SVGStopElement: { - prototype: SVGStopElement; - new(): SVGStopElement; -} - -interface PositionCallback { - (position: Position): void; -} - -interface SVGSymbolElement extends SVGElement, SVGStylable, SVGLangSpace, SVGFitToViewBox, SVGExternalResourcesRequired { -} -declare var SVGSymbolElement: { - prototype: SVGSymbolElement; - new(): SVGSymbolElement; -} - -interface SVGElementInstanceList { - length: number; - item(index: number): SVGElementInstance; -} -declare var SVGElementInstanceList: { - prototype: SVGElementInstanceList; - new(): SVGElementInstanceList; -} - -interface CSSRuleList { - length: number; - item(index: number): CSSRule; - [index: number]: CSSRule; -} -declare var CSSRuleList: { - prototype: CSSRuleList; - new(): CSSRuleList; -} - -interface MSDataBindingRecordSetExtensions { - recordset: any; - namedRecordset(dataMember: string, hierarchy?: any): any; -} - -interface LinkStyle { - styleSheet: StyleSheet; - sheet: StyleSheet; -} - -interface HTMLVideoElement extends HTMLMediaElement { - /** - * Gets or sets the width of the video element. - */ - width: number; - /** - * Gets the intrinsic width of a video in CSS pixels, or zero if the dimensions are not known. - */ - videoWidth: number; - /** - * Gets the intrinsic height of a video in CSS pixels, or zero if the dimensions are not known. - */ - videoHeight: number; - /** - * Gets or sets the height of the video element. - */ - height: number; - /** - * Gets or sets a URL of an image to display, for example, like a movie poster. This can be a still frame from the video, or another image if no video data is available. - */ - poster: string; - msIsStereo3D: boolean; - msStereo3DPackingMode: string; - onMSVideoOptimalLayoutChanged: (ev: any) => any; - onMSVideoFrameStepCompleted: (ev: any) => any; - msStereo3DRenderMode: string; - msIsLayoutOptimalForPlayback: boolean; - msHorizontalMirror: boolean; - onMSVideoFormatChanged: (ev: any) => any; - msZoom: boolean; - msInsertVideoEffect(activatableClassId: string, effectRequired: boolean, config?: any): void; - msSetVideoRectangle(left: number, top: number, right: number, bottom: number): void; - msFrameStep(forward: boolean): void; - getVideoPlaybackQuality(): VideoPlaybackQuality; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msneedkey", listener: (ev: MSMediaKeyNeededEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSVideoOptimalLayoutChanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "MSVideoFrameStepCompleted", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "MSVideoFormatChanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var HTMLVideoElement: { - prototype: HTMLVideoElement; - new(): HTMLVideoElement; -} - -interface ClientRectList { - length: number; - item(index: number): ClientRect; - [index: number]: ClientRect; -} -declare var ClientRectList: { - prototype: ClientRectList; - new(): ClientRectList; -} - -interface SVGMaskElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { - y: SVGAnimatedLength; - width: SVGAnimatedLength; - maskUnits: SVGAnimatedEnumeration; - maskContentUnits: SVGAnimatedEnumeration; - x: SVGAnimatedLength; - height: SVGAnimatedLength; -} -declare var SVGMaskElement: { - prototype: SVGMaskElement; - new(): SVGMaskElement; -} - -interface External { -} -declare var External: { - prototype: External; - new(): External; -} - -interface MSGestureEvent extends UIEvent { - offsetY: number; - translationY: number; - velocityExpansion: number; - velocityY: number; - velocityAngular: number; - translationX: number; - velocityX: number; - hwTimestamp: number; - offsetX: number; - screenX: number; - rotation: number; - expansion: number; - clientY: number; - screenY: number; - scale: number; - gestureObject: any; - clientX: number; - initGestureEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, offsetXArg: number, offsetYArg: number, translationXArg: number, translationYArg: number, scaleArg: number, expansionArg: number, rotationArg: number, velocityXArg: number, velocityYArg: number, velocityExpansionArg: number, velocityAngularArg: number, hwTimestampArg: number): void; - MSGESTURE_FLAG_BEGIN: number; - MSGESTURE_FLAG_END: number; - MSGESTURE_FLAG_CANCEL: number; - MSGESTURE_FLAG_INERTIA: number; - MSGESTURE_FLAG_NONE: number; -} -declare var MSGestureEvent: { - prototype: MSGestureEvent; - new(): MSGestureEvent; - MSGESTURE_FLAG_BEGIN: number; - MSGESTURE_FLAG_END: number; - MSGESTURE_FLAG_CANCEL: number; - MSGESTURE_FLAG_INERTIA: number; - MSGESTURE_FLAG_NONE: number; -} - -interface ErrorEvent extends Event { - colno: number; - filename: string; - error: any; - lineno: number; - message: string; - initErrorEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, messageArg: string, filenameArg: string, linenoArg: number): void; -} -declare var ErrorEvent: { - prototype: ErrorEvent; - new(): ErrorEvent; -} - -interface SVGFilterElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGLangSpace, SVGURIReference, SVGExternalResourcesRequired { - y: SVGAnimatedLength; - width: SVGAnimatedLength; - filterResX: SVGAnimatedInteger; - filterUnits: SVGAnimatedEnumeration; - primitiveUnits: SVGAnimatedEnumeration; - x: SVGAnimatedLength; - height: SVGAnimatedLength; - filterResY: SVGAnimatedInteger; - setFilterRes(filterResX: number, filterResY: number): void; -} -declare var SVGFilterElement: { - prototype: SVGFilterElement; - new(): SVGFilterElement; -} - -interface TrackEvent extends Event { - track: any; -} -declare var TrackEvent: { - prototype: TrackEvent; - new(): TrackEvent; -} - -interface SVGFEMergeNodeElement extends SVGElement { - in1: SVGAnimatedString; -} -declare var SVGFEMergeNodeElement: { - prototype: SVGFEMergeNodeElement; - new(): SVGFEMergeNodeElement; -} - -interface SVGFEFloodElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { -} -declare var SVGFEFloodElement: { - prototype: SVGFEFloodElement; - new(): SVGFEFloodElement; -} - -interface MSGesture { - target: Element; - addPointer(pointerId: number): void; - stop(): void; -} -declare var MSGesture: { - prototype: MSGesture; - new(): MSGesture; -} - -interface TextTrackCue extends EventTarget { - onenter: (ev: Event) => any; - track: TextTrack; - endTime: number; - text: string; - pauseOnExit: boolean; - id: string; - startTime: number; - onexit: (ev: Event) => any; - getCueAsHTML(): DocumentFragment; - addEventListener(type: "enter", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "exit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var TextTrackCue: { - prototype: TextTrackCue; - new(startTime: number, endTime: number, text: string): TextTrackCue; -} - -interface MSStreamReader extends MSBaseReader { - error: DOMError; - readAsArrayBuffer(stream: MSStream, size?: number): void; - readAsBlob(stream: MSStream, size?: number): void; - readAsDataURL(stream: MSStream, size?: number): void; - readAsText(stream: MSStream, encoding?: string, size?: number): void; -} -declare var MSStreamReader: { - prototype: MSStreamReader; - new(): MSStreamReader; -} - -interface DOMTokenList { - length: number; - contains(token: string): boolean; - remove(token: string): void; - toggle(token: string): boolean; - add(token: string): void; - item(index: number): string; - [index: number]: string; - toString(): string; -} -declare var DOMTokenList: { - prototype: DOMTokenList; - new(): DOMTokenList; -} - -interface SVGFEFuncAElement extends SVGComponentTransferFunctionElement { -} -declare var SVGFEFuncAElement: { - prototype: SVGFEFuncAElement; - new(): SVGFEFuncAElement; -} - -interface SVGFETileElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - in1: SVGAnimatedString; -} -declare var SVGFETileElement: { - prototype: SVGFETileElement; - new(): SVGFETileElement; -} - -interface SVGFEBlendElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - in2: SVGAnimatedString; - mode: SVGAnimatedEnumeration; - in1: SVGAnimatedString; - SVG_FEBLEND_MODE_DARKEN: number; - SVG_FEBLEND_MODE_UNKNOWN: number; - SVG_FEBLEND_MODE_MULTIPLY: number; - SVG_FEBLEND_MODE_NORMAL: number; - SVG_FEBLEND_MODE_SCREEN: number; - SVG_FEBLEND_MODE_LIGHTEN: number; -} -declare var SVGFEBlendElement: { - prototype: SVGFEBlendElement; - new(): SVGFEBlendElement; - SVG_FEBLEND_MODE_DARKEN: number; - SVG_FEBLEND_MODE_UNKNOWN: number; - SVG_FEBLEND_MODE_MULTIPLY: number; - SVG_FEBLEND_MODE_NORMAL: number; - SVG_FEBLEND_MODE_SCREEN: number; - SVG_FEBLEND_MODE_LIGHTEN: number; -} - -interface MessageChannel { - port2: MessagePort; - port1: MessagePort; -} -declare var MessageChannel: { - prototype: MessageChannel; - new(): MessageChannel; -} - -interface SVGFEMergeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { -} -declare var SVGFEMergeElement: { - prototype: SVGFEMergeElement; - new(): SVGFEMergeElement; -} - -interface TransitionEvent extends Event { - propertyName: string; - elapsedTime: number; - initTransitionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, propertyNameArg: string, elapsedTimeArg: number): void; -} -declare var TransitionEvent: { - prototype: TransitionEvent; - new(): TransitionEvent; -} - -interface MediaQueryList { - matches: boolean; - media: string; - addListener(listener: MediaQueryListListener): void; - removeListener(listener: MediaQueryListListener): void; -} -declare var MediaQueryList: { - prototype: MediaQueryList; - new(): MediaQueryList; -} - -interface DOMError { - name: string; - toString(): string; -} -declare var DOMError: { - prototype: DOMError; - new(): DOMError; -} - -interface CloseEvent extends Event { - wasClean: boolean; - reason: string; - code: number; - initCloseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, wasCleanArg: boolean, codeArg: number, reasonArg: string): void; -} -declare var CloseEvent: { - prototype: CloseEvent; - new(): CloseEvent; -} - -interface WebSocket extends EventTarget { - protocol: string; - readyState: number; - bufferedAmount: number; - onopen: (ev: Event) => any; - extensions: string; - onmessage: (ev: MessageEvent) => any; - onclose: (ev: CloseEvent) => any; - onerror: (ev: ErrorEvent) => any; - binaryType: string; - url: string; - close(code?: number, reason?: string): void; - send(data: any): void; - OPEN: number; - CLOSING: number; - CONNECTING: number; - CLOSED: number; - addEventListener(type: "open", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "close", listener: (ev: CloseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var WebSocket: { - prototype: WebSocket; - new(url: string, protocols?: string): WebSocket; - new(url: string, protocols?: string[]): WebSocket; - OPEN: number; - CLOSING: number; - CONNECTING: number; - CLOSED: number; -} - -interface SVGFEPointLightElement extends SVGElement { - y: SVGAnimatedNumber; - x: SVGAnimatedNumber; - z: SVGAnimatedNumber; -} -declare var SVGFEPointLightElement: { - prototype: SVGFEPointLightElement; - new(): SVGFEPointLightElement; -} - -interface ProgressEvent extends Event { - loaded: number; - lengthComputable: boolean; - total: number; - initProgressEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, lengthComputableArg: boolean, loadedArg: number, totalArg: number): void; -} -declare var ProgressEvent: { - prototype: ProgressEvent; - new(): ProgressEvent; -} - -interface IDBObjectStore { - indexNames: DOMStringList; - name: string; - transaction: IDBTransaction; - keyPath: string; - count(key?: any): IDBRequest; - add(value: any, key?: any): IDBRequest; - clear(): IDBRequest; - createIndex(name: string, keyPath: string, optionalParameters?: any): IDBIndex; - put(value: any, key?: any): IDBRequest; - openCursor(range?: any, direction?: string): IDBRequest; - deleteIndex(indexName: string): void; - index(name: string): IDBIndex; - get(key: any): IDBRequest; - delete(key: any): IDBRequest; -} -declare var IDBObjectStore: { - prototype: IDBObjectStore; - new(): IDBObjectStore; -} - -interface SVGFEGaussianBlurElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - stdDeviationX: SVGAnimatedNumber; - in1: SVGAnimatedString; - stdDeviationY: SVGAnimatedNumber; - setStdDeviation(stdDeviationX: number, stdDeviationY: number): void; -} -declare var SVGFEGaussianBlurElement: { - prototype: SVGFEGaussianBlurElement; - new(): SVGFEGaussianBlurElement; -} - -interface SVGFilterPrimitiveStandardAttributes extends SVGStylable { - y: SVGAnimatedLength; - width: SVGAnimatedLength; - x: SVGAnimatedLength; - height: SVGAnimatedLength; - result: SVGAnimatedString; -} - -interface IDBVersionChangeEvent extends Event { - newVersion: number; - oldVersion: number; -} -declare var IDBVersionChangeEvent: { - prototype: IDBVersionChangeEvent; - new(): IDBVersionChangeEvent; -} - -interface IDBIndex { - unique: boolean; - name: string; - keyPath: string; - objectStore: IDBObjectStore; - count(key?: any): IDBRequest; - getKey(key: any): IDBRequest; - openKeyCursor(range?: IDBKeyRange, direction?: string): IDBRequest; - get(key: any): IDBRequest; - openCursor(range?: IDBKeyRange, direction?: string): IDBRequest; -} -declare var IDBIndex: { - prototype: IDBIndex; - new(): IDBIndex; -} - -interface FileList { - length: number; - item(index: number): File; - [index: number]: File; -} -declare var FileList: { - prototype: FileList; - new(): FileList; -} - -interface IDBCursor { - source: any; - direction: string; - key: any; - primaryKey: any; - advance(count: number): void; - delete(): IDBRequest; - continue(key?: any): void; - update(value: any): IDBRequest; - PREV: string; - PREV_NO_DUPLICATE: string; - NEXT: string; - NEXT_NO_DUPLICATE: string; -} -declare var IDBCursor: { - prototype: IDBCursor; - new(): IDBCursor; - PREV: string; - PREV_NO_DUPLICATE: string; - NEXT: string; - NEXT_NO_DUPLICATE: string; -} - -interface SVGFESpecularLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - kernelUnitLengthY: SVGAnimatedNumber; - surfaceScale: SVGAnimatedNumber; - specularExponent: SVGAnimatedNumber; - in1: SVGAnimatedString; - kernelUnitLengthX: SVGAnimatedNumber; - specularConstant: SVGAnimatedNumber; -} -declare var SVGFESpecularLightingElement: { - prototype: SVGFESpecularLightingElement; - new(): SVGFESpecularLightingElement; -} - -interface File extends Blob { - lastModifiedDate: any; - name: string; -} -declare var File: { - prototype: File; - new(): File; -} - -interface URL { - revokeObjectURL(url: string): void; - createObjectURL(object: any, options?: ObjectURLOptions): string; -} -declare var URL: URL; - -interface IDBCursorWithValue extends IDBCursor { - value: any; -} -declare var IDBCursorWithValue: { - prototype: IDBCursorWithValue; - new(): IDBCursorWithValue; -} - -interface XMLHttpRequestEventTarget extends EventTarget { - onprogress: (ev: ProgressEvent) => any; - onerror: (ev: ErrorEvent) => any; - onload: (ev: Event) => any; - ontimeout: (ev: Event) => any; - onabort: (ev: UIEvent) => any; - onloadstart: (ev: Event) => any; - onloadend: (ev: ProgressEvent) => any; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "timeout", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var XMLHttpRequestEventTarget: { - prototype: XMLHttpRequestEventTarget; - new(): XMLHttpRequestEventTarget; -} - -interface IDBEnvironment { - msIndexedDB: IDBFactory; - indexedDB: IDBFactory; -} - -interface AudioTrackList extends EventTarget { - length: number; - onchange: (ev: Event) => any; - onaddtrack: (ev: TrackEvent) => any; - onremovetrack: (ev: any /*PluginArray*/) => any; - getTrackById(id: string): AudioTrack; - item(index: number): AudioTrack; - [index: number]: AudioTrack; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "addtrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void; - addEventListener(type: "removetrack", listener: (ev: any /*PluginArray*/) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var AudioTrackList: { - prototype: AudioTrackList; - new(): AudioTrackList; -} - -interface MSBaseReader extends EventTarget { - onprogress: (ev: ProgressEvent) => any; - readyState: number; - onabort: (ev: UIEvent) => any; - onloadend: (ev: ProgressEvent) => any; - onerror: (ev: ErrorEvent) => any; - onload: (ev: Event) => any; - onloadstart: (ev: Event) => any; - result: any; - abort(): void; - LOADING: number; - EMPTY: number; - DONE: number; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface SVGFEMorphologyElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - operator: SVGAnimatedEnumeration; - radiusX: SVGAnimatedNumber; - radiusY: SVGAnimatedNumber; - in1: SVGAnimatedString; - SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number; - SVG_MORPHOLOGY_OPERATOR_ERODE: number; - SVG_MORPHOLOGY_OPERATOR_DILATE: number; -} -declare var SVGFEMorphologyElement: { - prototype: SVGFEMorphologyElement; - new(): SVGFEMorphologyElement; - SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number; - SVG_MORPHOLOGY_OPERATOR_ERODE: number; - SVG_MORPHOLOGY_OPERATOR_DILATE: number; -} - -interface SVGFEFuncRElement extends SVGComponentTransferFunctionElement { -} -declare var SVGFEFuncRElement: { - prototype: SVGFEFuncRElement; - new(): SVGFEFuncRElement; -} - -interface WindowTimersExtension { - msSetImmediate(expression: any, ...args: any[]): number; - clearImmediate(handle: number): void; - msClearImmediate(handle: number): void; - setImmediate(expression: any, ...args: any[]): number; -} - -interface SVGFEDisplacementMapElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - in2: SVGAnimatedString; - xChannelSelector: SVGAnimatedEnumeration; - yChannelSelector: SVGAnimatedEnumeration; - scale: SVGAnimatedNumber; - in1: SVGAnimatedString; - SVG_CHANNEL_B: number; - SVG_CHANNEL_R: number; - SVG_CHANNEL_G: number; - SVG_CHANNEL_UNKNOWN: number; - SVG_CHANNEL_A: number; -} -declare var SVGFEDisplacementMapElement: { - prototype: SVGFEDisplacementMapElement; - new(): SVGFEDisplacementMapElement; - SVG_CHANNEL_B: number; - SVG_CHANNEL_R: number; - SVG_CHANNEL_G: number; - SVG_CHANNEL_UNKNOWN: number; - SVG_CHANNEL_A: number; -} - -interface AnimationEvent extends Event { - animationName: string; - elapsedTime: number; - initAnimationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, animationNameArg: string, elapsedTimeArg: number): void; -} -declare var AnimationEvent: { - prototype: AnimationEvent; - new(): AnimationEvent; -} - -interface SVGComponentTransferFunctionElement extends SVGElement { - tableValues: SVGAnimatedNumberList; - slope: SVGAnimatedNumber; - type: SVGAnimatedEnumeration; - exponent: SVGAnimatedNumber; - amplitude: SVGAnimatedNumber; - intercept: SVGAnimatedNumber; - offset: SVGAnimatedNumber; - SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number; - SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number; - SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number; - SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number; - SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number; - SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number; -} -declare var SVGComponentTransferFunctionElement: { - prototype: SVGComponentTransferFunctionElement; - new(): SVGComponentTransferFunctionElement; - SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number; - SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number; - SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number; - SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number; - SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number; - SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number; -} - -interface MSRangeCollection { - length: number; - item(index: number): Range; - [index: number]: Range; -} -declare var MSRangeCollection: { - prototype: MSRangeCollection; - new(): MSRangeCollection; -} - -interface SVGFEDistantLightElement extends SVGElement { - azimuth: SVGAnimatedNumber; - elevation: SVGAnimatedNumber; -} -declare var SVGFEDistantLightElement: { - prototype: SVGFEDistantLightElement; - new(): SVGFEDistantLightElement; -} - -interface SVGFEFuncBElement extends SVGComponentTransferFunctionElement { -} -declare var SVGFEFuncBElement: { - prototype: SVGFEFuncBElement; - new(): SVGFEFuncBElement; -} - -interface IDBKeyRange { - upper: any; - upperOpen: boolean; - lower: any; - lowerOpen: boolean; -} -declare var IDBKeyRange: { - prototype: IDBKeyRange; - new(): IDBKeyRange; - bound(lower: any, upper: any, lowerOpen?: boolean, upperOpen?: boolean): IDBKeyRange; - only(value: any): IDBKeyRange; - lowerBound(bound: any, open?: boolean): IDBKeyRange; - upperBound(bound: any, open?: boolean): IDBKeyRange; -} - -interface WindowConsole { - console: Console; -} - -interface IDBTransaction extends EventTarget { - oncomplete: (ev: Event) => any; - db: IDBDatabase; - mode: string; - error: DOMError; - onerror: (ev: ErrorEvent) => any; - onabort: (ev: UIEvent) => any; - abort(): void; - objectStore(name: string): IDBObjectStore; - READ_ONLY: string; - VERSION_CHANGE: string; - READ_WRITE: string; - addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var IDBTransaction: { - prototype: IDBTransaction; - new(): IDBTransaction; - READ_ONLY: string; - VERSION_CHANGE: string; - READ_WRITE: string; -} - -interface AudioTrack { - kind: string; - language: string; - id: string; - label: string; - enabled: boolean; - sourceBuffer: SourceBuffer; -} -declare var AudioTrack: { - prototype: AudioTrack; - new(): AudioTrack; -} - -interface SVGFEConvolveMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - orderY: SVGAnimatedInteger; - kernelUnitLengthY: SVGAnimatedNumber; - orderX: SVGAnimatedInteger; - preserveAlpha: SVGAnimatedBoolean; - kernelMatrix: SVGAnimatedNumberList; - edgeMode: SVGAnimatedEnumeration; - kernelUnitLengthX: SVGAnimatedNumber; - bias: SVGAnimatedNumber; - targetX: SVGAnimatedInteger; - targetY: SVGAnimatedInteger; - divisor: SVGAnimatedNumber; - in1: SVGAnimatedString; - SVG_EDGEMODE_WRAP: number; - SVG_EDGEMODE_DUPLICATE: number; - SVG_EDGEMODE_UNKNOWN: number; - SVG_EDGEMODE_NONE: number; -} -declare var SVGFEConvolveMatrixElement: { - prototype: SVGFEConvolveMatrixElement; - new(): SVGFEConvolveMatrixElement; - SVG_EDGEMODE_WRAP: number; - SVG_EDGEMODE_DUPLICATE: number; - SVG_EDGEMODE_UNKNOWN: number; - SVG_EDGEMODE_NONE: number; -} - -interface TextTrackCueList { - length: number; - item(index: number): TextTrackCue; - [index: number]: TextTrackCue; - getCueById(id: string): TextTrackCue; -} -declare var TextTrackCueList: { - prototype: TextTrackCueList; - new(): TextTrackCueList; -} - -interface CSSKeyframesRule extends CSSRule { - name: string; - cssRules: CSSRuleList; - findRule(rule: string): CSSKeyframeRule; - deleteRule(rule: string): void; - appendRule(rule: string): void; -} -declare var CSSKeyframesRule: { - prototype: CSSKeyframesRule; - new(): CSSKeyframesRule; -} - -interface SVGFETurbulenceElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - baseFrequencyX: SVGAnimatedNumber; - numOctaves: SVGAnimatedInteger; - type: SVGAnimatedEnumeration; - baseFrequencyY: SVGAnimatedNumber; - stitchTiles: SVGAnimatedEnumeration; - seed: SVGAnimatedNumber; - SVG_STITCHTYPE_UNKNOWN: number; - SVG_STITCHTYPE_NOSTITCH: number; - SVG_TURBULENCE_TYPE_UNKNOWN: number; - SVG_TURBULENCE_TYPE_TURBULENCE: number; - SVG_TURBULENCE_TYPE_FRACTALNOISE: number; - SVG_STITCHTYPE_STITCH: number; -} -declare var SVGFETurbulenceElement: { - prototype: SVGFETurbulenceElement; - new(): SVGFETurbulenceElement; - SVG_STITCHTYPE_UNKNOWN: number; - SVG_STITCHTYPE_NOSTITCH: number; - SVG_TURBULENCE_TYPE_UNKNOWN: number; - SVG_TURBULENCE_TYPE_TURBULENCE: number; - SVG_TURBULENCE_TYPE_FRACTALNOISE: number; - SVG_STITCHTYPE_STITCH: number; -} - -interface TextTrackList extends EventTarget { - length: number; - onaddtrack: (ev: TrackEvent) => any; - item(index: number): TextTrack; - [index: number]: TextTrack; - addEventListener(type: "addtrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var TextTrackList: { - prototype: TextTrackList; - new(): TextTrackList; -} - -interface SVGFEFuncGElement extends SVGComponentTransferFunctionElement { -} -declare var SVGFEFuncGElement: { - prototype: SVGFEFuncGElement; - new(): SVGFEFuncGElement; -} - -interface SVGFEColorMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - in1: SVGAnimatedString; - type: SVGAnimatedEnumeration; - values: SVGAnimatedNumberList; - SVG_FECOLORMATRIX_TYPE_SATURATE: number; - SVG_FECOLORMATRIX_TYPE_UNKNOWN: number; - SVG_FECOLORMATRIX_TYPE_MATRIX: number; - SVG_FECOLORMATRIX_TYPE_HUEROTATE: number; - SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number; -} -declare var SVGFEColorMatrixElement: { - prototype: SVGFEColorMatrixElement; - new(): SVGFEColorMatrixElement; - SVG_FECOLORMATRIX_TYPE_SATURATE: number; - SVG_FECOLORMATRIX_TYPE_UNKNOWN: number; - SVG_FECOLORMATRIX_TYPE_MATRIX: number; - SVG_FECOLORMATRIX_TYPE_HUEROTATE: number; - SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number; -} - -interface SVGFESpotLightElement extends SVGElement { - pointsAtY: SVGAnimatedNumber; - y: SVGAnimatedNumber; - limitingConeAngle: SVGAnimatedNumber; - specularExponent: SVGAnimatedNumber; - x: SVGAnimatedNumber; - pointsAtZ: SVGAnimatedNumber; - z: SVGAnimatedNumber; - pointsAtX: SVGAnimatedNumber; -} -declare var SVGFESpotLightElement: { - prototype: SVGFESpotLightElement; - new(): SVGFESpotLightElement; -} - -interface WindowBase64 { - btoa(rawString: string): string; - atob(encodedString: string): string; -} - -interface IDBDatabase extends EventTarget { - version: string; - name: string; - objectStoreNames: DOMStringList; - onerror: (ev: ErrorEvent) => any; - onabort: (ev: UIEvent) => any; - createObjectStore(name: string, optionalParameters?: any): IDBObjectStore; - close(): void; - transaction(storeNames: any, mode?: string): IDBTransaction; - deleteObjectStore(name: string): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var IDBDatabase: { - prototype: IDBDatabase; - new(): IDBDatabase; -} - -interface DOMStringList { - length: number; - contains(str: string): boolean; - item(index: number): string; - [index: number]: string; -} -declare var DOMStringList: { - prototype: DOMStringList; - new(): DOMStringList; -} - -interface IDBOpenDBRequest extends IDBRequest { - onupgradeneeded: (ev: IDBVersionChangeEvent) => any; - onblocked: (ev: Event) => any; - addEventListener(type: "success", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "upgradeneeded", listener: (ev: IDBVersionChangeEvent) => any, useCapture?: boolean): void; - addEventListener(type: "blocked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var IDBOpenDBRequest: { - prototype: IDBOpenDBRequest; - new(): IDBOpenDBRequest; -} - -interface HTMLProgressElement extends HTMLElement { - /** - * Sets or gets the current value of a progress element. The value must be a non-negative number between 0 and the max value. - */ - value: number; - /** - * Defines the maximum, or "done" value for a progress element. - */ - max: number; - /** - * Returns the quotient of value/max when the value attribute is set (determinate progress bar), or -1 when the value attribute is missing (indeterminate progress bar). - */ - position: number; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; -} -declare var HTMLProgressElement: { - prototype: HTMLProgressElement; - new(): HTMLProgressElement; -} - -interface MSLaunchUriCallback { - (): void; -} - -interface SVGFEOffsetElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - dy: SVGAnimatedNumber; - in1: SVGAnimatedString; - dx: SVGAnimatedNumber; -} -declare var SVGFEOffsetElement: { - prototype: SVGFEOffsetElement; - new(): SVGFEOffsetElement; -} - -interface MSUnsafeFunctionCallback { - (): any; -} - -interface TextTrack extends EventTarget { - language: string; - mode: any; - readyState: number; - activeCues: TextTrackCueList; - cues: TextTrackCueList; - oncuechange: (ev: Event) => any; - kind: string; - onload: (ev: Event) => any; - onerror: (ev: ErrorEvent) => any; - label: string; - addCue(cue: TextTrackCue): void; - removeCue(cue: TextTrackCue): void; - ERROR: number; - SHOWING: number; - LOADING: number; - LOADED: number; - NONE: number; - HIDDEN: number; - DISABLED: number; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var TextTrack: { - prototype: TextTrack; - new(): TextTrack; - ERROR: number; - SHOWING: number; - LOADING: number; - LOADED: number; - NONE: number; - HIDDEN: number; - DISABLED: number; -} - -interface MediaQueryListListener { - (mql: MediaQueryList): void; -} - -interface IDBRequest extends EventTarget { - source: any; - onsuccess: (ev: Event) => any; - error: DOMError; - transaction: IDBTransaction; - onerror: (ev: ErrorEvent) => any; - readyState: string; - result: any; - addEventListener(type: "success", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var IDBRequest: { - prototype: IDBRequest; - new(): IDBRequest; -} - -interface MessagePort extends EventTarget { - onmessage: (ev: MessageEvent) => any; - close(): void; - postMessage(message?: any, ports?: any): void; - start(): void; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var MessagePort: { - prototype: MessagePort; - new(): MessagePort; -} - -interface FileReader extends MSBaseReader { - error: DOMError; - readAsArrayBuffer(blob: Blob): void; - readAsDataURL(blob: Blob): void; - readAsText(blob: Blob, encoding?: string): void; -} -declare var FileReader: { - prototype: FileReader; - new(): FileReader; -} - -interface ApplicationCache extends EventTarget { - status: number; - ondownloading: (ev: Event) => any; - onprogress: (ev: ProgressEvent) => any; - onupdateready: (ev: Event) => any; - oncached: (ev: Event) => any; - onobsolete: (ev: Event) => any; - onerror: (ev: ErrorEvent) => any; - onchecking: (ev: Event) => any; - onnoupdate: (ev: Event) => any; - swapCache(): void; - abort(): void; - update(): void; - CHECKING: number; - UNCACHED: number; - UPDATEREADY: number; - DOWNLOADING: number; - IDLE: number; - OBSOLETE: number; - addEventListener(type: "downloading", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "updateready", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cached", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "obsolete", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "checking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "noupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var ApplicationCache: { - prototype: ApplicationCache; - new(): ApplicationCache; - CHECKING: number; - UNCACHED: number; - UPDATEREADY: number; - DOWNLOADING: number; - IDLE: number; - OBSOLETE: number; -} - -interface FrameRequestCallback { - (time: number): void; -} - -interface PopStateEvent extends Event { - state: any; - initPopStateEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, stateArg: any): void; -} -declare var PopStateEvent: { - prototype: PopStateEvent; - new(): PopStateEvent; -} - -interface CSSKeyframeRule extends CSSRule { - keyText: string; - style: CSSStyleDeclaration; -} -declare var CSSKeyframeRule: { - prototype: CSSKeyframeRule; - new(): CSSKeyframeRule; -} - -interface MSFileSaver { - msSaveBlob(blob: any, defaultName?: string): boolean; - msSaveOrOpenBlob(blob: any, defaultName?: string): boolean; -} - -interface MSStream { - type: string; - msDetachStream(): any; - msClose(): void; -} -declare var MSStream: { - prototype: MSStream; - new(): MSStream; -} - -interface MSBlobBuilder { - append(data: any, endings?: string): void; - getBlob(contentType?: string): Blob; -} -declare var MSBlobBuilder: { - prototype: MSBlobBuilder; - new(): MSBlobBuilder; -} - -interface DOMSettableTokenList extends DOMTokenList { - value: string; -} -declare var DOMSettableTokenList: { - prototype: DOMSettableTokenList; - new(): DOMSettableTokenList; -} - -interface IDBFactory { - open(name: string, version?: number): IDBOpenDBRequest; - cmp(first: any, second: any): number; - deleteDatabase(name: string): IDBOpenDBRequest; -} -declare var IDBFactory: { - prototype: IDBFactory; - new(): IDBFactory; -} - -interface MSPointerEvent extends MouseEvent { - width: number; - rotation: number; - pressure: number; - pointerType: any; - isPrimary: boolean; - tiltY: number; - height: number; - intermediatePoints: any; - currentPoint: any; - tiltX: number; - hwTimestamp: number; - pointerId: number; - initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void; - getCurrentPoint(element: Element): void; - getIntermediatePoints(element: Element): void; - MSPOINTER_TYPE_PEN: number; - MSPOINTER_TYPE_MOUSE: number; - MSPOINTER_TYPE_TOUCH: number; -} -declare var MSPointerEvent: { - prototype: MSPointerEvent; - new(): MSPointerEvent; - MSPOINTER_TYPE_PEN: number; - MSPOINTER_TYPE_MOUSE: number; - MSPOINTER_TYPE_TOUCH: number; -} - -interface MSManipulationEvent extends UIEvent { - lastState: number; - currentState: number; - initMSManipulationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, lastState: number, currentState: number): void; - MS_MANIPULATION_STATE_STOPPED: number; - MS_MANIPULATION_STATE_ACTIVE: number; - MS_MANIPULATION_STATE_INERTIA: number; - MS_MANIPULATION_STATE_SELECTING: number; - MS_MANIPULATION_STATE_COMMITTED: number; - MS_MANIPULATION_STATE_PRESELECT: number; - MS_MANIPULATION_STATE_DRAGGING: number; - MS_MANIPULATION_STATE_CANCELLED: number; -} -declare var MSManipulationEvent: { - prototype: MSManipulationEvent; - new(): MSManipulationEvent; - MS_MANIPULATION_STATE_STOPPED: number; - MS_MANIPULATION_STATE_ACTIVE: number; - MS_MANIPULATION_STATE_INERTIA: number; - MS_MANIPULATION_STATE_SELECTING: number; - MS_MANIPULATION_STATE_COMMITTED: number; - MS_MANIPULATION_STATE_PRESELECT: number; - MS_MANIPULATION_STATE_DRAGGING: number; - MS_MANIPULATION_STATE_CANCELLED: number; -} - -interface FormData { - append(name: any, value: any, blobName?: string): void; -} -declare var FormData: { - prototype: FormData; - new(): FormData; -} - -interface HTMLDataListElement extends HTMLElement { - options: HTMLCollection; -} -declare var HTMLDataListElement: { - prototype: HTMLDataListElement; - new(): HTMLDataListElement; -} - -interface SVGFEImageElement extends SVGElement, SVGLangSpace, SVGFilterPrimitiveStandardAttributes, SVGURIReference, SVGExternalResourcesRequired { - preserveAspectRatio: SVGAnimatedPreserveAspectRatio; -} -declare var SVGFEImageElement: { - prototype: SVGFEImageElement; - new(): SVGFEImageElement; -} - -interface AbstractWorker extends EventTarget { - onerror: (ev: ErrorEvent) => any; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface SVGFECompositeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - operator: SVGAnimatedEnumeration; - in2: SVGAnimatedString; - k2: SVGAnimatedNumber; - k1: SVGAnimatedNumber; - k3: SVGAnimatedNumber; - in1: SVGAnimatedString; - k4: SVGAnimatedNumber; - SVG_FECOMPOSITE_OPERATOR_OUT: number; - SVG_FECOMPOSITE_OPERATOR_OVER: number; - SVG_FECOMPOSITE_OPERATOR_XOR: number; - SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number; - SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number; - SVG_FECOMPOSITE_OPERATOR_IN: number; - SVG_FECOMPOSITE_OPERATOR_ATOP: number; -} -declare var SVGFECompositeElement: { - prototype: SVGFECompositeElement; - new(): SVGFECompositeElement; - SVG_FECOMPOSITE_OPERATOR_OUT: number; - SVG_FECOMPOSITE_OPERATOR_OVER: number; - SVG_FECOMPOSITE_OPERATOR_XOR: number; - SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number; - SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number; - SVG_FECOMPOSITE_OPERATOR_IN: number; - SVG_FECOMPOSITE_OPERATOR_ATOP: number; -} - -interface ValidityState { - customError: boolean; - valueMissing: boolean; - stepMismatch: boolean; - rangeUnderflow: boolean; - rangeOverflow: boolean; - typeMismatch: boolean; - patternMismatch: boolean; - tooLong: boolean; - valid: boolean; -} -declare var ValidityState: { - prototype: ValidityState; - new(): ValidityState; -} - -interface HTMLTrackElement extends HTMLElement { - kind: string; - src: string; - srclang: string; - track: TextTrack; - label: string; - default: boolean; - readyState: number; - ERROR: number; - LOADING: number; - LOADED: number; - NONE: number; -} -declare var HTMLTrackElement: { - prototype: HTMLTrackElement; - new(): HTMLTrackElement; - ERROR: number; - LOADING: number; - LOADED: number; - NONE: number; -} - -interface MSApp { - createFileFromStorageFile(storageFile: any): File; - createBlobFromRandomAccessStream(type: string, seeker: any): Blob; - createStreamFromInputStream(type: string, inputStream: any): MSStream; - terminateApp(exceptionObject: any): void; - createDataPackage(object: any): any; - execUnsafeLocalFunction(unsafeFunction: MSUnsafeFunctionCallback): any; - getHtmlPrintDocumentSource(htmlDoc: any): any; - addPublicLocalApplicationUri(uri: string): void; - createDataPackageFromSelection(): any; - getViewOpener(): MSAppView; - suppressSubdownloadCredentialPrompts(suppress: boolean): void; - execAsyncAtPriority(asynchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): void; - isTaskScheduledAtPriorityOrHigher(priority: string): boolean; - execAtPriority(synchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): any; - createNewView(uri: string): MSAppView; - getCurrentPriority(): string; - NORMAL: string; - HIGH: string; - IDLE: string; - CURRENT: string; -} -declare var MSApp: MSApp; - -interface SVGFEComponentTransferElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - in1: SVGAnimatedString; -} -declare var SVGFEComponentTransferElement: { - prototype: SVGFEComponentTransferElement; - new(): SVGFEComponentTransferElement; -} - -interface SVGFEDiffuseLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - kernelUnitLengthY: SVGAnimatedNumber; - surfaceScale: SVGAnimatedNumber; - in1: SVGAnimatedString; - kernelUnitLengthX: SVGAnimatedNumber; - diffuseConstant: SVGAnimatedNumber; -} -declare var SVGFEDiffuseLightingElement: { - prototype: SVGFEDiffuseLightingElement; - new(): SVGFEDiffuseLightingElement; -} - -interface MSCSSMatrix { - m24: number; - m34: number; - a: number; - d: number; - m32: number; - m41: number; - m11: number; - f: number; - e: number; - m23: number; - m14: number; - m33: number; - m22: number; - m21: number; - c: number; - m12: number; - b: number; - m42: number; - m31: number; - m43: number; - m13: number; - m44: number; - multiply(secondMatrix: MSCSSMatrix): MSCSSMatrix; - skewY(angle: number): MSCSSMatrix; - setMatrixValue(value: string): void; - inverse(): MSCSSMatrix; - rotateAxisAngle(x: number, y: number, z: number, angle: number): MSCSSMatrix; - toString(): string; - rotate(angleX: number, angleY?: number, angleZ?: number): MSCSSMatrix; - translate(x: number, y: number, z?: number): MSCSSMatrix; - scale(scaleX: number, scaleY?: number, scaleZ?: number): MSCSSMatrix; - skewX(angle: number): MSCSSMatrix; -} -declare var MSCSSMatrix: { - prototype: MSCSSMatrix; - new(text?: string): MSCSSMatrix; -} - -interface Worker extends AbstractWorker { - onmessage: (ev: MessageEvent) => any; - postMessage(message: any, ports?: any): void; - terminate(): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var Worker: { - prototype: Worker; - new(stringUrl: string): Worker; -} - -interface MSExecAtPriorityFunctionCallback { - (...args: any[]): any; -} - -interface MSGraphicsTrust { - status: string; - constrictionActive: boolean; -} -declare var MSGraphicsTrust: { - prototype: MSGraphicsTrust; - new(): MSGraphicsTrust; -} - -interface SubtleCrypto { - unwrapKey(wrappedKey: ArrayBufferView, keyAlgorithm: any, keyEncryptionKey: Key, extractable?: boolean, keyUsages?: string[]): KeyOperation; - encrypt(algorithm: any, key: Key, buffer?: ArrayBufferView): CryptoOperation; - importKey(format: string, keyData: ArrayBufferView, algorithm: any, extractable?: boolean, keyUsages?: string[]): KeyOperation; - wrapKey(key: Key, keyEncryptionKey: Key, keyWrappingAlgorithm: any): KeyOperation; - verify(algorithm: any, key: Key, signature: ArrayBufferView, buffer?: ArrayBufferView): CryptoOperation; - deriveKey(algorithm: any, baseKey: Key, derivedKeyType: any, extractable?: boolean, keyUsages?: string[]): KeyOperation; - digest(algorithm: any, buffer?: ArrayBufferView): CryptoOperation; - exportKey(format: string, key: Key): KeyOperation; - generateKey(algorithm: any, extractable?: boolean, keyUsages?: string[]): KeyOperation; - sign(algorithm: any, key: Key, buffer?: ArrayBufferView): CryptoOperation; - decrypt(algorithm: any, key: Key, buffer?: ArrayBufferView): CryptoOperation; -} -declare var SubtleCrypto: { - prototype: SubtleCrypto; - new(): SubtleCrypto; -} - -interface Crypto extends RandomSource { - subtle: SubtleCrypto; -} -declare var Crypto: { - prototype: Crypto; - new(): Crypto; -} - -interface VideoPlaybackQuality { - totalFrameDelay: number; - creationTime: number; - totalVideoFrames: number; - droppedVideoFrames: number; -} -declare var VideoPlaybackQuality: { - prototype: VideoPlaybackQuality; - new(): VideoPlaybackQuality; -} - -interface GlobalEventHandlers { - onpointerenter: (ev: PointerEvent) => any; - onpointerout: (ev: PointerEvent) => any; - onpointerdown: (ev: PointerEvent) => any; - onpointerup: (ev: PointerEvent) => any; - onpointercancel: (ev: PointerEvent) => any; - onpointerover: (ev: PointerEvent) => any; - onpointermove: (ev: PointerEvent) => any; - onpointerleave: (ev: PointerEvent) => any; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface Key { - algorithm: Algorithm; - type: string; - extractable: boolean; - keyUsage: string[]; -} -declare var Key: { - prototype: Key; - new(): Key; -} - -interface DeviceAcceleration { - y: number; - x: number; - z: number; -} -declare var DeviceAcceleration: { - prototype: DeviceAcceleration; - new(): DeviceAcceleration; -} - -interface HTMLAllCollection extends HTMLCollection { - namedItem(name: string): Element; - // [name: string]: Element; -} -declare var HTMLAllCollection: { - prototype: HTMLAllCollection; - new(): HTMLAllCollection; -} - -interface AesGcmEncryptResult { - ciphertext: ArrayBuffer; - tag: ArrayBuffer; -} -declare var AesGcmEncryptResult: { - prototype: AesGcmEncryptResult; - new(): AesGcmEncryptResult; -} - -interface NavigationCompletedEvent extends NavigationEvent { - webErrorStatus: number; - isSuccess: boolean; -} -declare var NavigationCompletedEvent: { - prototype: NavigationCompletedEvent; - new(): NavigationCompletedEvent; -} - -interface MutationRecord { - oldValue: string; - previousSibling: Node; - addedNodes: NodeList; - attributeName: string; - removedNodes: NodeList; - target: Node; - nextSibling: Node; - attributeNamespace: string; - type: string; -} -declare var MutationRecord: { - prototype: MutationRecord; - new(): MutationRecord; -} - -interface MimeTypeArray { - length: number; - item(index: number): Plugin; - [index: number]: Plugin; - namedItem(type: string): Plugin; - // [type: string]: Plugin; -} -declare var MimeTypeArray: { - prototype: MimeTypeArray; - new(): MimeTypeArray; -} - -interface KeyOperation extends EventTarget { - oncomplete: (ev: Event) => any; - onerror: (ev: ErrorEvent) => any; - result: any; - addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var KeyOperation: { - prototype: KeyOperation; - new(): KeyOperation; -} - -interface DOMStringMap { -} -declare var DOMStringMap: { - prototype: DOMStringMap; - new(): DOMStringMap; -} - -interface DeviceOrientationEvent extends Event { - gamma: number; - alpha: number; - absolute: boolean; - beta: number; - initDeviceOrientationEvent(type: string, bubbles: boolean, cancelable: boolean, alpha: number, beta: number, gamma: number, absolute: boolean): void; -} -declare var DeviceOrientationEvent: { - prototype: DeviceOrientationEvent; - new(): DeviceOrientationEvent; -} - -interface MSMediaKeys { - keySystem: string; - createSession(type: string, initData: Uint8Array, cdmData?: Uint8Array): MSMediaKeySession; -} -declare var MSMediaKeys: { - prototype: MSMediaKeys; - new(keySystem: string): MSMediaKeys; - isTypeSupported(keySystem: string, type?: string): boolean; -} - -interface MSMediaKeyMessageEvent extends Event { - destinationURL: string; - message: Uint8Array; -} -declare var MSMediaKeyMessageEvent: { - prototype: MSMediaKeyMessageEvent; - new(): MSMediaKeyMessageEvent; -} - -interface MSHTMLWebViewElement extends HTMLElement { - documentTitle: string; - width: number; - src: string; - canGoForward: boolean; - height: number; - canGoBack: boolean; - navigateWithHttpRequestMessage(requestMessage: any): void; - goBack(): void; - navigate(uri: string): void; - stop(): void; - navigateToString(contents: string): void; - captureSelectedContentToDataPackageAsync(): MSWebViewAsyncOperation; - capturePreviewToBlobAsync(): MSWebViewAsyncOperation; - refresh(): void; - goForward(): void; - navigateToLocalStreamUri(source: string, streamResolver: any): void; - invokeScriptAsync(scriptName: string, ...args: any[]): MSWebViewAsyncOperation; - buildLocalStreamUri(contentIdentifier: string, relativePath: string): string; -} -declare var MSHTMLWebViewElement: { - prototype: MSHTMLWebViewElement; - new(): MSHTMLWebViewElement; -} - -interface NavigationEvent extends Event { - uri: string; -} -declare var NavigationEvent: { - prototype: NavigationEvent; - new(): NavigationEvent; -} - -interface RandomSource { - getRandomValues(array: ArrayBufferView): ArrayBufferView; -} - -interface SourceBuffer extends EventTarget { - updating: boolean; - appendWindowStart: number; - appendWindowEnd: number; - buffered: TimeRanges; - timestampOffset: number; - audioTracks: AudioTrackList; - appendBuffer(data: ArrayBuffer): void; - remove(start: number, end: number): void; - abort(): void; - appendStream(stream: MSStream, maxSize?: number): void; -} -declare var SourceBuffer: { - prototype: SourceBuffer; - new(): SourceBuffer; -} - -interface MSInputMethodContext extends EventTarget { - oncandidatewindowshow: (ev: any) => any; - target: HTMLElement; - compositionStartOffset: number; - oncandidatewindowhide: (ev: any) => any; - oncandidatewindowupdate: (ev: any) => any; - compositionEndOffset: number; - getCompositionAlternatives(): string[]; - getCandidateWindowClientRect(): ClientRect; - hasComposition(): boolean; - isCandidateWindowVisible(): boolean; - addEventListener(type: "candidatewindowshow", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "candidatewindowhide", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "candidatewindowupdate", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var MSInputMethodContext: { - prototype: MSInputMethodContext; - new(): MSInputMethodContext; -} - -interface DeviceRotationRate { - gamma: number; - alpha: number; - beta: number; -} -declare var DeviceRotationRate: { - prototype: DeviceRotationRate; - new(): DeviceRotationRate; -} - -interface PluginArray { - length: number; - refresh(reload?: boolean): void; - item(index: number): Plugin; - [index: number]: Plugin; - namedItem(name: string): Plugin; - // [name: string]: Plugin; -} -declare var PluginArray: { - prototype: PluginArray; - new(): PluginArray; -} - -interface MSMediaKeyError { - systemCode: number; - code: number; - MS_MEDIA_KEYERR_SERVICE: number; - MS_MEDIA_KEYERR_HARDWARECHANGE: number; - MS_MEDIA_KEYERR_OUTPUT: number; - MS_MEDIA_KEYERR_DOMAIN: number; - MS_MEDIA_KEYERR_UNKNOWN: number; - MS_MEDIA_KEYERR_CLIENT: number; -} -declare var MSMediaKeyError: { - prototype: MSMediaKeyError; - new(): MSMediaKeyError; - MS_MEDIA_KEYERR_SERVICE: number; - MS_MEDIA_KEYERR_HARDWARECHANGE: number; - MS_MEDIA_KEYERR_OUTPUT: number; - MS_MEDIA_KEYERR_DOMAIN: number; - MS_MEDIA_KEYERR_UNKNOWN: number; - MS_MEDIA_KEYERR_CLIENT: number; -} - -interface Plugin { - length: number; - filename: string; - version: string; - name: string; - description: string; - item(index: number): MimeType; - [index: number]: MimeType; - namedItem(type: string): MimeType; - // [type: string]: MimeType; -} -declare var Plugin: { - prototype: Plugin; - new(): Plugin; -} - -interface MediaSource extends EventTarget { - sourceBuffers: SourceBufferList; - duration: number; - readyState: string; - activeSourceBuffers: SourceBufferList; - addSourceBuffer(type: string): SourceBuffer; - endOfStream(error?: string): void; - removeSourceBuffer(sourceBuffer: SourceBuffer): void; -} -declare var MediaSource: { - prototype: MediaSource; - new(): MediaSource; - isTypeSupported(type: string): boolean; -} - -interface SourceBufferList extends EventTarget { - length: number; - item(index: number): SourceBuffer; - [index: number]: SourceBuffer; -} -declare var SourceBufferList: { - prototype: SourceBufferList; - new(): SourceBufferList; -} - -interface XMLDocument extends Document { -} -declare var XMLDocument: { - prototype: XMLDocument; - new(): XMLDocument; -} - -interface DeviceMotionEvent extends Event { - rotationRate: DeviceRotationRate; - acceleration: DeviceAcceleration; - interval: number; - accelerationIncludingGravity: DeviceAcceleration; - initDeviceMotionEvent(type: string, bubbles: boolean, cancelable: boolean, acceleration: DeviceAccelerationDict, accelerationIncludingGravity: DeviceAccelerationDict, rotationRate: DeviceRotationRateDict, interval: number): void; -} -declare var DeviceMotionEvent: { - prototype: DeviceMotionEvent; - new(): DeviceMotionEvent; -} - -interface MimeType { - enabledPlugin: Plugin; - suffixes: string; - type: string; - description: string; -} -declare var MimeType: { - prototype: MimeType; - new(): MimeType; -} - -interface PointerEvent extends MouseEvent { - width: number; - rotation: number; - pressure: number; - pointerType: any; - isPrimary: boolean; - tiltY: number; - height: number; - intermediatePoints: any; - currentPoint: any; - tiltX: number; - hwTimestamp: number; - pointerId: number; - initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void; - getCurrentPoint(element: Element): void; - getIntermediatePoints(element: Element): void; -} -declare var PointerEvent: { - prototype: PointerEvent; - new(): PointerEvent; -} - -interface MSDocumentExtensions { - captureEvents(): void; - releaseEvents(): void; -} - -interface MutationObserver { - observe(target: Node, options: MutationObserverInit): void; - takeRecords(): MutationRecord[]; - disconnect(): void; -} -declare var MutationObserver: { - prototype: MutationObserver; - new (callback: (arr: MutationRecord[], observer: MutationObserver)=>any): MutationObserver; -} - -interface MSWebViewAsyncOperation extends EventTarget { - target: MSHTMLWebViewElement; - oncomplete: (ev: Event) => any; - error: DOMError; - onerror: (ev: ErrorEvent) => any; - readyState: number; - type: number; - result: any; - start(): void; - ERROR: number; - TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number; - TYPE_INVOKE_SCRIPT: number; - COMPLETED: number; - TYPE_CAPTURE_PREVIEW_TO_RANDOM_ACCESS_STREAM: number; - STARTED: number; - addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var MSWebViewAsyncOperation: { - prototype: MSWebViewAsyncOperation; - new(): MSWebViewAsyncOperation; - ERROR: number; - TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number; - TYPE_INVOKE_SCRIPT: number; - COMPLETED: number; - TYPE_CAPTURE_PREVIEW_TO_RANDOM_ACCESS_STREAM: number; - STARTED: number; -} - -interface ScriptNotifyEvent extends Event { - value: string; - callingUri: string; -} -declare var ScriptNotifyEvent: { - prototype: ScriptNotifyEvent; - new(): ScriptNotifyEvent; -} - -interface PerformanceNavigationTiming extends PerformanceEntry { - redirectStart: number; - domainLookupEnd: number; - responseStart: number; - domComplete: number; - domainLookupStart: number; - loadEventStart: number; - unloadEventEnd: number; - fetchStart: number; - requestStart: number; - domInteractive: number; - navigationStart: number; - connectEnd: number; - loadEventEnd: number; - connectStart: number; - responseEnd: number; - domLoading: number; - redirectEnd: number; - redirectCount: number; - unloadEventStart: number; - domContentLoadedEventStart: number; - domContentLoadedEventEnd: number; - type: string; -} -declare var PerformanceNavigationTiming: { - prototype: PerformanceNavigationTiming; - new(): PerformanceNavigationTiming; -} - -interface MSMediaKeyNeededEvent extends Event { - initData: Uint8Array; -} -declare var MSMediaKeyNeededEvent: { - prototype: MSMediaKeyNeededEvent; - new(): MSMediaKeyNeededEvent; -} - -interface LongRunningScriptDetectedEvent extends Event { - stopPageScriptExecution: boolean; - executionTime: number; -} -declare var LongRunningScriptDetectedEvent: { - prototype: LongRunningScriptDetectedEvent; - new(): LongRunningScriptDetectedEvent; -} - -interface MSAppView { - viewId: number; - close(): void; - postMessage(message: any, targetOrigin: string, ports?: any): void; -} -declare var MSAppView: { - prototype: MSAppView; - new(): MSAppView; -} - -interface PerfWidgetExternal { - maxCpuSpeed: number; - independentRenderingEnabled: boolean; - irDisablingContentString: string; - irStatusAvailable: boolean; - performanceCounter: number; - averagePaintTime: number; - activeNetworkRequestCount: number; - paintRequestsPerSecond: number; - extraInformationEnabled: boolean; - performanceCounterFrequency: number; - averageFrameTime: number; - repositionWindow(x: number, y: number): void; - getRecentMemoryUsage(last: number): any; - getMemoryUsage(): number; - resizeWindow(width: number, height: number): void; - getProcessCpuUsage(): number; - removeEventListener(eventType: string, callback: (ev: any) => any): void; - getRecentCpuUsage(last: number): any; - addEventListener(eventType: string, callback: (ev: any) => any): void; - getRecentFrames(last: number): any; - getRecentPaintRequests(last: number): any; -} -declare var PerfWidgetExternal: { - prototype: PerfWidgetExternal; - new(): PerfWidgetExternal; -} - -interface PageTransitionEvent extends Event { - persisted: boolean; -} -declare var PageTransitionEvent: { - prototype: PageTransitionEvent; - new(): PageTransitionEvent; -} - -interface MutationCallback { - (mutations: MutationRecord[], observer: MutationObserver): void; -} - -interface HTMLDocument extends Document { -} -declare var HTMLDocument: { - prototype: HTMLDocument; - new(): HTMLDocument; -} - -interface KeyPair { - privateKey: Key; - publicKey: Key; -} -declare var KeyPair: { - prototype: KeyPair; - new(): KeyPair; -} - -interface MSMediaKeySession extends EventTarget { - sessionId: string; - error: MSMediaKeyError; - keySystem: string; - close(): void; - update(key: Uint8Array): void; -} -declare var MSMediaKeySession: { - prototype: MSMediaKeySession; - new(): MSMediaKeySession; -} - -interface UnviewableContentIdentifiedEvent extends NavigationEvent { - referrer: string; -} -declare var UnviewableContentIdentifiedEvent: { - prototype: UnviewableContentIdentifiedEvent; - new(): UnviewableContentIdentifiedEvent; -} - -interface CryptoOperation extends EventTarget { - algorithm: Algorithm; - oncomplete: (ev: Event) => any; - onerror: (ev: ErrorEvent) => any; - onprogress: (ev: ProgressEvent) => any; - onabort: (ev: UIEvent) => any; - key: Key; - result: any; - abort(): void; - finish(): void; - process(buffer: ArrayBufferView): void; - addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var CryptoOperation: { - prototype: CryptoOperation; - new(): CryptoOperation; -} - -interface WebGLTexture extends WebGLObject { -} -declare var WebGLTexture: { - prototype: WebGLTexture; - new(): WebGLTexture; -} - -interface OES_texture_float { -} -declare var OES_texture_float: { - prototype: OES_texture_float; - new(): OES_texture_float; -} - -interface WebGLContextEvent extends Event { - statusMessage: string; -} -declare var WebGLContextEvent: { - prototype: WebGLContextEvent; - new(): WebGLContextEvent; -} - -interface WebGLRenderbuffer extends WebGLObject { -} -declare var WebGLRenderbuffer: { - prototype: WebGLRenderbuffer; - new(): WebGLRenderbuffer; -} - -interface WebGLUniformLocation { -} -declare var WebGLUniformLocation: { - prototype: WebGLUniformLocation; - new(): WebGLUniformLocation; -} - -interface WebGLActiveInfo { - name: string; - type: number; - size: number; -} -declare var WebGLActiveInfo: { - prototype: WebGLActiveInfo; - new(): WebGLActiveInfo; -} - -interface WEBGL_compressed_texture_s3tc { - COMPRESSED_RGBA_S3TC_DXT1_EXT: number; - COMPRESSED_RGBA_S3TC_DXT5_EXT: number; - COMPRESSED_RGBA_S3TC_DXT3_EXT: number; - COMPRESSED_RGB_S3TC_DXT1_EXT: number; -} -declare var WEBGL_compressed_texture_s3tc: { - prototype: WEBGL_compressed_texture_s3tc; - new(): WEBGL_compressed_texture_s3tc; - COMPRESSED_RGBA_S3TC_DXT1_EXT: number; - COMPRESSED_RGBA_S3TC_DXT5_EXT: number; - COMPRESSED_RGBA_S3TC_DXT3_EXT: number; - COMPRESSED_RGB_S3TC_DXT1_EXT: number; -} - -interface WebGLRenderingContext { - drawingBufferWidth: number; - drawingBufferHeight: number; - canvas: HTMLCanvasElement; - getUniformLocation(program: WebGLProgram, name: string): WebGLUniformLocation; - bindTexture(target: number, texture: WebGLTexture): void; - bufferData(target: number, data: ArrayBufferView, usage: number): void; - bufferData(target: number, data: ArrayBuffer, usage: number): void; - bufferData(target: number, size: number, usage: number): void; - depthMask(flag: boolean): void; - getUniform(program: WebGLProgram, location: WebGLUniformLocation): any; - vertexAttrib3fv(indx: number, values: number[]): void; - vertexAttrib3fv(indx: number, values: Float32Array): void; - linkProgram(program: WebGLProgram): void; - getSupportedExtensions(): string[]; - bufferSubData(target: number, offset: number, data: ArrayBuffer): void; - bufferSubData(target: number, offset: number, data: ArrayBufferView): void; - vertexAttribPointer(indx: number, size: number, type: number, normalized: boolean, stride: number, offset: number): void; - polygonOffset(factor: number, units: number): void; - blendColor(red: number, green: number, blue: number, alpha: number): void; - createTexture(): WebGLTexture; - hint(target: number, mode: number): void; - getVertexAttrib(index: number, pname: number): any; - enableVertexAttribArray(index: number): void; - depthRange(zNear: number, zFar: number): void; - cullFace(mode: number): void; - createFramebuffer(): WebGLFramebuffer; - uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: number[]): void; - uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array): void; - framebufferTexture2D(target: number, attachment: number, textarget: number, texture: WebGLTexture, level: number): void; - deleteFramebuffer(framebuffer: WebGLFramebuffer): void; - colorMask(red: boolean, green: boolean, blue: boolean, alpha: boolean): void; - compressedTexImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, data: ArrayBufferView): void; - uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: number[]): void; - uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array): void; - getExtension(name: string): any; - createProgram(): WebGLProgram; - deleteShader(shader: WebGLShader): void; - getAttachedShaders(program: WebGLProgram): WebGLShader[]; - enable(cap: number): void; - blendEquation(mode: number): void; - texImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, format: number, type: number, pixels: ArrayBufferView): void; - texImage2D(target: number, level: number, internalformat: number, format: number, type: number, image: HTMLImageElement): void; - texImage2D(target: number, level: number, internalformat: number, format: number, type: number, canvas: HTMLCanvasElement): void; - texImage2D(target: number, level: number, internalformat: number, format: number, type: number, video: HTMLVideoElement): void; - texImage2D(target: number, level: number, internalformat: number, format: number, type: number, pixels: ImageData): void; - createBuffer(): WebGLBuffer; - deleteTexture(texture: WebGLTexture): void; - useProgram(program: WebGLProgram): void; - vertexAttrib2fv(indx: number, values: number[]): void; - vertexAttrib2fv(indx: number, values: Float32Array): void; - checkFramebufferStatus(target: number): number; - frontFace(mode: number): void; - getBufferParameter(target: number, pname: number): any; - texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView): void; - texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, image: HTMLImageElement): void; - texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, canvas: HTMLCanvasElement): void; - texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, video: HTMLVideoElement): void; - texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, pixels: ImageData): void; - copyTexImage2D(target: number, level: number, internalformat: number, x: number, y: number, width: number, height: number, border: number): void; - getVertexAttribOffset(index: number, pname: number): number; - disableVertexAttribArray(index: number): void; - blendFunc(sfactor: number, dfactor: number): void; - drawElements(mode: number, count: number, type: number, offset: number): void; - isFramebuffer(framebuffer: WebGLFramebuffer): boolean; - uniform3iv(location: WebGLUniformLocation, v: number[]): void; - uniform3iv(location: WebGLUniformLocation, v: Int32Array): void; - lineWidth(width: number): void; - getShaderInfoLog(shader: WebGLShader): string; - getTexParameter(target: number, pname: number): any; - getParameter(pname: number): any; - getShaderPrecisionFormat(shadertype: number, precisiontype: number): WebGLShaderPrecisionFormat; - getContextAttributes(): WebGLContextAttributes; - vertexAttrib1f(indx: number, x: number): void; - bindFramebuffer(target: number, framebuffer: WebGLFramebuffer): void; - compressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, data: ArrayBufferView): void; - isContextLost(): boolean; - uniform1iv(location: WebGLUniformLocation, v: number[]): void; - uniform1iv(location: WebGLUniformLocation, v: Int32Array): void; - getRenderbufferParameter(target: number, pname: number): any; - uniform2fv(location: WebGLUniformLocation, v: number[]): void; - uniform2fv(location: WebGLUniformLocation, v: Float32Array): void; - isTexture(texture: WebGLTexture): boolean; - getError(): number; - shaderSource(shader: WebGLShader, source: string): void; - deleteRenderbuffer(renderbuffer: WebGLRenderbuffer): void; - stencilMask(mask: number): void; - bindBuffer(target: number, buffer: WebGLBuffer): void; - getAttribLocation(program: WebGLProgram, name: string): number; - uniform3i(location: WebGLUniformLocation, x: number, y: number, z: number): void; - blendEquationSeparate(modeRGB: number, modeAlpha: number): void; - clear(mask: number): void; - blendFuncSeparate(srcRGB: number, dstRGB: number, srcAlpha: number, dstAlpha: number): void; - stencilFuncSeparate(face: number, func: number, ref: number, mask: number): void; - readPixels(x: number, y: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView): void; - scissor(x: number, y: number, width: number, height: number): void; - uniform2i(location: WebGLUniformLocation, x: number, y: number): void; - getActiveAttrib(program: WebGLProgram, index: number): WebGLActiveInfo; - getShaderSource(shader: WebGLShader): string; - generateMipmap(target: number): void; - bindAttribLocation(program: WebGLProgram, index: number, name: string): void; - uniform1fv(location: WebGLUniformLocation, v: number[]): void; - uniform1fv(location: WebGLUniformLocation, v: Float32Array): void; - uniform2iv(location: WebGLUniformLocation, v: number[]): void; - uniform2iv(location: WebGLUniformLocation, v: Int32Array): void; - stencilOp(fail: number, zfail: number, zpass: number): void; - uniform4fv(location: WebGLUniformLocation, v: number[]): void; - uniform4fv(location: WebGLUniformLocation, v: Float32Array): void; - vertexAttrib1fv(indx: number, values: number[]): void; - vertexAttrib1fv(indx: number, values: Float32Array): void; - flush(): void; - uniform4f(location: WebGLUniformLocation, x: number, y: number, z: number, w: number): void; - deleteProgram(program: WebGLProgram): void; - isRenderbuffer(renderbuffer: WebGLRenderbuffer): boolean; - uniform1i(location: WebGLUniformLocation, x: number): void; - getProgramParameter(program: WebGLProgram, pname: number): any; - getActiveUniform(program: WebGLProgram, index: number): WebGLActiveInfo; - stencilFunc(func: number, ref: number, mask: number): void; - pixelStorei(pname: number, param: number): void; - disable(cap: number): void; - vertexAttrib4fv(indx: number, values: number[]): void; - vertexAttrib4fv(indx: number, values: Float32Array): void; - createRenderbuffer(): WebGLRenderbuffer; - isBuffer(buffer: WebGLBuffer): boolean; - stencilOpSeparate(face: number, fail: number, zfail: number, zpass: number): void; - getFramebufferAttachmentParameter(target: number, attachment: number, pname: number): any; - uniform4i(location: WebGLUniformLocation, x: number, y: number, z: number, w: number): void; - sampleCoverage(value: number, invert: boolean): void; - depthFunc(func: number): void; - texParameterf(target: number, pname: number, param: number): void; - vertexAttrib3f(indx: number, x: number, y: number, z: number): void; - drawArrays(mode: number, first: number, count: number): void; - texParameteri(target: number, pname: number, param: number): void; - vertexAttrib4f(indx: number, x: number, y: number, z: number, w: number): void; - getShaderParameter(shader: WebGLShader, pname: number): any; - clearDepth(depth: number): void; - activeTexture(texture: number): void; - viewport(x: number, y: number, width: number, height: number): void; - detachShader(program: WebGLProgram, shader: WebGLShader): void; - uniform1f(location: WebGLUniformLocation, x: number): void; - uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: number[]): void; - uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array): void; - deleteBuffer(buffer: WebGLBuffer): void; - copyTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, x: number, y: number, width: number, height: number): void; - uniform3fv(location: WebGLUniformLocation, v: number[]): void; - uniform3fv(location: WebGLUniformLocation, v: Float32Array): void; - stencilMaskSeparate(face: number, mask: number): void; - attachShader(program: WebGLProgram, shader: WebGLShader): void; - compileShader(shader: WebGLShader): void; - clearColor(red: number, green: number, blue: number, alpha: number): void; - isShader(shader: WebGLShader): boolean; - clearStencil(s: number): void; - framebufferRenderbuffer(target: number, attachment: number, renderbuffertarget: number, renderbuffer: WebGLRenderbuffer): void; - finish(): void; - uniform2f(location: WebGLUniformLocation, x: number, y: number): void; - renderbufferStorage(target: number, internalformat: number, width: number, height: number): void; - uniform3f(location: WebGLUniformLocation, x: number, y: number, z: number): void; - getProgramInfoLog(program: WebGLProgram): string; - validateProgram(program: WebGLProgram): void; - isEnabled(cap: number): boolean; - vertexAttrib2f(indx: number, x: number, y: number): void; - isProgram(program: WebGLProgram): boolean; - createShader(type: number): WebGLShader; - bindRenderbuffer(target: number, renderbuffer: WebGLRenderbuffer): void; - uniform4iv(location: WebGLUniformLocation, v: number[]): void; - uniform4iv(location: WebGLUniformLocation, v: Int32Array): void; - DEPTH_FUNC: number; - DEPTH_COMPONENT16: number; - REPLACE: number; - REPEAT: number; - VERTEX_ATTRIB_ARRAY_ENABLED: number; - FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number; - STENCIL_BUFFER_BIT: number; - RENDERER: number; - STENCIL_BACK_REF: number; - TEXTURE26: number; - RGB565: number; - DITHER: number; - CONSTANT_COLOR: number; - GENERATE_MIPMAP_HINT: number; - POINTS: number; - DECR: number; - INT_VEC3: number; - TEXTURE28: number; - ONE_MINUS_CONSTANT_ALPHA: number; - BACK: number; - RENDERBUFFER_STENCIL_SIZE: number; - UNPACK_FLIP_Y_WEBGL: number; - BLEND: number; - TEXTURE9: number; - ARRAY_BUFFER_BINDING: number; - MAX_VIEWPORT_DIMS: number; - INVALID_FRAMEBUFFER_OPERATION: number; - TEXTURE: number; - TEXTURE0: number; - TEXTURE31: number; - TEXTURE24: number; - HIGH_INT: number; - RENDERBUFFER_BINDING: number; - BLEND_COLOR: number; - FASTEST: number; - STENCIL_WRITEMASK: number; - ALIASED_POINT_SIZE_RANGE: number; - TEXTURE12: number; - DST_ALPHA: number; - BLEND_EQUATION_RGB: number; - FRAMEBUFFER_COMPLETE: number; - NEAREST_MIPMAP_NEAREST: number; - VERTEX_ATTRIB_ARRAY_SIZE: number; - TEXTURE3: number; - DEPTH_WRITEMASK: number; - CONTEXT_LOST_WEBGL: number; - INVALID_VALUE: number; - TEXTURE_MAG_FILTER: number; - ONE_MINUS_CONSTANT_COLOR: number; - ONE_MINUS_SRC_ALPHA: number; - TEXTURE_CUBE_MAP_POSITIVE_Z: number; - NOTEQUAL: number; - ALPHA: number; - DEPTH_STENCIL: number; - MAX_VERTEX_UNIFORM_VECTORS: number; - DEPTH_COMPONENT: number; - RENDERBUFFER_RED_SIZE: number; - TEXTURE20: number; - RED_BITS: number; - RENDERBUFFER_BLUE_SIZE: number; - SCISSOR_BOX: number; - VENDOR: number; - FRONT_AND_BACK: number; - CONSTANT_ALPHA: number; - VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number; - NEAREST: number; - CULL_FACE: number; - ALIASED_LINE_WIDTH_RANGE: number; - TEXTURE19: number; - FRONT: number; - DEPTH_CLEAR_VALUE: number; - GREEN_BITS: number; - TEXTURE29: number; - TEXTURE23: number; - MAX_RENDERBUFFER_SIZE: number; - STENCIL_ATTACHMENT: number; - TEXTURE27: number; - BOOL_VEC2: number; - OUT_OF_MEMORY: number; - MIRRORED_REPEAT: number; - POLYGON_OFFSET_UNITS: number; - TEXTURE_MIN_FILTER: number; - STENCIL_BACK_PASS_DEPTH_PASS: number; - LINE_LOOP: number; - FLOAT_MAT3: number; - TEXTURE14: number; - LINEAR: number; - RGB5_A1: number; - ONE_MINUS_SRC_COLOR: number; - SAMPLE_COVERAGE_INVERT: number; - DONT_CARE: number; - FRAMEBUFFER_BINDING: number; - RENDERBUFFER_ALPHA_SIZE: number; - STENCIL_REF: number; - ZERO: number; - DECR_WRAP: number; - SAMPLE_COVERAGE: number; - STENCIL_BACK_FUNC: number; - TEXTURE30: number; - VIEWPORT: number; - STENCIL_BITS: number; - FLOAT: number; - COLOR_WRITEMASK: number; - SAMPLE_COVERAGE_VALUE: number; - TEXTURE_CUBE_MAP_NEGATIVE_Y: number; - STENCIL_BACK_FAIL: number; - FLOAT_MAT4: number; - UNSIGNED_SHORT_4_4_4_4: number; - TEXTURE6: number; - RENDERBUFFER_WIDTH: number; - RGBA4: number; - ALWAYS: number; - BLEND_EQUATION_ALPHA: number; - COLOR_BUFFER_BIT: number; - TEXTURE_CUBE_MAP: number; - DEPTH_BUFFER_BIT: number; - STENCIL_CLEAR_VALUE: number; - BLEND_EQUATION: number; - RENDERBUFFER_GREEN_SIZE: number; - NEAREST_MIPMAP_LINEAR: number; - VERTEX_ATTRIB_ARRAY_TYPE: number; - INCR_WRAP: number; - ONE_MINUS_DST_COLOR: number; - HIGH_FLOAT: number; - BYTE: number; - FRONT_FACE: number; - SAMPLE_ALPHA_TO_COVERAGE: number; - CCW: number; - TEXTURE13: number; - MAX_VERTEX_ATTRIBS: number; - MAX_VERTEX_TEXTURE_IMAGE_UNITS: number; - TEXTURE_WRAP_T: number; - UNPACK_PREMULTIPLY_ALPHA_WEBGL: number; - FLOAT_VEC2: number; - LUMINANCE: number; - GREATER: number; - INT_VEC2: number; - VALIDATE_STATUS: number; - FRAMEBUFFER: number; - FRAMEBUFFER_UNSUPPORTED: number; - TEXTURE5: number; - FUNC_SUBTRACT: number; - BLEND_DST_ALPHA: number; - SAMPLER_CUBE: number; - ONE_MINUS_DST_ALPHA: number; - LESS: number; - TEXTURE_CUBE_MAP_POSITIVE_X: number; - BLUE_BITS: number; - DEPTH_TEST: number; - VERTEX_ATTRIB_ARRAY_STRIDE: number; - DELETE_STATUS: number; - TEXTURE18: number; - POLYGON_OFFSET_FACTOR: number; - UNSIGNED_INT: number; - TEXTURE_2D: number; - DST_COLOR: number; - FLOAT_MAT2: number; - COMPRESSED_TEXTURE_FORMATS: number; - MAX_FRAGMENT_UNIFORM_VECTORS: number; - DEPTH_STENCIL_ATTACHMENT: number; - LUMINANCE_ALPHA: number; - CW: number; - VERTEX_ATTRIB_ARRAY_NORMALIZED: number; - TEXTURE_CUBE_MAP_NEGATIVE_Z: number; - LINEAR_MIPMAP_LINEAR: number; - BUFFER_SIZE: number; - SAMPLE_BUFFERS: number; - TEXTURE15: number; - ACTIVE_TEXTURE: number; - VERTEX_SHADER: number; - TEXTURE22: number; - VERTEX_ATTRIB_ARRAY_POINTER: number; - INCR: number; - COMPILE_STATUS: number; - MAX_COMBINED_TEXTURE_IMAGE_UNITS: number; - TEXTURE7: number; - UNSIGNED_SHORT_5_5_5_1: number; - DEPTH_BITS: number; - RGBA: number; - TRIANGLE_STRIP: number; - COLOR_CLEAR_VALUE: number; - BROWSER_DEFAULT_WEBGL: number; - INVALID_ENUM: number; - SCISSOR_TEST: number; - LINE_STRIP: number; - FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number; - STENCIL_FUNC: number; - FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number; - RENDERBUFFER_HEIGHT: number; - TEXTURE8: number; - TRIANGLES: number; - FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number; - STENCIL_BACK_VALUE_MASK: number; - TEXTURE25: number; - RENDERBUFFER: number; - LEQUAL: number; - TEXTURE1: number; - STENCIL_INDEX8: number; - FUNC_ADD: number; - STENCIL_FAIL: number; - BLEND_SRC_ALPHA: number; - BOOL: number; - ALPHA_BITS: number; - LOW_INT: number; - TEXTURE10: number; - SRC_COLOR: number; - MAX_VARYING_VECTORS: number; - BLEND_DST_RGB: number; - TEXTURE_BINDING_CUBE_MAP: number; - STENCIL_INDEX: number; - TEXTURE_BINDING_2D: number; - MEDIUM_INT: number; - SHADER_TYPE: number; - POLYGON_OFFSET_FILL: number; - DYNAMIC_DRAW: number; - TEXTURE4: number; - STENCIL_BACK_PASS_DEPTH_FAIL: number; - STREAM_DRAW: number; - MAX_CUBE_MAP_TEXTURE_SIZE: number; - TEXTURE17: number; - TRIANGLE_FAN: number; - UNPACK_ALIGNMENT: number; - CURRENT_PROGRAM: number; - LINES: number; - INVALID_OPERATION: number; - FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number; - LINEAR_MIPMAP_NEAREST: number; - CLAMP_TO_EDGE: number; - RENDERBUFFER_DEPTH_SIZE: number; - TEXTURE_WRAP_S: number; - ELEMENT_ARRAY_BUFFER: number; - UNSIGNED_SHORT_5_6_5: number; - ACTIVE_UNIFORMS: number; - FLOAT_VEC3: number; - NO_ERROR: number; - ATTACHED_SHADERS: number; - DEPTH_ATTACHMENT: number; - TEXTURE11: number; - STENCIL_TEST: number; - ONE: number; - FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number; - STATIC_DRAW: number; - GEQUAL: number; - BOOL_VEC4: number; - COLOR_ATTACHMENT0: number; - PACK_ALIGNMENT: number; - MAX_TEXTURE_SIZE: number; - STENCIL_PASS_DEPTH_FAIL: number; - CULL_FACE_MODE: number; - TEXTURE16: number; - STENCIL_BACK_WRITEMASK: number; - SRC_ALPHA: number; - UNSIGNED_SHORT: number; - TEXTURE21: number; - FUNC_REVERSE_SUBTRACT: number; - SHADING_LANGUAGE_VERSION: number; - EQUAL: number; - FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number; - BOOL_VEC3: number; - SAMPLER_2D: number; - TEXTURE_CUBE_MAP_NEGATIVE_X: number; - MAX_TEXTURE_IMAGE_UNITS: number; - TEXTURE_CUBE_MAP_POSITIVE_Y: number; - RENDERBUFFER_INTERNAL_FORMAT: number; - STENCIL_VALUE_MASK: number; - ELEMENT_ARRAY_BUFFER_BINDING: number; - ARRAY_BUFFER: number; - DEPTH_RANGE: number; - NICEST: number; - ACTIVE_ATTRIBUTES: number; - NEVER: number; - FLOAT_VEC4: number; - CURRENT_VERTEX_ATTRIB: number; - STENCIL_PASS_DEPTH_PASS: number; - INVERT: number; - LINK_STATUS: number; - RGB: number; - INT_VEC4: number; - TEXTURE2: number; - UNPACK_COLORSPACE_CONVERSION_WEBGL: number; - MEDIUM_FLOAT: number; - SRC_ALPHA_SATURATE: number; - BUFFER_USAGE: number; - SHORT: number; - NONE: number; - UNSIGNED_BYTE: number; - INT: number; - SUBPIXEL_BITS: number; - KEEP: number; - SAMPLES: number; - FRAGMENT_SHADER: number; - LINE_WIDTH: number; - BLEND_SRC_RGB: number; - LOW_FLOAT: number; - VERSION: number; -} -declare var WebGLRenderingContext: { - prototype: WebGLRenderingContext; - new(): WebGLRenderingContext; - DEPTH_FUNC: number; - DEPTH_COMPONENT16: number; - REPLACE: number; - REPEAT: number; - VERTEX_ATTRIB_ARRAY_ENABLED: number; - FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number; - STENCIL_BUFFER_BIT: number; - RENDERER: number; - STENCIL_BACK_REF: number; - TEXTURE26: number; - RGB565: number; - DITHER: number; - CONSTANT_COLOR: number; - GENERATE_MIPMAP_HINT: number; - POINTS: number; - DECR: number; - INT_VEC3: number; - TEXTURE28: number; - ONE_MINUS_CONSTANT_ALPHA: number; - BACK: number; - RENDERBUFFER_STENCIL_SIZE: number; - UNPACK_FLIP_Y_WEBGL: number; - BLEND: number; - TEXTURE9: number; - ARRAY_BUFFER_BINDING: number; - MAX_VIEWPORT_DIMS: number; - INVALID_FRAMEBUFFER_OPERATION: number; - TEXTURE: number; - TEXTURE0: number; - TEXTURE31: number; - TEXTURE24: number; - HIGH_INT: number; - RENDERBUFFER_BINDING: number; - BLEND_COLOR: number; - FASTEST: number; - STENCIL_WRITEMASK: number; - ALIASED_POINT_SIZE_RANGE: number; - TEXTURE12: number; - DST_ALPHA: number; - BLEND_EQUATION_RGB: number; - FRAMEBUFFER_COMPLETE: number; - NEAREST_MIPMAP_NEAREST: number; - VERTEX_ATTRIB_ARRAY_SIZE: number; - TEXTURE3: number; - DEPTH_WRITEMASK: number; - CONTEXT_LOST_WEBGL: number; - INVALID_VALUE: number; - TEXTURE_MAG_FILTER: number; - ONE_MINUS_CONSTANT_COLOR: number; - ONE_MINUS_SRC_ALPHA: number; - TEXTURE_CUBE_MAP_POSITIVE_Z: number; - NOTEQUAL: number; - ALPHA: number; - DEPTH_STENCIL: number; - MAX_VERTEX_UNIFORM_VECTORS: number; - DEPTH_COMPONENT: number; - RENDERBUFFER_RED_SIZE: number; - TEXTURE20: number; - RED_BITS: number; - RENDERBUFFER_BLUE_SIZE: number; - SCISSOR_BOX: number; - VENDOR: number; - FRONT_AND_BACK: number; - CONSTANT_ALPHA: number; - VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number; - NEAREST: number; - CULL_FACE: number; - ALIASED_LINE_WIDTH_RANGE: number; - TEXTURE19: number; - FRONT: number; - DEPTH_CLEAR_VALUE: number; - GREEN_BITS: number; - TEXTURE29: number; - TEXTURE23: number; - MAX_RENDERBUFFER_SIZE: number; - STENCIL_ATTACHMENT: number; - TEXTURE27: number; - BOOL_VEC2: number; - OUT_OF_MEMORY: number; - MIRRORED_REPEAT: number; - POLYGON_OFFSET_UNITS: number; - TEXTURE_MIN_FILTER: number; - STENCIL_BACK_PASS_DEPTH_PASS: number; - LINE_LOOP: number; - FLOAT_MAT3: number; - TEXTURE14: number; - LINEAR: number; - RGB5_A1: number; - ONE_MINUS_SRC_COLOR: number; - SAMPLE_COVERAGE_INVERT: number; - DONT_CARE: number; - FRAMEBUFFER_BINDING: number; - RENDERBUFFER_ALPHA_SIZE: number; - STENCIL_REF: number; - ZERO: number; - DECR_WRAP: number; - SAMPLE_COVERAGE: number; - STENCIL_BACK_FUNC: number; - TEXTURE30: number; - VIEWPORT: number; - STENCIL_BITS: number; - FLOAT: number; - COLOR_WRITEMASK: number; - SAMPLE_COVERAGE_VALUE: number; - TEXTURE_CUBE_MAP_NEGATIVE_Y: number; - STENCIL_BACK_FAIL: number; - FLOAT_MAT4: number; - UNSIGNED_SHORT_4_4_4_4: number; - TEXTURE6: number; - RENDERBUFFER_WIDTH: number; - RGBA4: number; - ALWAYS: number; - BLEND_EQUATION_ALPHA: number; - COLOR_BUFFER_BIT: number; - TEXTURE_CUBE_MAP: number; - DEPTH_BUFFER_BIT: number; - STENCIL_CLEAR_VALUE: number; - BLEND_EQUATION: number; - RENDERBUFFER_GREEN_SIZE: number; - NEAREST_MIPMAP_LINEAR: number; - VERTEX_ATTRIB_ARRAY_TYPE: number; - INCR_WRAP: number; - ONE_MINUS_DST_COLOR: number; - HIGH_FLOAT: number; - BYTE: number; - FRONT_FACE: number; - SAMPLE_ALPHA_TO_COVERAGE: number; - CCW: number; - TEXTURE13: number; - MAX_VERTEX_ATTRIBS: number; - MAX_VERTEX_TEXTURE_IMAGE_UNITS: number; - TEXTURE_WRAP_T: number; - UNPACK_PREMULTIPLY_ALPHA_WEBGL: number; - FLOAT_VEC2: number; - LUMINANCE: number; - GREATER: number; - INT_VEC2: number; - VALIDATE_STATUS: number; - FRAMEBUFFER: number; - FRAMEBUFFER_UNSUPPORTED: number; - TEXTURE5: number; - FUNC_SUBTRACT: number; - BLEND_DST_ALPHA: number; - SAMPLER_CUBE: number; - ONE_MINUS_DST_ALPHA: number; - LESS: number; - TEXTURE_CUBE_MAP_POSITIVE_X: number; - BLUE_BITS: number; - DEPTH_TEST: number; - VERTEX_ATTRIB_ARRAY_STRIDE: number; - DELETE_STATUS: number; - TEXTURE18: number; - POLYGON_OFFSET_FACTOR: number; - UNSIGNED_INT: number; - TEXTURE_2D: number; - DST_COLOR: number; - FLOAT_MAT2: number; - COMPRESSED_TEXTURE_FORMATS: number; - MAX_FRAGMENT_UNIFORM_VECTORS: number; - DEPTH_STENCIL_ATTACHMENT: number; - LUMINANCE_ALPHA: number; - CW: number; - VERTEX_ATTRIB_ARRAY_NORMALIZED: number; - TEXTURE_CUBE_MAP_NEGATIVE_Z: number; - LINEAR_MIPMAP_LINEAR: number; - BUFFER_SIZE: number; - SAMPLE_BUFFERS: number; - TEXTURE15: number; - ACTIVE_TEXTURE: number; - VERTEX_SHADER: number; - TEXTURE22: number; - VERTEX_ATTRIB_ARRAY_POINTER: number; - INCR: number; - COMPILE_STATUS: number; - MAX_COMBINED_TEXTURE_IMAGE_UNITS: number; - TEXTURE7: number; - UNSIGNED_SHORT_5_5_5_1: number; - DEPTH_BITS: number; - RGBA: number; - TRIANGLE_STRIP: number; - COLOR_CLEAR_VALUE: number; - BROWSER_DEFAULT_WEBGL: number; - INVALID_ENUM: number; - SCISSOR_TEST: number; - LINE_STRIP: number; - FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number; - STENCIL_FUNC: number; - FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number; - RENDERBUFFER_HEIGHT: number; - TEXTURE8: number; - TRIANGLES: number; - FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number; - STENCIL_BACK_VALUE_MASK: number; - TEXTURE25: number; - RENDERBUFFER: number; - LEQUAL: number; - TEXTURE1: number; - STENCIL_INDEX8: number; - FUNC_ADD: number; - STENCIL_FAIL: number; - BLEND_SRC_ALPHA: number; - BOOL: number; - ALPHA_BITS: number; - LOW_INT: number; - TEXTURE10: number; - SRC_COLOR: number; - MAX_VARYING_VECTORS: number; - BLEND_DST_RGB: number; - TEXTURE_BINDING_CUBE_MAP: number; - STENCIL_INDEX: number; - TEXTURE_BINDING_2D: number; - MEDIUM_INT: number; - SHADER_TYPE: number; - POLYGON_OFFSET_FILL: number; - DYNAMIC_DRAW: number; - TEXTURE4: number; - STENCIL_BACK_PASS_DEPTH_FAIL: number; - STREAM_DRAW: number; - MAX_CUBE_MAP_TEXTURE_SIZE: number; - TEXTURE17: number; - TRIANGLE_FAN: number; - UNPACK_ALIGNMENT: number; - CURRENT_PROGRAM: number; - LINES: number; - INVALID_OPERATION: number; - FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number; - LINEAR_MIPMAP_NEAREST: number; - CLAMP_TO_EDGE: number; - RENDERBUFFER_DEPTH_SIZE: number; - TEXTURE_WRAP_S: number; - ELEMENT_ARRAY_BUFFER: number; - UNSIGNED_SHORT_5_6_5: number; - ACTIVE_UNIFORMS: number; - FLOAT_VEC3: number; - NO_ERROR: number; - ATTACHED_SHADERS: number; - DEPTH_ATTACHMENT: number; - TEXTURE11: number; - STENCIL_TEST: number; - ONE: number; - FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number; - STATIC_DRAW: number; - GEQUAL: number; - BOOL_VEC4: number; - COLOR_ATTACHMENT0: number; - PACK_ALIGNMENT: number; - MAX_TEXTURE_SIZE: number; - STENCIL_PASS_DEPTH_FAIL: number; - CULL_FACE_MODE: number; - TEXTURE16: number; - STENCIL_BACK_WRITEMASK: number; - SRC_ALPHA: number; - UNSIGNED_SHORT: number; - TEXTURE21: number; - FUNC_REVERSE_SUBTRACT: number; - SHADING_LANGUAGE_VERSION: number; - EQUAL: number; - FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number; - BOOL_VEC3: number; - SAMPLER_2D: number; - TEXTURE_CUBE_MAP_NEGATIVE_X: number; - MAX_TEXTURE_IMAGE_UNITS: number; - TEXTURE_CUBE_MAP_POSITIVE_Y: number; - RENDERBUFFER_INTERNAL_FORMAT: number; - STENCIL_VALUE_MASK: number; - ELEMENT_ARRAY_BUFFER_BINDING: number; - ARRAY_BUFFER: number; - DEPTH_RANGE: number; - NICEST: number; - ACTIVE_ATTRIBUTES: number; - NEVER: number; - FLOAT_VEC4: number; - CURRENT_VERTEX_ATTRIB: number; - STENCIL_PASS_DEPTH_PASS: number; - INVERT: number; - LINK_STATUS: number; - RGB: number; - INT_VEC4: number; - TEXTURE2: number; - UNPACK_COLORSPACE_CONVERSION_WEBGL: number; - MEDIUM_FLOAT: number; - SRC_ALPHA_SATURATE: number; - BUFFER_USAGE: number; - SHORT: number; - NONE: number; - UNSIGNED_BYTE: number; - INT: number; - SUBPIXEL_BITS: number; - KEEP: number; - SAMPLES: number; - FRAGMENT_SHADER: number; - LINE_WIDTH: number; - BLEND_SRC_RGB: number; - LOW_FLOAT: number; - VERSION: number; -} - -interface WebGLProgram extends WebGLObject { -} -declare var WebGLProgram: { - prototype: WebGLProgram; - new(): WebGLProgram; -} - -interface OES_standard_derivatives { - FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number; -} -declare var OES_standard_derivatives: { - prototype: OES_standard_derivatives; - new(): OES_standard_derivatives; - FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number; -} - -interface WebGLFramebuffer extends WebGLObject { -} -declare var WebGLFramebuffer: { - prototype: WebGLFramebuffer; - new(): WebGLFramebuffer; -} - -interface WebGLShader extends WebGLObject { -} -declare var WebGLShader: { - prototype: WebGLShader; - new(): WebGLShader; -} - -interface OES_texture_float_linear { -} -declare var OES_texture_float_linear: { - prototype: OES_texture_float_linear; - new(): OES_texture_float_linear; -} - -interface WebGLObject { -} -declare var WebGLObject: { - prototype: WebGLObject; - new(): WebGLObject; -} - -interface WebGLBuffer extends WebGLObject { -} -declare var WebGLBuffer: { - prototype: WebGLBuffer; - new(): WebGLBuffer; -} - -interface WebGLShaderPrecisionFormat { - rangeMin: number; - rangeMax: number; - precision: number; -} -declare var WebGLShaderPrecisionFormat: { - prototype: WebGLShaderPrecisionFormat; - new(): WebGLShaderPrecisionFormat; -} - -interface EXT_texture_filter_anisotropic { - TEXTURE_MAX_ANISOTROPY_EXT: number; - MAX_TEXTURE_MAX_ANISOTROPY_EXT: number; -} -declare var EXT_texture_filter_anisotropic: { - prototype: EXT_texture_filter_anisotropic; - new(): EXT_texture_filter_anisotropic; - TEXTURE_MAX_ANISOTROPY_EXT: number; - MAX_TEXTURE_MAX_ANISOTROPY_EXT: number; -} - -declare var Option: { new(text?: string, value?: string, defaultSelected?: boolean, selected?:boolean): HTMLOptionElement; }; -declare var Image: { new(width?: number, height?: number): HTMLImageElement; }; -declare var Audio: { new(src?: string): HTMLAudioElement; }; - -declare var ondragend: (ev: DragEvent) => any; -declare var onkeydown: (ev: KeyboardEvent) => any; -declare var ondragover: (ev: DragEvent) => any; -declare var onkeyup: (ev: KeyboardEvent) => any; -declare var onreset: (ev: Event) => any; -declare var onmouseup: (ev: MouseEvent) => any; -declare var ondragstart: (ev: DragEvent) => any; -declare var ondrag: (ev: DragEvent) => any; -declare var screenX: number; -declare var onmouseover: (ev: MouseEvent) => any; -declare var ondragleave: (ev: DragEvent) => any; -declare var history: History; -declare var pageXOffset: number; -declare var name: string; -declare var onafterprint: (ev: Event) => any; -declare var onpause: (ev: Event) => any; -declare var onbeforeprint: (ev: Event) => any; -declare var top: Window; -declare var onmousedown: (ev: MouseEvent) => any; -declare var onseeked: (ev: Event) => any; -declare var opener: Window; -declare var onclick: (ev: MouseEvent) => any; -declare var innerHeight: number; -declare var onwaiting: (ev: Event) => any; -declare var ononline: (ev: Event) => any; -declare var ondurationchange: (ev: Event) => any; -declare var frames: Window; -declare var onblur: (ev: FocusEvent) => any; -declare var onemptied: (ev: Event) => any; -declare var onseeking: (ev: Event) => any; -declare var oncanplay: (ev: Event) => any; -declare var outerWidth: number; -declare var onstalled: (ev: Event) => any; -declare var onmousemove: (ev: MouseEvent) => any; -declare var innerWidth: number; -declare var onoffline: (ev: Event) => any; -declare var length: number; -declare var screen: Screen; -declare var onbeforeunload: (ev: BeforeUnloadEvent) => any; -declare var onratechange: (ev: Event) => any; -declare var onstorage: (ev: StorageEvent) => any; -declare var onloadstart: (ev: Event) => any; -declare var ondragenter: (ev: DragEvent) => any; -declare var onsubmit: (ev: Event) => any; -declare var self: Window; -declare var document: Document; -declare var onprogress: (ev: ProgressEvent) => any; -declare var ondblclick: (ev: MouseEvent) => any; -declare var pageYOffset: number; -declare var oncontextmenu: (ev: MouseEvent) => any; -declare var onchange: (ev: Event) => any; -declare var onloadedmetadata: (ev: Event) => any; -declare var onplay: (ev: Event) => any; -declare var onerror: ErrorEventHandler; -declare var onplaying: (ev: Event) => any; -declare var parent: Window; -declare var location: Location; -declare var oncanplaythrough: (ev: Event) => any; -declare var onabort: (ev: UIEvent) => any; -declare var onreadystatechange: (ev: Event) => any; -declare var outerHeight: number; -declare var onkeypress: (ev: KeyboardEvent) => any; -declare var frameElement: Element; -declare var onloadeddata: (ev: Event) => any; -declare var onsuspend: (ev: Event) => any; -declare var window: Window; -declare var onfocus: (ev: FocusEvent) => any; -declare var onmessage: (ev: MessageEvent) => any; -declare var ontimeupdate: (ev: Event) => any; -declare var onresize: (ev: UIEvent) => any; -declare var onselect: (ev: UIEvent) => any; -declare var navigator: Navigator; -declare var styleMedia: StyleMedia; -declare var ondrop: (ev: DragEvent) => any; -declare var onmouseout: (ev: MouseEvent) => any; -declare var onended: (ev: Event) => any; -declare var onhashchange: (ev: Event) => any; -declare var onunload: (ev: Event) => any; -declare var onscroll: (ev: UIEvent) => any; -declare var screenY: number; -declare var onmousewheel: (ev: MouseWheelEvent) => any; -declare var onload: (ev: Event) => any; -declare var onvolumechange: (ev: Event) => any; -declare var oninput: (ev: Event) => any; -declare var performance: Performance; -declare var onmspointerdown: (ev: any) => any; -declare var animationStartTime: number; -declare var onmsgesturedoubletap: (ev: any) => any; -declare var onmspointerhover: (ev: any) => any; -declare var onmsgesturehold: (ev: any) => any; -declare var onmspointermove: (ev: any) => any; -declare var onmsgesturechange: (ev: any) => any; -declare var onmsgesturestart: (ev: any) => any; -declare var onmspointercancel: (ev: any) => any; -declare var onmsgestureend: (ev: any) => any; -declare var onmsgesturetap: (ev: any) => any; -declare var onmspointerout: (ev: any) => any; -declare var msAnimationStartTime: number; -declare var applicationCache: ApplicationCache; -declare var onmsinertiastart: (ev: any) => any; -declare var onmspointerover: (ev: any) => any; -declare var onpopstate: (ev: PopStateEvent) => any; -declare var onmspointerup: (ev: any) => any; -declare var onpageshow: (ev: PageTransitionEvent) => any; -declare var ondevicemotion: (ev: DeviceMotionEvent) => any; -declare var devicePixelRatio: number; -declare var msCrypto: Crypto; -declare var ondeviceorientation: (ev: DeviceOrientationEvent) => any; -declare var doNotTrack: string; -declare var onmspointerenter: (ev: any) => any; -declare var onpagehide: (ev: PageTransitionEvent) => any; -declare var onmspointerleave: (ev: any) => any; -declare function alert(message?: any): void; -declare function scroll(x?: number, y?: number): void; -declare function focus(): void; -declare function scrollTo(x?: number, y?: number): void; -declare function print(): void; -declare function prompt(message?: string, _default?: string): string; -declare function toString(): string; -declare function open(url?: string, target?: string, features?: string, replace?: boolean): Window; -declare function scrollBy(x?: number, y?: number): void; -declare function confirm(message?: string): boolean; -declare function close(): void; -declare function postMessage(message: any, targetOrigin: string, ports?: any): void; -declare function showModalDialog(url?: string, argument?: any, options?: any): any; -declare function blur(): void; -declare function getSelection(): Selection; -declare function getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; -declare function msCancelRequestAnimationFrame(handle: number): void; -declare function matchMedia(mediaQuery: string): MediaQueryList; -declare function cancelAnimationFrame(handle: number): void; -declare function msIsStaticHTML(html: string): boolean; -declare function msMatchMedia(mediaQuery: string): MediaQueryList; -declare function requestAnimationFrame(callback: FrameRequestCallback): number; -declare function msRequestAnimationFrame(callback: FrameRequestCallback): number; -declare function removeEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -declare function dispatchEvent(evt: Event): boolean; -declare function attachEvent(event: string, listener: EventListener): boolean; -declare function detachEvent(event: string, listener: EventListener): void; -declare var localStorage: Storage; -declare var status: string; -declare var onmouseleave: (ev: MouseEvent) => any; -declare var screenLeft: number; -declare var offscreenBuffering: any; -declare var maxConnectionsPerServer: number; -declare var onmouseenter: (ev: MouseEvent) => any; -declare var clipboardData: DataTransfer; -declare var defaultStatus: string; -declare var clientInformation: Navigator; -declare var closed: boolean; -declare var onhelp: (ev: Event) => any; -declare var external: External; -declare var event: MSEventObj; -declare var onfocusout: (ev: FocusEvent) => any; -declare var screenTop: number; -declare var onfocusin: (ev: FocusEvent) => any; -declare function showModelessDialog(url?: string, argument?: any, options?: any): Window; -declare function navigate(url: string): void; -declare function resizeBy(x?: number, y?: number): void; -declare function item(index: any): any; -declare function resizeTo(x?: number, y?: number): void; -declare function createPopup(arguments?: any): MSPopupWindow; -declare function toStaticHTML(html: string): string; -declare function execScript(code: string, language?: string): any; -declare function msWriteProfilerMark(profilerMarkName: string): void; -declare function moveTo(x?: number, y?: number): void; -declare function moveBy(x?: number, y?: number): void; -declare function showHelp(url: string, helpArg?: any, features?: string): void; -declare function captureEvents(): void; -declare function releaseEvents(): void; -declare var sessionStorage: Storage; -declare function clearTimeout(handle: number): void; -declare function setTimeout(handler: any, timeout?: any, ...args: any[]): number; -declare function clearInterval(handle: number): void; -declare function setInterval(handler: any, timeout?: any, ...args: any[]): number; -declare function msSetImmediate(expression: any, ...args: any[]): number; -declare function clearImmediate(handle: number): void; -declare function msClearImmediate(handle: number): void; -declare function setImmediate(expression: any, ...args: any[]): number; -declare function btoa(rawString: string): string; -declare function atob(encodedString: string): string; -declare var msIndexedDB: IDBFactory; -declare var indexedDB: IDBFactory; -declare var console: Console; -declare var onpointerenter: (ev: PointerEvent) => any; -declare var onpointerout: (ev: PointerEvent) => any; -declare var onpointerdown: (ev: PointerEvent) => any; -declare var onpointerup: (ev: PointerEvent) => any; -declare var onpointercancel: (ev: PointerEvent) => any; -declare var onpointerover: (ev: PointerEvent) => any; -declare var onpointermove: (ev: PointerEvent) => any; -declare var onpointerleave: (ev: PointerEvent) => any; -declare function addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "hashchange", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "devicemotion", listener: (ev: DeviceMotionEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "deviceorientation", listener: (ev: DeviceOrientationEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; diff --git a/pages/third_party/typescript/bin/lib.scriptHost.d.ts b/pages/third_party/typescript/bin/lib.scriptHost.d.ts deleted file mode 100644 index 1498aeea63..0000000000 --- a/pages/third_party/typescript/bin/lib.scriptHost.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - -/// - - -///////////////////////////// -/// Windows Script Host APIS -///////////////////////////// - -declare var ActiveXObject: { new (s: string): any; }; - -interface ITextWriter { - Write(s: string): void; - WriteLine(s: string): void; - Close(): void; -} - -declare var WScript: { - Echo(s: any): void; - StdErr: ITextWriter; - StdOut: ITextWriter; - Arguments: { length: number; Item(n: number): string; }; - ScriptFullName: string; - Quit(exitCode?: number): number; -} diff --git a/pages/third_party/typescript/bin/lib.webworker.d.ts b/pages/third_party/typescript/bin/lib.webworker.d.ts deleted file mode 100644 index 8675d267aa..0000000000 --- a/pages/third_party/typescript/bin/lib.webworker.d.ts +++ /dev/null @@ -1,1647 +0,0 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - -/// - -///////////////////////////// -/// IE10 ECMAScript Extensions -///////////////////////////// - -/** - * Represents a raw buffer of binary data, which is used to store data for the - * different typed arrays. ArrayBuffers cannot be read from or written to directly, - * but can be passed to a typed array or DataView Object to interpret the raw - * buffer as needed. - */ -interface ArrayBuffer { - /** - * Read-only. The length of the ArrayBuffer (in bytes). - */ - byteLength: number; - - /** - * Returns a section of an ArrayBuffer. - */ - slice(begin:number, end?:number): ArrayBuffer; -} - -declare var ArrayBuffer: { - prototype: ArrayBuffer; - new (byteLength: number): ArrayBuffer; -} - -interface ArrayBufferView { - buffer: ArrayBuffer; - byteOffset: number; - byteLength: number; -} - -/** - * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Int8Array extends ArrayBufferView { - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * The length of the array. - */ - length: number; - - [index: number]: number; - - /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. - */ - get(index: number): number; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: Int8Array, offset?: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: number[], offset?: number): void; - - /** - * Gets a new Int8Array view of the ArrayBuffer store for this array, referencing the elements at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Int8Array; -} -declare var Int8Array: { - prototype: Int8Array; - new (length: number): Int8Array; - new (array: Int8Array): Int8Array; - new (array: number[]): Int8Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int8Array; - BYTES_PER_ELEMENT: number; -} - -/** - * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Uint8Array extends ArrayBufferView { - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * The length of the array. - */ - length: number; - [index: number]: number; - - /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. - */ - get(index: number): number; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: Uint8Array, offset?: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: number[], offset?: number): void; - - /** - * Gets a new Uint8Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Uint8Array; -} -declare var Uint8Array: { - prototype: Uint8Array; - new (length: number): Uint8Array; - new (array: Uint8Array): Uint8Array; - new (array: number[]): Uint8Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint8Array; - BYTES_PER_ELEMENT: number; -} - -/** - * A typed array of 16-bit integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Int16Array extends ArrayBufferView { - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * The length of the array. - */ - length: number; - [index: number]: number; - - /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. - */ - get(index: number): number; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: Int16Array, offset?: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: number[], offset?: number): void; - - /** - * Gets a new Int16Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Int16Array; -} -declare var Int16Array: { - prototype: Int16Array; - new (length: number): Int16Array; - new (array: Int16Array): Int16Array; - new (array: number[]): Int16Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int16Array; - BYTES_PER_ELEMENT: number; -} - -/** - * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Uint16Array extends ArrayBufferView { - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * The length of the array. - */ - length: number; - [index: number]: number; - - /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. - */ - get(index: number): number; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: Uint16Array, offset?: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: number[], offset?: number): void; - - /** - * Gets a new Uint16Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Uint16Array; -} -declare var Uint16Array: { - prototype: Uint16Array; - new (length: number): Uint16Array; - new (array: Uint16Array): Uint16Array; - new (array: number[]): Uint16Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint16Array; - BYTES_PER_ELEMENT: number; -} - -/** - * A typed array of 32-bit integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Int32Array extends ArrayBufferView { - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * The length of the array. - */ - length: number; - [index: number]: number; - - /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. - */ - get(index: number): number; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: Int32Array, offset?: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: number[], offset?: number): void; - - /** - * Gets a new Int32Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Int32Array; -} -declare var Int32Array: { - prototype: Int32Array; - new (length: number): Int32Array; - new (array: Int32Array): Int32Array; - new (array: number[]): Int32Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int32Array; - BYTES_PER_ELEMENT: number; -} - -/** - * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Uint32Array extends ArrayBufferView { - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * The length of the array. - */ - length: number; - [index: number]: number; - - /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. - */ - get(index: number): number; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: Uint32Array, offset?: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: number[], offset?: number): void; - - /** - * Gets a new Int8Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Uint32Array; -} -declare var Uint32Array: { - prototype: Uint32Array; - new (length: number): Uint32Array; - new (array: Uint32Array): Uint32Array; - new (array: number[]): Uint32Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint32Array; - BYTES_PER_ELEMENT: number; -} - -/** - * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Float32Array extends ArrayBufferView { - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * The length of the array. - */ - length: number; - [index: number]: number; - - /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. - */ - get(index: number): number; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: Float32Array, offset?: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: number[], offset?: number): void; - - /** - * Gets a new Float32Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Float32Array; -} -declare var Float32Array: { - prototype: Float32Array; - new (length: number): Float32Array; - new (array: Float32Array): Float32Array; - new (array: number[]): Float32Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float32Array; - BYTES_PER_ELEMENT: number; -} - -/** - * A typed array of 64-bit float values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Float64Array extends ArrayBufferView { - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * The length of the array. - */ - length: number; - [index: number]: number; - - /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. - */ - get(index: number): number; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: Float64Array, offset?: number): void; - - /** - * Sets a value or an array of values. - * @param array A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: number[], offset?: number): void; - - /** - * Gets a new Float64Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Float64Array; -} -declare var Float64Array: { - prototype: Float64Array; - new (length: number): Float64Array; - new (array: Float64Array): Float64Array; - new (array: number[]): Float64Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float64Array; - BYTES_PER_ELEMENT: number; -} - -/** - * You can use a DataView object to read and write the different kinds of binary data to any location in the ArrayBuffer. - */ -interface DataView extends ArrayBufferView { - /** - * Gets the Int8 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getInt8(byteOffset: number): number; - - /** - * Gets the Uint8 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getUint8(byteOffset: number): number; - - /** - * Gets the Int16 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getInt16(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Uint16 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getUint16(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Int32 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getInt32(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Uint32 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getUint32(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Float32 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getFloat32(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Float64 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getFloat64(byteOffset: number, littleEndian?: boolean): number; - - /** - * Stores an Int8 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - */ - setInt8(byteOffset: number, value: number): void; - - /** - * Stores an Uint8 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - */ - setUint8(byteOffset: number, value: number): void; - - /** - * Stores an Int16 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. - */ - setInt16(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Uint16 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. - */ - setUint16(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Int32 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. - */ - setInt32(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Uint32 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. - */ - setUint32(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Float32 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. - */ - setFloat32(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Float64 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. - */ - setFloat64(byteOffset: number, value: number, littleEndian?: boolean): void; -} -declare var DataView: { - prototype: DataView; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): DataView; -} - -///////////////////////////// -/// IE11 ECMAScript Extensions -///////////////////////////// - -interface Map { - clear(): void; - delete(key: K): boolean; - forEach(callbackfn: (value: V, index: K, map: Map) => void, thisArg?: any): void; - get(key: K): V; - has(key: K): boolean; - set(key: K, value: V): Map; - size: number; -} -declare var Map: { - new (): Map; -} - -interface WeakMap { - clear(): void; - delete(key: K): boolean; - get(key: K): V; - has(key: K): boolean; - set(key: K, value: V): WeakMap; -} -declare var WeakMap: { - new (): WeakMap; -} - -interface Set { - add(value: T): Set; - clear(): void; - delete(value: T): boolean; - forEach(callbackfn: (value: T, index: T, set: Set) => void, thisArg?: any): void; - has(value: T): boolean; - size: number; -} -declare var Set: { - new (): Set; -} - -declare module Intl { - - interface CollatorOptions { - usage?: string; - localeMatcher?: string; - numeric?: boolean; - caseFirst?: string; - sensitivity?: string; - ignorePunctuation?: boolean; - } - - interface ResolvedCollatorOptions { - locale: string; - usage: string; - sensitivity: string; - ignorePunctuation: boolean; - collation: string; - caseFirst: string; - numeric: boolean; - } - - interface Collator { - compare(x: string, y: string): number; - resolvedOptions(): ResolvedCollatorOptions; - } - var Collator: { - new (locales?: string[], options?: CollatorOptions): Collator; - new (locale?: string, options?: CollatorOptions): Collator; - (locales?: string[], options?: CollatorOptions): Collator; - (locale?: string, options?: CollatorOptions): Collator; - supportedLocalesOf(locales: string[], options?: CollatorOptions): string[]; - supportedLocalesOf(locale: string, options?: CollatorOptions): string[]; - } - - interface NumberFormatOptions { - localeMatcher?: string; - style?: string; - currency?: string; - currencyDisplay?: string; - useGrouping?: boolean; - } - - interface ResolvedNumberFormatOptions { - locale: string; - numberingSystem: string; - style: string; - currency?: string; - currencyDisplay?: string; - minimumintegerDigits: number; - minimumFractionDigits: number; - maximumFractionDigits: number; - minimumSignificantDigits?: number; - maximumSignificantDigits?: number; - useGrouping: boolean; - } - - interface NumberFormat { - format(value: number): string; - resolvedOptions(): ResolvedNumberFormatOptions; - } - var NumberFormat: { - new (locales?: string[], options?: NumberFormatOptions): Collator; - new (locale?: string, options?: NumberFormatOptions): Collator; - (locales?: string[], options?: NumberFormatOptions): Collator; - (locale?: string, options?: NumberFormatOptions): Collator; - supportedLocalesOf(locales: string[], options?: NumberFormatOptions): string[]; - supportedLocalesOf(locale: string, options?: NumberFormatOptions): string[]; - } - - interface DateTimeFormatOptions { - localeMatcher?: string; - weekday?: string; - era?: string; - year?: string; - month?: string; - day?: string; - hour?: string; - minute?: string; - second?: string; - timeZoneName?: string; - formatMatcher?: string; - hour12: boolean; - } - - interface ResolvedDateTimeFormatOptions { - locale: string; - calendar: string; - numberingSystem: string; - timeZone: string; - hour12?: boolean; - weekday?: string; - era?: string; - year?: string; - month?: string; - day?: string; - hour?: string; - minute?: string; - second?: string; - timeZoneName?: string; - } - - interface DateTimeFormat { - format(date: number): string; - resolvedOptions(): ResolvedDateTimeFormatOptions; - } - var DateTimeFormat: { - new (locales?: string[], options?: DateTimeFormatOptions): Collator; - new (locale?: string, options?: DateTimeFormatOptions): Collator; - (locales?: string[], options?: DateTimeFormatOptions): Collator; - (locale?: string, options?: DateTimeFormatOptions): Collator; - supportedLocalesOf(locales: string[], options?: DateTimeFormatOptions): string[]; - supportedLocalesOf(locale: string, options?: DateTimeFormatOptions): string[]; - } -} - -interface String { - /** - * Determines whether two strings are equivalent in the current locale. - * @param that String to compare to target string - * @param locales An array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details. - * @param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details. - */ - localeCompare(that: string, locales: string[], options?: Intl.CollatorOptions): number; - - /** - * Determines whether two strings are equivalent in the current locale. - * @param that String to compare to target string - * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details. - * @param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details. - */ - localeCompare(that: string, locale: string, options?: Intl.CollatorOptions): number; -} - -interface Number { - /** - * Converts a number to a string by using the current or specified locale. - * @param locales An array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. - * @param options An object that contains one or more properties that specify comparison options. - */ - toLocaleString(locales?: string[], options?: Intl.NumberFormatOptions): string; - - /** - * Converts a number to a string by using the current or specified locale. - * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used. - * @param options An object that contains one or more properties that specify comparison options. - */ - toLocaleString(locale?: string, options?: Intl.NumberFormatOptions): string; -} - -interface Date { - /** - * Converts a date to a string by using the current or specified locale. - * @param locales An array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. - * @param options An object that contains one or more properties that specify comparison options. - */ - toLocaleString(locales?: string[], options?: Intl.DateTimeFormatOptions): string; - - /** - * Converts a date to a string by using the current or specified locale. - * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used. - * @param options An object that contains one or more properties that specify comparison options. - */ - toLocaleString(locale?: string, options?: Intl.DateTimeFormatOptions): string; -} - -///////////////////////////// -/// IE Worker APIs -///////////////////////////// - - -interface Console { - info(message?: any, ...optionalParams: any[]): void; - warn(message?: any, ...optionalParams: any[]): void; - error(message?: any, ...optionalParams: any[]): void; - log(message?: any, ...optionalParams: any[]): void; - profile(reportName?: string): void; - assert(test?: boolean, message?: string, ...optionalParams: any[]): void; - msIsIndependentlyComposed(element: any): boolean; - clear(): void; - dir(value?: any, ...optionalParams: any[]): void; - profileEnd(): void; - count(countTitle?: string): void; - groupEnd(): void; - time(timerName?: string): void; - timeEnd(timerName?: string): void; - trace(): void; - group(groupTitle?: string): void; - dirxml(value: any): void; - debug(message?: string, ...optionalParams: any[]): void; - groupCollapsed(groupTitle?: string): void; - select(element: any): void; -} -declare var Console: { - prototype: Console; - new(): Console; -} - -interface NavigatorID { - appVersion: string; - appName: string; - userAgent: string; - platform: string; - product: string; - vendor: string; -} - -interface EventTarget { - removeEventListener(type: string, listener: EventListener, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; - dispatchEvent(evt: Event): boolean; -} - -interface MessageEvent extends Event { - source: any; - origin: string; - data: any; - ports: any; - initMessageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, dataArg: any, originArg: string, lastEventIdArg: string, sourceArg: any): void; -} -declare var MessageEvent: { - prototype: MessageEvent; - new(): MessageEvent; -} - -interface XMLHttpRequest extends EventTarget { - responseBody: any; - status: number; - readyState: number; - responseText: string; - responseXML: any; - ontimeout: (ev: Event) => any; - statusText: string; - onreadystatechange: (ev: Event) => any; - timeout: number; - onload: (ev: Event) => any; - response: any; - withCredentials: boolean; - onprogress: (ev: ProgressEvent) => any; - onabort: (ev: any) => any; - responseType: string; - onloadend: (ev: ProgressEvent) => any; - upload: XMLHttpRequestEventTarget; - onerror: (ev: ErrorEvent) => any; - onloadstart: (ev: Event) => any; - msCaching: string; - open(method: string, url: string, async?: boolean, user?: string, password?: string): void; - send(data?: any): void; - abort(): void; - getAllResponseHeaders(): string; - setRequestHeader(header: string, value: string): void; - getResponseHeader(header: string): string; - msCachingEnabled(): boolean; - overrideMimeType(mime: string): void; - LOADING: number; - DONE: number; - UNSENT: number; - OPENED: number; - HEADERS_RECEIVED: number; - addEventListener(type: "timeout", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var XMLHttpRequest: { - prototype: XMLHttpRequest; - new(): XMLHttpRequest; - LOADING: number; - DONE: number; - UNSENT: number; - OPENED: number; - HEADERS_RECEIVED: number; - create(): XMLHttpRequest; -} - -interface EventListener { - (evt: Event): void; -} - -interface EventException { - code: number; - message: string; - name: string; - toString(): string; - DISPATCH_REQUEST_ERR: number; - UNSPECIFIED_EVENT_TYPE_ERR: number; -} -declare var EventException: { - prototype: EventException; - new(): EventException; - DISPATCH_REQUEST_ERR: number; - UNSPECIFIED_EVENT_TYPE_ERR: number; -} - -interface NavigatorOnLine { - onLine: boolean; -} - -interface Event { - timeStamp: number; - defaultPrevented: boolean; - isTrusted: boolean; - currentTarget: EventTarget; - cancelBubble: boolean; - target: EventTarget; - eventPhase: number; - cancelable: boolean; - type: string; - srcElement: any; - bubbles: boolean; - initEvent(eventTypeArg: string, canBubbleArg: boolean, cancelableArg: boolean): void; - stopPropagation(): void; - stopImmediatePropagation(): void; - preventDefault(): void; - CAPTURING_PHASE: number; - AT_TARGET: number; - BUBBLING_PHASE: number; -} -declare var Event: { - prototype: Event; - new(): Event; - CAPTURING_PHASE: number; - AT_TARGET: number; - BUBBLING_PHASE: number; -} - -interface ImageData { - width: number; - data: number[]; - height: number; -} -declare var ImageData: { - prototype: ImageData; - new(): ImageData; -} - -interface DOMException { - code: number; - message: string; - name: string; - toString(): string; - HIERARCHY_REQUEST_ERR: number; - NO_MODIFICATION_ALLOWED_ERR: number; - INVALID_MODIFICATION_ERR: number; - NAMESPACE_ERR: number; - INVALID_CHARACTER_ERR: number; - TYPE_MISMATCH_ERR: number; - ABORT_ERR: number; - INVALID_STATE_ERR: number; - SECURITY_ERR: number; - NETWORK_ERR: number; - WRONG_DOCUMENT_ERR: number; - QUOTA_EXCEEDED_ERR: number; - INDEX_SIZE_ERR: number; - DOMSTRING_SIZE_ERR: number; - SYNTAX_ERR: number; - SERIALIZE_ERR: number; - VALIDATION_ERR: number; - NOT_FOUND_ERR: number; - URL_MISMATCH_ERR: number; - PARSE_ERR: number; - NO_DATA_ALLOWED_ERR: number; - NOT_SUPPORTED_ERR: number; - INVALID_ACCESS_ERR: number; - INUSE_ATTRIBUTE_ERR: number; - INVALID_NODE_TYPE_ERR: number; - DATA_CLONE_ERR: number; - TIMEOUT_ERR: number; -} -declare var DOMException: { - prototype: DOMException; - new(): DOMException; - HIERARCHY_REQUEST_ERR: number; - NO_MODIFICATION_ALLOWED_ERR: number; - INVALID_MODIFICATION_ERR: number; - NAMESPACE_ERR: number; - INVALID_CHARACTER_ERR: number; - TYPE_MISMATCH_ERR: number; - ABORT_ERR: number; - INVALID_STATE_ERR: number; - SECURITY_ERR: number; - NETWORK_ERR: number; - WRONG_DOCUMENT_ERR: number; - QUOTA_EXCEEDED_ERR: number; - INDEX_SIZE_ERR: number; - DOMSTRING_SIZE_ERR: number; - SYNTAX_ERR: number; - SERIALIZE_ERR: number; - VALIDATION_ERR: number; - NOT_FOUND_ERR: number; - URL_MISMATCH_ERR: number; - PARSE_ERR: number; - NO_DATA_ALLOWED_ERR: number; - NOT_SUPPORTED_ERR: number; - INVALID_ACCESS_ERR: number; - INUSE_ATTRIBUTE_ERR: number; - INVALID_NODE_TYPE_ERR: number; - DATA_CLONE_ERR: number; - TIMEOUT_ERR: number; -} - -interface ErrorEvent extends Event { - colno: number; - filename: string; - error: any; - lineno: number; - message: string; - initErrorEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, messageArg: string, filenameArg: string, linenoArg: number): void; -} -declare var ErrorEvent: { - prototype: ErrorEvent; - new(): ErrorEvent; -} - -interface MSStreamReader extends MSBaseReader { - error: DOMError; - readAsArrayBuffer(stream: MSStream, size?: number): void; - readAsBlob(stream: MSStream, size?: number): void; - readAsDataURL(stream: MSStream, size?: number): void; - readAsText(stream: MSStream, encoding?: string, size?: number): void; -} -declare var MSStreamReader: { - prototype: MSStreamReader; - new(): MSStreamReader; -} - -interface MessageChannel { - port2: MessagePort; - port1: MessagePort; -} -declare var MessageChannel: { - prototype: MessageChannel; - new(): MessageChannel; -} - -interface DOMError { - name: string; - toString(): string; -} -declare var DOMError: { - prototype: DOMError; - new(): DOMError; -} - -interface CloseEvent extends Event { - wasClean: boolean; - reason: string; - code: number; - initCloseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, wasCleanArg: boolean, codeArg: number, reasonArg: string): void; -} -declare var CloseEvent: { - prototype: CloseEvent; - new(): CloseEvent; -} - -interface WebSocket extends EventTarget { - protocol: string; - readyState: number; - bufferedAmount: number; - onopen: (ev: Event) => any; - extensions: string; - onmessage: (ev: MessageEvent) => any; - onclose: (ev: CloseEvent) => any; - onerror: (ev: ErrorEvent) => any; - binaryType: string; - url: string; - close(code?: number, reason?: string): void; - send(data: any): void; - OPEN: number; - CLOSING: number; - CONNECTING: number; - CLOSED: number; - addEventListener(type: "open", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "close", listener: (ev: CloseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var WebSocket: { - prototype: WebSocket; - new(url: string, protocols?: string): WebSocket; - new(url: string, protocols?: string[]): WebSocket; - OPEN: number; - CLOSING: number; - CONNECTING: number; - CLOSED: number; -} - -interface ProgressEvent extends Event { - loaded: number; - lengthComputable: boolean; - total: number; - initProgressEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, lengthComputableArg: boolean, loadedArg: number, totalArg: number): void; -} -declare var ProgressEvent: { - prototype: ProgressEvent; - new(): ProgressEvent; -} - -interface IDBObjectStore { - indexNames: DOMStringList; - name: string; - transaction: IDBTransaction; - keyPath: string; - count(key?: any): IDBRequest; - add(value: any, key?: any): IDBRequest; - clear(): IDBRequest; - createIndex(name: string, keyPath: string, optionalParameters?: any): IDBIndex; - put(value: any, key?: any): IDBRequest; - openCursor(range?: any, direction?: string): IDBRequest; - deleteIndex(indexName: string): void; - index(name: string): IDBIndex; - get(key: any): IDBRequest; - delete(key: any): IDBRequest; -} -declare var IDBObjectStore: { - prototype: IDBObjectStore; - new(): IDBObjectStore; -} - -interface IDBVersionChangeEvent extends Event { - newVersion: number; - oldVersion: number; -} -declare var IDBVersionChangeEvent: { - prototype: IDBVersionChangeEvent; - new(): IDBVersionChangeEvent; -} - -interface IDBIndex { - unique: boolean; - name: string; - keyPath: string; - objectStore: IDBObjectStore; - count(key?: any): IDBRequest; - getKey(key: any): IDBRequest; - openKeyCursor(range?: IDBKeyRange, direction?: string): IDBRequest; - get(key: any): IDBRequest; - openCursor(range?: IDBKeyRange, direction?: string): IDBRequest; -} -declare var IDBIndex: { - prototype: IDBIndex; - new(): IDBIndex; -} - -interface FileList { - length: number; - item(index: number): File; - [index: number]: File; -} -declare var FileList: { - prototype: FileList; - new(): FileList; -} - -interface IDBCursor { - source: any; - direction: string; - key: any; - primaryKey: any; - advance(count: number): void; - delete(): IDBRequest; - continue(key?: any): void; - update(value: any): IDBRequest; - PREV: string; - PREV_NO_DUPLICATE: string; - NEXT: string; - NEXT_NO_DUPLICATE: string; -} -declare var IDBCursor: { - prototype: IDBCursor; - new(): IDBCursor; - PREV: string; - PREV_NO_DUPLICATE: string; - NEXT: string; - NEXT_NO_DUPLICATE: string; -} - -interface File extends Blob { - lastModifiedDate: any; - name: string; -} -declare var File: { - prototype: File; - new(): File; -} - -interface IDBCursorWithValue extends IDBCursor { - value: any; -} -declare var IDBCursorWithValue: { - prototype: IDBCursorWithValue; - new(): IDBCursorWithValue; -} - -interface XMLHttpRequestEventTarget extends EventTarget { - onprogress: (ev: ProgressEvent) => any; - onerror: (ev: ErrorEvent) => any; - onload: (ev: Event) => any; - ontimeout: (ev: Event) => any; - onabort: (ev: any) => any; - onloadstart: (ev: Event) => any; - onloadend: (ev: ProgressEvent) => any; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "timeout", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var XMLHttpRequestEventTarget: { - prototype: XMLHttpRequestEventTarget; - new(): XMLHttpRequestEventTarget; -} - -interface MSBaseReader extends EventTarget { - onprogress: (ev: ProgressEvent) => any; - readyState: number; - onabort: (ev: any) => any; - onloadend: (ev: ProgressEvent) => any; - onerror: (ev: ErrorEvent) => any; - onload: (ev: Event) => any; - onloadstart: (ev: Event) => any; - result: any; - abort(): void; - LOADING: number; - EMPTY: number; - DONE: number; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface IDBKeyRange { - upper: any; - upperOpen: boolean; - lower: any; - lowerOpen: boolean; -} -declare var IDBKeyRange: { - prototype: IDBKeyRange; - new(): IDBKeyRange; - bound(lower: any, upper: any, lowerOpen?: boolean, upperOpen?: boolean): IDBKeyRange; - only(value: any): IDBKeyRange; - lowerBound(bound: any, open?: boolean): IDBKeyRange; - upperBound(bound: any, open?: boolean): IDBKeyRange; -} - -interface WindowConsole { - console: Console; -} - -interface IDBTransaction extends EventTarget { - oncomplete: (ev: Event) => any; - db: IDBDatabase; - mode: string; - error: DOMError; - onerror: (ev: ErrorEvent) => any; - onabort: (ev: any) => any; - abort(): void; - objectStore(name: string): IDBObjectStore; - READ_ONLY: string; - VERSION_CHANGE: string; - READ_WRITE: string; - addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var IDBTransaction: { - prototype: IDBTransaction; - new(): IDBTransaction; - READ_ONLY: string; - VERSION_CHANGE: string; - READ_WRITE: string; -} - -interface WindowBase64 { - btoa(rawString: string): string; - atob(encodedString: string): string; -} - -interface IDBDatabase extends EventTarget { - version: string; - name: string; - objectStoreNames: DOMStringList; - onerror: (ev: ErrorEvent) => any; - onabort: (ev: any) => any; - createObjectStore(name: string, optionalParameters?: any): IDBObjectStore; - close(): void; - transaction(storeNames: any, mode?: string): IDBTransaction; - deleteObjectStore(name: string): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var IDBDatabase: { - prototype: IDBDatabase; - new(): IDBDatabase; -} - -interface DOMStringList { - length: number; - contains(str: string): boolean; - item(index: number): string; - [index: number]: string; -} -declare var DOMStringList: { - prototype: DOMStringList; - new(): DOMStringList; -} - -interface IDBOpenDBRequest extends IDBRequest { - onupgradeneeded: (ev: IDBVersionChangeEvent) => any; - onblocked: (ev: Event) => any; - addEventListener(type: "success", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "upgradeneeded", listener: (ev: IDBVersionChangeEvent) => any, useCapture?: boolean): void; - addEventListener(type: "blocked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var IDBOpenDBRequest: { - prototype: IDBOpenDBRequest; - new(): IDBOpenDBRequest; -} - -interface MSUnsafeFunctionCallback { - (): any; -} - -interface IDBRequest extends EventTarget { - source: any; - onsuccess: (ev: Event) => any; - error: DOMError; - transaction: IDBTransaction; - onerror: (ev: ErrorEvent) => any; - readyState: string; - result: any; - addEventListener(type: "success", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var IDBRequest: { - prototype: IDBRequest; - new(): IDBRequest; -} - -interface MessagePort extends EventTarget { - onmessage: (ev: MessageEvent) => any; - close(): void; - postMessage(message?: any, ports?: any): void; - start(): void; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var MessagePort: { - prototype: MessagePort; - new(): MessagePort; -} - -interface FileReader extends MSBaseReader { - error: DOMError; - readAsArrayBuffer(blob: Blob): void; - readAsDataURL(blob: Blob): void; - readAsText(blob: Blob, encoding?: string): void; -} -declare var FileReader: { - prototype: FileReader; - new(): FileReader; -} - -interface BlobPropertyBag { - type?: string; - endings?: string; -} - -interface Blob { - type: string; - size: number; - msDetachStream(): any; - slice(start?: number, end?: number, contentType?: string): Blob; - msClose(): void; -} -declare var Blob: { - prototype: Blob; - new (blobParts?: any[], options?: BlobPropertyBag): Blob; -} - -interface MSStream { - type: string; - msDetachStream(): any; - msClose(): void; -} -declare var MSStream: { - prototype: MSStream; - new(): MSStream; -} - -interface MSBlobBuilder { - append(data: any, endings?: string): void; - getBlob(contentType?: string): Blob; -} -declare var MSBlobBuilder: { - prototype: MSBlobBuilder; - new(): MSBlobBuilder; -} - -interface IDBFactory { - open(name: string, version?: number): IDBOpenDBRequest; - cmp(first: any, second: any): number; - deleteDatabase(name: string): IDBOpenDBRequest; -} -declare var IDBFactory: { - prototype: IDBFactory; - new(): IDBFactory; -} - -interface AbstractWorker extends EventTarget { - onerror: (ev: ErrorEvent) => any; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface MSApp { - createFileFromStorageFile(storageFile: any): File; - createBlobFromRandomAccessStream(type: string, seeker: any): Blob; - createStreamFromInputStream(type: string, inputStream: any): MSStream; - terminateApp(exceptionObject: any): void; - createDataPackage(object: any): any; - execUnsafeLocalFunction(unsafeFunction: MSUnsafeFunctionCallback): any; - getHtmlPrintDocumentSource(htmlDoc: any): any; - addPublicLocalApplicationUri(uri: string): void; - createDataPackageFromSelection(): any; - getViewOpener(): MSAppView; - suppressSubdownloadCredentialPrompts(suppress: boolean): void; - execAsyncAtPriority(asynchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): void; - isTaskScheduledAtPriorityOrHigher(priority: string): boolean; - execAtPriority(synchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): any; - createNewView(uri: string): MSAppView; - getCurrentPriority(): string; - NORMAL: string; - HIGH: string; - IDLE: string; - CURRENT: string; -} -declare var MSApp: MSApp; - -interface Worker extends AbstractWorker { - onmessage: (ev: MessageEvent) => any; - postMessage(message: any, ports?: any): void; - terminate(): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -declare var Worker: { - prototype: Worker; - new(stringUrl: string): Worker; -} - -interface MSExecAtPriorityFunctionCallback { - (...args: any[]): any; -} - -interface MSAppView { - viewId: number; - close(): void; - postMessage(message: any, targetOrigin: string, ports?: any): void; -} -declare var MSAppView: { - prototype: MSAppView; - new(): MSAppView; -} - -interface WorkerLocation { - hash: string; - protocol: string; - search: string; - href: string; - hostname: string; - port: string; - pathname: string; - host: string; - toString(): string; -} -declare var WorkerLocation: { - prototype: WorkerLocation; - new(): WorkerLocation; -} - -interface FileReaderSync { - readAsArrayBuffer(blob: Blob): any; - readAsDataURL(blob: Blob): string; - readAsText(blob: Blob, encoding?: string): string; -} -declare var FileReaderSync: { - prototype: FileReaderSync; - new(): FileReaderSync; -} - -interface WorkerGlobalScope extends EventTarget, DedicatedWorkerGlobalScope, WindowConsole, WorkerUtils { - location: WorkerLocation; - self: WorkerGlobalScope; - onerror: (ev: ErrorEvent) => any; - msWriteProfilerMark(profilerMarkName: string): void; - close(): void; - toString(): string; -} -declare var WorkerGlobalScope: { - prototype: WorkerGlobalScope; - new(): WorkerGlobalScope; -} - -interface DedicatedWorkerGlobalScope { - onmessage: (ev: MessageEvent) => any; - postMessage(data: any): void; -} - -interface WorkerNavigator extends NavigatorID, NavigatorOnLine { -} -declare var WorkerNavigator: { - prototype: WorkerNavigator; - new(): WorkerNavigator; -} - -interface WorkerUtils extends WindowBase64 { - navigator: WorkerNavigator; - msIndexedDB: IDBFactory; - indexedDB: IDBFactory; - clearImmediate(handle: number): void; - importScripts(...urls: string[]): void; - clearTimeout(handle: number): void; - setImmediate(handler: any, ...args: any[]): number; - setTimeout(handler: any, timeout?: any, ...args: any[]): number; - clearInterval(handle: number): void; - setInterval(handler: any, timeout?: any, ...args: any[]): number; -} - - -declare var location: WorkerLocation; -declare var self: WorkerGlobalScope; -declare var onerror: (ev: ErrorEvent) => any; -declare function msWriteProfilerMark(profilerMarkName: string): void; -declare function close(): void; -declare function toString(): string; -declare function removeEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -declare function addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -declare function dispatchEvent(evt: Event): boolean; -declare var onmessage: (ev: MessageEvent) => any; -declare function postMessage(data: any): void; -declare var console: Console; -declare var navigator: WorkerNavigator; -declare var msIndexedDB: IDBFactory; -declare var indexedDB: IDBFactory; -declare function clearImmediate(handle: number): void; -declare function importScripts(...urls: string[]): void; -declare function clearTimeout(handle: number): void; -declare function setImmediate(handler: any, ...args: any[]): number; -declare function setTimeout(handler: any, timeout?: any, ...args: any[]): number; -declare function clearInterval(handle: number): void; -declare function setInterval(handler: any, timeout?: any, ...args: any[]): number; -declare function btoa(rawString: string): string; -declare function atob(encodedString: string): string; diff --git a/pages/third_party/typescript/bin/tsc b/pages/third_party/typescript/bin/tsc deleted file mode 100755 index 3c0dab574f..0000000000 --- a/pages/third_party/typescript/bin/tsc +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env node -require('./tsc.js') diff --git a/pages/third_party/typescript/bin/tsc.js b/pages/third_party/typescript/bin/tsc.js deleted file mode 100644 index cfa3d99265..0000000000 --- a/pages/third_party/typescript/bin/tsc.js +++ /dev/null @@ -1,15742 +0,0 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - -var ts; -(function (ts) { - ts.Diagnostics = { - Unterminated_string_literal: { code: 1002, category: 1 /* Error */, key: "Unterminated string literal." }, - Identifier_expected: { code: 1003, category: 1 /* Error */, key: "Identifier expected." }, - _0_expected: { code: 1005, category: 1 /* Error */, key: "'{0}' expected." }, - A_file_cannot_have_a_reference_to_itself: { code: 1006, category: 1 /* Error */, key: "A file cannot have a reference to itself." }, - Trailing_comma_not_allowed: { code: 1009, category: 1 /* Error */, key: "Trailing comma not allowed." }, - Asterisk_Slash_expected: { code: 1010, category: 1 /* Error */, key: "'*/' expected." }, - Unexpected_token: { code: 1012, category: 1 /* Error */, key: "Unexpected token." }, - Catch_clause_parameter_cannot_have_a_type_annotation: { code: 1013, category: 1 /* Error */, key: "Catch clause parameter cannot have a type annotation." }, - A_rest_parameter_must_be_last_in_a_parameter_list: { code: 1014, category: 1 /* Error */, key: "A rest parameter must be last in a parameter list." }, - Parameter_cannot_have_question_mark_and_initializer: { code: 1015, category: 1 /* Error */, key: "Parameter cannot have question mark and initializer." }, - A_required_parameter_cannot_follow_an_optional_parameter: { code: 1016, category: 1 /* Error */, key: "A required parameter cannot follow an optional parameter." }, - An_index_signature_cannot_have_a_rest_parameter: { code: 1017, category: 1 /* Error */, key: "An index signature cannot have a rest parameter." }, - An_index_signature_parameter_cannot_have_an_accessibility_modifier: { code: 1018, category: 1 /* Error */, key: "An index signature parameter cannot have an accessibility modifier." }, - An_index_signature_parameter_cannot_have_a_question_mark: { code: 1019, category: 1 /* Error */, key: "An index signature parameter cannot have a question mark." }, - An_index_signature_parameter_cannot_have_an_initializer: { code: 1020, category: 1 /* Error */, key: "An index signature parameter cannot have an initializer." }, - An_index_signature_must_have_a_type_annotation: { code: 1021, category: 1 /* Error */, key: "An index signature must have a type annotation." }, - An_index_signature_parameter_must_have_a_type_annotation: { code: 1022, category: 1 /* Error */, key: "An index signature parameter must have a type annotation." }, - An_index_signature_parameter_type_must_be_string_or_number: { code: 1023, category: 1 /* Error */, key: "An index signature parameter type must be 'string' or 'number'." }, - A_class_or_interface_declaration_can_only_have_one_extends_clause: { code: 1024, category: 1 /* Error */, key: "A class or interface declaration can only have one 'extends' clause." }, - An_extends_clause_must_precede_an_implements_clause: { code: 1025, category: 1 /* Error */, key: "An 'extends' clause must precede an 'implements' clause." }, - A_class_can_only_extend_a_single_class: { code: 1026, category: 1 /* Error */, key: "A class can only extend a single class." }, - A_class_declaration_can_only_have_one_implements_clause: { code: 1027, category: 1 /* Error */, key: "A class declaration can only have one 'implements' clause." }, - Accessibility_modifier_already_seen: { code: 1028, category: 1 /* Error */, key: "Accessibility modifier already seen." }, - _0_modifier_must_precede_1_modifier: { code: 1029, category: 1 /* Error */, key: "'{0}' modifier must precede '{1}' modifier." }, - _0_modifier_already_seen: { code: 1030, category: 1 /* Error */, key: "'{0}' modifier already seen." }, - _0_modifier_cannot_appear_on_a_class_element: { code: 1031, category: 1 /* Error */, key: "'{0}' modifier cannot appear on a class element." }, - An_interface_declaration_cannot_have_an_implements_clause: { code: 1032, category: 1 /* Error */, key: "An interface declaration cannot have an 'implements' clause." }, - super_must_be_followed_by_an_argument_list_or_member_access: { code: 1034, category: 1 /* Error */, key: "'super' must be followed by an argument list or member access." }, - Only_ambient_modules_can_use_quoted_names: { code: 1035, category: 1 /* Error */, key: "Only ambient modules can use quoted names." }, - Statements_are_not_allowed_in_ambient_contexts: { code: 1036, category: 1 /* Error */, key: "Statements are not allowed in ambient contexts." }, - A_function_implementation_cannot_be_declared_in_an_ambient_context: { code: 1037, category: 1 /* Error */, key: "A function implementation cannot be declared in an ambient context." }, - A_declare_modifier_cannot_be_used_in_an_already_ambient_context: { code: 1038, category: 1 /* Error */, key: "A 'declare' modifier cannot be used in an already ambient context." }, - Initializers_are_not_allowed_in_ambient_contexts: { code: 1039, category: 1 /* Error */, key: "Initializers are not allowed in ambient contexts." }, - _0_modifier_cannot_appear_on_a_module_element: { code: 1044, category: 1 /* Error */, key: "'{0}' modifier cannot appear on a module element." }, - A_declare_modifier_cannot_be_used_with_an_interface_declaration: { code: 1045, category: 1 /* Error */, key: "A 'declare' modifier cannot be used with an interface declaration." }, - A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file: { code: 1046, category: 1 /* Error */, key: "A 'declare' modifier is required for a top level declaration in a .d.ts file." }, - A_rest_parameter_cannot_be_optional: { code: 1047, category: 1 /* Error */, key: "A rest parameter cannot be optional." }, - A_rest_parameter_cannot_have_an_initializer: { code: 1048, category: 1 /* Error */, key: "A rest parameter cannot have an initializer." }, - A_set_accessor_must_have_exactly_one_parameter: { code: 1049, category: 1 /* Error */, key: "A 'set' accessor must have exactly one parameter." }, - A_set_accessor_cannot_have_an_optional_parameter: { code: 1051, category: 1 /* Error */, key: "A 'set' accessor cannot have an optional parameter." }, - A_set_accessor_parameter_cannot_have_an_initializer: { code: 1052, category: 1 /* Error */, key: "A 'set' accessor parameter cannot have an initializer." }, - A_set_accessor_cannot_have_rest_parameter: { code: 1053, category: 1 /* Error */, key: "A 'set' accessor cannot have rest parameter." }, - A_get_accessor_cannot_have_parameters: { code: 1054, category: 1 /* Error */, key: "A 'get' accessor cannot have parameters." }, - Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: { code: 1056, category: 1 /* Error */, key: "Accessors are only available when targeting ECMAScript 5 and higher." }, - Enum_member_must_have_initializer: { code: 1061, category: 1 /* Error */, key: "Enum member must have initializer." }, - An_export_assignment_cannot_be_used_in_an_internal_module: { code: 1063, category: 1 /* Error */, key: "An export assignment cannot be used in an internal module." }, - Ambient_enum_elements_can_only_have_integer_literal_initializers: { code: 1066, category: 1 /* Error */, key: "Ambient enum elements can only have integer literal initializers." }, - Unexpected_token_A_constructor_method_accessor_or_property_was_expected: { code: 1068, category: 1 /* Error */, key: "Unexpected token. A constructor, method, accessor, or property was expected." }, - A_declare_modifier_cannot_be_used_with_an_import_declaration: { code: 1079, category: 1 /* Error */, key: "A 'declare' modifier cannot be used with an import declaration." }, - Invalid_reference_directive_syntax: { code: 1084, category: 1 /* Error */, key: "Invalid 'reference' directive syntax." }, - Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher: { code: 1085, category: 1 /* Error */, key: "Octal literals are not available when targeting ECMAScript 5 and higher." }, - An_accessor_cannot_be_declared_in_an_ambient_context: { code: 1086, category: 1 /* Error */, key: "An accessor cannot be declared in an ambient context." }, - _0_modifier_cannot_appear_on_a_constructor_declaration: { code: 1089, category: 1 /* Error */, key: "'{0}' modifier cannot appear on a constructor declaration." }, - _0_modifier_cannot_appear_on_a_parameter: { code: 1090, category: 1 /* Error */, key: "'{0}' modifier cannot appear on a parameter." }, - Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement: { code: 1091, category: 1 /* Error */, key: "Only a single variable declaration is allowed in a 'for...in' statement." }, - Type_parameters_cannot_appear_on_a_constructor_declaration: { code: 1092, category: 1 /* Error */, key: "Type parameters cannot appear on a constructor declaration." }, - Type_annotation_cannot_appear_on_a_constructor_declaration: { code: 1093, category: 1 /* Error */, key: "Type annotation cannot appear on a constructor declaration." }, - An_accessor_cannot_have_type_parameters: { code: 1094, category: 1 /* Error */, key: "An accessor cannot have type parameters." }, - A_set_accessor_cannot_have_a_return_type_annotation: { code: 1095, category: 1 /* Error */, key: "A 'set' accessor cannot have a return type annotation." }, - An_index_signature_must_have_exactly_one_parameter: { code: 1096, category: 1 /* Error */, key: "An index signature must have exactly one parameter." }, - _0_list_cannot_be_empty: { code: 1097, category: 1 /* Error */, key: "'{0}' list cannot be empty." }, - Type_parameter_list_cannot_be_empty: { code: 1098, category: 1 /* Error */, key: "Type parameter list cannot be empty." }, - Type_argument_list_cannot_be_empty: { code: 1099, category: 1 /* Error */, key: "Type argument list cannot be empty." }, - Invalid_use_of_0_in_strict_mode: { code: 1100, category: 1 /* Error */, key: "Invalid use of '{0}' in strict mode." }, - with_statements_are_not_allowed_in_strict_mode: { code: 1101, category: 1 /* Error */, key: "'with' statements are not allowed in strict mode." }, - delete_cannot_be_called_on_an_identifier_in_strict_mode: { code: 1102, category: 1 /* Error */, key: "'delete' cannot be called on an identifier in strict mode." }, - A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement: { code: 1104, category: 1 /* Error */, key: "A 'continue' statement can only be used within an enclosing iteration statement." }, - A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement: { code: 1105, category: 1 /* Error */, key: "A 'break' statement can only be used within an enclosing iteration or switch statement." }, - Jump_target_cannot_cross_function_boundary: { code: 1107, category: 1 /* Error */, key: "Jump target cannot cross function boundary." }, - A_return_statement_can_only_be_used_within_a_function_body: { code: 1108, category: 1 /* Error */, key: "A 'return' statement can only be used within a function body." }, - Expression_expected: { code: 1109, category: 1 /* Error */, key: "Expression expected." }, - Type_expected: { code: 1110, category: 1 /* Error */, key: "Type expected." }, - A_constructor_implementation_cannot_be_declared_in_an_ambient_context: { code: 1111, category: 1 /* Error */, key: "A constructor implementation cannot be declared in an ambient context." }, - A_class_member_cannot_be_declared_optional: { code: 1112, category: 1 /* Error */, key: "A class member cannot be declared optional." }, - A_default_clause_cannot_appear_more_than_once_in_a_switch_statement: { code: 1113, category: 1 /* Error */, key: "A 'default' clause cannot appear more than once in a 'switch' statement." }, - Duplicate_label_0: { code: 1114, category: 1 /* Error */, key: "Duplicate label '{0}'" }, - A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: { code: 1115, category: 1 /* Error */, key: "A 'continue' statement can only jump to a label of an enclosing iteration statement." }, - A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: { code: 1116, category: 1 /* Error */, key: "A 'break' statement can only jump to a label of an enclosing statement." }, - An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode: { code: 1117, category: 1 /* Error */, key: "An object literal cannot have multiple properties with the same name in strict mode." }, - An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name: { code: 1118, category: 1 /* Error */, key: "An object literal cannot have multiple get/set accessors with the same name." }, - An_object_literal_cannot_have_property_and_accessor_with_the_same_name: { code: 1119, category: 1 /* Error */, key: "An object literal cannot have property and accessor with the same name." }, - An_export_assignment_cannot_have_modifiers: { code: 1120, category: 1 /* Error */, key: "An export assignment cannot have modifiers." }, - Octal_literals_are_not_allowed_in_strict_mode: { code: 1121, category: 1 /* Error */, key: "Octal literals are not allowed in strict mode." }, - A_tuple_type_element_list_cannot_be_empty: { code: 1122, category: 1 /* Error */, key: "A tuple type element list cannot be empty." }, - Variable_declaration_list_cannot_be_empty: { code: 1123, category: 1 /* Error */, key: "Variable declaration list cannot be empty." }, - Digit_expected: { code: 1124, category: 1 /* Error */, key: "Digit expected." }, - Hexadecimal_digit_expected: { code: 1125, category: 1 /* Error */, key: "Hexadecimal digit expected." }, - Unexpected_end_of_text: { code: 1126, category: 1 /* Error */, key: "Unexpected end of text." }, - Invalid_character: { code: 1127, category: 1 /* Error */, key: "Invalid character." }, - Declaration_or_statement_expected: { code: 1128, category: 1 /* Error */, key: "Declaration or statement expected." }, - Statement_expected: { code: 1129, category: 1 /* Error */, key: "Statement expected." }, - case_or_default_expected: { code: 1130, category: 1 /* Error */, key: "'case' or 'default' expected." }, - Property_or_signature_expected: { code: 1131, category: 1 /* Error */, key: "Property or signature expected." }, - Enum_member_expected: { code: 1132, category: 1 /* Error */, key: "Enum member expected." }, - Type_reference_expected: { code: 1133, category: 1 /* Error */, key: "Type reference expected." }, - Variable_declaration_expected: { code: 1134, category: 1 /* Error */, key: "Variable declaration expected." }, - Argument_expression_expected: { code: 1135, category: 1 /* Error */, key: "Argument expression expected." }, - Property_assignment_expected: { code: 1136, category: 1 /* Error */, key: "Property assignment expected." }, - Expression_or_comma_expected: { code: 1137, category: 1 /* Error */, key: "Expression or comma expected." }, - Parameter_declaration_expected: { code: 1138, category: 1 /* Error */, key: "Parameter declaration expected." }, - Type_parameter_declaration_expected: { code: 1139, category: 1 /* Error */, key: "Type parameter declaration expected." }, - Type_argument_expected: { code: 1140, category: 1 /* Error */, key: "Type argument expected." }, - String_literal_expected: { code: 1141, category: 1 /* Error */, key: "String literal expected." }, - Line_break_not_permitted_here: { code: 1142, category: 1 /* Error */, key: "Line break not permitted here." }, - catch_or_finally_expected: { code: 1143, category: 1 /* Error */, key: "'catch' or 'finally' expected." }, - Block_or_expected: { code: 1144, category: 1 /* Error */, key: "Block or ';' expected." }, - Modifiers_not_permitted_on_index_signature_members: { code: 1145, category: 1 /* Error */, key: "Modifiers not permitted on index signature members." }, - Declaration_expected: { code: 1146, category: 1 /* Error */, key: "Declaration expected." }, - Import_declarations_in_an_internal_module_cannot_reference_an_external_module: { code: 1147, category: 1 /* Error */, key: "Import declarations in an internal module cannot reference an external module." }, - Cannot_compile_external_modules_unless_the_module_flag_is_provided: { code: 1148, category: 1 /* Error */, key: "Cannot compile external modules unless the '--module' flag is provided." }, - Filename_0_differs_from_already_included_filename_1_only_in_casing: { code: 1149, category: 1 /* Error */, key: "Filename '{0}' differs from already included filename '{1}' only in casing" }, - new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: { code: 1150, category: 1 /* Error */, key: "'new T[]' cannot be used to create an array. Use 'new Array()' instead." }, - An_enum_member_cannot_have_a_numeric_name: { code: 1151, category: 1 /* Error */, key: "An enum member cannot have a numeric name." }, - Duplicate_identifier_0: { code: 2300, category: 1 /* Error */, key: "Duplicate identifier '{0}'." }, - Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: 1 /* Error */, key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." }, - Static_members_cannot_reference_class_type_parameters: { code: 2302, category: 1 /* Error */, key: "Static members cannot reference class type parameters." }, - Circular_definition_of_import_alias_0: { code: 2303, category: 1 /* Error */, key: "Circular definition of import alias '{0}'." }, - Cannot_find_name_0: { code: 2304, category: 1 /* Error */, key: "Cannot find name '{0}'." }, - Module_0_has_no_exported_member_1: { code: 2305, category: 1 /* Error */, key: "Module '{0}' has no exported member '{1}'." }, - File_0_is_not_an_external_module: { code: 2306, category: 1 /* Error */, key: "File '{0}' is not an external module." }, - Cannot_find_external_module_0: { code: 2307, category: 1 /* Error */, key: "Cannot find external module '{0}'." }, - A_module_cannot_have_more_than_one_export_assignment: { code: 2308, category: 1 /* Error */, key: "A module cannot have more than one export assignment." }, - An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements: { code: 2309, category: 1 /* Error */, key: "An export assignment cannot be used in a module with other exported elements." }, - Type_0_recursively_references_itself_as_a_base_type: { code: 2310, category: 1 /* Error */, key: "Type '{0}' recursively references itself as a base type." }, - A_class_may_only_extend_another_class: { code: 2311, category: 1 /* Error */, key: "A class may only extend another class." }, - An_interface_may_only_extend_a_class_or_another_interface: { code: 2312, category: 1 /* Error */, key: "An interface may only extend a class or another interface." }, - Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list: { code: 2313, category: 1 /* Error */, key: "Constraint of a type parameter cannot reference any type parameter from the same type parameter list." }, - Generic_type_0_requires_1_type_argument_s: { code: 2314, category: 1 /* Error */, key: "Generic type '{0}' requires {1} type argument(s)." }, - Type_0_is_not_generic: { code: 2315, category: 1 /* Error */, key: "Type '{0}' is not generic." }, - Global_type_0_must_be_a_class_or_interface_type: { code: 2316, category: 1 /* Error */, key: "Global type '{0}' must be a class or interface type." }, - Global_type_0_must_have_1_type_parameter_s: { code: 2317, category: 1 /* Error */, key: "Global type '{0}' must have {1} type parameter(s)." }, - Cannot_find_global_type_0: { code: 2318, category: 1 /* Error */, key: "Cannot find global type '{0}'." }, - Named_properties_0_of_types_1_and_2_are_not_identical: { code: 2319, category: 1 /* Error */, key: "Named properties '{0}' of types '{1}' and '{2}' are not identical." }, - Interface_0_cannot_simultaneously_extend_types_1_and_2_Colon: { code: 2320, category: 1 /* Error */, key: "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}':" }, - Excessive_stack_depth_comparing_types_0_and_1: { code: 2321, category: 1 /* Error */, key: "Excessive stack depth comparing types '{0}' and '{1}'." }, - Type_0_is_not_assignable_to_type_1_Colon: { code: 2322, category: 1 /* Error */, key: "Type '{0}' is not assignable to type '{1}':" }, - Type_0_is_not_assignable_to_type_1: { code: 2323, category: 1 /* Error */, key: "Type '{0}' is not assignable to type '{1}'." }, - Property_0_is_missing_in_type_1: { code: 2324, category: 1 /* Error */, key: "Property '{0}' is missing in type '{1}'." }, - Property_0_is_private_in_type_1_but_not_in_type_2: { code: 2325, category: 1 /* Error */, key: "Property '{0}' is private in type '{1}' but not in type '{2}'." }, - Types_of_property_0_are_incompatible_Colon: { code: 2326, category: 1 /* Error */, key: "Types of property '{0}' are incompatible:" }, - Property_0_is_optional_in_type_1_but_required_in_type_2: { code: 2327, category: 1 /* Error */, key: "Property '{0}' is optional in type '{1}' but required in type '{2}'." }, - Types_of_parameters_0_and_1_are_incompatible_Colon: { code: 2328, category: 1 /* Error */, key: "Types of parameters '{0}' and '{1}' are incompatible:" }, - Index_signature_is_missing_in_type_0: { code: 2329, category: 1 /* Error */, key: "Index signature is missing in type '{0}'." }, - Index_signatures_are_incompatible_Colon: { code: 2330, category: 1 /* Error */, key: "Index signatures are incompatible:" }, - this_cannot_be_referenced_in_a_module_body: { code: 2331, category: 1 /* Error */, key: "'this' cannot be referenced in a module body." }, - this_cannot_be_referenced_in_current_location: { code: 2332, category: 1 /* Error */, key: "'this' cannot be referenced in current location." }, - this_cannot_be_referenced_in_constructor_arguments: { code: 2333, category: 1 /* Error */, key: "'this' cannot be referenced in constructor arguments." }, - this_cannot_be_referenced_in_a_static_property_initializer: { code: 2334, category: 1 /* Error */, key: "'this' cannot be referenced in a static property initializer." }, - super_can_only_be_referenced_in_a_derived_class: { code: 2335, category: 1 /* Error */, key: "'super' can only be referenced in a derived class." }, - super_cannot_be_referenced_in_constructor_arguments: { code: 2336, category: 1 /* Error */, key: "'super' cannot be referenced in constructor arguments." }, - Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors: { code: 2337, category: 1 /* Error */, key: "Super calls are not permitted outside constructors or in nested functions inside constructors" }, - super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class: { code: 2338, category: 1 /* Error */, key: "'super' property access is permitted only in a constructor, member function, or member accessor of a derived class" }, - Property_0_does_not_exist_on_type_1: { code: 2339, category: 1 /* Error */, key: "Property '{0}' does not exist on type '{1}'." }, - Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword: { code: 2340, category: 1 /* Error */, key: "Only public and protected methods of the base class are accessible via the 'super' keyword" }, - Property_0_is_private_and_only_accessible_within_class_1: { code: 2341, category: 1 /* Error */, key: "Property '{0}' is private and only accessible within class '{1}'." }, - An_index_expression_argument_must_be_of_type_string_number_or_any: { code: 2342, category: 1 /* Error */, key: "An index expression argument must be of type 'string', 'number', or 'any'." }, - Type_0_does_not_satisfy_the_constraint_1_Colon: { code: 2343, category: 1 /* Error */, key: "Type '{0}' does not satisfy the constraint '{1}':" }, - Type_0_does_not_satisfy_the_constraint_1: { code: 2344, category: 1 /* Error */, key: "Type '{0}' does not satisfy the constraint '{1}'." }, - Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: { code: 2345, category: 1 /* Error */, key: "Argument of type '{0}' is not assignable to parameter of type '{1}'." }, - Supplied_parameters_do_not_match_any_signature_of_call_target: { code: 2346, category: 1 /* Error */, key: "Supplied parameters do not match any signature of call target." }, - Untyped_function_calls_may_not_accept_type_arguments: { code: 2347, category: 1 /* Error */, key: "Untyped function calls may not accept type arguments." }, - Value_of_type_0_is_not_callable_Did_you_mean_to_include_new: { code: 2348, category: 1 /* Error */, key: "Value of type '{0}' is not callable. Did you mean to include 'new'?" }, - Cannot_invoke_an_expression_whose_type_lacks_a_call_signature: { code: 2349, category: 1 /* Error */, key: "Cannot invoke an expression whose type lacks a call signature." }, - Only_a_void_function_can_be_called_with_the_new_keyword: { code: 2350, category: 1 /* Error */, key: "Only a void function can be called with the 'new' keyword." }, - Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature: { code: 2351, category: 1 /* Error */, key: "Cannot use 'new' with an expression whose type lacks a call or construct signature." }, - Neither_type_0_nor_type_1_is_assignable_to_the_other: { code: 2352, category: 1 /* Error */, key: "Neither type '{0}' nor type '{1}' is assignable to the other." }, - Neither_type_0_nor_type_1_is_assignable_to_the_other_Colon: { code: 2353, category: 1 /* Error */, key: "Neither type '{0}' nor type '{1}' is assignable to the other:" }, - No_best_common_type_exists_among_return_expressions: { code: 2354, category: 1 /* Error */, key: "No best common type exists among return expressions." }, - A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2355, category: 1 /* Error */, key: "A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement." }, - An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type: { code: 2356, category: 1 /* Error */, key: "An arithmetic operand must be of type 'any', 'number' or an enum type." }, - The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer: { code: 2357, category: 1 /* Error */, key: "The operand of an increment or decrement operator must be a variable, property or indexer." }, - The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2358, category: 1 /* Error */, key: "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter." }, - The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: { code: 2359, category: 1 /* Error */, key: "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type." }, - The_left_hand_side_of_an_in_expression_must_be_of_types_any_string_or_number: { code: 2360, category: 1 /* Error */, key: "The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'." }, - The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2361, category: 1 /* Error */, key: "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter" }, - The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2362, category: 1 /* Error */, key: "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, - The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2363, category: 1 /* Error */, key: "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, - Invalid_left_hand_side_of_assignment_expression: { code: 2364, category: 1 /* Error */, key: "Invalid left-hand side of assignment expression." }, - Operator_0_cannot_be_applied_to_types_1_and_2: { code: 2365, category: 1 /* Error */, key: "Operator '{0}' cannot be applied to types '{1}' and '{2}'." }, - No_best_common_type_exists_between_0_1_and_2: { code: 2366, category: 1 /* Error */, key: "No best common type exists between '{0}', '{1}', and '{2}'." }, - No_best_common_type_exists_between_0_and_1: { code: 2367, category: 1 /* Error */, key: "No best common type exists between '{0}' and '{1}'." }, - Type_parameter_name_cannot_be_0: { code: 2368, category: 1 /* Error */, key: "Type parameter name cannot be '{0}'" }, - A_parameter_property_is_only_allowed_in_a_constructor_implementation: { code: 2369, category: 1 /* Error */, key: "A parameter property is only allowed in a constructor implementation." }, - A_rest_parameter_must_be_of_an_array_type: { code: 2370, category: 1 /* Error */, key: "A rest parameter must be of an array type." }, - A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation: { code: 2371, category: 1 /* Error */, key: "A parameter initializer is only allowed in a function or constructor implementation." }, - Parameter_0_cannot_be_referenced_in_its_initializer: { code: 2372, category: 1 /* Error */, key: "Parameter '{0}' cannot be referenced in its initializer." }, - Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it: { code: 2373, category: 1 /* Error */, key: "Initializer of parameter '{0}' cannot reference identifier '{1}' declared after it." }, - Duplicate_string_index_signature: { code: 2374, category: 1 /* Error */, key: "Duplicate string index signature." }, - Duplicate_number_index_signature: { code: 2375, category: 1 /* Error */, key: "Duplicate number index signature." }, - A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties: { code: 2376, category: 1 /* Error */, key: "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties." }, - Constructors_for_derived_classes_must_contain_a_super_call: { code: 2377, category: 1 /* Error */, key: "Constructors for derived classes must contain a 'super' call." }, - A_get_accessor_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2378, category: 1 /* Error */, key: "A 'get' accessor must return a value or consist of a single 'throw' statement." }, - Getter_and_setter_accessors_do_not_agree_in_visibility: { code: 2379, category: 1 /* Error */, key: "Getter and setter accessors do not agree in visibility." }, - get_and_set_accessor_must_have_the_same_type: { code: 2380, category: 1 /* Error */, key: "'get' and 'set' accessor must have the same type." }, - A_signature_with_an_implementation_cannot_use_a_string_literal_type: { code: 2381, category: 1 /* Error */, key: "A signature with an implementation cannot use a string literal type." }, - Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature: { code: 2382, category: 1 /* Error */, key: "Specialized overload signature is not assignable to any non-specialized signature." }, - Overload_signatures_must_all_be_exported_or_not_exported: { code: 2383, category: 1 /* Error */, key: "Overload signatures must all be exported or not exported." }, - Overload_signatures_must_all_be_ambient_or_non_ambient: { code: 2384, category: 1 /* Error */, key: "Overload signatures must all be ambient or non-ambient." }, - Overload_signatures_must_all_be_public_private_or_protected: { code: 2385, category: 1 /* Error */, key: "Overload signatures must all be public, private or protected." }, - Overload_signatures_must_all_be_optional_or_required: { code: 2386, category: 1 /* Error */, key: "Overload signatures must all be optional or required." }, - Function_overload_must_be_static: { code: 2387, category: 1 /* Error */, key: "Function overload must be static." }, - Function_overload_must_not_be_static: { code: 2388, category: 1 /* Error */, key: "Function overload must not be static." }, - Function_implementation_name_must_be_0: { code: 2389, category: 1 /* Error */, key: "Function implementation name must be '{0}'." }, - Constructor_implementation_is_missing: { code: 2390, category: 1 /* Error */, key: "Constructor implementation is missing." }, - Function_implementation_is_missing_or_not_immediately_following_the_declaration: { code: 2391, category: 1 /* Error */, key: "Function implementation is missing or not immediately following the declaration." }, - Multiple_constructor_implementations_are_not_allowed: { code: 2392, category: 1 /* Error */, key: "Multiple constructor implementations are not allowed." }, - Duplicate_function_implementation: { code: 2393, category: 1 /* Error */, key: "Duplicate function implementation." }, - Overload_signature_is_not_compatible_with_function_implementation: { code: 2394, category: 1 /* Error */, key: "Overload signature is not compatible with function implementation." }, - Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local: { code: 2395, category: 1 /* Error */, key: "Individual declarations in merged declaration {0} must be all exported or all local." }, - Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters: { code: 2396, category: 1 /* Error */, key: "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters." }, - Duplicate_identifier_i_Compiler_uses_i_to_initialize_rest_parameter: { code: 2397, category: 1 /* Error */, key: "Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter." }, - Expression_resolves_to_variable_declaration_i_that_compiler_uses_to_initialize_rest_parameter: { code: 2398, category: 1 /* Error */, key: "Expression resolves to variable declaration '_i' that compiler uses to initialize rest parameter." }, - Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference: { code: 2399, category: 1 /* Error */, key: "Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference." }, - Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference: { code: 2400, category: 1 /* Error */, key: "Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference." }, - Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference: { code: 2401, category: 1 /* Error */, key: "Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference." }, - Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference: { code: 2402, category: 1 /* Error */, key: "Expression resolves to '_super' that compiler uses to capture base class reference." }, - Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2: { code: 2403, category: 1 /* Error */, key: "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'." }, - The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation: { code: 2404, category: 1 /* Error */, key: "The left-hand side of a 'for...in' statement cannot use a type annotation." }, - The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any: { code: 2405, category: 1 /* Error */, key: "The left-hand side of a 'for...in' statement must be of type 'string' or 'any'." }, - Invalid_left_hand_side_in_for_in_statement: { code: 2406, category: 1 /* Error */, key: "Invalid left-hand side in 'for...in' statement." }, - The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2407, category: 1 /* Error */, key: "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter." }, - Setters_cannot_return_a_value: { code: 2408, category: 1 /* Error */, key: "Setters cannot return a value." }, - Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: { code: 2409, category: 1 /* Error */, key: "Return type of constructor signature must be assignable to the instance type of the class" }, - All_symbols_within_a_with_block_will_be_resolved_to_any: { code: 2410, category: 1 /* Error */, key: "All symbols within a 'with' block will be resolved to 'any'." }, - Property_0_of_type_1_is_not_assignable_to_string_index_type_2: { code: 2411, category: 1 /* Error */, key: "Property '{0}' of type '{1}' is not assignable to string index type '{2}'." }, - Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2: { code: 2412, category: 1 /* Error */, key: "Property '{0}' of type '{1}' is not assignable to numeric index type '{2}'." }, - Numeric_index_type_0_is_not_assignable_to_string_index_type_1: { code: 2413, category: 1 /* Error */, key: "Numeric index type '{0}' is not assignable to string index type '{1}'." }, - Class_name_cannot_be_0: { code: 2414, category: 1 /* Error */, key: "Class name cannot be '{0}'" }, - Class_0_incorrectly_extends_base_class_1: { code: 2415, category: 1 /* Error */, key: "Class '{0}' incorrectly extends base class '{1}'." }, - Class_0_incorrectly_extends_base_class_1_Colon: { code: 2416, category: 1 /* Error */, key: "Class '{0}' incorrectly extends base class '{1}':" }, - Class_static_side_0_incorrectly_extends_base_class_static_side_1: { code: 2417, category: 1 /* Error */, key: "Class static side '{0}' incorrectly extends base class static side '{1}'." }, - Class_static_side_0_incorrectly_extends_base_class_static_side_1_Colon: { code: 2418, category: 1 /* Error */, key: "Class static side '{0}' incorrectly extends base class static side '{1}':" }, - Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0: { code: 2419, category: 1 /* Error */, key: "Type name '{0}' in extends clause does not reference constructor function for '{0}'." }, - Class_0_incorrectly_implements_interface_1: { code: 2420, category: 1 /* Error */, key: "Class '{0}' incorrectly implements interface '{1}'." }, - Class_0_incorrectly_implements_interface_1_Colon: { code: 2421, category: 1 /* Error */, key: "Class '{0}' incorrectly implements interface '{1}':" }, - A_class_may_only_implement_another_class_or_interface: { code: 2422, category: 1 /* Error */, key: "A class may only implement another class or interface." }, - Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: { code: 2423, category: 1 /* Error */, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor." }, - Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: { code: 2424, category: 1 /* Error */, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property." }, - Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2425, category: 1 /* Error */, key: "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function." }, - Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2426, category: 1 /* Error */, key: "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function." }, - Interface_name_cannot_be_0: { code: 2427, category: 1 /* Error */, key: "Interface name cannot be '{0}'" }, - All_declarations_of_an_interface_must_have_identical_type_parameters: { code: 2428, category: 1 /* Error */, key: "All declarations of an interface must have identical type parameters." }, - Interface_0_incorrectly_extends_interface_1_Colon: { code: 2429, category: 1 /* Error */, key: "Interface '{0}' incorrectly extends interface '{1}':" }, - Interface_0_incorrectly_extends_interface_1: { code: 2430, category: 1 /* Error */, key: "Interface '{0}' incorrectly extends interface '{1}'." }, - Enum_name_cannot_be_0: { code: 2431, category: 1 /* Error */, key: "Enum name cannot be '{0}'" }, - In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element: { code: 2432, category: 1 /* Error */, key: "In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element." }, - A_module_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged: { code: 2433, category: 1 /* Error */, key: "A module declaration cannot be in a different file from a class or function with which it is merged" }, - A_module_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged: { code: 2434, category: 1 /* Error */, key: "A module declaration cannot be located prior to a class or function with which it is merged" }, - Ambient_external_modules_cannot_be_nested_in_other_modules: { code: 2435, category: 1 /* Error */, key: "Ambient external modules cannot be nested in other modules." }, - Ambient_external_module_declaration_cannot_specify_relative_module_name: { code: 2436, category: 1 /* Error */, key: "Ambient external module declaration cannot specify relative module name." }, - Module_0_is_hidden_by_a_local_declaration_with_the_same_name: { code: 2437, category: 1 /* Error */, key: "Module '{0}' is hidden by a local declaration with the same name" }, - Import_name_cannot_be_0: { code: 2438, category: 1 /* Error */, key: "Import name cannot be '{0}'" }, - Import_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name: { code: 2439, category: 1 /* Error */, key: "Import declaration in an ambient external module declaration cannot reference external module through relative external module name." }, - Import_declaration_conflicts_with_local_declaration_of_0: { code: 2440, category: 1 /* Error */, key: "Import declaration conflicts with local declaration of '{0}'" }, - Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module: { code: 2441, category: 1 /* Error */, key: "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of an external module." }, - Types_have_separate_declarations_of_a_private_property_0: { code: 2442, category: 1 /* Error */, key: "Types have separate declarations of a private property '{0}'." }, - Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2: { code: 2443, category: 1 /* Error */, key: "Property '{0}' is protected but type '{1}' is not a class derived from '{2}'." }, - Property_0_is_protected_in_type_1_but_public_in_type_2: { code: 2444, category: 1 /* Error */, key: "Property '{0}' is protected in type '{1}' but public in type '{2}'." }, - Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses: { code: 2445, category: 1 /* Error */, key: "Property '{0}' is protected and only accessible within class '{1}' and its subclasses." }, - Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1: { code: 2446, category: 1 /* Error */, key: "Property '{0}' is protected and only accessible through an instance of class '{1}'." }, - The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead: { code: 2447, category: 1 /* Error */, key: "The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead." }, - Import_declaration_0_is_using_private_name_1: { code: 4000, category: 1 /* Error */, key: "Import declaration '{0}' is using private name '{1}'." }, - Type_parameter_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4001, category: 1 /* Error */, key: "Type parameter '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: 1 /* Error */, key: "Type parameter '{0}' of exported class has or is using private name '{1}'." }, - Type_parameter_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4003, category: 1 /* Error */, key: "Type parameter '{0}' of exported interface has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4004, category: 1 /* Error */, key: "Type parameter '{0}' of exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4005, category: 1 /* Error */, key: "Type parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4006, category: 1 /* Error */, key: "Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4007, category: 1 /* Error */, key: "Type parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4008, category: 1 /* Error */, key: "Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4009, category: 1 /* Error */, key: "Type parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { code: 4010, category: 1 /* Error */, key: "Type parameter '{0}' of public static method from exported class has or is using private name '{1}'." }, - Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4011, category: 1 /* Error */, key: "Type parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { code: 4012, category: 1 /* Error */, key: "Type parameter '{0}' of public method from exported class has or is using private name '{1}'." }, - Type_parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4013, category: 1 /* Error */, key: "Type parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 4014, category: 1 /* Error */, key: "Type parameter '{0}' of method from exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: { code: 4015, category: 1 /* Error */, key: "Type parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4016, category: 1 /* Error */, key: "Type parameter '{0}' of exported function has or is using private name '{1}'." }, - Implements_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2: { code: 4017, category: 1 /* Error */, key: "Implements clause of exported class '{0}' has or is using name '{1}' from private module '{2}'." }, - Extends_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2: { code: 4018, category: 1 /* Error */, key: "Extends clause of exported class '{0}' has or is using name '{1}' from private module '{2}'." }, - Implements_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4019, category: 1 /* Error */, key: "Implements clause of exported class '{0}' has or is using private name '{1}'." }, - Extends_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4020, category: 1 /* Error */, key: "Extends clause of exported class '{0}' has or is using private name '{1}'." }, - Extends_clause_of_exported_interface_0_has_or_is_using_name_1_from_private_module_2: { code: 4021, category: 1 /* Error */, key: "Extends clause of exported interface '{0}' has or is using name '{1}' from private module '{2}'." }, - Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1: { code: 4022, category: 1 /* Error */, key: "Extends clause of exported interface '{0}' has or is using private name '{1}'." }, - Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4023, category: 1 /* Error */, key: "Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named." }, - Exported_variable_0_has_or_is_using_name_1_from_private_module_2: { code: 4024, category: 1 /* Error */, key: "Exported variable '{0}' has or is using name '{1}' from private module '{2}'." }, - Exported_variable_0_has_or_is_using_private_name_1: { code: 4025, category: 1 /* Error */, key: "Exported variable '{0}' has or is using private name '{1}'." }, - Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4026, category: 1 /* Error */, key: "Public static property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4027, category: 1 /* Error */, key: "Public static property '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, - Public_static_property_0_of_exported_class_has_or_is_using_private_name_1: { code: 4028, category: 1 /* Error */, key: "Public static property '{0}' of exported class has or is using private name '{1}'." }, - Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4029, category: 1 /* Error */, key: "Public property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4030, category: 1 /* Error */, key: "Public property '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, - Public_property_0_of_exported_class_has_or_is_using_private_name_1: { code: 4031, category: 1 /* Error */, key: "Public property '{0}' of exported class has or is using private name '{1}'." }, - Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4032, category: 1 /* Error */, key: "Property '{0}' of exported interface has or is using name '{1}' from private module '{2}'." }, - Property_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4033, category: 1 /* Error */, key: "Property '{0}' of exported interface has or is using private name '{1}'." }, - Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4034, category: 1 /* Error */, key: "Parameter '{0}' of public static property setter from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1: { code: 4035, category: 1 /* Error */, key: "Parameter '{0}' of public static property setter from exported class has or is using private name '{1}'." }, - Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4036, category: 1 /* Error */, key: "Parameter '{0}' of public property setter from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_name_1: { code: 4037, category: 1 /* Error */, key: "Parameter '{0}' of public property setter from exported class has or is using private name '{1}'." }, - Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4038, category: 1 /* Error */, key: "Return type of public static property getter from exported class has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4039, category: 1 /* Error */, key: "Return type of public static property getter from exported class has or is using name '{0}' from private module '{1}'." }, - Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_name_0: { code: 4040, category: 1 /* Error */, key: "Return type of public static property getter from exported class has or is using private name '{0}'." }, - Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4041, category: 1 /* Error */, key: "Return type of public property getter from exported class has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4042, category: 1 /* Error */, key: "Return type of public property getter from exported class has or is using name '{0}' from private module '{1}'." }, - Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_name_0: { code: 4043, category: 1 /* Error */, key: "Return type of public property getter from exported class has or is using private name '{0}'." }, - Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4044, category: 1 /* Error */, key: "Return type of constructor signature from exported interface has or is using name '{0}' from private module '{1}'." }, - Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4045, category: 1 /* Error */, key: "Return type of constructor signature from exported interface has or is using private name '{0}'." }, - Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4046, category: 1 /* Error */, key: "Return type of call signature from exported interface has or is using name '{0}' from private module '{1}'." }, - Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4047, category: 1 /* Error */, key: "Return type of call signature from exported interface has or is using private name '{0}'." }, - Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4048, category: 1 /* Error */, key: "Return type of index signature from exported interface has or is using name '{0}' from private module '{1}'." }, - Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4049, category: 1 /* Error */, key: "Return type of index signature from exported interface has or is using private name '{0}'." }, - Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4050, category: 1 /* Error */, key: "Return type of public static method from exported class has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4051, category: 1 /* Error */, key: "Return type of public static method from exported class has or is using name '{0}' from private module '{1}'." }, - Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0: { code: 4052, category: 1 /* Error */, key: "Return type of public static method from exported class has or is using private name '{0}'." }, - Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4053, category: 1 /* Error */, key: "Return type of public method from exported class has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4054, category: 1 /* Error */, key: "Return type of public method from exported class has or is using name '{0}' from private module '{1}'." }, - Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0: { code: 4055, category: 1 /* Error */, key: "Return type of public method from exported class has or is using private name '{0}'." }, - Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4056, category: 1 /* Error */, key: "Return type of method from exported interface has or is using name '{0}' from private module '{1}'." }, - Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0: { code: 4057, category: 1 /* Error */, key: "Return type of method from exported interface has or is using private name '{0}'." }, - Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4058, category: 1 /* Error */, key: "Return type of exported function has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1: { code: 4059, category: 1 /* Error */, key: "Return type of exported function has or is using name '{0}' from private module '{1}'." }, - Return_type_of_exported_function_has_or_is_using_private_name_0: { code: 4060, category: 1 /* Error */, key: "Return type of exported function has or is using private name '{0}'." }, - Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4061, category: 1 /* Error */, key: "Parameter '{0}' of constructor from exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4062, category: 1 /* Error */, key: "Parameter '{0}' of constructor from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1: { code: 4063, category: 1 /* Error */, key: "Parameter '{0}' of constructor from exported class has or is using private name '{1}'." }, - Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4064, category: 1 /* Error */, key: "Parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4065, category: 1 /* Error */, key: "Parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." }, - Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4066, category: 1 /* Error */, key: "Parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4067, category: 1 /* Error */, key: "Parameter '{0}' of call signature from exported interface has or is using private name '{1}'." }, - Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4068, category: 1 /* Error */, key: "Parameter '{0}' of public static method from exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4069, category: 1 /* Error */, key: "Parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { code: 4070, category: 1 /* Error */, key: "Parameter '{0}' of public static method from exported class has or is using private name '{1}'." }, - Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4071, category: 1 /* Error */, key: "Parameter '{0}' of public method from exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4072, category: 1 /* Error */, key: "Parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { code: 4073, category: 1 /* Error */, key: "Parameter '{0}' of public method from exported class has or is using private name '{1}'." }, - Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4074, category: 1 /* Error */, key: "Parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 4075, category: 1 /* Error */, key: "Parameter '{0}' of method from exported interface has or is using private name '{1}'." }, - Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4076, category: 1 /* Error */, key: "Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named." }, - Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: { code: 4077, category: 1 /* Error */, key: "Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4078, category: 1 /* Error */, key: "Parameter '{0}' of exported function has or is using private name '{1}'." }, - The_current_host_does_not_support_the_0_option: { code: 5001, category: 1 /* Error */, key: "The current host does not support the '{0}' option." }, - Cannot_find_the_common_subdirectory_path_for_the_input_files: { code: 5009, category: 1 /* Error */, key: "Cannot find the common subdirectory path for the input files." }, - Cannot_read_file_0_Colon_1: { code: 5012, category: 1 /* Error */, key: "Cannot read file '{0}': {1}" }, - Unsupported_file_encoding: { code: 5013, category: 1 /* Error */, key: "Unsupported file encoding." }, - Unknown_compiler_option_0: { code: 5023, category: 1 /* Error */, key: "Unknown compiler option '{0}'." }, - Could_not_write_file_0_Colon_1: { code: 5033, category: 1 /* Error */, key: "Could not write file '{0}': {1}" }, - Option_mapRoot_cannot_be_specified_without_specifying_sourcemap_option: { code: 5038, category: 1 /* Error */, key: "Option mapRoot cannot be specified without specifying sourcemap option." }, - Option_sourceRoot_cannot_be_specified_without_specifying_sourcemap_option: { code: 5039, category: 1 /* Error */, key: "Option sourceRoot cannot be specified without specifying sourcemap option." }, - Concatenate_and_emit_output_to_single_file: { code: 6001, category: 2 /* Message */, key: "Concatenate and emit output to single file." }, - Generates_corresponding_d_ts_file: { code: 6002, category: 2 /* Message */, key: "Generates corresponding '.d.ts' file." }, - Specifies_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations: { code: 6003, category: 2 /* Message */, key: "Specifies the location where debugger should locate map files instead of generated locations." }, - Specifies_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations: { code: 6004, category: 2 /* Message */, key: "Specifies the location where debugger should locate TypeScript files instead of source locations." }, - Watch_input_files: { code: 6005, category: 2 /* Message */, key: "Watch input files." }, - Redirect_output_structure_to_the_directory: { code: 6006, category: 2 /* Message */, key: "Redirect output structure to the directory." }, - Do_not_emit_comments_to_output: { code: 6009, category: 2 /* Message */, key: "Do not emit comments to output." }, - Specify_ECMAScript_target_version_Colon_ES3_default_or_ES5: { code: 6015, category: 2 /* Message */, key: "Specify ECMAScript target version: 'ES3' (default), or 'ES5'" }, - Specify_module_code_generation_Colon_commonjs_or_amd: { code: 6016, category: 2 /* Message */, key: "Specify module code generation: 'commonjs' or 'amd'" }, - Print_this_message: { code: 6017, category: 2 /* Message */, key: "Print this message." }, - Print_the_compiler_s_version: { code: 6019, category: 2 /* Message */, key: "Print the compiler's version." }, - Syntax_Colon_0: { code: 6023, category: 2 /* Message */, key: "Syntax: {0}" }, - options: { code: 6024, category: 2 /* Message */, key: "options" }, - file: { code: 6025, category: 2 /* Message */, key: "file" }, - Examples_Colon_0: { code: 6026, category: 2 /* Message */, key: "Examples: {0}" }, - Options_Colon: { code: 6027, category: 2 /* Message */, key: "Options:" }, - Version_0: { code: 6029, category: 2 /* Message */, key: "Version {0}" }, - Insert_command_line_options_and_files_from_a_file: { code: 6030, category: 2 /* Message */, key: "Insert command line options and files from a file." }, - File_change_detected_Compiling: { code: 6032, category: 2 /* Message */, key: "File change detected. Compiling..." }, - KIND: { code: 6034, category: 2 /* Message */, key: "KIND" }, - FILE: { code: 6035, category: 2 /* Message */, key: "FILE" }, - VERSION: { code: 6036, category: 2 /* Message */, key: "VERSION" }, - LOCATION: { code: 6037, category: 2 /* Message */, key: "LOCATION" }, - DIRECTORY: { code: 6038, category: 2 /* Message */, key: "DIRECTORY" }, - Compilation_complete_Watching_for_file_changes: { code: 6042, category: 2 /* Message */, key: "Compilation complete. Watching for file changes." }, - Generates_corresponding_map_file: { code: 6043, category: 2 /* Message */, key: "Generates corresponding '.map' file." }, - Compiler_option_0_expects_an_argument: { code: 6044, category: 1 /* Error */, key: "Compiler option '{0}' expects an argument." }, - Unterminated_quoted_string_in_response_file_0: { code: 6045, category: 1 /* Error */, key: "Unterminated quoted string in response file '{0}'." }, - Argument_for_module_option_must_be_commonjs_or_amd: { code: 6046, category: 1 /* Error */, key: "Argument for '--module' option must be 'commonjs' or 'amd'." }, - Argument_for_target_option_must_be_es3_or_es5: { code: 6047, category: 1 /* Error */, key: "Argument for '--target' option must be 'es3' or 'es5'." }, - Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: { code: 6048, category: 1 /* Error */, key: "Locale must be of the form or -. For example '{0}' or '{1}'." }, - Unsupported_locale_0: { code: 6049, category: 1 /* Error */, key: "Unsupported locale '{0}'." }, - Unable_to_open_file_0: { code: 6050, category: 1 /* Error */, key: "Unable to open file '{0}'." }, - Corrupted_locale_file_0: { code: 6051, category: 1 /* Error */, key: "Corrupted locale file {0}." }, - Warn_on_expressions_and_declarations_with_an_implied_any_type: { code: 6052, category: 2 /* Message */, key: "Warn on expressions and declarations with an implied 'any' type." }, - File_0_not_found: { code: 6053, category: 1 /* Error */, key: "File '{0}' not found." }, - File_0_must_have_extension_ts_or_d_ts: { code: 6054, category: 1 /* Error */, key: "File '{0}' must have extension '.ts' or '.d.ts'." }, - Variable_0_implicitly_has_an_1_type: { code: 7005, category: 1 /* Error */, key: "Variable '{0}' implicitly has an '{1}' type." }, - Parameter_0_implicitly_has_an_1_type: { code: 7006, category: 1 /* Error */, key: "Parameter '{0}' implicitly has an '{1}' type." }, - Member_0_implicitly_has_an_1_type: { code: 7008, category: 1 /* Error */, key: "Member '{0}' implicitly has an '{1}' type." }, - new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type: { code: 7009, category: 1 /* Error */, key: "'new' expression, whose target lacks a construct signature, implicitly has an 'any' type." }, - _0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type: { code: 7010, category: 1 /* Error */, key: "'{0}', which lacks return-type annotation, implicitly has an '{1}' return type." }, - Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: { code: 7011, category: 1 /* Error */, key: "Function expression, which lacks return-type annotation, implicitly has an '{0}' return type." }, - Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7013, category: 1 /* Error */, key: "Construct signature, which lacks return-type annotation, implicitly has an 'any' return type." }, - Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_type_annotation: { code: 7016, category: 1 /* Error */, key: "Property '{0}' implicitly has type 'any', because its 'set' accessor lacks a type annotation." }, - Index_signature_of_object_type_implicitly_has_an_any_type: { code: 7017, category: 1 /* Error */, key: "Index signature of object type implicitly has an 'any' type." }, - Object_literal_s_property_0_implicitly_has_an_1_type: { code: 7018, category: 1 /* Error */, key: "Object literal's property '{0}' implicitly has an '{1}' type." }, - Rest_parameter_0_implicitly_has_an_any_type: { code: 7019, category: 1 /* Error */, key: "Rest parameter '{0}' implicitly has an 'any[]' type." }, - Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7020, category: 1 /* Error */, key: "Call signature, which lacks return-type annotation, implicitly has an 'any' return type." }, - _0_implicitly_has_type_any_because_it_is_referenced_directly_or_indirectly_in_its_own_type_annotation: { code: 7021, category: 1 /* Error */, key: "'{0}' implicitly has type 'any' because it is referenced directly or indirectly in its own type annotation." }, - _0_implicitly_has_type_any_because_it_is_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer: { code: 7022, category: 1 /* Error */, key: "'{0}' implicitly has type 'any' because it is does not have a type annotation and is referenced directly or indirectly in its own initializer." }, - _0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions: { code: 7023, category: 1 /* Error */, key: "'{0}' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions." }, - Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions: { code: 7024, category: 1 /* Error */, key: "Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions." }, - You_cannot_rename_this_element: { code: 8000, category: 1 /* Error */, key: "You cannot rename this element." } - }; -})(ts || (ts = {})); -var ts; -(function (ts) { - var textToToken = { - "any": 105 /* AnyKeyword */, - "boolean": 106 /* BooleanKeyword */, - "break": 60 /* BreakKeyword */, - "case": 61 /* CaseKeyword */, - "catch": 62 /* CatchKeyword */, - "class": 63 /* ClassKeyword */, - "continue": 65 /* ContinueKeyword */, - "const": 64 /* ConstKeyword */, - "constructor": 107 /* ConstructorKeyword */, - "debugger": 66 /* DebuggerKeyword */, - "declare": 108 /* DeclareKeyword */, - "default": 67 /* DefaultKeyword */, - "delete": 68 /* DeleteKeyword */, - "do": 69 /* DoKeyword */, - "else": 70 /* ElseKeyword */, - "enum": 71 /* EnumKeyword */, - "export": 72 /* ExportKeyword */, - "extends": 73 /* ExtendsKeyword */, - "false": 74 /* FalseKeyword */, - "finally": 75 /* FinallyKeyword */, - "for": 76 /* ForKeyword */, - "function": 77 /* FunctionKeyword */, - "get": 109 /* GetKeyword */, - "if": 78 /* IfKeyword */, - "implements": 96 /* ImplementsKeyword */, - "import": 79 /* ImportKeyword */, - "in": 80 /* InKeyword */, - "instanceof": 81 /* InstanceOfKeyword */, - "interface": 97 /* InterfaceKeyword */, - "let": 98 /* LetKeyword */, - "module": 110 /* ModuleKeyword */, - "new": 82 /* NewKeyword */, - "null": 83 /* NullKeyword */, - "number": 112 /* NumberKeyword */, - "package": 99 /* PackageKeyword */, - "private": 100 /* PrivateKeyword */, - "protected": 101 /* ProtectedKeyword */, - "public": 102 /* PublicKeyword */, - "require": 111 /* RequireKeyword */, - "return": 84 /* ReturnKeyword */, - "set": 113 /* SetKeyword */, - "static": 103 /* StaticKeyword */, - "string": 114 /* StringKeyword */, - "super": 85 /* SuperKeyword */, - "switch": 86 /* SwitchKeyword */, - "this": 87 /* ThisKeyword */, - "throw": 88 /* ThrowKeyword */, - "true": 89 /* TrueKeyword */, - "try": 90 /* TryKeyword */, - "typeof": 91 /* TypeOfKeyword */, - "var": 92 /* VarKeyword */, - "void": 93 /* VoidKeyword */, - "while": 94 /* WhileKeyword */, - "with": 95 /* WithKeyword */, - "yield": 104 /* YieldKeyword */, - "{": 9 /* OpenBraceToken */, - "}": 10 /* CloseBraceToken */, - "(": 11 /* OpenParenToken */, - ")": 12 /* CloseParenToken */, - "[": 13 /* OpenBracketToken */, - "]": 14 /* CloseBracketToken */, - ".": 15 /* DotToken */, - "...": 16 /* DotDotDotToken */, - ";": 17 /* SemicolonToken */, - ",": 18 /* CommaToken */, - "<": 19 /* LessThanToken */, - ">": 20 /* GreaterThanToken */, - "<=": 21 /* LessThanEqualsToken */, - ">=": 22 /* GreaterThanEqualsToken */, - "==": 23 /* EqualsEqualsToken */, - "!=": 24 /* ExclamationEqualsToken */, - "===": 25 /* EqualsEqualsEqualsToken */, - "!==": 26 /* ExclamationEqualsEqualsToken */, - "=>": 27 /* EqualsGreaterThanToken */, - "+": 28 /* PlusToken */, - "-": 29 /* MinusToken */, - "*": 30 /* AsteriskToken */, - "/": 31 /* SlashToken */, - "%": 32 /* PercentToken */, - "++": 33 /* PlusPlusToken */, - "--": 34 /* MinusMinusToken */, - "<<": 35 /* LessThanLessThanToken */, - ">>": 36 /* GreaterThanGreaterThanToken */, - ">>>": 37 /* GreaterThanGreaterThanGreaterThanToken */, - "&": 38 /* AmpersandToken */, - "|": 39 /* BarToken */, - "^": 40 /* CaretToken */, - "!": 41 /* ExclamationToken */, - "~": 42 /* TildeToken */, - "&&": 43 /* AmpersandAmpersandToken */, - "||": 44 /* BarBarToken */, - "?": 45 /* QuestionToken */, - ":": 46 /* ColonToken */, - "=": 47 /* EqualsToken */, - "+=": 48 /* PlusEqualsToken */, - "-=": 49 /* MinusEqualsToken */, - "*=": 50 /* AsteriskEqualsToken */, - "/=": 51 /* SlashEqualsToken */, - "%=": 52 /* PercentEqualsToken */, - "<<=": 53 /* LessThanLessThanEqualsToken */, - ">>=": 54 /* GreaterThanGreaterThanEqualsToken */, - ">>>=": 55 /* GreaterThanGreaterThanGreaterThanEqualsToken */, - "&=": 56 /* AmpersandEqualsToken */, - "|=": 57 /* BarEqualsToken */, - "^=": 58 /* CaretEqualsToken */ - }; - var unicodeES3IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1610, 1649, 1747, 1749, 1749, 1765, 1766, 1786, 1788, 1808, 1808, 1810, 1836, 1920, 1957, 2309, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2784, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3294, 3294, 3296, 3297, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3424, 3425, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3805, 3840, 3840, 3904, 3911, 3913, 3946, 3976, 3979, 4096, 4129, 4131, 4135, 4137, 4138, 4176, 4181, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6067, 6176, 6263, 6272, 6312, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8319, 8319, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12346, 12353, 12436, 12445, 12446, 12449, 12538, 12540, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65138, 65140, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; - var unicodeES3IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 768, 846, 864, 866, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1155, 1158, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1441, 1443, 1465, 1467, 1469, 1471, 1471, 1473, 1474, 1476, 1476, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1621, 1632, 1641, 1648, 1747, 1749, 1756, 1759, 1768, 1770, 1773, 1776, 1788, 1808, 1836, 1840, 1866, 1920, 1968, 2305, 2307, 2309, 2361, 2364, 2381, 2384, 2388, 2392, 2403, 2406, 2415, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2492, 2494, 2500, 2503, 2504, 2507, 2509, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2562, 2562, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2649, 2652, 2654, 2654, 2662, 2676, 2689, 2691, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2784, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2876, 2883, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2913, 2918, 2927, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3031, 3031, 3047, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3134, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3168, 3169, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3262, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3297, 3302, 3311, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3390, 3395, 3398, 3400, 3402, 3405, 3415, 3415, 3424, 3425, 3430, 3439, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3805, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3946, 3953, 3972, 3974, 3979, 3984, 3991, 3993, 4028, 4038, 4038, 4096, 4129, 4131, 4135, 4137, 4138, 4140, 4146, 4150, 4153, 4160, 4169, 4176, 4185, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 4969, 4977, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6099, 6112, 6121, 6160, 6169, 6176, 6263, 6272, 6313, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8319, 8319, 8400, 8412, 8417, 8417, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12346, 12353, 12436, 12441, 12442, 12445, 12446, 12449, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65056, 65059, 65075, 65076, 65101, 65103, 65136, 65138, 65140, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65381, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; - var unicodeES5IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2208, 2208, 2210, 2220, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2423, 2425, 2431, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6000, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6428, 6480, 6509, 6512, 6516, 6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409, 7413, 7414, 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43648, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; - var unicodeES5IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1520, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2048, 2093, 2112, 2139, 2208, 2208, 2210, 2220, 2276, 2302, 2304, 2403, 2406, 2415, 2417, 2423, 2425, 2431, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3161, 3168, 3171, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3396, 3398, 3400, 3402, 3406, 3415, 3415, 3424, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6000, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6263, 6272, 6314, 6320, 6389, 6400, 6428, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6617, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7376, 7378, 7380, 7414, 7424, 7654, 7676, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8204, 8205, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 11823, 11823, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12442, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42647, 42655, 42737, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43047, 43072, 43123, 43136, 43204, 43216, 43225, 43232, 43255, 43259, 43259, 43264, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43643, 43648, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65062, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; - function lookupInUnicodeMap(code, map) { - if (code < map[0]) { - return false; - } - var lo = 0; - var hi = map.length; - var mid; - while (lo + 1 < hi) { - mid = lo + (hi - lo) / 2; - mid -= mid % 2; - if (map[mid] <= code && code <= map[mid + 1]) { - return true; - } - if (code < map[mid]) { - hi = mid; - } - else { - lo = mid + 2; - } - } - return false; - } - function isUnicodeIdentifierStart(code, languageVersion) { - return languageVersion === 0 /* ES3 */ ? lookupInUnicodeMap(code, unicodeES3IdentifierStart) : lookupInUnicodeMap(code, unicodeES5IdentifierStart); - } - function isUnicodeIdentifierPart(code, languageVersion) { - return languageVersion === 0 /* ES3 */ ? lookupInUnicodeMap(code, unicodeES3IdentifierPart) : lookupInUnicodeMap(code, unicodeES5IdentifierPart); - } - function makeReverseMap(source) { - var result = []; - for (var name in source) { - if (source.hasOwnProperty(name)) { - result[source[name]] = name; - } - } - return result; - } - var tokenStrings = makeReverseMap(textToToken); - function tokenToString(t) { - return tokenStrings[t]; - } - ts.tokenToString = tokenToString; - function getLineStarts(text) { - var result = new Array(); - var pos = 0; - var lineStart = 0; - while (pos < text.length) { - var ch = text.charCodeAt(pos++); - switch (ch) { - case 13 /* carriageReturn */: - if (text.charCodeAt(pos) === 10 /* lineFeed */) { - pos++; - } - case 10 /* lineFeed */: - result.push(lineStart); - lineStart = pos; - break; - default: - if (ch > 127 /* maxAsciiCharacter */ && isLineBreak(ch)) { - result.push(lineStart); - lineStart = pos; - } - break; - } - } - result.push(lineStart); - return result; - } - ts.getLineStarts = getLineStarts; - function getPositionFromLineAndCharacter(lineStarts, line, character) { - ts.Debug.assert(line > 0); - return lineStarts[line - 1] + character - 1; - } - ts.getPositionFromLineAndCharacter = getPositionFromLineAndCharacter; - function getLineAndCharacterOfPosition(lineStarts, position) { - var lineNumber = ts.binarySearch(lineStarts, position); - if (lineNumber < 0) { - lineNumber = (~lineNumber) - 1; - } - return { - line: lineNumber + 1, - character: position - lineStarts[lineNumber] + 1 - }; - } - ts.getLineAndCharacterOfPosition = getLineAndCharacterOfPosition; - function positionToLineAndCharacter(text, pos) { - var lineStarts = getLineStarts(text); - return getLineAndCharacterOfPosition(lineStarts, pos); - } - ts.positionToLineAndCharacter = positionToLineAndCharacter; - var hasOwnProperty = Object.prototype.hasOwnProperty; - function isWhiteSpace(ch) { - return ch === 32 /* space */ || ch === 9 /* tab */ || ch === 11 /* verticalTab */ || ch === 12 /* formFeed */ || ch === 160 /* nonBreakingSpace */ || ch === 5760 /* ogham */ || ch >= 8192 /* enQuad */ && ch <= 8203 /* zeroWidthSpace */ || ch === 8239 /* narrowNoBreakSpace */ || ch === 8287 /* mathematicalSpace */ || ch === 12288 /* ideographicSpace */ || ch === 65279 /* byteOrderMark */; - } - ts.isWhiteSpace = isWhiteSpace; - function isLineBreak(ch) { - return ch === 10 /* lineFeed */ || ch === 13 /* carriageReturn */ || ch === 8232 /* lineSeparator */ || ch === 8233 /* paragraphSeparator */ || ch === 133 /* nextLine */; - } - ts.isLineBreak = isLineBreak; - function isDigit(ch) { - return ch >= 48 /* _0 */ && ch <= 57 /* _9 */; - } - function isOctalDigit(ch) { - return ch >= 48 /* _0 */ && ch <= 55 /* _7 */; - } - ts.isOctalDigit = isOctalDigit; - function skipTrivia(text, pos, stopAfterLineBreak) { - while (true) { - var ch = text.charCodeAt(pos); - switch (ch) { - case 13 /* carriageReturn */: - if (text.charCodeAt(pos + 1) === 10 /* lineFeed */) - pos++; - case 10 /* lineFeed */: - pos++; - if (stopAfterLineBreak) - return pos; - continue; - case 9 /* tab */: - case 11 /* verticalTab */: - case 12 /* formFeed */: - case 32 /* space */: - pos++; - continue; - case 47 /* slash */: - if (text.charCodeAt(pos + 1) === 47 /* slash */) { - pos += 2; - while (pos < text.length) { - if (isLineBreak(text.charCodeAt(pos))) { - break; - } - pos++; - } - continue; - } - if (text.charCodeAt(pos + 1) === 42 /* asterisk */) { - pos += 2; - while (pos < text.length) { - if (text.charCodeAt(pos) === 42 /* asterisk */ && text.charCodeAt(pos + 1) === 47 /* slash */) { - pos += 2; - break; - } - pos++; - } - continue; - } - break; - default: - if (ch > 127 /* maxAsciiCharacter */ && (isWhiteSpace(ch) || isLineBreak(ch))) { - pos++; - continue; - } - break; - } - return pos; - } - } - ts.skipTrivia = skipTrivia; - function getCommentRanges(text, pos, trailing) { - var result; - var collecting = trailing || pos === 0; - while (true) { - var ch = text.charCodeAt(pos); - switch (ch) { - case 13 /* carriageReturn */: - if (text.charCodeAt(pos + 1) === 10 /* lineFeed */) - pos++; - case 10 /* lineFeed */: - pos++; - if (trailing) { - return result; - } - collecting = true; - if (result && result.length) { - result[result.length - 1].hasTrailingNewLine = true; - } - continue; - case 9 /* tab */: - case 11 /* verticalTab */: - case 12 /* formFeed */: - case 32 /* space */: - pos++; - continue; - case 47 /* slash */: - var nextChar = text.charCodeAt(pos + 1); - var hasTrailingNewLine = false; - if (nextChar === 47 /* slash */ || nextChar === 42 /* asterisk */) { - var startPos = pos; - pos += 2; - if (nextChar === 47 /* slash */) { - while (pos < text.length) { - if (isLineBreak(text.charCodeAt(pos))) { - hasTrailingNewLine = true; - break; - } - pos++; - } - } - else { - while (pos < text.length) { - if (text.charCodeAt(pos) === 42 /* asterisk */ && text.charCodeAt(pos + 1) === 47 /* slash */) { - pos += 2; - break; - } - pos++; - } - } - if (collecting) { - if (!result) - result = []; - result.push({ pos: startPos, end: pos, hasTrailingNewLine: hasTrailingNewLine }); - } - continue; - } - break; - default: - if (ch > 127 /* maxAsciiCharacter */ && (isWhiteSpace(ch) || isLineBreak(ch))) { - if (result && result.length && isLineBreak(ch)) { - result[result.length - 1].hasTrailingNewLine = true; - } - pos++; - continue; - } - break; - } - return result; - } - } - function getLeadingCommentRanges(text, pos) { - return getCommentRanges(text, pos, false); - } - ts.getLeadingCommentRanges = getLeadingCommentRanges; - function getTrailingCommentRanges(text, pos) { - return getCommentRanges(text, pos, true); - } - ts.getTrailingCommentRanges = getTrailingCommentRanges; - function isIdentifierStart(ch, languageVersion) { - return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch === 36 /* $ */ || ch === 95 /* _ */ || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierStart(ch, languageVersion); - } - ts.isIdentifierStart = isIdentifierStart; - function isIdentifierPart(ch, languageVersion) { - return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch >= 48 /* _0 */ && ch <= 57 /* _9 */ || ch === 36 /* $ */ || ch === 95 /* _ */ || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierPart(ch, languageVersion); - } - ts.isIdentifierPart = isIdentifierPart; - function createScanner(languageVersion, skipTrivia, text, onError, onComment) { - var pos; - var len; - var startPos; - var tokenPos; - var token; - var tokenValue; - var precedingLineBreak; - function error(message) { - if (onError) { - onError(message); - } - } - function isIdentifierStart(ch) { - return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch === 36 /* $ */ || ch === 95 /* _ */ || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierStart(ch, languageVersion); - } - function isIdentifierPart(ch) { - return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch >= 48 /* _0 */ && ch <= 57 /* _9 */ || ch === 36 /* $ */ || ch === 95 /* _ */ || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierPart(ch, languageVersion); - } - function scanNumber() { - var start = pos; - while (isDigit(text.charCodeAt(pos))) - pos++; - if (text.charCodeAt(pos) === 46 /* dot */) { - pos++; - while (isDigit(text.charCodeAt(pos))) - pos++; - } - var end = pos; - if (text.charCodeAt(pos) === 69 /* E */ || text.charCodeAt(pos) === 101 /* e */) { - pos++; - if (text.charCodeAt(pos) === 43 /* plus */ || text.charCodeAt(pos) === 45 /* minus */) - pos++; - if (isDigit(text.charCodeAt(pos))) { - pos++; - while (isDigit(text.charCodeAt(pos))) - pos++; - end = pos; - } - else { - error(ts.Diagnostics.Digit_expected); - } - } - return +(text.substring(start, end)); - } - function scanOctalDigits() { - var start = pos; - while (isOctalDigit(text.charCodeAt(pos))) { - pos++; - } - return +(text.substring(start, pos)); - } - function scanHexDigits(count, exact) { - var digits = 0; - var value = 0; - while (digits < count || !exact) { - var ch = text.charCodeAt(pos); - if (ch >= 48 /* _0 */ && ch <= 57 /* _9 */) { - value = value * 16 + ch - 48 /* _0 */; - } - else if (ch >= 65 /* A */ && ch <= 70 /* F */) { - value = value * 16 + ch - 65 /* A */ + 10; - } - else if (ch >= 97 /* a */ && ch <= 102 /* f */) { - value = value * 16 + ch - 97 /* a */ + 10; - } - else { - break; - } - pos++; - digits++; - } - if (digits < count) { - value = -1; - } - return value; - } - function scanString() { - var quote = text.charCodeAt(pos++); - var result = ""; - var start = pos; - while (true) { - if (pos >= len) { - result += text.substring(start, pos); - error(ts.Diagnostics.Unexpected_end_of_text); - break; - } - var ch = text.charCodeAt(pos); - if (ch === quote) { - result += text.substring(start, pos); - pos++; - break; - } - if (ch === 92 /* backslash */) { - result += text.substring(start, pos); - pos++; - if (pos >= len) { - error(ts.Diagnostics.Unexpected_end_of_text); - break; - } - ch = text.charCodeAt(pos++); - switch (ch) { - case 48 /* _0 */: - result += "\0"; - break; - case 98 /* b */: - result += "\b"; - break; - case 116 /* t */: - result += "\t"; - break; - case 110 /* n */: - result += "\n"; - break; - case 118 /* v */: - result += "\v"; - break; - case 102 /* f */: - result += "\f"; - break; - case 114 /* r */: - result += "\r"; - break; - case 39 /* singleQuote */: - result += "\'"; - break; - case 34 /* doubleQuote */: - result += "\""; - break; - case 120 /* x */: - case 117 /* u */: - var ch = scanHexDigits(ch === 120 /* x */ ? 2 : 4, true); - if (ch >= 0) { - result += String.fromCharCode(ch); - } - else { - error(ts.Diagnostics.Hexadecimal_digit_expected); - } - break; - case 13 /* carriageReturn */: - if (pos < len && text.charCodeAt(pos) === 10 /* lineFeed */) - pos++; - break; - case 10 /* lineFeed */: - case 8232 /* lineSeparator */: - case 8233 /* paragraphSeparator */: - break; - default: - result += String.fromCharCode(ch); - } - start = pos; - continue; - } - if (isLineBreak(ch)) { - result += text.substring(start, pos); - error(ts.Diagnostics.Unterminated_string_literal); - break; - } - pos++; - } - return result; - } - function peekUnicodeEscape() { - if (pos + 5 < len && text.charCodeAt(pos + 1) === 117 /* u */) { - var start = pos; - pos += 2; - var value = scanHexDigits(4, true); - pos = start; - return value; - } - return -1; - } - function scanIdentifierParts() { - var result = ""; - var start = pos; - while (pos < len) { - var ch = text.charCodeAt(pos); - if (isIdentifierPart(ch)) { - pos++; - } - else if (ch === 92 /* backslash */) { - ch = peekUnicodeEscape(); - if (!(ch >= 0 && isIdentifierPart(ch))) { - break; - } - result += text.substring(start, pos); - result += String.fromCharCode(ch); - pos += 6; - start = pos; - } - else { - break; - } - } - result += text.substring(start, pos); - return result; - } - function getIdentifierToken() { - var len = tokenValue.length; - if (len >= 2 && len <= 11) { - var ch = tokenValue.charCodeAt(0); - if (ch >= 97 /* a */ && ch <= 122 /* z */ && hasOwnProperty.call(textToToken, tokenValue)) { - return token = textToToken[tokenValue]; - } - } - return token = 59 /* Identifier */; - } - function scan() { - startPos = pos; - precedingLineBreak = false; - while (true) { - tokenPos = pos; - if (pos >= len) { - return token = 1 /* EndOfFileToken */; - } - var ch = text.charCodeAt(pos); - switch (ch) { - case 10 /* lineFeed */: - case 13 /* carriageReturn */: - precedingLineBreak = true; - if (skipTrivia) { - pos++; - continue; - } - else { - if (ch === 13 /* carriageReturn */ && pos + 1 < len && text.charCodeAt(pos + 1) === 10 /* lineFeed */) { - pos += 2; - } - else { - pos++; - } - return token = 4 /* NewLineTrivia */; - } - case 9 /* tab */: - case 11 /* verticalTab */: - case 12 /* formFeed */: - case 32 /* space */: - if (skipTrivia) { - pos++; - continue; - } - else { - while (pos < len && isWhiteSpace(text.charCodeAt(pos))) { - pos++; - } - return token = 5 /* WhitespaceTrivia */; - } - case 33 /* exclamation */: - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - if (text.charCodeAt(pos + 2) === 61 /* equals */) { - return pos += 3, token = 26 /* ExclamationEqualsEqualsToken */; - } - return pos += 2, token = 24 /* ExclamationEqualsToken */; - } - return pos++, token = 41 /* ExclamationToken */; - case 34 /* doubleQuote */: - case 39 /* singleQuote */: - tokenValue = scanString(); - return token = 7 /* StringLiteral */; - case 37 /* percent */: - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 52 /* PercentEqualsToken */; - } - return pos++, token = 32 /* PercentToken */; - case 38 /* ampersand */: - if (text.charCodeAt(pos + 1) === 38 /* ampersand */) { - return pos += 2, token = 43 /* AmpersandAmpersandToken */; - } - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 56 /* AmpersandEqualsToken */; - } - return pos++, token = 38 /* AmpersandToken */; - case 40 /* openParen */: - return pos++, token = 11 /* OpenParenToken */; - case 41 /* closeParen */: - return pos++, token = 12 /* CloseParenToken */; - case 42 /* asterisk */: - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 50 /* AsteriskEqualsToken */; - } - return pos++, token = 30 /* AsteriskToken */; - case 43 /* plus */: - if (text.charCodeAt(pos + 1) === 43 /* plus */) { - return pos += 2, token = 33 /* PlusPlusToken */; - } - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 48 /* PlusEqualsToken */; - } - return pos++, token = 28 /* PlusToken */; - case 44 /* comma */: - return pos++, token = 18 /* CommaToken */; - case 45 /* minus */: - if (text.charCodeAt(pos + 1) === 45 /* minus */) { - return pos += 2, token = 34 /* MinusMinusToken */; - } - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 49 /* MinusEqualsToken */; - } - return pos++, token = 29 /* MinusToken */; - case 46 /* dot */: - if (isDigit(text.charCodeAt(pos + 1))) { - tokenValue = "" + scanNumber(); - return token = 6 /* NumericLiteral */; - } - if (text.charCodeAt(pos + 1) === 46 /* dot */ && text.charCodeAt(pos + 2) === 46 /* dot */) { - return pos += 3, token = 16 /* DotDotDotToken */; - } - return pos++, token = 15 /* DotToken */; - case 47 /* slash */: - if (text.charCodeAt(pos + 1) === 47 /* slash */) { - pos += 2; - while (pos < len) { - if (isLineBreak(text.charCodeAt(pos))) { - break; - } - pos++; - } - if (onComment) { - onComment(tokenPos, pos); - } - if (skipTrivia) { - continue; - } - else { - return token = 2 /* SingleLineCommentTrivia */; - } - } - if (text.charCodeAt(pos + 1) === 42 /* asterisk */) { - pos += 2; - var commentClosed = false; - while (pos < len) { - var ch = text.charCodeAt(pos); - if (ch === 42 /* asterisk */ && text.charCodeAt(pos + 1) === 47 /* slash */) { - pos += 2; - commentClosed = true; - break; - } - if (isLineBreak(ch)) { - precedingLineBreak = true; - } - pos++; - } - if (!commentClosed) { - error(ts.Diagnostics.Asterisk_Slash_expected); - } - if (onComment) { - onComment(tokenPos, pos); - } - if (skipTrivia) { - continue; - } - else { - return token = 3 /* MultiLineCommentTrivia */; - } - } - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 51 /* SlashEqualsToken */; - } - return pos++, token = 31 /* SlashToken */; - case 48 /* _0 */: - if (pos + 2 < len && (text.charCodeAt(pos + 1) === 88 /* X */ || text.charCodeAt(pos + 1) === 120 /* x */)) { - pos += 2; - var value = scanHexDigits(1, false); - if (value < 0) { - error(ts.Diagnostics.Hexadecimal_digit_expected); - value = 0; - } - tokenValue = "" + value; - return 6 /* NumericLiteral */; - } - if (pos + 1 < len && isOctalDigit(text.charCodeAt(pos + 1))) { - tokenValue = "" + scanOctalDigits(); - return 6 /* NumericLiteral */; - } - case 49 /* _1 */: - case 50 /* _2 */: - case 51 /* _3 */: - case 52 /* _4 */: - case 53 /* _5 */: - case 54 /* _6 */: - case 55 /* _7 */: - case 56 /* _8 */: - case 57 /* _9 */: - tokenValue = "" + scanNumber(); - return token = 6 /* NumericLiteral */; - case 58 /* colon */: - return pos++, token = 46 /* ColonToken */; - case 59 /* semicolon */: - return pos++, token = 17 /* SemicolonToken */; - case 60 /* lessThan */: - if (text.charCodeAt(pos + 1) === 60 /* lessThan */) { - if (text.charCodeAt(pos + 2) === 61 /* equals */) { - return pos += 3, token = 53 /* LessThanLessThanEqualsToken */; - } - return pos += 2, token = 35 /* LessThanLessThanToken */; - } - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 21 /* LessThanEqualsToken */; - } - return pos++, token = 19 /* LessThanToken */; - case 61 /* equals */: - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - if (text.charCodeAt(pos + 2) === 61 /* equals */) { - return pos += 3, token = 25 /* EqualsEqualsEqualsToken */; - } - return pos += 2, token = 23 /* EqualsEqualsToken */; - } - if (text.charCodeAt(pos + 1) === 62 /* greaterThan */) { - return pos += 2, token = 27 /* EqualsGreaterThanToken */; - } - return pos++, token = 47 /* EqualsToken */; - case 62 /* greaterThan */: - return pos++, token = 20 /* GreaterThanToken */; - case 63 /* question */: - return pos++, token = 45 /* QuestionToken */; - case 91 /* openBracket */: - return pos++, token = 13 /* OpenBracketToken */; - case 93 /* closeBracket */: - return pos++, token = 14 /* CloseBracketToken */; - case 94 /* caret */: - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 58 /* CaretEqualsToken */; - } - return pos++, token = 40 /* CaretToken */; - case 123 /* openBrace */: - return pos++, token = 9 /* OpenBraceToken */; - case 124 /* bar */: - if (text.charCodeAt(pos + 1) === 124 /* bar */) { - return pos += 2, token = 44 /* BarBarToken */; - } - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 57 /* BarEqualsToken */; - } - return pos++, token = 39 /* BarToken */; - case 125 /* closeBrace */: - return pos++, token = 10 /* CloseBraceToken */; - case 126 /* tilde */: - return pos++, token = 42 /* TildeToken */; - case 92 /* backslash */: - var ch = peekUnicodeEscape(); - if (ch >= 0 && isIdentifierStart(ch)) { - pos += 6; - tokenValue = String.fromCharCode(ch) + scanIdentifierParts(); - return token = getIdentifierToken(); - } - error(ts.Diagnostics.Invalid_character); - return pos++, token = 0 /* Unknown */; - default: - if (isIdentifierStart(ch)) { - pos++; - while (pos < len && isIdentifierPart(ch = text.charCodeAt(pos))) - pos++; - tokenValue = text.substring(tokenPos, pos); - if (ch === 92 /* backslash */) { - tokenValue += scanIdentifierParts(); - } - return token = getIdentifierToken(); - } - else if (isWhiteSpace(ch)) { - pos++; - continue; - } - else if (isLineBreak(ch)) { - precedingLineBreak = true; - pos++; - continue; - } - error(ts.Diagnostics.Invalid_character); - return pos++, token = 0 /* Unknown */; - } - } - } - function reScanGreaterToken() { - if (token === 20 /* GreaterThanToken */) { - if (text.charCodeAt(pos) === 62 /* greaterThan */) { - if (text.charCodeAt(pos + 1) === 62 /* greaterThan */) { - if (text.charCodeAt(pos + 2) === 61 /* equals */) { - return pos += 3, token = 55 /* GreaterThanGreaterThanGreaterThanEqualsToken */; - } - return pos += 2, token = 37 /* GreaterThanGreaterThanGreaterThanToken */; - } - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 54 /* GreaterThanGreaterThanEqualsToken */; - } - return pos++, token = 36 /* GreaterThanGreaterThanToken */; - } - if (text.charCodeAt(pos) === 61 /* equals */) { - return pos++, token = 22 /* GreaterThanEqualsToken */; - } - } - return token; - } - function reScanSlashToken() { - if (token === 31 /* SlashToken */ || token === 51 /* SlashEqualsToken */) { - var p = tokenPos + 1; - var inEscape = false; - var inCharacterClass = false; - while (true) { - if (p >= len) { - return token; - } - var ch = text.charCodeAt(p); - if (isLineBreak(ch)) { - return token; - } - if (inEscape) { - inEscape = false; - } - else if (ch === 47 /* slash */ && !inCharacterClass) { - break; - } - else if (ch === 91 /* openBracket */) { - inCharacterClass = true; - } - else if (ch === 92 /* backslash */) { - inEscape = true; - } - else if (ch === 93 /* closeBracket */) { - inCharacterClass = false; - } - p++; - } - p++; - while (isIdentifierPart(text.charCodeAt(p))) { - p++; - } - pos = p; - tokenValue = text.substring(tokenPos, pos); - token = 8 /* RegularExpressionLiteral */; - } - return token; - } - function tryScan(callback) { - var savePos = pos; - var saveStartPos = startPos; - var saveTokenPos = tokenPos; - var saveToken = token; - var saveTokenValue = tokenValue; - var savePrecedingLineBreak = precedingLineBreak; - var result = callback(); - if (!result) { - pos = savePos; - startPos = saveStartPos; - tokenPos = saveTokenPos; - token = saveToken; - tokenValue = saveTokenValue; - precedingLineBreak = savePrecedingLineBreak; - } - return result; - } - function setText(newText) { - text = newText || ""; - len = text.length; - setTextPos(0); - } - function setTextPos(textPos) { - pos = textPos; - startPos = textPos; - tokenPos = textPos; - token = 0 /* Unknown */; - precedingLineBreak = false; - } - setText(text); - return { - getStartPos: function () { return startPos; }, - getTextPos: function () { return pos; }, - getToken: function () { return token; }, - getTokenPos: function () { return tokenPos; }, - getTokenText: function () { return text.substring(tokenPos, pos); }, - getTokenValue: function () { return tokenValue; }, - hasPrecedingLineBreak: function () { return precedingLineBreak; }, - isIdentifier: function () { return token === 59 /* Identifier */ || token > ts.SyntaxKind.LastReservedWord; }, - isReservedWord: function () { return token >= ts.SyntaxKind.FirstReservedWord && token <= ts.SyntaxKind.LastReservedWord; }, - reScanGreaterToken: reScanGreaterToken, - reScanSlashToken: reScanSlashToken, - scan: scan, - setText: setText, - setTextPos: setTextPos, - tryScan: tryScan - }; - } - ts.createScanner = createScanner; -})(ts || (ts = {})); -var ts; -(function (ts) { - (function (SyntaxKind) { - SyntaxKind[SyntaxKind["Unknown"] = 0] = "Unknown"; - SyntaxKind[SyntaxKind["EndOfFileToken"] = 1] = "EndOfFileToken"; - SyntaxKind[SyntaxKind["SingleLineCommentTrivia"] = 2] = "SingleLineCommentTrivia"; - SyntaxKind[SyntaxKind["MultiLineCommentTrivia"] = 3] = "MultiLineCommentTrivia"; - SyntaxKind[SyntaxKind["NewLineTrivia"] = 4] = "NewLineTrivia"; - SyntaxKind[SyntaxKind["WhitespaceTrivia"] = 5] = "WhitespaceTrivia"; - SyntaxKind[SyntaxKind["NumericLiteral"] = 6] = "NumericLiteral"; - SyntaxKind[SyntaxKind["StringLiteral"] = 7] = "StringLiteral"; - SyntaxKind[SyntaxKind["RegularExpressionLiteral"] = 8] = "RegularExpressionLiteral"; - SyntaxKind[SyntaxKind["OpenBraceToken"] = 9] = "OpenBraceToken"; - SyntaxKind[SyntaxKind["CloseBraceToken"] = 10] = "CloseBraceToken"; - SyntaxKind[SyntaxKind["OpenParenToken"] = 11] = "OpenParenToken"; - SyntaxKind[SyntaxKind["CloseParenToken"] = 12] = "CloseParenToken"; - SyntaxKind[SyntaxKind["OpenBracketToken"] = 13] = "OpenBracketToken"; - SyntaxKind[SyntaxKind["CloseBracketToken"] = 14] = "CloseBracketToken"; - SyntaxKind[SyntaxKind["DotToken"] = 15] = "DotToken"; - SyntaxKind[SyntaxKind["DotDotDotToken"] = 16] = "DotDotDotToken"; - SyntaxKind[SyntaxKind["SemicolonToken"] = 17] = "SemicolonToken"; - SyntaxKind[SyntaxKind["CommaToken"] = 18] = "CommaToken"; - SyntaxKind[SyntaxKind["LessThanToken"] = 19] = "LessThanToken"; - SyntaxKind[SyntaxKind["GreaterThanToken"] = 20] = "GreaterThanToken"; - SyntaxKind[SyntaxKind["LessThanEqualsToken"] = 21] = "LessThanEqualsToken"; - SyntaxKind[SyntaxKind["GreaterThanEqualsToken"] = 22] = "GreaterThanEqualsToken"; - SyntaxKind[SyntaxKind["EqualsEqualsToken"] = 23] = "EqualsEqualsToken"; - SyntaxKind[SyntaxKind["ExclamationEqualsToken"] = 24] = "ExclamationEqualsToken"; - SyntaxKind[SyntaxKind["EqualsEqualsEqualsToken"] = 25] = "EqualsEqualsEqualsToken"; - SyntaxKind[SyntaxKind["ExclamationEqualsEqualsToken"] = 26] = "ExclamationEqualsEqualsToken"; - SyntaxKind[SyntaxKind["EqualsGreaterThanToken"] = 27] = "EqualsGreaterThanToken"; - SyntaxKind[SyntaxKind["PlusToken"] = 28] = "PlusToken"; - SyntaxKind[SyntaxKind["MinusToken"] = 29] = "MinusToken"; - SyntaxKind[SyntaxKind["AsteriskToken"] = 30] = "AsteriskToken"; - SyntaxKind[SyntaxKind["SlashToken"] = 31] = "SlashToken"; - SyntaxKind[SyntaxKind["PercentToken"] = 32] = "PercentToken"; - SyntaxKind[SyntaxKind["PlusPlusToken"] = 33] = "PlusPlusToken"; - SyntaxKind[SyntaxKind["MinusMinusToken"] = 34] = "MinusMinusToken"; - SyntaxKind[SyntaxKind["LessThanLessThanToken"] = 35] = "LessThanLessThanToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanToken"] = 36] = "GreaterThanGreaterThanToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanToken"] = 37] = "GreaterThanGreaterThanGreaterThanToken"; - SyntaxKind[SyntaxKind["AmpersandToken"] = 38] = "AmpersandToken"; - SyntaxKind[SyntaxKind["BarToken"] = 39] = "BarToken"; - SyntaxKind[SyntaxKind["CaretToken"] = 40] = "CaretToken"; - SyntaxKind[SyntaxKind["ExclamationToken"] = 41] = "ExclamationToken"; - SyntaxKind[SyntaxKind["TildeToken"] = 42] = "TildeToken"; - SyntaxKind[SyntaxKind["AmpersandAmpersandToken"] = 43] = "AmpersandAmpersandToken"; - SyntaxKind[SyntaxKind["BarBarToken"] = 44] = "BarBarToken"; - SyntaxKind[SyntaxKind["QuestionToken"] = 45] = "QuestionToken"; - SyntaxKind[SyntaxKind["ColonToken"] = 46] = "ColonToken"; - SyntaxKind[SyntaxKind["EqualsToken"] = 47] = "EqualsToken"; - SyntaxKind[SyntaxKind["PlusEqualsToken"] = 48] = "PlusEqualsToken"; - SyntaxKind[SyntaxKind["MinusEqualsToken"] = 49] = "MinusEqualsToken"; - SyntaxKind[SyntaxKind["AsteriskEqualsToken"] = 50] = "AsteriskEqualsToken"; - SyntaxKind[SyntaxKind["SlashEqualsToken"] = 51] = "SlashEqualsToken"; - SyntaxKind[SyntaxKind["PercentEqualsToken"] = 52] = "PercentEqualsToken"; - SyntaxKind[SyntaxKind["LessThanLessThanEqualsToken"] = 53] = "LessThanLessThanEqualsToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanEqualsToken"] = 54] = "GreaterThanGreaterThanEqualsToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanEqualsToken"] = 55] = "GreaterThanGreaterThanGreaterThanEqualsToken"; - SyntaxKind[SyntaxKind["AmpersandEqualsToken"] = 56] = "AmpersandEqualsToken"; - SyntaxKind[SyntaxKind["BarEqualsToken"] = 57] = "BarEqualsToken"; - SyntaxKind[SyntaxKind["CaretEqualsToken"] = 58] = "CaretEqualsToken"; - SyntaxKind[SyntaxKind["Identifier"] = 59] = "Identifier"; - SyntaxKind[SyntaxKind["BreakKeyword"] = 60] = "BreakKeyword"; - SyntaxKind[SyntaxKind["CaseKeyword"] = 61] = "CaseKeyword"; - SyntaxKind[SyntaxKind["CatchKeyword"] = 62] = "CatchKeyword"; - SyntaxKind[SyntaxKind["ClassKeyword"] = 63] = "ClassKeyword"; - SyntaxKind[SyntaxKind["ConstKeyword"] = 64] = "ConstKeyword"; - SyntaxKind[SyntaxKind["ContinueKeyword"] = 65] = "ContinueKeyword"; - SyntaxKind[SyntaxKind["DebuggerKeyword"] = 66] = "DebuggerKeyword"; - SyntaxKind[SyntaxKind["DefaultKeyword"] = 67] = "DefaultKeyword"; - SyntaxKind[SyntaxKind["DeleteKeyword"] = 68] = "DeleteKeyword"; - SyntaxKind[SyntaxKind["DoKeyword"] = 69] = "DoKeyword"; - SyntaxKind[SyntaxKind["ElseKeyword"] = 70] = "ElseKeyword"; - SyntaxKind[SyntaxKind["EnumKeyword"] = 71] = "EnumKeyword"; - SyntaxKind[SyntaxKind["ExportKeyword"] = 72] = "ExportKeyword"; - SyntaxKind[SyntaxKind["ExtendsKeyword"] = 73] = "ExtendsKeyword"; - SyntaxKind[SyntaxKind["FalseKeyword"] = 74] = "FalseKeyword"; - SyntaxKind[SyntaxKind["FinallyKeyword"] = 75] = "FinallyKeyword"; - SyntaxKind[SyntaxKind["ForKeyword"] = 76] = "ForKeyword"; - SyntaxKind[SyntaxKind["FunctionKeyword"] = 77] = "FunctionKeyword"; - SyntaxKind[SyntaxKind["IfKeyword"] = 78] = "IfKeyword"; - SyntaxKind[SyntaxKind["ImportKeyword"] = 79] = "ImportKeyword"; - SyntaxKind[SyntaxKind["InKeyword"] = 80] = "InKeyword"; - SyntaxKind[SyntaxKind["InstanceOfKeyword"] = 81] = "InstanceOfKeyword"; - SyntaxKind[SyntaxKind["NewKeyword"] = 82] = "NewKeyword"; - SyntaxKind[SyntaxKind["NullKeyword"] = 83] = "NullKeyword"; - SyntaxKind[SyntaxKind["ReturnKeyword"] = 84] = "ReturnKeyword"; - SyntaxKind[SyntaxKind["SuperKeyword"] = 85] = "SuperKeyword"; - SyntaxKind[SyntaxKind["SwitchKeyword"] = 86] = "SwitchKeyword"; - SyntaxKind[SyntaxKind["ThisKeyword"] = 87] = "ThisKeyword"; - SyntaxKind[SyntaxKind["ThrowKeyword"] = 88] = "ThrowKeyword"; - SyntaxKind[SyntaxKind["TrueKeyword"] = 89] = "TrueKeyword"; - SyntaxKind[SyntaxKind["TryKeyword"] = 90] = "TryKeyword"; - SyntaxKind[SyntaxKind["TypeOfKeyword"] = 91] = "TypeOfKeyword"; - SyntaxKind[SyntaxKind["VarKeyword"] = 92] = "VarKeyword"; - SyntaxKind[SyntaxKind["VoidKeyword"] = 93] = "VoidKeyword"; - SyntaxKind[SyntaxKind["WhileKeyword"] = 94] = "WhileKeyword"; - SyntaxKind[SyntaxKind["WithKeyword"] = 95] = "WithKeyword"; - SyntaxKind[SyntaxKind["ImplementsKeyword"] = 96] = "ImplementsKeyword"; - SyntaxKind[SyntaxKind["InterfaceKeyword"] = 97] = "InterfaceKeyword"; - SyntaxKind[SyntaxKind["LetKeyword"] = 98] = "LetKeyword"; - SyntaxKind[SyntaxKind["PackageKeyword"] = 99] = "PackageKeyword"; - SyntaxKind[SyntaxKind["PrivateKeyword"] = 100] = "PrivateKeyword"; - SyntaxKind[SyntaxKind["ProtectedKeyword"] = 101] = "ProtectedKeyword"; - SyntaxKind[SyntaxKind["PublicKeyword"] = 102] = "PublicKeyword"; - SyntaxKind[SyntaxKind["StaticKeyword"] = 103] = "StaticKeyword"; - SyntaxKind[SyntaxKind["YieldKeyword"] = 104] = "YieldKeyword"; - SyntaxKind[SyntaxKind["AnyKeyword"] = 105] = "AnyKeyword"; - SyntaxKind[SyntaxKind["BooleanKeyword"] = 106] = "BooleanKeyword"; - SyntaxKind[SyntaxKind["ConstructorKeyword"] = 107] = "ConstructorKeyword"; - SyntaxKind[SyntaxKind["DeclareKeyword"] = 108] = "DeclareKeyword"; - SyntaxKind[SyntaxKind["GetKeyword"] = 109] = "GetKeyword"; - SyntaxKind[SyntaxKind["ModuleKeyword"] = 110] = "ModuleKeyword"; - SyntaxKind[SyntaxKind["RequireKeyword"] = 111] = "RequireKeyword"; - SyntaxKind[SyntaxKind["NumberKeyword"] = 112] = "NumberKeyword"; - SyntaxKind[SyntaxKind["SetKeyword"] = 113] = "SetKeyword"; - SyntaxKind[SyntaxKind["StringKeyword"] = 114] = "StringKeyword"; - SyntaxKind[SyntaxKind["Missing"] = 115] = "Missing"; - SyntaxKind[SyntaxKind["QualifiedName"] = 116] = "QualifiedName"; - SyntaxKind[SyntaxKind["TypeParameter"] = 117] = "TypeParameter"; - SyntaxKind[SyntaxKind["Parameter"] = 118] = "Parameter"; - SyntaxKind[SyntaxKind["Property"] = 119] = "Property"; - SyntaxKind[SyntaxKind["Method"] = 120] = "Method"; - SyntaxKind[SyntaxKind["Constructor"] = 121] = "Constructor"; - SyntaxKind[SyntaxKind["GetAccessor"] = 122] = "GetAccessor"; - SyntaxKind[SyntaxKind["SetAccessor"] = 123] = "SetAccessor"; - SyntaxKind[SyntaxKind["CallSignature"] = 124] = "CallSignature"; - SyntaxKind[SyntaxKind["ConstructSignature"] = 125] = "ConstructSignature"; - SyntaxKind[SyntaxKind["IndexSignature"] = 126] = "IndexSignature"; - SyntaxKind[SyntaxKind["TypeReference"] = 127] = "TypeReference"; - SyntaxKind[SyntaxKind["TypeQuery"] = 128] = "TypeQuery"; - SyntaxKind[SyntaxKind["TypeLiteral"] = 129] = "TypeLiteral"; - SyntaxKind[SyntaxKind["ArrayType"] = 130] = "ArrayType"; - SyntaxKind[SyntaxKind["TupleType"] = 131] = "TupleType"; - SyntaxKind[SyntaxKind["ArrayLiteral"] = 132] = "ArrayLiteral"; - SyntaxKind[SyntaxKind["ObjectLiteral"] = 133] = "ObjectLiteral"; - SyntaxKind[SyntaxKind["PropertyAssignment"] = 134] = "PropertyAssignment"; - SyntaxKind[SyntaxKind["PropertyAccess"] = 135] = "PropertyAccess"; - SyntaxKind[SyntaxKind["IndexedAccess"] = 136] = "IndexedAccess"; - SyntaxKind[SyntaxKind["CallExpression"] = 137] = "CallExpression"; - SyntaxKind[SyntaxKind["NewExpression"] = 138] = "NewExpression"; - SyntaxKind[SyntaxKind["TypeAssertion"] = 139] = "TypeAssertion"; - SyntaxKind[SyntaxKind["ParenExpression"] = 140] = "ParenExpression"; - SyntaxKind[SyntaxKind["FunctionExpression"] = 141] = "FunctionExpression"; - SyntaxKind[SyntaxKind["ArrowFunction"] = 142] = "ArrowFunction"; - SyntaxKind[SyntaxKind["PrefixOperator"] = 143] = "PrefixOperator"; - SyntaxKind[SyntaxKind["PostfixOperator"] = 144] = "PostfixOperator"; - SyntaxKind[SyntaxKind["BinaryExpression"] = 145] = "BinaryExpression"; - SyntaxKind[SyntaxKind["ConditionalExpression"] = 146] = "ConditionalExpression"; - SyntaxKind[SyntaxKind["OmittedExpression"] = 147] = "OmittedExpression"; - SyntaxKind[SyntaxKind["Block"] = 148] = "Block"; - SyntaxKind[SyntaxKind["VariableStatement"] = 149] = "VariableStatement"; - SyntaxKind[SyntaxKind["EmptyStatement"] = 150] = "EmptyStatement"; - SyntaxKind[SyntaxKind["ExpressionStatement"] = 151] = "ExpressionStatement"; - SyntaxKind[SyntaxKind["IfStatement"] = 152] = "IfStatement"; - SyntaxKind[SyntaxKind["DoStatement"] = 153] = "DoStatement"; - SyntaxKind[SyntaxKind["WhileStatement"] = 154] = "WhileStatement"; - SyntaxKind[SyntaxKind["ForStatement"] = 155] = "ForStatement"; - SyntaxKind[SyntaxKind["ForInStatement"] = 156] = "ForInStatement"; - SyntaxKind[SyntaxKind["ContinueStatement"] = 157] = "ContinueStatement"; - SyntaxKind[SyntaxKind["BreakStatement"] = 158] = "BreakStatement"; - SyntaxKind[SyntaxKind["ReturnStatement"] = 159] = "ReturnStatement"; - SyntaxKind[SyntaxKind["WithStatement"] = 160] = "WithStatement"; - SyntaxKind[SyntaxKind["SwitchStatement"] = 161] = "SwitchStatement"; - SyntaxKind[SyntaxKind["CaseClause"] = 162] = "CaseClause"; - SyntaxKind[SyntaxKind["DefaultClause"] = 163] = "DefaultClause"; - SyntaxKind[SyntaxKind["LabeledStatement"] = 164] = "LabeledStatement"; - SyntaxKind[SyntaxKind["ThrowStatement"] = 165] = "ThrowStatement"; - SyntaxKind[SyntaxKind["TryStatement"] = 166] = "TryStatement"; - SyntaxKind[SyntaxKind["TryBlock"] = 167] = "TryBlock"; - SyntaxKind[SyntaxKind["CatchBlock"] = 168] = "CatchBlock"; - SyntaxKind[SyntaxKind["FinallyBlock"] = 169] = "FinallyBlock"; - SyntaxKind[SyntaxKind["DebuggerStatement"] = 170] = "DebuggerStatement"; - SyntaxKind[SyntaxKind["VariableDeclaration"] = 171] = "VariableDeclaration"; - SyntaxKind[SyntaxKind["FunctionDeclaration"] = 172] = "FunctionDeclaration"; - SyntaxKind[SyntaxKind["FunctionBlock"] = 173] = "FunctionBlock"; - SyntaxKind[SyntaxKind["ClassDeclaration"] = 174] = "ClassDeclaration"; - SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 175] = "InterfaceDeclaration"; - SyntaxKind[SyntaxKind["EnumDeclaration"] = 176] = "EnumDeclaration"; - SyntaxKind[SyntaxKind["ModuleDeclaration"] = 177] = "ModuleDeclaration"; - SyntaxKind[SyntaxKind["ModuleBlock"] = 178] = "ModuleBlock"; - SyntaxKind[SyntaxKind["ImportDeclaration"] = 179] = "ImportDeclaration"; - SyntaxKind[SyntaxKind["ExportAssignment"] = 180] = "ExportAssignment"; - SyntaxKind[SyntaxKind["EnumMember"] = 181] = "EnumMember"; - SyntaxKind[SyntaxKind["SourceFile"] = 182] = "SourceFile"; - SyntaxKind[SyntaxKind["Program"] = 183] = "Program"; - SyntaxKind[SyntaxKind["SyntaxList"] = 184] = "SyntaxList"; - SyntaxKind[SyntaxKind["Count"] = 185] = "Count"; - SyntaxKind[SyntaxKind["FirstAssignment"] = SyntaxKind.EqualsToken] = "FirstAssignment"; - SyntaxKind[SyntaxKind["LastAssignment"] = SyntaxKind.CaretEqualsToken] = "LastAssignment"; - SyntaxKind[SyntaxKind["FirstReservedWord"] = SyntaxKind.BreakKeyword] = "FirstReservedWord"; - SyntaxKind[SyntaxKind["LastReservedWord"] = SyntaxKind.WithKeyword] = "LastReservedWord"; - SyntaxKind[SyntaxKind["FirstKeyword"] = SyntaxKind.BreakKeyword] = "FirstKeyword"; - SyntaxKind[SyntaxKind["LastKeyword"] = SyntaxKind.StringKeyword] = "LastKeyword"; - SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = SyntaxKind.ImplementsKeyword] = "FirstFutureReservedWord"; - SyntaxKind[SyntaxKind["LastFutureReservedWord"] = SyntaxKind.YieldKeyword] = "LastFutureReservedWord"; - SyntaxKind[SyntaxKind["FirstTypeNode"] = SyntaxKind.TypeReference] = "FirstTypeNode"; - SyntaxKind[SyntaxKind["LastTypeNode"] = SyntaxKind.TupleType] = "LastTypeNode"; - SyntaxKind[SyntaxKind["FirstPunctuation"] = SyntaxKind.OpenBraceToken] = "FirstPunctuation"; - SyntaxKind[SyntaxKind["LastPunctuation"] = SyntaxKind.CaretEqualsToken] = "LastPunctuation"; - SyntaxKind[SyntaxKind["FirstToken"] = SyntaxKind.EndOfFileToken] = "FirstToken"; - SyntaxKind[SyntaxKind["LastToken"] = SyntaxKind.StringKeyword] = "LastToken"; - SyntaxKind[SyntaxKind["FirstTriviaToken"] = SyntaxKind.SingleLineCommentTrivia] = "FirstTriviaToken"; - SyntaxKind[SyntaxKind["LastTriviaToken"] = SyntaxKind.WhitespaceTrivia] = "LastTriviaToken"; - })(ts.SyntaxKind || (ts.SyntaxKind = {})); - var SyntaxKind = ts.SyntaxKind; - (function (NodeFlags) { - NodeFlags[NodeFlags["Export"] = 0x00000001] = "Export"; - NodeFlags[NodeFlags["Ambient"] = 0x00000002] = "Ambient"; - NodeFlags[NodeFlags["QuestionMark"] = 0x00000004] = "QuestionMark"; - NodeFlags[NodeFlags["Rest"] = 0x00000008] = "Rest"; - NodeFlags[NodeFlags["Public"] = 0x00000010] = "Public"; - NodeFlags[NodeFlags["Private"] = 0x00000020] = "Private"; - NodeFlags[NodeFlags["Protected"] = 0x00000040] = "Protected"; - NodeFlags[NodeFlags["Static"] = 0x00000080] = "Static"; - NodeFlags[NodeFlags["MultiLine"] = 0x00000100] = "MultiLine"; - NodeFlags[NodeFlags["Synthetic"] = 0x00000200] = "Synthetic"; - NodeFlags[NodeFlags["DeclarationFile"] = 0x00000400] = "DeclarationFile"; - NodeFlags[NodeFlags["Modifier"] = NodeFlags.Export | NodeFlags.Ambient | NodeFlags.Public | NodeFlags.Private | NodeFlags.Protected | NodeFlags.Static] = "Modifier"; - NodeFlags[NodeFlags["AccessibilityModifier"] = NodeFlags.Public | NodeFlags.Private | NodeFlags.Protected] = "AccessibilityModifier"; - })(ts.NodeFlags || (ts.NodeFlags = {})); - var NodeFlags = ts.NodeFlags; - (function (EmitReturnStatus) { - EmitReturnStatus[EmitReturnStatus["Succeeded"] = 0] = "Succeeded"; - EmitReturnStatus[EmitReturnStatus["AllOutputGenerationSkipped"] = 1] = "AllOutputGenerationSkipped"; - EmitReturnStatus[EmitReturnStatus["JSGeneratedWithSemanticErrors"] = 2] = "JSGeneratedWithSemanticErrors"; - EmitReturnStatus[EmitReturnStatus["DeclarationGenerationSkipped"] = 3] = "DeclarationGenerationSkipped"; - EmitReturnStatus[EmitReturnStatus["EmitErrorsEncountered"] = 4] = "EmitErrorsEncountered"; - EmitReturnStatus[EmitReturnStatus["CompilerOptionsErrors"] = 5] = "CompilerOptionsErrors"; - })(ts.EmitReturnStatus || (ts.EmitReturnStatus = {})); - var EmitReturnStatus = ts.EmitReturnStatus; - (function (TypeFormatFlags) { - TypeFormatFlags[TypeFormatFlags["None"] = 0x00000000] = "None"; - TypeFormatFlags[TypeFormatFlags["WriteArrayAsGenericType"] = 0x00000001] = "WriteArrayAsGenericType"; - TypeFormatFlags[TypeFormatFlags["UseTypeOfFunction"] = 0x00000002] = "UseTypeOfFunction"; - TypeFormatFlags[TypeFormatFlags["NoTruncation"] = 0x00000004] = "NoTruncation"; - TypeFormatFlags[TypeFormatFlags["WriteArrowStyleSignature"] = 0x00000008] = "WriteArrowStyleSignature"; - TypeFormatFlags[TypeFormatFlags["WriteOwnNameForAnyLike"] = 0x00000010] = "WriteOwnNameForAnyLike"; - TypeFormatFlags[TypeFormatFlags["WriteTypeArgumentsOfSignature"] = 0x00000020] = "WriteTypeArgumentsOfSignature"; - })(ts.TypeFormatFlags || (ts.TypeFormatFlags = {})); - var TypeFormatFlags = ts.TypeFormatFlags; - (function (SymbolFormatFlags) { - SymbolFormatFlags[SymbolFormatFlags["None"] = 0x00000000] = "None"; - SymbolFormatFlags[SymbolFormatFlags["WriteTypeParametersOrArguments"] = 0x00000001] = "WriteTypeParametersOrArguments"; - SymbolFormatFlags[SymbolFormatFlags["UseOnlyExternalAliasing"] = 0x00000002] = "UseOnlyExternalAliasing"; - })(ts.SymbolFormatFlags || (ts.SymbolFormatFlags = {})); - var SymbolFormatFlags = ts.SymbolFormatFlags; - (function (SymbolAccessibility) { - SymbolAccessibility[SymbolAccessibility["Accessible"] = 0] = "Accessible"; - SymbolAccessibility[SymbolAccessibility["NotAccessible"] = 1] = "NotAccessible"; - SymbolAccessibility[SymbolAccessibility["CannotBeNamed"] = 2] = "CannotBeNamed"; - })(ts.SymbolAccessibility || (ts.SymbolAccessibility = {})); - var SymbolAccessibility = ts.SymbolAccessibility; - (function (SymbolFlags) { - SymbolFlags[SymbolFlags["Variable"] = 0x00000001] = "Variable"; - SymbolFlags[SymbolFlags["Property"] = 0x00000002] = "Property"; - SymbolFlags[SymbolFlags["EnumMember"] = 0x00000004] = "EnumMember"; - SymbolFlags[SymbolFlags["Function"] = 0x00000008] = "Function"; - SymbolFlags[SymbolFlags["Class"] = 0x00000010] = "Class"; - SymbolFlags[SymbolFlags["Interface"] = 0x00000020] = "Interface"; - SymbolFlags[SymbolFlags["Enum"] = 0x00000040] = "Enum"; - SymbolFlags[SymbolFlags["ValueModule"] = 0x00000080] = "ValueModule"; - SymbolFlags[SymbolFlags["NamespaceModule"] = 0x00000100] = "NamespaceModule"; - SymbolFlags[SymbolFlags["TypeLiteral"] = 0x00000200] = "TypeLiteral"; - SymbolFlags[SymbolFlags["ObjectLiteral"] = 0x00000400] = "ObjectLiteral"; - SymbolFlags[SymbolFlags["Method"] = 0x00000800] = "Method"; - SymbolFlags[SymbolFlags["Constructor"] = 0x00001000] = "Constructor"; - SymbolFlags[SymbolFlags["GetAccessor"] = 0x00002000] = "GetAccessor"; - SymbolFlags[SymbolFlags["SetAccessor"] = 0x00004000] = "SetAccessor"; - SymbolFlags[SymbolFlags["CallSignature"] = 0x00008000] = "CallSignature"; - SymbolFlags[SymbolFlags["ConstructSignature"] = 0x00010000] = "ConstructSignature"; - SymbolFlags[SymbolFlags["IndexSignature"] = 0x00020000] = "IndexSignature"; - SymbolFlags[SymbolFlags["TypeParameter"] = 0x00040000] = "TypeParameter"; - SymbolFlags[SymbolFlags["ExportValue"] = 0x00080000] = "ExportValue"; - SymbolFlags[SymbolFlags["ExportType"] = 0x00100000] = "ExportType"; - SymbolFlags[SymbolFlags["ExportNamespace"] = 0x00200000] = "ExportNamespace"; - SymbolFlags[SymbolFlags["Import"] = 0x00400000] = "Import"; - SymbolFlags[SymbolFlags["Instantiated"] = 0x00800000] = "Instantiated"; - SymbolFlags[SymbolFlags["Merged"] = 0x01000000] = "Merged"; - SymbolFlags[SymbolFlags["Transient"] = 0x02000000] = "Transient"; - SymbolFlags[SymbolFlags["Prototype"] = 0x04000000] = "Prototype"; - SymbolFlags[SymbolFlags["Value"] = SymbolFlags.Variable | SymbolFlags.Property | SymbolFlags.EnumMember | SymbolFlags.Function | SymbolFlags.Class | SymbolFlags.Enum | SymbolFlags.ValueModule | SymbolFlags.Method | SymbolFlags.GetAccessor | SymbolFlags.SetAccessor] = "Value"; - SymbolFlags[SymbolFlags["Type"] = SymbolFlags.Class | SymbolFlags.Interface | SymbolFlags.Enum | SymbolFlags.TypeLiteral | SymbolFlags.ObjectLiteral | SymbolFlags.TypeParameter] = "Type"; - SymbolFlags[SymbolFlags["Namespace"] = SymbolFlags.ValueModule | SymbolFlags.NamespaceModule] = "Namespace"; - SymbolFlags[SymbolFlags["Module"] = SymbolFlags.ValueModule | SymbolFlags.NamespaceModule] = "Module"; - SymbolFlags[SymbolFlags["Accessor"] = SymbolFlags.GetAccessor | SymbolFlags.SetAccessor] = "Accessor"; - SymbolFlags[SymbolFlags["Signature"] = SymbolFlags.CallSignature | SymbolFlags.ConstructSignature | SymbolFlags.IndexSignature] = "Signature"; - SymbolFlags[SymbolFlags["ParameterExcludes"] = SymbolFlags.Value] = "ParameterExcludes"; - SymbolFlags[SymbolFlags["VariableExcludes"] = SymbolFlags.Value & ~SymbolFlags.Variable] = "VariableExcludes"; - SymbolFlags[SymbolFlags["PropertyExcludes"] = SymbolFlags.Value] = "PropertyExcludes"; - SymbolFlags[SymbolFlags["EnumMemberExcludes"] = SymbolFlags.Value] = "EnumMemberExcludes"; - SymbolFlags[SymbolFlags["FunctionExcludes"] = SymbolFlags.Value & ~(SymbolFlags.Function | SymbolFlags.ValueModule)] = "FunctionExcludes"; - SymbolFlags[SymbolFlags["ClassExcludes"] = (SymbolFlags.Value | SymbolFlags.Type) & ~SymbolFlags.ValueModule] = "ClassExcludes"; - SymbolFlags[SymbolFlags["InterfaceExcludes"] = SymbolFlags.Type & ~SymbolFlags.Interface] = "InterfaceExcludes"; - SymbolFlags[SymbolFlags["EnumExcludes"] = (SymbolFlags.Value | SymbolFlags.Type) & ~(SymbolFlags.Enum | SymbolFlags.ValueModule)] = "EnumExcludes"; - SymbolFlags[SymbolFlags["ValueModuleExcludes"] = SymbolFlags.Value & ~(SymbolFlags.Function | SymbolFlags.Class | SymbolFlags.Enum | SymbolFlags.ValueModule)] = "ValueModuleExcludes"; - SymbolFlags[SymbolFlags["NamespaceModuleExcludes"] = 0] = "NamespaceModuleExcludes"; - SymbolFlags[SymbolFlags["MethodExcludes"] = SymbolFlags.Value & ~SymbolFlags.Method] = "MethodExcludes"; - SymbolFlags[SymbolFlags["GetAccessorExcludes"] = SymbolFlags.Value & ~SymbolFlags.SetAccessor] = "GetAccessorExcludes"; - SymbolFlags[SymbolFlags["SetAccessorExcludes"] = SymbolFlags.Value & ~SymbolFlags.GetAccessor] = "SetAccessorExcludes"; - SymbolFlags[SymbolFlags["TypeParameterExcludes"] = SymbolFlags.Type & ~SymbolFlags.TypeParameter] = "TypeParameterExcludes"; - SymbolFlags[SymbolFlags["ImportExcludes"] = SymbolFlags.Import] = "ImportExcludes"; - SymbolFlags[SymbolFlags["ModuleMember"] = SymbolFlags.Variable | SymbolFlags.Function | SymbolFlags.Class | SymbolFlags.Interface | SymbolFlags.Enum | SymbolFlags.Module | SymbolFlags.Import] = "ModuleMember"; - SymbolFlags[SymbolFlags["ExportHasLocal"] = SymbolFlags.Function | SymbolFlags.Class | SymbolFlags.Enum | SymbolFlags.ValueModule] = "ExportHasLocal"; - SymbolFlags[SymbolFlags["HasLocals"] = SymbolFlags.Function | SymbolFlags.Module | SymbolFlags.Method | SymbolFlags.Constructor | SymbolFlags.Accessor | SymbolFlags.Signature] = "HasLocals"; - SymbolFlags[SymbolFlags["HasExports"] = SymbolFlags.Class | SymbolFlags.Enum | SymbolFlags.Module] = "HasExports"; - SymbolFlags[SymbolFlags["HasMembers"] = SymbolFlags.Class | SymbolFlags.Interface | SymbolFlags.TypeLiteral | SymbolFlags.ObjectLiteral] = "HasMembers"; - SymbolFlags[SymbolFlags["IsContainer"] = SymbolFlags.HasLocals | SymbolFlags.HasExports | SymbolFlags.HasMembers] = "IsContainer"; - SymbolFlags[SymbolFlags["PropertyOrAccessor"] = SymbolFlags.Property | SymbolFlags.Accessor] = "PropertyOrAccessor"; - SymbolFlags[SymbolFlags["Export"] = SymbolFlags.ExportNamespace | SymbolFlags.ExportType | SymbolFlags.ExportValue] = "Export"; - })(ts.SymbolFlags || (ts.SymbolFlags = {})); - var SymbolFlags = ts.SymbolFlags; - (function (NodeCheckFlags) { - NodeCheckFlags[NodeCheckFlags["TypeChecked"] = 0x00000001] = "TypeChecked"; - NodeCheckFlags[NodeCheckFlags["LexicalThis"] = 0x00000002] = "LexicalThis"; - NodeCheckFlags[NodeCheckFlags["CaptureThis"] = 0x00000004] = "CaptureThis"; - NodeCheckFlags[NodeCheckFlags["EmitExtends"] = 0x00000008] = "EmitExtends"; - NodeCheckFlags[NodeCheckFlags["SuperInstance"] = 0x00000010] = "SuperInstance"; - NodeCheckFlags[NodeCheckFlags["SuperStatic"] = 0x00000020] = "SuperStatic"; - NodeCheckFlags[NodeCheckFlags["ContextChecked"] = 0x00000040] = "ContextChecked"; - NodeCheckFlags[NodeCheckFlags["EnumValuesComputed"] = 0x00000080] = "EnumValuesComputed"; - })(ts.NodeCheckFlags || (ts.NodeCheckFlags = {})); - var NodeCheckFlags = ts.NodeCheckFlags; - (function (TypeFlags) { - TypeFlags[TypeFlags["Any"] = 0x00000001] = "Any"; - TypeFlags[TypeFlags["String"] = 0x00000002] = "String"; - TypeFlags[TypeFlags["Number"] = 0x00000004] = "Number"; - TypeFlags[TypeFlags["Boolean"] = 0x00000008] = "Boolean"; - TypeFlags[TypeFlags["Void"] = 0x00000010] = "Void"; - TypeFlags[TypeFlags["Undefined"] = 0x00000020] = "Undefined"; - TypeFlags[TypeFlags["Null"] = 0x00000040] = "Null"; - TypeFlags[TypeFlags["Enum"] = 0x00000080] = "Enum"; - TypeFlags[TypeFlags["StringLiteral"] = 0x00000100] = "StringLiteral"; - TypeFlags[TypeFlags["TypeParameter"] = 0x00000200] = "TypeParameter"; - TypeFlags[TypeFlags["Class"] = 0x00000400] = "Class"; - TypeFlags[TypeFlags["Interface"] = 0x00000800] = "Interface"; - TypeFlags[TypeFlags["Reference"] = 0x00001000] = "Reference"; - TypeFlags[TypeFlags["Tuple"] = 0x00002000] = "Tuple"; - TypeFlags[TypeFlags["Anonymous"] = 0x00004000] = "Anonymous"; - TypeFlags[TypeFlags["FromSignature"] = 0x00008000] = "FromSignature"; - TypeFlags[TypeFlags["Intrinsic"] = TypeFlags.Any | TypeFlags.String | TypeFlags.Number | TypeFlags.Boolean | TypeFlags.Void | TypeFlags.Undefined | TypeFlags.Null] = "Intrinsic"; - TypeFlags[TypeFlags["StringLike"] = TypeFlags.String | TypeFlags.StringLiteral] = "StringLike"; - TypeFlags[TypeFlags["NumberLike"] = TypeFlags.Number | TypeFlags.Enum] = "NumberLike"; - TypeFlags[TypeFlags["ObjectType"] = TypeFlags.Class | TypeFlags.Interface | TypeFlags.Reference | TypeFlags.Tuple | TypeFlags.Anonymous] = "ObjectType"; - })(ts.TypeFlags || (ts.TypeFlags = {})); - var TypeFlags = ts.TypeFlags; - (function (SignatureKind) { - SignatureKind[SignatureKind["Call"] = 0] = "Call"; - SignatureKind[SignatureKind["Construct"] = 1] = "Construct"; - })(ts.SignatureKind || (ts.SignatureKind = {})); - var SignatureKind = ts.SignatureKind; - (function (IndexKind) { - IndexKind[IndexKind["String"] = 0] = "String"; - IndexKind[IndexKind["Number"] = 1] = "Number"; - })(ts.IndexKind || (ts.IndexKind = {})); - var IndexKind = ts.IndexKind; - (function (DiagnosticCategory) { - DiagnosticCategory[DiagnosticCategory["Warning"] = 0] = "Warning"; - DiagnosticCategory[DiagnosticCategory["Error"] = 1] = "Error"; - DiagnosticCategory[DiagnosticCategory["Message"] = 2] = "Message"; - })(ts.DiagnosticCategory || (ts.DiagnosticCategory = {})); - var DiagnosticCategory = ts.DiagnosticCategory; - (function (ModuleKind) { - ModuleKind[ModuleKind["None"] = 0] = "None"; - ModuleKind[ModuleKind["CommonJS"] = 1] = "CommonJS"; - ModuleKind[ModuleKind["AMD"] = 2] = "AMD"; - })(ts.ModuleKind || (ts.ModuleKind = {})); - var ModuleKind = ts.ModuleKind; - (function (ScriptTarget) { - ScriptTarget[ScriptTarget["ES3"] = 0] = "ES3"; - ScriptTarget[ScriptTarget["ES5"] = 1] = "ES5"; - })(ts.ScriptTarget || (ts.ScriptTarget = {})); - var ScriptTarget = ts.ScriptTarget; - (function (CharacterCodes) { - CharacterCodes[CharacterCodes["nullCharacter"] = 0] = "nullCharacter"; - CharacterCodes[CharacterCodes["maxAsciiCharacter"] = 0x7F] = "maxAsciiCharacter"; - CharacterCodes[CharacterCodes["lineFeed"] = 0x0A] = "lineFeed"; - CharacterCodes[CharacterCodes["carriageReturn"] = 0x0D] = "carriageReturn"; - CharacterCodes[CharacterCodes["lineSeparator"] = 0x2028] = "lineSeparator"; - CharacterCodes[CharacterCodes["paragraphSeparator"] = 0x2029] = "paragraphSeparator"; - CharacterCodes[CharacterCodes["nextLine"] = 0x0085] = "nextLine"; - CharacterCodes[CharacterCodes["space"] = 0x0020] = "space"; - CharacterCodes[CharacterCodes["nonBreakingSpace"] = 0x00A0] = "nonBreakingSpace"; - CharacterCodes[CharacterCodes["enQuad"] = 0x2000] = "enQuad"; - CharacterCodes[CharacterCodes["emQuad"] = 0x2001] = "emQuad"; - CharacterCodes[CharacterCodes["enSpace"] = 0x2002] = "enSpace"; - CharacterCodes[CharacterCodes["emSpace"] = 0x2003] = "emSpace"; - CharacterCodes[CharacterCodes["threePerEmSpace"] = 0x2004] = "threePerEmSpace"; - CharacterCodes[CharacterCodes["fourPerEmSpace"] = 0x2005] = "fourPerEmSpace"; - CharacterCodes[CharacterCodes["sixPerEmSpace"] = 0x2006] = "sixPerEmSpace"; - CharacterCodes[CharacterCodes["figureSpace"] = 0x2007] = "figureSpace"; - CharacterCodes[CharacterCodes["punctuationSpace"] = 0x2008] = "punctuationSpace"; - CharacterCodes[CharacterCodes["thinSpace"] = 0x2009] = "thinSpace"; - CharacterCodes[CharacterCodes["hairSpace"] = 0x200A] = "hairSpace"; - CharacterCodes[CharacterCodes["zeroWidthSpace"] = 0x200B] = "zeroWidthSpace"; - CharacterCodes[CharacterCodes["narrowNoBreakSpace"] = 0x202F] = "narrowNoBreakSpace"; - CharacterCodes[CharacterCodes["ideographicSpace"] = 0x3000] = "ideographicSpace"; - CharacterCodes[CharacterCodes["mathematicalSpace"] = 0x205F] = "mathematicalSpace"; - CharacterCodes[CharacterCodes["ogham"] = 0x1680] = "ogham"; - CharacterCodes[CharacterCodes["_"] = 0x5F] = "_"; - CharacterCodes[CharacterCodes["$"] = 0x24] = "$"; - CharacterCodes[CharacterCodes["_0"] = 0x30] = "_0"; - CharacterCodes[CharacterCodes["_1"] = 0x31] = "_1"; - CharacterCodes[CharacterCodes["_2"] = 0x32] = "_2"; - CharacterCodes[CharacterCodes["_3"] = 0x33] = "_3"; - CharacterCodes[CharacterCodes["_4"] = 0x34] = "_4"; - CharacterCodes[CharacterCodes["_5"] = 0x35] = "_5"; - CharacterCodes[CharacterCodes["_6"] = 0x36] = "_6"; - CharacterCodes[CharacterCodes["_7"] = 0x37] = "_7"; - CharacterCodes[CharacterCodes["_8"] = 0x38] = "_8"; - CharacterCodes[CharacterCodes["_9"] = 0x39] = "_9"; - CharacterCodes[CharacterCodes["a"] = 0x61] = "a"; - CharacterCodes[CharacterCodes["b"] = 0x62] = "b"; - CharacterCodes[CharacterCodes["c"] = 0x63] = "c"; - CharacterCodes[CharacterCodes["d"] = 0x64] = "d"; - CharacterCodes[CharacterCodes["e"] = 0x65] = "e"; - CharacterCodes[CharacterCodes["f"] = 0x66] = "f"; - CharacterCodes[CharacterCodes["g"] = 0x67] = "g"; - CharacterCodes[CharacterCodes["h"] = 0x68] = "h"; - CharacterCodes[CharacterCodes["i"] = 0x69] = "i"; - CharacterCodes[CharacterCodes["j"] = 0x6A] = "j"; - CharacterCodes[CharacterCodes["k"] = 0x6B] = "k"; - CharacterCodes[CharacterCodes["l"] = 0x6C] = "l"; - CharacterCodes[CharacterCodes["m"] = 0x6D] = "m"; - CharacterCodes[CharacterCodes["n"] = 0x6E] = "n"; - CharacterCodes[CharacterCodes["o"] = 0x6F] = "o"; - CharacterCodes[CharacterCodes["p"] = 0x70] = "p"; - CharacterCodes[CharacterCodes["q"] = 0x71] = "q"; - CharacterCodes[CharacterCodes["r"] = 0x72] = "r"; - CharacterCodes[CharacterCodes["s"] = 0x73] = "s"; - CharacterCodes[CharacterCodes["t"] = 0x74] = "t"; - CharacterCodes[CharacterCodes["u"] = 0x75] = "u"; - CharacterCodes[CharacterCodes["v"] = 0x76] = "v"; - CharacterCodes[CharacterCodes["w"] = 0x77] = "w"; - CharacterCodes[CharacterCodes["x"] = 0x78] = "x"; - CharacterCodes[CharacterCodes["y"] = 0x79] = "y"; - CharacterCodes[CharacterCodes["z"] = 0x7A] = "z"; - CharacterCodes[CharacterCodes["A"] = 0x41] = "A"; - CharacterCodes[CharacterCodes["B"] = 0x42] = "B"; - CharacterCodes[CharacterCodes["C"] = 0x43] = "C"; - CharacterCodes[CharacterCodes["D"] = 0x44] = "D"; - CharacterCodes[CharacterCodes["E"] = 0x45] = "E"; - CharacterCodes[CharacterCodes["F"] = 0x46] = "F"; - CharacterCodes[CharacterCodes["G"] = 0x47] = "G"; - CharacterCodes[CharacterCodes["H"] = 0x48] = "H"; - CharacterCodes[CharacterCodes["I"] = 0x49] = "I"; - CharacterCodes[CharacterCodes["J"] = 0x4A] = "J"; - CharacterCodes[CharacterCodes["K"] = 0x4B] = "K"; - CharacterCodes[CharacterCodes["L"] = 0x4C] = "L"; - CharacterCodes[CharacterCodes["M"] = 0x4D] = "M"; - CharacterCodes[CharacterCodes["N"] = 0x4E] = "N"; - CharacterCodes[CharacterCodes["O"] = 0x4F] = "O"; - CharacterCodes[CharacterCodes["P"] = 0x50] = "P"; - CharacterCodes[CharacterCodes["Q"] = 0x51] = "Q"; - CharacterCodes[CharacterCodes["R"] = 0x52] = "R"; - CharacterCodes[CharacterCodes["S"] = 0x53] = "S"; - CharacterCodes[CharacterCodes["T"] = 0x54] = "T"; - CharacterCodes[CharacterCodes["U"] = 0x55] = "U"; - CharacterCodes[CharacterCodes["V"] = 0x56] = "V"; - CharacterCodes[CharacterCodes["W"] = 0x57] = "W"; - CharacterCodes[CharacterCodes["X"] = 0x58] = "X"; - CharacterCodes[CharacterCodes["Y"] = 0x59] = "Y"; - CharacterCodes[CharacterCodes["Z"] = 0x5a] = "Z"; - CharacterCodes[CharacterCodes["ampersand"] = 0x26] = "ampersand"; - CharacterCodes[CharacterCodes["asterisk"] = 0x2A] = "asterisk"; - CharacterCodes[CharacterCodes["at"] = 0x40] = "at"; - CharacterCodes[CharacterCodes["backslash"] = 0x5C] = "backslash"; - CharacterCodes[CharacterCodes["bar"] = 0x7C] = "bar"; - CharacterCodes[CharacterCodes["caret"] = 0x5E] = "caret"; - CharacterCodes[CharacterCodes["closeBrace"] = 0x7D] = "closeBrace"; - CharacterCodes[CharacterCodes["closeBracket"] = 0x5D] = "closeBracket"; - CharacterCodes[CharacterCodes["closeParen"] = 0x29] = "closeParen"; - CharacterCodes[CharacterCodes["colon"] = 0x3A] = "colon"; - CharacterCodes[CharacterCodes["comma"] = 0x2C] = "comma"; - CharacterCodes[CharacterCodes["dot"] = 0x2E] = "dot"; - CharacterCodes[CharacterCodes["doubleQuote"] = 0x22] = "doubleQuote"; - CharacterCodes[CharacterCodes["equals"] = 0x3D] = "equals"; - CharacterCodes[CharacterCodes["exclamation"] = 0x21] = "exclamation"; - CharacterCodes[CharacterCodes["greaterThan"] = 0x3E] = "greaterThan"; - CharacterCodes[CharacterCodes["lessThan"] = 0x3C] = "lessThan"; - CharacterCodes[CharacterCodes["minus"] = 0x2D] = "minus"; - CharacterCodes[CharacterCodes["openBrace"] = 0x7B] = "openBrace"; - CharacterCodes[CharacterCodes["openBracket"] = 0x5B] = "openBracket"; - CharacterCodes[CharacterCodes["openParen"] = 0x28] = "openParen"; - CharacterCodes[CharacterCodes["percent"] = 0x25] = "percent"; - CharacterCodes[CharacterCodes["plus"] = 0x2B] = "plus"; - CharacterCodes[CharacterCodes["question"] = 0x3F] = "question"; - CharacterCodes[CharacterCodes["semicolon"] = 0x3B] = "semicolon"; - CharacterCodes[CharacterCodes["singleQuote"] = 0x27] = "singleQuote"; - CharacterCodes[CharacterCodes["slash"] = 0x2F] = "slash"; - CharacterCodes[CharacterCodes["tilde"] = 0x7E] = "tilde"; - CharacterCodes[CharacterCodes["backspace"] = 0x08] = "backspace"; - CharacterCodes[CharacterCodes["formFeed"] = 0x0C] = "formFeed"; - CharacterCodes[CharacterCodes["byteOrderMark"] = 0xFEFF] = "byteOrderMark"; - CharacterCodes[CharacterCodes["tab"] = 0x09] = "tab"; - CharacterCodes[CharacterCodes["verticalTab"] = 0x0B] = "verticalTab"; - })(ts.CharacterCodes || (ts.CharacterCodes = {})); - var CharacterCodes = ts.CharacterCodes; - (function (SymbolDisplayPartKind) { - SymbolDisplayPartKind[SymbolDisplayPartKind["aliasName"] = 0] = "aliasName"; - SymbolDisplayPartKind[SymbolDisplayPartKind["className"] = 1] = "className"; - SymbolDisplayPartKind[SymbolDisplayPartKind["enumName"] = 2] = "enumName"; - SymbolDisplayPartKind[SymbolDisplayPartKind["fieldName"] = 3] = "fieldName"; - SymbolDisplayPartKind[SymbolDisplayPartKind["interfaceName"] = 4] = "interfaceName"; - SymbolDisplayPartKind[SymbolDisplayPartKind["keyword"] = 5] = "keyword"; - SymbolDisplayPartKind[SymbolDisplayPartKind["lineBreak"] = 6] = "lineBreak"; - SymbolDisplayPartKind[SymbolDisplayPartKind["numericLiteral"] = 7] = "numericLiteral"; - SymbolDisplayPartKind[SymbolDisplayPartKind["stringLiteral"] = 8] = "stringLiteral"; - SymbolDisplayPartKind[SymbolDisplayPartKind["localName"] = 9] = "localName"; - SymbolDisplayPartKind[SymbolDisplayPartKind["methodName"] = 10] = "methodName"; - SymbolDisplayPartKind[SymbolDisplayPartKind["moduleName"] = 11] = "moduleName"; - SymbolDisplayPartKind[SymbolDisplayPartKind["operator"] = 12] = "operator"; - SymbolDisplayPartKind[SymbolDisplayPartKind["parameterName"] = 13] = "parameterName"; - SymbolDisplayPartKind[SymbolDisplayPartKind["propertyName"] = 14] = "propertyName"; - SymbolDisplayPartKind[SymbolDisplayPartKind["punctuation"] = 15] = "punctuation"; - SymbolDisplayPartKind[SymbolDisplayPartKind["space"] = 16] = "space"; - SymbolDisplayPartKind[SymbolDisplayPartKind["text"] = 17] = "text"; - SymbolDisplayPartKind[SymbolDisplayPartKind["typeParameterName"] = 18] = "typeParameterName"; - SymbolDisplayPartKind[SymbolDisplayPartKind["enumMemberName"] = 19] = "enumMemberName"; - SymbolDisplayPartKind[SymbolDisplayPartKind["functionName"] = 20] = "functionName"; - SymbolDisplayPartKind[SymbolDisplayPartKind["regularExpressionLiteral"] = 21] = "regularExpressionLiteral"; - })(ts.SymbolDisplayPartKind || (ts.SymbolDisplayPartKind = {})); - var SymbolDisplayPartKind = ts.SymbolDisplayPartKind; -})(ts || (ts = {})); -var ts; -(function (ts) { - function forEach(array, callback) { - var result; - if (array) { - for (var i = 0, len = array.length; i < len; i++) { - if (result = callback(array[i])) { - break; - } - } - } - return result; - } - ts.forEach = forEach; - function contains(array, value) { - if (array) { - for (var i = 0, len = array.length; i < len; i++) { - if (array[i] === value) { - return true; - } - } - } - return false; - } - ts.contains = contains; - function indexOf(array, value) { - if (array) { - for (var i = 0, len = array.length; i < len; i++) { - if (array[i] === value) { - return i; - } - } - } - return -1; - } - ts.indexOf = indexOf; - function countWhere(array, predicate) { - var count = 0; - if (array) { - for (var i = 0, len = array.length; i < len; i++) { - if (predicate(array[i])) { - count++; - } - } - } - return count; - } - ts.countWhere = countWhere; - function filter(array, f) { - if (array) { - var result = []; - for (var i = 0, len = array.length; i < len; i++) { - var item = array[i]; - if (f(item)) { - result.push(item); - } - } - } - return result; - } - ts.filter = filter; - function map(array, f) { - if (array) { - var result = []; - for (var i = 0, len = array.length; i < len; i++) { - result.push(f(array[i])); - } - } - return result; - } - ts.map = map; - function concatenate(array1, array2) { - if (!array2 || !array2.length) - return array1; - if (!array1 || !array1.length) - return array2; - return array1.concat(array2); - } - ts.concatenate = concatenate; - function uniqueElements(array) { - if (array) { - var result = []; - for (var i = 0, len = array.length; i < len; i++) { - var item = array[i]; - if (!contains(result, item)) - result.push(item); - } - } - return result; - } - ts.uniqueElements = uniqueElements; - function sum(array, prop) { - var result = 0; - for (var i = 0; i < array.length; i++) { - result += array[i][prop]; - } - return result; - } - ts.sum = sum; - function binarySearch(array, value) { - var low = 0; - var high = array.length - 1; - while (low <= high) { - var middle = low + ((high - low) >> 1); - var midValue = array[middle]; - if (midValue === value) { - return middle; - } - else if (midValue > value) { - high = middle - 1; - } - else { - low = middle + 1; - } - } - return ~low; - } - ts.binarySearch = binarySearch; - var hasOwnProperty = Object.prototype.hasOwnProperty; - function hasProperty(map, key) { - return hasOwnProperty.call(map, key); - } - ts.hasProperty = hasProperty; - function getProperty(map, key) { - return hasOwnProperty.call(map, key) ? map[key] : undefined; - } - ts.getProperty = getProperty; - function isEmpty(map) { - for (var id in map) { - if (hasProperty(map, id)) { - return false; - } - } - return true; - } - ts.isEmpty = isEmpty; - function clone(object) { - var result = {}; - for (var id in object) { - result[id] = object[id]; - } - return result; - } - ts.clone = clone; - function forEachValue(map, callback) { - var result; - for (var id in map) { - if (result = callback(map[id])) - break; - } - return result; - } - ts.forEachValue = forEachValue; - function forEachKey(map, callback) { - var result; - for (var id in map) { - if (result = callback(id)) - break; - } - return result; - } - ts.forEachKey = forEachKey; - function lookUp(map, key) { - return hasProperty(map, key) ? map[key] : undefined; - } - ts.lookUp = lookUp; - function mapToArray(map) { - var result = []; - for (var id in map) { - result.push(map[id]); - } - return result; - } - ts.mapToArray = mapToArray; - function arrayToMap(array, makeKey) { - var result = {}; - forEach(array, function (value) { - result[makeKey(value)] = value; - }); - return result; - } - ts.arrayToMap = arrayToMap; - function formatStringFromArgs(text, args, baseIndex) { - baseIndex = baseIndex || 0; - return text.replace(/{(\d+)}/g, function (match, index) { return args[+index + baseIndex]; }); - } - ts.localizedDiagnosticMessages = undefined; - function getLocaleSpecificMessage(message) { - return ts.localizedDiagnosticMessages && ts.localizedDiagnosticMessages[message] ? ts.localizedDiagnosticMessages[message] : message; - } - ts.getLocaleSpecificMessage = getLocaleSpecificMessage; - function createFileDiagnostic(file, start, length, message) { - Debug.assert(start >= 0, "start must be non-negative, is " + start); - Debug.assert(length >= 0, "length must be non-negative, is " + length); - var text = getLocaleSpecificMessage(message.key); - if (arguments.length > 4) { - text = formatStringFromArgs(text, arguments, 4); - } - return { - file: file, - start: start, - length: length, - messageText: text, - category: message.category, - code: message.code - }; - } - ts.createFileDiagnostic = createFileDiagnostic; - function createCompilerDiagnostic(message) { - var text = getLocaleSpecificMessage(message.key); - if (arguments.length > 1) { - text = formatStringFromArgs(text, arguments, 1); - } - return { - file: undefined, - start: undefined, - length: undefined, - messageText: text, - category: message.category, - code: message.code - }; - } - ts.createCompilerDiagnostic = createCompilerDiagnostic; - function chainDiagnosticMessages(details, message) { - var text = getLocaleSpecificMessage(message.key); - if (arguments.length > 2) { - text = formatStringFromArgs(text, arguments, 2); - } - return { - messageText: text, - category: message.category, - code: message.code, - next: details - }; - } - ts.chainDiagnosticMessages = chainDiagnosticMessages; - function flattenDiagnosticChain(file, start, length, diagnosticChain, newLine) { - Debug.assert(start >= 0, "start must be non-negative, is " + start); - Debug.assert(length >= 0, "length must be non-negative, is " + length); - var code = diagnosticChain.code; - var category = diagnosticChain.category; - var messageText = ""; - var indent = 0; - while (diagnosticChain) { - if (indent) { - messageText += newLine; - for (var i = 0; i < indent; i++) { - messageText += " "; - } - } - messageText += diagnosticChain.messageText; - indent++; - diagnosticChain = diagnosticChain.next; - } - return { - file: file, - start: start, - length: length, - code: code, - category: category, - messageText: messageText - }; - } - ts.flattenDiagnosticChain = flattenDiagnosticChain; - function compareValues(a, b) { - if (a === b) - return 0; - if (a === undefined) - return -1; - if (b === undefined) - return 1; - return a < b ? -1 : 1; - } - ts.compareValues = compareValues; - function getDiagnosticFilename(diagnostic) { - return diagnostic.file ? diagnostic.file.filename : undefined; - } - function compareDiagnostics(d1, d2) { - return compareValues(getDiagnosticFilename(d1), getDiagnosticFilename(d2)) || compareValues(d1.start, d2.start) || compareValues(d1.length, d2.length) || compareValues(d1.code, d2.code) || compareValues(d1.messageText, d2.messageText) || 0; - } - ts.compareDiagnostics = compareDiagnostics; - function deduplicateSortedDiagnostics(diagnostics) { - if (diagnostics.length < 2) { - return diagnostics; - } - var newDiagnostics = [diagnostics[0]]; - var previousDiagnostic = diagnostics[0]; - for (var i = 1; i < diagnostics.length; i++) { - var currentDiagnostic = diagnostics[i]; - var isDupe = compareDiagnostics(currentDiagnostic, previousDiagnostic) === 0; - if (!isDupe) { - newDiagnostics.push(currentDiagnostic); - previousDiagnostic = currentDiagnostic; - } - } - return newDiagnostics; - } - ts.deduplicateSortedDiagnostics = deduplicateSortedDiagnostics; - function normalizeSlashes(path) { - return path.replace(/\\/g, "/"); - } - ts.normalizeSlashes = normalizeSlashes; - function getRootLength(path) { - if (path.charCodeAt(0) === 47 /* slash */) { - if (path.charCodeAt(1) !== 47 /* slash */) - return 1; - var p1 = path.indexOf("/", 2); - if (p1 < 0) - return 2; - var p2 = path.indexOf("/", p1 + 1); - if (p2 < 0) - return p1 + 1; - return p2 + 1; - } - if (path.charCodeAt(1) === 58 /* colon */) { - if (path.charCodeAt(2) === 47 /* slash */) - return 3; - return 2; - } - return 0; - } - ts.getRootLength = getRootLength; - ts.directorySeparator = "/"; - function getNormalizedParts(normalizedSlashedPath, rootLength) { - var parts = normalizedSlashedPath.substr(rootLength).split(ts.directorySeparator); - var normalized = []; - for (var i = 0; i < parts.length; i++) { - var part = parts[i]; - if (part !== ".") { - if (part === ".." && normalized.length > 0 && normalized[normalized.length - 1] !== "..") { - normalized.pop(); - } - else { - normalized.push(part); - } - } - } - return normalized; - } - function normalizePath(path) { - var path = normalizeSlashes(path); - var rootLength = getRootLength(path); - var normalized = getNormalizedParts(path, rootLength); - return path.substr(0, rootLength) + normalized.join(ts.directorySeparator); - } - ts.normalizePath = normalizePath; - function getDirectoryPath(path) { - return path.substr(0, Math.max(getRootLength(path), path.lastIndexOf(ts.directorySeparator))); - } - ts.getDirectoryPath = getDirectoryPath; - function isUrl(path) { - return path && !isRootedDiskPath(path) && path.indexOf("://") !== -1; - } - ts.isUrl = isUrl; - function isRootedDiskPath(path) { - return getRootLength(path) !== 0; - } - ts.isRootedDiskPath = isRootedDiskPath; - function normalizedPathComponents(path, rootLength) { - var normalizedParts = getNormalizedParts(path, rootLength); - return [path.substr(0, rootLength)].concat(normalizedParts); - } - function getNormalizedPathComponents(path, currentDirectory) { - var path = normalizeSlashes(path); - var rootLength = getRootLength(path); - if (rootLength == 0) { - path = combinePaths(normalizeSlashes(currentDirectory), path); - rootLength = getRootLength(path); - } - return normalizedPathComponents(path, rootLength); - } - ts.getNormalizedPathComponents = getNormalizedPathComponents; - function getNormalizedPathFromPathComponents(pathComponents) { - if (pathComponents && pathComponents.length) { - return pathComponents[0] + pathComponents.slice(1).join(ts.directorySeparator); - } - } - ts.getNormalizedPathFromPathComponents = getNormalizedPathFromPathComponents; - function getNormalizedPathComponentsOfUrl(url) { - var urlLength = url.length; - var rootLength = url.indexOf("://") + "://".length; - while (rootLength < urlLength) { - if (url.charCodeAt(rootLength) === 47 /* slash */) { - rootLength++; - } - else { - break; - } - } - if (rootLength === urlLength) { - return [url]; - } - var indexOfNextSlash = url.indexOf(ts.directorySeparator, rootLength); - if (indexOfNextSlash !== -1) { - rootLength = indexOfNextSlash + 1; - return normalizedPathComponents(url, rootLength); - } - else { - return [url + ts.directorySeparator]; - } - } - function getNormalizedPathOrUrlComponents(pathOrUrl, currentDirectory) { - if (isUrl(pathOrUrl)) { - return getNormalizedPathComponentsOfUrl(pathOrUrl); - } - else { - return getNormalizedPathComponents(pathOrUrl, currentDirectory); - } - } - function getRelativePathToDirectoryOrUrl(directoryPathOrUrl, relativeOrAbsolutePath, currentDirectory, getCanonicalFileName, isAbsolutePathAnUrl) { - var pathComponents = getNormalizedPathOrUrlComponents(relativeOrAbsolutePath, currentDirectory); - var directoryComponents = getNormalizedPathOrUrlComponents(directoryPathOrUrl, currentDirectory); - if (directoryComponents.length > 1 && directoryComponents[directoryComponents.length - 1] === "") { - directoryComponents.length--; - } - for (var joinStartIndex = 0; joinStartIndex < pathComponents.length && joinStartIndex < directoryComponents.length; joinStartIndex++) { - if (getCanonicalFileName(directoryComponents[joinStartIndex]) !== getCanonicalFileName(pathComponents[joinStartIndex])) { - break; - } - } - if (joinStartIndex) { - var relativePath = ""; - var relativePathComponents = pathComponents.slice(joinStartIndex, pathComponents.length); - for (; joinStartIndex < directoryComponents.length; joinStartIndex++) { - if (directoryComponents[joinStartIndex] !== "") { - relativePath = relativePath + ".." + ts.directorySeparator; - } - } - return relativePath + relativePathComponents.join(ts.directorySeparator); - } - var absolutePath = getNormalizedPathFromPathComponents(pathComponents); - if (isAbsolutePathAnUrl && isRootedDiskPath(absolutePath)) { - absolutePath = "file:///" + absolutePath; - } - return absolutePath; - } - ts.getRelativePathToDirectoryOrUrl = getRelativePathToDirectoryOrUrl; - function getBaseFilename(path) { - var i = path.lastIndexOf(ts.directorySeparator); - return i < 0 ? path : path.substring(i + 1); - } - ts.getBaseFilename = getBaseFilename; - function combinePaths(path1, path2) { - if (!(path1 && path1.length)) - return path2; - if (!(path2 && path2.length)) - return path1; - if (path2.charAt(0) === ts.directorySeparator) - return path2; - if (path1.charAt(path1.length - 1) === ts.directorySeparator) - return path1 + path2; - return path1 + ts.directorySeparator + path2; - } - ts.combinePaths = combinePaths; - function fileExtensionIs(path, extension) { - var pathLen = path.length; - var extLen = extension.length; - return pathLen > extLen && path.substr(pathLen - extLen, extLen) === extension; - } - ts.fileExtensionIs = fileExtensionIs; - var supportedExtensions = [".d.ts", ".ts", ".js"]; - function removeFileExtension(path) { - for (var i = 0; i < supportedExtensions.length; i++) { - var ext = supportedExtensions[i]; - if (fileExtensionIs(path, ext)) { - return path.substr(0, path.length - ext.length); - } - } - return path; - } - ts.removeFileExtension = removeFileExtension; - var escapedCharsRegExp = /[\t\v\f\b\0\r\n\"\\\u2028\u2029\u0085]/g; - var escapedCharsMap = { - "\t": "\\t", - "\v": "\\v", - "\f": "\\f", - "\b": "\\b", - "\0": "\\0", - "\r": "\\r", - "\n": "\\n", - "\"": "\\\"", - "\u2028": "\\u2028", - "\u2029": "\\u2029", - "\u0085": "\\u0085" - }; - function escapeString(s) { - return escapedCharsRegExp.test(s) ? s.replace(escapedCharsRegExp, function (c) { - return escapedCharsMap[c] || c; - }) : s; - } - ts.escapeString = escapeString; - function Symbol(flags, name) { - this.flags = flags; - this.name = name; - this.declarations = undefined; - } - function Type(checker, flags) { - this.flags = flags; - } - function Signature(checker) { - } - ts.objectAllocator = { - getNodeConstructor: function (kind) { - function Node() { - } - Node.prototype = { - kind: kind, - pos: 0, - end: 0, - flags: 0, - parent: undefined - }; - return Node; - }, - getSymbolConstructor: function () { return Symbol; }, - getTypeConstructor: function () { return Type; }, - getSignatureConstructor: function () { return Signature; } - }; - (function (AssertionLevel) { - AssertionLevel[AssertionLevel["None"] = 0] = "None"; - AssertionLevel[AssertionLevel["Normal"] = 1] = "Normal"; - AssertionLevel[AssertionLevel["Aggressive"] = 2] = "Aggressive"; - AssertionLevel[AssertionLevel["VeryAggressive"] = 3] = "VeryAggressive"; - })(ts.AssertionLevel || (ts.AssertionLevel = {})); - var AssertionLevel = ts.AssertionLevel; - var Debug; - (function (Debug) { - var currentAssertionLevel = 0 /* None */; - function shouldAssert(level) { - return currentAssertionLevel >= level; - } - Debug.shouldAssert = shouldAssert; - function assert(expression, message, verboseDebugInfo) { - if (!expression) { - var verboseDebugString = ""; - if (verboseDebugInfo) { - verboseDebugString = "\r\nVerbose Debug Information: " + verboseDebugInfo(); - } - throw new Error("Debug Failure. False expression: " + (message || "") + verboseDebugString); - } - } - Debug.assert = assert; - function fail(message) { - Debug.assert(false, message); - } - Debug.fail = fail; - })(Debug = ts.Debug || (ts.Debug = {})); -})(ts || (ts = {})); -var sys = (function () { - function getWScriptSystem() { - var fso = new ActiveXObject("Scripting.FileSystemObject"); - var fileStream = new ActiveXObject("ADODB.Stream"); - fileStream.Type = 2; - var binaryStream = new ActiveXObject("ADODB.Stream"); - binaryStream.Type = 1; - var args = []; - for (var i = 0; i < WScript.Arguments.length; i++) { - args[i] = WScript.Arguments.Item(i); - } - function readFile(fileName, encoding) { - if (!fso.FileExists(fileName)) { - return undefined; - } - fileStream.Open(); - try { - if (encoding) { - fileStream.Charset = encoding; - fileStream.LoadFromFile(fileName); - } - else { - fileStream.Charset = "x-ansi"; - fileStream.LoadFromFile(fileName); - var bom = fileStream.ReadText(2) || ""; - fileStream.Position = 0; - fileStream.Charset = bom.length >= 2 && (bom.charCodeAt(0) === 0xFF && bom.charCodeAt(1) === 0xFE || bom.charCodeAt(0) === 0xFE && bom.charCodeAt(1) === 0xFF) ? "unicode" : "utf-8"; - } - return fileStream.ReadText(); - } - catch (e) { - throw e.number === -2147024809 ? new Error(ts.Diagnostics.Unsupported_file_encoding.key) : e; - } - finally { - fileStream.Close(); - } - } - function writeFile(fileName, data, writeByteOrderMark) { - fileStream.Open(); - binaryStream.Open(); - try { - fileStream.Charset = "utf-8"; - fileStream.WriteText(data); - if (writeByteOrderMark) { - fileStream.Position = 0; - } - else { - fileStream.Position = 3; - } - fileStream.CopyTo(binaryStream); - binaryStream.SaveToFile(fileName, 2); - } - finally { - binaryStream.Close(); - fileStream.Close(); - } - } - return { - args: args, - newLine: "\r\n", - useCaseSensitiveFileNames: false, - write: function (s) { - WScript.StdOut.Write(s); - }, - readFile: readFile, - writeFile: writeFile, - resolvePath: function (path) { - return fso.GetAbsolutePathName(path); - }, - fileExists: function (path) { - return fso.FileExists(path); - }, - directoryExists: function (path) { - return fso.FolderExists(path); - }, - createDirectory: function (directoryName) { - if (!this.directoryExists(directoryName)) { - fso.CreateFolder(directoryName); - } - }, - getExecutingFilePath: function () { - return WScript.ScriptFullName; - }, - getCurrentDirectory: function () { - return new ActiveXObject("WScript.Shell").CurrentDirectory; - }, - exit: function (exitCode) { - try { - WScript.Quit(exitCode); - } - catch (e) { - } - } - }; - } - function getNodeSystem() { - var _fs = require("fs"); - var _path = require("path"); - var _os = require('os'); - var platform = _os.platform(); - var useCaseSensitiveFileNames = platform !== "win32" && platform !== "win64" && platform !== "darwin"; - function readFile(fileName, encoding) { - if (!_fs.existsSync(fileName)) { - return undefined; - } - var buffer = _fs.readFileSync(fileName); - var len = buffer.length; - if (len >= 2 && buffer[0] === 0xFE && buffer[1] === 0xFF) { - len &= ~1; - for (var i = 0; i < len; i += 2) { - var temp = buffer[i]; - buffer[i] = buffer[i + 1]; - buffer[i + 1] = temp; - } - return buffer.toString("utf16le", 2); - } - if (len >= 2 && buffer[0] === 0xFF && buffer[1] === 0xFE) { - return buffer.toString("utf16le", 2); - } - if (len >= 3 && buffer[0] === 0xEF && buffer[1] === 0xBB && buffer[2] === 0xBF) { - return buffer.toString("utf8", 3); - } - return buffer.toString("utf8"); - } - function writeFile(fileName, data, writeByteOrderMark) { - if (writeByteOrderMark) { - data = '\uFEFF' + data; - } - _fs.writeFileSync(fileName, data, "utf8"); - } - return { - args: process.argv.slice(2), - newLine: _os.EOL, - useCaseSensitiveFileNames: useCaseSensitiveFileNames, - write: function (s) { - _fs.writeSync(1, s); - }, - readFile: readFile, - writeFile: writeFile, - watchFile: function (fileName, callback) { - _fs.watchFile(fileName, { persistent: true, interval: 250 }, fileChanged); - return { - close: function () { - _fs.unwatchFile(fileName, fileChanged); - } - }; - function fileChanged(curr, prev) { - if (+curr.mtime <= +prev.mtime) { - return; - } - callback(fileName); - } - ; - }, - resolvePath: function (path) { - return _path.resolve(path); - }, - fileExists: function (path) { - return _fs.existsSync(path); - }, - directoryExists: function (path) { - return _fs.existsSync(path) && _fs.statSync(path).isDirectory(); - }, - createDirectory: function (directoryName) { - if (!this.directoryExists(directoryName)) { - _fs.mkdirSync(directoryName); - } - }, - getExecutingFilePath: function () { - return process.mainModule.filename; - }, - getCurrentDirectory: function () { - return process.cwd(); - }, - getMemoryUsage: function () { - if (global.gc) { - global.gc(); - } - return process.memoryUsage().heapUsed; - }, - exit: function (exitCode) { - process.exit(exitCode); - } - }; - } - if (typeof WScript !== "undefined" && typeof ActiveXObject === "function") { - return getWScriptSystem(); - } - else if (typeof module !== "undefined" && module.exports) { - return getNodeSystem(); - } - else { - return undefined; - } -})(); -var ts; -(function (ts) { - var nodeConstructors = new Array(185 /* Count */); - function getNodeConstructor(kind) { - return nodeConstructors[kind] || (nodeConstructors[kind] = ts.objectAllocator.getNodeConstructor(kind)); - } - ts.getNodeConstructor = getNodeConstructor; - function createRootNode(kind, pos, end, flags) { - var node = new (getNodeConstructor(kind))(); - node.pos = pos; - node.end = end; - node.flags = flags; - return node; - } - function getSourceFileOfNode(node) { - while (node && node.kind !== 182 /* SourceFile */) - node = node.parent; - return node; - } - ts.getSourceFileOfNode = getSourceFileOfNode; - function nodePosToString(node) { - var file = getSourceFileOfNode(node); - var loc = file.getLineAndCharacterFromPosition(node.pos); - return file.filename + "(" + loc.line + "," + loc.character + ")"; - } - ts.nodePosToString = nodePosToString; - function getStartPosOfNode(node) { - return node.pos; - } - ts.getStartPosOfNode = getStartPosOfNode; - function getTokenPosOfNode(node, sourceFile) { - return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos); - } - ts.getTokenPosOfNode = getTokenPosOfNode; - function getTextOfNodeFromSourceText(sourceText, node) { - return sourceText.substring(ts.skipTrivia(sourceText, node.pos), node.end); - } - ts.getTextOfNodeFromSourceText = getTextOfNodeFromSourceText; - function getTextOfNode(node) { - var text = getSourceFileOfNode(node).text; - return text.substring(ts.skipTrivia(text, node.pos), node.end); - } - ts.getTextOfNode = getTextOfNode; - function escapeIdentifier(identifier) { - return identifier.length >= 2 && identifier.charCodeAt(0) === 95 /* _ */ && identifier.charCodeAt(1) === 95 /* _ */ ? "_" + identifier : identifier; - } - ts.escapeIdentifier = escapeIdentifier; - function unescapeIdentifier(identifier) { - return identifier.length >= 3 && identifier.charCodeAt(0) === 95 /* _ */ && identifier.charCodeAt(1) === 95 /* _ */ && identifier.charCodeAt(2) === 95 /* _ */ ? identifier.substr(1) : identifier; - } - ts.unescapeIdentifier = unescapeIdentifier; - function identifierToString(identifier) { - return identifier.kind === 115 /* Missing */ ? "(Missing)" : getTextOfNode(identifier); - } - ts.identifierToString = identifierToString; - function createDiagnosticForNode(node, message, arg0, arg1, arg2) { - node = getErrorSpanForNode(node); - var file = getSourceFileOfNode(node); - var start = node.kind === 115 /* Missing */ ? node.pos : ts.skipTrivia(file.text, node.pos); - var length = node.end - start; - return ts.createFileDiagnostic(file, start, length, message, arg0, arg1, arg2); - } - ts.createDiagnosticForNode = createDiagnosticForNode; - function createDiagnosticForNodeFromMessageChain(node, messageChain, newLine) { - node = getErrorSpanForNode(node); - var file = getSourceFileOfNode(node); - var start = ts.skipTrivia(file.text, node.pos); - var length = node.end - start; - return ts.flattenDiagnosticChain(file, start, length, messageChain, newLine); - } - ts.createDiagnosticForNodeFromMessageChain = createDiagnosticForNodeFromMessageChain; - function getErrorSpanForNode(node) { - var errorSpan; - switch (node.kind) { - case 171 /* VariableDeclaration */: - case 174 /* ClassDeclaration */: - case 175 /* InterfaceDeclaration */: - case 177 /* ModuleDeclaration */: - case 176 /* EnumDeclaration */: - case 181 /* EnumMember */: - errorSpan = node.name; - break; - } - return errorSpan && errorSpan.pos < errorSpan.end ? errorSpan : node; - } - ts.getErrorSpanForNode = getErrorSpanForNode; - function isExternalModule(file) { - return file.externalModuleIndicator !== undefined; - } - ts.isExternalModule = isExternalModule; - function isDeclarationFile(file) { - return (file.flags & 1024 /* DeclarationFile */) !== 0; - } - ts.isDeclarationFile = isDeclarationFile; - function isPrologueDirective(node) { - return node.kind === 151 /* ExpressionStatement */ && node.expression.kind === 7 /* StringLiteral */; - } - ts.isPrologueDirective = isPrologueDirective; - function isEvalOrArgumentsIdentifier(node) { - return node.kind === 59 /* Identifier */ && node.text && (node.text === "eval" || node.text === "arguments"); - } - function isUseStrictPrologueDirective(node) { - ts.Debug.assert(isPrologueDirective(node)); - return node.expression.text === "use strict"; - } - function getLeadingCommentRangesOfNode(node, sourceFileOfNode) { - sourceFileOfNode = sourceFileOfNode || getSourceFileOfNode(node); - if (node.kind === 118 /* Parameter */ || node.kind === 117 /* TypeParameter */) { - return ts.concatenate(ts.getTrailingCommentRanges(sourceFileOfNode.text, node.pos), ts.getLeadingCommentRanges(sourceFileOfNode.text, node.pos)); - } - else { - return ts.getLeadingCommentRanges(sourceFileOfNode.text, node.pos); - } - } - ts.getLeadingCommentRangesOfNode = getLeadingCommentRangesOfNode; - function getJsDocComments(node, sourceFileOfNode) { - return ts.filter(getLeadingCommentRangesOfNode(node, sourceFileOfNode), function (comment) { return isJsDocComment(comment); }); - function isJsDocComment(comment) { - return sourceFileOfNode.text.charCodeAt(comment.pos + 1) === 42 /* asterisk */ && sourceFileOfNode.text.charCodeAt(comment.pos + 2) === 42 /* asterisk */ && sourceFileOfNode.text.charCodeAt(comment.pos + 3) !== 47 /* slash */; - } - } - ts.getJsDocComments = getJsDocComments; - ts.fullTripleSlashReferencePathRegEx = /^(\/\/\/\s*/; - function forEachChild(node, cbNode, cbNodes) { - function child(node) { - if (node) - return cbNode(node); - } - function children(nodes) { - if (nodes) { - if (cbNodes) - return cbNodes(nodes); - var result; - for (var i = 0, len = nodes.length; i < len; i++) { - if (result = cbNode(nodes[i])) - break; - } - return result; - } - } - if (!node) - return; - switch (node.kind) { - case 116 /* QualifiedName */: - return child(node.left) || child(node.right); - case 117 /* TypeParameter */: - return child(node.name) || child(node.constraint); - case 118 /* Parameter */: - return child(node.name) || child(node.type) || child(node.initializer); - case 119 /* Property */: - case 134 /* PropertyAssignment */: - return child(node.name) || child(node.type) || child(node.initializer); - case 124 /* CallSignature */: - case 125 /* ConstructSignature */: - case 126 /* IndexSignature */: - return children(node.typeParameters) || children(node.parameters) || child(node.type); - case 120 /* Method */: - case 121 /* Constructor */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 141 /* FunctionExpression */: - case 172 /* FunctionDeclaration */: - case 142 /* ArrowFunction */: - return child(node.name) || children(node.typeParameters) || children(node.parameters) || child(node.type) || child(node.body); - case 127 /* TypeReference */: - return child(node.typeName) || children(node.typeArguments); - case 128 /* TypeQuery */: - return child(node.exprName); - case 129 /* TypeLiteral */: - return children(node.members); - case 130 /* ArrayType */: - return child(node.elementType); - case 131 /* TupleType */: - return children(node.elementTypes); - case 132 /* ArrayLiteral */: - return children(node.elements); - case 133 /* ObjectLiteral */: - return children(node.properties); - case 135 /* PropertyAccess */: - return child(node.left) || child(node.right); - case 136 /* IndexedAccess */: - return child(node.object) || child(node.index); - case 137 /* CallExpression */: - case 138 /* NewExpression */: - return child(node.func) || children(node.typeArguments) || children(node.arguments); - case 139 /* TypeAssertion */: - return child(node.type) || child(node.operand); - case 140 /* ParenExpression */: - return child(node.expression); - case 143 /* PrefixOperator */: - case 144 /* PostfixOperator */: - return child(node.operand); - case 145 /* BinaryExpression */: - return child(node.left) || child(node.right); - case 146 /* ConditionalExpression */: - return child(node.condition) || child(node.whenTrue) || child(node.whenFalse); - case 148 /* Block */: - case 167 /* TryBlock */: - case 169 /* FinallyBlock */: - case 173 /* FunctionBlock */: - case 178 /* ModuleBlock */: - case 182 /* SourceFile */: - return children(node.statements); - case 149 /* VariableStatement */: - return children(node.declarations); - case 151 /* ExpressionStatement */: - return child(node.expression); - case 152 /* IfStatement */: - return child(node.expression) || child(node.thenStatement) || child(node.elseStatement); - case 153 /* DoStatement */: - return child(node.statement) || child(node.expression); - case 154 /* WhileStatement */: - return child(node.expression) || child(node.statement); - case 155 /* ForStatement */: - return children(node.declarations) || child(node.initializer) || child(node.condition) || child(node.iterator) || child(node.statement); - case 156 /* ForInStatement */: - return child(node.declaration) || child(node.variable) || child(node.expression) || child(node.statement); - case 157 /* ContinueStatement */: - case 158 /* BreakStatement */: - return child(node.label); - case 159 /* ReturnStatement */: - return child(node.expression); - case 160 /* WithStatement */: - return child(node.expression) || child(node.statement); - case 161 /* SwitchStatement */: - return child(node.expression) || children(node.clauses); - case 162 /* CaseClause */: - case 163 /* DefaultClause */: - return child(node.expression) || children(node.statements); - case 164 /* LabeledStatement */: - return child(node.label) || child(node.statement); - case 165 /* ThrowStatement */: - return child(node.expression); - case 166 /* TryStatement */: - return child(node.tryBlock) || child(node.catchBlock) || child(node.finallyBlock); - case 168 /* CatchBlock */: - return child(node.variable) || children(node.statements); - case 171 /* VariableDeclaration */: - return child(node.name) || child(node.type) || child(node.initializer); - case 174 /* ClassDeclaration */: - return child(node.name) || children(node.typeParameters) || child(node.baseType) || children(node.implementedTypes) || children(node.members); - case 175 /* InterfaceDeclaration */: - return child(node.name) || children(node.typeParameters) || children(node.baseTypes) || children(node.members); - case 176 /* EnumDeclaration */: - return child(node.name) || children(node.members); - case 181 /* EnumMember */: - return child(node.name) || child(node.initializer); - case 177 /* ModuleDeclaration */: - return child(node.name) || child(node.body); - case 179 /* ImportDeclaration */: - return child(node.name) || child(node.entityName) || child(node.externalModuleName); - case 180 /* ExportAssignment */: - return child(node.exportName); - } - } - ts.forEachChild = forEachChild; - function forEachReturnStatement(body, visitor) { - return traverse(body); - function traverse(node) { - switch (node.kind) { - case 159 /* ReturnStatement */: - return visitor(node); - case 148 /* Block */: - case 173 /* FunctionBlock */: - case 152 /* IfStatement */: - case 153 /* DoStatement */: - case 154 /* WhileStatement */: - case 155 /* ForStatement */: - case 156 /* ForInStatement */: - case 160 /* WithStatement */: - case 161 /* SwitchStatement */: - case 162 /* CaseClause */: - case 163 /* DefaultClause */: - case 164 /* LabeledStatement */: - case 166 /* TryStatement */: - case 167 /* TryBlock */: - case 168 /* CatchBlock */: - case 169 /* FinallyBlock */: - return forEachChild(node, traverse); - } - } - } - ts.forEachReturnStatement = forEachReturnStatement; - function isAnyFunction(node) { - if (node) { - switch (node.kind) { - case 141 /* FunctionExpression */: - case 172 /* FunctionDeclaration */: - case 142 /* ArrowFunction */: - case 120 /* Method */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 121 /* Constructor */: - return true; - } - } - return false; - } - ts.isAnyFunction = isAnyFunction; - function getContainingFunction(node) { - while (true) { - node = node.parent; - if (!node || isAnyFunction(node)) { - return node; - } - } - } - ts.getContainingFunction = getContainingFunction; - function getThisContainer(node, includeArrowFunctions) { - while (true) { - node = node.parent; - if (!node) { - return undefined; - } - switch (node.kind) { - case 142 /* ArrowFunction */: - if (!includeArrowFunctions) { - continue; - } - case 172 /* FunctionDeclaration */: - case 141 /* FunctionExpression */: - case 177 /* ModuleDeclaration */: - case 119 /* Property */: - case 120 /* Method */: - case 121 /* Constructor */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 176 /* EnumDeclaration */: - case 182 /* SourceFile */: - return node; - } - } - } - ts.getThisContainer = getThisContainer; - function getSuperContainer(node) { - while (true) { - node = node.parent; - if (!node) { - return undefined; - } - switch (node.kind) { - case 119 /* Property */: - case 120 /* Method */: - case 121 /* Constructor */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - return node; - } - } - } - ts.getSuperContainer = getSuperContainer; - function hasRestParameters(s) { - return s.parameters.length > 0 && (s.parameters[s.parameters.length - 1].flags & 8 /* Rest */) !== 0; - } - ts.hasRestParameters = hasRestParameters; - function isInAmbientContext(node) { - while (node) { - if (node.flags & (2 /* Ambient */ | 1024 /* DeclarationFile */)) - return true; - node = node.parent; - } - return false; - } - ts.isInAmbientContext = isInAmbientContext; - function isDeclaration(node) { - switch (node.kind) { - case 117 /* TypeParameter */: - case 118 /* Parameter */: - case 171 /* VariableDeclaration */: - case 119 /* Property */: - case 134 /* PropertyAssignment */: - case 181 /* EnumMember */: - case 120 /* Method */: - case 172 /* FunctionDeclaration */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 174 /* ClassDeclaration */: - case 175 /* InterfaceDeclaration */: - case 176 /* EnumDeclaration */: - case 177 /* ModuleDeclaration */: - case 179 /* ImportDeclaration */: - return true; - } - return false; - } - ts.isDeclaration = isDeclaration; - function isStatement(n) { - switch (n.kind) { - case 158 /* BreakStatement */: - case 157 /* ContinueStatement */: - case 170 /* DebuggerStatement */: - case 153 /* DoStatement */: - case 151 /* ExpressionStatement */: - case 150 /* EmptyStatement */: - case 156 /* ForInStatement */: - case 155 /* ForStatement */: - case 152 /* IfStatement */: - case 164 /* LabeledStatement */: - case 159 /* ReturnStatement */: - case 161 /* SwitchStatement */: - case 88 /* ThrowKeyword */: - case 166 /* TryStatement */: - case 149 /* VariableStatement */: - case 154 /* WhileStatement */: - case 160 /* WithStatement */: - case 180 /* ExportAssignment */: - return true; - default: - return false; - } - } - ts.isStatement = isStatement; - function isDeclarationOrFunctionExpressionOrCatchVariableName(name) { - if (name.kind !== 59 /* Identifier */ && name.kind !== 7 /* StringLiteral */ && name.kind !== 6 /* NumericLiteral */) { - return false; - } - var parent = name.parent; - if (isDeclaration(parent) || parent.kind === 141 /* FunctionExpression */) { - return parent.name === name; - } - if (parent.kind === 168 /* CatchBlock */) { - return parent.variable === name; - } - return false; - } - ts.isDeclarationOrFunctionExpressionOrCatchVariableName = isDeclarationOrFunctionExpressionOrCatchVariableName; - function getAncestor(node, kind) { - switch (kind) { - case 174 /* ClassDeclaration */: - while (node) { - switch (node.kind) { - case 174 /* ClassDeclaration */: - return node; - case 176 /* EnumDeclaration */: - case 175 /* InterfaceDeclaration */: - case 177 /* ModuleDeclaration */: - case 179 /* ImportDeclaration */: - return undefined; - default: - node = node.parent; - continue; - } - } - break; - default: - while (node) { - if (node.kind === kind) { - return node; - } - node = node.parent; - } - break; - } - return undefined; - } - ts.getAncestor = getAncestor; - var ParsingContext; - (function (ParsingContext) { - ParsingContext[ParsingContext["SourceElements"] = 0] = "SourceElements"; - ParsingContext[ParsingContext["ModuleElements"] = 1] = "ModuleElements"; - ParsingContext[ParsingContext["BlockStatements"] = 2] = "BlockStatements"; - ParsingContext[ParsingContext["SwitchClauses"] = 3] = "SwitchClauses"; - ParsingContext[ParsingContext["SwitchClauseStatements"] = 4] = "SwitchClauseStatements"; - ParsingContext[ParsingContext["TypeMembers"] = 5] = "TypeMembers"; - ParsingContext[ParsingContext["ClassMembers"] = 6] = "ClassMembers"; - ParsingContext[ParsingContext["EnumMembers"] = 7] = "EnumMembers"; - ParsingContext[ParsingContext["BaseTypeReferences"] = 8] = "BaseTypeReferences"; - ParsingContext[ParsingContext["VariableDeclarations"] = 9] = "VariableDeclarations"; - ParsingContext[ParsingContext["ArgumentExpressions"] = 10] = "ArgumentExpressions"; - ParsingContext[ParsingContext["ObjectLiteralMembers"] = 11] = "ObjectLiteralMembers"; - ParsingContext[ParsingContext["ArrayLiteralMembers"] = 12] = "ArrayLiteralMembers"; - ParsingContext[ParsingContext["Parameters"] = 13] = "Parameters"; - ParsingContext[ParsingContext["TypeParameters"] = 14] = "TypeParameters"; - ParsingContext[ParsingContext["TypeArguments"] = 15] = "TypeArguments"; - ParsingContext[ParsingContext["TupleElementTypes"] = 16] = "TupleElementTypes"; - ParsingContext[ParsingContext["Count"] = 17] = "Count"; - })(ParsingContext || (ParsingContext = {})); - var Tristate; - (function (Tristate) { - Tristate[Tristate["False"] = 0] = "False"; - Tristate[Tristate["True"] = 1] = "True"; - Tristate[Tristate["Unknown"] = 2] = "Unknown"; - })(Tristate || (Tristate = {})); - function parsingContextErrors(context) { - switch (context) { - case 0 /* SourceElements */: - return ts.Diagnostics.Declaration_or_statement_expected; - case 1 /* ModuleElements */: - return ts.Diagnostics.Declaration_or_statement_expected; - case 2 /* BlockStatements */: - return ts.Diagnostics.Statement_expected; - case 3 /* SwitchClauses */: - return ts.Diagnostics.case_or_default_expected; - case 4 /* SwitchClauseStatements */: - return ts.Diagnostics.Statement_expected; - case 5 /* TypeMembers */: - return ts.Diagnostics.Property_or_signature_expected; - case 6 /* ClassMembers */: - return ts.Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected; - case 7 /* EnumMembers */: - return ts.Diagnostics.Enum_member_expected; - case 8 /* BaseTypeReferences */: - return ts.Diagnostics.Type_reference_expected; - case 9 /* VariableDeclarations */: - return ts.Diagnostics.Variable_declaration_expected; - case 10 /* ArgumentExpressions */: - return ts.Diagnostics.Argument_expression_expected; - case 11 /* ObjectLiteralMembers */: - return ts.Diagnostics.Property_assignment_expected; - case 12 /* ArrayLiteralMembers */: - return ts.Diagnostics.Expression_or_comma_expected; - case 13 /* Parameters */: - return ts.Diagnostics.Parameter_declaration_expected; - case 14 /* TypeParameters */: - return ts.Diagnostics.Type_parameter_declaration_expected; - case 15 /* TypeArguments */: - return ts.Diagnostics.Type_argument_expected; - case 16 /* TupleElementTypes */: - return ts.Diagnostics.Type_expected; - } - } - ; - var LookAheadMode; - (function (LookAheadMode) { - LookAheadMode[LookAheadMode["NotLookingAhead"] = 0] = "NotLookingAhead"; - LookAheadMode[LookAheadMode["NoErrorYet"] = 1] = "NoErrorYet"; - LookAheadMode[LookAheadMode["Error"] = 2] = "Error"; - })(LookAheadMode || (LookAheadMode = {})); - var ModifierContext; - (function (ModifierContext) { - ModifierContext[ModifierContext["SourceElements"] = 0] = "SourceElements"; - ModifierContext[ModifierContext["ModuleElements"] = 1] = "ModuleElements"; - ModifierContext[ModifierContext["ClassMembers"] = 2] = "ClassMembers"; - ModifierContext[ModifierContext["Parameters"] = 3] = "Parameters"; - })(ModifierContext || (ModifierContext = {})); - var ControlBlockContext; - (function (ControlBlockContext) { - ControlBlockContext[ControlBlockContext["NotNested"] = 0] = "NotNested"; - ControlBlockContext[ControlBlockContext["Nested"] = 1] = "Nested"; - ControlBlockContext[ControlBlockContext["CrossingFunctionBoundary"] = 2] = "CrossingFunctionBoundary"; - })(ControlBlockContext || (ControlBlockContext = {})); - function isKeyword(token) { - return ts.SyntaxKind.FirstKeyword <= token && token <= ts.SyntaxKind.LastKeyword; - } - ts.isKeyword = isKeyword; - function isTrivia(token) { - return ts.SyntaxKind.FirstTriviaToken <= token && token <= ts.SyntaxKind.LastTriviaToken; - } - ts.isTrivia = isTrivia; - function isModifier(token) { - switch (token) { - case 102 /* PublicKeyword */: - case 100 /* PrivateKeyword */: - case 101 /* ProtectedKeyword */: - case 103 /* StaticKeyword */: - case 72 /* ExportKeyword */: - case 108 /* DeclareKeyword */: - return true; - } - return false; - } - ts.isModifier = isModifier; - function createSourceFile(filename, sourceText, languageVersion, version, isOpen) { - if (isOpen === void 0) { isOpen = false; } - var file; - var scanner; - var token; - var parsingContext; - var commentRanges; - var identifiers = {}; - var identifierCount = 0; - var nodeCount = 0; - var lineStarts; - var isInStrictMode = false; - var lookAheadMode = 0 /* NotLookingAhead */; - var inAmbientContext = false; - var inFunctionBody = false; - var inSwitchStatement = 0 /* NotNested */; - var inIterationStatement = 0 /* NotNested */; - var labelledStatementInfo = (function () { - var functionBoundarySentinel; - var currentLabelSet; - var labelSetStack; - var isIterationStack; - function addLabel(label) { - if (!currentLabelSet) { - currentLabelSet = {}; - } - currentLabelSet[label.text] = true; - } - function pushCurrentLabelSet(isIterationStatement) { - if (!labelSetStack && !isIterationStack) { - labelSetStack = []; - isIterationStack = []; - } - ts.Debug.assert(currentLabelSet !== undefined); - labelSetStack.push(currentLabelSet); - isIterationStack.push(isIterationStatement); - currentLabelSet = undefined; - } - function pushFunctionBoundary() { - if (!functionBoundarySentinel) { - functionBoundarySentinel = {}; - if (!labelSetStack && !isIterationStack) { - labelSetStack = []; - isIterationStack = []; - } - } - ts.Debug.assert(currentLabelSet === undefined); - labelSetStack.push(functionBoundarySentinel); - isIterationStack.push(false); - } - function pop() { - ts.Debug.assert(labelSetStack.length && isIterationStack.length && currentLabelSet === undefined); - labelSetStack.pop(); - isIterationStack.pop(); - } - function nodeIsNestedInLabel(label, requireIterationStatement, stopAtFunctionBoundary) { - if (!requireIterationStatement && currentLabelSet && ts.hasProperty(currentLabelSet, label.text)) { - return 1 /* Nested */; - } - if (!labelSetStack) { - return 0 /* NotNested */; - } - var crossedFunctionBoundary = false; - for (var i = labelSetStack.length - 1; i >= 0; i--) { - var labelSet = labelSetStack[i]; - if (labelSet === functionBoundarySentinel) { - if (stopAtFunctionBoundary) { - break; - } - else { - crossedFunctionBoundary = true; - continue; - } - } - if (requireIterationStatement && isIterationStack[i] === false) { - continue; - } - if (ts.hasProperty(labelSet, label.text)) { - return crossedFunctionBoundary ? 2 /* CrossingFunctionBoundary */ : 1 /* Nested */; - } - } - return 0 /* NotNested */; - } - return { - addLabel: addLabel, - pushCurrentLabelSet: pushCurrentLabelSet, - pushFunctionBoundary: pushFunctionBoundary, - pop: pop, - nodeIsNestedInLabel: nodeIsNestedInLabel - }; - })(); - function getLineAndCharacterlFromSourcePosition(position) { - if (!lineStarts) { - lineStarts = ts.getLineStarts(sourceText); - } - return ts.getLineAndCharacterOfPosition(lineStarts, position); - } - function getPositionFromSourceLineAndCharacter(line, character) { - if (!lineStarts) { - lineStarts = ts.getLineStarts(sourceText); - } - return ts.getPositionFromLineAndCharacter(lineStarts, line, character); - } - function error(message, arg0, arg1, arg2) { - var start = scanner.getTokenPos(); - var length = scanner.getTextPos() - start; - errorAtPos(start, length, message, arg0, arg1, arg2); - } - function grammarErrorOnNode(node, message, arg0, arg1, arg2) { - var span = getErrorSpanForNode(node); - var start = span.end > span.pos ? ts.skipTrivia(file.text, span.pos) : span.pos; - var length = span.end - start; - file.syntacticErrors.push(ts.createFileDiagnostic(file, start, length, message, arg0, arg1, arg2)); - } - function reportInvalidUseInStrictMode(node) { - var name = sourceText.substring(ts.skipTrivia(sourceText, node.pos), node.end); - grammarErrorOnNode(node, ts.Diagnostics.Invalid_use_of_0_in_strict_mode, name); - } - function grammarErrorAtPos(start, length, message, arg0, arg1, arg2) { - file.syntacticErrors.push(ts.createFileDiagnostic(file, start, length, message, arg0, arg1, arg2)); - } - function errorAtPos(start, length, message, arg0, arg1, arg2) { - var lastErrorPos = file.syntacticErrors.length ? file.syntacticErrors[file.syntacticErrors.length - 1].start : -1; - if (start !== lastErrorPos) { - file.syntacticErrors.push(ts.createFileDiagnostic(file, start, length, message, arg0, arg1, arg2)); - } - if (lookAheadMode === 1 /* NoErrorYet */) { - lookAheadMode = 2 /* Error */; - } - } - function scanError(message) { - var pos = scanner.getTextPos(); - errorAtPos(pos, 0, message); - } - function onComment(pos, end) { - if (commentRanges) - commentRanges.push({ pos: pos, end: end }); - } - function getNodePos() { - return scanner.getStartPos(); - } - function getNodeEnd() { - return scanner.getStartPos(); - } - function nextToken() { - return token = scanner.scan(); - } - function getTokenPos(pos) { - return ts.skipTrivia(sourceText, pos); - } - function reScanGreaterToken() { - return token = scanner.reScanGreaterToken(); - } - function reScanSlashToken() { - return token = scanner.reScanSlashToken(); - } - function lookAheadHelper(callback, alwaysResetState) { - var saveToken = token; - var saveSyntacticErrorsLength = file.syntacticErrors.length; - var saveLookAheadMode = lookAheadMode; - lookAheadMode = 1 /* NoErrorYet */; - var result = callback(); - ts.Debug.assert(lookAheadMode === 2 /* Error */ || lookAheadMode === 1 /* NoErrorYet */); - if (lookAheadMode === 2 /* Error */) { - result = undefined; - } - lookAheadMode = saveLookAheadMode; - if (!result || alwaysResetState) { - token = saveToken; - file.syntacticErrors.length = saveSyntacticErrorsLength; - } - return result; - } - function lookAhead(callback) { - var result; - scanner.tryScan(function () { - result = lookAheadHelper(callback, true); - return false; - }); - return result; - } - function tryParse(callback) { - return scanner.tryScan(function () { return lookAheadHelper(callback, false); }); - } - function isIdentifier() { - return token === 59 /* Identifier */ || (isInStrictMode ? token > ts.SyntaxKind.LastFutureReservedWord : token > ts.SyntaxKind.LastReservedWord); - } - function parseExpected(t) { - if (token === t) { - nextToken(); - return true; - } - error(ts.Diagnostics._0_expected, ts.tokenToString(t)); - return false; - } - function parseOptional(t) { - if (token === t) { - nextToken(); - return true; - } - return false; - } - function canParseSemicolon() { - if (token === 17 /* SemicolonToken */) { - return true; - } - return token === 10 /* CloseBraceToken */ || token === 1 /* EndOfFileToken */ || scanner.hasPrecedingLineBreak(); - } - function parseSemicolon() { - if (canParseSemicolon()) { - if (token === 17 /* SemicolonToken */) { - nextToken(); - } - } - else { - error(ts.Diagnostics._0_expected, ";"); - } - } - function createNode(kind, pos) { - nodeCount++; - var node = new (nodeConstructors[kind] || (nodeConstructors[kind] = ts.objectAllocator.getNodeConstructor(kind)))(); - if (!(pos >= 0)) - pos = scanner.getStartPos(); - node.pos = pos; - node.end = pos; - return node; - } - function finishNode(node) { - node.end = scanner.getStartPos(); - return node; - } - function createMissingNode() { - return createNode(115 /* Missing */); - } - function internIdentifier(text) { - return ts.hasProperty(identifiers, text) ? identifiers[text] : (identifiers[text] = text); - } - function createIdentifier(isIdentifier) { - identifierCount++; - if (isIdentifier) { - var node = createNode(59 /* Identifier */); - var text = escapeIdentifier(scanner.getTokenValue()); - node.text = internIdentifier(text); - nextToken(); - return finishNode(node); - } - error(ts.Diagnostics.Identifier_expected); - var node = createMissingNode(); - node.text = ""; - return node; - } - function parseIdentifier() { - return createIdentifier(isIdentifier()); - } - function parseIdentifierName() { - return createIdentifier(token >= 59 /* Identifier */); - } - function isPropertyName() { - return token >= 59 /* Identifier */ || token === 7 /* StringLiteral */ || token === 6 /* NumericLiteral */; - } - function parsePropertyName() { - if (token === 7 /* StringLiteral */ || token === 6 /* NumericLiteral */) { - return parseLiteralNode(true); - } - return parseIdentifierName(); - } - function parseContextualModifier(t) { - return token === t && tryParse(function () { - nextToken(); - return token === 13 /* OpenBracketToken */ || isPropertyName(); - }); - } - function parseAnyContextualModifier() { - return isModifier(token) && tryParse(function () { - nextToken(); - return token === 13 /* OpenBracketToken */ || isPropertyName(); - }); - } - function isListElement(kind, inErrorRecovery) { - switch (kind) { - case 0 /* SourceElements */: - case 1 /* ModuleElements */: - return isSourceElement(inErrorRecovery); - case 2 /* BlockStatements */: - case 4 /* SwitchClauseStatements */: - return isStatement(inErrorRecovery); - case 3 /* SwitchClauses */: - return token === 61 /* CaseKeyword */ || token === 67 /* DefaultKeyword */; - case 5 /* TypeMembers */: - return isTypeMember(); - case 6 /* ClassMembers */: - return lookAhead(isClassMemberStart); - case 7 /* EnumMembers */: - case 11 /* ObjectLiteralMembers */: - return isPropertyName(); - case 8 /* BaseTypeReferences */: - return isIdentifier() && ((token !== 73 /* ExtendsKeyword */ && token !== 96 /* ImplementsKeyword */) || !lookAhead(function () { return (nextToken(), isIdentifier()); })); - case 9 /* VariableDeclarations */: - case 14 /* TypeParameters */: - return isIdentifier(); - case 10 /* ArgumentExpressions */: - return token === 18 /* CommaToken */ || isExpression(); - case 12 /* ArrayLiteralMembers */: - return token === 18 /* CommaToken */ || isExpression(); - case 13 /* Parameters */: - return isParameter(); - case 15 /* TypeArguments */: - case 16 /* TupleElementTypes */: - return isType(); - } - ts.Debug.fail("Non-exhaustive case in 'isListElement'."); - } - function isListTerminator(kind) { - if (token === 1 /* EndOfFileToken */) { - return true; - } - switch (kind) { - case 1 /* ModuleElements */: - case 2 /* BlockStatements */: - case 3 /* SwitchClauses */: - case 5 /* TypeMembers */: - case 6 /* ClassMembers */: - case 7 /* EnumMembers */: - case 11 /* ObjectLiteralMembers */: - return token === 10 /* CloseBraceToken */; - case 4 /* SwitchClauseStatements */: - return token === 10 /* CloseBraceToken */ || token === 61 /* CaseKeyword */ || token === 67 /* DefaultKeyword */; - case 8 /* BaseTypeReferences */: - return token === 9 /* OpenBraceToken */ || token === 73 /* ExtendsKeyword */ || token === 96 /* ImplementsKeyword */; - case 9 /* VariableDeclarations */: - return isVariableDeclaratorListTerminator(); - case 14 /* TypeParameters */: - return token === 20 /* GreaterThanToken */ || token === 11 /* OpenParenToken */ || token === 9 /* OpenBraceToken */ || token === 73 /* ExtendsKeyword */ || token === 96 /* ImplementsKeyword */; - case 10 /* ArgumentExpressions */: - return token === 12 /* CloseParenToken */ || token === 17 /* SemicolonToken */; - case 12 /* ArrayLiteralMembers */: - case 16 /* TupleElementTypes */: - return token === 14 /* CloseBracketToken */; - case 13 /* Parameters */: - return token === 12 /* CloseParenToken */ || token === 14 /* CloseBracketToken */ || token === 9 /* OpenBraceToken */; - case 15 /* TypeArguments */: - return token === 20 /* GreaterThanToken */ || token === 11 /* OpenParenToken */; - } - } - function isVariableDeclaratorListTerminator() { - if (canParseSemicolon()) { - return true; - } - if (token === 80 /* InKeyword */) { - return true; - } - if (token === 27 /* EqualsGreaterThanToken */) { - return true; - } - return false; - } - function isInSomeParsingContext() { - for (var kind = 0; kind < 17 /* Count */; kind++) { - if (parsingContext & (1 << kind)) { - if (isListElement(kind, true) || isListTerminator(kind)) { - return true; - } - } - } - return false; - } - function parseList(kind, checkForStrictMode, parseElement) { - var saveParsingContext = parsingContext; - parsingContext |= 1 << kind; - var result = []; - result.pos = getNodePos(); - var saveIsInStrictMode = isInStrictMode; - while (!isListTerminator(kind)) { - if (isListElement(kind, false)) { - var element = parseElement(); - result.push(element); - if (!isInStrictMode && checkForStrictMode) { - if (isPrologueDirective(element)) { - if (isUseStrictPrologueDirective(element)) { - isInStrictMode = true; - checkForStrictMode = false; - } - } - else { - checkForStrictMode = false; - } - } - } - else { - error(parsingContextErrors(kind)); - if (isInSomeParsingContext()) { - break; - } - nextToken(); - } - } - isInStrictMode = saveIsInStrictMode; - result.end = getNodeEnd(); - parsingContext = saveParsingContext; - return result; - } - function parseDelimitedList(kind, parseElement, allowTrailingComma) { - var saveParsingContext = parsingContext; - parsingContext |= 1 << kind; - var result = []; - result.pos = getNodePos(); - var errorCountBeforeParsingList = file.syntacticErrors.length; - var commaStart = -1; - while (true) { - if (isListElement(kind, false)) { - result.push(parseElement()); - commaStart = scanner.getTokenPos(); - if (parseOptional(18 /* CommaToken */)) { - continue; - } - commaStart = -1; - if (isListTerminator(kind)) { - break; - } - error(ts.Diagnostics._0_expected, ","); - } - else if (isListTerminator(kind)) { - break; - } - else { - error(parsingContextErrors(kind)); - if (isInSomeParsingContext()) { - break; - } - nextToken(); - } - } - if (commaStart >= 0) { - if (!allowTrailingComma) { - if (file.syntacticErrors.length === errorCountBeforeParsingList) { - grammarErrorAtPos(commaStart, scanner.getStartPos() - commaStart, ts.Diagnostics.Trailing_comma_not_allowed); - } - } - result.hasTrailingComma = true; - } - result.end = getNodeEnd(); - parsingContext = saveParsingContext; - return result; - } - function createMissingList() { - var pos = getNodePos(); - var result = []; - result.pos = pos; - result.end = pos; - return result; - } - function createNodeArray(node) { - var result = [node]; - result.pos = node.pos; - result.end = node.end; - return result; - } - function parseBracketedList(kind, parseElement, startToken, endToken) { - if (parseExpected(startToken)) { - var result = parseDelimitedList(kind, parseElement, false); - parseExpected(endToken); - return result; - } - return createMissingList(); - } - function parseEntityName(allowReservedWords) { - var entity = parseIdentifier(); - while (parseOptional(15 /* DotToken */)) { - var node = createNode(116 /* QualifiedName */, entity.pos); - node.left = entity; - node.right = allowReservedWords ? parseIdentifierName() : parseIdentifier(); - entity = finishNode(node); - } - return entity; - } - function parseTokenNode() { - var node = createNode(token); - nextToken(); - return finishNode(node); - } - function parseLiteralNode(internName) { - var node = createNode(token); - var text = scanner.getTokenValue(); - node.text = internName ? internIdentifier(text) : text; - var tokenPos = scanner.getTokenPos(); - nextToken(); - finishNode(node); - if (node.kind === 6 /* NumericLiteral */ && sourceText.charCodeAt(tokenPos) === 48 /* _0 */ && ts.isOctalDigit(sourceText.charCodeAt(tokenPos + 1))) { - if (isInStrictMode) { - grammarErrorOnNode(node, ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode); - } - else if (languageVersion >= 1 /* ES5 */) { - grammarErrorOnNode(node, ts.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher); - } - } - return node; - } - function parseStringLiteral() { - if (token === 7 /* StringLiteral */) - return parseLiteralNode(true); - error(ts.Diagnostics.String_literal_expected); - return createMissingNode(); - } - function parseTypeReference() { - var node = createNode(127 /* TypeReference */); - node.typeName = parseEntityName(false); - if (!scanner.hasPrecedingLineBreak() && token === 19 /* LessThanToken */) { - node.typeArguments = parseTypeArguments(); - } - return finishNode(node); - } - function parseTypeQuery() { - var node = createNode(128 /* TypeQuery */); - parseExpected(91 /* TypeOfKeyword */); - node.exprName = parseEntityName(true); - return finishNode(node); - } - function parseTypeParameter() { - var node = createNode(117 /* TypeParameter */); - node.name = parseIdentifier(); - if (parseOptional(73 /* ExtendsKeyword */)) { - if (isType() || !isExpression()) { - node.constraint = parseType(); - } - else { - var expr = parseUnaryExpression(); - grammarErrorOnNode(expr, ts.Diagnostics.Type_expected); - } - } - return finishNode(node); - } - function parseTypeParameters() { - if (token === 19 /* LessThanToken */) { - var pos = getNodePos(); - var result = parseBracketedList(14 /* TypeParameters */, parseTypeParameter, 19 /* LessThanToken */, 20 /* GreaterThanToken */); - if (!result.length) { - var start = getTokenPos(pos); - var length = getNodePos() - start; - errorAtPos(start, length, ts.Diagnostics.Type_parameter_list_cannot_be_empty); - } - return result; - } - } - function parseParameterType() { - return parseOptional(46 /* ColonToken */) ? token === 7 /* StringLiteral */ ? parseStringLiteral() : parseType() : undefined; - } - function isParameter() { - return token === 16 /* DotDotDotToken */ || isIdentifier() || isModifier(token); - } - function parseParameter(flags) { - if (flags === void 0) { flags = 0; } - var node = createNode(118 /* Parameter */); - node.flags |= parseAndCheckModifiers(3 /* Parameters */); - if (parseOptional(16 /* DotDotDotToken */)) { - node.flags |= 8 /* Rest */; - } - node.name = parseIdentifier(); - if (node.name.kind === 115 /* Missing */ && node.flags === 0 && isModifier(token)) { - nextToken(); - } - if (parseOptional(45 /* QuestionToken */)) { - node.flags |= 4 /* QuestionMark */; - } - node.type = parseParameterType(); - node.initializer = parseInitializer(true); - return finishNode(node); - } - function parseSignature(kind, returnToken, returnTokenRequired) { - if (kind === 125 /* ConstructSignature */) { - parseExpected(82 /* NewKeyword */); - } - var typeParameters = parseTypeParameters(); - var parameters = parseParameterList(11 /* OpenParenToken */, 12 /* CloseParenToken */); - checkParameterList(parameters); - var type; - if (returnTokenRequired) { - parseExpected(returnToken); - type = parseType(); - } - else if (parseOptional(returnToken)) { - type = parseType(); - } - return { - typeParameters: typeParameters, - parameters: parameters, - type: type - }; - } - function parseParameterList(startDelimiter, endDelimiter) { - return parseBracketedList(13 /* Parameters */, parseParameter, startDelimiter, endDelimiter); - } - function checkParameterList(parameters) { - var seenOptionalParameter = false; - var parameterCount = parameters.length; - for (var i = 0; i < parameterCount; i++) { - var parameter = parameters[i]; - if (isInStrictMode && isEvalOrArgumentsIdentifier(parameter.name)) { - reportInvalidUseInStrictMode(parameter.name); - return; - } - else if (parameter.flags & 8 /* Rest */) { - if (i !== (parameterCount - 1)) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list); - return; - } - if (parameter.flags & 4 /* QuestionMark */) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.A_rest_parameter_cannot_be_optional); - return; - } - if (parameter.initializer) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.A_rest_parameter_cannot_have_an_initializer); - return; - } - } - else if (parameter.flags & 4 /* QuestionMark */ || parameter.initializer) { - seenOptionalParameter = true; - if (parameter.flags & 4 /* QuestionMark */ && parameter.initializer) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.Parameter_cannot_have_question_mark_and_initializer); - return; - } - } - else { - if (seenOptionalParameter) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.A_required_parameter_cannot_follow_an_optional_parameter); - return; - } - } - } - } - function parseSignatureMember(kind, returnToken) { - var node = createNode(kind); - var sig = parseSignature(kind, returnToken, false); - node.typeParameters = sig.typeParameters; - node.parameters = sig.parameters; - node.type = sig.type; - parseSemicolon(); - return finishNode(node); - } - function parseIndexSignatureMember() { - var node = createNode(126 /* IndexSignature */); - var errorCountBeforeIndexSignature = file.syntacticErrors.length; - var indexerStart = scanner.getTokenPos(); - node.parameters = parseParameterList(13 /* OpenBracketToken */, 14 /* CloseBracketToken */); - var indexerLength = scanner.getStartPos() - indexerStart; - node.type = parseTypeAnnotation(); - parseSemicolon(); - if (file.syntacticErrors.length === errorCountBeforeIndexSignature) { - checkIndexSignature(node, indexerStart, indexerLength); - } - return finishNode(node); - } - function checkIndexSignature(node, indexerStart, indexerLength) { - var parameter = node.parameters[0]; - if (node.parameters.length !== 1) { - var arityDiagnostic = ts.Diagnostics.An_index_signature_must_have_exactly_one_parameter; - if (parameter) { - grammarErrorOnNode(parameter.name, arityDiagnostic); - } - else { - grammarErrorAtPos(indexerStart, indexerLength, arityDiagnostic); - } - return; - } - else if (parameter.flags & 8 /* Rest */) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_cannot_have_a_rest_parameter); - return; - } - else if (parameter.flags & ts.NodeFlags.Modifier) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_cannot_have_an_accessibility_modifier); - return; - } - else if (parameter.flags & 4 /* QuestionMark */) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_cannot_have_a_question_mark); - return; - } - else if (parameter.initializer) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_cannot_have_an_initializer); - return; - } - else if (!parameter.type) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); - return; - } - else if (parameter.type.kind !== 114 /* StringKeyword */ && parameter.type.kind !== 112 /* NumberKeyword */) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_must_be_string_or_number); - return; - } - else if (!node.type) { - grammarErrorAtPos(indexerStart, indexerLength, ts.Diagnostics.An_index_signature_must_have_a_type_annotation); - return; - } - } - function parsePropertyOrMethod() { - var node = createNode(0 /* Unknown */); - node.name = parsePropertyName(); - if (parseOptional(45 /* QuestionToken */)) { - node.flags |= 4 /* QuestionMark */; - } - if (token === 11 /* OpenParenToken */ || token === 19 /* LessThanToken */) { - node.kind = 120 /* Method */; - var sig = parseSignature(124 /* CallSignature */, 46 /* ColonToken */, false); - node.typeParameters = sig.typeParameters; - node.parameters = sig.parameters; - node.type = sig.type; - } - else { - node.kind = 119 /* Property */; - node.type = parseTypeAnnotation(); - } - parseSemicolon(); - return finishNode(node); - } - function isTypeMember() { - switch (token) { - case 11 /* OpenParenToken */: - case 19 /* LessThanToken */: - case 13 /* OpenBracketToken */: - return true; - default: - return isPropertyName() && lookAhead(function () { return nextToken() === 11 /* OpenParenToken */ || token === 19 /* LessThanToken */ || token === 45 /* QuestionToken */ || token === 46 /* ColonToken */ || canParseSemicolon(); }); - } - } - function parseTypeMember() { - switch (token) { - case 11 /* OpenParenToken */: - case 19 /* LessThanToken */: - return parseSignatureMember(124 /* CallSignature */, 46 /* ColonToken */); - case 13 /* OpenBracketToken */: - return parseIndexSignatureMember(); - case 82 /* NewKeyword */: - if (lookAhead(function () { return nextToken() === 11 /* OpenParenToken */ || token === 19 /* LessThanToken */; })) { - return parseSignatureMember(125 /* ConstructSignature */, 46 /* ColonToken */); - } - case 7 /* StringLiteral */: - case 6 /* NumericLiteral */: - return parsePropertyOrMethod(); - default: - if (token >= 59 /* Identifier */) { - return parsePropertyOrMethod(); - } - } - } - function parseTypeLiteral() { - var node = createNode(129 /* TypeLiteral */); - if (parseExpected(9 /* OpenBraceToken */)) { - node.members = parseList(5 /* TypeMembers */, false, parseTypeMember); - parseExpected(10 /* CloseBraceToken */); - } - else { - node.members = createMissingList(); - } - return finishNode(node); - } - function parseTupleType() { - var node = createNode(131 /* TupleType */); - var startTokenPos = scanner.getTokenPos(); - var startErrorCount = file.syntacticErrors.length; - node.elementTypes = parseBracketedList(16 /* TupleElementTypes */, parseType, 13 /* OpenBracketToken */, 14 /* CloseBracketToken */); - if (!node.elementTypes.length && file.syntacticErrors.length === startErrorCount) { - grammarErrorAtPos(startTokenPos, scanner.getStartPos() - startTokenPos, ts.Diagnostics.A_tuple_type_element_list_cannot_be_empty); - } - return finishNode(node); - } - function parseFunctionType(signatureKind) { - var node = createNode(129 /* TypeLiteral */); - var member = createNode(signatureKind); - var sig = parseSignature(signatureKind, 27 /* EqualsGreaterThanToken */, true); - member.typeParameters = sig.typeParameters; - member.parameters = sig.parameters; - member.type = sig.type; - finishNode(member); - node.members = createNodeArray(member); - return finishNode(node); - } - function parseKeywordAndNoDot() { - var node = parseTokenNode(); - return token === 15 /* DotToken */ ? undefined : node; - } - function parseNonArrayType() { - switch (token) { - case 105 /* AnyKeyword */: - case 114 /* StringKeyword */: - case 112 /* NumberKeyword */: - case 106 /* BooleanKeyword */: - case 93 /* VoidKeyword */: - var node = tryParse(parseKeywordAndNoDot); - return node || parseTypeReference(); - case 91 /* TypeOfKeyword */: - return parseTypeQuery(); - case 9 /* OpenBraceToken */: - return parseTypeLiteral(); - case 13 /* OpenBracketToken */: - return parseTupleType(); - case 11 /* OpenParenToken */: - case 19 /* LessThanToken */: - return parseFunctionType(124 /* CallSignature */); - case 82 /* NewKeyword */: - return parseFunctionType(125 /* ConstructSignature */); - default: - if (isIdentifier()) { - return parseTypeReference(); - } - } - error(ts.Diagnostics.Type_expected); - return createMissingNode(); - } - function isType() { - switch (token) { - case 105 /* AnyKeyword */: - case 114 /* StringKeyword */: - case 112 /* NumberKeyword */: - case 106 /* BooleanKeyword */: - case 93 /* VoidKeyword */: - case 91 /* TypeOfKeyword */: - case 9 /* OpenBraceToken */: - case 13 /* OpenBracketToken */: - case 19 /* LessThanToken */: - case 82 /* NewKeyword */: - return true; - case 11 /* OpenParenToken */: - return lookAhead(function () { - nextToken(); - return token === 12 /* CloseParenToken */ || isParameter(); - }); - default: - return isIdentifier(); - } - } - function parseType() { - var type = parseNonArrayType(); - while (type && !scanner.hasPrecedingLineBreak() && parseOptional(13 /* OpenBracketToken */)) { - parseExpected(14 /* CloseBracketToken */); - var node = createNode(130 /* ArrayType */, type.pos); - node.elementType = type; - type = finishNode(node); - } - return type; - } - function parseTypeAnnotation() { - return parseOptional(46 /* ColonToken */) ? parseType() : undefined; - } - function isExpression() { - switch (token) { - case 87 /* ThisKeyword */: - case 85 /* SuperKeyword */: - case 83 /* NullKeyword */: - case 89 /* TrueKeyword */: - case 74 /* FalseKeyword */: - case 6 /* NumericLiteral */: - case 7 /* StringLiteral */: - case 11 /* OpenParenToken */: - case 13 /* OpenBracketToken */: - case 9 /* OpenBraceToken */: - case 77 /* FunctionKeyword */: - case 82 /* NewKeyword */: - case 31 /* SlashToken */: - case 51 /* SlashEqualsToken */: - case 28 /* PlusToken */: - case 29 /* MinusToken */: - case 42 /* TildeToken */: - case 41 /* ExclamationToken */: - case 68 /* DeleteKeyword */: - case 91 /* TypeOfKeyword */: - case 93 /* VoidKeyword */: - case 33 /* PlusPlusToken */: - case 34 /* MinusMinusToken */: - case 19 /* LessThanToken */: - case 59 /* Identifier */: - return true; - default: - return isIdentifier(); - } - } - function isExpressionStatement() { - return token !== 9 /* OpenBraceToken */ && token !== 77 /* FunctionKeyword */ && isExpression(); - } - function parseExpression(noIn) { - var expr = parseAssignmentExpression(noIn); - while (parseOptional(18 /* CommaToken */)) { - expr = makeBinaryExpression(expr, 18 /* CommaToken */, parseAssignmentExpression(noIn)); - } - return expr; - } - function parseInitializer(inParameter, noIn) { - if (token !== 47 /* EqualsToken */) { - if (scanner.hasPrecedingLineBreak() || (inParameter && token === 9 /* OpenBraceToken */) || !isExpression()) { - return undefined; - } - } - parseExpected(47 /* EqualsToken */); - return parseAssignmentExpression(noIn); - } - function parseAssignmentExpression(noIn) { - var arrowExpression = tryParseParenthesizedArrowFunctionExpression(); - if (arrowExpression) { - return arrowExpression; - } - var expr = parseConditionalExpression(noIn); - if (expr.kind === 59 /* Identifier */ && token === 27 /* EqualsGreaterThanToken */) { - return parseSimpleArrowFunctionExpression(expr); - } - if (isLeftHandSideExpression(expr) && isAssignmentOperator()) { - if (isInStrictMode && isEvalOrArgumentsIdentifier(expr)) { - reportInvalidUseInStrictMode(expr); - } - var operator = token; - nextToken(); - return makeBinaryExpression(expr, operator, parseAssignmentExpression(noIn)); - } - return expr; - } - function isLeftHandSideExpression(expr) { - if (expr) { - switch (expr.kind) { - case 135 /* PropertyAccess */: - case 136 /* IndexedAccess */: - case 138 /* NewExpression */: - case 137 /* CallExpression */: - case 132 /* ArrayLiteral */: - case 140 /* ParenExpression */: - case 133 /* ObjectLiteral */: - case 141 /* FunctionExpression */: - case 59 /* Identifier */: - case 115 /* Missing */: - case 8 /* RegularExpressionLiteral */: - case 6 /* NumericLiteral */: - case 7 /* StringLiteral */: - case 74 /* FalseKeyword */: - case 83 /* NullKeyword */: - case 87 /* ThisKeyword */: - case 89 /* TrueKeyword */: - case 85 /* SuperKeyword */: - return true; - } - } - return false; - } - function parseSimpleArrowFunctionExpression(identifier) { - ts.Debug.assert(token === 27 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); - parseExpected(27 /* EqualsGreaterThanToken */); - var parameter = createNode(118 /* Parameter */, identifier.pos); - parameter.name = identifier; - finishNode(parameter); - var parameters = []; - parameters.push(parameter); - parameters.pos = parameter.pos; - parameters.end = parameter.end; - var signature = { parameters: parameters }; - return parseArrowExpressionTail(identifier.pos, signature, false); - } - function tryParseParenthesizedArrowFunctionExpression() { - var triState = isParenthesizedArrowFunctionExpression(); - if (triState === 0 /* False */) { - return undefined; - } - var pos = getNodePos(); - if (triState === 1 /* True */) { - var sig = parseSignature(124 /* CallSignature */, 46 /* ColonToken */, false); - if (parseExpected(27 /* EqualsGreaterThanToken */) || token === 9 /* OpenBraceToken */) { - return parseArrowExpressionTail(pos, sig, false); - } - else { - return makeFunctionExpression(142 /* ArrowFunction */, pos, undefined, sig, createMissingNode()); - } - } - var sig = tryParseSignatureIfArrowOrBraceFollows(); - if (sig) { - parseExpected(27 /* EqualsGreaterThanToken */); - return parseArrowExpressionTail(pos, sig, false); - } - else { - return undefined; - } - } - function isParenthesizedArrowFunctionExpression() { - if (token === 11 /* OpenParenToken */ || token === 19 /* LessThanToken */) { - return lookAhead(function () { - var first = token; - var second = nextToken(); - if (first === 11 /* OpenParenToken */) { - if (second === 12 /* CloseParenToken */) { - var third = nextToken(); - switch (third) { - case 27 /* EqualsGreaterThanToken */: - case 46 /* ColonToken */: - case 9 /* OpenBraceToken */: - return 1 /* True */; - default: - return 0 /* False */; - } - } - if (second === 16 /* DotDotDotToken */) { - return 1 /* True */; - } - if (!isIdentifier()) { - return 0 /* False */; - } - if (nextToken() === 46 /* ColonToken */) { - return 1 /* True */; - } - return 2 /* Unknown */; - } - else { - ts.Debug.assert(first === 19 /* LessThanToken */); - if (!isIdentifier()) { - return 0 /* False */; - } - return 2 /* Unknown */; - } - }); - } - if (token === 27 /* EqualsGreaterThanToken */) { - return 1 /* True */; - } - return 0 /* False */; - } - function tryParseSignatureIfArrowOrBraceFollows() { - return tryParse(function () { - var sig = parseSignature(124 /* CallSignature */, 46 /* ColonToken */, false); - if (token === 27 /* EqualsGreaterThanToken */ || token === 9 /* OpenBraceToken */) { - return sig; - } - return undefined; - }); - } - function parseArrowExpressionTail(pos, sig, noIn) { - var body; - if (token === 9 /* OpenBraceToken */) { - body = parseBody(false); - } - else if (isStatement(true) && !isExpressionStatement() && token !== 77 /* FunctionKeyword */) { - body = parseBody(true); - } - else { - body = parseAssignmentExpression(noIn); - } - return makeFunctionExpression(142 /* ArrowFunction */, pos, undefined, sig, body); - } - function isAssignmentOperator() { - return token >= ts.SyntaxKind.FirstAssignment && token <= ts.SyntaxKind.LastAssignment; - } - function parseConditionalExpression(noIn) { - var expr = parseBinaryExpression(noIn); - while (parseOptional(45 /* QuestionToken */)) { - var node = createNode(146 /* ConditionalExpression */, expr.pos); - node.condition = expr; - node.whenTrue = parseAssignmentExpression(false); - parseExpected(46 /* ColonToken */); - node.whenFalse = parseAssignmentExpression(noIn); - expr = finishNode(node); - } - return expr; - } - function parseBinaryExpression(noIn) { - return parseBinaryOperators(parseUnaryExpression(), 0, noIn); - } - function parseBinaryOperators(expr, minPrecedence, noIn) { - while (true) { - reScanGreaterToken(); - var precedence = getOperatorPrecedence(); - if (precedence && precedence > minPrecedence && (!noIn || token !== 80 /* InKeyword */)) { - var operator = token; - nextToken(); - expr = makeBinaryExpression(expr, operator, parseBinaryOperators(parseUnaryExpression(), precedence, noIn)); - continue; - } - return expr; - } - } - function getOperatorPrecedence() { - switch (token) { - case 44 /* BarBarToken */: - return 1; - case 43 /* AmpersandAmpersandToken */: - return 2; - case 39 /* BarToken */: - return 3; - case 40 /* CaretToken */: - return 4; - case 38 /* AmpersandToken */: - return 5; - case 23 /* EqualsEqualsToken */: - case 24 /* ExclamationEqualsToken */: - case 25 /* EqualsEqualsEqualsToken */: - case 26 /* ExclamationEqualsEqualsToken */: - return 6; - case 19 /* LessThanToken */: - case 20 /* GreaterThanToken */: - case 21 /* LessThanEqualsToken */: - case 22 /* GreaterThanEqualsToken */: - case 81 /* InstanceOfKeyword */: - case 80 /* InKeyword */: - return 7; - case 35 /* LessThanLessThanToken */: - case 36 /* GreaterThanGreaterThanToken */: - case 37 /* GreaterThanGreaterThanGreaterThanToken */: - return 8; - case 28 /* PlusToken */: - case 29 /* MinusToken */: - return 9; - case 30 /* AsteriskToken */: - case 31 /* SlashToken */: - case 32 /* PercentToken */: - return 10; - } - return undefined; - } - function makeBinaryExpression(left, operator, right) { - var node = createNode(145 /* BinaryExpression */, left.pos); - node.left = left; - node.operator = operator; - node.right = right; - return finishNode(node); - } - function parseUnaryExpression() { - var pos = getNodePos(); - switch (token) { - case 28 /* PlusToken */: - case 29 /* MinusToken */: - case 42 /* TildeToken */: - case 41 /* ExclamationToken */: - case 68 /* DeleteKeyword */: - case 91 /* TypeOfKeyword */: - case 93 /* VoidKeyword */: - case 33 /* PlusPlusToken */: - case 34 /* MinusMinusToken */: - var operator = token; - nextToken(); - var operand = parseUnaryExpression(); - if (isInStrictMode) { - if ((operator === 33 /* PlusPlusToken */ || operator === 34 /* MinusMinusToken */) && isEvalOrArgumentsIdentifier(operand)) { - reportInvalidUseInStrictMode(operand); - } - else if (operator === 68 /* DeleteKeyword */ && operand.kind === 59 /* Identifier */) { - grammarErrorOnNode(operand, ts.Diagnostics.delete_cannot_be_called_on_an_identifier_in_strict_mode); - } - } - return makeUnaryExpression(143 /* PrefixOperator */, pos, operator, operand); - case 19 /* LessThanToken */: - return parseTypeAssertion(); - } - var primaryExpression = parsePrimaryExpression(); - var illegalUsageOfSuperKeyword = primaryExpression.kind === 85 /* SuperKeyword */ && token !== 11 /* OpenParenToken */ && token !== 15 /* DotToken */; - if (illegalUsageOfSuperKeyword) { - error(ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); - } - var expr = parseCallAndAccess(primaryExpression, false); - ts.Debug.assert(isLeftHandSideExpression(expr)); - if ((token === 33 /* PlusPlusToken */ || token === 34 /* MinusMinusToken */) && !scanner.hasPrecedingLineBreak()) { - if (isInStrictMode && isEvalOrArgumentsIdentifier(expr)) { - reportInvalidUseInStrictMode(expr); - } - var operator = token; - nextToken(); - expr = makeUnaryExpression(144 /* PostfixOperator */, expr.pos, operator, expr); - } - return expr; - } - function parseTypeAssertion() { - var node = createNode(139 /* TypeAssertion */); - parseExpected(19 /* LessThanToken */); - node.type = parseType(); - parseExpected(20 /* GreaterThanToken */); - node.operand = parseUnaryExpression(); - return finishNode(node); - } - function makeUnaryExpression(kind, pos, operator, operand) { - var node = createNode(kind, pos); - node.operator = operator; - node.operand = operand; - return finishNode(node); - } - function parseCallAndAccess(expr, inNewExpression) { - while (true) { - var dotStart = scanner.getTokenPos(); - if (parseOptional(15 /* DotToken */)) { - var propertyAccess = createNode(135 /* PropertyAccess */, expr.pos); - if (scanner.hasPrecedingLineBreak() && scanner.isReservedWord() && lookAhead(function () { return scanner.isReservedWord(); })) { - grammarErrorAtPos(dotStart, scanner.getStartPos() - dotStart, ts.Diagnostics.Identifier_expected); - var id = createMissingNode(); - } - else { - var id = parseIdentifierName(); - } - propertyAccess.left = expr; - propertyAccess.right = id; - expr = finishNode(propertyAccess); - continue; - } - var bracketStart = scanner.getTokenPos(); - if (parseOptional(13 /* OpenBracketToken */)) { - var indexedAccess = createNode(136 /* IndexedAccess */, expr.pos); - indexedAccess.object = expr; - if (inNewExpression && parseOptional(14 /* CloseBracketToken */)) { - indexedAccess.index = createMissingNode(); - grammarErrorAtPos(bracketStart, scanner.getStartPos() - bracketStart, ts.Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); - } - else { - indexedAccess.index = parseExpression(); - if (indexedAccess.index.kind === 7 /* StringLiteral */ || indexedAccess.index.kind === 6 /* NumericLiteral */) { - var literal = indexedAccess.index; - literal.text = internIdentifier(literal.text); - } - parseExpected(14 /* CloseBracketToken */); - } - expr = finishNode(indexedAccess); - continue; - } - if ((token === 11 /* OpenParenToken */ || token === 19 /* LessThanToken */) && !inNewExpression) { - var callExpr = createNode(137 /* CallExpression */, expr.pos); - callExpr.func = expr; - if (token === 19 /* LessThanToken */) { - if (!(callExpr.typeArguments = tryParse(parseTypeArgumentsAndOpenParen))) - return expr; - } - else { - parseExpected(11 /* OpenParenToken */); - } - callExpr.arguments = parseDelimitedList(10 /* ArgumentExpressions */, parseArgumentExpression, false); - parseExpected(12 /* CloseParenToken */); - expr = finishNode(callExpr); - continue; - } - return expr; - } - } - function parseTypeArgumentsAndOpenParen() { - var result = parseTypeArguments(); - parseExpected(11 /* OpenParenToken */); - return result; - } - function parseTypeArguments() { - var typeArgumentListStart = scanner.getTokenPos(); - var errorCountBeforeTypeParameterList = file.syntacticErrors.length; - var result = parseBracketedList(15 /* TypeArguments */, parseType, 19 /* LessThanToken */, 20 /* GreaterThanToken */); - if (!result.length && file.syntacticErrors.length === errorCountBeforeTypeParameterList) { - grammarErrorAtPos(typeArgumentListStart, scanner.getStartPos() - typeArgumentListStart, ts.Diagnostics.Type_argument_list_cannot_be_empty); - } - return result; - } - function parsePrimaryExpression() { - switch (token) { - case 87 /* ThisKeyword */: - case 85 /* SuperKeyword */: - case 83 /* NullKeyword */: - case 89 /* TrueKeyword */: - case 74 /* FalseKeyword */: - return parseTokenNode(); - case 6 /* NumericLiteral */: - case 7 /* StringLiteral */: - return parseLiteralNode(); - case 11 /* OpenParenToken */: - return parseParenExpression(); - case 13 /* OpenBracketToken */: - return parseArrayLiteral(); - case 9 /* OpenBraceToken */: - return parseObjectLiteral(); - case 77 /* FunctionKeyword */: - return parseFunctionExpression(); - case 82 /* NewKeyword */: - return parseNewExpression(); - case 31 /* SlashToken */: - case 51 /* SlashEqualsToken */: - if (reScanSlashToken() === 8 /* RegularExpressionLiteral */) { - return parseLiteralNode(); - } - break; - default: - if (isIdentifier()) { - return parseIdentifier(); - } - } - error(ts.Diagnostics.Expression_expected); - return createMissingNode(); - } - function parseParenExpression() { - var node = createNode(140 /* ParenExpression */); - parseExpected(11 /* OpenParenToken */); - node.expression = parseExpression(); - parseExpected(12 /* CloseParenToken */); - return finishNode(node); - } - function parseAssignmentExpressionOrOmittedExpression(omittedExpressionDiagnostic) { - if (token === 18 /* CommaToken */) { - if (omittedExpressionDiagnostic) { - var errorStart = scanner.getTokenPos(); - var errorLength = scanner.getTextPos() - errorStart; - grammarErrorAtPos(errorStart, errorLength, omittedExpressionDiagnostic); - } - return createNode(147 /* OmittedExpression */); - } - return parseAssignmentExpression(); - } - function parseArrayLiteralElement() { - return parseAssignmentExpressionOrOmittedExpression(undefined); - } - function parseArgumentExpression() { - return parseAssignmentExpressionOrOmittedExpression(ts.Diagnostics.Argument_expression_expected); - } - function parseArrayLiteral() { - var node = createNode(132 /* ArrayLiteral */); - parseExpected(13 /* OpenBracketToken */); - if (scanner.hasPrecedingLineBreak()) - node.flags |= 256 /* MultiLine */; - node.elements = parseDelimitedList(12 /* ArrayLiteralMembers */, parseArrayLiteralElement, true); - parseExpected(14 /* CloseBracketToken */); - return finishNode(node); - } - function parsePropertyAssignment() { - var node = createNode(134 /* PropertyAssignment */); - node.name = parsePropertyName(); - if (token === 11 /* OpenParenToken */ || token === 19 /* LessThanToken */) { - var sig = parseSignature(124 /* CallSignature */, 46 /* ColonToken */, false); - var body = parseBody(false); - node.initializer = makeFunctionExpression(141 /* FunctionExpression */, node.pos, undefined, sig, body); - } - else { - parseExpected(46 /* ColonToken */); - node.initializer = parseAssignmentExpression(false); - } - return finishNode(node); - } - function parseObjectLiteralMember() { - var initialPos = getNodePos(); - var initialToken = token; - if (parseContextualModifier(109 /* GetKeyword */) || parseContextualModifier(113 /* SetKeyword */)) { - var kind = initialToken === 109 /* GetKeyword */ ? 122 /* GetAccessor */ : 123 /* SetAccessor */; - return parseAndCheckMemberAccessorDeclaration(kind, initialPos, 0); - } - return parsePropertyAssignment(); - } - function parseObjectLiteral() { - var node = createNode(133 /* ObjectLiteral */); - parseExpected(9 /* OpenBraceToken */); - if (scanner.hasPrecedingLineBreak()) { - node.flags |= 256 /* MultiLine */; - } - node.properties = parseDelimitedList(11 /* ObjectLiteralMembers */, parseObjectLiteralMember, true); - parseExpected(10 /* CloseBraceToken */); - var seen = {}; - var Property = 1; - var GetAccessor = 2; - var SetAccesor = 4; - var GetOrSetAccessor = GetAccessor | SetAccesor; - ts.forEach(node.properties, function (p) { - if (p.kind === 147 /* OmittedExpression */) { - return; - } - var currentKind; - if (p.kind === 134 /* PropertyAssignment */) { - currentKind = Property; - } - else if (p.kind === 122 /* GetAccessor */) { - currentKind = GetAccessor; - } - else if (p.kind === 123 /* SetAccessor */) { - currentKind = SetAccesor; - } - else { - ts.Debug.fail("Unexpected syntax kind:" + ts.SyntaxKind[p.kind]); - } - if (!ts.hasProperty(seen, p.name.text)) { - seen[p.name.text] = currentKind; - } - else { - var existingKind = seen[p.name.text]; - if (currentKind === Property && existingKind === Property) { - if (isInStrictMode) { - grammarErrorOnNode(p.name, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode); - } - } - else if ((currentKind & GetOrSetAccessor) && (existingKind & GetOrSetAccessor)) { - if (existingKind !== GetOrSetAccessor && currentKind !== existingKind) { - seen[p.name.text] = currentKind | existingKind; - } - else { - grammarErrorOnNode(p.name, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); - } - } - else { - grammarErrorOnNode(p.name, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); - } - } - }); - return finishNode(node); - } - function parseFunctionExpression() { - var pos = getNodePos(); - parseExpected(77 /* FunctionKeyword */); - var name = isIdentifier() ? parseIdentifier() : undefined; - var sig = parseSignature(124 /* CallSignature */, 46 /* ColonToken */, false); - var body = parseBody(false); - if (name && isInStrictMode && isEvalOrArgumentsIdentifier(name)) { - reportInvalidUseInStrictMode(name); - } - return makeFunctionExpression(141 /* FunctionExpression */, pos, name, sig, body); - } - function makeFunctionExpression(kind, pos, name, sig, body) { - var node = createNode(kind, pos); - node.name = name; - node.typeParameters = sig.typeParameters; - node.parameters = sig.parameters; - node.type = sig.type; - node.body = body; - return finishNode(node); - } - function parseNewExpression() { - var node = createNode(138 /* NewExpression */); - parseExpected(82 /* NewKeyword */); - node.func = parseCallAndAccess(parsePrimaryExpression(), true); - if (parseOptional(11 /* OpenParenToken */) || token === 19 /* LessThanToken */ && (node.typeArguments = tryParse(parseTypeArgumentsAndOpenParen))) { - node.arguments = parseDelimitedList(10 /* ArgumentExpressions */, parseArgumentExpression, false); - parseExpected(12 /* CloseParenToken */); - } - return finishNode(node); - } - function parseBlock(ignoreMissingOpenBrace, checkForStrictMode) { - var node = createNode(148 /* Block */); - if (parseExpected(9 /* OpenBraceToken */) || ignoreMissingOpenBrace) { - node.statements = parseList(2 /* BlockStatements */, checkForStrictMode, parseStatement); - parseExpected(10 /* CloseBraceToken */); - } - else { - node.statements = createMissingList(); - } - return finishNode(node); - } - function parseBody(ignoreMissingOpenBrace) { - var saveInFunctionBody = inFunctionBody; - var saveInSwitchStatement = inSwitchStatement; - var saveInIterationStatement = inIterationStatement; - inFunctionBody = true; - if (inSwitchStatement === 1 /* Nested */) { - inSwitchStatement = 2 /* CrossingFunctionBoundary */; - } - if (inIterationStatement === 1 /* Nested */) { - inIterationStatement = 2 /* CrossingFunctionBoundary */; - } - labelledStatementInfo.pushFunctionBoundary(); - var block = parseBlock(ignoreMissingOpenBrace, true); - block.kind = 173 /* FunctionBlock */; - labelledStatementInfo.pop(); - inFunctionBody = saveInFunctionBody; - inSwitchStatement = saveInSwitchStatement; - inIterationStatement = saveInIterationStatement; - return block; - } - function parseEmptyStatement() { - var node = createNode(150 /* EmptyStatement */); - parseExpected(17 /* SemicolonToken */); - return finishNode(node); - } - function parseIfStatement() { - var node = createNode(152 /* IfStatement */); - parseExpected(78 /* IfKeyword */); - parseExpected(11 /* OpenParenToken */); - node.expression = parseExpression(); - parseExpected(12 /* CloseParenToken */); - node.thenStatement = parseStatement(); - node.elseStatement = parseOptional(70 /* ElseKeyword */) ? parseStatement() : undefined; - return finishNode(node); - } - function parseDoStatement() { - var node = createNode(153 /* DoStatement */); - parseExpected(69 /* DoKeyword */); - var saveInIterationStatement = inIterationStatement; - inIterationStatement = 1 /* Nested */; - node.statement = parseStatement(); - inIterationStatement = saveInIterationStatement; - parseExpected(94 /* WhileKeyword */); - parseExpected(11 /* OpenParenToken */); - node.expression = parseExpression(); - parseExpected(12 /* CloseParenToken */); - parseOptional(17 /* SemicolonToken */); - return finishNode(node); - } - function parseWhileStatement() { - var node = createNode(154 /* WhileStatement */); - parseExpected(94 /* WhileKeyword */); - parseExpected(11 /* OpenParenToken */); - node.expression = parseExpression(); - parseExpected(12 /* CloseParenToken */); - var saveInIterationStatement = inIterationStatement; - inIterationStatement = 1 /* Nested */; - node.statement = parseStatement(); - inIterationStatement = saveInIterationStatement; - return finishNode(node); - } - function parseForOrForInStatement() { - var pos = getNodePos(); - parseExpected(76 /* ForKeyword */); - parseExpected(11 /* OpenParenToken */); - if (token !== 17 /* SemicolonToken */) { - if (parseOptional(92 /* VarKeyword */)) { - var declarations = parseVariableDeclarationList(0, true); - if (!declarations.length) { - error(ts.Diagnostics.Variable_declaration_list_cannot_be_empty); - } - } - else { - var varOrInit = parseExpression(true); - } - } - var forOrForInStatement; - if (parseOptional(80 /* InKeyword */)) { - var forInStatement = createNode(156 /* ForInStatement */, pos); - if (declarations) { - if (declarations.length > 1) { - error(ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement); - } - forInStatement.declaration = declarations[0]; - } - else { - forInStatement.variable = varOrInit; - } - forInStatement.expression = parseExpression(); - parseExpected(12 /* CloseParenToken */); - forOrForInStatement = forInStatement; - } - else { - var forStatement = createNode(155 /* ForStatement */, pos); - if (declarations) - forStatement.declarations = declarations; - if (varOrInit) - forStatement.initializer = varOrInit; - parseExpected(17 /* SemicolonToken */); - if (token !== 17 /* SemicolonToken */ && token !== 12 /* CloseParenToken */) { - forStatement.condition = parseExpression(); - } - parseExpected(17 /* SemicolonToken */); - if (token !== 12 /* CloseParenToken */) { - forStatement.iterator = parseExpression(); - } - parseExpected(12 /* CloseParenToken */); - forOrForInStatement = forStatement; - } - var saveInIterationStatement = inIterationStatement; - inIterationStatement = 1 /* Nested */; - forOrForInStatement.statement = parseStatement(); - inIterationStatement = saveInIterationStatement; - return finishNode(forOrForInStatement); - } - function parseBreakOrContinueStatement(kind) { - var node = createNode(kind); - var errorCountBeforeStatement = file.syntacticErrors.length; - parseExpected(kind === 158 /* BreakStatement */ ? 60 /* BreakKeyword */ : 65 /* ContinueKeyword */); - if (!canParseSemicolon()) - node.label = parseIdentifier(); - parseSemicolon(); - finishNode(node); - if (!inAmbientContext && errorCountBeforeStatement === file.syntacticErrors.length) { - if (node.label) { - checkBreakOrContinueStatementWithLabel(node); - } - else { - checkBareBreakOrContinueStatement(node); - } - } - return node; - } - function checkBareBreakOrContinueStatement(node) { - if (node.kind === 158 /* BreakStatement */) { - if (inIterationStatement === 1 /* Nested */ || inSwitchStatement === 1 /* Nested */) { - return; - } - else if (inIterationStatement === 0 /* NotNested */ && inSwitchStatement === 0 /* NotNested */) { - grammarErrorOnNode(node, ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement); - return; - } - } - else if (node.kind === 157 /* ContinueStatement */) { - if (inIterationStatement === 1 /* Nested */) { - return; - } - else if (inIterationStatement === 0 /* NotNested */) { - grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement); - return; - } - } - else { - ts.Debug.fail("checkAnonymousBreakOrContinueStatement"); - } - ts.Debug.assert(inIterationStatement === 2 /* CrossingFunctionBoundary */ || inSwitchStatement === 2 /* CrossingFunctionBoundary */); - grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); - } - function checkBreakOrContinueStatementWithLabel(node) { - var nodeIsNestedInLabel = labelledStatementInfo.nodeIsNestedInLabel(node.label, node.kind === 157 /* ContinueStatement */, false); - if (nodeIsNestedInLabel === 1 /* Nested */) { - return; - } - if (nodeIsNestedInLabel === 2 /* CrossingFunctionBoundary */) { - grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); - return; - } - if (node.kind === 157 /* ContinueStatement */) { - grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); - } - else if (node.kind === 158 /* BreakStatement */) { - grammarErrorOnNode(node, ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement); - } - else { - ts.Debug.fail("checkBreakOrContinueStatementWithLabel"); - } - } - function parseReturnStatement() { - var node = createNode(159 /* ReturnStatement */); - var errorCountBeforeReturnStatement = file.syntacticErrors.length; - var returnTokenStart = scanner.getTokenPos(); - var returnTokenLength = scanner.getTextPos() - returnTokenStart; - parseExpected(84 /* ReturnKeyword */); - if (!canParseSemicolon()) - node.expression = parseExpression(); - parseSemicolon(); - if (!inFunctionBody && !inAmbientContext && errorCountBeforeReturnStatement === file.syntacticErrors.length) { - grammarErrorAtPos(returnTokenStart, returnTokenLength, ts.Diagnostics.A_return_statement_can_only_be_used_within_a_function_body); - } - return finishNode(node); - } - function parseWithStatement() { - var node = createNode(160 /* WithStatement */); - var startPos = scanner.getTokenPos(); - parseExpected(95 /* WithKeyword */); - var endPos = scanner.getStartPos(); - parseExpected(11 /* OpenParenToken */); - node.expression = parseExpression(); - parseExpected(12 /* CloseParenToken */); - node.statement = parseStatement(); - node = finishNode(node); - if (isInStrictMode) { - grammarErrorAtPos(startPos, endPos - startPos, ts.Diagnostics.with_statements_are_not_allowed_in_strict_mode); - } - return node; - } - function parseCaseClause() { - var node = createNode(162 /* CaseClause */); - parseExpected(61 /* CaseKeyword */); - node.expression = parseExpression(); - parseExpected(46 /* ColonToken */); - node.statements = parseList(4 /* SwitchClauseStatements */, false, parseStatement); - return finishNode(node); - } - function parseDefaultClause() { - var node = createNode(163 /* DefaultClause */); - parseExpected(67 /* DefaultKeyword */); - parseExpected(46 /* ColonToken */); - node.statements = parseList(4 /* SwitchClauseStatements */, false, parseStatement); - return finishNode(node); - } - function parseCaseOrDefaultClause() { - return token === 61 /* CaseKeyword */ ? parseCaseClause() : parseDefaultClause(); - } - function parseSwitchStatement() { - var node = createNode(161 /* SwitchStatement */); - parseExpected(86 /* SwitchKeyword */); - parseExpected(11 /* OpenParenToken */); - node.expression = parseExpression(); - parseExpected(12 /* CloseParenToken */); - parseExpected(9 /* OpenBraceToken */); - var saveInSwitchStatement = inSwitchStatement; - inSwitchStatement = 1 /* Nested */; - node.clauses = parseList(3 /* SwitchClauses */, false, parseCaseOrDefaultClause); - inSwitchStatement = saveInSwitchStatement; - parseExpected(10 /* CloseBraceToken */); - var defaultClauses = ts.filter(node.clauses, function (clause) { return clause.kind === 163 /* DefaultClause */; }); - for (var i = 1, n = defaultClauses.length; i < n; i++) { - var clause = defaultClauses[i]; - var start = ts.skipTrivia(file.text, clause.pos); - var end = clause.statements.length > 0 ? clause.statements[0].pos : clause.end; - grammarErrorAtPos(start, end - start, ts.Diagnostics.A_default_clause_cannot_appear_more_than_once_in_a_switch_statement); - } - return finishNode(node); - } - function parseThrowStatement() { - var node = createNode(165 /* ThrowStatement */); - parseExpected(88 /* ThrowKeyword */); - if (scanner.hasPrecedingLineBreak()) { - error(ts.Diagnostics.Line_break_not_permitted_here); - } - node.expression = parseExpression(); - parseSemicolon(); - return finishNode(node); - } - function parseTryStatement() { - var node = createNode(166 /* TryStatement */); - node.tryBlock = parseTokenAndBlock(90 /* TryKeyword */, 167 /* TryBlock */); - if (token === 62 /* CatchKeyword */) { - node.catchBlock = parseCatchBlock(); - } - if (token === 75 /* FinallyKeyword */) { - node.finallyBlock = parseTokenAndBlock(75 /* FinallyKeyword */, 169 /* FinallyBlock */); - } - if (!(node.catchBlock || node.finallyBlock)) { - error(ts.Diagnostics.catch_or_finally_expected); - } - return finishNode(node); - } - function parseTokenAndBlock(token, kind) { - var pos = getNodePos(); - parseExpected(token); - var result = parseBlock(false, false); - result.kind = kind; - result.pos = pos; - return result; - } - function parseCatchBlock() { - var pos = getNodePos(); - parseExpected(62 /* CatchKeyword */); - parseExpected(11 /* OpenParenToken */); - var variable = parseIdentifier(); - var typeAnnotationColonStart = scanner.getTokenPos(); - var typeAnnotationColonLength = scanner.getTextPos() - typeAnnotationColonStart; - var typeAnnotation = parseTypeAnnotation(); - parseExpected(12 /* CloseParenToken */); - var result = parseBlock(false, false); - result.kind = 168 /* CatchBlock */; - result.pos = pos; - result.variable = variable; - if (typeAnnotation) { - errorAtPos(typeAnnotationColonStart, typeAnnotationColonLength, ts.Diagnostics.Catch_clause_parameter_cannot_have_a_type_annotation); - } - if (isInStrictMode && isEvalOrArgumentsIdentifier(variable)) { - reportInvalidUseInStrictMode(variable); - } - return result; - } - function parseDebuggerStatement() { - var node = createNode(170 /* DebuggerStatement */); - parseExpected(66 /* DebuggerKeyword */); - parseSemicolon(); - return finishNode(node); - } - function isIterationStatementStart() { - return token === 94 /* WhileKeyword */ || token === 69 /* DoKeyword */ || token === 76 /* ForKeyword */; - } - function parseStatementWithLabelSet() { - labelledStatementInfo.pushCurrentLabelSet(isIterationStatementStart()); - var statement = parseStatement(); - labelledStatementInfo.pop(); - return statement; - } - function isLabel() { - return isIdentifier() && lookAhead(function () { return nextToken() === 46 /* ColonToken */; }); - } - function parseLabelledStatement() { - var node = createNode(164 /* LabeledStatement */); - node.label = parseIdentifier(); - parseExpected(46 /* ColonToken */); - if (labelledStatementInfo.nodeIsNestedInLabel(node.label, false, true)) { - grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, getTextOfNodeFromSourceText(sourceText, node.label)); - } - labelledStatementInfo.addLabel(node.label); - node.statement = isLabel() ? parseLabelledStatement() : parseStatementWithLabelSet(); - return finishNode(node); - } - function parseExpressionStatement() { - var node = createNode(151 /* ExpressionStatement */); - node.expression = parseExpression(); - parseSemicolon(); - return finishNode(node); - } - function isStatement(inErrorRecovery) { - switch (token) { - case 17 /* SemicolonToken */: - return !inErrorRecovery; - case 9 /* OpenBraceToken */: - case 92 /* VarKeyword */: - case 77 /* FunctionKeyword */: - case 78 /* IfKeyword */: - case 69 /* DoKeyword */: - case 94 /* WhileKeyword */: - case 76 /* ForKeyword */: - case 65 /* ContinueKeyword */: - case 60 /* BreakKeyword */: - case 84 /* ReturnKeyword */: - case 95 /* WithKeyword */: - case 86 /* SwitchKeyword */: - case 88 /* ThrowKeyword */: - case 90 /* TryKeyword */: - case 66 /* DebuggerKeyword */: - case 62 /* CatchKeyword */: - case 75 /* FinallyKeyword */: - return true; - case 97 /* InterfaceKeyword */: - case 63 /* ClassKeyword */: - case 110 /* ModuleKeyword */: - case 71 /* EnumKeyword */: - if (isDeclaration()) { - return false; - } - case 102 /* PublicKeyword */: - case 100 /* PrivateKeyword */: - case 101 /* ProtectedKeyword */: - case 103 /* StaticKeyword */: - if (lookAhead(function () { return nextToken() >= 59 /* Identifier */; })) { - return false; - } - default: - return isExpression(); - } - } - function parseStatement() { - switch (token) { - case 9 /* OpenBraceToken */: - return parseBlock(false, false); - case 92 /* VarKeyword */: - return parseVariableStatement(); - case 77 /* FunctionKeyword */: - return parseFunctionDeclaration(); - case 17 /* SemicolonToken */: - return parseEmptyStatement(); - case 78 /* IfKeyword */: - return parseIfStatement(); - case 69 /* DoKeyword */: - return parseDoStatement(); - case 94 /* WhileKeyword */: - return parseWhileStatement(); - case 76 /* ForKeyword */: - return parseForOrForInStatement(); - case 65 /* ContinueKeyword */: - return parseBreakOrContinueStatement(157 /* ContinueStatement */); - case 60 /* BreakKeyword */: - return parseBreakOrContinueStatement(158 /* BreakStatement */); - case 84 /* ReturnKeyword */: - return parseReturnStatement(); - case 95 /* WithKeyword */: - return parseWithStatement(); - case 86 /* SwitchKeyword */: - return parseSwitchStatement(); - case 88 /* ThrowKeyword */: - return parseThrowStatement(); - case 90 /* TryKeyword */: - case 62 /* CatchKeyword */: - case 75 /* FinallyKeyword */: - return parseTryStatement(); - case 66 /* DebuggerKeyword */: - return parseDebuggerStatement(); - default: - if (isLabel()) { - return parseLabelledStatement(); - } - return parseExpressionStatement(); - } - } - function parseStatementOrFunction() { - return token === 77 /* FunctionKeyword */ ? parseFunctionDeclaration() : parseStatement(); - } - function parseAndCheckFunctionBody(isConstructor) { - var initialPosition = scanner.getTokenPos(); - var errorCountBeforeBody = file.syntacticErrors.length; - if (token === 9 /* OpenBraceToken */) { - var body = parseBody(false); - if (body && inAmbientContext && file.syntacticErrors.length === errorCountBeforeBody) { - var diagnostic = isConstructor ? ts.Diagnostics.A_constructor_implementation_cannot_be_declared_in_an_ambient_context : ts.Diagnostics.A_function_implementation_cannot_be_declared_in_an_ambient_context; - grammarErrorAtPos(initialPosition, 1, diagnostic); - } - return body; - } - if (canParseSemicolon()) { - parseSemicolon(); - return undefined; - } - error(ts.Diagnostics.Block_or_expected); - } - function parseVariableDeclaration(flags, noIn) { - var node = createNode(171 /* VariableDeclaration */); - node.flags = flags; - var errorCountBeforeVariableDeclaration = file.syntacticErrors.length; - node.name = parseIdentifier(); - node.type = parseTypeAnnotation(); - var initializerStart = scanner.getTokenPos(); - var initializerFirstTokenLength = scanner.getTextPos() - initializerStart; - node.initializer = parseInitializer(false, noIn); - if (inAmbientContext && node.initializer && errorCountBeforeVariableDeclaration === file.syntacticErrors.length) { - grammarErrorAtPos(initializerStart, initializerFirstTokenLength, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); - } - if (isInStrictMode && isEvalOrArgumentsIdentifier(node.name)) { - reportInvalidUseInStrictMode(node.name); - } - return finishNode(node); - } - function parseVariableDeclarationList(flags, noIn) { - return parseDelimitedList(9 /* VariableDeclarations */, function () { return parseVariableDeclaration(flags, noIn); }, false); - } - function parseVariableStatement(pos, flags) { - var node = createNode(149 /* VariableStatement */, pos); - if (flags) - node.flags = flags; - var errorCountBeforeVarStatement = file.syntacticErrors.length; - parseExpected(92 /* VarKeyword */); - node.declarations = parseVariableDeclarationList(flags, false); - parseSemicolon(); - finishNode(node); - if (!node.declarations.length && file.syntacticErrors.length === errorCountBeforeVarStatement) { - grammarErrorOnNode(node, ts.Diagnostics.Variable_declaration_list_cannot_be_empty); - } - return node; - } - function parseFunctionDeclaration(pos, flags) { - var node = createNode(172 /* FunctionDeclaration */, pos); - if (flags) - node.flags = flags; - parseExpected(77 /* FunctionKeyword */); - node.name = parseIdentifier(); - var sig = parseSignature(124 /* CallSignature */, 46 /* ColonToken */, false); - node.typeParameters = sig.typeParameters; - node.parameters = sig.parameters; - node.type = sig.type; - node.body = parseAndCheckFunctionBody(false); - if (isInStrictMode && isEvalOrArgumentsIdentifier(node.name)) { - reportInvalidUseInStrictMode(node.name); - } - return finishNode(node); - } - function parseConstructorDeclaration(pos, flags) { - var node = createNode(121 /* Constructor */, pos); - node.flags = flags; - parseExpected(107 /* ConstructorKeyword */); - var sig = parseSignature(124 /* CallSignature */, 46 /* ColonToken */, false); - node.typeParameters = sig.typeParameters; - node.parameters = sig.parameters; - node.type = sig.type; - node.body = parseAndCheckFunctionBody(true); - if (node.typeParameters) { - grammarErrorAtPos(node.typeParameters.pos, node.typeParameters.end - node.typeParameters.pos, ts.Diagnostics.Type_parameters_cannot_appear_on_a_constructor_declaration); - } - if (node.type) { - grammarErrorOnNode(node.type, ts.Diagnostics.Type_annotation_cannot_appear_on_a_constructor_declaration); - } - return finishNode(node); - } - function parsePropertyMemberDeclaration(pos, flags) { - var errorCountBeforePropertyDeclaration = file.syntacticErrors.length; - var name = parsePropertyName(); - var questionStart = scanner.getTokenPos(); - if (parseOptional(45 /* QuestionToken */)) { - errorAtPos(questionStart, scanner.getStartPos() - questionStart, ts.Diagnostics.A_class_member_cannot_be_declared_optional); - } - if (token === 11 /* OpenParenToken */ || token === 19 /* LessThanToken */) { - var method = createNode(120 /* Method */, pos); - method.flags = flags; - method.name = name; - var sig = parseSignature(124 /* CallSignature */, 46 /* ColonToken */, false); - method.typeParameters = sig.typeParameters; - method.parameters = sig.parameters; - method.type = sig.type; - method.body = parseAndCheckFunctionBody(false); - return finishNode(method); - } - else { - var property = createNode(119 /* Property */, pos); - property.flags = flags; - property.name = name; - property.type = parseTypeAnnotation(); - var initializerStart = scanner.getTokenPos(); - var initializerFirstTokenLength = scanner.getTextPos() - initializerStart; - property.initializer = parseInitializer(false); - parseSemicolon(); - if (inAmbientContext && property.initializer && errorCountBeforePropertyDeclaration === file.syntacticErrors.length) { - grammarErrorAtPos(initializerStart, initializerFirstTokenLength, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); - } - return finishNode(property); - } - } - function parseAndCheckMemberAccessorDeclaration(kind, pos, flags) { - var errorCountBeforeAccessor = file.syntacticErrors.length; - var accessor = parseMemberAccessorDeclaration(kind, pos, flags); - if (errorCountBeforeAccessor === file.syntacticErrors.length) { - if (languageVersion < 1 /* ES5 */) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher); - } - else if (inAmbientContext) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_be_declared_in_an_ambient_context); - } - else if (accessor.typeParameters) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); - } - else if (kind === 122 /* GetAccessor */ && accessor.parameters.length) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.A_get_accessor_cannot_have_parameters); - } - else if (kind === 123 /* SetAccessor */) { - if (accessor.type) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); - } - else if (accessor.parameters.length !== 1) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter); - } - else { - var parameter = accessor.parameters[0]; - if (parameter.flags & 8 /* Rest */) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_rest_parameter); - } - else if (parameter.flags & ts.NodeFlags.Modifier) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); - } - else if (parameter.flags & 4 /* QuestionMark */) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_an_optional_parameter); - } - else if (parameter.initializer) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_parameter_cannot_have_an_initializer); - } - } - } - } - return accessor; - } - function parseMemberAccessorDeclaration(kind, pos, flags) { - var node = createNode(kind, pos); - node.flags = flags; - node.name = parsePropertyName(); - var sig = parseSignature(124 /* CallSignature */, 46 /* ColonToken */, false); - node.typeParameters = sig.typeParameters; - node.parameters = sig.parameters; - node.type = sig.type; - if (inAmbientContext && canParseSemicolon()) { - parseSemicolon(); - node.body = createMissingNode(); - } - else { - node.body = parseBody(false); - } - return finishNode(node); - } - function isClassMemberStart() { - var idToken; - while (isModifier(token)) { - idToken = token; - nextToken(); - } - if (isPropertyName()) { - idToken = token; - nextToken(); - } - if (token === 13 /* OpenBracketToken */) { - return true; - } - if (idToken !== undefined) { - if (!isKeyword(idToken) || idToken === 113 /* SetKeyword */ || idToken === 109 /* GetKeyword */) { - return true; - } - switch (token) { - case 11 /* OpenParenToken */: - case 19 /* LessThanToken */: - case 46 /* ColonToken */: - case 47 /* EqualsToken */: - case 45 /* QuestionToken */: - return true; - default: - return canParseSemicolon(); - } - } - return false; - } - function parseAndCheckModifiers(context) { - var flags = 0; - var lastStaticModifierStart; - var lastStaticModifierLength; - var lastDeclareModifierStart; - var lastDeclareModifierLength; - var lastPrivateModifierStart; - var lastPrivateModifierLength; - var lastProtectedModifierStart; - var lastProtectedModifierLength; - while (true) { - var modifierStart = scanner.getTokenPos(); - var modifierToken = token; - if (!parseAnyContextualModifier()) - break; - var modifierLength = scanner.getStartPos() - modifierStart; - switch (modifierToken) { - case 102 /* PublicKeyword */: - if (flags & ts.NodeFlags.AccessibilityModifier) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics.Accessibility_modifier_already_seen); - } - else if (flags & 128 /* Static */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_must_precede_1_modifier, "public", "static"); - } - else if (context === 1 /* ModuleElements */ || context === 0 /* SourceElements */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, "public"); - } - flags |= 16 /* Public */; - break; - case 100 /* PrivateKeyword */: - if (flags & ts.NodeFlags.AccessibilityModifier) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics.Accessibility_modifier_already_seen); - } - else if (flags & 128 /* Static */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_must_precede_1_modifier, "private", "static"); - } - else if (context === 1 /* ModuleElements */ || context === 0 /* SourceElements */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, "private"); - } - lastPrivateModifierStart = modifierStart; - lastPrivateModifierLength = modifierLength; - flags |= 32 /* Private */; - break; - case 101 /* ProtectedKeyword */: - if (flags & 16 /* Public */ || flags & 32 /* Private */ || flags & 64 /* Protected */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics.Accessibility_modifier_already_seen); - } - else if (flags & 128 /* Static */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_must_precede_1_modifier, "protected", "static"); - } - else if (context === 1 /* ModuleElements */ || context === 0 /* SourceElements */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, "protected"); - } - lastProtectedModifierStart = modifierStart; - lastProtectedModifierLength = modifierLength; - flags |= 64 /* Protected */; - break; - case 103 /* StaticKeyword */: - if (flags & 128 /* Static */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_already_seen, "static"); - } - else if (context === 1 /* ModuleElements */ || context === 0 /* SourceElements */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, "static"); - } - else if (context === 3 /* Parameters */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); - } - lastStaticModifierStart = modifierStart; - lastStaticModifierLength = modifierLength; - flags |= 128 /* Static */; - break; - case 72 /* ExportKeyword */: - if (flags & 1 /* Export */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_already_seen, "export"); - } - else if (flags & 2 /* Ambient */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_must_precede_1_modifier, "export", "declare"); - } - else if (context === 2 /* ClassMembers */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); - } - else if (context === 3 /* Parameters */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); - } - flags |= 1 /* Export */; - break; - case 108 /* DeclareKeyword */: - if (flags & 2 /* Ambient */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_already_seen, "declare"); - } - else if (context === 2 /* ClassMembers */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); - } - else if (context === 3 /* Parameters */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); - } - else if (inAmbientContext && context === 1 /* ModuleElements */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); - } - lastDeclareModifierStart = modifierStart; - lastDeclareModifierLength = modifierLength; - flags |= 2 /* Ambient */; - break; - } - } - if (token === 107 /* ConstructorKeyword */ && flags & 128 /* Static */) { - grammarErrorAtPos(lastStaticModifierStart, lastStaticModifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); - } - else if (token === 107 /* ConstructorKeyword */ && flags & 32 /* Private */) { - grammarErrorAtPos(lastPrivateModifierStart, lastPrivateModifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "private"); - } - else if (token === 107 /* ConstructorKeyword */ && flags & 64 /* Protected */) { - grammarErrorAtPos(lastProtectedModifierStart, lastProtectedModifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "protected"); - } - else if (token === 79 /* ImportKeyword */) { - if (flags & 2 /* Ambient */) { - grammarErrorAtPos(lastDeclareModifierStart, lastDeclareModifierLength, ts.Diagnostics.A_declare_modifier_cannot_be_used_with_an_import_declaration, "declare"); - } - } - else if (token === 97 /* InterfaceKeyword */) { - if (flags & 2 /* Ambient */) { - grammarErrorAtPos(lastDeclareModifierStart, lastDeclareModifierLength, ts.Diagnostics.A_declare_modifier_cannot_be_used_with_an_interface_declaration, "declare"); - } - } - else if (token !== 72 /* ExportKeyword */ && !(flags & 2 /* Ambient */) && inAmbientContext && context === 0 /* SourceElements */) { - var declarationStart = scanner.getTokenPos(); - var declarationFirstTokenLength = scanner.getTextPos() - declarationStart; - grammarErrorAtPos(declarationStart, declarationFirstTokenLength, ts.Diagnostics.A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file); - } - return flags; - } - function parseClassMemberDeclaration() { - var pos = getNodePos(); - var flags = parseAndCheckModifiers(2 /* ClassMembers */); - if (parseContextualModifier(109 /* GetKeyword */)) { - return parseAndCheckMemberAccessorDeclaration(122 /* GetAccessor */, pos, flags); - } - if (parseContextualModifier(113 /* SetKeyword */)) { - return parseAndCheckMemberAccessorDeclaration(123 /* SetAccessor */, pos, flags); - } - if (token === 107 /* ConstructorKeyword */) { - return parseConstructorDeclaration(pos, flags); - } - if (token >= 59 /* Identifier */ || token === 7 /* StringLiteral */ || token === 6 /* NumericLiteral */) { - return parsePropertyMemberDeclaration(pos, flags); - } - if (token === 13 /* OpenBracketToken */) { - if (flags) { - var start = getTokenPos(pos); - var length = getNodePos() - start; - errorAtPos(start, length, ts.Diagnostics.Modifiers_not_permitted_on_index_signature_members); - } - return parseIndexSignatureMember(); - } - ts.Debug.fail("Should not have attempted to parse class member declaration."); - } - function parseClassDeclaration(pos, flags) { - var node = createNode(174 /* ClassDeclaration */, pos); - node.flags = flags; - var errorCountBeforeClassDeclaration = file.syntacticErrors.length; - parseExpected(63 /* ClassKeyword */); - node.name = parseIdentifier(); - node.typeParameters = parseTypeParameters(); - node.baseType = parseOptional(73 /* ExtendsKeyword */) ? parseTypeReference() : undefined; - var implementsKeywordStart = scanner.getTokenPos(); - var implementsKeywordLength; - if (parseOptional(96 /* ImplementsKeyword */)) { - implementsKeywordLength = scanner.getStartPos() - implementsKeywordStart; - node.implementedTypes = parseDelimitedList(8 /* BaseTypeReferences */, parseTypeReference, false); - } - var errorCountBeforeClassBody = file.syntacticErrors.length; - if (parseExpected(9 /* OpenBraceToken */)) { - node.members = parseList(6 /* ClassMembers */, false, parseClassMemberDeclaration); - parseExpected(10 /* CloseBraceToken */); - } - else { - node.members = createMissingList(); - } - if (node.implementedTypes && !node.implementedTypes.length && errorCountBeforeClassBody === errorCountBeforeClassDeclaration) { - grammarErrorAtPos(implementsKeywordStart, implementsKeywordLength, ts.Diagnostics._0_list_cannot_be_empty, "implements"); - } - return finishNode(node); - } - function parseInterfaceDeclaration(pos, flags) { - var node = createNode(175 /* InterfaceDeclaration */, pos); - node.flags = flags; - var errorCountBeforeInterfaceDeclaration = file.syntacticErrors.length; - parseExpected(97 /* InterfaceKeyword */); - node.name = parseIdentifier(); - node.typeParameters = parseTypeParameters(); - var extendsKeywordStart = scanner.getTokenPos(); - var extendsKeywordLength; - if (parseOptional(73 /* ExtendsKeyword */)) { - extendsKeywordLength = scanner.getStartPos() - extendsKeywordStart; - node.baseTypes = parseDelimitedList(8 /* BaseTypeReferences */, parseTypeReference, false); - } - var errorCountBeforeInterfaceBody = file.syntacticErrors.length; - node.members = parseTypeLiteral().members; - if (node.baseTypes && !node.baseTypes.length && errorCountBeforeInterfaceBody === errorCountBeforeInterfaceDeclaration) { - grammarErrorAtPos(extendsKeywordStart, extendsKeywordLength, ts.Diagnostics._0_list_cannot_be_empty, "extends"); - } - return finishNode(node); - } - function parseAndCheckEnumDeclaration(pos, flags) { - function isIntegerLiteral(expression) { - function isInteger(literalExpression) { - return /^[0-9]+([eE]\+?[0-9]+)?$/.test(literalExpression.text); - } - if (expression.kind === 143 /* PrefixOperator */) { - var unaryExpression = expression; - if (unaryExpression.operator === 28 /* PlusToken */ || unaryExpression.operator === 29 /* MinusToken */) { - expression = unaryExpression.operand; - } - } - if (expression.kind === 6 /* NumericLiteral */) { - return isInteger(expression); - } - return false; - } - var inConstantEnumMemberSection = true; - function parseAndCheckEnumMember() { - var node = createNode(181 /* EnumMember */); - var errorCountBeforeEnumMember = file.syntacticErrors.length; - node.name = parsePropertyName(); - node.initializer = parseInitializer(false); - if (inAmbientContext) { - if (node.initializer && !isIntegerLiteral(node.initializer) && errorCountBeforeEnumMember === file.syntacticErrors.length) { - grammarErrorOnNode(node.name, ts.Diagnostics.Ambient_enum_elements_can_only_have_integer_literal_initializers); - } - } - else if (node.initializer) { - inConstantEnumMemberSection = isIntegerLiteral(node.initializer); - } - else if (!inConstantEnumMemberSection && errorCountBeforeEnumMember === file.syntacticErrors.length) { - grammarErrorOnNode(node.name, ts.Diagnostics.Enum_member_must_have_initializer); - } - return finishNode(node); - } - var node = createNode(176 /* EnumDeclaration */, pos); - node.flags = flags; - parseExpected(71 /* EnumKeyword */); - node.name = parseIdentifier(); - if (parseExpected(9 /* OpenBraceToken */)) { - node.members = parseDelimitedList(7 /* EnumMembers */, parseAndCheckEnumMember, true); - parseExpected(10 /* CloseBraceToken */); - } - else { - node.members = createMissingList(); - } - return finishNode(node); - } - function parseModuleBody() { - var node = createNode(178 /* ModuleBlock */); - if (parseExpected(9 /* OpenBraceToken */)) { - node.statements = parseList(1 /* ModuleElements */, false, parseModuleElement); - parseExpected(10 /* CloseBraceToken */); - } - else { - node.statements = createMissingList(); - } - return finishNode(node); - } - function parseInternalModuleTail(pos, flags) { - var node = createNode(177 /* ModuleDeclaration */, pos); - node.flags = flags; - node.name = parseIdentifier(); - if (parseOptional(15 /* DotToken */)) { - node.body = parseInternalModuleTail(getNodePos(), 1 /* Export */); - } - else { - node.body = parseModuleBody(); - ts.forEach(node.body.statements, function (s) { - if (s.kind === 180 /* ExportAssignment */) { - grammarErrorOnNode(s, ts.Diagnostics.An_export_assignment_cannot_be_used_in_an_internal_module); - } - else if (s.kind === 179 /* ImportDeclaration */ && s.externalModuleName) { - grammarErrorOnNode(s, ts.Diagnostics.Import_declarations_in_an_internal_module_cannot_reference_an_external_module); - } - }); - } - return finishNode(node); - } - function parseAmbientExternalModuleDeclaration(pos, flags) { - var node = createNode(177 /* ModuleDeclaration */, pos); - node.flags = flags; - node.name = parseStringLiteral(); - if (!inAmbientContext) { - var errorCount = file.syntacticErrors.length; - if (!errorCount || file.syntacticErrors[errorCount - 1].start < getTokenPos(pos)) { - grammarErrorOnNode(node.name, ts.Diagnostics.Only_ambient_modules_can_use_quoted_names); - } - } - var saveInAmbientContext = inAmbientContext; - inAmbientContext = true; - node.body = parseModuleBody(); - inAmbientContext = saveInAmbientContext; - return finishNode(node); - } - function parseModuleDeclaration(pos, flags) { - parseExpected(110 /* ModuleKeyword */); - return token === 7 /* StringLiteral */ ? parseAmbientExternalModuleDeclaration(pos, flags) : parseInternalModuleTail(pos, flags); - } - function parseImportDeclaration(pos, flags) { - var node = createNode(179 /* ImportDeclaration */, pos); - node.flags = flags; - parseExpected(79 /* ImportKeyword */); - node.name = parseIdentifier(); - parseExpected(47 /* EqualsToken */); - var entityName = parseEntityName(false); - if (entityName.kind === 59 /* Identifier */ && entityName.text === "require" && parseOptional(11 /* OpenParenToken */)) { - node.externalModuleName = parseStringLiteral(); - parseExpected(12 /* CloseParenToken */); - } - else { - node.entityName = entityName; - } - parseSemicolon(); - return finishNode(node); - } - function parseExportAssignmentTail(pos) { - var node = createNode(180 /* ExportAssignment */, pos); - node.exportName = parseIdentifier(); - parseSemicolon(); - return finishNode(node); - } - function isDeclaration() { - switch (token) { - case 92 /* VarKeyword */: - case 77 /* FunctionKeyword */: - return true; - case 63 /* ClassKeyword */: - case 97 /* InterfaceKeyword */: - case 71 /* EnumKeyword */: - case 79 /* ImportKeyword */: - return lookAhead(function () { return nextToken() >= 59 /* Identifier */; }); - case 110 /* ModuleKeyword */: - return lookAhead(function () { return nextToken() >= 59 /* Identifier */ || token === 7 /* StringLiteral */; }); - case 72 /* ExportKeyword */: - return lookAhead(function () { return nextToken() === 47 /* EqualsToken */ || isDeclaration(); }); - case 108 /* DeclareKeyword */: - case 102 /* PublicKeyword */: - case 100 /* PrivateKeyword */: - case 101 /* ProtectedKeyword */: - case 103 /* StaticKeyword */: - return lookAhead(function () { - nextToken(); - return isDeclaration(); - }); - } - } - function parseDeclaration(modifierContext) { - var pos = getNodePos(); - var errorCountBeforeModifiers = file.syntacticErrors.length; - var flags = parseAndCheckModifiers(modifierContext); - if (token === 72 /* ExportKeyword */) { - var modifiersEnd = scanner.getStartPos(); - nextToken(); - if (parseOptional(47 /* EqualsToken */)) { - var exportAssignmentTail = parseExportAssignmentTail(pos); - if (flags !== 0 && errorCountBeforeModifiers === file.syntacticErrors.length) { - var modifiersStart = ts.skipTrivia(sourceText, pos); - grammarErrorAtPos(modifiersStart, modifiersEnd - modifiersStart, ts.Diagnostics.An_export_assignment_cannot_have_modifiers); - } - return exportAssignmentTail; - } - } - var saveInAmbientContext = inAmbientContext; - if (flags & 2 /* Ambient */) { - inAmbientContext = true; - } - var result; - switch (token) { - case 92 /* VarKeyword */: - result = parseVariableStatement(pos, flags); - break; - case 77 /* FunctionKeyword */: - result = parseFunctionDeclaration(pos, flags); - break; - case 63 /* ClassKeyword */: - result = parseClassDeclaration(pos, flags); - break; - case 97 /* InterfaceKeyword */: - result = parseInterfaceDeclaration(pos, flags); - break; - case 71 /* EnumKeyword */: - result = parseAndCheckEnumDeclaration(pos, flags); - break; - case 110 /* ModuleKeyword */: - result = parseModuleDeclaration(pos, flags); - break; - case 79 /* ImportKeyword */: - result = parseImportDeclaration(pos, flags); - break; - default: - error(ts.Diagnostics.Declaration_expected); - } - inAmbientContext = saveInAmbientContext; - return result; - } - function isSourceElement(inErrorRecovery) { - return isDeclaration() || isStatement(inErrorRecovery); - } - function parseSourceElement() { - return parseSourceElementOrModuleElement(0 /* SourceElements */); - } - function parseModuleElement() { - return parseSourceElementOrModuleElement(1 /* ModuleElements */); - } - function parseSourceElementOrModuleElement(modifierContext) { - if (isDeclaration()) { - return parseDeclaration(modifierContext); - } - var statementStart = scanner.getTokenPos(); - var statementFirstTokenLength = scanner.getTextPos() - statementStart; - var errorCountBeforeStatement = file.syntacticErrors.length; - var statement = parseStatement(); - if (inAmbientContext && file.syntacticErrors.length === errorCountBeforeStatement) { - grammarErrorAtPos(statementStart, statementFirstTokenLength, ts.Diagnostics.Statements_are_not_allowed_in_ambient_contexts); - } - return statement; - } - function processReferenceComments() { - var referencedFiles = []; - var amdDependencies = []; - commentRanges = []; - token = scanner.scan(); - for (var i = 0; i < commentRanges.length; i++) { - var range = commentRanges[i]; - var comment = sourceText.substring(range.pos, range.end); - var simpleReferenceRegEx = /^\/\/\/\s*/gim; - if (isNoDefaultLibRegEx.exec(comment)) { - file.hasNoDefaultLib = true; - } - else { - var matchResult = ts.fullTripleSlashReferencePathRegEx.exec(comment); - var start = range.pos; - var end = range.end; - var length = end - start; - if (!matchResult) { - errorAtPos(start, length, ts.Diagnostics.Invalid_reference_directive_syntax); - } - else { - referencedFiles.push({ - pos: start, - end: end, - filename: matchResult[3] - }); - } - } - } - else { - var amdDependencyRegEx = /^\/\/\/\s*= 0; - } - function processRootFile(filename, isDefaultLib) { - processSourceFile(ts.normalizePath(filename), isDefaultLib); - } - function processSourceFile(filename, isDefaultLib, refFile, refPos, refEnd) { - if (refEnd !== undefined && refPos !== undefined) { - var start = refPos; - var length = refEnd - refPos; - } - var diagnostic; - if (hasExtension(filename)) { - if (!ts.fileExtensionIs(filename, ".ts")) { - diagnostic = ts.Diagnostics.File_0_must_have_extension_ts_or_d_ts; - } - else if (!findSourceFile(filename, isDefaultLib, refFile, refPos, refEnd)) { - diagnostic = ts.Diagnostics.File_0_not_found; - } - else if (refFile && host.getCanonicalFileName(filename) === host.getCanonicalFileName(refFile.filename)) { - diagnostic = ts.Diagnostics.A_file_cannot_have_a_reference_to_itself; - } - } - else { - if (!(findSourceFile(filename + ".ts", isDefaultLib, refFile, refPos, refEnd) || findSourceFile(filename + ".d.ts", isDefaultLib, refFile, refPos, refEnd))) { - diagnostic = ts.Diagnostics.File_0_not_found; - filename += ".ts"; - } - } - if (diagnostic) { - if (refFile) { - errors.push(ts.createFileDiagnostic(refFile, start, length, diagnostic, filename)); - } - else { - errors.push(ts.createCompilerDiagnostic(diagnostic, filename)); - } - } - } - function findSourceFile(filename, isDefaultLib, refFile, refStart, refLength) { - var canonicalName = host.getCanonicalFileName(filename); - if (ts.hasProperty(filesByName, canonicalName)) { - var file = filesByName[canonicalName]; - if (file && host.useCaseSensitiveFileNames() && canonicalName !== file.filename) { - errors.push(ts.createFileDiagnostic(refFile, refStart, refLength, ts.Diagnostics.Filename_0_differs_from_already_included_filename_1_only_in_casing, filename, file.filename)); - } - } - else { - var file = filesByName[canonicalName] = host.getSourceFile(filename, options.target, function (hostErrorMessage) { - errors.push(ts.createFileDiagnostic(refFile, refStart, refLength, ts.Diagnostics.Cannot_read_file_0_Colon_1, filename, hostErrorMessage)); - }); - if (file) { - seenNoDefaultLib = seenNoDefaultLib || file.hasNoDefaultLib; - if (!options.noResolve) { - var basePath = ts.getDirectoryPath(filename); - processReferencedFiles(file, basePath); - processImportedModules(file, basePath); - } - if (isDefaultLib) { - files.unshift(file); - } - else { - files.push(file); - } - ts.forEach(file.syntacticErrors, function (e) { - errors.push(e); - }); - } - } - return file; - } - function processReferencedFiles(file, basePath) { - ts.forEach(file.referencedFiles, function (ref) { - var referencedFilename = ts.isRootedDiskPath(ref.filename) ? ref.filename : ts.combinePaths(basePath, ref.filename); - processSourceFile(ts.normalizePath(referencedFilename), false, file, ref.pos, ref.end); - }); - } - function processImportedModules(file, basePath) { - ts.forEach(file.statements, function (node) { - if (node.kind === 179 /* ImportDeclaration */ && node.externalModuleName) { - var nameLiteral = node.externalModuleName; - var moduleName = nameLiteral.text; - if (moduleName) { - var searchPath = basePath; - while (true) { - var searchName = ts.normalizePath(ts.combinePaths(searchPath, moduleName)); - if (findModuleSourceFile(searchName + ".ts", nameLiteral) || findModuleSourceFile(searchName + ".d.ts", nameLiteral)) { - break; - } - var parentPath = ts.getDirectoryPath(searchPath); - if (parentPath === searchPath) { - break; - } - searchPath = parentPath; - } - } - } - else if (node.kind === 177 /* ModuleDeclaration */ && node.name.kind === 7 /* StringLiteral */ && (node.flags & 2 /* Ambient */ || isDeclarationFile(file))) { - forEachChild(node.body, function (node) { - if (node.kind === 179 /* ImportDeclaration */ && node.externalModuleName) { - var nameLiteral = node.externalModuleName; - var moduleName = nameLiteral.text; - if (moduleName) { - var searchName = ts.normalizePath(ts.combinePaths(basePath, moduleName)); - var tsFile = findModuleSourceFile(searchName + ".ts", nameLiteral); - if (!tsFile) { - findModuleSourceFile(searchName + ".d.ts", nameLiteral); - } - } - } - }); - } - }); - function findModuleSourceFile(filename, nameLiteral) { - return findSourceFile(filename, false, file, nameLiteral.pos, nameLiteral.end - nameLiteral.pos); - } - } - function verifyCompilerOptions() { - if (!options.sourceMap && (options.mapRoot || options.sourceRoot)) { - if (options.mapRoot) { - errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Option_mapRoot_cannot_be_specified_without_specifying_sourcemap_option)); - } - if (options.sourceRoot) { - errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Option_sourceRoot_cannot_be_specified_without_specifying_sourcemap_option)); - } - return; - } - var firstExternalModule = ts.forEach(files, function (f) { return isExternalModule(f) ? f : undefined; }); - if (firstExternalModule && options.module === 0 /* None */) { - var externalModuleErrorSpan = getErrorSpanForNode(firstExternalModule.externalModuleIndicator); - var errorStart = ts.skipTrivia(firstExternalModule.text, externalModuleErrorSpan.pos); - var errorLength = externalModuleErrorSpan.end - errorStart; - errors.push(ts.createFileDiagnostic(firstExternalModule, errorStart, errorLength, ts.Diagnostics.Cannot_compile_external_modules_unless_the_module_flag_is_provided)); - } - if (options.outDir || options.sourceRoot || (options.mapRoot && (!options.out || firstExternalModule !== undefined))) { - var commonPathComponents; - ts.forEach(files, function (sourceFile) { - if (!(sourceFile.flags & 1024 /* DeclarationFile */) && !ts.fileExtensionIs(sourceFile.filename, ".js")) { - var sourcePathComponents = ts.getNormalizedPathComponents(sourceFile.filename, host.getCurrentDirectory()); - sourcePathComponents.pop(); - if (commonPathComponents) { - for (var i = 0; i < Math.min(commonPathComponents.length, sourcePathComponents.length); i++) { - if (commonPathComponents[i] !== sourcePathComponents[i]) { - if (i === 0) { - errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files)); - return; - } - commonPathComponents.length = i; - break; - } - } - if (sourcePathComponents.length < commonPathComponents.length) { - commonPathComponents.length = sourcePathComponents.length; - } - } - else { - commonPathComponents = sourcePathComponents; - } - } - }); - commonSourceDirectory = ts.getNormalizedPathFromPathComponents(commonPathComponents); - if (commonSourceDirectory) { - commonSourceDirectory += ts.directorySeparator; - } - } - } - } - ts.createProgram = createProgram; -})(ts || (ts = {})); -var ts; -(function (ts) { - function isInstantiated(node) { - if (node.kind === 175 /* InterfaceDeclaration */) { - return false; - } - else if (node.kind === 179 /* ImportDeclaration */ && !(node.flags & 1 /* Export */)) { - return false; - } - else if (node.kind === 178 /* ModuleBlock */ && !ts.forEachChild(node, isInstantiated)) { - return false; - } - else if (node.kind === 177 /* ModuleDeclaration */ && !isInstantiated(node.body)) { - return false; - } - else { - return true; - } - } - ts.isInstantiated = isInstantiated; - function bindSourceFile(file) { - var parent; - var container; - var lastContainer; - var symbolCount = 0; - var Symbol = ts.objectAllocator.getSymbolConstructor(); - if (!file.locals) { - file.locals = {}; - container = file; - bind(file); - file.symbolCount = symbolCount; - } - function createSymbol(flags, name) { - symbolCount++; - return new Symbol(flags, name); - } - function addDeclarationToSymbol(symbol, node, symbolKind) { - symbol.flags |= symbolKind; - if (!symbol.declarations) - symbol.declarations = []; - symbol.declarations.push(node); - if (symbolKind & ts.SymbolFlags.HasExports && !symbol.exports) - symbol.exports = {}; - if (symbolKind & ts.SymbolFlags.HasMembers && !symbol.members) - symbol.members = {}; - node.symbol = symbol; - if (symbolKind & ts.SymbolFlags.Value && !symbol.valueDeclaration) - symbol.valueDeclaration = node; - } - function getDeclarationName(node) { - if (node.name) { - if (node.kind === 177 /* ModuleDeclaration */ && node.name.kind === 7 /* StringLiteral */) { - return '"' + node.name.text + '"'; - } - return node.name.text; - } - switch (node.kind) { - case 121 /* Constructor */: - return "__constructor"; - case 124 /* CallSignature */: - return "__call"; - case 125 /* ConstructSignature */: - return "__new"; - case 126 /* IndexSignature */: - return "__index"; - } - } - function getDisplayName(node) { - return node.name ? ts.identifierToString(node.name) : getDeclarationName(node); - } - function declareSymbol(symbols, parent, node, includes, excludes) { - var name = getDeclarationName(node); - if (name !== undefined) { - var symbol = ts.hasProperty(symbols, name) ? symbols[name] : (symbols[name] = createSymbol(0, name)); - if (symbol.flags & excludes) { - if (node.name) { - node.name.parent = node; - } - ts.forEach(symbol.declarations, function (declaration) { - file.semanticErrors.push(ts.createDiagnosticForNode(declaration.name, ts.Diagnostics.Duplicate_identifier_0, getDisplayName(declaration))); - }); - file.semanticErrors.push(ts.createDiagnosticForNode(node.name, ts.Diagnostics.Duplicate_identifier_0, getDisplayName(node))); - symbol = createSymbol(0, name); - } - } - else { - symbol = createSymbol(0, "__missing"); - } - addDeclarationToSymbol(symbol, node, includes); - symbol.parent = parent; - if (node.kind === 174 /* ClassDeclaration */ && symbol.exports) { - var prototypeSymbol = createSymbol(2 /* Property */ | 67108864 /* Prototype */, "prototype"); - if (ts.hasProperty(symbol.exports, prototypeSymbol.name)) { - if (node.name) { - node.name.parent = node; - } - file.semanticErrors.push(ts.createDiagnosticForNode(symbol.exports[prototypeSymbol.name].declarations[0], ts.Diagnostics.Duplicate_identifier_0, prototypeSymbol.name)); - } - symbol.exports[prototypeSymbol.name] = prototypeSymbol; - prototypeSymbol.parent = symbol; - } - return symbol; - } - function isAmbientContext(node) { - while (node) { - if (node.flags & 2 /* Ambient */) - return true; - node = node.parent; - } - return false; - } - function declareModuleMember(node, symbolKind, symbolExcludes) { - var exportKind = 0; - if (symbolKind & ts.SymbolFlags.Value) { - exportKind |= 524288 /* ExportValue */; - } - if (symbolKind & ts.SymbolFlags.Type) { - exportKind |= 1048576 /* ExportType */; - } - if (symbolKind & ts.SymbolFlags.Namespace) { - exportKind |= 2097152 /* ExportNamespace */; - } - if (node.flags & 1 /* Export */ || (node.kind !== 179 /* ImportDeclaration */ && isAmbientContext(container))) { - if (exportKind) { - var local = declareSymbol(container.locals, undefined, node, exportKind, symbolExcludes); - local.exportSymbol = declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); - node.localSymbol = local; - } - else { - declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); - } - } - else { - declareSymbol(container.locals, undefined, node, symbolKind, symbolExcludes); - } - } - function bindChildren(node, symbolKind) { - if (symbolKind & ts.SymbolFlags.HasLocals) { - node.locals = {}; - } - var saveParent = parent; - var saveContainer = container; - parent = node; - if (symbolKind & ts.SymbolFlags.IsContainer) { - container = node; - if (lastContainer !== container && !container.nextContainer) { - if (lastContainer) { - lastContainer.nextContainer = container; - } - lastContainer = container; - } - } - ts.forEachChild(node, bind); - container = saveContainer; - parent = saveParent; - } - function bindDeclaration(node, symbolKind, symbolExcludes) { - switch (container.kind) { - case 177 /* ModuleDeclaration */: - declareModuleMember(node, symbolKind, symbolExcludes); - break; - case 182 /* SourceFile */: - if (ts.isExternalModule(container)) { - declareModuleMember(node, symbolKind, symbolExcludes); - break; - } - case 124 /* CallSignature */: - case 125 /* ConstructSignature */: - case 126 /* IndexSignature */: - case 120 /* Method */: - case 121 /* Constructor */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 172 /* FunctionDeclaration */: - case 141 /* FunctionExpression */: - case 142 /* ArrowFunction */: - declareSymbol(container.locals, undefined, node, symbolKind, symbolExcludes); - break; - case 174 /* ClassDeclaration */: - if (node.flags & 128 /* Static */) { - declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); - break; - } - case 129 /* TypeLiteral */: - case 133 /* ObjectLiteral */: - case 175 /* InterfaceDeclaration */: - declareSymbol(container.symbol.members, container.symbol, node, symbolKind, symbolExcludes); - break; - case 176 /* EnumDeclaration */: - declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); - break; - } - bindChildren(node, symbolKind); - } - function bindConstructorDeclaration(node) { - bindDeclaration(node, 4096 /* Constructor */, 0); - ts.forEach(node.parameters, function (p) { - if (p.flags & (16 /* Public */ | 32 /* Private */ | 64 /* Protected */)) { - bindDeclaration(p, 2 /* Property */, ts.SymbolFlags.PropertyExcludes); - } - }); - } - function bindModuleDeclaration(node) { - if (node.name.kind === 7 /* StringLiteral */) { - bindDeclaration(node, 128 /* ValueModule */, ts.SymbolFlags.ValueModuleExcludes); - } - else if (isInstantiated(node)) { - bindDeclaration(node, 128 /* ValueModule */, ts.SymbolFlags.ValueModuleExcludes); - } - else { - bindDeclaration(node, 256 /* NamespaceModule */, 0 /* NamespaceModuleExcludes */); - } - } - function bindAnonymousDeclaration(node, symbolKind, name) { - var symbol = createSymbol(symbolKind, name); - addDeclarationToSymbol(symbol, node, symbolKind); - bindChildren(node, symbolKind); - } - function bindCatchVariableDeclaration(node) { - var symbol = createSymbol(1 /* Variable */, node.variable.text || "__missing"); - addDeclarationToSymbol(symbol, node, 1 /* Variable */); - var saveParent = parent; - parent = node; - ts.forEachChild(node, bind); - parent = saveParent; - } - function bind(node) { - node.parent = parent; - switch (node.kind) { - case 117 /* TypeParameter */: - bindDeclaration(node, 262144 /* TypeParameter */, ts.SymbolFlags.TypeParameterExcludes); - break; - case 118 /* Parameter */: - bindDeclaration(node, 1 /* Variable */, ts.SymbolFlags.ParameterExcludes); - break; - case 171 /* VariableDeclaration */: - bindDeclaration(node, 1 /* Variable */, ts.SymbolFlags.VariableExcludes); - break; - case 119 /* Property */: - case 134 /* PropertyAssignment */: - bindDeclaration(node, 2 /* Property */, ts.SymbolFlags.PropertyExcludes); - break; - case 181 /* EnumMember */: - bindDeclaration(node, 4 /* EnumMember */, ts.SymbolFlags.EnumMemberExcludes); - break; - case 124 /* CallSignature */: - bindDeclaration(node, 32768 /* CallSignature */, 0); - break; - case 120 /* Method */: - bindDeclaration(node, 2048 /* Method */, ts.SymbolFlags.MethodExcludes); - break; - case 125 /* ConstructSignature */: - bindDeclaration(node, 65536 /* ConstructSignature */, 0); - break; - case 126 /* IndexSignature */: - bindDeclaration(node, 131072 /* IndexSignature */, 0); - break; - case 172 /* FunctionDeclaration */: - bindDeclaration(node, 8 /* Function */, ts.SymbolFlags.FunctionExcludes); - break; - case 121 /* Constructor */: - bindConstructorDeclaration(node); - break; - case 122 /* GetAccessor */: - bindDeclaration(node, 8192 /* GetAccessor */, ts.SymbolFlags.GetAccessorExcludes); - break; - case 123 /* SetAccessor */: - bindDeclaration(node, 16384 /* SetAccessor */, ts.SymbolFlags.SetAccessorExcludes); - break; - case 129 /* TypeLiteral */: - bindAnonymousDeclaration(node, 512 /* TypeLiteral */, "__type"); - break; - case 133 /* ObjectLiteral */: - bindAnonymousDeclaration(node, 1024 /* ObjectLiteral */, "__object"); - break; - case 141 /* FunctionExpression */: - case 142 /* ArrowFunction */: - bindAnonymousDeclaration(node, 8 /* Function */, "__function"); - break; - case 168 /* CatchBlock */: - bindCatchVariableDeclaration(node); - break; - case 174 /* ClassDeclaration */: - bindDeclaration(node, 16 /* Class */, ts.SymbolFlags.ClassExcludes); - break; - case 175 /* InterfaceDeclaration */: - bindDeclaration(node, 32 /* Interface */, ts.SymbolFlags.InterfaceExcludes); - break; - case 176 /* EnumDeclaration */: - bindDeclaration(node, 64 /* Enum */, ts.SymbolFlags.EnumExcludes); - break; - case 177 /* ModuleDeclaration */: - bindModuleDeclaration(node); - break; - case 179 /* ImportDeclaration */: - bindDeclaration(node, 4194304 /* Import */, ts.SymbolFlags.ImportExcludes); - break; - case 182 /* SourceFile */: - if (ts.isExternalModule(node)) { - bindAnonymousDeclaration(node, 128 /* ValueModule */, '"' + ts.removeFileExtension(node.filename) + '"'); - break; - } - default: - var saveParent = parent; - parent = node; - ts.forEachChild(node, bind); - parent = saveParent; - } - } - } - ts.bindSourceFile = bindSourceFile; -})(ts || (ts = {})); -var ts; -(function (ts) { - var indentStrings = ["", " "]; - function getIndentString(level) { - if (indentStrings[level] === undefined) { - indentStrings[level] = getIndentString(level - 1) + indentStrings[1]; - } - return indentStrings[level]; - } - ts.getIndentString = getIndentString; - function getIndentSize() { - return indentStrings[1].length; - } - function shouldEmitToOwnFile(sourceFile, compilerOptions) { - if (!ts.isDeclarationFile(sourceFile)) { - if ((ts.isExternalModule(sourceFile) || !compilerOptions.out) && !ts.fileExtensionIs(sourceFile.filename, ".js")) { - return true; - } - return false; - } - return false; - } - ts.shouldEmitToOwnFile = shouldEmitToOwnFile; - function isExternalModuleOrDeclarationFile(sourceFile) { - return ts.isExternalModule(sourceFile) || ts.isDeclarationFile(sourceFile); - } - ts.isExternalModuleOrDeclarationFile = isExternalModuleOrDeclarationFile; - function createTextWriter(newLine, trackSymbol) { - var output = ""; - var indent = 0; - var lineStart = true; - var lineCount = 0; - var linePos = 0; - function write(s) { - if (s && s.length) { - if (lineStart) { - output += getIndentString(indent); - lineStart = false; - } - output += s; - } - } - function rawWrite(s) { - if (s !== undefined) { - if (lineStart) { - lineStart = false; - } - output += s; - } - } - function writeLiteral(s) { - if (s && s.length) { - write(s); - var lineStartsOfS = ts.getLineStarts(s); - if (lineStartsOfS.length > 1) { - lineCount = lineCount + lineStartsOfS.length - 1; - linePos = output.length - s.length + lineStartsOfS[lineStartsOfS.length - 1]; - } - } - } - function writeLine() { - if (!lineStart) { - output += newLine; - lineCount++; - linePos = output.length; - lineStart = true; - } - } - function writeKind(text, kind) { - write(text); - } - function writeSymbol(text, symbol) { - write(text); - } - return { - write: write, - trackSymbol: trackSymbol, - writeKind: writeKind, - writeSymbol: writeSymbol, - rawWrite: rawWrite, - writeLiteral: writeLiteral, - writeLine: writeLine, - increaseIndent: function () { return indent++; }, - decreaseIndent: function () { return indent--; }, - getIndent: function () { return indent; }, - getTextPos: function () { return output.length; }, - getLine: function () { return lineCount + 1; }, - getColumn: function () { return lineStart ? indent * getIndentSize() + 1 : output.length - linePos + 1; }, - getText: function () { return output; }, - clear: function () { - } - }; - } - function getSourceTextOfLocalNode(currentSourceFile, node) { - var text = currentSourceFile.text; - return text.substring(ts.skipTrivia(text, node.pos), node.end); - } - function getLineOfLocalPosition(currentSourceFile, pos) { - return currentSourceFile.getLineAndCharacterFromPosition(pos).line; - } - function emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments) { - if (leadingComments && leadingComments.length && node.pos !== leadingComments[0].pos && getLineOfLocalPosition(currentSourceFile, node.pos) !== getLineOfLocalPosition(currentSourceFile, leadingComments[0].pos)) { - writer.writeLine(); - } - } - function emitComments(currentSourceFile, writer, comments, trailingSeparator, newLine, writeComment) { - var emitLeadingSpace = !trailingSeparator; - ts.forEach(comments, function (comment) { - if (emitLeadingSpace) { - writer.write(" "); - emitLeadingSpace = false; - } - writeComment(currentSourceFile, writer, comment, newLine); - if (comment.hasTrailingNewLine) { - writer.writeLine(); - } - else if (trailingSeparator) { - writer.write(" "); - } - else { - emitLeadingSpace = true; - } - }); - } - function writeCommentRange(currentSourceFile, writer, comment, newLine) { - if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 42 /* asterisk */) { - var firstCommentLineAndCharacter = currentSourceFile.getLineAndCharacterFromPosition(comment.pos); - var firstCommentLineIndent; - for (var pos = comment.pos, currentLine = firstCommentLineAndCharacter.line; pos < comment.end; currentLine++) { - var nextLineStart = currentSourceFile.getPositionFromLineAndCharacter(currentLine + 1, 1); - if (pos !== comment.pos) { - if (firstCommentLineIndent === undefined) { - firstCommentLineIndent = calculateIndent(currentSourceFile.getPositionFromLineAndCharacter(firstCommentLineAndCharacter.line, 1), comment.pos); - } - var currentWriterIndentSpacing = writer.getIndent() * getIndentSize(); - var spacesToEmit = currentWriterIndentSpacing - firstCommentLineIndent + calculateIndent(pos, nextLineStart); - if (spacesToEmit > 0) { - var numberOfSingleSpacesToEmit = spacesToEmit % getIndentSize(); - var indentSizeSpaceString = getIndentString((spacesToEmit - numberOfSingleSpacesToEmit) / getIndentSize()); - writer.rawWrite(indentSizeSpaceString); - while (numberOfSingleSpacesToEmit) { - writer.rawWrite(" "); - numberOfSingleSpacesToEmit--; - } - } - else { - writer.rawWrite(""); - } - } - writeTrimmedCurrentLine(pos, nextLineStart); - pos = nextLineStart; - } - } - else { - writer.write(currentSourceFile.text.substring(comment.pos, comment.end)); - } - function writeTrimmedCurrentLine(pos, nextLineStart) { - var end = Math.min(comment.end, nextLineStart - 1); - var currentLineText = currentSourceFile.text.substring(pos, end).replace(/^\s+|\s+$/g, ''); - if (currentLineText) { - writer.write(currentLineText); - if (end !== comment.end) { - writer.writeLine(); - } - } - else { - writer.writeLiteral(newLine); - } - } - function calculateIndent(pos, end) { - var currentLineIndent = 0; - for (; pos < end && ts.isWhiteSpace(currentSourceFile.text.charCodeAt(pos)); pos++) { - if (currentSourceFile.text.charCodeAt(pos) === 9 /* tab */) { - currentLineIndent += getIndentSize() - (currentLineIndent % getIndentSize()); - } - else { - currentLineIndent++; - } - } - return currentLineIndent; - } - } - function getFirstConstructorWithBody(node) { - return ts.forEach(node.members, function (member) { - if (member.kind === 121 /* Constructor */ && member.body) { - return member; - } - }); - } - function getAllAccessorDeclarations(node, accessor) { - var firstAccessor; - var getAccessor; - var setAccessor; - ts.forEach(node.members, function (member) { - if ((member.kind === 122 /* GetAccessor */ || member.kind === 123 /* SetAccessor */) && member.name.text === accessor.name.text && (member.flags & 128 /* Static */) === (accessor.flags & 128 /* Static */)) { - if (!firstAccessor) { - firstAccessor = member; - } - if (member.kind === 122 /* GetAccessor */ && !getAccessor) { - getAccessor = member; - } - if (member.kind === 123 /* SetAccessor */ && !setAccessor) { - setAccessor = member; - } - } - }); - return { - firstAccessor: firstAccessor, - getAccessor: getAccessor, - setAccessor: setAccessor - }; - } - function getSourceFilePathInNewDir(sourceFile, program, newDirPath) { - var compilerHost = program.getCompilerHost(); - var sourceFilePath = ts.getNormalizedPathFromPathComponents(ts.getNormalizedPathComponents(sourceFile.filename, compilerHost.getCurrentDirectory())); - sourceFilePath = sourceFilePath.replace(program.getCommonSourceDirectory(), ""); - return ts.combinePaths(newDirPath, sourceFilePath); - } - function getOwnEmitOutputFilePath(sourceFile, program, extension) { - var compilerOptions = program.getCompilerOptions(); - if (compilerOptions.outDir) { - var emitOutputFilePathWithoutExtension = ts.removeFileExtension(getSourceFilePathInNewDir(sourceFile, program, compilerOptions.outDir)); - } - else { - var emitOutputFilePathWithoutExtension = ts.removeFileExtension(sourceFile.filename); - } - return emitOutputFilePathWithoutExtension + extension; - } - function writeFile(compilerHost, diagnostics, filename, data, writeByteOrderMark) { - compilerHost.writeFile(filename, data, writeByteOrderMark, function (hostErrorMessage) { - diagnostics.push(ts.createCompilerDiagnostic(ts.Diagnostics.Could_not_write_file_0_Colon_1, filename, hostErrorMessage)); - }); - } - function emitDeclarations(program, resolver, diagnostics, jsFilePath, root) { - var newLine = program.getCompilerHost().getNewLine(); - var compilerOptions = program.getCompilerOptions(); - var compilerHost = program.getCompilerHost(); - var writer = createTextWriter(newLine, trackSymbol); - var write = writer.write; - var writeLine = writer.writeLine; - var increaseIndent = writer.increaseIndent; - var decreaseIndent = writer.decreaseIndent; - var enclosingDeclaration; - var currentSourceFile; - var reportedDeclarationError = false; - var emitJsDocComments = compilerOptions.removeComments ? function (declaration) { - } : writeJsDocComments; - var aliasDeclarationEmitInfo = []; - var getSymbolVisibilityDiagnosticMessage; - function writeAsychronousImportDeclarations(importDeclarations) { - var oldWriter = writer; - ts.forEach(importDeclarations, function (aliasToWrite) { - var aliasEmitInfo = ts.forEach(aliasDeclarationEmitInfo, function (declEmitInfo) { return declEmitInfo.declaration === aliasToWrite ? declEmitInfo : undefined; }); - if (aliasEmitInfo) { - writer = createTextWriter(newLine, trackSymbol); - for (var declarationIndent = aliasEmitInfo.indent; declarationIndent; declarationIndent--) { - writer.increaseIndent(); - } - writeImportDeclaration(aliasToWrite); - aliasEmitInfo.asynchronousOutput = writer.getText(); - } - }); - writer = oldWriter; - } - function trackSymbol(symbol, enclosingDeclaration, meaning) { - var symbolAccesibilityResult = resolver.isSymbolAccessible(symbol, enclosingDeclaration, meaning); - if (symbolAccesibilityResult.accessibility === 0 /* Accessible */) { - if (symbolAccesibilityResult && symbolAccesibilityResult.aliasesToMakeVisible) { - writeAsychronousImportDeclarations(symbolAccesibilityResult.aliasesToMakeVisible); - } - } - else { - reportedDeclarationError = true; - var errorInfo = getSymbolVisibilityDiagnosticMessage(symbolAccesibilityResult); - if (errorInfo) { - if (errorInfo.typeName) { - diagnostics.push(ts.createDiagnosticForNode(errorInfo.errorNode, errorInfo.diagnosticMessage, getSourceTextOfLocalNode(currentSourceFile, errorInfo.typeName), symbolAccesibilityResult.errorSymbolName, symbolAccesibilityResult.errorModuleName)); - } - else { - diagnostics.push(ts.createDiagnosticForNode(errorInfo.errorNode, errorInfo.diagnosticMessage, symbolAccesibilityResult.errorSymbolName, symbolAccesibilityResult.errorModuleName)); - } - } - } - } - function emitLines(nodes) { - for (var i = 0, n = nodes.length; i < n; i++) { - emitNode(nodes[i]); - } - } - function emitCommaList(nodes, eachNodeEmitFn) { - var currentWriterPos = writer.getTextPos(); - for (var i = 0, n = nodes.length; i < n; i++) { - if (currentWriterPos !== writer.getTextPos()) { - write(", "); - } - currentWriterPos = writer.getTextPos(); - eachNodeEmitFn(nodes[i]); - } - } - function writeJsDocComments(declaration) { - if (declaration) { - var jsDocComments = ts.getJsDocComments(declaration, currentSourceFile); - emitNewLineBeforeLeadingComments(currentSourceFile, writer, declaration, jsDocComments); - emitComments(currentSourceFile, writer, jsDocComments, true, newLine, writeCommentRange); - } - } - function emitSourceTextOfNode(node) { - write(getSourceTextOfLocalNode(currentSourceFile, node)); - } - function emitSourceFile(node) { - currentSourceFile = node; - enclosingDeclaration = node; - emitLines(node.statements); - } - function emitExportAssignment(node) { - write("export = "); - emitSourceTextOfNode(node.exportName); - write(";"); - writeLine(); - } - function emitDeclarationFlags(node) { - if (node.flags & 128 /* Static */) { - if (node.flags & 32 /* Private */) { - write("private "); - } - else if (node.flags & 64 /* Protected */) { - write("protected "); - } - write("static "); - } - else { - if (node.flags & 32 /* Private */) { - write("private "); - } - else if (node.flags & 64 /* Protected */) { - write("protected "); - } - else if (node.parent === currentSourceFile) { - if (node.flags & 1 /* Export */) { - write("export "); - } - if (node.kind !== 175 /* InterfaceDeclaration */) { - write("declare "); - } - } - } - } - function emitImportDeclaration(node) { - var nodeEmitInfo = { - declaration: node, - outputPos: writer.getTextPos(), - indent: writer.getIndent(), - hasWritten: resolver.isDeclarationVisible(node) - }; - aliasDeclarationEmitInfo.push(nodeEmitInfo); - if (nodeEmitInfo.hasWritten) { - writeImportDeclaration(node); - } - } - function writeImportDeclaration(node) { - emitJsDocComments(node); - if (node.flags & 1 /* Export */) { - writer.write("export "); - } - writer.write("import "); - writer.write(getSourceTextOfLocalNode(currentSourceFile, node.name)); - writer.write(" = "); - if (node.entityName) { - checkEntityNameAccessible(); - writer.write(getSourceTextOfLocalNode(currentSourceFile, node.entityName)); - writer.write(";"); - } - else { - writer.write("require("); - writer.write(getSourceTextOfLocalNode(currentSourceFile, node.externalModuleName)); - writer.write(");"); - } - writer.writeLine(); - function checkEntityNameAccessible() { - var symbolAccesibilityResult = resolver.isImportDeclarationEntityNameReferenceDeclarationVisible(node.entityName); - if (symbolAccesibilityResult.accessibility === 0 /* Accessible */) { - if (symbolAccesibilityResult.aliasesToMakeVisible) { - writeAsychronousImportDeclarations(symbolAccesibilityResult.aliasesToMakeVisible); - } - } - else { - reportedDeclarationError = true; - diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.Import_declaration_0_is_using_private_name_1, getSourceTextOfLocalNode(currentSourceFile, node.name), symbolAccesibilityResult.errorSymbolName)); - } - } - } - function emitModuleDeclaration(node) { - if (resolver.isDeclarationVisible(node)) { - emitJsDocComments(node); - emitDeclarationFlags(node); - write("module "); - emitSourceTextOfNode(node.name); - while (node.body.kind !== 178 /* ModuleBlock */) { - node = node.body; - write("."); - emitSourceTextOfNode(node.name); - } - var prevEnclosingDeclaration = enclosingDeclaration; - enclosingDeclaration = node; - write(" {"); - writeLine(); - increaseIndent(); - emitLines(node.body.statements); - decreaseIndent(); - write("}"); - writeLine(); - enclosingDeclaration = prevEnclosingDeclaration; - } - } - function emitEnumDeclaration(node) { - if (resolver.isDeclarationVisible(node)) { - emitJsDocComments(node); - emitDeclarationFlags(node); - write("enum "); - emitSourceTextOfNode(node.name); - write(" {"); - writeLine(); - increaseIndent(); - emitLines(node.members); - decreaseIndent(); - write("}"); - writeLine(); - } - } - function emitEnumMemberDeclaration(node) { - emitJsDocComments(node); - emitSourceTextOfNode(node.name); - var enumMemberValue = resolver.getEnumMemberValue(node); - if (enumMemberValue !== undefined) { - write(" = "); - write(enumMemberValue.toString()); - } - write(","); - writeLine(); - } - function emitTypeParameters(typeParameters) { - function emitTypeParameter(node) { - function getTypeParameterConstraintVisibilityError(symbolAccesibilityResult) { - var diagnosticMessage; - switch (node.parent.kind) { - case 174 /* ClassDeclaration */: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; - break; - case 175 /* InterfaceDeclaration */: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; - break; - case 125 /* ConstructSignature */: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; - break; - case 124 /* CallSignature */: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; - break; - case 120 /* Method */: - if (node.parent.flags & 128 /* Static */) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; - } - else if (node.parent.parent.kind === 174 /* ClassDeclaration */) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; - } - else { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; - } - break; - case 172 /* FunctionDeclaration */: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; - break; - default: - ts.Debug.fail("This is unknown parent for type parameter: " + ts.SyntaxKind[node.parent.kind]); - } - return { - diagnosticMessage: diagnosticMessage, - errorNode: node, - typeName: node.name - }; - } - increaseIndent(); - emitJsDocComments(node); - decreaseIndent(); - emitSourceTextOfNode(node.name); - if (node.constraint && (node.parent.kind !== 120 /* Method */ || !(node.parent.flags & 32 /* Private */))) { - write(" extends "); - getSymbolVisibilityDiagnosticMessage = getTypeParameterConstraintVisibilityError; - resolver.writeTypeAtLocation(node.constraint, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); - } - } - if (typeParameters) { - write("<"); - emitCommaList(typeParameters, emitTypeParameter); - write(">"); - } - } - function emitHeritageClause(typeReferences, isImplementsList) { - if (typeReferences) { - write(isImplementsList ? " implements " : " extends "); - emitCommaList(typeReferences, emitTypeOfTypeReference); - } - function emitTypeOfTypeReference(node) { - getSymbolVisibilityDiagnosticMessage = getHeritageClauseVisibilityError; - resolver.writeTypeAtLocation(node, enclosingDeclaration, 1 /* WriteArrayAsGenericType */ | 2 /* UseTypeOfFunction */, writer); - function getHeritageClauseVisibilityError(symbolAccesibilityResult) { - var diagnosticMessage; - if (node.parent.kind === 174 /* ClassDeclaration */) { - if (symbolAccesibilityResult.errorModuleName) { - diagnosticMessage = isImplementsList ? ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Extends_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2; - } - else { - diagnosticMessage = isImplementsList ? ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : ts.Diagnostics.Extends_clause_of_exported_class_0_has_or_is_using_private_name_1; - } - } - else { - if (symbolAccesibilityResult.errorModuleName) { - diagnosticMessage = ts.Diagnostics.Extends_clause_of_exported_interface_0_has_or_is_using_name_1_from_private_module_2; - } - else { - diagnosticMessage = ts.Diagnostics.Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1; - } - } - return { - diagnosticMessage: diagnosticMessage, - errorNode: node, - typeName: node.parent.name - }; - } - } - } - function emitClassDeclaration(node) { - function emitParameterProperties(constructorDeclaration) { - if (constructorDeclaration) { - ts.forEach(constructorDeclaration.parameters, function (param) { - if (param.flags & ts.NodeFlags.AccessibilityModifier) { - emitPropertyDeclaration(param); - } - }); - } - } - if (resolver.isDeclarationVisible(node)) { - emitJsDocComments(node); - emitDeclarationFlags(node); - write("class "); - emitSourceTextOfNode(node.name); - var prevEnclosingDeclaration = enclosingDeclaration; - enclosingDeclaration = node; - emitTypeParameters(node.typeParameters); - if (node.baseType) { - emitHeritageClause([node.baseType], false); - } - emitHeritageClause(node.implementedTypes, true); - write(" {"); - writeLine(); - increaseIndent(); - emitParameterProperties(getFirstConstructorWithBody(node)); - emitLines(node.members); - decreaseIndent(); - write("}"); - writeLine(); - enclosingDeclaration = prevEnclosingDeclaration; - } - } - function emitInterfaceDeclaration(node) { - if (resolver.isDeclarationVisible(node)) { - emitJsDocComments(node); - emitDeclarationFlags(node); - write("interface "); - emitSourceTextOfNode(node.name); - var prevEnclosingDeclaration = enclosingDeclaration; - enclosingDeclaration = node; - emitTypeParameters(node.typeParameters); - emitHeritageClause(node.baseTypes, false); - write(" {"); - writeLine(); - increaseIndent(); - emitLines(node.members); - decreaseIndent(); - write("}"); - writeLine(); - enclosingDeclaration = prevEnclosingDeclaration; - } - } - function emitPropertyDeclaration(node) { - emitJsDocComments(node); - emitDeclarationFlags(node); - emitVariableDeclaration(node); - write(";"); - writeLine(); - } - function emitVariableDeclaration(node) { - if (node.kind !== 171 /* VariableDeclaration */ || resolver.isDeclarationVisible(node)) { - emitSourceTextOfNode(node.name); - if (node.kind === 119 /* Property */ && (node.flags & 4 /* QuestionMark */)) { - write("?"); - } - if (!(node.flags & 32 /* Private */)) { - write(": "); - getSymbolVisibilityDiagnosticMessage = getVariableDeclarationTypeVisibilityError; - resolver.writeTypeAtLocation(node, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); - } - } - function getVariableDeclarationTypeVisibilityError(symbolAccesibilityResult) { - var diagnosticMessage; - if (node.kind === 171 /* VariableDeclaration */) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Exported_variable_0_has_or_is_using_private_name_1; - } - else if (node.kind === 119 /* Property */) { - if (node.flags & 128 /* Static */) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; - } - else if (node.parent.kind === 174 /* ClassDeclaration */) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1; - } - else { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Property_0_of_exported_interface_has_or_is_using_private_name_1; - } - } - return diagnosticMessage !== undefined ? { - diagnosticMessage: diagnosticMessage, - errorNode: node, - typeName: node.name - } : undefined; - } - } - function emitVariableStatement(node) { - var hasDeclarationWithEmit = ts.forEach(node.declarations, function (varDeclaration) { return resolver.isDeclarationVisible(varDeclaration); }); - if (hasDeclarationWithEmit) { - emitJsDocComments(node); - emitDeclarationFlags(node); - write("var "); - emitCommaList(node.declarations, emitVariableDeclaration); - write(";"); - writeLine(); - } - } - function emitAccessorDeclaration(node) { - var accessors = getAllAccessorDeclarations(node.parent, node); - if (node === accessors.firstAccessor) { - emitJsDocComments(accessors.getAccessor); - emitJsDocComments(accessors.setAccessor); - emitDeclarationFlags(node); - emitSourceTextOfNode(node.name); - if (!(node.flags & 32 /* Private */)) { - write(": "); - getSymbolVisibilityDiagnosticMessage = getAccessorDeclarationTypeVisibilityError; - resolver.writeTypeAtLocation(node, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); - } - write(";"); - writeLine(); - } - function getAccessorDeclarationTypeVisibilityError(symbolAccesibilityResult) { - var diagnosticMessage; - if (node.kind === 123 /* SetAccessor */) { - if (node.parent.flags & 128 /* Static */) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1; - } - else { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_name_1; - } - return { - diagnosticMessage: diagnosticMessage, - errorNode: node.parameters[0], - typeName: node.name - }; - } - else { - if (node.flags & 128 /* Static */) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts.Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_name_0; - } - else { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts.Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_name_0; - } - return { - diagnosticMessage: diagnosticMessage, - errorNode: node.name, - typeName: undefined - }; - } - } - } - function emitFunctionDeclaration(node) { - if ((node.kind !== 172 /* FunctionDeclaration */ || resolver.isDeclarationVisible(node)) && !resolver.isImplementationOfOverload(node)) { - emitJsDocComments(node); - emitDeclarationFlags(node); - if (node.kind === 172 /* FunctionDeclaration */) { - write("function "); - emitSourceTextOfNode(node.name); - } - else if (node.kind === 121 /* Constructor */) { - write("constructor"); - } - else { - emitSourceTextOfNode(node.name); - if (node.flags & 4 /* QuestionMark */) { - write("?"); - } - } - emitSignatureDeclaration(node); - } - } - function emitConstructSignatureDeclaration(node) { - emitJsDocComments(node); - write("new "); - emitSignatureDeclaration(node); - } - function emitSignatureDeclaration(node) { - if (node.kind === 124 /* CallSignature */ || node.kind === 126 /* IndexSignature */) { - emitJsDocComments(node); - } - emitTypeParameters(node.typeParameters); - if (node.kind === 126 /* IndexSignature */) { - write("["); - } - else { - write("("); - } - emitCommaList(node.parameters, emitParameterDeclaration); - if (node.kind === 126 /* IndexSignature */) { - write("]"); - } - else { - write(")"); - } - if (node.kind !== 121 /* Constructor */ && !(node.flags & 32 /* Private */)) { - write(": "); - getSymbolVisibilityDiagnosticMessage = getReturnTypeVisibilityError; - resolver.writeReturnTypeOfSignatureDeclaration(node, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); - } - write(";"); - writeLine(); - function getReturnTypeVisibilityError(symbolAccesibilityResult) { - var diagnosticMessage; - switch (node.kind) { - case 125 /* ConstructSignature */: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0; - break; - case 124 /* CallSignature */: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0; - break; - case 126 /* IndexSignature */: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0; - break; - case 120 /* Method */: - if (node.flags & 128 /* Static */) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0; - } - else if (node.parent.kind === 174 /* ClassDeclaration */) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0; - } - else { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; - } - break; - case 172 /* FunctionDeclaration */: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_private_name_0; - break; - default: - ts.Debug.fail("This is unknown kind for signature: " + ts.SyntaxKind[node.kind]); - } - return { - diagnosticMessage: diagnosticMessage, - errorNode: node.name || node - }; - } - } - function emitParameterDeclaration(node) { - increaseIndent(); - emitJsDocComments(node); - if (node.flags & 8 /* Rest */) { - write("..."); - } - emitSourceTextOfNode(node.name); - if (node.initializer || (node.flags & 4 /* QuestionMark */)) { - write("?"); - } - decreaseIndent(); - if (!(node.parent.flags & 32 /* Private */)) { - write(": "); - getSymbolVisibilityDiagnosticMessage = getParameterDeclarationTypeVisibilityError; - resolver.writeTypeAtLocation(node, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); - } - function getParameterDeclarationTypeVisibilityError(symbolAccesibilityResult) { - var diagnosticMessage; - switch (node.parent.kind) { - case 121 /* Constructor */: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1; - break; - case 125 /* ConstructSignature */: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; - break; - case 124 /* CallSignature */: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; - break; - case 120 /* Method */: - if (node.parent.flags & 128 /* Static */) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; - } - else if (node.parent.parent.kind === 174 /* ClassDeclaration */) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; - } - else { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; - } - break; - case 172 /* FunctionDeclaration */: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1; - break; - default: - ts.Debug.fail("This is unknown parent for parameter: " + ts.SyntaxKind[node.parent.kind]); - } - return { - diagnosticMessage: diagnosticMessage, - errorNode: node, - typeName: node.name - }; - } - } - function emitNode(node) { - switch (node.kind) { - case 121 /* Constructor */: - case 172 /* FunctionDeclaration */: - case 120 /* Method */: - return emitFunctionDeclaration(node); - case 125 /* ConstructSignature */: - return emitConstructSignatureDeclaration(node); - case 124 /* CallSignature */: - case 126 /* IndexSignature */: - return emitSignatureDeclaration(node); - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - return emitAccessorDeclaration(node); - case 149 /* VariableStatement */: - return emitVariableStatement(node); - case 119 /* Property */: - return emitPropertyDeclaration(node); - case 175 /* InterfaceDeclaration */: - return emitInterfaceDeclaration(node); - case 174 /* ClassDeclaration */: - return emitClassDeclaration(node); - case 181 /* EnumMember */: - return emitEnumMemberDeclaration(node); - case 176 /* EnumDeclaration */: - return emitEnumDeclaration(node); - case 177 /* ModuleDeclaration */: - return emitModuleDeclaration(node); - case 179 /* ImportDeclaration */: - return emitImportDeclaration(node); - case 180 /* ExportAssignment */: - return emitExportAssignment(node); - case 182 /* SourceFile */: - return emitSourceFile(node); - } - } - function tryResolveScriptReference(sourceFile, reference) { - var referenceFileName = ts.normalizePath(ts.combinePaths(ts.getDirectoryPath(sourceFile.filename), reference.filename)); - return program.getSourceFile(referenceFileName); - } - var referencePathsOutput = ""; - function writeReferencePath(referencedFile) { - var declFileName = referencedFile.flags & 1024 /* DeclarationFile */ ? referencedFile.filename : shouldEmitToOwnFile(referencedFile, compilerOptions) ? getOwnEmitOutputFilePath(referencedFile, program, ".d.ts") : ts.removeFileExtension(compilerOptions.out) + ".d.ts"; - declFileName = ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizeSlashes(jsFilePath)), declFileName, compilerHost.getCurrentDirectory(), compilerHost.getCanonicalFileName, false); - referencePathsOutput += "/// " + newLine; - } - if (root) { - if (!compilerOptions.noResolve) { - var addedGlobalFileReference = false; - ts.forEach(root.referencedFiles, function (fileReference) { - var referencedFile = tryResolveScriptReference(root, fileReference); - if (referencedFile && ((referencedFile.flags & 1024 /* DeclarationFile */) || shouldEmitToOwnFile(referencedFile, compilerOptions) || !addedGlobalFileReference)) { - writeReferencePath(referencedFile); - if (!isExternalModuleOrDeclarationFile(referencedFile)) { - addedGlobalFileReference = true; - } - } - }); - } - emitNode(root); - } - else { - var emittedReferencedFiles = []; - ts.forEach(program.getSourceFiles(), function (sourceFile) { - if (!isExternalModuleOrDeclarationFile(sourceFile)) { - if (!compilerOptions.noResolve) { - ts.forEach(sourceFile.referencedFiles, function (fileReference) { - var referencedFile = tryResolveScriptReference(sourceFile, fileReference); - if (referencedFile && (isExternalModuleOrDeclarationFile(referencedFile) && !ts.contains(emittedReferencedFiles, referencedFile))) { - writeReferencePath(referencedFile); - emittedReferencedFiles.push(referencedFile); - } - }); - } - emitNode(sourceFile); - } - }); - } - return { - reportedDeclarationError: reportedDeclarationError, - aliasDeclarationEmitInfo: aliasDeclarationEmitInfo, - synchronousDeclarationOutput: writer.getText(), - declarationOutput: referencePathsOutput - }; - } - function writeDeclarationToFile(compilerHost, compilerOptions, diagnostics, aliasDeclarationEmitInfo, synchronousDeclarationOutput, jsFilePath, declarationOutput) { - var appliedSyncOutputPos = 0; - ts.forEach(aliasDeclarationEmitInfo, function (aliasEmitInfo) { - if (aliasEmitInfo.asynchronousOutput) { - declarationOutput += synchronousDeclarationOutput.substring(appliedSyncOutputPos, aliasEmitInfo.outputPos); - declarationOutput += aliasEmitInfo.asynchronousOutput; - appliedSyncOutputPos = aliasEmitInfo.outputPos; - } - }); - declarationOutput += synchronousDeclarationOutput.substring(appliedSyncOutputPos); - writeFile(compilerHost, diagnostics, ts.removeFileExtension(jsFilePath) + ".d.ts", declarationOutput, compilerOptions.emitBOM); - } - function getDeclarationDiagnostics(program, resolver, targetSourceFile) { - var diagnostics = []; - var jsFilePath = getOwnEmitOutputFilePath(targetSourceFile, program, ".js"); - emitDeclarations(program, resolver, diagnostics, jsFilePath, targetSourceFile); - return diagnostics; - } - ts.getDeclarationDiagnostics = getDeclarationDiagnostics; - function emitFiles(resolver, targetSourceFile) { - var program = resolver.getProgram(); - var compilerHost = program.getCompilerHost(); - var compilerOptions = program.getCompilerOptions(); - var sourceMapDataList = compilerOptions.sourceMap ? [] : undefined; - var diagnostics = []; - var newLine = program.getCompilerHost().getNewLine(); - function emitJavaScript(jsFilePath, root) { - var writer = createTextWriter(newLine, trackSymbol); - var write = writer.write; - var writeLine = writer.writeLine; - var increaseIndent = writer.increaseIndent; - var decreaseIndent = writer.decreaseIndent; - var currentSourceFile; - var extendsEmitted = false; - var writeEmittedFiles = writeJavaScriptFile; - var emitLeadingComments = compilerOptions.removeComments ? function (node) { - } : emitLeadingDeclarationComments; - var emitTrailingComments = compilerOptions.removeComments ? function (node) { - } : emitTrailingDeclarationComments; - var emitLeadingCommentsOfPosition = compilerOptions.removeComments ? function (pos) { - } : emitLeadingCommentsOfLocalPosition; - var detachedCommentsInfo; - var emitDetachedComments = compilerOptions.removeComments ? function (node) { - } : emitDetachedCommentsAtPosition; - var emitPinnedOrTripleSlashComments = compilerOptions.removeComments ? function (node) { - } : emitPinnedOrTripleSlashCommentsOfNode; - var writeComment = writeCommentRange; - var emit = emitNode; - var emitStart = function (node) { - }; - var emitEnd = function (node) { - }; - var emitToken = emitTokenText; - var scopeEmitStart = function (scopeDeclaration, scopeName) { - }; - var scopeEmitEnd = function () { - }; - var sourceMapData; - function trackSymbol(symbol, enclosingDeclaration, meaning) { - } - function initializeEmitterWithSourceMaps() { - var sourceMapDir; - var sourceMapSourceIndex = -1; - var sourceMapNameIndexMap = {}; - var sourceMapNameIndices = []; - function getSourceMapNameIndex() { - return sourceMapNameIndices.length ? sourceMapNameIndices[sourceMapNameIndices.length - 1] : -1; - } - var lastRecordedSourceMapSpan; - var lastEncodedSourceMapSpan = { - emittedLine: 1, - emittedColumn: 1, - sourceLine: 1, - sourceColumn: 1, - sourceIndex: 0 - }; - var lastEncodedNameIndex = 0; - function encodeLastRecordedSourceMapSpan() { - if (!lastRecordedSourceMapSpan || lastRecordedSourceMapSpan === lastEncodedSourceMapSpan) { - return; - } - var prevEncodedEmittedColumn = lastEncodedSourceMapSpan.emittedColumn; - if (lastEncodedSourceMapSpan.emittedLine == lastRecordedSourceMapSpan.emittedLine) { - if (sourceMapData.sourceMapMappings) { - sourceMapData.sourceMapMappings += ","; - } - } - else { - for (var encodedLine = lastEncodedSourceMapSpan.emittedLine; encodedLine < lastRecordedSourceMapSpan.emittedLine; encodedLine++) { - sourceMapData.sourceMapMappings += ";"; - } - prevEncodedEmittedColumn = 1; - } - sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.emittedColumn - prevEncodedEmittedColumn); - sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceIndex - lastEncodedSourceMapSpan.sourceIndex); - sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceLine - lastEncodedSourceMapSpan.sourceLine); - sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceColumn - lastEncodedSourceMapSpan.sourceColumn); - if (lastRecordedSourceMapSpan.nameIndex >= 0) { - sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.nameIndex - lastEncodedNameIndex); - lastEncodedNameIndex = lastRecordedSourceMapSpan.nameIndex; - } - lastEncodedSourceMapSpan = lastRecordedSourceMapSpan; - sourceMapData.sourceMapDecodedMappings.push(lastEncodedSourceMapSpan); - function base64VLQFormatEncode(inValue) { - function base64FormatEncode(inValue) { - if (inValue < 64) { - return 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.charAt(inValue); - } - throw TypeError(inValue + ": not a 64 based value"); - } - if (inValue < 0) { - inValue = ((-inValue) << 1) + 1; - } - else { - inValue = inValue << 1; - } - var encodedStr = ""; - do { - var currentDigit = inValue & 31; - inValue = inValue >> 5; - if (inValue > 0) { - currentDigit = currentDigit | 32; - } - encodedStr = encodedStr + base64FormatEncode(currentDigit); - } while (inValue > 0); - return encodedStr; - } - } - function recordSourceMapSpan(pos) { - var sourceLinePos = currentSourceFile.getLineAndCharacterFromPosition(pos); - var emittedLine = writer.getLine(); - var emittedColumn = writer.getColumn(); - if (!lastRecordedSourceMapSpan || lastRecordedSourceMapSpan.emittedLine != emittedLine || lastRecordedSourceMapSpan.emittedColumn != emittedColumn || (lastRecordedSourceMapSpan.sourceIndex === sourceMapSourceIndex && (lastRecordedSourceMapSpan.sourceLine > sourceLinePos.line || (lastRecordedSourceMapSpan.sourceLine === sourceLinePos.line && lastRecordedSourceMapSpan.sourceColumn > sourceLinePos.character)))) { - encodeLastRecordedSourceMapSpan(); - lastRecordedSourceMapSpan = { - emittedLine: emittedLine, - emittedColumn: emittedColumn, - sourceLine: sourceLinePos.line, - sourceColumn: sourceLinePos.character, - nameIndex: getSourceMapNameIndex(), - sourceIndex: sourceMapSourceIndex - }; - } - else { - lastRecordedSourceMapSpan.sourceLine = sourceLinePos.line; - lastRecordedSourceMapSpan.sourceColumn = sourceLinePos.character; - lastRecordedSourceMapSpan.sourceIndex = sourceMapSourceIndex; - } - } - function recordEmitNodeStartSpan(node) { - recordSourceMapSpan(ts.skipTrivia(currentSourceFile.text, node.pos)); - } - function recordEmitNodeEndSpan(node) { - recordSourceMapSpan(node.end); - } - function writeTextWithSpanRecord(tokenKind, startPos, emitFn) { - var tokenStartPos = ts.skipTrivia(currentSourceFile.text, startPos); - recordSourceMapSpan(tokenStartPos); - var tokenEndPos = emitTokenText(tokenKind, tokenStartPos, emitFn); - recordSourceMapSpan(tokenEndPos); - return tokenEndPos; - } - function recordNewSourceFileStart(node) { - var sourcesDirectoryPath = compilerOptions.sourceRoot ? program.getCommonSourceDirectory() : sourceMapDir; - sourceMapData.sourceMapSources.push(ts.getRelativePathToDirectoryOrUrl(sourcesDirectoryPath, node.filename, compilerHost.getCurrentDirectory(), compilerHost.getCanonicalFileName, true)); - sourceMapSourceIndex = sourceMapData.sourceMapSources.length - 1; - sourceMapData.inputSourceFileNames.push(node.filename); - } - function recordScopeNameOfNode(node, scopeName) { - function recordScopeNameIndex(scopeNameIndex) { - sourceMapNameIndices.push(scopeNameIndex); - } - function recordScopeNameStart(scopeName) { - var scopeNameIndex = -1; - if (scopeName) { - var parentIndex = getSourceMapNameIndex(); - if (parentIndex !== -1) { - scopeName = sourceMapData.sourceMapNames[parentIndex] + "." + scopeName; - } - scopeNameIndex = ts.getProperty(sourceMapNameIndexMap, scopeName); - if (scopeNameIndex === undefined) { - scopeNameIndex = sourceMapData.sourceMapNames.length; - sourceMapData.sourceMapNames.push(scopeName); - sourceMapNameIndexMap[scopeName] = scopeNameIndex; - } - } - recordScopeNameIndex(scopeNameIndex); - } - if (scopeName) { - recordScopeNameStart(scopeName); - } - else if (node.kind === 172 /* FunctionDeclaration */ || node.kind === 141 /* FunctionExpression */ || node.kind === 120 /* Method */ || node.kind === 122 /* GetAccessor */ || node.kind === 123 /* SetAccessor */ || node.kind === 177 /* ModuleDeclaration */ || node.kind === 174 /* ClassDeclaration */ || node.kind === 176 /* EnumDeclaration */) { - if (node.name) { - scopeName = node.name.text; - } - recordScopeNameStart(scopeName); - } - else { - recordScopeNameIndex(getSourceMapNameIndex()); - } - } - function recordScopeNameEnd() { - sourceMapNameIndices.pop(); - } - ; - function writeCommentRangeWithMap(curentSourceFile, writer, comment, newLine) { - recordSourceMapSpan(comment.pos); - writeCommentRange(currentSourceFile, writer, comment, newLine); - recordSourceMapSpan(comment.end); - } - function serializeSourceMapContents(version, file, sourceRoot, sources, names, mappings) { - if (typeof JSON !== "undefined") { - return JSON.stringify({ - version: version, - file: file, - sourceRoot: sourceRoot, - sources: sources, - names: names, - mappings: mappings - }); - } - return "{\"version\":" + version + ",\"file\":\"" + ts.escapeString(file) + "\",\"sourceRoot\":\"" + ts.escapeString(sourceRoot) + "\",\"sources\":[" + serializeStringArray(sources) + "],\"names\":[" + serializeStringArray(names) + "],\"mappings\":\"" + ts.escapeString(mappings) + "\"}"; - function serializeStringArray(list) { - var output = ""; - for (var i = 0, n = list.length; i < n; i++) { - if (i) { - output += ","; - } - output += "\"" + ts.escapeString(list[i]) + "\""; - } - return output; - } - } - function writeJavaScriptAndSourceMapFile(emitOutput, writeByteOrderMark) { - encodeLastRecordedSourceMapSpan(); - writeFile(compilerHost, diagnostics, sourceMapData.sourceMapFilePath, serializeSourceMapContents(3, sourceMapData.sourceMapFile, sourceMapData.sourceMapSourceRoot, sourceMapData.sourceMapSources, sourceMapData.sourceMapNames, sourceMapData.sourceMapMappings), false); - sourceMapDataList.push(sourceMapData); - writeJavaScriptFile(emitOutput + "//# sourceMappingURL=" + sourceMapData.jsSourceMappingURL, writeByteOrderMark); - } - var sourceMapJsFile = ts.getBaseFilename(ts.normalizeSlashes(jsFilePath)); - sourceMapData = { - sourceMapFilePath: jsFilePath + ".map", - jsSourceMappingURL: sourceMapJsFile + ".map", - sourceMapFile: sourceMapJsFile, - sourceMapSourceRoot: compilerOptions.sourceRoot || "", - sourceMapSources: [], - inputSourceFileNames: [], - sourceMapNames: [], - sourceMapMappings: "", - sourceMapDecodedMappings: [] - }; - sourceMapData.sourceMapSourceRoot = ts.normalizeSlashes(sourceMapData.sourceMapSourceRoot); - if (sourceMapData.sourceMapSourceRoot.length && sourceMapData.sourceMapSourceRoot.charCodeAt(sourceMapData.sourceMapSourceRoot.length - 1) !== 47 /* slash */) { - sourceMapData.sourceMapSourceRoot += ts.directorySeparator; - } - if (compilerOptions.mapRoot) { - sourceMapDir = ts.normalizeSlashes(compilerOptions.mapRoot); - if (root) { - sourceMapDir = ts.getDirectoryPath(getSourceFilePathInNewDir(root, program, sourceMapDir)); - } - if (!ts.isRootedDiskPath(sourceMapDir) && !ts.isUrl(sourceMapDir)) { - sourceMapDir = ts.combinePaths(program.getCommonSourceDirectory(), sourceMapDir); - sourceMapData.jsSourceMappingURL = ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizePath(jsFilePath)), ts.combinePaths(sourceMapDir, sourceMapData.jsSourceMappingURL), compilerHost.getCurrentDirectory(), compilerHost.getCanonicalFileName, true); - } - else { - sourceMapData.jsSourceMappingURL = ts.combinePaths(sourceMapDir, sourceMapData.jsSourceMappingURL); - } - } - else { - sourceMapDir = ts.getDirectoryPath(ts.normalizePath(jsFilePath)); - } - function emitNodeWithMap(node) { - if (node) { - if (node.kind != 182 /* SourceFile */) { - recordEmitNodeStartSpan(node); - emitNode(node); - recordEmitNodeEndSpan(node); - } - else { - recordNewSourceFileStart(node); - emitNode(node); - } - } - } - writeEmittedFiles = writeJavaScriptAndSourceMapFile; - emit = emitNodeWithMap; - emitStart = recordEmitNodeStartSpan; - emitEnd = recordEmitNodeEndSpan; - emitToken = writeTextWithSpanRecord; - scopeEmitStart = recordScopeNameOfNode; - scopeEmitEnd = recordScopeNameEnd; - writeComment = writeCommentRangeWithMap; - } - function writeJavaScriptFile(emitOutput, writeByteOrderMark) { - writeFile(compilerHost, diagnostics, jsFilePath, emitOutput, writeByteOrderMark); - } - function emitTokenText(tokenKind, startPos, emitFn) { - var tokenString = ts.tokenToString(tokenKind); - if (emitFn) { - emitFn(); - } - else { - write(tokenString); - } - return startPos + tokenString.length; - } - function emitOptional(prefix, node) { - if (node) { - write(prefix); - emit(node); - } - } - function emitTrailingCommaIfPresent(nodeList, isMultiline) { - if (nodeList.hasTrailingComma) { - write(","); - if (isMultiline) { - writeLine(); - } - } - } - function emitCommaList(nodes, includeTrailingComma, count) { - if (!(count >= 0)) { - count = nodes.length; - } - if (nodes) { - for (var i = 0; i < count; i++) { - if (i) { - write(", "); - } - emit(nodes[i]); - } - if (includeTrailingComma) { - emitTrailingCommaIfPresent(nodes, false); - } - } - } - function emitMultiLineList(nodes, includeTrailingComma) { - if (nodes) { - for (var i = 0; i < nodes.length; i++) { - if (i) { - write(","); - } - writeLine(); - emit(nodes[i]); - } - if (includeTrailingComma) { - emitTrailingCommaIfPresent(nodes, true); - } - } - } - function emitLines(nodes) { - emitLinesStartingAt(nodes, 0); - } - function emitLinesStartingAt(nodes, startIndex) { - for (var i = startIndex; i < nodes.length; i++) { - writeLine(); - emit(nodes[i]); - } - } - function emitLiteral(node) { - var text = getSourceTextOfLocalNode(currentSourceFile, node); - if (node.kind === 7 /* StringLiteral */ && compilerOptions.sourceMap) { - writer.writeLiteral(text); - } - else { - write(text); - } - } - function emitQuotedIdentifier(node) { - if (node.kind === 7 /* StringLiteral */) { - emitLiteral(node); - } - else { - write("\""); - if (node.kind === 6 /* NumericLiteral */) { - write(node.text); - } - else { - write(getSourceTextOfLocalNode(currentSourceFile, node)); - } - write("\""); - } - } - function isNonExpressionIdentifier(node) { - var parent = node.parent; - switch (parent.kind) { - case 118 /* Parameter */: - case 171 /* VariableDeclaration */: - case 119 /* Property */: - case 134 /* PropertyAssignment */: - case 181 /* EnumMember */: - case 120 /* Method */: - case 172 /* FunctionDeclaration */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 141 /* FunctionExpression */: - case 174 /* ClassDeclaration */: - case 175 /* InterfaceDeclaration */: - case 176 /* EnumDeclaration */: - case 177 /* ModuleDeclaration */: - case 179 /* ImportDeclaration */: - return parent.name === node; - case 158 /* BreakStatement */: - case 157 /* ContinueStatement */: - case 180 /* ExportAssignment */: - return false; - case 164 /* LabeledStatement */: - return node.parent.label === node; - case 168 /* CatchBlock */: - return node.parent.variable === node; - } - } - function emitIdentifier(node) { - if (!isNonExpressionIdentifier(node)) { - var prefix = resolver.getExpressionNamePrefix(node); - if (prefix) { - write(prefix); - write("."); - } - } - write(getSourceTextOfLocalNode(currentSourceFile, node)); - } - function emitThis(node) { - if (resolver.getNodeCheckFlags(node) & 2 /* LexicalThis */) { - write("_this"); - } - else { - write("this"); - } - } - function emitSuper(node) { - var flags = resolver.getNodeCheckFlags(node); - if (flags & 16 /* SuperInstance */) { - write("_super.prototype"); - } - else if (flags & 32 /* SuperStatic */) { - write("_super"); - } - else { - write("super"); - } - } - function emitArrayLiteral(node) { - if (node.flags & 256 /* MultiLine */) { - write("["); - increaseIndent(); - emitMultiLineList(node.elements, true); - decreaseIndent(); - writeLine(); - write("]"); - } - else { - write("["); - emitCommaList(node.elements, true); - write("]"); - } - } - function emitObjectLiteral(node) { - if (!node.properties.length) { - write("{}"); - } - else if (node.flags & 256 /* MultiLine */) { - write("{"); - increaseIndent(); - emitMultiLineList(node.properties, compilerOptions.target >= 1 /* ES5 */); - decreaseIndent(); - writeLine(); - write("}"); - } - else { - write("{ "); - emitCommaList(node.properties, compilerOptions.target >= 1 /* ES5 */); - write(" }"); - } - } - function emitPropertyAssignment(node) { - emitLeadingComments(node); - emit(node.name); - write(": "); - emit(node.initializer); - emitTrailingComments(node); - } - function emitPropertyAccess(node) { - var constantValue = resolver.getConstantValue(node); - if (constantValue !== undefined) { - write(constantValue.toString() + " /* " + ts.identifierToString(node.right) + " */"); - } - else { - emit(node.left); - write("."); - emit(node.right); - } - } - function emitIndexedAccess(node) { - emit(node.object); - write("["); - emit(node.index); - write("]"); - } - function emitCallExpression(node) { - var superCall = false; - if (node.func.kind === 85 /* SuperKeyword */) { - write("_super"); - superCall = true; - } - else { - emit(node.func); - superCall = node.func.kind === 135 /* PropertyAccess */ && node.func.left.kind === 85 /* SuperKeyword */; - } - if (superCall) { - write(".call("); - emitThis(node.func); - if (node.arguments.length) { - write(", "); - emitCommaList(node.arguments, false); - } - write(")"); - } - else { - write("("); - emitCommaList(node.arguments, false); - write(")"); - } - } - function emitNewExpression(node) { - write("new "); - emit(node.func); - if (node.arguments) { - write("("); - emitCommaList(node.arguments, false); - write(")"); - } - } - function emitParenExpression(node) { - if (node.expression.kind === 139 /* TypeAssertion */) { - var operand = node.expression.operand; - while (operand.kind == 139 /* TypeAssertion */) { - operand = operand.operand; - } - if (operand.kind !== 143 /* PrefixOperator */ && operand.kind !== 144 /* PostfixOperator */ && operand.kind !== 138 /* NewExpression */ && !(operand.kind === 137 /* CallExpression */ && node.parent.kind === 138 /* NewExpression */) && !(operand.kind === 141 /* FunctionExpression */ && node.parent.kind === 137 /* CallExpression */)) { - emit(operand); - return; - } - } - write("("); - emit(node.expression); - write(")"); - } - function emitUnaryExpression(node) { - if (node.kind === 143 /* PrefixOperator */) { - write(ts.tokenToString(node.operator)); - } - if (node.operator >= 59 /* Identifier */) { - write(" "); - } - else if (node.kind === 143 /* PrefixOperator */ && node.operand.kind === 143 /* PrefixOperator */) { - var operand = node.operand; - if (node.operator === 28 /* PlusToken */ && (operand.operator === 28 /* PlusToken */ || operand.operator === 33 /* PlusPlusToken */)) { - write(" "); - } - else if (node.operator === 29 /* MinusToken */ && (operand.operator === 29 /* MinusToken */ || operand.operator === 34 /* MinusMinusToken */)) { - write(" "); - } - } - emit(node.operand); - if (node.kind === 144 /* PostfixOperator */) { - write(ts.tokenToString(node.operator)); - } - } - function emitBinaryExpression(node) { - emit(node.left); - if (node.operator !== 18 /* CommaToken */) - write(" "); - write(ts.tokenToString(node.operator)); - write(" "); - emit(node.right); - } - function emitConditionalExpression(node) { - emit(node.condition); - write(" ? "); - emit(node.whenTrue); - write(" : "); - emit(node.whenFalse); - } - function emitBlock(node) { - emitToken(9 /* OpenBraceToken */, node.pos); - increaseIndent(); - scopeEmitStart(node.parent); - if (node.kind === 178 /* ModuleBlock */) { - ts.Debug.assert(node.parent.kind === 177 /* ModuleDeclaration */); - emitCaptureThisForNodeIfNecessary(node.parent); - } - emitLines(node.statements); - decreaseIndent(); - writeLine(); - emitToken(10 /* CloseBraceToken */, node.statements.end); - scopeEmitEnd(); - } - function emitEmbeddedStatement(node) { - if (node.kind === 148 /* Block */) { - write(" "); - emit(node); - } - else { - increaseIndent(); - writeLine(); - emit(node); - decreaseIndent(); - } - } - function emitExpressionStatement(node) { - var isArrowExpression = node.expression.kind === 142 /* ArrowFunction */; - emitLeadingComments(node); - if (isArrowExpression) - write("("); - emit(node.expression); - if (isArrowExpression) - write(")"); - write(";"); - emitTrailingComments(node); - } - function emitIfStatement(node) { - emitLeadingComments(node); - var endPos = emitToken(78 /* IfKeyword */, node.pos); - write(" "); - endPos = emitToken(11 /* OpenParenToken */, endPos); - emit(node.expression); - emitToken(12 /* CloseParenToken */, node.expression.end); - emitEmbeddedStatement(node.thenStatement); - if (node.elseStatement) { - writeLine(); - emitToken(70 /* ElseKeyword */, node.thenStatement.end); - if (node.elseStatement.kind === 152 /* IfStatement */) { - write(" "); - emit(node.elseStatement); - } - else { - emitEmbeddedStatement(node.elseStatement); - } - } - emitTrailingComments(node); - } - function emitDoStatement(node) { - write("do"); - emitEmbeddedStatement(node.statement); - if (node.statement.kind === 148 /* Block */) { - write(" "); - } - else { - writeLine(); - } - write("while ("); - emit(node.expression); - write(");"); - } - function emitWhileStatement(node) { - write("while ("); - emit(node.expression); - write(")"); - emitEmbeddedStatement(node.statement); - } - function emitForStatement(node) { - var endPos = emitToken(76 /* ForKeyword */, node.pos); - write(" "); - endPos = emitToken(11 /* OpenParenToken */, endPos); - if (node.declarations) { - emitToken(92 /* VarKeyword */, endPos); - write(" "); - emitCommaList(node.declarations, false); - } - if (node.initializer) { - emit(node.initializer); - } - write(";"); - emitOptional(" ", node.condition); - write(";"); - emitOptional(" ", node.iterator); - write(")"); - emitEmbeddedStatement(node.statement); - } - function emitForInStatement(node) { - var endPos = emitToken(76 /* ForKeyword */, node.pos); - write(" "); - endPos = emitToken(11 /* OpenParenToken */, endPos); - if (node.declaration) { - emitToken(92 /* VarKeyword */, endPos); - write(" "); - emit(node.declaration); - } - else { - emit(node.variable); - } - write(" in "); - emit(node.expression); - emitToken(12 /* CloseParenToken */, node.expression.end); - emitEmbeddedStatement(node.statement); - } - function emitBreakOrContinueStatement(node) { - emitToken(node.kind === 158 /* BreakStatement */ ? 60 /* BreakKeyword */ : 65 /* ContinueKeyword */, node.pos); - emitOptional(" ", node.label); - write(";"); - } - function emitReturnStatement(node) { - emitLeadingComments(node); - emitToken(84 /* ReturnKeyword */, node.pos); - emitOptional(" ", node.expression); - write(";"); - emitTrailingComments(node); - } - function emitWithStatement(node) { - write("with ("); - emit(node.expression); - write(")"); - emitEmbeddedStatement(node.statement); - } - function emitSwitchStatement(node) { - var endPos = emitToken(86 /* SwitchKeyword */, node.pos); - write(" "); - emitToken(11 /* OpenParenToken */, endPos); - emit(node.expression); - endPos = emitToken(12 /* CloseParenToken */, node.expression.end); - write(" "); - emitToken(9 /* OpenBraceToken */, endPos); - increaseIndent(); - emitLines(node.clauses); - decreaseIndent(); - writeLine(); - emitToken(10 /* CloseBraceToken */, node.clauses.end); - } - function emitCaseOrDefaultClause(node) { - if (node.kind === 162 /* CaseClause */) { - write("case "); - emit(node.expression); - write(":"); - } - else { - write("default:"); - } - increaseIndent(); - emitLines(node.statements); - decreaseIndent(); - } - function emitThrowStatement(node) { - write("throw "); - emit(node.expression); - write(";"); - } - function emitTryStatement(node) { - write("try "); - emit(node.tryBlock); - emit(node.catchBlock); - if (node.finallyBlock) { - writeLine(); - write("finally "); - emit(node.finallyBlock); - } - } - function emitCatchBlock(node) { - writeLine(); - var endPos = emitToken(62 /* CatchKeyword */, node.pos); - write(" "); - emitToken(11 /* OpenParenToken */, endPos); - emit(node.variable); - emitToken(12 /* CloseParenToken */, node.variable.end); - write(" "); - emitBlock(node); - } - function emitDebuggerStatement(node) { - emitToken(66 /* DebuggerKeyword */, node.pos); - write(";"); - } - function emitLabelledStatement(node) { - emit(node.label); - write(": "); - emit(node.statement); - } - function getContainingModule(node) { - do { - node = node.parent; - } while (node && node.kind !== 177 /* ModuleDeclaration */); - return node; - } - function emitModuleMemberName(node) { - emitStart(node.name); - if (node.flags & 1 /* Export */) { - var container = getContainingModule(node); - write(container ? resolver.getLocalNameOfContainer(container) : "exports"); - write("."); - } - emitNode(node.name); - emitEnd(node.name); - } - function emitVariableDeclaration(node) { - emitLeadingComments(node); - emitModuleMemberName(node); - emitOptional(" = ", node.initializer); - emitTrailingComments(node); - } - function emitVariableStatement(node) { - emitLeadingComments(node); - if (!(node.flags & 1 /* Export */)) - write("var "); - emitCommaList(node.declarations, false); - write(";"); - emitTrailingComments(node); - } - function emitParameter(node) { - emitLeadingComments(node); - emit(node.name); - emitTrailingComments(node); - } - function emitDefaultValueAssignments(node) { - ts.forEach(node.parameters, function (param) { - if (param.initializer) { - writeLine(); - emitStart(param); - write("if ("); - emitNode(param.name); - write(" === void 0)"); - emitEnd(param); - write(" { "); - emitStart(param); - emitNode(param.name); - write(" = "); - emitNode(param.initializer); - emitEnd(param); - write("; }"); - } - }); - } - function emitRestParameter(node) { - if (ts.hasRestParameters(node)) { - var restIndex = node.parameters.length - 1; - var restParam = node.parameters[restIndex]; - writeLine(); - emitLeadingComments(restParam); - emitStart(restParam); - write("var "); - emitNode(restParam.name); - write(" = [];"); - emitEnd(restParam); - emitTrailingComments(restParam); - writeLine(); - write("for ("); - emitStart(restParam); - write("var _i = " + restIndex + ";"); - emitEnd(restParam); - write(" "); - emitStart(restParam); - write("_i < arguments.length;"); - emitEnd(restParam); - write(" "); - emitStart(restParam); - write("_i++"); - emitEnd(restParam); - write(") {"); - increaseIndent(); - writeLine(); - emitStart(restParam); - emitNode(restParam.name); - write("[_i - " + restIndex + "] = arguments[_i];"); - emitEnd(restParam); - decreaseIndent(); - writeLine(); - write("}"); - } - } - function emitAccessor(node) { - emitLeadingComments(node); - write(node.kind === 122 /* GetAccessor */ ? "get " : "set "); - emit(node.name); - emitSignatureAndBody(node); - emitTrailingComments(node); - } - function emitFunctionDeclaration(node) { - if (!node.body) { - return emitPinnedOrTripleSlashComments(node); - } - if (node.kind !== 120 /* Method */) { - emitLeadingComments(node); - } - write("function "); - if (node.kind === 172 /* FunctionDeclaration */ || (node.kind === 141 /* FunctionExpression */ && node.name)) { - emit(node.name); - } - emitSignatureAndBody(node); - if (node.kind !== 120 /* Method */) { - emitTrailingComments(node); - } - } - function emitCaptureThisForNodeIfNecessary(node) { - if (resolver.getNodeCheckFlags(node) & 4 /* CaptureThis */) { - writeLine(); - emitStart(node); - write("var _this = this;"); - emitEnd(node); - } - } - function emitSignatureParameters(node) { - increaseIndent(); - write("("); - if (node) { - emitCommaList(node.parameters, false, node.parameters.length - (ts.hasRestParameters(node) ? 1 : 0)); - } - write(")"); - decreaseIndent(); - } - function emitSignatureAndBody(node) { - emitSignatureParameters(node); - write(" {"); - scopeEmitStart(node); - increaseIndent(); - emitDetachedComments(node.body.kind === 173 /* FunctionBlock */ ? node.body.statements : node.body); - var startIndex = 0; - if (node.body.kind === 173 /* FunctionBlock */) { - startIndex = emitDirectivePrologues(node.body.statements, true); - } - var outPos = writer.getTextPos(); - emitCaptureThisForNodeIfNecessary(node); - emitDefaultValueAssignments(node); - emitRestParameter(node); - if (node.body.kind !== 173 /* FunctionBlock */ && outPos === writer.getTextPos()) { - decreaseIndent(); - write(" "); - emitStart(node.body); - write("return "); - emitNode(node.body); - emitEnd(node.body); - write("; "); - emitStart(node.body); - write("}"); - emitEnd(node.body); - } - else { - if (node.body.kind === 173 /* FunctionBlock */) { - emitLinesStartingAt(node.body.statements, startIndex); - } - else { - writeLine(); - emitLeadingComments(node.body); - write("return "); - emit(node.body); - write(";"); - emitTrailingComments(node.body); - } - writeLine(); - if (node.body.kind === 173 /* FunctionBlock */) { - emitLeadingCommentsOfPosition(node.body.statements.end); - decreaseIndent(); - emitToken(10 /* CloseBraceToken */, node.body.statements.end); - } - else { - decreaseIndent(); - emitStart(node.body); - write("}"); - emitEnd(node.body); - } - } - scopeEmitEnd(); - if (node.flags & 1 /* Export */) { - writeLine(); - emitStart(node); - emitModuleMemberName(node); - write(" = "); - emit(node.name); - emitEnd(node); - write(";"); - } - } - function findInitialSuperCall(ctor) { - if (ctor.body) { - var statement = ctor.body.statements[0]; - if (statement && statement.kind === 151 /* ExpressionStatement */) { - var expr = statement.expression; - if (expr && expr.kind === 137 /* CallExpression */) { - var func = expr.func; - if (func && func.kind === 85 /* SuperKeyword */) { - return statement; - } - } - } - } - } - function emitParameterPropertyAssignments(node) { - ts.forEach(node.parameters, function (param) { - if (param.flags & ts.NodeFlags.AccessibilityModifier) { - writeLine(); - emitStart(param); - emitStart(param.name); - write("this."); - emitNode(param.name); - emitEnd(param.name); - write(" = "); - emit(param.name); - write(";"); - emitEnd(param); - } - }); - } - function emitMemberAccess(memberName) { - if (memberName.kind === 7 /* StringLiteral */ || memberName.kind === 6 /* NumericLiteral */) { - write("["); - emitNode(memberName); - write("]"); - } - else { - write("."); - emitNode(memberName); - } - } - function emitMemberAssignments(node, staticFlag) { - ts.forEach(node.members, function (member) { - if (member.kind === 119 /* Property */ && (member.flags & 128 /* Static */) === staticFlag && member.initializer) { - writeLine(); - emitLeadingComments(member); - emitStart(member); - emitStart(member.name); - if (staticFlag) { - emitNode(node.name); - } - else { - write("this"); - } - emitMemberAccess(member.name); - emitEnd(member.name); - write(" = "); - emit(member.initializer); - write(";"); - emitEnd(member); - emitTrailingComments(member); - } - }); - } - function emitMemberFunctions(node) { - ts.forEach(node.members, function (member) { - if (member.kind === 120 /* Method */) { - if (!member.body) { - return emitPinnedOrTripleSlashComments(member); - } - writeLine(); - emitLeadingComments(member); - emitStart(member); - emitStart(member.name); - emitNode(node.name); - if (!(member.flags & 128 /* Static */)) { - write(".prototype"); - } - emitMemberAccess(member.name); - emitEnd(member.name); - write(" = "); - emitStart(member); - emitFunctionDeclaration(member); - emitEnd(member); - emitEnd(member); - write(";"); - emitTrailingComments(member); - } - else if (member.kind === 122 /* GetAccessor */ || member.kind === 123 /* SetAccessor */) { - var accessors = getAllAccessorDeclarations(node, member); - if (member === accessors.firstAccessor) { - writeLine(); - emitStart(member); - write("Object.defineProperty("); - emitStart(member.name); - emitNode(node.name); - if (!(member.flags & 128 /* Static */)) { - write(".prototype"); - } - write(", "); - emitQuotedIdentifier(member.name); - emitEnd(member.name); - write(", {"); - increaseIndent(); - if (accessors.getAccessor) { - writeLine(); - emitLeadingComments(accessors.getAccessor); - write("get: "); - emitStart(accessors.getAccessor); - write("function "); - emitSignatureAndBody(accessors.getAccessor); - emitEnd(accessors.getAccessor); - emitTrailingComments(accessors.getAccessor); - write(","); - } - if (accessors.setAccessor) { - writeLine(); - emitLeadingComments(accessors.setAccessor); - write("set: "); - emitStart(accessors.setAccessor); - write("function "); - emitSignatureAndBody(accessors.setAccessor); - emitEnd(accessors.setAccessor); - emitTrailingComments(accessors.setAccessor); - write(","); - } - writeLine(); - write("enumerable: true,"); - writeLine(); - write("configurable: true"); - decreaseIndent(); - writeLine(); - write("});"); - emitEnd(member); - } - } - }); - } - function emitClassDeclaration(node) { - emitLeadingComments(node); - write("var "); - emit(node.name); - write(" = (function ("); - if (node.baseType) { - write("_super"); - } - write(") {"); - increaseIndent(); - scopeEmitStart(node); - if (node.baseType) { - writeLine(); - emitStart(node.baseType); - write("__extends("); - emit(node.name); - write(", _super);"); - emitEnd(node.baseType); - } - writeLine(); - emitConstructorOfClass(); - emitMemberFunctions(node); - emitMemberAssignments(node, 128 /* Static */); - writeLine(); - function emitClassReturnStatement() { - write("return "); - emitNode(node.name); - } - emitToken(10 /* CloseBraceToken */, node.members.end, emitClassReturnStatement); - write(";"); - decreaseIndent(); - writeLine(); - emitToken(10 /* CloseBraceToken */, node.members.end); - scopeEmitEnd(); - emitStart(node); - write(")("); - if (node.baseType) { - emit(node.baseType.typeName); - } - write(");"); - emitEnd(node); - if (node.flags & 1 /* Export */) { - writeLine(); - emitStart(node); - emitModuleMemberName(node); - write(" = "); - emit(node.name); - emitEnd(node); - write(";"); - } - emitTrailingComments(node); - function emitConstructorOfClass() { - ts.forEach(node.members, function (member) { - if (member.kind === 121 /* Constructor */ && !member.body) { - emitPinnedOrTripleSlashComments(member); - } - }); - var ctor = getFirstConstructorWithBody(node); - if (ctor) { - emitLeadingComments(ctor); - } - emitStart(ctor || node); - write("function "); - emit(node.name); - emitSignatureParameters(ctor); - write(" {"); - scopeEmitStart(node, "constructor"); - increaseIndent(); - if (ctor) { - emitDetachedComments(ctor.body.statements); - } - emitCaptureThisForNodeIfNecessary(node); - if (ctor) { - emitDefaultValueAssignments(ctor); - emitRestParameter(ctor); - if (node.baseType) { - var superCall = findInitialSuperCall(ctor); - if (superCall) { - writeLine(); - emit(superCall); - } - } - emitParameterPropertyAssignments(ctor); - } - else { - if (node.baseType) { - writeLine(); - emitStart(node.baseType); - write("_super.apply(this, arguments);"); - emitEnd(node.baseType); - } - } - emitMemberAssignments(node, 0); - if (ctor) { - var statements = ctor.body.statements; - if (superCall) - statements = statements.slice(1); - emitLines(statements); - } - writeLine(); - if (ctor) { - emitLeadingCommentsOfPosition(ctor.body.statements.end); - } - decreaseIndent(); - emitToken(10 /* CloseBraceToken */, ctor ? ctor.body.statements.end : node.members.end); - scopeEmitEnd(); - emitEnd(ctor || node); - if (ctor) { - emitTrailingComments(ctor); - } - } - } - function emitInterfaceDeclaration(node) { - emitPinnedOrTripleSlashComments(node); - } - function emitEnumDeclaration(node) { - emitLeadingComments(node); - if (!(node.flags & 1 /* Export */)) { - emitStart(node); - write("var "); - emit(node.name); - emitEnd(node); - write(";"); - } - writeLine(); - emitStart(node); - write("(function ("); - emitStart(node.name); - write(resolver.getLocalNameOfContainer(node)); - emitEnd(node.name); - write(") {"); - increaseIndent(); - scopeEmitStart(node); - emitEnumMemberDeclarations(); - decreaseIndent(); - writeLine(); - emitToken(10 /* CloseBraceToken */, node.members.end); - scopeEmitEnd(); - write(")("); - emitModuleMemberName(node); - write(" || ("); - emitModuleMemberName(node); - write(" = {}));"); - emitEnd(node); - if (node.flags & 1 /* Export */) { - writeLine(); - emitStart(node); - write("var "); - emit(node.name); - write(" = "); - emitModuleMemberName(node); - emitEnd(node); - write(";"); - } - emitTrailingComments(node); - function emitEnumMemberDeclarations() { - ts.forEach(node.members, function (member) { - writeLine(); - emitLeadingComments(member); - emitStart(member); - write(resolver.getLocalNameOfContainer(node)); - write("["); - write(resolver.getLocalNameOfContainer(node)); - write("["); - emitQuotedIdentifier(member.name); - write("] = "); - if (member.initializer) { - emit(member.initializer); - } - else { - write(resolver.getEnumMemberValue(member).toString()); - } - write("] = "); - emitQuotedIdentifier(member.name); - emitEnd(member); - write(";"); - emitTrailingComments(member); - }); - } - } - function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 177 /* ModuleDeclaration */) { - var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); - return recursiveInnerModule || moduleDeclaration.body; - } - } - function emitModuleDeclaration(node) { - if (!ts.isInstantiated(node)) { - return emitPinnedOrTripleSlashComments(node); - } - emitLeadingComments(node); - emitStart(node); - write("var "); - emit(node.name); - write(";"); - emitEnd(node); - writeLine(); - emitStart(node); - write("(function ("); - emitStart(node.name); - write(resolver.getLocalNameOfContainer(node)); - emitEnd(node.name); - write(") "); - if (node.body.kind === 178 /* ModuleBlock */) { - emit(node.body); - } - else { - write("{"); - increaseIndent(); - scopeEmitStart(node); - emitCaptureThisForNodeIfNecessary(node); - writeLine(); - emit(node.body); - decreaseIndent(); - writeLine(); - var moduleBlock = getInnerMostModuleDeclarationFromDottedModule(node).body; - emitToken(10 /* CloseBraceToken */, moduleBlock.statements.end); - scopeEmitEnd(); - } - write(")("); - if (node.flags & 1 /* Export */) { - emit(node.name); - write(" = "); - } - emitModuleMemberName(node); - write(" || ("); - emitModuleMemberName(node); - write(" = {}));"); - emitEnd(node); - emitTrailingComments(node); - } - function emitImportDeclaration(node) { - var emitImportDeclaration = resolver.isReferencedImportDeclaration(node); - if (!emitImportDeclaration) { - emitImportDeclaration = !ts.isExternalModule(currentSourceFile) && resolver.isTopLevelValueImportedViaEntityName(node); - } - if (emitImportDeclaration) { - if (node.externalModuleName && node.parent.kind === 182 /* SourceFile */ && compilerOptions.module === 2 /* AMD */) { - if (node.flags & 1 /* Export */) { - writeLine(); - emitLeadingComments(node); - emitStart(node); - emitModuleMemberName(node); - write(" = "); - emit(node.name); - write(";"); - emitEnd(node); - emitTrailingComments(node); - } - } - else { - writeLine(); - emitLeadingComments(node); - emitStart(node); - if (!(node.flags & 1 /* Export */)) - write("var "); - emitModuleMemberName(node); - write(" = "); - if (node.entityName) { - emit(node.entityName); - } - else { - write("require("); - emitStart(node.externalModuleName); - emitLiteral(node.externalModuleName); - emitEnd(node.externalModuleName); - emitToken(12 /* CloseParenToken */, node.externalModuleName.end); - } - write(";"); - emitEnd(node); - emitTrailingComments(node); - } - } - } - function getExternalImportDeclarations(node) { - var result = []; - ts.forEach(node.statements, function (stat) { - if (stat.kind === 179 /* ImportDeclaration */ && stat.externalModuleName && resolver.isReferencedImportDeclaration(stat)) { - result.push(stat); - } - }); - return result; - } - function getFirstExportAssignment(sourceFile) { - return ts.forEach(sourceFile.statements, function (node) { - if (node.kind === 180 /* ExportAssignment */) { - return node; - } - }); - } - function emitAMDModule(node, startIndex) { - var imports = getExternalImportDeclarations(node); - writeLine(); - write("define([\"require\", \"exports\""); - ts.forEach(imports, function (imp) { - write(", "); - emitLiteral(imp.externalModuleName); - }); - ts.forEach(node.amdDependencies, function (amdDependency) { - var text = "\"" + amdDependency + "\""; - write(", "); - write(text); - }); - write("], function (require, exports"); - ts.forEach(imports, function (imp) { - write(", "); - emit(imp.name); - }); - write(") {"); - increaseIndent(); - emitCaptureThisForNodeIfNecessary(node); - emitLinesStartingAt(node.statements, startIndex); - var exportName = resolver.getExportAssignmentName(node); - if (exportName) { - writeLine(); - var exportAssignement = getFirstExportAssignment(node); - emitStart(exportAssignement); - write("return "); - emitStart(exportAssignement.exportName); - write(exportName); - emitEnd(exportAssignement.exportName); - write(";"); - emitEnd(exportAssignement); - } - decreaseIndent(); - writeLine(); - write("});"); - } - function emitCommonJSModule(node, startIndex) { - emitCaptureThisForNodeIfNecessary(node); - emitLinesStartingAt(node.statements, startIndex); - var exportName = resolver.getExportAssignmentName(node); - if (exportName) { - writeLine(); - var exportAssignement = getFirstExportAssignment(node); - emitStart(exportAssignement); - write("module.exports = "); - emitStart(exportAssignement.exportName); - write(exportName); - emitEnd(exportAssignement.exportName); - write(";"); - emitEnd(exportAssignement); - } - } - function emitDirectivePrologues(statements, startWithNewLine) { - for (var i = 0; i < statements.length; ++i) { - if (ts.isPrologueDirective(statements[i])) { - if (startWithNewLine || i > 0) { - writeLine(); - } - emit(statements[i]); - } - else { - return i; - } - } - return statements.length; - } - function emitSourceFile(node) { - currentSourceFile = node; - writeLine(); - emitDetachedComments(node); - var startIndex = emitDirectivePrologues(node.statements, false); - if (!extendsEmitted && resolver.getNodeCheckFlags(node) & 8 /* EmitExtends */) { - writeLine(); - write("var __extends = this.__extends || function (d, b) {"); - increaseIndent(); - writeLine(); - write("for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];"); - writeLine(); - write("function __() { this.constructor = d; }"); - writeLine(); - write("__.prototype = b.prototype;"); - writeLine(); - write("d.prototype = new __();"); - decreaseIndent(); - writeLine(); - write("};"); - extendsEmitted = true; - } - if (ts.isExternalModule(node)) { - if (compilerOptions.module === 2 /* AMD */) { - emitAMDModule(node, startIndex); - } - else { - emitCommonJSModule(node, startIndex); - } - } - else { - emitCaptureThisForNodeIfNecessary(node); - emitLinesStartingAt(node.statements, startIndex); - } - } - function emitNode(node) { - if (!node) { - return; - } - if (node.flags & 2 /* Ambient */) { - return emitPinnedOrTripleSlashComments(node); - } - switch (node.kind) { - case 59 /* Identifier */: - return emitIdentifier(node); - case 118 /* Parameter */: - return emitParameter(node); - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - return emitAccessor(node); - case 87 /* ThisKeyword */: - return emitThis(node); - case 85 /* SuperKeyword */: - return emitSuper(node); - case 83 /* NullKeyword */: - return write("null"); - case 89 /* TrueKeyword */: - return write("true"); - case 74 /* FalseKeyword */: - return write("false"); - case 6 /* NumericLiteral */: - case 7 /* StringLiteral */: - case 8 /* RegularExpressionLiteral */: - return emitLiteral(node); - case 116 /* QualifiedName */: - return emitPropertyAccess(node); - case 132 /* ArrayLiteral */: - return emitArrayLiteral(node); - case 133 /* ObjectLiteral */: - return emitObjectLiteral(node); - case 134 /* PropertyAssignment */: - return emitPropertyAssignment(node); - case 135 /* PropertyAccess */: - return emitPropertyAccess(node); - case 136 /* IndexedAccess */: - return emitIndexedAccess(node); - case 137 /* CallExpression */: - return emitCallExpression(node); - case 138 /* NewExpression */: - return emitNewExpression(node); - case 139 /* TypeAssertion */: - return emit(node.operand); - case 140 /* ParenExpression */: - return emitParenExpression(node); - case 172 /* FunctionDeclaration */: - case 141 /* FunctionExpression */: - case 142 /* ArrowFunction */: - return emitFunctionDeclaration(node); - case 143 /* PrefixOperator */: - case 144 /* PostfixOperator */: - return emitUnaryExpression(node); - case 145 /* BinaryExpression */: - return emitBinaryExpression(node); - case 146 /* ConditionalExpression */: - return emitConditionalExpression(node); - case 147 /* OmittedExpression */: - return; - case 148 /* Block */: - case 167 /* TryBlock */: - case 169 /* FinallyBlock */: - case 173 /* FunctionBlock */: - case 178 /* ModuleBlock */: - return emitBlock(node); - case 149 /* VariableStatement */: - return emitVariableStatement(node); - case 150 /* EmptyStatement */: - return write(";"); - case 151 /* ExpressionStatement */: - return emitExpressionStatement(node); - case 152 /* IfStatement */: - return emitIfStatement(node); - case 153 /* DoStatement */: - return emitDoStatement(node); - case 154 /* WhileStatement */: - return emitWhileStatement(node); - case 155 /* ForStatement */: - return emitForStatement(node); - case 156 /* ForInStatement */: - return emitForInStatement(node); - case 157 /* ContinueStatement */: - case 158 /* BreakStatement */: - return emitBreakOrContinueStatement(node); - case 159 /* ReturnStatement */: - return emitReturnStatement(node); - case 160 /* WithStatement */: - return emitWithStatement(node); - case 161 /* SwitchStatement */: - return emitSwitchStatement(node); - case 162 /* CaseClause */: - case 163 /* DefaultClause */: - return emitCaseOrDefaultClause(node); - case 164 /* LabeledStatement */: - return emitLabelledStatement(node); - case 165 /* ThrowStatement */: - return emitThrowStatement(node); - case 166 /* TryStatement */: - return emitTryStatement(node); - case 168 /* CatchBlock */: - return emitCatchBlock(node); - case 170 /* DebuggerStatement */: - return emitDebuggerStatement(node); - case 171 /* VariableDeclaration */: - return emitVariableDeclaration(node); - case 174 /* ClassDeclaration */: - return emitClassDeclaration(node); - case 175 /* InterfaceDeclaration */: - return emitInterfaceDeclaration(node); - case 176 /* EnumDeclaration */: - return emitEnumDeclaration(node); - case 177 /* ModuleDeclaration */: - return emitModuleDeclaration(node); - case 179 /* ImportDeclaration */: - return emitImportDeclaration(node); - case 182 /* SourceFile */: - return emitSourceFile(node); - } - } - function hasDetachedComments(pos) { - return detachedCommentsInfo !== undefined && detachedCommentsInfo[detachedCommentsInfo.length - 1].nodePos === pos; - } - function getLeadingCommentsWithoutDetachedComments() { - var leadingComments = ts.getLeadingCommentRanges(currentSourceFile.text, detachedCommentsInfo[detachedCommentsInfo.length - 1].detachedCommentEndPos); - if (detachedCommentsInfo.length - 1) { - detachedCommentsInfo.pop(); - } - else { - detachedCommentsInfo = undefined; - } - return leadingComments; - } - function getLeadingCommentsToEmit(node) { - if (node.parent.kind === 182 /* SourceFile */ || node.pos !== node.parent.pos) { - var leadingComments; - if (hasDetachedComments(node.pos)) { - leadingComments = getLeadingCommentsWithoutDetachedComments(); - } - else { - leadingComments = ts.getLeadingCommentRangesOfNode(node, currentSourceFile); - } - return leadingComments; - } - } - function emitLeadingDeclarationComments(node) { - var leadingComments = getLeadingCommentsToEmit(node); - emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments); - emitComments(currentSourceFile, writer, leadingComments, true, newLine, writeComment); - } - function emitTrailingDeclarationComments(node) { - if (node.parent.kind === 182 /* SourceFile */ || node.end !== node.parent.end) { - var trailingComments = ts.getTrailingCommentRanges(currentSourceFile.text, node.end); - emitComments(currentSourceFile, writer, trailingComments, false, newLine, writeComment); - } - } - function emitLeadingCommentsOfLocalPosition(pos) { - var leadingComments; - if (hasDetachedComments(pos)) { - leadingComments = getLeadingCommentsWithoutDetachedComments(); - } - else { - leadingComments = ts.getLeadingCommentRanges(currentSourceFile.text, pos); - } - emitNewLineBeforeLeadingComments(currentSourceFile, writer, { pos: pos, end: pos }, leadingComments); - emitComments(currentSourceFile, writer, leadingComments, true, newLine, writeComment); - } - function emitDetachedCommentsAtPosition(node) { - var leadingComments = ts.getLeadingCommentRanges(currentSourceFile.text, node.pos); - if (leadingComments) { - var detachedComments = []; - var lastComment; - ts.forEach(leadingComments, function (comment) { - if (lastComment) { - var lastCommentLine = getLineOfLocalPosition(currentSourceFile, lastComment.end); - var commentLine = getLineOfLocalPosition(currentSourceFile, comment.pos); - if (commentLine >= lastCommentLine + 2) { - return detachedComments; - } - } - detachedComments.push(comment); - lastComment = comment; - }); - if (detachedComments.length) { - var lastCommentLine = getLineOfLocalPosition(currentSourceFile, detachedComments[detachedComments.length - 1].end); - var astLine = getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node.pos)); - if (astLine >= lastCommentLine + 2) { - emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments); - emitComments(currentSourceFile, writer, detachedComments, true, newLine, writeComment); - var currentDetachedCommentInfo = { nodePos: node.pos, detachedCommentEndPos: detachedComments[detachedComments.length - 1].end }; - if (detachedCommentsInfo) { - detachedCommentsInfo.push(currentDetachedCommentInfo); - } - else { - detachedCommentsInfo = [currentDetachedCommentInfo]; - } - } - } - } - } - function emitPinnedOrTripleSlashCommentsOfNode(node) { - var pinnedComments = ts.filter(getLeadingCommentsToEmit(node), isPinnedOrTripleSlashComment); - function isPinnedOrTripleSlashComment(comment) { - if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 42 /* asterisk */) { - return currentSourceFile.text.charCodeAt(comment.pos + 2) === 33 /* exclamation */; - } - else if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 47 /* slash */ && comment.pos + 2 < comment.end && currentSourceFile.text.charCodeAt(comment.pos + 2) === 47 /* slash */ && currentSourceFile.text.substring(comment.pos, comment.end).match(ts.fullTripleSlashReferencePathRegEx)) { - return true; - } - } - emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, pinnedComments); - emitComments(currentSourceFile, writer, pinnedComments, true, newLine, writeComment); - } - if (compilerOptions.sourceMap) { - initializeEmitterWithSourceMaps(); - } - if (root) { - emit(root); - } - else { - ts.forEach(program.getSourceFiles(), function (sourceFile) { - if (!isExternalModuleOrDeclarationFile(sourceFile)) { - emit(sourceFile); - } - }); - } - writeLine(); - writeEmittedFiles(writer.getText(), compilerOptions.emitBOM); - } - var hasSemanticErrors = resolver.hasSemanticErrors(); - function emitFile(jsFilePath, sourceFile) { - emitJavaScript(jsFilePath, sourceFile); - if (!hasSemanticErrors && compilerOptions.declaration) { - var emitDeclarationResult = emitDeclarations(program, resolver, diagnostics, jsFilePath, sourceFile); - if (!emitDeclarationResult.reportedDeclarationError) { - writeDeclarationToFile(compilerHost, compilerOptions, diagnostics, emitDeclarationResult.aliasDeclarationEmitInfo, emitDeclarationResult.synchronousDeclarationOutput, jsFilePath, emitDeclarationResult.declarationOutput); - } - } - } - if (targetSourceFile === undefined) { - ts.forEach(program.getSourceFiles(), function (sourceFile) { - if (shouldEmitToOwnFile(sourceFile, compilerOptions)) { - var jsFilePath = getOwnEmitOutputFilePath(sourceFile, program, ".js"); - emitFile(jsFilePath, sourceFile); - } - }); - if (compilerOptions.out) { - emitFile(compilerOptions.out); - } - } - else { - if (shouldEmitToOwnFile(targetSourceFile, compilerOptions)) { - var jsFilePath = getOwnEmitOutputFilePath(targetSourceFile, program, ".js"); - emitFile(jsFilePath, targetSourceFile); - } - else if (!ts.isDeclarationFile(targetSourceFile) && compilerOptions.out) { - emitFile(compilerOptions.out); - } - } - diagnostics.sort(ts.compareDiagnostics); - diagnostics = ts.deduplicateSortedDiagnostics(diagnostics); - var hasEmitterError = ts.forEach(diagnostics, function (diagnostic) { return diagnostic.category === 1 /* Error */; }); - var returnCode; - if (hasEmitterError) { - returnCode = 4 /* EmitErrorsEncountered */; - } - else if (hasSemanticErrors && compilerOptions.declaration) { - returnCode = 3 /* DeclarationGenerationSkipped */; - } - else if (hasSemanticErrors && !compilerOptions.declaration) { - returnCode = 2 /* JSGeneratedWithSemanticErrors */; - } - else { - returnCode = 0 /* Succeeded */; - } - return { - emitResultStatus: returnCode, - errors: diagnostics, - sourceMaps: sourceMapDataList - }; - } - ts.emitFiles = emitFiles; -})(ts || (ts = {})); -var ts; -(function (ts) { - var nextSymbolId = 1; - var nextNodeId = 1; - var nextMergeId = 1; - function getDeclarationOfKind(symbol, kind) { - var declarations = symbol.declarations; - for (var i = 0; i < declarations.length; i++) { - var declaration = declarations[i]; - if (declaration.kind === kind) { - return declaration; - } - } - return undefined; - } - ts.getDeclarationOfKind = getDeclarationOfKind; - var stringWriters = []; - function getSingleLineStringWriter() { - if (stringWriters.length == 0) { - var str = ""; - return { - string: function () { return str; }, - writeKind: function (text) { return str += text; }, - writeSymbol: function (text) { return str += text; }, - writeLine: function () { return str += " "; }, - increaseIndent: function () { - }, - decreaseIndent: function () { - }, - clear: function () { return str = ""; }, - trackSymbol: function () { - } - }; - } - return stringWriters.pop(); - } - ts.getSingleLineStringWriter = getSingleLineStringWriter; - function createTypeChecker(program, fullTypeCheck) { - var Symbol = ts.objectAllocator.getSymbolConstructor(); - var Type = ts.objectAllocator.getTypeConstructor(); - var Signature = ts.objectAllocator.getSignatureConstructor(); - var typeCount = 0; - var emptyArray = []; - var emptySymbols = {}; - var compilerOptions = program.getCompilerOptions(); - var checker = { - getProgram: function () { return program; }, - getDiagnostics: getDiagnostics, - getDeclarationDiagnostics: getDeclarationDiagnostics, - getGlobalDiagnostics: getGlobalDiagnostics, - getNodeCount: function () { return ts.sum(program.getSourceFiles(), "nodeCount"); }, - getIdentifierCount: function () { return ts.sum(program.getSourceFiles(), "identifierCount"); }, - getSymbolCount: function () { return ts.sum(program.getSourceFiles(), "symbolCount"); }, - getTypeCount: function () { return typeCount; }, - checkProgram: checkProgram, - emitFiles: invokeEmitter, - getParentOfSymbol: getParentOfSymbol, - getTypeOfSymbol: getTypeOfSymbol, - getPropertiesOfType: getPropertiesOfType, - getPropertyOfType: getPropertyOfType, - getSignaturesOfType: getSignaturesOfType, - getIndexTypeOfType: getIndexTypeOfType, - getReturnTypeOfSignature: getReturnTypeOfSignature, - getSymbolsInScope: getSymbolsInScope, - getSymbolInfo: getSymbolInfo, - getTypeOfNode: getTypeOfNode, - getApparentType: getApparentType, - typeToString: typeToString, - writeType: writeType, - symbolToString: symbolToString, - writeSymbol: writeSymbol, - getAugmentedPropertiesOfApparentType: getAugmentedPropertiesOfApparentType, - getRootSymbol: getRootSymbol, - getContextualType: getContextualType, - getFullyQualifiedName: getFullyQualifiedName, - getResolvedSignature: getResolvedSignature, - getEnumMemberValue: getEnumMemberValue, - isValidPropertyAccess: isValidPropertyAccess, - getSignatureFromDeclaration: getSignatureFromDeclaration, - writeSignature: writeSignature, - writeTypeParameter: writeTypeParameter, - writeTypeParametersOfSymbol: writeTypeParametersOfSymbol, - isImplementationOfOverload: isImplementationOfOverload, - getAliasedSymbol: resolveImport, - isUndefinedSymbol: function (symbol) { return symbol === undefinedSymbol; }, - isArgumentsSymbol: function (symbol) { return symbol === argumentsSymbol; } - }; - var undefinedSymbol = createSymbol(2 /* Property */ | 33554432 /* Transient */, "undefined"); - var argumentsSymbol = createSymbol(2 /* Property */ | 33554432 /* Transient */, "arguments"); - var unknownSymbol = createSymbol(2 /* Property */ | 33554432 /* Transient */, "unknown"); - var resolvingSymbol = createSymbol(33554432 /* Transient */, "__resolving__"); - var anyType = createIntrinsicType(1 /* Any */, "any"); - var stringType = createIntrinsicType(2 /* String */, "string"); - var numberType = createIntrinsicType(4 /* Number */, "number"); - var booleanType = createIntrinsicType(8 /* Boolean */, "boolean"); - var voidType = createIntrinsicType(16 /* Void */, "void"); - var undefinedType = createIntrinsicType(32 /* Undefined */, "undefined"); - var nullType = createIntrinsicType(64 /* Null */, "null"); - var unknownType = createIntrinsicType(1 /* Any */, "unknown"); - var resolvingType = createIntrinsicType(1 /* Any */, "__resolving__"); - var emptyObjectType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); - var anyFunctionType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); - var noConstraintType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); - var anySignature = createSignature(undefined, undefined, emptyArray, anyType, 0, false, false); - var unknownSignature = createSignature(undefined, undefined, emptyArray, unknownType, 0, false, false); - var globals = {}; - var globalArraySymbol; - var globalObjectType; - var globalFunctionType; - var globalArrayType; - var globalStringType; - var globalNumberType; - var globalBooleanType; - var globalRegExpType; - var tupleTypes = {}; - var stringLiteralTypes = {}; - var emitExtends = false; - var mergedSymbols = []; - var symbolLinks = []; - var nodeLinks = []; - var potentialThisCollisions = []; - var diagnostics = []; - var diagnosticsModified = false; - function addDiagnostic(diagnostic) { - diagnostics.push(diagnostic); - diagnosticsModified = true; - } - function error(location, message, arg0, arg1, arg2) { - var diagnostic = location ? ts.createDiagnosticForNode(location, message, arg0, arg1, arg2) : ts.createCompilerDiagnostic(message, arg0, arg1, arg2); - addDiagnostic(diagnostic); - } - function createSymbol(flags, name) { - return new Symbol(flags, name); - } - function getExcludedSymbolFlags(flags) { - var result = 0; - if (flags & 1 /* Variable */) - result |= ts.SymbolFlags.VariableExcludes; - if (flags & 2 /* Property */) - result |= ts.SymbolFlags.PropertyExcludes; - if (flags & 4 /* EnumMember */) - result |= ts.SymbolFlags.EnumMemberExcludes; - if (flags & 8 /* Function */) - result |= ts.SymbolFlags.FunctionExcludes; - if (flags & 16 /* Class */) - result |= ts.SymbolFlags.ClassExcludes; - if (flags & 32 /* Interface */) - result |= ts.SymbolFlags.InterfaceExcludes; - if (flags & 64 /* Enum */) - result |= ts.SymbolFlags.EnumExcludes; - if (flags & 128 /* ValueModule */) - result |= ts.SymbolFlags.ValueModuleExcludes; - if (flags & 2048 /* Method */) - result |= ts.SymbolFlags.MethodExcludes; - if (flags & 8192 /* GetAccessor */) - result |= ts.SymbolFlags.GetAccessorExcludes; - if (flags & 16384 /* SetAccessor */) - result |= ts.SymbolFlags.SetAccessorExcludes; - if (flags & 262144 /* TypeParameter */) - result |= ts.SymbolFlags.TypeParameterExcludes; - if (flags & 4194304 /* Import */) - result |= ts.SymbolFlags.ImportExcludes; - return result; - } - function recordMergedSymbol(target, source) { - if (!source.mergeId) - source.mergeId = nextMergeId++; - mergedSymbols[source.mergeId] = target; - } - function cloneSymbol(symbol) { - var result = createSymbol(symbol.flags | 16777216 /* Merged */, symbol.name); - result.declarations = symbol.declarations.slice(0); - result.parent = symbol.parent; - if (symbol.valueDeclaration) - result.valueDeclaration = symbol.valueDeclaration; - if (symbol.members) - result.members = cloneSymbolTable(symbol.members); - if (symbol.exports) - result.exports = cloneSymbolTable(symbol.exports); - recordMergedSymbol(result, symbol); - return result; - } - function extendSymbol(target, source) { - if (!(target.flags & getExcludedSymbolFlags(source.flags))) { - target.flags |= source.flags; - if (!target.valueDeclaration && source.valueDeclaration) - target.valueDeclaration = source.valueDeclaration; - ts.forEach(source.declarations, function (node) { - target.declarations.push(node); - }); - if (source.members) { - if (!target.members) - target.members = {}; - extendSymbolTable(target.members, source.members); - } - if (source.exports) { - if (!target.exports) - target.exports = {}; - extendSymbolTable(target.exports, source.exports); - } - recordMergedSymbol(target, source); - } - else { - ts.forEach(source.declarations, function (node) { - error(node.name ? node.name : node, ts.Diagnostics.Duplicate_identifier_0, symbolToString(source)); - }); - } - } - function cloneSymbolTable(symbolTable) { - var result = {}; - for (var id in symbolTable) { - if (ts.hasProperty(symbolTable, id)) { - result[id] = symbolTable[id]; - } - } - return result; - } - function extendSymbolTable(target, source) { - for (var id in source) { - if (ts.hasProperty(source, id)) { - if (!ts.hasProperty(target, id)) { - target[id] = source[id]; - } - else { - var symbol = target[id]; - if (!(symbol.flags & 16777216 /* Merged */)) { - target[id] = symbol = cloneSymbol(symbol); - } - extendSymbol(symbol, source[id]); - } - } - } - } - function getSymbolLinks(symbol) { - if (symbol.flags & 33554432 /* Transient */) - return symbol; - if (!symbol.id) - symbol.id = nextSymbolId++; - return symbolLinks[symbol.id] || (symbolLinks[symbol.id] = {}); - } - function getNodeLinks(node) { - if (!node.id) - node.id = nextNodeId++; - return nodeLinks[node.id] || (nodeLinks[node.id] = {}); - } - function getSourceFile(node) { - return ts.getAncestor(node, 182 /* SourceFile */); - } - function isGlobalSourceFile(node) { - return node.kind === 182 /* SourceFile */ && !ts.isExternalModule(node); - } - function getSymbol(symbols, name, meaning) { - if (meaning && ts.hasProperty(symbols, name)) { - var symbol = symbols[name]; - ts.Debug.assert((symbol.flags & 8388608 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); - if (symbol.flags & meaning) { - return symbol; - } - if (symbol.flags & 4194304 /* Import */) { - var target = resolveImport(symbol); - if (target === unknownSymbol || target.flags & meaning) { - return symbol; - } - } - } - } - function resolveName(location, name, meaning, nameNotFoundMessage, nameArg) { - var errorLocation = location; - var result; - var lastLocation; - var memberWithInitializerThatReferencesIdentifierFromConstructor; - function returnResolvedSymbol(s) { - if (s && memberWithInitializerThatReferencesIdentifierFromConstructor) { - var propertyName = memberWithInitializerThatReferencesIdentifierFromConstructor.name; - error(errorLocation, ts.Diagnostics.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor, ts.identifierToString(propertyName), nameArg); - return undefined; - } - if (!s && nameNotFoundMessage) { - error(errorLocation, nameNotFoundMessage, nameArg); - } - return s; - } - while (location) { - if (location.locals && !isGlobalSourceFile(location)) { - if (result = getSymbol(location.locals, name, meaning)) { - return returnResolvedSymbol(result); - } - } - switch (location.kind) { - case 182 /* SourceFile */: - if (!ts.isExternalModule(location)) - break; - case 177 /* ModuleDeclaration */: - if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & ts.SymbolFlags.ModuleMember)) { - return returnResolvedSymbol(result); - } - break; - case 176 /* EnumDeclaration */: - if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 4 /* EnumMember */)) { - return returnResolvedSymbol(result); - } - break; - case 119 /* Property */: - if (location.parent.kind === 174 /* ClassDeclaration */ && !(location.flags & 128 /* Static */)) { - var ctor = findConstructorDeclaration(location.parent); - if (ctor && ctor.locals) { - if (getSymbol(ctor.locals, name, meaning & ts.SymbolFlags.Value)) { - memberWithInitializerThatReferencesIdentifierFromConstructor = location; - } - } - } - break; - case 174 /* ClassDeclaration */: - case 175 /* InterfaceDeclaration */: - if (result = getSymbol(getSymbolOfNode(location).members, name, meaning & ts.SymbolFlags.Type)) { - if (lastLocation && lastLocation.flags & 128 /* Static */) { - error(errorLocation, ts.Diagnostics.Static_members_cannot_reference_class_type_parameters); - return undefined; - } - else { - return returnResolvedSymbol(result); - } - } - break; - case 120 /* Method */: - case 121 /* Constructor */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 172 /* FunctionDeclaration */: - case 142 /* ArrowFunction */: - if (name === "arguments") { - return returnResolvedSymbol(argumentsSymbol); - } - break; - case 141 /* FunctionExpression */: - if (name === "arguments") { - return returnResolvedSymbol(argumentsSymbol); - } - var id = location.name; - if (id && name === id.text) { - return returnResolvedSymbol(location.symbol); - } - break; - case 168 /* CatchBlock */: - var id = location.variable; - if (name === id.text) { - return returnResolvedSymbol(location.symbol); - } - break; - } - lastLocation = location; - location = location.parent; - } - if (result = getSymbol(globals, name, meaning)) { - return returnResolvedSymbol(result); - } - return returnResolvedSymbol(undefined); - } - function resolveImport(symbol) { - ts.Debug.assert((symbol.flags & 4194304 /* Import */) !== 0, "Should only get Imports here."); - var links = getSymbolLinks(symbol); - if (!links.target) { - links.target = resolvingSymbol; - var node = getDeclarationOfKind(symbol, 179 /* ImportDeclaration */); - var target = node.externalModuleName ? resolveExternalModuleName(node, node.externalModuleName) : getSymbolOfPartOfRightHandSideOfImport(node.entityName, node); - if (links.target === resolvingSymbol) { - links.target = target || unknownSymbol; - } - else { - error(node, ts.Diagnostics.Circular_definition_of_import_alias_0, symbolToString(symbol)); - } - } - else if (links.target === resolvingSymbol) { - links.target = unknownSymbol; - } - return links.target; - } - function getSymbolOfPartOfRightHandSideOfImport(entityName, importDeclaration) { - if (!importDeclaration) { - importDeclaration = ts.getAncestor(entityName, 179 /* ImportDeclaration */); - ts.Debug.assert(importDeclaration); - } - if (entityName.kind === 59 /* Identifier */ && isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { - entityName = entityName.parent; - } - if (entityName.kind === 59 /* Identifier */ || entityName.parent.kind === 116 /* QualifiedName */) { - return resolveEntityName(importDeclaration, entityName, ts.SymbolFlags.Namespace); - } - else { - ts.Debug.assert(entityName.parent.kind === 179 /* ImportDeclaration */); - return resolveEntityName(importDeclaration, entityName, ts.SymbolFlags.Value | ts.SymbolFlags.Type | ts.SymbolFlags.Namespace); - } - } - function getFullyQualifiedName(symbol) { - return symbol.parent ? getFullyQualifiedName(symbol.parent) + "." + symbolToString(symbol) : symbolToString(symbol); - } - function resolveEntityName(location, name, meaning) { - if (name.kind === 59 /* Identifier */) { - var symbol = resolveName(location, name.text, meaning, ts.Diagnostics.Cannot_find_name_0, ts.identifierToString(name)); - if (!symbol) { - return; - } - } - else if (name.kind === 116 /* QualifiedName */) { - var namespace = resolveEntityName(location, name.left, ts.SymbolFlags.Namespace); - if (!namespace || namespace === unknownSymbol || name.right.kind === 115 /* Missing */) - return; - var symbol = getSymbol(namespace.exports, name.right.text, meaning); - if (!symbol) { - error(location, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(namespace), ts.identifierToString(name.right)); - return; - } - } - else { - return; - } - ts.Debug.assert((symbol.flags & 8388608 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); - return symbol.flags & meaning ? symbol : resolveImport(symbol); - } - function isExternalModuleNameRelative(moduleName) { - return moduleName.substr(0, 2) === "./" || moduleName.substr(0, 3) === "../" || moduleName.substr(0, 2) === ".\\" || moduleName.substr(0, 3) === "..\\"; - } - function resolveExternalModuleName(location, moduleLiteral) { - var searchPath = ts.getDirectoryPath(getSourceFile(location).filename); - var moduleName = moduleLiteral.text; - if (!moduleName) - return; - var isRelative = isExternalModuleNameRelative(moduleName); - if (!isRelative) { - var symbol = getSymbol(globals, '"' + moduleName + '"', 128 /* ValueModule */); - if (symbol) { - return getResolvedExportSymbol(symbol); - } - } - while (true) { - var filename = ts.normalizePath(ts.combinePaths(searchPath, moduleName)); - var sourceFile = program.getSourceFile(filename + ".ts") || program.getSourceFile(filename + ".d.ts"); - if (sourceFile || isRelative) - break; - var parentPath = ts.getDirectoryPath(searchPath); - if (parentPath === searchPath) - break; - searchPath = parentPath; - } - if (sourceFile) { - if (sourceFile.symbol) { - return getResolvedExportSymbol(sourceFile.symbol); - } - error(moduleLiteral, ts.Diagnostics.File_0_is_not_an_external_module, sourceFile.filename); - return; - } - error(moduleLiteral, ts.Diagnostics.Cannot_find_external_module_0, moduleName); - } - function getResolvedExportSymbol(moduleSymbol) { - var symbol = getExportAssignmentSymbol(moduleSymbol); - if (symbol) { - if (symbol.flags & (ts.SymbolFlags.Value | ts.SymbolFlags.Type | ts.SymbolFlags.Namespace)) { - return symbol; - } - if (symbol.flags & 4194304 /* Import */) { - return resolveImport(symbol); - } - } - return moduleSymbol; - } - function getExportAssignmentSymbol(symbol) { - checkTypeOfExportAssignmentSymbol(symbol); - var symbolLinks = getSymbolLinks(symbol); - return symbolLinks.exportAssignSymbol === unknownSymbol ? undefined : symbolLinks.exportAssignSymbol; - } - function checkTypeOfExportAssignmentSymbol(containerSymbol) { - var symbolLinks = getSymbolLinks(containerSymbol); - if (!symbolLinks.exportAssignSymbol) { - var exportInformation = collectExportInformationForSourceFileOrModule(containerSymbol); - if (exportInformation.exportAssignments.length) { - if (exportInformation.exportAssignments.length > 1) { - ts.forEach(exportInformation.exportAssignments, function (node) { return error(node, ts.Diagnostics.A_module_cannot_have_more_than_one_export_assignment); }); - } - var node = exportInformation.exportAssignments[0]; - if (exportInformation.hasExportedMember) { - error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements); - } - if (node.exportName.text) { - var meaning = ts.SymbolFlags.Value | ts.SymbolFlags.Type | ts.SymbolFlags.Namespace; - var exportSymbol = resolveName(node, node.exportName.text, meaning, ts.Diagnostics.Cannot_find_name_0, ts.identifierToString(node.exportName)); - } - } - symbolLinks.exportAssignSymbol = exportSymbol || unknownSymbol; - } - } - function collectExportInformationForSourceFileOrModule(symbol) { - var seenExportedMember = false; - var result = []; - ts.forEach(symbol.declarations, function (declaration) { - var block = (declaration.kind === 182 /* SourceFile */ ? declaration : declaration.body); - ts.forEach(block.statements, function (node) { - if (node.kind === 180 /* ExportAssignment */) { - result.push(node); - } - else { - seenExportedMember = seenExportedMember || (node.flags & 1 /* Export */) !== 0; - } - }); - }); - return { - hasExportedMember: seenExportedMember, - exportAssignments: result - }; - } - function getMergedSymbol(symbol) { - var merged; - return symbol && symbol.mergeId && (merged = mergedSymbols[symbol.mergeId]) ? merged : symbol; - } - function getSymbolOfNode(node) { - return getMergedSymbol(node.symbol); - } - function getParentOfSymbol(symbol) { - return getMergedSymbol(symbol.parent); - } - function getExportSymbolOfValueSymbolIfExported(symbol) { - return symbol && (symbol.flags & 524288 /* ExportValue */) !== 0 ? getMergedSymbol(symbol.exportSymbol) : symbol; - } - function symbolIsValue(symbol) { - if (symbol.flags & ts.SymbolFlags.Value) { - return true; - } - if (symbol.flags & 4194304 /* Import */) { - return (resolveImport(symbol).flags & ts.SymbolFlags.Value) !== 0; - } - if (symbol.flags & 8388608 /* Instantiated */) { - return (getSymbolLinks(symbol).target.flags & ts.SymbolFlags.Value) !== 0; - } - return false; - } - function findConstructorDeclaration(node) { - var members = node.members; - for (var i = 0; i < members.length; i++) { - var member = members[i]; - if (member.kind === 121 /* Constructor */ && member.body) { - return member; - } - } - } - function createType(flags) { - var result = new Type(checker, flags); - result.id = typeCount++; - return result; - } - function createIntrinsicType(kind, intrinsicName) { - var type = createType(kind); - type.intrinsicName = intrinsicName; - return type; - } - function createObjectType(kind, symbol) { - var type = createType(kind); - type.symbol = symbol; - return type; - } - function isReservedMemberName(name) { - return name.charCodeAt(0) === 95 /* _ */ && name.charCodeAt(1) === 95 /* _ */ && name.charCodeAt(2) !== 95 /* _ */; - } - function getNamedMembers(members) { - var result; - for (var id in members) { - if (ts.hasProperty(members, id)) { - if (!isReservedMemberName(id)) { - if (!result) - result = []; - var symbol = members[id]; - if (symbolIsValue(symbol)) { - result.push(symbol); - } - } - } - } - return result || emptyArray; - } - function setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType) { - type.members = members; - type.properties = getNamedMembers(members); - type.callSignatures = callSignatures; - type.constructSignatures = constructSignatures; - if (stringIndexType) - type.stringIndexType = stringIndexType; - if (numberIndexType) - type.numberIndexType = numberIndexType; - return type; - } - function createAnonymousType(symbol, members, callSignatures, constructSignatures, stringIndexType, numberIndexType) { - return setObjectTypeMembers(createObjectType(16384 /* Anonymous */, symbol), members, callSignatures, constructSignatures, stringIndexType, numberIndexType); - } - function isOptionalProperty(propertySymbol) { - return propertySymbol.valueDeclaration && propertySymbol.valueDeclaration.flags & 4 /* QuestionMark */ && propertySymbol.valueDeclaration.kind !== 118 /* Parameter */; - } - function forEachSymbolTableInScope(enclosingDeclaration, callback) { - var result; - for (var location = enclosingDeclaration; location; location = location.parent) { - if (location.locals && !isGlobalSourceFile(location)) { - if (result = callback(location.locals)) { - return result; - } - } - switch (location.kind) { - case 182 /* SourceFile */: - if (!ts.isExternalModule(location)) { - break; - } - case 177 /* ModuleDeclaration */: - if (result = callback(getSymbolOfNode(location).exports)) { - return result; - } - break; - case 174 /* ClassDeclaration */: - case 175 /* InterfaceDeclaration */: - if (result = callback(getSymbolOfNode(location).members)) { - return result; - } - break; - } - } - return callback(globals); - } - function getQualifiedLeftMeaning(rightMeaning) { - return rightMeaning === ts.SymbolFlags.Value ? ts.SymbolFlags.Value : ts.SymbolFlags.Namespace; - } - function getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning, useOnlyExternalAliasing) { - function getAccessibleSymbolChainFromSymbolTable(symbols) { - function canQualifySymbol(symbolFromSymbolTable, meaning) { - if (!needsQualification(symbolFromSymbolTable, enclosingDeclaration, meaning)) { - return true; - } - var accessibleParent = getAccessibleSymbolChain(symbolFromSymbolTable.parent, enclosingDeclaration, getQualifiedLeftMeaning(meaning), useOnlyExternalAliasing); - return !!accessibleParent; - } - function isAccessible(symbolFromSymbolTable, resolvedAliasSymbol) { - if (symbol === (resolvedAliasSymbol || symbolFromSymbolTable)) { - return !ts.forEach(symbolFromSymbolTable.declarations, function (declaration) { return hasExternalModuleSymbol(declaration); }) && canQualifySymbol(symbolFromSymbolTable, meaning); - } - } - if (isAccessible(ts.lookUp(symbols, symbol.name))) { - return [symbol]; - } - return ts.forEachValue(symbols, function (symbolFromSymbolTable) { - if (symbolFromSymbolTable.flags & 4194304 /* Import */) { - if (!useOnlyExternalAliasing || ts.forEach(symbolFromSymbolTable.declarations, function (declaration) { return declaration.kind === 179 /* ImportDeclaration */ && declaration.externalModuleName; })) { - var resolvedImportedSymbol = resolveImport(symbolFromSymbolTable); - if (isAccessible(symbolFromSymbolTable, resolveImport(symbolFromSymbolTable))) { - return [symbolFromSymbolTable]; - } - var accessibleSymbolsFromExports = resolvedImportedSymbol.exports ? getAccessibleSymbolChainFromSymbolTable(resolvedImportedSymbol.exports) : undefined; - if (accessibleSymbolsFromExports && canQualifySymbol(symbolFromSymbolTable, getQualifiedLeftMeaning(meaning))) { - return [symbolFromSymbolTable].concat(accessibleSymbolsFromExports); - } - } - } - }); - } - if (symbol) { - return forEachSymbolTableInScope(enclosingDeclaration, getAccessibleSymbolChainFromSymbolTable); - } - } - function needsQualification(symbol, enclosingDeclaration, meaning) { - var qualify = false; - forEachSymbolTableInScope(enclosingDeclaration, function (symbolTable) { - if (!ts.hasProperty(symbolTable, symbol.name)) { - return false; - } - var symbolFromSymbolTable = symbolTable[symbol.name]; - if (symbolFromSymbolTable === symbol) { - return true; - } - symbolFromSymbolTable = (symbolFromSymbolTable.flags & 4194304 /* Import */) ? resolveImport(symbolFromSymbolTable) : symbolFromSymbolTable; - if (symbolFromSymbolTable.flags & meaning) { - qualify = true; - return true; - } - return false; - }); - return qualify; - } - function isSymbolAccessible(symbol, enclosingDeclaration, meaning) { - if (symbol && enclosingDeclaration && !(symbol.flags & 262144 /* TypeParameter */)) { - var initialSymbol = symbol; - var meaningToLook = meaning; - while (symbol) { - var accessibleSymbolChain = getAccessibleSymbolChain(symbol, enclosingDeclaration, meaningToLook, false); - if (accessibleSymbolChain) { - var hasAccessibleDeclarations = hasVisibleDeclarations(accessibleSymbolChain[0]); - if (!hasAccessibleDeclarations) { - return { - accessibility: 1 /* NotAccessible */, - errorSymbolName: symbolToString(initialSymbol, enclosingDeclaration, meaning), - errorModuleName: symbol !== initialSymbol ? symbolToString(symbol, enclosingDeclaration, ts.SymbolFlags.Namespace) : undefined - }; - } - return { accessibility: 0 /* Accessible */, aliasesToMakeVisible: hasAccessibleDeclarations.aliasesToMakeVisible }; - } - meaningToLook = getQualifiedLeftMeaning(meaning); - symbol = getParentOfSymbol(symbol); - } - var symbolExternalModule = ts.forEach(initialSymbol.declarations, function (declaration) { return getExternalModuleContainer(declaration); }); - if (symbolExternalModule) { - var enclosingExternalModule = getExternalModuleContainer(enclosingDeclaration); - if (symbolExternalModule !== enclosingExternalModule) { - return { - accessibility: 2 /* CannotBeNamed */, - errorSymbolName: symbolToString(initialSymbol, enclosingDeclaration, meaning), - errorModuleName: symbolToString(symbolExternalModule) - }; - } - } - return { - accessibility: 1 /* NotAccessible */, - errorSymbolName: symbolToString(initialSymbol, enclosingDeclaration, meaning) - }; - } - return { accessibility: 0 /* Accessible */ }; - function getExternalModuleContainer(declaration) { - for (; declaration; declaration = declaration.parent) { - if (hasExternalModuleSymbol(declaration)) { - return getSymbolOfNode(declaration); - } - } - } - } - function hasExternalModuleSymbol(declaration) { - return (declaration.kind === 177 /* ModuleDeclaration */ && declaration.name.kind === 7 /* StringLiteral */) || (declaration.kind === 182 /* SourceFile */ && ts.isExternalModule(declaration)); - } - function hasVisibleDeclarations(symbol) { - var aliasesToMakeVisible; - if (ts.forEach(symbol.declarations, function (declaration) { return !getIsDeclarationVisible(declaration); })) { - return undefined; - } - return { aliasesToMakeVisible: aliasesToMakeVisible }; - function getIsDeclarationVisible(declaration) { - if (!isDeclarationVisible(declaration)) { - if (declaration.kind === 179 /* ImportDeclaration */ && !(declaration.flags & 1 /* Export */) && isDeclarationVisible(declaration.parent)) { - getNodeLinks(declaration).isVisible = true; - if (aliasesToMakeVisible) { - if (!ts.contains(aliasesToMakeVisible, declaration)) { - aliasesToMakeVisible.push(declaration); - } - } - else { - aliasesToMakeVisible = [declaration]; - } - return true; - } - return false; - } - return true; - } - } - function isImportDeclarationEntityNameReferenceDeclarationVisible(entityName) { - var firstIdentifier = getFirstIdentifier(entityName); - var firstIdentifierName = ts.identifierToString(firstIdentifier); - var symbolOfNameSpace = resolveName(entityName.parent, firstIdentifier.text, ts.SymbolFlags.Namespace, ts.Diagnostics.Cannot_find_name_0, firstIdentifierName); - var hasNamespaceDeclarationsVisibile = hasVisibleDeclarations(symbolOfNameSpace); - return hasNamespaceDeclarationsVisibile ? { accessibility: 0 /* Accessible */, aliasesToMakeVisible: hasNamespaceDeclarationsVisibile.aliasesToMakeVisible } : { accessibility: 1 /* NotAccessible */, errorSymbolName: firstIdentifierName }; - } - function releaseStringWriter(writer) { - writer.clear(); - stringWriters.push(writer); - } - function writeKeyword(writer, kind) { - writer.writeKind(ts.tokenToString(kind), 5 /* keyword */); - } - function writePunctuation(writer, kind) { - writer.writeKind(ts.tokenToString(kind), 15 /* punctuation */); - } - function writeOperator(writer, kind) { - writer.writeKind(ts.tokenToString(kind), 12 /* operator */); - } - function writeSpace(writer) { - writer.writeKind(" ", 16 /* space */); - } - function symbolToString(symbol, enclosingDeclaration, meaning) { - var writer = getSingleLineStringWriter(); - writeSymbol(symbol, writer, enclosingDeclaration, meaning); - var result = writer.string(); - releaseStringWriter(writer); - return result; - } - function writeSymbol(symbol, writer, enclosingDeclaration, meaning, flags) { - var parentSymbol; - function writeSymbolName(symbol) { - if (parentSymbol) { - if (flags & 1 /* WriteTypeParametersOrArguments */) { - if (symbol.flags & 8388608 /* Instantiated */) { - writeTypeArguments(getTypeParametersOfClassOrInterface(parentSymbol), symbol.mapper, writer, enclosingDeclaration); - } - else { - writeTypeParametersOfSymbol(parentSymbol, writer, enclosingDeclaration); - } - } - writePunctuation(writer, 15 /* DotToken */); - } - parentSymbol = symbol; - if (symbol.declarations && symbol.declarations.length > 0) { - var declaration = symbol.declarations[0]; - if (declaration.name) { - writer.writeSymbol(ts.identifierToString(declaration.name), symbol); - return; - } - } - writer.writeSymbol(symbol.name, symbol); - } - writer.trackSymbol(symbol, enclosingDeclaration, meaning); - function walkSymbol(symbol, meaning) { - if (symbol) { - var accessibleSymbolChain = getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning, !!(flags & 2 /* UseOnlyExternalAliasing */)); - if (!accessibleSymbolChain || needsQualification(accessibleSymbolChain[0], enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) { - walkSymbol(getParentOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol), getQualifiedLeftMeaning(meaning)); - } - if (accessibleSymbolChain) { - for (var i = 0, n = accessibleSymbolChain.length; i < n; i++) { - writeSymbolName(accessibleSymbolChain[i]); - } - } - else { - if (!parentSymbol && ts.forEach(symbol.declarations, function (declaration) { return hasExternalModuleSymbol(declaration); })) { - return; - } - if (symbol.flags & 512 /* TypeLiteral */ || symbol.flags & 1024 /* ObjectLiteral */) { - return; - } - writeSymbolName(symbol); - } - } - } - if (enclosingDeclaration && !(symbol.flags & 262144 /* TypeParameter */)) { - walkSymbol(symbol, meaning); - return; - } - return writeSymbolName(symbol); - } - function typeToString(type, enclosingDeclaration, flags) { - var writer = getSingleLineStringWriter(); - writeType(type, writer, enclosingDeclaration, flags); - var result = writer.string(); - releaseStringWriter(writer); - var maxLength = compilerOptions.noErrorTruncation || flags & 4 /* NoTruncation */ ? undefined : 100; - if (maxLength && result.length >= maxLength) { - result = result.substr(0, maxLength - "...".length) + "..."; - } - return result; - } - function writeType(type, writer, enclosingDeclaration, flags, typeStack) { - return writeType(type, flags | 8 /* WriteArrowStyleSignature */); - function writeType(type, flags) { - if (type.flags & ts.TypeFlags.Intrinsic) { - writer.writeKind(!(flags & 16 /* WriteOwnNameForAnyLike */) && (type.flags & 1 /* Any */) ? "any" : type.intrinsicName, 5 /* keyword */); - } - else if (type.flags & 4096 /* Reference */) { - writeTypeReference(type); - } - else if (type.flags & (1024 /* Class */ | 2048 /* Interface */ | 128 /* Enum */ | 512 /* TypeParameter */)) { - writeSymbol(type.symbol, writer, enclosingDeclaration, ts.SymbolFlags.Type); - } - else if (type.flags & 8192 /* Tuple */) { - writeTupleType(type); - } - else if (type.flags & 16384 /* Anonymous */) { - writeAnonymousType(type, flags); - } - else if (type.flags & 256 /* StringLiteral */) { - writer.writeKind(type.text, 8 /* stringLiteral */); - } - else { - writePunctuation(writer, 9 /* OpenBraceToken */); - writeSpace(writer); - writePunctuation(writer, 16 /* DotDotDotToken */); - writeSpace(writer); - writePunctuation(writer, 10 /* CloseBraceToken */); - } - } - function writeTypeList(types) { - for (var i = 0; i < types.length; i++) { - if (i > 0) { - writePunctuation(writer, 18 /* CommaToken */); - writeSpace(writer); - } - writeType(types[i], flags | 8 /* WriteArrowStyleSignature */); - } - } - function writeTypeReference(type) { - if (type.target === globalArrayType && !(flags & 1 /* WriteArrayAsGenericType */)) { - writeType(type.typeArguments[0], flags & ~8 /* WriteArrowStyleSignature */); - writePunctuation(writer, 13 /* OpenBracketToken */); - writePunctuation(writer, 14 /* CloseBracketToken */); - } - else { - writeSymbol(type.target.symbol, writer, enclosingDeclaration, ts.SymbolFlags.Type); - writePunctuation(writer, 19 /* LessThanToken */); - writeTypeList(type.typeArguments); - writePunctuation(writer, 20 /* GreaterThanToken */); - } - } - function writeTupleType(type) { - writePunctuation(writer, 13 /* OpenBracketToken */); - writeTypeList(type.elementTypes); - writePunctuation(writer, 14 /* CloseBracketToken */); - } - function writeAnonymousType(type, flags) { - if (type.symbol && type.symbol.flags & (16 /* Class */ | 64 /* Enum */ | 128 /* ValueModule */)) { - writeTypeofSymbol(type); - } - else if (shouldWriteTypeOfFunctionSymbol()) { - writeTypeofSymbol(type); - } - else if (typeStack && ts.contains(typeStack, type)) { - writeKeyword(writer, 105 /* AnyKeyword */); - } - else { - if (!typeStack) { - typeStack = []; - } - typeStack.push(type); - writeLiteralType(type, flags); - typeStack.pop(); - } - function shouldWriteTypeOfFunctionSymbol() { - if (type.symbol) { - var isStaticMethodSymbol = !!(type.symbol.flags & 2048 /* Method */ && ts.forEach(type.symbol.declarations, function (declaration) { return declaration.flags & 128 /* Static */; })); - var isNonLocalFunctionSymbol = !!(type.symbol.flags & 8 /* Function */) && (type.symbol.parent || ts.forEach(type.symbol.declarations, function (declaration) { return declaration.parent.kind === 182 /* SourceFile */ || declaration.parent.kind === 178 /* ModuleBlock */; })); - if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { - return !!(flags & 2 /* UseTypeOfFunction */) || (typeStack && ts.contains(typeStack, type)); - } - } - } - } - function writeTypeofSymbol(type) { - writeKeyword(writer, 91 /* TypeOfKeyword */); - writeSpace(writer); - writeSymbol(type.symbol, writer, enclosingDeclaration, ts.SymbolFlags.Value); - } - function writeLiteralType(type, flags) { - var resolved = resolveObjectTypeMembers(type); - if (!resolved.properties.length && !resolved.stringIndexType && !resolved.numberIndexType) { - if (!resolved.callSignatures.length && !resolved.constructSignatures.length) { - writePunctuation(writer, 9 /* OpenBraceToken */); - writePunctuation(writer, 10 /* CloseBraceToken */); - return; - } - if (flags & 8 /* WriteArrowStyleSignature */) { - if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { - writeSignature(resolved.callSignatures[0], writer, enclosingDeclaration, flags, typeStack); - return; - } - if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { - writeKeyword(writer, 82 /* NewKeyword */); - writeSpace(writer); - writeSignature(resolved.constructSignatures[0], writer, enclosingDeclaration, flags, typeStack); - return; - } - } - } - writePunctuation(writer, 9 /* OpenBraceToken */); - writer.writeLine(); - writer.increaseIndent(); - for (var i = 0; i < resolved.callSignatures.length; i++) { - writeSignature(resolved.callSignatures[i], writer, enclosingDeclaration, flags & ~8 /* WriteArrowStyleSignature */, typeStack); - writePunctuation(writer, 17 /* SemicolonToken */); - writer.writeLine(); - } - for (var i = 0; i < resolved.constructSignatures.length; i++) { - writeKeyword(writer, 82 /* NewKeyword */); - writeSpace(writer); - writeSignature(resolved.constructSignatures[i], writer, enclosingDeclaration, flags & ~8 /* WriteArrowStyleSignature */, typeStack); - writePunctuation(writer, 17 /* SemicolonToken */); - writer.writeLine(); - } - if (resolved.stringIndexType) { - writePunctuation(writer, 13 /* OpenBracketToken */); - writer.writeKind("x", 13 /* parameterName */); - writePunctuation(writer, 46 /* ColonToken */); - writeSpace(writer); - writeKeyword(writer, 114 /* StringKeyword */); - writePunctuation(writer, 14 /* CloseBracketToken */); - writePunctuation(writer, 46 /* ColonToken */); - writeSpace(writer); - writeType(resolved.stringIndexType, flags | 8 /* WriteArrowStyleSignature */); - writePunctuation(writer, 17 /* SemicolonToken */); - writer.writeLine(); - } - if (resolved.numberIndexType) { - writePunctuation(writer, 13 /* OpenBracketToken */); - writer.writeKind("x", 13 /* parameterName */); - writePunctuation(writer, 46 /* ColonToken */); - writeSpace(writer); - writeKeyword(writer, 112 /* NumberKeyword */); - writePunctuation(writer, 14 /* CloseBracketToken */); - writePunctuation(writer, 46 /* ColonToken */); - writeSpace(writer); - writeType(resolved.numberIndexType, flags | 8 /* WriteArrowStyleSignature */); - writePunctuation(writer, 17 /* SemicolonToken */); - writer.writeLine(); - } - for (var i = 0; i < resolved.properties.length; i++) { - var p = resolved.properties[i]; - var t = getTypeOfSymbol(p); - if (p.flags & (8 /* Function */ | 2048 /* Method */) && !getPropertiesOfType(t).length) { - var signatures = getSignaturesOfType(t, 0 /* Call */); - for (var j = 0; j < signatures.length; j++) { - writeSymbol(p, writer); - if (isOptionalProperty(p)) { - writePunctuation(writer, 45 /* QuestionToken */); - } - writeSignature(signatures[j], writer, enclosingDeclaration, flags & ~8 /* WriteArrowStyleSignature */, typeStack); - writePunctuation(writer, 17 /* SemicolonToken */); - writer.writeLine(); - } - } - else { - writeSymbol(p, writer); - if (isOptionalProperty(p)) { - writePunctuation(writer, 45 /* QuestionToken */); - } - writePunctuation(writer, 46 /* ColonToken */); - writeSpace(writer); - writeType(t, flags | 8 /* WriteArrowStyleSignature */); - writePunctuation(writer, 17 /* SemicolonToken */); - writer.writeLine(); - } - } - writer.decreaseIndent(); - writePunctuation(writer, 10 /* CloseBraceToken */); - } - } - function writeTypeParameter(tp, writer, enclosingDeclaration, flags, typeStack) { - writeSymbol(tp.symbol, writer); - var constraint = getConstraintOfTypeParameter(tp); - if (constraint) { - writeSpace(writer); - writeKeyword(writer, 73 /* ExtendsKeyword */); - writeSpace(writer); - writeType(constraint, writer, enclosingDeclaration, flags, typeStack); - } - } - function writeTypeParameters(typeParameters, writer, enclosingDeclaration, flags, typeStack) { - if (typeParameters && typeParameters.length) { - writePunctuation(writer, 19 /* LessThanToken */); - for (var i = 0; i < typeParameters.length; i++) { - if (i > 0) { - writePunctuation(writer, 18 /* CommaToken */); - writeSpace(writer); - } - writeTypeParameter(typeParameters[i], writer, enclosingDeclaration, flags, typeStack); - } - writePunctuation(writer, 20 /* GreaterThanToken */); - } - } - function writeTypeArguments(typeParameters, mapper, writer, enclosingDeclaration, flags, typeStack) { - if (typeParameters && typeParameters.length) { - writePunctuation(writer, 19 /* LessThanToken */); - for (var i = 0; i < typeParameters.length; i++) { - if (i > 0) { - writePunctuation(writer, 18 /* CommaToken */); - writeSpace(writer); - } - writeType(mapper(typeParameters[i]), writer, enclosingDeclaration, 8 /* WriteArrowStyleSignature */); - } - writePunctuation(writer, 20 /* GreaterThanToken */); - } - } - function writeTypeParametersOfSymbol(symbol, writer, enclosingDeclaraiton, flags) { - var rootSymbol = getRootSymbol(symbol); - if (rootSymbol.flags & 16 /* Class */ || rootSymbol.flags & 32 /* Interface */) { - writeTypeParameters(getTypeParametersOfClassOrInterface(symbol), writer, enclosingDeclaraiton, flags); - } - } - function writeSignature(signature, writer, enclosingDeclaration, flags, typeStack) { - if (signature.target && (flags & 32 /* WriteTypeArgumentsOfSignature */)) { - writeTypeArguments(signature.target.typeParameters, signature.mapper, writer, enclosingDeclaration); - } - else { - writeTypeParameters(signature.typeParameters, writer, enclosingDeclaration, flags, typeStack); - } - writePunctuation(writer, 11 /* OpenParenToken */); - for (var i = 0; i < signature.parameters.length; i++) { - if (i > 0) { - writePunctuation(writer, 18 /* CommaToken */); - writeSpace(writer); - } - var p = signature.parameters[i]; - if (getDeclarationFlagsFromSymbol(p) & 8 /* Rest */) { - writePunctuation(writer, 16 /* DotDotDotToken */); - } - writeSymbol(p, writer); - if (p.valueDeclaration.flags & 4 /* QuestionMark */ || p.valueDeclaration.initializer) { - writePunctuation(writer, 45 /* QuestionToken */); - } - writePunctuation(writer, 46 /* ColonToken */); - writeSpace(writer); - writeType(getTypeOfSymbol(p), writer, enclosingDeclaration, flags, typeStack); - } - writePunctuation(writer, 12 /* CloseParenToken */); - if (flags & 8 /* WriteArrowStyleSignature */) { - writeSpace(writer); - writePunctuation(writer, 27 /* EqualsGreaterThanToken */); - } - else { - writePunctuation(writer, 46 /* ColonToken */); - } - writeSpace(writer); - writeType(getReturnTypeOfSignature(signature), writer, enclosingDeclaration, flags, typeStack); - } - function isDeclarationVisible(node) { - function getContainingExternalModule(node) { - for (; node; node = node.parent) { - if (node.kind === 177 /* ModuleDeclaration */) { - if (node.name.kind === 7 /* StringLiteral */) { - return node; - } - } - else if (node.kind === 182 /* SourceFile */) { - return ts.isExternalModule(node) ? node : undefined; - } - } - ts.Debug.fail("getContainingModule cant reach here"); - } - function isUsedInExportAssignment(node) { - var externalModule = getContainingExternalModule(node); - if (externalModule) { - var externalModuleSymbol = getSymbolOfNode(externalModule); - var exportAssignmentSymbol = getExportAssignmentSymbol(externalModuleSymbol); - var resolvedExportSymbol; - var symbolOfNode = getSymbolOfNode(node); - if (isSymbolUsedInExportAssignment(symbolOfNode)) { - return true; - } - if (symbolOfNode.flags & 4194304 /* Import */) { - return isSymbolUsedInExportAssignment(resolveImport(symbolOfNode)); - } - } - function isSymbolUsedInExportAssignment(symbol) { - if (exportAssignmentSymbol === symbol) { - return true; - } - if (exportAssignmentSymbol && !!(exportAssignmentSymbol.flags & 4194304 /* Import */)) { - resolvedExportSymbol = resolvedExportSymbol || resolveImport(exportAssignmentSymbol); - if (resolvedExportSymbol === symbol) { - return true; - } - return ts.forEach(resolvedExportSymbol.declarations, function (declaration) { - while (declaration) { - if (declaration === node) { - return true; - } - declaration = declaration.parent; - } - }); - } - } - } - function determineIfDeclarationIsVisible() { - switch (node.kind) { - case 171 /* VariableDeclaration */: - case 177 /* ModuleDeclaration */: - case 174 /* ClassDeclaration */: - case 175 /* InterfaceDeclaration */: - case 172 /* FunctionDeclaration */: - case 176 /* EnumDeclaration */: - case 179 /* ImportDeclaration */: - var parent = node.kind === 171 /* VariableDeclaration */ ? node.parent.parent : node.parent; - if (!(node.flags & 1 /* Export */) && !(node.kind !== 179 /* ImportDeclaration */ && parent.kind !== 182 /* SourceFile */ && ts.isInAmbientContext(parent))) { - return isGlobalSourceFile(parent) || isUsedInExportAssignment(node); - } - return isDeclarationVisible(parent); - case 119 /* Property */: - case 120 /* Method */: - if (node.flags & (32 /* Private */ | 64 /* Protected */)) { - return false; - } - case 121 /* Constructor */: - case 125 /* ConstructSignature */: - case 124 /* CallSignature */: - case 126 /* IndexSignature */: - case 118 /* Parameter */: - case 178 /* ModuleBlock */: - return isDeclarationVisible(node.parent); - case 182 /* SourceFile */: - return true; - default: - ts.Debug.fail("isDeclarationVisible unknown: SyntaxKind: " + ts.SyntaxKind[node.kind]); - } - } - if (node) { - var links = getNodeLinks(node); - if (links.isVisible === undefined) { - links.isVisible = !!determineIfDeclarationIsVisible(); - } - return links.isVisible; - } - } - function getApparentType(type) { - if (type.flags & 512 /* TypeParameter */) { - do { - type = getConstraintOfTypeParameter(type); - } while (type && type.flags & 512 /* TypeParameter */); - if (!type) - type = emptyObjectType; - } - if (type.flags & ts.TypeFlags.StringLike) { - type = globalStringType; - } - else if (type.flags & ts.TypeFlags.NumberLike) { - type = globalNumberType; - } - else if (type.flags & 8 /* Boolean */) { - type = globalBooleanType; - } - return type; - } - function getTypeOfPrototypeProperty(prototype) { - var classType = getDeclaredTypeOfSymbol(prototype.parent); - return classType.typeParameters ? createTypeReference(classType, ts.map(classType.typeParameters, function (_) { return anyType; })) : classType; - } - function getTypeOfVariableDeclaration(declaration) { - if (declaration.parent.kind === 156 /* ForInStatement */) { - return anyType; - } - if (declaration.type) { - return getTypeFromTypeNode(declaration.type); - } - if (declaration.kind === 118 /* Parameter */) { - var func = declaration.parent; - if (func.kind === 123 /* SetAccessor */) { - var getter = getDeclarationOfKind(declaration.parent.symbol, 122 /* GetAccessor */); - if (getter) { - return getReturnTypeOfSignature(getSignatureFromDeclaration(getter)); - } - } - var type = getContextuallyTypedParameterType(declaration); - if (type) { - return type; - } - } - if (declaration.initializer) { - var type = checkAndMarkExpression(declaration.initializer); - if (declaration.kind !== 134 /* PropertyAssignment */) { - var unwidenedType = type; - type = getWidenedType(type); - if (type !== unwidenedType) { - checkImplicitAny(type); - } - } - return type; - } - var type = declaration.flags & 8 /* Rest */ ? createArrayType(anyType) : anyType; - checkImplicitAny(type); - return type; - function checkImplicitAny(type) { - if (!fullTypeCheck || !compilerOptions.noImplicitAny) { - return; - } - if (getInnermostTypeOfNestedArrayTypes(type) !== anyType) { - return; - } - if (isPrivateWithinAmbient(declaration) || (declaration.kind === 118 /* Parameter */ && isPrivateWithinAmbient(declaration.parent))) { - return; - } - switch (declaration.kind) { - case 119 /* Property */: - var diagnostic = ts.Diagnostics.Member_0_implicitly_has_an_1_type; - break; - case 118 /* Parameter */: - var diagnostic = declaration.flags & 8 /* Rest */ ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type; - break; - default: - var diagnostic = ts.Diagnostics.Variable_0_implicitly_has_an_1_type; - } - error(declaration, diagnostic, ts.identifierToString(declaration.name), typeToString(type)); - } - } - function getTypeOfVariableOrParameterOrProperty(symbol) { - var links = getSymbolLinks(symbol); - if (!links.type) { - if (symbol.flags & 67108864 /* Prototype */) { - return links.type = getTypeOfPrototypeProperty(symbol); - } - var declaration = symbol.valueDeclaration; - if (declaration.kind === 168 /* CatchBlock */) { - return links.type = anyType; - } - links.type = resolvingType; - var type = getTypeOfVariableDeclaration(declaration); - if (links.type === resolvingType) { - links.type = type; - } - } - else if (links.type === resolvingType) { - links.type = anyType; - if (compilerOptions.noImplicitAny) { - var diagnostic = symbol.valueDeclaration.type ? ts.Diagnostics._0_implicitly_has_type_any_because_it_is_referenced_directly_or_indirectly_in_its_own_type_annotation : ts.Diagnostics._0_implicitly_has_type_any_because_it_is_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer; - error(symbol.valueDeclaration, diagnostic, symbolToString(symbol)); - } - } - return links.type; - } - function getSetAccessorTypeAnnotationNode(accessor) { - return accessor && accessor.parameters.length > 0 && accessor.parameters[0].type; - } - function getAnnotatedAccessorType(accessor) { - if (accessor) { - if (accessor.kind === 122 /* GetAccessor */) { - return accessor.type && getTypeFromTypeNode(accessor.type); - } - else { - var setterTypeAnnotation = getSetAccessorTypeAnnotationNode(accessor); - return setterTypeAnnotation && getTypeFromTypeNode(setterTypeAnnotation); - } - } - return undefined; - } - function getTypeOfAccessors(symbol) { - var links = getSymbolLinks(symbol); - checkAndStoreTypeOfAccessors(symbol, links); - return links.type; - } - function checkAndStoreTypeOfAccessors(symbol, links) { - links = links || getSymbolLinks(symbol); - if (!links.type) { - links.type = resolvingType; - var getter = getDeclarationOfKind(symbol, 122 /* GetAccessor */); - var setter = getDeclarationOfKind(symbol, 123 /* SetAccessor */); - var type; - var getterReturnType = getAnnotatedAccessorType(getter); - if (getterReturnType) { - type = getterReturnType; - } - else { - var setterParameterType = getAnnotatedAccessorType(setter); - if (setterParameterType) { - type = setterParameterType; - } - else { - if (getter) { - type = getReturnTypeFromBody(getter); - } - else { - if (compilerOptions.noImplicitAny) { - error(setter, ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_type_annotation, symbolToString(symbol)); - } - type = anyType; - } - } - } - if (links.type === resolvingType) { - links.type = type; - } - } - else if (links.type === resolvingType) { - links.type = anyType; - if (compilerOptions.noImplicitAny) { - var getter = getDeclarationOfKind(symbol, 122 /* GetAccessor */); - error(getter, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol)); - } - } - } - function getTypeOfFuncClassEnumModule(symbol) { - var links = getSymbolLinks(symbol); - if (!links.type) { - links.type = createObjectType(16384 /* Anonymous */, symbol); - } - return links.type; - } - function getTypeOfEnumMember(symbol) { - var links = getSymbolLinks(symbol); - if (!links.type) { - links.type = getDeclaredTypeOfEnum(getParentOfSymbol(symbol)); - } - return links.type; - } - function getTypeOfImport(symbol) { - var links = getSymbolLinks(symbol); - if (!links.type) { - links.type = getTypeOfSymbol(resolveImport(symbol)); - } - return links.type; - } - function getTypeOfInstantiatedSymbol(symbol) { - var links = getSymbolLinks(symbol); - if (!links.type) { - links.type = instantiateType(getTypeOfSymbol(links.target), links.mapper); - } - return links.type; - } - function getTypeOfSymbol(symbol) { - if (symbol.flags & (1 /* Variable */ | 2 /* Property */)) { - return getTypeOfVariableOrParameterOrProperty(symbol); - } - if (symbol.flags & (8 /* Function */ | 2048 /* Method */ | 16 /* Class */ | 64 /* Enum */ | 128 /* ValueModule */)) { - return getTypeOfFuncClassEnumModule(symbol); - } - if (symbol.flags & 4 /* EnumMember */) { - return getTypeOfEnumMember(symbol); - } - if (symbol.flags & ts.SymbolFlags.Accessor) { - return getTypeOfAccessors(symbol); - } - if (symbol.flags & 4194304 /* Import */) { - return getTypeOfImport(symbol); - } - if (symbol.flags & 8388608 /* Instantiated */) { - return getTypeOfInstantiatedSymbol(symbol); - } - return unknownType; - } - function getTargetType(type) { - return type.flags & 4096 /* Reference */ ? type.target : type; - } - function hasBaseType(type, checkBase) { - return check(type); - function check(type) { - var target = getTargetType(type); - return target === checkBase || ts.forEach(target.baseTypes, check); - } - } - function getTypeParametersOfClassOrInterface(symbol) { - var result; - ts.forEach(symbol.declarations, function (node) { - if (node.kind === 175 /* InterfaceDeclaration */ || node.kind === 174 /* ClassDeclaration */) { - var declaration = node; - if (declaration.typeParameters && declaration.typeParameters.length) { - ts.forEach(declaration.typeParameters, function (node) { - var tp = getDeclaredTypeOfTypeParameter(getSymbolOfNode(node)); - if (!result) { - result = [tp]; - } - else if (!ts.contains(result, tp)) { - result.push(tp); - } - }); - } - } - }); - return result; - } - function getDeclaredTypeOfClass(symbol) { - var links = getSymbolLinks(symbol); - if (!links.declaredType) { - var type = links.declaredType = createObjectType(1024 /* Class */, symbol); - var typeParameters = getTypeParametersOfClassOrInterface(symbol); - if (typeParameters) { - type.flags |= 4096 /* Reference */; - type.typeParameters = typeParameters; - type.instantiations = {}; - type.instantiations[getTypeListId(type.typeParameters)] = type; - type.target = type; - type.typeArguments = type.typeParameters; - } - type.baseTypes = []; - var declaration = getDeclarationOfKind(symbol, 174 /* ClassDeclaration */); - if (declaration.baseType) { - var baseType = getTypeFromTypeReferenceNode(declaration.baseType); - if (baseType !== unknownType) { - if (getTargetType(baseType).flags & 1024 /* Class */) { - if (type !== baseType && !hasBaseType(baseType, type)) { - type.baseTypes.push(baseType); - } - else { - error(declaration, ts.Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, undefined, 1 /* WriteArrayAsGenericType */)); - } - } - else { - error(declaration.baseType, ts.Diagnostics.A_class_may_only_extend_another_class); - } - } - } - type.declaredProperties = getNamedMembers(symbol.members); - type.declaredCallSignatures = emptyArray; - type.declaredConstructSignatures = emptyArray; - type.declaredStringIndexType = getIndexTypeOfSymbol(symbol, 0 /* String */); - type.declaredNumberIndexType = getIndexTypeOfSymbol(symbol, 1 /* Number */); - } - return links.declaredType; - } - function getDeclaredTypeOfInterface(symbol) { - var links = getSymbolLinks(symbol); - if (!links.declaredType) { - var type = links.declaredType = createObjectType(2048 /* Interface */, symbol); - var typeParameters = getTypeParametersOfClassOrInterface(symbol); - if (typeParameters) { - type.flags |= 4096 /* Reference */; - type.typeParameters = typeParameters; - type.instantiations = {}; - type.instantiations[getTypeListId(type.typeParameters)] = type; - type.target = type; - type.typeArguments = type.typeParameters; - } - type.baseTypes = []; - ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 175 /* InterfaceDeclaration */ && declaration.baseTypes) { - ts.forEach(declaration.baseTypes, function (node) { - var baseType = getTypeFromTypeReferenceNode(node); - if (baseType !== unknownType) { - if (getTargetType(baseType).flags & (1024 /* Class */ | 2048 /* Interface */)) { - if (type !== baseType && !hasBaseType(baseType, type)) { - type.baseTypes.push(baseType); - } - else { - error(declaration, ts.Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, undefined, 1 /* WriteArrayAsGenericType */)); - } - } - else { - error(node, ts.Diagnostics.An_interface_may_only_extend_a_class_or_another_interface); - } - } - }); - } - }); - type.declaredProperties = getNamedMembers(symbol.members); - type.declaredCallSignatures = getSignaturesOfSymbol(symbol.members["__call"]); - type.declaredConstructSignatures = getSignaturesOfSymbol(symbol.members["__new"]); - type.declaredStringIndexType = getIndexTypeOfSymbol(symbol, 0 /* String */); - type.declaredNumberIndexType = getIndexTypeOfSymbol(symbol, 1 /* Number */); - } - return links.declaredType; - } - function getDeclaredTypeOfEnum(symbol) { - var links = getSymbolLinks(symbol); - if (!links.declaredType) { - var type = createType(128 /* Enum */); - type.symbol = symbol; - links.declaredType = type; - } - return links.declaredType; - } - function getDeclaredTypeOfTypeParameter(symbol) { - var links = getSymbolLinks(symbol); - if (!links.declaredType) { - var type = createType(512 /* TypeParameter */); - type.symbol = symbol; - if (!getDeclarationOfKind(symbol, 117 /* TypeParameter */).constraint) { - type.constraint = noConstraintType; - } - links.declaredType = type; - } - return links.declaredType; - } - function getDeclaredTypeOfImport(symbol) { - var links = getSymbolLinks(symbol); - if (!links.declaredType) { - links.declaredType = getDeclaredTypeOfSymbol(resolveImport(symbol)); - } - return links.declaredType; - } - function getDeclaredTypeOfSymbol(symbol) { - if (symbol.flags & 16 /* Class */) { - return getDeclaredTypeOfClass(symbol); - } - if (symbol.flags & 32 /* Interface */) { - return getDeclaredTypeOfInterface(symbol); - } - if (symbol.flags & 64 /* Enum */) { - return getDeclaredTypeOfEnum(symbol); - } - if (symbol.flags & 262144 /* TypeParameter */) { - return getDeclaredTypeOfTypeParameter(symbol); - } - if (symbol.flags & 4194304 /* Import */) { - return getDeclaredTypeOfImport(symbol); - } - ts.Debug.assert((symbol.flags & 8388608 /* Instantiated */) === 0); - return unknownType; - } - function createSymbolTable(symbols) { - var result = {}; - for (var i = 0; i < symbols.length; i++) { - var symbol = symbols[i]; - result[symbol.name] = symbol; - } - return result; - } - function createInstantiatedSymbolTable(symbols, mapper) { - var result = {}; - for (var i = 0; i < symbols.length; i++) { - var symbol = symbols[i]; - result[symbol.name] = instantiateSymbol(symbol, mapper); - } - return result; - } - function addInheritedMembers(symbols, baseSymbols) { - for (var i = 0; i < baseSymbols.length; i++) { - var s = baseSymbols[i]; - if (!ts.hasProperty(symbols, s.name)) { - symbols[s.name] = s; - } - } - } - function addInheritedSignatures(signatures, baseSignatures) { - if (baseSignatures) { - for (var i = 0; i < baseSignatures.length; i++) { - signatures.push(baseSignatures[i]); - } - } - } - function resolveClassOrInterfaceMembers(type) { - var members = type.symbol.members; - var callSignatures = type.declaredCallSignatures; - var constructSignatures = type.declaredConstructSignatures; - var stringIndexType = type.declaredStringIndexType; - var numberIndexType = type.declaredNumberIndexType; - if (type.baseTypes.length) { - members = createSymbolTable(type.declaredProperties); - ts.forEach(type.baseTypes, function (baseType) { - addInheritedMembers(members, getPropertiesOfType(baseType)); - callSignatures = ts.concatenate(callSignatures, getSignaturesOfType(baseType, 0 /* Call */)); - constructSignatures = ts.concatenate(constructSignatures, getSignaturesOfType(baseType, 1 /* Construct */)); - stringIndexType = stringIndexType || getIndexTypeOfType(baseType, 0 /* String */); - numberIndexType = numberIndexType || getIndexTypeOfType(baseType, 1 /* Number */); - }); - } - setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); - } - function resolveTypeReferenceMembers(type) { - var target = type.target; - var mapper = createTypeMapper(target.typeParameters, type.typeArguments); - var members = createInstantiatedSymbolTable(target.declaredProperties, mapper); - var callSignatures = instantiateList(target.declaredCallSignatures, mapper, instantiateSignature); - var constructSignatures = instantiateList(target.declaredConstructSignatures, mapper, instantiateSignature); - var stringIndexType = target.declaredStringIndexType ? instantiateType(target.declaredStringIndexType, mapper) : undefined; - var numberIndexType = target.declaredNumberIndexType ? instantiateType(target.declaredNumberIndexType, mapper) : undefined; - ts.forEach(target.baseTypes, function (baseType) { - var instantiatedBaseType = instantiateType(baseType, mapper); - addInheritedMembers(members, getPropertiesOfType(instantiatedBaseType)); - callSignatures = ts.concatenate(callSignatures, getSignaturesOfType(instantiatedBaseType, 0 /* Call */)); - constructSignatures = ts.concatenate(constructSignatures, getSignaturesOfType(instantiatedBaseType, 1 /* Construct */)); - stringIndexType = stringIndexType || getIndexTypeOfType(instantiatedBaseType, 0 /* String */); - numberIndexType = numberIndexType || getIndexTypeOfType(instantiatedBaseType, 1 /* Number */); - }); - setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); - } - function createSignature(declaration, typeParameters, parameters, resolvedReturnType, minArgumentCount, hasRestParameter, hasStringLiterals) { - var sig = new Signature(checker); - sig.declaration = declaration; - sig.typeParameters = typeParameters; - sig.parameters = parameters; - sig.resolvedReturnType = resolvedReturnType; - sig.minArgumentCount = minArgumentCount; - sig.hasRestParameter = hasRestParameter; - sig.hasStringLiterals = hasStringLiterals; - return sig; - } - function cloneSignature(sig) { - return createSignature(sig.declaration, sig.typeParameters, sig.parameters, sig.resolvedReturnType, sig.minArgumentCount, sig.hasRestParameter, sig.hasStringLiterals); - } - function getDefaultConstructSignatures(classType) { - if (classType.baseTypes.length) { - var baseType = classType.baseTypes[0]; - var baseSignatures = getSignaturesOfType(getTypeOfSymbol(baseType.symbol), 1 /* Construct */); - return ts.map(baseSignatures, function (baseSignature) { - var signature = baseType.flags & 4096 /* Reference */ ? getSignatureInstantiation(baseSignature, baseType.typeArguments) : cloneSignature(baseSignature); - signature.typeParameters = classType.typeParameters; - signature.resolvedReturnType = classType; - return signature; - }); - } - return [createSignature(undefined, classType.typeParameters, emptyArray, classType, 0, false, false)]; - } - function createTupleTypeMemberSymbols(memberTypes) { - var members = {}; - for (var i = 0; i < memberTypes.length; i++) { - var symbol = createSymbol(2 /* Property */ | 33554432 /* Transient */, "" + i); - symbol.type = memberTypes[i]; - members[i] = symbol; - } - return members; - } - function resolveTupleTypeMembers(type) { - var arrayType = resolveObjectTypeMembers(createArrayType(getBestCommonType(type.elementTypes))); - var members = createTupleTypeMemberSymbols(type.elementTypes); - addInheritedMembers(members, arrayType.properties); - setObjectTypeMembers(type, members, arrayType.callSignatures, arrayType.constructSignatures, arrayType.stringIndexType, arrayType.numberIndexType); - } - function resolveAnonymousTypeMembers(type) { - var symbol = type.symbol; - if (symbol.flags & 512 /* TypeLiteral */) { - var members = symbol.members; - var callSignatures = getSignaturesOfSymbol(members["__call"]); - var constructSignatures = getSignaturesOfSymbol(members["__new"]); - var stringIndexType = getIndexTypeOfSymbol(symbol, 0 /* String */); - var numberIndexType = getIndexTypeOfSymbol(symbol, 1 /* Number */); - } - else { - var members = emptySymbols; - var callSignatures = emptyArray; - var constructSignatures = emptyArray; - if (symbol.flags & ts.SymbolFlags.HasExports) { - members = symbol.exports; - } - if (symbol.flags & (8 /* Function */ | 2048 /* Method */)) { - callSignatures = getSignaturesOfSymbol(symbol); - } - if (symbol.flags & 16 /* Class */) { - var classType = getDeclaredTypeOfClass(symbol); - constructSignatures = getSignaturesOfSymbol(symbol.members["__constructor"]); - if (!constructSignatures.length) { - constructSignatures = getDefaultConstructSignatures(classType); - } - if (classType.baseTypes.length) { - members = createSymbolTable(getNamedMembers(members)); - addInheritedMembers(members, getPropertiesOfType(getTypeOfSymbol(classType.baseTypes[0].symbol))); - } - } - var stringIndexType = undefined; - var numberIndexType = (symbol.flags & 64 /* Enum */) ? stringType : undefined; - } - setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); - } - function resolveObjectTypeMembers(type) { - if (!type.members) { - if (type.flags & (1024 /* Class */ | 2048 /* Interface */)) { - resolveClassOrInterfaceMembers(type); - } - else if (type.flags & 16384 /* Anonymous */) { - resolveAnonymousTypeMembers(type); - } - else if (type.flags & 8192 /* Tuple */) { - resolveTupleTypeMembers(type); - } - else { - resolveTypeReferenceMembers(type); - } - } - return type; - } - function getPropertiesOfType(type) { - if (type.flags & ts.TypeFlags.ObjectType) { - return resolveObjectTypeMembers(type).properties; - } - return emptyArray; - } - function getPropertyOfType(type, name) { - if (type.flags & ts.TypeFlags.ObjectType) { - var resolved = resolveObjectTypeMembers(type); - if (ts.hasProperty(resolved.members, name)) { - var symbol = resolved.members[name]; - if (symbolIsValue(symbol)) { - return symbol; - } - } - } - } - function getPropertyOfApparentType(type, name) { - if (type.flags & ts.TypeFlags.ObjectType) { - var resolved = resolveObjectTypeMembers(type); - if (ts.hasProperty(resolved.members, name)) { - var symbol = resolved.members[name]; - if (symbolIsValue(symbol)) { - return symbol; - } - } - if (resolved === anyFunctionType || resolved.callSignatures.length || resolved.constructSignatures.length) { - var symbol = getPropertyOfType(globalFunctionType, name); - if (symbol) - return symbol; - } - return getPropertyOfType(globalObjectType, name); - } - } - function getSignaturesOfType(type, kind) { - if (type.flags & ts.TypeFlags.ObjectType) { - var resolved = resolveObjectTypeMembers(type); - return kind === 0 /* Call */ ? resolved.callSignatures : resolved.constructSignatures; - } - return emptyArray; - } - function getIndexTypeOfType(type, kind) { - if (type.flags & ts.TypeFlags.ObjectType) { - var resolved = resolveObjectTypeMembers(type); - return kind === 0 /* String */ ? resolved.stringIndexType : resolved.numberIndexType; - } - } - function getTypeParametersFromDeclaration(typeParameterDeclarations) { - var result = []; - ts.forEach(typeParameterDeclarations, function (node) { - var tp = getDeclaredTypeOfTypeParameter(node.symbol); - if (!ts.contains(result, tp)) { - result.push(tp); - } - }); - return result; - } - function getSignatureFromDeclaration(declaration) { - var links = getNodeLinks(declaration); - if (!links.resolvedSignature) { - var classType = declaration.kind === 121 /* Constructor */ ? getDeclaredTypeOfClass(declaration.parent.symbol) : undefined; - var typeParameters = classType ? classType.typeParameters : declaration.typeParameters ? getTypeParametersFromDeclaration(declaration.typeParameters) : undefined; - var parameters = []; - var hasStringLiterals = false; - var minArgumentCount = -1; - for (var i = 0, n = declaration.parameters.length; i < n; i++) { - var param = declaration.parameters[i]; - parameters.push(param.symbol); - if (param.type && param.type.kind === 7 /* StringLiteral */) { - hasStringLiterals = true; - } - if (minArgumentCount < 0) { - if (param.initializer || param.flags & (4 /* QuestionMark */ | 8 /* Rest */)) { - minArgumentCount = i; - } - } - } - if (minArgumentCount < 0) { - minArgumentCount = declaration.parameters.length; - } - var returnType; - if (classType) { - returnType = classType; - } - else if (declaration.type) { - returnType = getTypeFromTypeNode(declaration.type); - } - else { - if (declaration.kind === 122 /* GetAccessor */) { - var setter = getDeclarationOfKind(declaration.symbol, 123 /* SetAccessor */); - returnType = getAnnotatedAccessorType(setter); - } - if (!returnType && !declaration.body) { - returnType = anyType; - } - } - links.resolvedSignature = createSignature(declaration, typeParameters, parameters, returnType, minArgumentCount, ts.hasRestParameters(declaration), hasStringLiterals); - } - return links.resolvedSignature; - } - function getSignaturesOfSymbol(symbol) { - if (!symbol) - return emptyArray; - var result = []; - for (var i = 0, len = symbol.declarations.length; i < len; i++) { - var node = symbol.declarations[i]; - switch (node.kind) { - case 172 /* FunctionDeclaration */: - case 120 /* Method */: - case 121 /* Constructor */: - case 124 /* CallSignature */: - case 125 /* ConstructSignature */: - case 126 /* IndexSignature */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 141 /* FunctionExpression */: - case 142 /* ArrowFunction */: - if (i > 0 && node.body) { - var previous = symbol.declarations[i - 1]; - if (node.parent === previous.parent && node.kind === previous.kind && node.pos === previous.end) { - break; - } - } - result.push(getSignatureFromDeclaration(node)); - } - } - return result; - } - function getReturnTypeOfSignature(signature) { - if (!signature.resolvedReturnType) { - signature.resolvedReturnType = resolvingType; - if (signature.target) { - var type = instantiateType(getReturnTypeOfSignature(signature.target), signature.mapper); - } - else { - var type = getReturnTypeFromBody(signature.declaration); - } - if (signature.resolvedReturnType === resolvingType) { - signature.resolvedReturnType = type; - } - } - else if (signature.resolvedReturnType === resolvingType) { - signature.resolvedReturnType = anyType; - if (compilerOptions.noImplicitAny) { - var declaration = signature.declaration; - if (declaration.name) { - error(declaration.name, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, ts.identifierToString(declaration.name)); - } - else { - error(declaration, ts.Diagnostics.Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions); - } - } - } - return signature.resolvedReturnType; - } - function getRestTypeOfSignature(signature) { - if (signature.hasRestParameter) { - var type = getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]); - if (type.flags & 4096 /* Reference */ && type.target === globalArrayType) { - return type.typeArguments[0]; - } - } - return anyType; - } - function getSignatureInstantiation(signature, typeArguments) { - return instantiateSignature(signature, createTypeMapper(signature.typeParameters, typeArguments), true); - } - function getErasedSignature(signature) { - if (!signature.typeParameters) - return signature; - if (!signature.erasedSignatureCache) { - if (signature.target) { - signature.erasedSignatureCache = instantiateSignature(getErasedSignature(signature.target), signature.mapper); - } - else { - signature.erasedSignatureCache = instantiateSignature(signature, createTypeEraser(signature.typeParameters), true); - } - } - return signature.erasedSignatureCache; - } - function getOrCreateTypeFromSignature(signature) { - if (!signature.isolatedSignatureType) { - var isConstructor = signature.declaration.kind === 121 /* Constructor */ || signature.declaration.kind === 125 /* ConstructSignature */; - var type = createObjectType(16384 /* Anonymous */ | 32768 /* FromSignature */); - type.members = emptySymbols; - type.properties = emptyArray; - type.callSignatures = !isConstructor ? [signature] : emptyArray; - type.constructSignatures = isConstructor ? [signature] : emptyArray; - signature.isolatedSignatureType = type; - } - return signature.isolatedSignatureType; - } - function getIndexSymbol(symbol) { - return symbol.members["__index"]; - } - function getIndexDeclarationOfSymbol(symbol, kind) { - var syntaxKind = kind === 1 /* Number */ ? 112 /* NumberKeyword */ : 114 /* StringKeyword */; - var indexSymbol = getIndexSymbol(symbol); - if (indexSymbol) { - var len = indexSymbol.declarations.length; - for (var i = 0; i < len; i++) { - var node = indexSymbol.declarations[i]; - if (node.parameters.length === 1) { - var parameter = node.parameters[0]; - if (parameter && parameter.type && parameter.type.kind === syntaxKind) { - return node; - } - } - } - } - return undefined; - } - function getIndexTypeOfSymbol(symbol, kind) { - var declaration = getIndexDeclarationOfSymbol(symbol, kind); - return declaration ? declaration.type ? getTypeFromTypeNode(declaration.type) : anyType : undefined; - } - function getConstraintOfTypeParameter(type) { - if (!type.constraint) { - if (type.target) { - var targetConstraint = getConstraintOfTypeParameter(type.target); - type.constraint = targetConstraint ? instantiateType(targetConstraint, type.mapper) : noConstraintType; - } - else { - type.constraint = getTypeFromTypeNode(getDeclarationOfKind(type.symbol, 117 /* TypeParameter */).constraint); - } - } - return type.constraint === noConstraintType ? undefined : type.constraint; - } - function getTypeListId(types) { - switch (types.length) { - case 1: - return "" + types[0].id; - case 2: - return types[0].id + "," + types[1].id; - default: - var result = ""; - for (var i = 0; i < types.length; i++) { - if (i > 0) - result += ","; - result += types[i].id; - } - return result; - } - } - function createTypeReference(target, typeArguments) { - var id = getTypeListId(typeArguments); - var type = target.instantiations[id]; - if (!type) { - type = target.instantiations[id] = createObjectType(4096 /* Reference */, target.symbol); - type.target = target; - type.typeArguments = typeArguments; - } - return type; - } - function isTypeParameterReferenceIllegalInConstraint(typeReferenceNode, typeParameterSymbol) { - var links = getNodeLinks(typeReferenceNode); - if (links.isIllegalTypeReferenceInConstraint !== undefined) { - return links.isIllegalTypeReferenceInConstraint; - } - var currentNode = typeReferenceNode; - while (!ts.forEach(typeParameterSymbol.declarations, function (d) { return d.parent === currentNode.parent; })) { - currentNode = currentNode.parent; - } - links.isIllegalTypeReferenceInConstraint = currentNode.kind === 117 /* TypeParameter */; - return links.isIllegalTypeReferenceInConstraint; - } - function checkTypeParameterHasIllegalReferencesInConstraint(typeParameter) { - var typeParameterSymbol; - function check(n) { - if (n.kind === 127 /* TypeReference */ && n.typeName.kind === 59 /* Identifier */) { - var links = getNodeLinks(n); - if (links.isIllegalTypeReferenceInConstraint === undefined) { - var symbol = resolveName(typeParameter, n.typeName.text, ts.SymbolFlags.Type, undefined, undefined); - if (symbol && (symbol.flags & 262144 /* TypeParameter */)) { - links.isIllegalTypeReferenceInConstraint = ts.forEach(symbol.declarations, function (d) { return d.parent == typeParameter.parent; }); - } - } - if (links.isIllegalTypeReferenceInConstraint) { - error(typeParameter, ts.Diagnostics.Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list); - } - } - ts.forEachChild(n, check); - } - if (typeParameter.constraint) { - typeParameterSymbol = getSymbolOfNode(typeParameter); - check(typeParameter.constraint); - } - } - function getTypeFromTypeReferenceNode(node) { - var links = getNodeLinks(node); - if (!links.resolvedType) { - var symbol = resolveEntityName(node, node.typeName, ts.SymbolFlags.Type); - if (symbol) { - var type; - if ((symbol.flags & 262144 /* TypeParameter */) && isTypeParameterReferenceIllegalInConstraint(node, symbol)) { - type = unknownType; - } - else { - type = getDeclaredTypeOfSymbol(symbol); - if (type.flags & (1024 /* Class */ | 2048 /* Interface */) && type.flags & 4096 /* Reference */) { - var typeParameters = type.typeParameters; - if (node.typeArguments && node.typeArguments.length === typeParameters.length) { - type = createTypeReference(type, ts.map(node.typeArguments, getTypeFromTypeNode)); - } - else { - error(node, ts.Diagnostics.Generic_type_0_requires_1_type_argument_s, typeToString(type, undefined, 1 /* WriteArrayAsGenericType */), typeParameters.length); - type = undefined; - } - } - else { - if (node.typeArguments) { - error(node, ts.Diagnostics.Type_0_is_not_generic, typeToString(type)); - type = undefined; - } - } - } - } - links.resolvedType = type || unknownType; - } - return links.resolvedType; - } - function getTypeFromTypeQueryNode(node) { - var links = getNodeLinks(node); - if (!links.resolvedType) { - links.resolvedType = getWidenedType(checkExpression(node.exprName)); - } - return links.resolvedType; - } - function getTypeOfGlobalSymbol(symbol, arity) { - function getTypeDeclaration(symbol) { - var declarations = symbol.declarations; - for (var i = 0; i < declarations.length; i++) { - var declaration = declarations[i]; - switch (declaration.kind) { - case 174 /* ClassDeclaration */: - case 175 /* InterfaceDeclaration */: - case 176 /* EnumDeclaration */: - return declaration; - } - } - } - if (!symbol) { - return emptyObjectType; - } - var type = getDeclaredTypeOfSymbol(symbol); - if (!(type.flags & ts.TypeFlags.ObjectType)) { - error(getTypeDeclaration(symbol), ts.Diagnostics.Global_type_0_must_be_a_class_or_interface_type, symbol.name); - return emptyObjectType; - } - if ((type.typeParameters ? type.typeParameters.length : 0) !== arity) { - error(getTypeDeclaration(symbol), ts.Diagnostics.Global_type_0_must_have_1_type_parameter_s, symbol.name, arity); - return emptyObjectType; - } - return type; - } - function getGlobalSymbol(name) { - return resolveName(undefined, name, ts.SymbolFlags.Type, ts.Diagnostics.Cannot_find_global_type_0, name); - } - function getGlobalType(name) { - return getTypeOfGlobalSymbol(getGlobalSymbol(name), 0); - } - function createArrayType(elementType) { - var arrayType = globalArrayType || getDeclaredTypeOfSymbol(globalArraySymbol); - return arrayType !== emptyObjectType ? createTypeReference(arrayType, [elementType]) : emptyObjectType; - } - function getTypeFromArrayTypeNode(node) { - var links = getNodeLinks(node); - if (!links.resolvedType) { - links.resolvedType = createArrayType(getTypeFromTypeNode(node.elementType)); - } - return links.resolvedType; - } - function createTupleType(elementTypes) { - var id = getTypeListId(elementTypes); - var type = tupleTypes[id]; - if (!type) { - type = tupleTypes[id] = createObjectType(8192 /* Tuple */); - type.elementTypes = elementTypes; - } - return type; - } - function getTypeFromTupleTypeNode(node) { - var links = getNodeLinks(node); - if (!links.resolvedType) { - links.resolvedType = createTupleType(ts.map(node.elementTypes, getTypeFromTypeNode)); - } - return links.resolvedType; - } - function getTypeFromTypeLiteralNode(node) { - var links = getNodeLinks(node); - if (!links.resolvedType) { - links.resolvedType = createObjectType(16384 /* Anonymous */, node.symbol); - } - return links.resolvedType; - } - function getStringLiteralType(node) { - if (ts.hasProperty(stringLiteralTypes, node.text)) - return stringLiteralTypes[node.text]; - var type = stringLiteralTypes[node.text] = createType(256 /* StringLiteral */); - type.text = ts.getTextOfNode(node); - return type; - } - function getTypeFromStringLiteral(node) { - var links = getNodeLinks(node); - if (!links.resolvedType) { - links.resolvedType = getStringLiteralType(node); - } - return links.resolvedType; - } - function getTypeFromTypeNode(node) { - switch (node.kind) { - case 105 /* AnyKeyword */: - return anyType; - case 114 /* StringKeyword */: - return stringType; - case 112 /* NumberKeyword */: - return numberType; - case 106 /* BooleanKeyword */: - return booleanType; - case 93 /* VoidKeyword */: - return voidType; - case 7 /* StringLiteral */: - return getTypeFromStringLiteral(node); - case 127 /* TypeReference */: - return getTypeFromTypeReferenceNode(node); - case 128 /* TypeQuery */: - return getTypeFromTypeQueryNode(node); - case 130 /* ArrayType */: - return getTypeFromArrayTypeNode(node); - case 131 /* TupleType */: - return getTypeFromTupleTypeNode(node); - case 129 /* TypeLiteral */: - return getTypeFromTypeLiteralNode(node); - case 59 /* Identifier */: - case 116 /* QualifiedName */: - var symbol = getSymbolInfo(node); - return symbol && getDeclaredTypeOfSymbol(symbol); - default: - return unknownType; - } - } - function instantiateList(items, mapper, instantiator) { - if (items && items.length) { - var result = []; - for (var i = 0; i < items.length; i++) { - result.push(instantiator(items[i], mapper)); - } - return result; - } - return items; - } - function createUnaryTypeMapper(source, target) { - return function (t) { return t === source ? target : t; }; - } - function createBinaryTypeMapper(source1, target1, source2, target2) { - return function (t) { return t === source1 ? target1 : t === source2 ? target2 : t; }; - } - function createTypeMapper(sources, targets) { - switch (sources.length) { - case 1: - return createUnaryTypeMapper(sources[0], targets[0]); - case 2: - return createBinaryTypeMapper(sources[0], targets[0], sources[1], targets[1]); - } - return function (t) { - for (var i = 0; i < sources.length; i++) { - if (t === sources[i]) - return targets[i]; - } - return t; - }; - } - function createUnaryTypeEraser(source) { - return function (t) { return t === source ? anyType : t; }; - } - function createBinaryTypeEraser(source1, source2) { - return function (t) { return t === source1 || t === source2 ? anyType : t; }; - } - function createTypeEraser(sources) { - switch (sources.length) { - case 1: - return createUnaryTypeEraser(sources[0]); - case 2: - return createBinaryTypeEraser(sources[0], sources[1]); - } - return function (t) { - for (var i = 0; i < sources.length; i++) { - if (t === sources[i]) - return anyType; - } - return t; - }; - } - function createInferenceMapper(context) { - return function (t) { - for (var i = 0; i < context.typeParameters.length; i++) { - if (t === context.typeParameters[i]) { - return getInferredType(context, i); - } - } - return t; - }; - } - function identityMapper(type) { - return type; - } - function combineTypeMappers(mapper1, mapper2) { - return function (t) { return mapper2(mapper1(t)); }; - } - function instantiateTypeParameter(typeParameter, mapper) { - var result = createType(512 /* TypeParameter */); - result.symbol = typeParameter.symbol; - if (typeParameter.constraint) { - result.constraint = instantiateType(typeParameter.constraint, mapper); - } - else { - result.target = typeParameter; - result.mapper = mapper; - } - return result; - } - function instantiateSignature(signature, mapper, eraseTypeParameters) { - if (signature.typeParameters && !eraseTypeParameters) { - var freshTypeParameters = instantiateList(signature.typeParameters, mapper, instantiateTypeParameter); - mapper = combineTypeMappers(createTypeMapper(signature.typeParameters, freshTypeParameters), mapper); - } - var result = createSignature(signature.declaration, freshTypeParameters, instantiateList(signature.parameters, mapper, instantiateSymbol), signature.resolvedReturnType ? instantiateType(signature.resolvedReturnType, mapper) : undefined, signature.minArgumentCount, signature.hasRestParameter, signature.hasStringLiterals); - result.target = signature; - result.mapper = mapper; - return result; - } - function instantiateSymbol(symbol, mapper) { - if (symbol.flags & 8388608 /* Instantiated */) { - var links = getSymbolLinks(symbol); - symbol = links.target; - mapper = combineTypeMappers(links.mapper, mapper); - } - var result = createSymbol(8388608 /* Instantiated */ | 33554432 /* Transient */, symbol.name); - result.declarations = symbol.declarations; - result.parent = symbol.parent; - result.target = symbol; - result.mapper = mapper; - if (symbol.valueDeclaration) { - result.valueDeclaration = symbol.valueDeclaration; - } - return result; - } - function instantiateAnonymousType(type, mapper) { - var result = createObjectType(16384 /* Anonymous */, type.symbol); - result.properties = instantiateList(getPropertiesOfType(type), mapper, instantiateSymbol); - result.members = createSymbolTable(result.properties); - result.callSignatures = instantiateList(getSignaturesOfType(type, 0 /* Call */), mapper, instantiateSignature); - result.constructSignatures = instantiateList(getSignaturesOfType(type, 1 /* Construct */), mapper, instantiateSignature); - var stringIndexType = getIndexTypeOfType(type, 0 /* String */); - var numberIndexType = getIndexTypeOfType(type, 1 /* Number */); - if (stringIndexType) - result.stringIndexType = instantiateType(stringIndexType, mapper); - if (numberIndexType) - result.numberIndexType = instantiateType(numberIndexType, mapper); - return result; - } - function instantiateType(type, mapper) { - if (mapper !== identityMapper) { - if (type.flags & 512 /* TypeParameter */) { - return mapper(type); - } - if (type.flags & 16384 /* Anonymous */) { - return type.symbol && type.symbol.flags & (8 /* Function */ | 2048 /* Method */ | 512 /* TypeLiteral */ | 1024 /* ObjectLiteral */) ? instantiateAnonymousType(type, mapper) : type; - } - if (type.flags & 4096 /* Reference */) { - return createTypeReference(type.target, instantiateList(type.typeArguments, mapper, instantiateType)); - } - if (type.flags & 8192 /* Tuple */) { - return createTupleType(instantiateList(type.elementTypes, mapper, instantiateType)); - } - } - return type; - } - function isContextSensitiveExpression(node) { - switch (node.kind) { - case 141 /* FunctionExpression */: - case 142 /* ArrowFunction */: - return !node.typeParameters && !ts.forEach(node.parameters, function (p) { return p.type; }); - case 133 /* ObjectLiteral */: - return ts.forEach(node.properties, function (p) { return p.kind === 134 /* PropertyAssignment */ && isContextSensitiveExpression(p.initializer); }); - case 132 /* ArrayLiteral */: - return ts.forEach(node.elements, function (e) { return isContextSensitiveExpression(e); }); - case 146 /* ConditionalExpression */: - return isContextSensitiveExpression(node.whenTrue) || isContextSensitiveExpression(node.whenFalse); - case 145 /* BinaryExpression */: - return node.operator === 44 /* BarBarToken */ && (isContextSensitiveExpression(node.left) || isContextSensitiveExpression(node.right)); - } - return false; - } - function getTypeWithoutConstructors(type) { - if (type.flags & ts.TypeFlags.ObjectType) { - var resolved = resolveObjectTypeMembers(type); - if (resolved.constructSignatures.length) { - var result = createObjectType(16384 /* Anonymous */, type.symbol); - result.members = resolved.members; - result.properties = resolved.properties; - result.callSignatures = resolved.callSignatures; - result.constructSignatures = emptyArray; - type = result; - } - } - return type; - } - var subtypeRelation = {}; - var assignableRelation = {}; - var identityRelation = {}; - function isTypeIdenticalTo(source, target) { - return checkTypeRelatedTo(source, target, identityRelation, undefined, undefined, undefined); - } - function isTypeSubtypeOf(source, target) { - return checkTypeSubtypeOf(source, target, undefined, undefined, undefined); - } - function checkTypeSubtypeOf(source, target, errorNode, chainedMessage, terminalMessage) { - return checkTypeRelatedTo(source, target, subtypeRelation, errorNode, chainedMessage, terminalMessage); - } - function isTypeAssignableTo(source, target) { - return checkTypeAssignableTo(source, target, undefined, undefined, undefined); - } - function checkTypeAssignableTo(source, target, errorNode, chainedMessage, terminalMessage) { - return checkTypeRelatedTo(source, target, assignableRelation, errorNode, chainedMessage, terminalMessage); - } - function isTypeRelatedTo(source, target, relation) { - return checkTypeRelatedTo(source, target, relation, undefined, undefined, undefined); - } - function isSignatureAssignableTo(source, target) { - var sourceType = getOrCreateTypeFromSignature(source); - var targetType = getOrCreateTypeFromSignature(target); - return checkTypeRelatedTo(sourceType, targetType, assignableRelation, undefined, undefined, undefined); - } - function isPropertyIdenticalTo(sourceProp, targetProp) { - return isPropertyIdenticalToRecursive(sourceProp, targetProp, false, function (s, t, _reportErrors) { return isTypeIdenticalTo(s, t); }); - } - function checkInheritedPropertiesAreIdentical(type, typeNode) { - if (!type.baseTypes.length || type.baseTypes.length === 1) { - return true; - } - var seen = {}; - ts.forEach(type.declaredProperties, function (p) { - seen[p.name] = { prop: p, containingType: type }; - }); - var ok = true; - for (var i = 0, len = type.baseTypes.length; i < len; ++i) { - var base = type.baseTypes[i]; - var properties = getPropertiesOfType(base); - for (var j = 0, proplen = properties.length; j < proplen; ++j) { - var prop = properties[j]; - if (!ts.hasProperty(seen, prop.name)) { - seen[prop.name] = { prop: prop, containingType: base }; - } - else { - var existing = seen[prop.name]; - var isInheritedProperty = existing.containingType !== type; - if (isInheritedProperty && !isPropertyIdenticalTo(existing.prop, prop)) { - ok = false; - var typeName1 = typeToString(existing.containingType); - var typeName2 = typeToString(base); - var errorInfo = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Named_properties_0_of_types_1_and_2_are_not_identical, prop.name, typeName1, typeName2); - errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Interface_0_cannot_simultaneously_extend_types_1_and_2_Colon, typeToString(type), typeName1, typeName2); - addDiagnostic(ts.createDiagnosticForNodeFromMessageChain(typeNode, errorInfo, program.getCompilerHost().getNewLine())); - } - } - } - } - return ok; - } - function isPropertyIdenticalToRecursive(sourceProp, targetProp, reportErrors, relate) { - if (sourceProp === targetProp) { - return true; - } - var sourcePropAccessibility = getDeclarationFlagsFromSymbol(sourceProp) & (32 /* Private */ | 64 /* Protected */); - var targetPropAccessibility = getDeclarationFlagsFromSymbol(targetProp) & (32 /* Private */ | 64 /* Protected */); - if (sourcePropAccessibility !== targetPropAccessibility) { - return false; - } - if (sourcePropAccessibility) { - return getTargetSymbol(sourceProp) === getTargetSymbol(targetProp) && relate(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp), reportErrors); - } - else { - return isOptionalProperty(sourceProp) === isOptionalProperty(targetProp) && relate(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp), reportErrors); - } - } - function checkTypeRelatedTo(source, target, relation, errorNode, chainedMessage, terminalMessage) { - var errorInfo; - var sourceStack; - var targetStack; - var expandingFlags; - var depth = 0; - var overflow = false; - ts.Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking"); - var result = isRelatedToWithCustomErrors(source, target, errorNode !== undefined, chainedMessage, terminalMessage); - if (overflow) { - error(errorNode, ts.Diagnostics.Excessive_stack_depth_comparing_types_0_and_1, typeToString(source), typeToString(target)); - } - else if (errorInfo) { - addDiagnostic(ts.createDiagnosticForNodeFromMessageChain(errorNode, errorInfo, program.getCompilerHost().getNewLine())); - } - return result; - function reportError(message, arg0, arg1, arg2) { - errorInfo = ts.chainDiagnosticMessages(errorInfo, message, arg0, arg1, arg2); - } - function isRelatedTo(source, target, reportErrors) { - return isRelatedToWithCustomErrors(source, target, reportErrors, undefined, undefined); - } - function isRelatedToWithCustomErrors(source, target, reportErrors, chainedMessage, terminalMessage) { - if (relation === identityRelation) { - if (source === target) - return true; - } - else { - if (source === target) - return true; - if (target.flags & 1 /* Any */) - return true; - if (source === undefinedType) - return true; - if (source === nullType && target !== undefinedType) - return true; - if (source.flags & 128 /* Enum */ && target === numberType) - return true; - if (source.flags & 256 /* StringLiteral */ && target === stringType) - return true; - if (relation === assignableRelation) { - if (source.flags & 1 /* Any */) - return true; - if (source === numberType && target.flags & 128 /* Enum */) - return true; - } - } - if (source.flags & 512 /* TypeParameter */ && target.flags & 512 /* TypeParameter */) { - if (typeParameterRelatedTo(source, target, reportErrors)) { - return true; - } - } - else { - var saveErrorInfo = errorInfo; - if (source.flags & 4096 /* Reference */ && target.flags & 4096 /* Reference */ && source.target === target.target) { - if (typesRelatedTo(source.typeArguments, target.typeArguments, reportErrors)) { - return true; - } - } - var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo; - var sourceOrApparentType = relation === identityRelation ? source : getApparentType(source); - if (sourceOrApparentType.flags & ts.TypeFlags.ObjectType && target.flags & ts.TypeFlags.ObjectType && objectTypeRelatedTo(sourceOrApparentType, target, reportStructuralErrors)) { - errorInfo = saveErrorInfo; - return true; - } - } - if (reportErrors) { - chainedMessage = chainedMessage || ts.Diagnostics.Type_0_is_not_assignable_to_type_1_Colon; - terminalMessage = terminalMessage || ts.Diagnostics.Type_0_is_not_assignable_to_type_1; - var diagnosticKey = errorInfo ? chainedMessage : terminalMessage; - ts.Debug.assert(diagnosticKey); - reportError(diagnosticKey, typeToString(source), typeToString(target)); - } - return false; - } - function typesRelatedTo(sources, targets, reportErrors) { - for (var i = 0, len = sources.length; i < len; i++) { - if (!isRelatedTo(sources[i], targets[i], reportErrors)) - return false; - } - return true; - } - function typeParameterRelatedTo(source, target, reportErrors) { - if (relation === identityRelation) { - if (source.symbol.name !== target.symbol.name) { - return false; - } - if (source.constraint === target.constraint) { - return true; - } - if (source.constraint === noConstraintType || target.constraint === noConstraintType) { - return false; - } - return isRelatedTo(source.constraint, target.constraint, reportErrors); - } - else { - while (true) { - var constraint = getConstraintOfTypeParameter(source); - if (constraint === target) - return true; - if (!(constraint && constraint.flags & 512 /* TypeParameter */)) - break; - source = constraint; - } - return false; - } - } - function objectTypeRelatedTo(source, target, reportErrors) { - if (overflow) - return false; - var result; - var id = source.id + "," + target.id; - if ((result = relation[id]) !== undefined) - return result; - if (depth > 0) { - for (var i = 0; i < depth; i++) { - if (source === sourceStack[i] && target === targetStack[i]) - return true; - } - if (depth === 100) { - overflow = true; - return false; - } - } - else { - sourceStack = []; - targetStack = []; - expandingFlags = 0; - } - sourceStack[depth] = source; - targetStack[depth] = target; - depth++; - var saveExpandingFlags = expandingFlags; - if (!(expandingFlags & 1) && isDeeplyNestedGeneric(source, sourceStack)) - expandingFlags |= 1; - if (!(expandingFlags & 2) && isDeeplyNestedGeneric(target, targetStack)) - expandingFlags |= 2; - result = expandingFlags === 3 || propertiesRelatedTo(source, target, reportErrors) && signaturesRelatedTo(source, target, 0 /* Call */, reportErrors) && signaturesRelatedTo(source, target, 1 /* Construct */, reportErrors) && stringIndexTypesRelatedTo(source, target, reportErrors) && numberIndexTypesRelatedTo(source, target, reportErrors); - expandingFlags = saveExpandingFlags; - depth--; - if (depth === 0) { - relation[id] = result; - } - return result; - } - function isDeeplyNestedGeneric(type, stack) { - if (type.flags & 4096 /* Reference */ && depth >= 10) { - var target = type.target; - var count = 0; - for (var i = 0; i < depth; i++) { - var t = stack[i]; - if (t.flags & 4096 /* Reference */ && t.target === target) { - count++; - if (count >= 10) - return true; - } - } - } - return false; - } - function propertiesRelatedTo(source, target, reportErrors) { - if (relation === identityRelation) { - return propertiesAreIdenticalTo(source, target, reportErrors); - } - else { - return propertiesAreSubtypeOrAssignableTo(source, target, reportErrors); - } - } - function propertiesAreIdenticalTo(source, target, reportErrors) { - var sourceProperties = getPropertiesOfType(source); - var targetProperties = getPropertiesOfType(target); - if (sourceProperties.length !== targetProperties.length) { - return false; - } - for (var i = 0, len = sourceProperties.length; i < len; ++i) { - var sourceProp = sourceProperties[i]; - var targetProp = getPropertyOfType(target, sourceProp.name); - if (!targetProp || !isPropertyIdenticalToRecursive(sourceProp, targetProp, reportErrors, isRelatedTo)) { - return false; - } - } - return true; - } - function propertiesAreSubtypeOrAssignableTo(source, target, reportErrors) { - var properties = getPropertiesOfType(target); - for (var i = 0; i < properties.length; i++) { - var targetProp = properties[i]; - var sourceProp = getPropertyOfApparentType(source, targetProp.name); - if (sourceProp !== targetProp) { - if (!sourceProp) { - if (!isOptionalProperty(targetProp)) { - if (reportErrors) { - reportError(ts.Diagnostics.Property_0_is_missing_in_type_1, symbolToString(targetProp), typeToString(source)); - } - return false; - } - } - else if (!(targetProp.flags & 67108864 /* Prototype */)) { - var sourceFlags = getDeclarationFlagsFromSymbol(sourceProp); - var targetFlags = getDeclarationFlagsFromSymbol(targetProp); - if (sourceFlags & 32 /* Private */ || targetFlags & 32 /* Private */) { - if (sourceProp.valueDeclaration !== targetProp.valueDeclaration) { - if (reportErrors) { - if (sourceFlags & 32 /* Private */ && targetFlags & 32 /* Private */) { - reportError(ts.Diagnostics.Types_have_separate_declarations_of_a_private_property_0, symbolToString(targetProp)); - } - else { - reportError(ts.Diagnostics.Property_0_is_private_in_type_1_but_not_in_type_2, symbolToString(targetProp), typeToString(sourceFlags & 32 /* Private */ ? source : target), typeToString(sourceFlags & 32 /* Private */ ? target : source)); - } - } - return false; - } - } - else if (targetFlags & 64 /* Protected */) { - var sourceDeclaredInClass = sourceProp.parent && sourceProp.parent.flags & 16 /* Class */; - var sourceClass = sourceDeclaredInClass ? getDeclaredTypeOfSymbol(sourceProp.parent) : undefined; - var targetClass = getDeclaredTypeOfSymbol(targetProp.parent); - if (!sourceClass || !hasBaseType(sourceClass, targetClass)) { - if (reportErrors) { - reportError(ts.Diagnostics.Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2, symbolToString(targetProp), typeToString(sourceClass || source), typeToString(targetClass)); - } - return false; - } - } - else if (sourceFlags & 64 /* Protected */) { - if (reportErrors) { - reportError(ts.Diagnostics.Property_0_is_protected_in_type_1_but_public_in_type_2, symbolToString(targetProp), typeToString(source), typeToString(target)); - } - return false; - } - if (!isRelatedTo(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp), reportErrors)) { - if (reportErrors) { - reportError(ts.Diagnostics.Types_of_property_0_are_incompatible_Colon, symbolToString(targetProp)); - } - return false; - } - if (isOptionalProperty(sourceProp) && !isOptionalProperty(targetProp)) { - if (reportErrors) { - reportError(ts.Diagnostics.Property_0_is_optional_in_type_1_but_required_in_type_2, symbolToString(targetProp), typeToString(source), typeToString(target)); - } - return false; - } - } - } - } - return true; - } - function signaturesRelatedTo(source, target, kind, reportErrors) { - if (relation === identityRelation) { - return areSignaturesIdenticalTo(source, target, kind, reportErrors); - } - else { - return areSignaturesSubtypeOrAssignableTo(source, target, kind, reportErrors); - } - } - function areSignaturesIdenticalTo(source, target, kind, reportErrors) { - var sourceSignatures = getSignaturesOfType(source, kind); - var targetSignatures = getSignaturesOfType(target, kind); - if (sourceSignatures.length !== targetSignatures.length) { - return false; - } - for (var i = 0, len = sourceSignatures.length; i < len; ++i) { - if (!isSignatureIdenticalTo(sourceSignatures[i], targetSignatures[i], reportErrors)) { - return false; - } - } - return true; - } - function isSignatureIdenticalTo(source, target, reportErrors) { - if (source === target) { - return true; - } - if (source.hasRestParameter !== target.hasRestParameter) { - return false; - } - if (source.parameters.length !== target.parameters.length) { - return false; - } - if (source.minArgumentCount !== target.minArgumentCount) { - return false; - } - if (source.typeParameters && target.typeParameters) { - if (source.typeParameters.length !== target.typeParameters.length) { - return false; - } - for (var i = 0, len = source.typeParameters.length; i < len; ++i) { - if (!isRelatedTo(source.typeParameters[i], target.typeParameters[i], reportErrors)) { - return false; - } - } - } - else if (source.typeParameters || source.typeParameters) { - return false; - } - source = getErasedSignature(source); - target = getErasedSignature(target); - for (var i = 0, len = source.parameters.length; i < len; i++) { - var s = source.hasRestParameter && i === len - 1 ? getRestTypeOfSignature(source) : getTypeOfSymbol(source.parameters[i]); - var t = target.hasRestParameter && i === len - 1 ? getRestTypeOfSignature(target) : getTypeOfSymbol(target.parameters[i]); - if (!isRelatedTo(s, t, reportErrors)) { - return false; - } - } - var t = getReturnTypeOfSignature(target); - var s = getReturnTypeOfSignature(source); - return isRelatedTo(s, t, reportErrors); - } - function areSignaturesSubtypeOrAssignableTo(source, target, kind, reportErrors) { - if (target === anyFunctionType || source === anyFunctionType) - return true; - var sourceSignatures = getSignaturesOfType(source, kind); - var targetSignatures = getSignaturesOfType(target, kind); - var saveErrorInfo = errorInfo; - outer: for (var i = 0; i < targetSignatures.length; i++) { - var t = targetSignatures[i]; - if (!t.hasStringLiterals || target.flags & 32768 /* FromSignature */) { - var localErrors = reportErrors; - for (var j = 0; j < sourceSignatures.length; j++) { - var s = sourceSignatures[j]; - if (!s.hasStringLiterals || source.flags & 32768 /* FromSignature */) { - if (isSignatureSubtypeOrAssignableTo(s, t, localErrors)) { - errorInfo = saveErrorInfo; - continue outer; - } - localErrors = false; - } - } - return false; - } - } - return true; - } - function isSignatureSubtypeOrAssignableTo(source, target, reportErrors) { - if (source === target) { - return true; - } - if (!target.hasRestParameter && source.minArgumentCount > target.parameters.length) { - return false; - } - var sourceMax = source.parameters.length; - var targetMax = target.parameters.length; - var checkCount; - if (source.hasRestParameter && target.hasRestParameter) { - checkCount = sourceMax > targetMax ? sourceMax : targetMax; - sourceMax--; - targetMax--; - } - else if (source.hasRestParameter) { - sourceMax--; - checkCount = targetMax; - } - else if (target.hasRestParameter) { - targetMax--; - checkCount = sourceMax; - } - else { - checkCount = sourceMax < targetMax ? sourceMax : targetMax; - } - source = getErasedSignature(source); - target = getErasedSignature(target); - for (var i = 0; i < checkCount; i++) { - var s = i < sourceMax ? getTypeOfSymbol(source.parameters[i]) : getRestTypeOfSignature(source); - var t = i < targetMax ? getTypeOfSymbol(target.parameters[i]) : getRestTypeOfSignature(target); - var saveErrorInfo = errorInfo; - if (!isRelatedTo(s, t, reportErrors)) { - if (!isRelatedTo(t, s, false)) { - if (reportErrors) { - reportError(ts.Diagnostics.Types_of_parameters_0_and_1_are_incompatible_Colon, source.parameters[i < sourceMax ? i : sourceMax].name, target.parameters[i < targetMax ? i : targetMax].name); - } - return false; - } - errorInfo = saveErrorInfo; - } - } - var t = getReturnTypeOfSignature(target); - if (t === voidType) - return true; - var s = getReturnTypeOfSignature(source); - return isRelatedTo(s, t, reportErrors); - } - function stringIndexTypesRelatedTo(source, target, reportErrors) { - if (relation === identityRelation) { - return areIndexTypesIdenticalTo(0 /* String */, source, target, reportErrors); - } - else { - var targetType = getIndexTypeOfType(target, 0 /* String */); - if (targetType) { - var sourceType = getIndexTypeOfType(source, 0 /* String */); - if (!sourceType) { - if (reportErrors) { - reportError(ts.Diagnostics.Index_signature_is_missing_in_type_0, typeToString(source)); - } - return false; - } - if (!isRelatedTo(sourceType, targetType, reportErrors)) { - if (reportErrors) { - reportError(ts.Diagnostics.Index_signatures_are_incompatible_Colon); - } - return false; - } - } - return true; - } - } - function numberIndexTypesRelatedTo(source, target, reportErrors) { - if (relation === identityRelation) { - return areIndexTypesIdenticalTo(1 /* Number */, source, target, reportErrors); - } - else { - var targetType = getIndexTypeOfType(target, 1 /* Number */); - if (targetType) { - var sourceStringType = getIndexTypeOfType(source, 0 /* String */); - var sourceNumberType = getIndexTypeOfType(source, 1 /* Number */); - if (!(sourceStringType || sourceNumberType)) { - if (reportErrors) { - reportError(ts.Diagnostics.Index_signature_is_missing_in_type_0, typeToString(source)); - } - return false; - } - if (sourceStringType && sourceNumberType) { - var compatible = isRelatedTo(sourceStringType, targetType, false) || isRelatedTo(sourceNumberType, targetType, reportErrors); - } - else { - var compatible = isRelatedTo(sourceStringType || sourceNumberType, targetType, reportErrors); - } - if (!compatible) { - if (reportErrors) { - reportError(ts.Diagnostics.Index_signatures_are_incompatible_Colon); - } - return false; - } - } - return true; - } - } - function areIndexTypesIdenticalTo(indexKind, source, target, reportErrors) { - var targetType = getIndexTypeOfType(target, indexKind); - var sourceType = getIndexTypeOfType(source, indexKind); - return (!sourceType && !targetType) || (sourceType && targetType && isRelatedTo(sourceType, targetType, reportErrors)); - } - } - function isSupertypeOfEach(candidate, types) { - for (var i = 0, len = types.length; i < len; i++) { - if (candidate !== types[i] && !isTypeSubtypeOf(types[i], candidate)) - return false; - } - return true; - } - function getBestCommonType(types, contextualType, candidatesOnly) { - if (contextualType && isSupertypeOfEach(contextualType, types)) - return contextualType; - return ts.forEach(types, function (t) { return isSupertypeOfEach(t, types) ? t : undefined; }) || (candidatesOnly ? undefined : emptyObjectType); - } - function isTypeOfObjectLiteral(type) { - return (type.flags & 16384 /* Anonymous */) && type.symbol && (type.symbol.flags & 1024 /* ObjectLiteral */) ? true : false; - } - function isArrayType(type) { - return type.flags & 4096 /* Reference */ && type.target === globalArrayType; - } - function getInnermostTypeOfNestedArrayTypes(type) { - while (isArrayType(type)) { - type = type.typeArguments[0]; - } - return type; - } - function getWidenedType(type, supressNoImplicitAnyErrors) { - if (type.flags & (32 /* Undefined */ | 64 /* Null */)) { - return anyType; - } - if (isTypeOfObjectLiteral(type)) { - return getWidenedTypeOfObjectLiteral(type); - } - if (isArrayType(type)) { - return getWidenedTypeOfArrayLiteral(type); - } - return type; - function getWidenedTypeOfObjectLiteral(type) { - var properties = getPropertiesOfType(type); - if (properties.length) { - var widenedTypes = []; - var propTypeWasWidened = false; - ts.forEach(properties, function (p) { - var propType = getTypeOfSymbol(p); - var widenedType = getWidenedType(propType); - if (propType !== widenedType) { - propTypeWasWidened = true; - if (!supressNoImplicitAnyErrors && program.getCompilerOptions().noImplicitAny && getInnermostTypeOfNestedArrayTypes(widenedType) === anyType) { - error(p.valueDeclaration, ts.Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, p.name, typeToString(widenedType)); - } - } - widenedTypes.push(widenedType); - }); - if (propTypeWasWidened) { - var members = {}; - var index = 0; - ts.forEach(properties, function (p) { - var symbol = createSymbol(2 /* Property */ | 33554432 /* Transient */, p.name); - symbol.declarations = p.declarations; - symbol.parent = p.parent; - symbol.type = widenedTypes[index++]; - symbol.target = p; - if (p.valueDeclaration) - symbol.valueDeclaration = p.valueDeclaration; - members[symbol.name] = symbol; - }); - var stringIndexType = getIndexTypeOfType(type, 0 /* String */); - var numberIndexType = getIndexTypeOfType(type, 1 /* Number */); - if (stringIndexType) - stringIndexType = getWidenedType(stringIndexType); - if (numberIndexType) - numberIndexType = getWidenedType(numberIndexType); - type = createAnonymousType(type.symbol, members, emptyArray, emptyArray, stringIndexType, numberIndexType); - } - } - return type; - } - function getWidenedTypeOfArrayLiteral(type) { - var elementType = type.typeArguments[0]; - var widenedType = getWidenedType(elementType, supressNoImplicitAnyErrors); - type = elementType !== widenedType ? createArrayType(widenedType) : type; - return type; - } - } - function forEachMatchingParameterType(source, target, callback) { - var sourceMax = source.parameters.length; - var targetMax = target.parameters.length; - var count; - if (source.hasRestParameter && target.hasRestParameter) { - count = sourceMax > targetMax ? sourceMax : targetMax; - sourceMax--; - targetMax--; - } - else if (source.hasRestParameter) { - sourceMax--; - count = targetMax; - } - else if (target.hasRestParameter) { - targetMax--; - count = sourceMax; - } - else { - count = sourceMax < targetMax ? sourceMax : targetMax; - } - for (var i = 0; i < count; i++) { - var s = i < sourceMax ? getTypeOfSymbol(source.parameters[i]) : getRestTypeOfSignature(source); - var t = i < targetMax ? getTypeOfSymbol(target.parameters[i]) : getRestTypeOfSignature(target); - callback(s, t); - } - } - function createInferenceContext(typeParameters) { - var inferences = []; - for (var i = 0; i < typeParameters.length; i++) - inferences.push([]); - return { - typeParameters: typeParameters, - inferences: inferences, - inferredTypes: new Array(typeParameters.length) - }; - } - function inferTypes(context, source, target) { - var sourceStack; - var targetStack; - var depth = 0; - inferFromTypes(source, target); - function isInProcess(source, target) { - for (var i = 0; i < depth; i++) { - if (source === sourceStack[i] && target === targetStack[i]) - return true; - } - return false; - } - function isWithinDepthLimit(type, stack) { - if (depth >= 5) { - var target = type.target; - var count = 0; - for (var i = 0; i < depth; i++) { - var t = stack[i]; - if (t.flags & 4096 /* Reference */ && t.target === target) - count++; - } - return count < 5; - } - return true; - } - function inferFromTypes(source, target) { - if (target.flags & 512 /* TypeParameter */) { - var typeParameters = context.typeParameters; - for (var i = 0; i < typeParameters.length; i++) { - if (target === typeParameters[i]) { - var inferences = context.inferences[i]; - if (!ts.contains(inferences, source)) - inferences.push(source); - break; - } - } - } - else if (source.flags & 4096 /* Reference */ && target.flags & 4096 /* Reference */ && source.target === target.target) { - var sourceTypes = source.typeArguments; - var targetTypes = target.typeArguments; - for (var i = 0; i < sourceTypes.length; i++) { - inferFromTypes(sourceTypes[i], targetTypes[i]); - } - } - else if (source.flags & ts.TypeFlags.ObjectType && (target.flags & (4096 /* Reference */ | 8192 /* Tuple */) || (target.flags & 16384 /* Anonymous */) && target.symbol && target.symbol.flags & (2048 /* Method */ | 512 /* TypeLiteral */))) { - if (!isInProcess(source, target) && isWithinDepthLimit(source, sourceStack) && isWithinDepthLimit(target, targetStack)) { - if (depth === 0) { - sourceStack = []; - targetStack = []; - } - sourceStack[depth] = source; - targetStack[depth] = target; - depth++; - inferFromProperties(source, target); - inferFromSignatures(source, target, 0 /* Call */); - inferFromSignatures(source, target, 1 /* Construct */); - inferFromIndexTypes(source, target, 0 /* String */, 0 /* String */); - inferFromIndexTypes(source, target, 1 /* Number */, 1 /* Number */); - inferFromIndexTypes(source, target, 0 /* String */, 1 /* Number */); - depth--; - } - } - } - function inferFromProperties(source, target) { - var properties = getPropertiesOfType(target); - for (var i = 0; i < properties.length; i++) { - var targetProp = properties[i]; - var sourceProp = getPropertyOfType(source, targetProp.name); - if (sourceProp) { - inferFromTypes(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp)); - } - } - } - function inferFromSignatures(source, target, kind) { - var sourceSignatures = getSignaturesOfType(source, kind); - var targetSignatures = getSignaturesOfType(target, kind); - var sourceLen = sourceSignatures.length; - var targetLen = targetSignatures.length; - var len = sourceLen < targetLen ? sourceLen : targetLen; - for (var i = 0; i < len; i++) { - inferFromSignature(getErasedSignature(sourceSignatures[sourceLen - len + i]), getErasedSignature(targetSignatures[targetLen - len + i])); - } - } - function inferFromSignature(source, target) { - forEachMatchingParameterType(source, target, inferFromTypes); - inferFromTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target)); - } - function inferFromIndexTypes(source, target, sourceKind, targetKind) { - var targetIndexType = getIndexTypeOfType(target, targetKind); - if (targetIndexType) { - var sourceIndexType = getIndexTypeOfType(source, sourceKind); - if (sourceIndexType) { - inferFromTypes(sourceIndexType, targetIndexType); - } - } - } - } - function getInferredType(context, index) { - var result = context.inferredTypes[index]; - if (!result) { - var commonType = getWidenedType(getBestCommonType(context.inferences[index])); - var constraint = getConstraintOfTypeParameter(context.typeParameters[index]); - var result = constraint && !isTypeAssignableTo(commonType, constraint) ? constraint : commonType; - context.inferredTypes[index] = result; - } - return result; - } - function getInferredTypes(context) { - for (var i = 0; i < context.inferredTypes.length; i++) { - getInferredType(context, i); - } - context.inferences = undefined; - return context.inferredTypes; - } - function hasAncestor(node, kind) { - return ts.getAncestor(node, kind) !== undefined; - } - function checkIdentifier(node) { - function isInTypeQuery(node) { - while (node) { - switch (node.kind) { - case 128 /* TypeQuery */: - return true; - case 59 /* Identifier */: - case 116 /* QualifiedName */: - node = node.parent; - continue; - default: - return false; - } - } - ts.Debug.fail("should not get here"); - } - var symbol = resolveName(node, node.text, ts.SymbolFlags.Value | 524288 /* ExportValue */, ts.Diagnostics.Cannot_find_name_0, ts.identifierToString(node)); - if (!symbol) { - symbol = unknownSymbol; - } - if (symbol.flags & 4194304 /* Import */) { - getSymbolLinks(symbol).referenced = !isInTypeQuery(node); - } - getNodeLinks(node).resolvedSymbol = symbol; - checkCollisionWithCapturedSuperVariable(node, node); - checkCollisionWithCapturedThisVariable(node, node); - checkCollisionWithIndexVariableInGeneratedCode(node, node); - return getTypeOfSymbol(getExportSymbolOfValueSymbolIfExported(symbol)); - } - function captureLexicalThis(node, container) { - var classNode = container.parent && container.parent.kind === 174 /* ClassDeclaration */ ? container.parent : undefined; - getNodeLinks(node).flags |= 2 /* LexicalThis */; - if (container.kind === 119 /* Property */ || container.kind === 121 /* Constructor */) { - getNodeLinks(classNode).flags |= 4 /* CaptureThis */; - } - else { - getNodeLinks(container).flags |= 4 /* CaptureThis */; - } - } - function checkThisExpression(node) { - var container = ts.getThisContainer(node, true); - var needToCaptureLexicalThis = false; - if (container.kind === 142 /* ArrowFunction */) { - container = ts.getThisContainer(container, false); - needToCaptureLexicalThis = true; - } - switch (container.kind) { - case 177 /* ModuleDeclaration */: - error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_body); - break; - case 176 /* EnumDeclaration */: - error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); - break; - case 121 /* Constructor */: - if (isInConstructorArgumentInitializer(node, container)) { - error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); - } - break; - case 119 /* Property */: - if (container.flags & 128 /* Static */) { - error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); - } - break; - } - if (needToCaptureLexicalThis) { - captureLexicalThis(node, container); - } - var classNode = container.parent && container.parent.kind === 174 /* ClassDeclaration */ ? container.parent : undefined; - if (classNode) { - var symbol = getSymbolOfNode(classNode); - return container.flags & 128 /* Static */ ? getTypeOfSymbol(symbol) : getDeclaredTypeOfSymbol(symbol); - } - return anyType; - } - function getSuperContainer(node) { - while (true) { - node = node.parent; - if (!node) - return node; - switch (node.kind) { - case 172 /* FunctionDeclaration */: - case 141 /* FunctionExpression */: - case 142 /* ArrowFunction */: - case 119 /* Property */: - case 120 /* Method */: - case 121 /* Constructor */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - return node; - } - } - } - function isInConstructorArgumentInitializer(node, constructorDecl) { - for (var n = node; n && n !== constructorDecl; n = n.parent) { - if (n.kind === 118 /* Parameter */) { - return true; - } - } - return false; - } - function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 137 /* CallExpression */ && node.parent.func === node; - var enclosingClass = ts.getAncestor(node, 174 /* ClassDeclaration */); - var baseClass; - if (enclosingClass && enclosingClass.baseType) { - var classType = getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClass)); - baseClass = classType.baseTypes.length && classType.baseTypes[0]; - } - if (!baseClass) { - error(node, ts.Diagnostics.super_can_only_be_referenced_in_a_derived_class); - return unknownType; - } - var container = getSuperContainer(node); - if (container) { - var canUseSuperExpression = false; - if (isCallExpression) { - canUseSuperExpression = container.kind === 121 /* Constructor */; - } - else { - var needToCaptureLexicalThis = false; - while (container && container.kind === 142 /* ArrowFunction */) { - container = getSuperContainer(container); - needToCaptureLexicalThis = true; - } - if (container && container.parent && container.parent.kind === 174 /* ClassDeclaration */) { - if (container.flags & 128 /* Static */) { - canUseSuperExpression = container.kind === 120 /* Method */ || container.kind === 122 /* GetAccessor */ || container.kind === 123 /* SetAccessor */; - } - else { - canUseSuperExpression = container.kind === 120 /* Method */ || container.kind === 122 /* GetAccessor */ || container.kind === 123 /* SetAccessor */ || container.kind === 119 /* Property */ || container.kind === 121 /* Constructor */; - } - } - } - if (canUseSuperExpression) { - var returnType; - if ((container.flags & 128 /* Static */) || isCallExpression) { - getNodeLinks(node).flags |= 32 /* SuperStatic */; - returnType = getTypeOfSymbol(baseClass.symbol); - } - else { - getNodeLinks(node).flags |= 16 /* SuperInstance */; - returnType = baseClass; - } - if (container.kind === 121 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { - error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); - returnType = unknownType; - } - if (!isCallExpression && needToCaptureLexicalThis) { - captureLexicalThis(node.parent, container); - } - return returnType; - } - } - if (isCallExpression) { - error(node, ts.Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors); - } - else { - error(node, ts.Diagnostics.super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class); - } - return unknownType; - } - function getContextuallyTypedParameterType(parameter) { - var func = parameter.parent; - if (func.kind === 141 /* FunctionExpression */ || func.kind === 142 /* ArrowFunction */) { - if (isContextSensitiveExpression(func)) { - var contextualSignature = getContextualSignature(func); - if (contextualSignature) { - var funcHasRestParameters = ts.hasRestParameters(func); - var len = func.parameters.length - (funcHasRestParameters ? 1 : 0); - var indexOfParameter = ts.indexOf(func.parameters, parameter); - if (indexOfParameter < len) { - return getTypeAtPosition(contextualSignature, indexOfParameter); - } - if (indexOfParameter === (func.parameters.length - 1) && funcHasRestParameters && contextualSignature.hasRestParameter && func.parameters.length >= contextualSignature.parameters.length) { - return getTypeOfSymbol(contextualSignature.parameters[contextualSignature.parameters.length - 1]); - } - } - } - } - return undefined; - } - function getContextualTypeForInitializerExpression(node) { - var declaration = node.parent; - if (node === declaration.initializer) { - if (declaration.type) { - return getTypeFromTypeNode(declaration.type); - } - if (declaration.kind === 118 /* Parameter */) { - return getContextuallyTypedParameterType(declaration); - } - } - return undefined; - } - function getContextualTypeForReturnExpression(node) { - var func = ts.getContainingFunction(node); - if (func) { - if (func.type || func.kind === 121 /* Constructor */ || func.kind === 122 /* GetAccessor */ && getSetAccessorTypeAnnotationNode(getDeclarationOfKind(func.symbol, 123 /* SetAccessor */))) { - return getReturnTypeOfSignature(getSignatureFromDeclaration(func)); - } - var signature = getContextualSignature(func); - if (signature) { - return getReturnTypeOfSignature(signature); - } - } - return undefined; - } - function getContextualTypeForArgument(node) { - var callExpression = node.parent; - var argIndex = ts.indexOf(callExpression.arguments, node); - if (argIndex >= 0) { - var signature = getResolvedSignature(callExpression); - return getTypeAtPosition(signature, argIndex); - } - return undefined; - } - function getContextualTypeForBinaryOperand(node) { - var binaryExpression = node.parent; - var operator = binaryExpression.operator; - if (operator >= ts.SyntaxKind.FirstAssignment && operator <= ts.SyntaxKind.LastAssignment) { - if (node === binaryExpression.right) { - return checkExpression(binaryExpression.left); - } - } - else if (operator === 44 /* BarBarToken */) { - var type = getContextualType(binaryExpression); - if (!type && node === binaryExpression.right) { - type = checkExpression(binaryExpression.left); - } - return type; - } - return undefined; - } - function getContextualTypeForPropertyExpression(node) { - var declaration = node.parent; - var objectLiteral = declaration.parent; - var type = getContextualType(objectLiteral); - var name = declaration.name.text; - if (type && name) { - var prop = getPropertyOfType(type, name); - if (prop) { - return getTypeOfSymbol(prop); - } - return isNumericName(name) && getIndexTypeOfType(type, 1 /* Number */) || getIndexTypeOfType(type, 0 /* String */); - } - return undefined; - } - function getContextualTypeForElementExpression(node) { - var arrayLiteral = node.parent; - var type = getContextualType(arrayLiteral); - if (type) { - var index = ts.indexOf(arrayLiteral.elements, node); - var prop = getPropertyOfType(type, "" + index); - if (prop) { - return getTypeOfSymbol(prop); - } - return getIndexTypeOfType(type, 1 /* Number */); - } - return undefined; - } - function getContextualTypeForConditionalOperand(node) { - var conditional = node.parent; - return node === conditional.whenTrue || node === conditional.whenFalse ? getContextualType(conditional) : undefined; - } - function getContextualType(node) { - if (isInsideWithStatementBody(node)) { - return undefined; - } - if (node.contextualType) { - return node.contextualType; - } - var parent = node.parent; - switch (parent.kind) { - case 171 /* VariableDeclaration */: - case 118 /* Parameter */: - case 119 /* Property */: - return getContextualTypeForInitializerExpression(node); - case 142 /* ArrowFunction */: - case 159 /* ReturnStatement */: - return getContextualTypeForReturnExpression(node); - case 137 /* CallExpression */: - case 138 /* NewExpression */: - return getContextualTypeForArgument(node); - case 139 /* TypeAssertion */: - return getTypeFromTypeNode(parent.type); - case 145 /* BinaryExpression */: - return getContextualTypeForBinaryOperand(node); - case 134 /* PropertyAssignment */: - return getContextualTypeForPropertyExpression(node); - case 132 /* ArrayLiteral */: - return getContextualTypeForElementExpression(node); - case 146 /* ConditionalExpression */: - return getContextualTypeForConditionalOperand(node); - } - return undefined; - } - function getContextualSignature(node) { - var type = getContextualType(node); - if (type) { - var signatures = getSignaturesOfType(type, 0 /* Call */); - if (signatures.length === 1) { - var signature = signatures[0]; - if (!signature.typeParameters) { - return signature; - } - } - } - return undefined; - } - function isInferentialContext(mapper) { - return mapper && mapper !== identityMapper; - } - function checkArrayLiteral(node, contextualMapper) { - var contextualType = getContextualType(node); - var elements = node.elements; - var elementTypes = []; - var isTupleLiteral = false; - for (var i = 0; i < elements.length; i++) { - if (contextualType && getPropertyOfType(contextualType, "" + i)) { - isTupleLiteral = true; - } - var element = elements[i]; - var type = element.kind !== 147 /* OmittedExpression */ ? checkExpression(element, contextualMapper) : undefinedType; - elementTypes.push(type); - } - if (isTupleLiteral) { - return createTupleType(elementTypes); - } - var contextualElementType = contextualType && !isInferentialContext(contextualMapper) ? getIndexTypeOfType(contextualType, 1 /* Number */) : undefined; - var elementType = getBestCommonType(ts.uniqueElements(elementTypes), contextualElementType, true); - if (!elementType) { - elementType = elements.length ? emptyObjectType : undefinedType; - } - return createArrayType(elementType); - } - function isNumericName(name) { - return (name !== "") && !isNaN(name); - } - function checkObjectLiteral(node, contextualMapper) { - var members = node.symbol.members; - var properties = {}; - var contextualType = getContextualType(node); - for (var id in members) { - if (ts.hasProperty(members, id)) { - var member = members[id]; - if (member.flags & 2 /* Property */) { - var type = checkExpression(member.declarations[0].initializer, contextualMapper); - var prop = createSymbol(2 /* Property */ | 33554432 /* Transient */, member.name); - prop.declarations = member.declarations; - prop.parent = member.parent; - if (member.valueDeclaration) - prop.valueDeclaration = member.valueDeclaration; - prop.type = type; - prop.target = member; - member = prop; - } - else { - var getAccessor = getDeclarationOfKind(member, 122 /* GetAccessor */); - if (getAccessor) { - checkAccessorDeclaration(getAccessor); - } - var setAccessor = getDeclarationOfKind(member, 123 /* SetAccessor */); - if (setAccessor) { - checkAccessorDeclaration(setAccessor); - } - } - properties[member.name] = member; - } - } - var stringIndexType = getIndexType(0 /* String */); - var numberIndexType = getIndexType(1 /* Number */); - return createAnonymousType(node.symbol, properties, emptyArray, emptyArray, stringIndexType, numberIndexType); - function getIndexType(kind) { - if (contextualType) { - var indexType = getIndexTypeOfType(contextualType, kind); - if (indexType) { - var propTypes = []; - for (var id in properties) { - if (ts.hasProperty(properties, id)) { - if (kind === 0 /* String */ || isNumericName(id)) { - var type = getTypeOfSymbol(properties[id]); - if (!ts.contains(propTypes, type)) - propTypes.push(type); - } - } - } - return getBestCommonType(propTypes, isInferentialContext(contextualMapper) ? undefined : indexType); - } - } - } - } - function getDeclarationKindFromSymbol(s) { - return s.valueDeclaration ? s.valueDeclaration.kind : 119 /* Property */; - } - function getDeclarationFlagsFromSymbol(s) { - return s.valueDeclaration ? s.valueDeclaration.flags : s.flags & 67108864 /* Prototype */ ? 16 /* Public */ | 128 /* Static */ : 0; - } - function checkClassPropertyAccess(node, type, prop) { - var flags = getDeclarationFlagsFromSymbol(prop); - if (!(flags & (32 /* Private */ | 64 /* Protected */))) { - return; - } - var enclosingClassDeclaration = ts.getAncestor(node, 174 /* ClassDeclaration */); - var enclosingClass = enclosingClassDeclaration ? getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClassDeclaration)) : undefined; - var declaringClass = getDeclaredTypeOfSymbol(prop.parent); - if (flags & 32 /* Private */) { - if (declaringClass !== enclosingClass) { - error(node, ts.Diagnostics.Property_0_is_private_and_only_accessible_within_class_1, symbolToString(prop), typeToString(declaringClass)); - } - return; - } - if (node.left.kind === 85 /* SuperKeyword */) { - return; - } - if (!enclosingClass || !hasBaseType(enclosingClass, declaringClass)) { - error(node, ts.Diagnostics.Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses, symbolToString(prop), typeToString(declaringClass)); - return; - } - if (flags & 128 /* Static */) { - return; - } - if (!(getTargetType(type).flags & (1024 /* Class */ | 2048 /* Interface */) && hasBaseType(type, enclosingClass))) { - error(node, ts.Diagnostics.Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1, symbolToString(prop), typeToString(enclosingClass)); - } - } - function checkPropertyAccess(node) { - var type = checkExpression(node.left); - if (type === unknownType) - return type; - if (type !== anyType) { - var apparentType = getApparentType(getWidenedType(type)); - if (apparentType === unknownType) { - return unknownType; - } - var prop = getPropertyOfApparentType(apparentType, node.right.text); - if (!prop) { - if (node.right.text) { - error(node.right, ts.Diagnostics.Property_0_does_not_exist_on_type_1, ts.identifierToString(node.right), typeToString(type)); - } - return unknownType; - } - getNodeLinks(node).resolvedSymbol = prop; - if (prop.parent && prop.parent.flags & 16 /* Class */) { - if (node.left.kind === 85 /* SuperKeyword */ && getDeclarationKindFromSymbol(prop) !== 120 /* Method */) { - error(node.right, ts.Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword); - } - else { - checkClassPropertyAccess(node, type, prop); - } - } - return getTypeOfSymbol(prop); - } - return anyType; - } - function isValidPropertyAccess(node, propertyName) { - var type = checkExpression(node.left); - if (type !== unknownType && type !== anyType) { - var apparentType = getApparentType(getWidenedType(type)); - var prop = getPropertyOfApparentType(apparentType, propertyName); - if (prop && prop.parent && prop.parent.flags & 16 /* Class */) { - if (node.left.kind === 85 /* SuperKeyword */ && getDeclarationKindFromSymbol(prop) !== 120 /* Method */) { - return false; - } - else { - var diagnosticsCount = diagnostics.length; - checkClassPropertyAccess(node, type, prop); - return diagnostics.length === diagnosticsCount; - } - } - } - return true; - } - function checkIndexedAccess(node) { - var objectType = checkExpression(node.object); - var indexType = checkExpression(node.index); - if (objectType === unknownType) - return unknownType; - var apparentType = getApparentType(objectType); - if (apparentType === unknownType) { - return unknownType; - } - if (node.index.kind === 7 /* StringLiteral */ || node.index.kind === 6 /* NumericLiteral */) { - var name = node.index.text; - var prop = getPropertyOfApparentType(apparentType, name); - if (prop) { - return getTypeOfSymbol(prop); - } - } - if (indexType.flags & (1 /* Any */ | ts.TypeFlags.StringLike | ts.TypeFlags.NumberLike)) { - if (indexType.flags & (1 /* Any */ | ts.TypeFlags.NumberLike)) { - var numberIndexType = getIndexTypeOfType(apparentType, 1 /* Number */); - if (numberIndexType) { - return numberIndexType; - } - } - var stringIndexType = getIndexTypeOfType(apparentType, 0 /* String */); - if (stringIndexType) { - return stringIndexType; - } - if (compilerOptions.noImplicitAny && objectType !== anyType) { - error(node, ts.Diagnostics.Index_signature_of_object_type_implicitly_has_an_any_type); - } - return anyType; - } - error(node, ts.Diagnostics.An_index_expression_argument_must_be_of_type_string_number_or_any); - return unknownType; - } - function resolveUntypedCall(node) { - ts.forEach(node.arguments, function (argument) { - checkExpression(argument); - }); - return anySignature; - } - function resolveErrorCall(node) { - resolveUntypedCall(node); - return unknownSignature; - } - function signatureHasCorrectArity(node, signature) { - if (!node.arguments) { - return signature.minArgumentCount === 0; - } - var args = node.arguments; - var numberOfArgs = args.hasTrailingComma ? args.length + 1 : args.length; - var hasTooManyArguments = !signature.hasRestParameter && numberOfArgs > signature.parameters.length; - var hasRightNumberOfTypeArguments = !node.typeArguments || (signature.typeParameters && node.typeArguments.length === signature.typeParameters.length); - if (hasTooManyArguments || !hasRightNumberOfTypeArguments) { - return false; - } - var callIsIncomplete = args.end === node.end; - var hasEnoughArguments = numberOfArgs >= signature.minArgumentCount; - return callIsIncomplete || hasEnoughArguments; - } - function getSingleCallSignature(type) { - if (type.flags & ts.TypeFlags.ObjectType) { - var resolved = resolveObjectTypeMembers(type); - if (resolved.callSignatures.length === 1 && resolved.constructSignatures.length === 0 && resolved.properties.length === 0 && !resolved.stringIndexType && !resolved.numberIndexType) { - return resolved.callSignatures[0]; - } - } - return undefined; - } - function instantiateSignatureInContextOf(signature, contextualSignature, contextualMapper) { - var context = createInferenceContext(signature.typeParameters); - forEachMatchingParameterType(contextualSignature, signature, function (source, target) { - inferTypes(context, instantiateType(source, contextualMapper), target); - }); - return getSignatureInstantiation(signature, getInferredTypes(context)); - } - function inferTypeArguments(signature, args, excludeArgument) { - var typeParameters = signature.typeParameters; - var context = createInferenceContext(typeParameters); - var mapper = createInferenceMapper(context); - for (var i = 0; i < args.length; i++) { - if (args[i].kind === 147 /* OmittedExpression */) { - continue; - } - if (!excludeArgument || excludeArgument[i] === undefined) { - var parameterType = getTypeAtPosition(signature, i); - inferTypes(context, checkExpressionWithContextualType(args[i], parameterType, mapper), parameterType); - } - } - if (excludeArgument) { - for (var i = 0; i < args.length; i++) { - if (args[i].kind === 147 /* OmittedExpression */) { - continue; - } - if (excludeArgument[i] === false) { - var parameterType = getTypeAtPosition(signature, i); - inferTypes(context, checkExpressionWithContextualType(args[i], parameterType, mapper), parameterType); - } - } - } - return getInferredTypes(context); - } - function checkTypeArguments(signature, typeArguments) { - var typeParameters = signature.typeParameters; - var result = []; - for (var i = 0; i < typeParameters.length; i++) { - var typeArgNode = typeArguments[i]; - var typeArgument = getTypeFromTypeNode(typeArgNode); - var constraint = getConstraintOfTypeParameter(typeParameters[i]); - if (constraint && fullTypeCheck) { - checkTypeAssignableTo(typeArgument, constraint, typeArgNode, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1_Colon, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); - } - result.push(typeArgument); - } - return result; - } - function checkApplicableSignature(node, signature, relation, excludeArgument, reportErrors) { - if (node.arguments) { - for (var i = 0; i < node.arguments.length; i++) { - var arg = node.arguments[i]; - if (arg.kind === 147 /* OmittedExpression */) { - continue; - } - var paramType = getTypeAtPosition(signature, i); - var argType = arg.kind === 7 /* StringLiteral */ && !reportErrors ? getStringLiteralType(arg) : checkExpressionWithContextualType(arg, paramType, excludeArgument && excludeArgument[i] ? identityMapper : undefined); - var isValidArgument = checkTypeRelatedTo(argType, paramType, relation, reportErrors ? arg : undefined, ts.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1, ts.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1); - if (!isValidArgument) { - return false; - } - } - } - return true; - } - function resolveCall(node, signatures, candidatesOutArray) { - ts.forEach(node.typeArguments, checkSourceElement); - var candidates = candidatesOutArray || []; - collectCandidates(); - if (!candidates.length) { - error(node, ts.Diagnostics.Supplied_parameters_do_not_match_any_signature_of_call_target); - return resolveErrorCall(node); - } - var args = node.arguments || emptyArray; - var excludeArgument; - for (var i = 0; i < args.length; i++) { - if (isContextSensitiveExpression(args[i])) { - if (!excludeArgument) - excludeArgument = new Array(args.length); - excludeArgument[i] = true; - } - } - var relation = candidates.length === 1 ? assignableRelation : subtypeRelation; - while (true) { - for (var i = 0; i < candidates.length; i++) { - if (!signatureHasCorrectArity(node, candidates[i])) { - continue; - } - while (true) { - var candidateWithCorrectArity = candidates[i]; - if (candidateWithCorrectArity.typeParameters) { - var typeArguments = node.typeArguments ? checkTypeArguments(candidateWithCorrectArity, node.typeArguments) : inferTypeArguments(candidateWithCorrectArity, args, excludeArgument); - candidateWithCorrectArity = getSignatureInstantiation(candidateWithCorrectArity, typeArguments); - } - if (!checkApplicableSignature(node, candidateWithCorrectArity, relation, excludeArgument, false)) { - break; - } - var index = excludeArgument ? ts.indexOf(excludeArgument, true) : -1; - if (index < 0) { - return candidateWithCorrectArity; - } - excludeArgument[index] = false; - } - } - if (relation === assignableRelation) { - break; - } - relation = assignableRelation; - } - if (candidateWithCorrectArity) { - checkApplicableSignature(node, candidateWithCorrectArity, relation, undefined, true); - } - else { - error(node, ts.Diagnostics.Supplied_parameters_do_not_match_any_signature_of_call_target); - } - if (!fullTypeCheck) { - for (var i = 0, n = candidates.length; i < n; i++) { - if (signatureHasCorrectArity(node, candidates[i])) { - return candidates[i]; - } - } - } - return resolveErrorCall(node); - function collectCandidates() { - var result = candidates; - var lastParent; - var lastSymbol; - var cutoffPos = 0; - var pos; - ts.Debug.assert(!result.length); - for (var i = 0; i < signatures.length; i++) { - var signature = signatures[i]; - if (true) { - var symbol = signature.declaration && getSymbolOfNode(signature.declaration); - var parent = signature.declaration && signature.declaration.parent; - if (!lastSymbol || symbol === lastSymbol) { - if (lastParent && parent === lastParent) { - pos++; - } - else { - lastParent = parent; - pos = cutoffPos; - } - } - else { - pos = cutoffPos = result.length; - lastParent = parent; - } - lastSymbol = symbol; - for (var j = result.length; j > pos; j--) { - result[j] = result[j - 1]; - } - result[pos] = signature; - } - } - } - } - function resolveCallExpression(node, candidatesOutArray) { - if (node.func.kind === 85 /* SuperKeyword */) { - var superType = checkSuperExpression(node.func); - if (superType !== unknownType) { - return resolveCall(node, getSignaturesOfType(superType, 1 /* Construct */), candidatesOutArray); - } - return resolveUntypedCall(node); - } - var funcType = checkExpression(node.func); - if (funcType === unknownType) { - return resolveErrorCall(node); - } - var apparentType = getApparentType(funcType); - if (apparentType === unknownType) { - return resolveErrorCall(node); - } - var callSignatures = getSignaturesOfType(apparentType, 0 /* Call */); - var constructSignatures = getSignaturesOfType(apparentType, 1 /* Construct */); - if ((funcType === anyType) || (!callSignatures.length && !constructSignatures.length && isTypeAssignableTo(funcType, globalFunctionType))) { - if (node.typeArguments) { - error(node, ts.Diagnostics.Untyped_function_calls_may_not_accept_type_arguments); - } - return resolveUntypedCall(node); - } - if (!callSignatures.length) { - if (constructSignatures.length) { - error(node, ts.Diagnostics.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new, typeToString(funcType)); - } - else { - error(node, ts.Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature); - } - return resolveErrorCall(node); - } - return resolveCall(node, callSignatures, candidatesOutArray); - } - function resolveNewExpression(node, candidatesOutArray) { - var expressionType = checkExpression(node.func); - if (expressionType === unknownType) { - return resolveErrorCall(node); - } - if (expressionType === anyType) { - if (node.typeArguments) { - error(node, ts.Diagnostics.Untyped_function_calls_may_not_accept_type_arguments); - } - return resolveUntypedCall(node); - } - expressionType = getApparentType(expressionType); - if (expressionType === unknownType) { - return resolveErrorCall(node); - } - var constructSignatures = getSignaturesOfType(expressionType, 1 /* Construct */); - if (constructSignatures.length) { - return resolveCall(node, constructSignatures, candidatesOutArray); - } - var callSignatures = getSignaturesOfType(expressionType, 0 /* Call */); - if (callSignatures.length) { - var signature = resolveCall(node, callSignatures, candidatesOutArray); - if (getReturnTypeOfSignature(signature) !== voidType) { - error(node, ts.Diagnostics.Only_a_void_function_can_be_called_with_the_new_keyword); - } - return signature; - } - error(node, ts.Diagnostics.Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature); - return resolveErrorCall(node); - } - function getResolvedSignature(node, candidatesOutArray) { - var links = getNodeLinks(node); - if (!links.resolvedSignature || candidatesOutArray) { - links.resolvedSignature = anySignature; - links.resolvedSignature = node.kind === 137 /* CallExpression */ ? resolveCallExpression(node, candidatesOutArray) : resolveNewExpression(node, candidatesOutArray); - } - return links.resolvedSignature; - } - function checkCallExpression(node) { - var signature = getResolvedSignature(node); - if (node.func.kind === 85 /* SuperKeyword */) { - return voidType; - } - if (node.kind === 138 /* NewExpression */) { - var declaration = signature.declaration; - if (declaration && (declaration.kind !== 121 /* Constructor */ && declaration.kind !== 125 /* ConstructSignature */)) { - if (compilerOptions.noImplicitAny) { - error(node, ts.Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type); - } - return anyType; - } - } - return getReturnTypeOfSignature(signature); - } - function checkTypeAssertion(node) { - var exprType = checkExpression(node.operand); - var targetType = getTypeFromTypeNode(node.type); - if (fullTypeCheck && targetType !== unknownType) { - var widenedType = getWidenedType(exprType, true); - if (!(isTypeAssignableTo(targetType, widenedType))) { - checkTypeAssignableTo(exprType, targetType, node, ts.Diagnostics.Neither_type_0_nor_type_1_is_assignable_to_the_other_Colon, ts.Diagnostics.Neither_type_0_nor_type_1_is_assignable_to_the_other); - } - } - return targetType; - } - function getTypeAtPosition(signature, pos) { - return signature.hasRestParameter ? pos < signature.parameters.length - 1 ? getTypeOfSymbol(signature.parameters[pos]) : getRestTypeOfSignature(signature) : pos < signature.parameters.length ? getTypeOfSymbol(signature.parameters[pos]) : anyType; - } - function assignContextualParameterTypes(signature, context, mapper) { - var len = signature.parameters.length - (signature.hasRestParameter ? 1 : 0); - for (var i = 0; i < len; i++) { - var parameter = signature.parameters[i]; - var links = getSymbolLinks(parameter); - links.type = instantiateType(getTypeAtPosition(context, i), mapper); - } - if (signature.hasRestParameter && context.hasRestParameter && signature.parameters.length >= context.parameters.length) { - var parameter = signature.parameters[signature.parameters.length - 1]; - var links = getSymbolLinks(parameter); - links.type = instantiateType(getTypeOfSymbol(context.parameters[context.parameters.length - 1]), mapper); - } - } - function getReturnTypeFromBody(func, contextualMapper) { - if (func.body.kind !== 173 /* FunctionBlock */) { - var unwidenedType = checkAndMarkExpression(func.body, contextualMapper); - var widenedType = getWidenedType(unwidenedType); - if (fullTypeCheck && compilerOptions.noImplicitAny && widenedType !== unwidenedType && getInnermostTypeOfNestedArrayTypes(widenedType) === anyType) { - error(func, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeToString(widenedType)); - } - return widenedType; - } - var types = checkAndAggregateReturnExpressionTypes(func.body, contextualMapper); - if (types.length > 0) { - var commonType = getBestCommonType(types, undefined, true); - if (!commonType) { - error(func, ts.Diagnostics.No_best_common_type_exists_among_return_expressions); - return unknownType; - } - var widenedType = getWidenedType(commonType); - if (fullTypeCheck && compilerOptions.noImplicitAny && widenedType !== commonType && getInnermostTypeOfNestedArrayTypes(widenedType) === anyType) { - var typeName = typeToString(widenedType); - if (func.name) { - error(func, ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type, ts.identifierToString(func.name), typeName); - } - else { - error(func, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeName); - } - } - return widenedType; - } - return voidType; - } - function checkAndAggregateReturnExpressionTypes(body, contextualMapper) { - var aggregatedTypes = []; - ts.forEachReturnStatement(body, function (returnStatement) { - var expr = returnStatement.expression; - if (expr) { - var type = checkAndMarkExpression(expr, contextualMapper); - if (!ts.contains(aggregatedTypes, type)) { - aggregatedTypes.push(type); - } - } - }); - return aggregatedTypes; - } - function bodyContainsAReturnStatement(funcBody) { - return ts.forEachReturnStatement(funcBody, function (returnStatement) { - return true; - }); - } - function bodyContainsSingleThrowStatement(body) { - return (body.statements.length === 1) && (body.statements[0].kind === 165 /* ThrowStatement */); - } - function checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(func, returnType) { - if (!fullTypeCheck) { - return; - } - if (returnType === voidType || returnType === anyType) { - return; - } - if (!func.body || func.body.kind !== 173 /* FunctionBlock */) { - return; - } - var bodyBlock = func.body; - if (bodyContainsAReturnStatement(bodyBlock)) { - return; - } - if (bodyContainsSingleThrowStatement(bodyBlock)) { - return; - } - error(func.type, ts.Diagnostics.A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_or_consist_of_a_single_throw_statement); - } - function checkFunctionExpression(node, contextualMapper) { - if (contextualMapper === identityMapper) { - return anyFunctionType; - } - var links = getNodeLinks(node); - var type = getTypeOfSymbol(node.symbol); - if (!(links.flags & 64 /* ContextChecked */)) { - var contextualSignature = getContextualSignature(node); - if (!(links.flags & 64 /* ContextChecked */)) { - links.flags |= 64 /* ContextChecked */; - if (contextualSignature) { - var signature = getSignaturesOfType(type, 0 /* Call */)[0]; - if (isContextSensitiveExpression(node)) { - assignContextualParameterTypes(signature, contextualSignature, contextualMapper || identityMapper); - } - if (!node.type) { - signature.resolvedReturnType = resolvingType; - var returnType = getReturnTypeFromBody(node, contextualMapper); - if (signature.resolvedReturnType === resolvingType) { - signature.resolvedReturnType = returnType; - } - } - } - checkSignatureDeclaration(node); - } - } - return type; - } - function checkFunctionExpressionBody(node) { - if (node.type) { - checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNode(node.type)); - } - if (node.body.kind === 173 /* FunctionBlock */) { - checkSourceElement(node.body); - } - else { - var exprType = checkExpression(node.body); - if (node.type) { - checkTypeAssignableTo(exprType, getTypeFromTypeNode(node.type), node.body, undefined, undefined); - } - checkFunctionExpressionBodies(node.body); - } - } - function checkArithmeticOperandType(operand, type, diagnostic) { - if (!(type.flags & (1 /* Any */ | ts.TypeFlags.NumberLike))) { - error(operand, diagnostic); - return false; - } - return true; - } - function checkReferenceExpression(n, message) { - function findSymbol(n) { - var symbol = getNodeLinks(n).resolvedSymbol; - return symbol && getExportSymbolOfValueSymbolIfExported(symbol); - } - function isReferenceOrErrorExpression(n) { - switch (n.kind) { - case 59 /* Identifier */: - var symbol = findSymbol(n); - return !symbol || symbol === unknownSymbol || symbol === argumentsSymbol || (symbol.flags & 1 /* Variable */) !== 0; - case 135 /* PropertyAccess */: - var symbol = findSymbol(n); - return !symbol || symbol === unknownSymbol || (symbol.flags & ~4 /* EnumMember */) !== 0; - case 136 /* IndexedAccess */: - return true; - case 140 /* ParenExpression */: - return isReferenceOrErrorExpression(n.expression); - default: - return false; - } - } - if (!isReferenceOrErrorExpression(n)) { - error(n, message); - return false; - } - return true; - } - function checkPrefixExpression(node) { - var operandType = checkExpression(node.operand); - switch (node.operator) { - case 28 /* PlusToken */: - case 29 /* MinusToken */: - case 42 /* TildeToken */: - return numberType; - case 41 /* ExclamationToken */: - case 68 /* DeleteKeyword */: - return booleanType; - case 91 /* TypeOfKeyword */: - return stringType; - case 93 /* VoidKeyword */: - return undefinedType; - case 33 /* PlusPlusToken */: - case 34 /* MinusMinusToken */: - var ok = checkArithmeticOperandType(node.operand, operandType, ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); - if (ok) { - checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer); - } - return numberType; - } - return unknownType; - } - function checkPostfixExpression(node) { - var operandType = checkExpression(node.operand); - var ok = checkArithmeticOperandType(node.operand, operandType, ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); - if (ok) { - checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer); - } - return numberType; - } - function isTypeAnyTypeObjectTypeOrTypeParameter(type) { - return type === anyType || ((type.flags & (ts.TypeFlags.ObjectType | 512 /* TypeParameter */)) !== 0); - } - function checkInstanceOfExpression(node, leftType, rightType) { - if (leftType !== unknownType && !isTypeAnyTypeObjectTypeOrTypeParameter(leftType)) { - error(node.left, ts.Diagnostics.The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); - } - if (rightType !== unknownType && rightType !== anyType && !isTypeSubtypeOf(rightType, globalFunctionType)) { - error(node.right, ts.Diagnostics.The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type); - } - return booleanType; - } - function checkInExpression(node, leftType, rightType) { - if (leftType !== anyType && leftType !== stringType && leftType !== numberType) { - error(node.left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_types_any_string_or_number); - } - if (!isTypeAnyTypeObjectTypeOrTypeParameter(rightType)) { - error(node.right, ts.Diagnostics.The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); - } - return booleanType; - } - function checkBinaryExpression(node, contextualMapper) { - var operator = node.operator; - var leftType = checkExpression(node.left, contextualMapper); - var rightType = checkExpression(node.right, contextualMapper); - switch (operator) { - case 30 /* AsteriskToken */: - case 50 /* AsteriskEqualsToken */: - case 31 /* SlashToken */: - case 51 /* SlashEqualsToken */: - case 32 /* PercentToken */: - case 52 /* PercentEqualsToken */: - case 29 /* MinusToken */: - case 49 /* MinusEqualsToken */: - case 35 /* LessThanLessThanToken */: - case 53 /* LessThanLessThanEqualsToken */: - case 36 /* GreaterThanGreaterThanToken */: - case 54 /* GreaterThanGreaterThanEqualsToken */: - case 37 /* GreaterThanGreaterThanGreaterThanToken */: - case 55 /* GreaterThanGreaterThanGreaterThanEqualsToken */: - case 39 /* BarToken */: - case 57 /* BarEqualsToken */: - case 40 /* CaretToken */: - case 58 /* CaretEqualsToken */: - case 38 /* AmpersandToken */: - case 56 /* AmpersandEqualsToken */: - if (leftType.flags & (32 /* Undefined */ | 64 /* Null */)) - leftType = rightType; - if (rightType.flags & (32 /* Undefined */ | 64 /* Null */)) - rightType = leftType; - var suggestedOperator; - if ((leftType.flags & 8 /* Boolean */) && (rightType.flags & 8 /* Boolean */) && (suggestedOperator = getSuggestedBooleanOperator(node.operator)) !== undefined) { - error(node, ts.Diagnostics.The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead, ts.tokenToString(node.operator), ts.tokenToString(suggestedOperator)); - } - else { - var leftOk = checkArithmeticOperandType(node.left, leftType, ts.Diagnostics.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type); - var rightOk = checkArithmeticOperandType(node.right, rightType, ts.Diagnostics.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type); - if (leftOk && rightOk) { - checkAssignmentOperator(numberType); - } - } - return numberType; - case 28 /* PlusToken */: - case 48 /* PlusEqualsToken */: - if (leftType.flags & (32 /* Undefined */ | 64 /* Null */)) - leftType = rightType; - if (rightType.flags & (32 /* Undefined */ | 64 /* Null */)) - rightType = leftType; - var resultType; - if (leftType.flags & ts.TypeFlags.NumberLike && rightType.flags & ts.TypeFlags.NumberLike) { - resultType = numberType; - } - else if (leftType.flags & ts.TypeFlags.StringLike || rightType.flags & ts.TypeFlags.StringLike) { - resultType = stringType; - } - else if (leftType.flags & 1 /* Any */ || leftType === unknownType || rightType.flags & 1 /* Any */ || rightType === unknownType) { - resultType = anyType; - } - if (!resultType) { - reportOperatorError(); - return anyType; - } - if (operator === 48 /* PlusEqualsToken */) { - checkAssignmentOperator(resultType); - } - return resultType; - case 23 /* EqualsEqualsToken */: - case 24 /* ExclamationEqualsToken */: - case 25 /* EqualsEqualsEqualsToken */: - case 26 /* ExclamationEqualsEqualsToken */: - case 19 /* LessThanToken */: - case 20 /* GreaterThanToken */: - case 21 /* LessThanEqualsToken */: - case 22 /* GreaterThanEqualsToken */: - if (!isTypeSubtypeOf(leftType, rightType) && !isTypeSubtypeOf(rightType, leftType)) { - reportOperatorError(); - } - return booleanType; - case 81 /* InstanceOfKeyword */: - return checkInstanceOfExpression(node, leftType, rightType); - case 80 /* InKeyword */: - return checkInExpression(node, leftType, rightType); - case 43 /* AmpersandAmpersandToken */: - return rightType; - case 44 /* BarBarToken */: - return getBestCommonType([leftType, rightType], isInferentialContext(contextualMapper) ? undefined : getContextualType(node)); - case 47 /* EqualsToken */: - checkAssignmentOperator(rightType); - return rightType; - case 18 /* CommaToken */: - return rightType; - } - function getSuggestedBooleanOperator(operator) { - switch (operator) { - case 39 /* BarToken */: - case 57 /* BarEqualsToken */: - return 44 /* BarBarToken */; - case 40 /* CaretToken */: - case 58 /* CaretEqualsToken */: - return 26 /* ExclamationEqualsEqualsToken */; - case 38 /* AmpersandToken */: - case 56 /* AmpersandEqualsToken */: - return 43 /* AmpersandAmpersandToken */; - default: - return undefined; - } - } - function checkAssignmentOperator(valueType) { - if (fullTypeCheck && operator >= ts.SyntaxKind.FirstAssignment && operator <= ts.SyntaxKind.LastAssignment) { - var ok = checkReferenceExpression(node.left, ts.Diagnostics.Invalid_left_hand_side_of_assignment_expression); - if (ok) { - checkTypeAssignableTo(valueType, leftType, node.left, undefined, undefined); - } - } - } - function reportOperatorError() { - error(node, ts.Diagnostics.Operator_0_cannot_be_applied_to_types_1_and_2, ts.tokenToString(node.operator), typeToString(leftType), typeToString(rightType)); - } - } - function checkConditionalExpression(node, contextualMapper) { - checkExpression(node.condition); - var type1 = checkExpression(node.whenTrue, contextualMapper); - var type2 = checkExpression(node.whenFalse, contextualMapper); - var contextualType = isInferentialContext(contextualMapper) ? undefined : getContextualType(node); - var resultType = getBestCommonType([type1, type2], contextualType, true); - if (!resultType) { - if (contextualType) { - error(node, ts.Diagnostics.No_best_common_type_exists_between_0_1_and_2, typeToString(contextualType), typeToString(type1), typeToString(type2)); - } - else { - error(node, ts.Diagnostics.No_best_common_type_exists_between_0_and_1, typeToString(type1), typeToString(type2)); - } - resultType = emptyObjectType; - } - return resultType; - } - function checkExpressionWithContextualType(node, contextualType, contextualMapper) { - var saveContextualType = node.contextualType; - node.contextualType = contextualType; - var result = checkExpression(node, contextualMapper); - node.contextualType = saveContextualType; - return result; - } - function checkAndMarkExpression(node, contextualMapper) { - var result = checkExpression(node, contextualMapper); - getNodeLinks(node).flags |= 1 /* TypeChecked */; - return result; - } - function checkExpression(node, contextualMapper) { - var type = checkExpressionNode(node, contextualMapper); - if (contextualMapper && contextualMapper !== identityMapper) { - var signature = getSingleCallSignature(type); - if (signature && signature.typeParameters) { - var contextualType = getContextualType(node); - if (contextualType) { - var contextualSignature = getSingleCallSignature(contextualType); - if (contextualSignature && !contextualSignature.typeParameters) { - type = getOrCreateTypeFromSignature(instantiateSignatureInContextOf(signature, contextualSignature, contextualMapper)); - } - } - } - } - return type; - } - function checkExpressionNode(node, contextualMapper) { - switch (node.kind) { - case 59 /* Identifier */: - return checkIdentifier(node); - case 87 /* ThisKeyword */: - return checkThisExpression(node); - case 85 /* SuperKeyword */: - return checkSuperExpression(node); - case 83 /* NullKeyword */: - return nullType; - case 89 /* TrueKeyword */: - case 74 /* FalseKeyword */: - return booleanType; - case 6 /* NumericLiteral */: - return numberType; - case 7 /* StringLiteral */: - return stringType; - case 8 /* RegularExpressionLiteral */: - return globalRegExpType; - case 116 /* QualifiedName */: - return checkPropertyAccess(node); - case 132 /* ArrayLiteral */: - return checkArrayLiteral(node, contextualMapper); - case 133 /* ObjectLiteral */: - return checkObjectLiteral(node, contextualMapper); - case 135 /* PropertyAccess */: - return checkPropertyAccess(node); - case 136 /* IndexedAccess */: - return checkIndexedAccess(node); - case 137 /* CallExpression */: - case 138 /* NewExpression */: - return checkCallExpression(node); - case 139 /* TypeAssertion */: - return checkTypeAssertion(node); - case 140 /* ParenExpression */: - return checkExpression(node.expression); - case 141 /* FunctionExpression */: - case 142 /* ArrowFunction */: - return checkFunctionExpression(node, contextualMapper); - case 143 /* PrefixOperator */: - return checkPrefixExpression(node); - case 144 /* PostfixOperator */: - return checkPostfixExpression(node); - case 145 /* BinaryExpression */: - return checkBinaryExpression(node, contextualMapper); - case 146 /* ConditionalExpression */: - return checkConditionalExpression(node, contextualMapper); - } - return unknownType; - } - function checkTypeParameter(node) { - checkSourceElement(node.constraint); - if (fullTypeCheck) { - checkTypeParameterHasIllegalReferencesInConstraint(node); - checkTypeNameIsReserved(node.name, ts.Diagnostics.Type_parameter_name_cannot_be_0); - } - } - function checkParameter(parameterDeclaration) { - checkVariableDeclaration(parameterDeclaration); - if (fullTypeCheck) { - checkCollisionWithIndexVariableInGeneratedCode(parameterDeclaration, parameterDeclaration.name); - if (parameterDeclaration.flags & (16 /* Public */ | 32 /* Private */ | 64 /* Protected */) && !(parameterDeclaration.parent.kind === 121 /* Constructor */ && parameterDeclaration.parent.body)) { - error(parameterDeclaration, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); - } - if (parameterDeclaration.flags & 8 /* Rest */) { - if (!isArrayType(getTypeOfSymbol(parameterDeclaration.symbol))) { - error(parameterDeclaration, ts.Diagnostics.A_rest_parameter_must_be_of_an_array_type); - } - } - else { - if (parameterDeclaration.initializer && !parameterDeclaration.parent.body) { - error(parameterDeclaration, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); - } - } - } - function checkReferencesInInitializer(n) { - if (n.kind === 59 /* Identifier */) { - var referencedSymbol = getNodeLinks(n).resolvedSymbol; - if (referencedSymbol && referencedSymbol !== unknownSymbol && getSymbol(parameterDeclaration.parent.locals, referencedSymbol.name, ts.SymbolFlags.Value) === referencedSymbol) { - if (referencedSymbol.valueDeclaration.kind === 118 /* Parameter */) { - if (referencedSymbol.valueDeclaration === parameterDeclaration) { - error(n, ts.Diagnostics.Parameter_0_cannot_be_referenced_in_its_initializer, ts.identifierToString(parameterDeclaration.name)); - return; - } - var enclosingOrReferencedParameter = ts.forEach(parameterDeclaration.parent.parameters, function (p) { return p === parameterDeclaration || p === referencedSymbol.valueDeclaration ? p : undefined; }); - if (enclosingOrReferencedParameter === referencedSymbol.valueDeclaration) { - return; - } - } - error(n, ts.Diagnostics.Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it, ts.identifierToString(parameterDeclaration.name), ts.identifierToString(n)); - } - } - else { - ts.forEachChild(n, checkReferencesInInitializer); - } - } - if (parameterDeclaration.initializer) { - checkReferencesInInitializer(parameterDeclaration.initializer); - } - } - function checkSignatureDeclaration(node) { - checkTypeParameters(node.typeParameters); - ts.forEach(node.parameters, checkParameter); - if (node.type) { - checkSourceElement(node.type); - } - if (fullTypeCheck) { - checkCollisionWithCapturedSuperVariable(node, node.name); - checkCollisionWithCapturedThisVariable(node, node.name); - checkCollisionWithRequireExportsInGeneratedCode(node, node.name); - checkCollisionWithArgumentsInGeneratedCode(node); - if (compilerOptions.noImplicitAny && !node.type) { - switch (node.kind) { - case 125 /* ConstructSignature */: - error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); - break; - case 124 /* CallSignature */: - error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); - break; - } - } - } - checkSpecializedSignatureDeclaration(node); - } - function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 175 /* InterfaceDeclaration */) { - var nodeSymbol = getSymbolOfNode(node); - if (nodeSymbol.declarations.length > 0 && nodeSymbol.declarations[0] !== node) { - return; - } - } - var indexSymbol = getIndexSymbol(getSymbolOfNode(node)); - if (indexSymbol) { - var seenNumericIndexer = false; - var seenStringIndexer = false; - for (var i = 0, len = indexSymbol.declarations.length; i < len; ++i) { - var declaration = indexSymbol.declarations[i]; - if (declaration.parameters.length == 1 && declaration.parameters[0].type) { - switch (declaration.parameters[0].type.kind) { - case 114 /* StringKeyword */: - if (!seenStringIndexer) { - seenStringIndexer = true; - } - else { - error(declaration, ts.Diagnostics.Duplicate_string_index_signature); - } - break; - case 112 /* NumberKeyword */: - if (!seenNumericIndexer) { - seenNumericIndexer = true; - } - else { - error(declaration, ts.Diagnostics.Duplicate_number_index_signature); - } - break; - } - } - } - } - } - function checkPropertyDeclaration(node) { - checkVariableDeclaration(node); - } - function checkMethodDeclaration(node) { - checkFunctionDeclaration(node); - } - function checkConstructorDeclaration(node) { - checkSignatureDeclaration(node); - checkSourceElement(node.body); - var symbol = getSymbolOfNode(node); - var firstDeclaration = getDeclarationOfKind(symbol, node.kind); - if (node === firstDeclaration) { - checkFunctionOrConstructorSymbol(symbol); - } - if (!node.body) { - return; - } - if (!fullTypeCheck) { - return; - } - function isSuperCallExpression(n) { - return n.kind === 137 /* CallExpression */ && n.func.kind === 85 /* SuperKeyword */; - } - function containsSuperCall(n) { - if (isSuperCallExpression(n)) { - return true; - } - switch (n.kind) { - case 141 /* FunctionExpression */: - case 172 /* FunctionDeclaration */: - case 142 /* ArrowFunction */: - case 133 /* ObjectLiteral */: - return false; - default: - return ts.forEachChild(n, containsSuperCall); - } - } - function markThisReferencesAsErrors(n) { - if (n.kind === 87 /* ThisKeyword */) { - error(n, ts.Diagnostics.this_cannot_be_referenced_in_current_location); - } - else if (n.kind !== 141 /* FunctionExpression */ && n.kind !== 172 /* FunctionDeclaration */) { - ts.forEachChild(n, markThisReferencesAsErrors); - } - } - function isInstancePropertyWithInitializer(n) { - return n.kind === 119 /* Property */ && !(n.flags & 128 /* Static */) && !!n.initializer; - } - if (node.parent.baseType) { - if (containsSuperCall(node.body)) { - var superCallShouldBeFirst = ts.forEach(node.parent.members, isInstancePropertyWithInitializer) || ts.forEach(node.parameters, function (p) { return p.flags & (16 /* Public */ | 32 /* Private */ | 64 /* Protected */); }); - if (superCallShouldBeFirst) { - var statements = node.body.statements; - if (!statements.length || statements[0].kind !== 151 /* ExpressionStatement */ || !isSuperCallExpression(statements[0].expression)) { - error(node, ts.Diagnostics.A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties); - } - else { - markThisReferencesAsErrors(statements[0].expression); - } - } - } - else { - error(node, ts.Diagnostics.Constructors_for_derived_classes_must_contain_a_super_call); - } - } - } - function checkAccessorDeclaration(node) { - if (fullTypeCheck) { - if (node.kind === 122 /* GetAccessor */) { - if (!ts.isInAmbientContext(node) && node.body && !(bodyContainsAReturnStatement(node.body) || bodyContainsSingleThrowStatement(node.body))) { - error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value_or_consist_of_a_single_throw_statement); - } - } - var otherKind = node.kind === 122 /* GetAccessor */ ? 123 /* SetAccessor */ : 122 /* GetAccessor */; - var otherAccessor = getDeclarationOfKind(node.symbol, otherKind); - if (otherAccessor) { - if (((node.flags & ts.NodeFlags.AccessibilityModifier) !== (otherAccessor.flags & ts.NodeFlags.AccessibilityModifier))) { - error(node.name, ts.Diagnostics.Getter_and_setter_accessors_do_not_agree_in_visibility); - } - var thisType = getAnnotatedAccessorType(node); - var otherType = getAnnotatedAccessorType(otherAccessor); - if (thisType && otherType) { - if (!isTypeIdenticalTo(thisType, otherType)) { - error(node, ts.Diagnostics.get_and_set_accessor_must_have_the_same_type); - } - } - } - } - checkFunctionDeclaration(node); - checkAndStoreTypeOfAccessors(getSymbolOfNode(node)); - } - function checkTypeReference(node) { - var type = getTypeFromTypeReferenceNode(node); - if (type !== unknownType && node.typeArguments) { - var len = node.typeArguments.length; - for (var i = 0; i < len; i++) { - checkSourceElement(node.typeArguments[i]); - var constraint = getConstraintOfTypeParameter(type.target.typeParameters[i]); - if (fullTypeCheck && constraint) { - var typeArgument = type.typeArguments[i]; - checkTypeAssignableTo(typeArgument, constraint, node, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1_Colon, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); - } - } - } - } - function checkTypeQuery(node) { - getTypeFromTypeQueryNode(node); - } - function checkTypeLiteral(node) { - ts.forEach(node.members, checkSourceElement); - if (fullTypeCheck) { - var type = getTypeFromTypeLiteralNode(node); - checkIndexConstraints(type); - checkTypeForDuplicateIndexSignatures(node); - } - } - function checkArrayType(node) { - checkSourceElement(node.elementType); - } - function checkTupleType(node) { - ts.forEach(node.elementTypes, checkSourceElement); - } - function isPrivateWithinAmbient(node) { - return (node.flags & 32 /* Private */) && ts.isInAmbientContext(node); - } - function checkSpecializedSignatureDeclaration(signatureDeclarationNode) { - if (!fullTypeCheck) { - return; - } - var signature = getSignatureFromDeclaration(signatureDeclarationNode); - if (!signature.hasStringLiterals) { - return; - } - if (signatureDeclarationNode.body) { - error(signatureDeclarationNode, ts.Diagnostics.A_signature_with_an_implementation_cannot_use_a_string_literal_type); - return; - } - var symbol = getSymbolOfNode(signatureDeclarationNode); - var signaturesToCheck; - if (!signatureDeclarationNode.name && signatureDeclarationNode.parent && signatureDeclarationNode.parent.kind === 175 /* InterfaceDeclaration */) { - ts.Debug.assert(signatureDeclarationNode.kind === 124 /* CallSignature */ || signatureDeclarationNode.kind === 125 /* ConstructSignature */); - var signatureKind = signatureDeclarationNode.kind === 124 /* CallSignature */ ? 0 /* Call */ : 1 /* Construct */; - var containingSymbol = getSymbolOfNode(signatureDeclarationNode.parent); - var containingType = getDeclaredTypeOfSymbol(containingSymbol); - signaturesToCheck = getSignaturesOfType(containingType, signatureKind); - } - else { - signaturesToCheck = getSignaturesOfSymbol(getSymbolOfNode(signatureDeclarationNode)); - } - for (var i = 0; i < signaturesToCheck.length; i++) { - var otherSignature = signaturesToCheck[i]; - if (!otherSignature.hasStringLiterals && isSignatureAssignableTo(signature, otherSignature)) { - return; - } - } - error(signatureDeclarationNode, ts.Diagnostics.Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature); - } - function getEffectiveDeclarationFlags(n, flagsToCheck) { - var flags = n.flags; - if (n.parent.kind !== 175 /* InterfaceDeclaration */ && ts.isInAmbientContext(n)) { - if (!(flags & 2 /* Ambient */)) { - flags |= 1 /* Export */; - } - flags |= 2 /* Ambient */; - } - return flags & flagsToCheck; - } - function checkFunctionOrConstructorSymbol(symbol) { - if (!fullTypeCheck) { - return; - } - function checkFlagAgreementBetweenOverloads(overloads, implementation, flagsToCheck, someOverloadFlags, allOverloadFlags) { - var someButNotAllOverloadFlags = someOverloadFlags ^ allOverloadFlags; - if (someButNotAllOverloadFlags !== 0) { - var implementationSharesContainerWithFirstOverload = implementation !== undefined && implementation.parent === overloads[0].parent; - var canonicalFlags = implementationSharesContainerWithFirstOverload ? getEffectiveDeclarationFlags(implementation, flagsToCheck) : getEffectiveDeclarationFlags(overloads[0], flagsToCheck); - ts.forEach(overloads, function (o) { - var deviation = getEffectiveDeclarationFlags(o, flagsToCheck) ^ canonicalFlags; - if (deviation & 1 /* Export */) { - error(o.name, ts.Diagnostics.Overload_signatures_must_all_be_exported_or_not_exported); - } - else if (deviation & 2 /* Ambient */) { - error(o.name, ts.Diagnostics.Overload_signatures_must_all_be_ambient_or_non_ambient); - } - else if (deviation & (32 /* Private */ | 64 /* Protected */)) { - error(o.name, ts.Diagnostics.Overload_signatures_must_all_be_public_private_or_protected); - } - else if (deviation & 4 /* QuestionMark */) { - error(o.name, ts.Diagnostics.Overload_signatures_must_all_be_optional_or_required); - } - }); - } - } - var flagsToCheck = 1 /* Export */ | 2 /* Ambient */ | 32 /* Private */ | 64 /* Protected */ | 4 /* QuestionMark */; - var someNodeFlags = 0; - var allNodeFlags = flagsToCheck; - var hasOverloads = false; - var bodyDeclaration; - var lastSeenNonAmbientDeclaration; - var previousDeclaration; - var declarations = symbol.declarations; - var isConstructor = (symbol.flags & 4096 /* Constructor */) !== 0; - function reportImplementationExpectedError(node) { - if (node.name && node.name.kind === 115 /* Missing */) { - return; - } - var seen = false; - var subsequentNode = ts.forEachChild(node.parent, function (c) { - if (seen) { - return c; - } - else { - seen = c === node; - } - }); - if (subsequentNode) { - if (subsequentNode.kind === node.kind) { - var errorNode = subsequentNode.name || subsequentNode; - if (node.name && subsequentNode.name && node.name.text === subsequentNode.name.text) { - ts.Debug.assert(node.kind === 120 /* Method */); - ts.Debug.assert((node.flags & 128 /* Static */) !== (subsequentNode.flags & 128 /* Static */)); - var diagnostic = node.flags & 128 /* Static */ ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static; - error(errorNode, diagnostic); - return; - } - else if (subsequentNode.body) { - error(errorNode, ts.Diagnostics.Function_implementation_name_must_be_0, ts.identifierToString(node.name)); - return; - } - } - } - var errorNode = node.name || node; - if (isConstructor) { - error(errorNode, ts.Diagnostics.Constructor_implementation_is_missing); - } - else { - error(errorNode, ts.Diagnostics.Function_implementation_is_missing_or_not_immediately_following_the_declaration); - } - } - var isExportSymbolInsideModule = symbol.parent && symbol.parent.flags & ts.SymbolFlags.Module; - var duplicateFunctionDeclaration = false; - var multipleConstructorImplementation = false; - for (var i = 0; i < declarations.length; i++) { - var node = declarations[i]; - var inAmbientContext = ts.isInAmbientContext(node); - var inAmbientContextOrInterface = node.parent.kind === 175 /* InterfaceDeclaration */ || node.parent.kind === 129 /* TypeLiteral */ || inAmbientContext; - if (inAmbientContextOrInterface) { - previousDeclaration = undefined; - } - if (node.kind === 172 /* FunctionDeclaration */ || node.kind === 120 /* Method */ || node.kind === 121 /* Constructor */) { - var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); - someNodeFlags |= currentNodeFlags; - allNodeFlags &= currentNodeFlags; - if (node.body && bodyDeclaration) { - if (isConstructor) { - multipleConstructorImplementation = true; - } - else { - duplicateFunctionDeclaration = true; - } - } - else if (!isExportSymbolInsideModule && previousDeclaration && previousDeclaration.parent === node.parent && previousDeclaration.end !== node.pos) { - reportImplementationExpectedError(previousDeclaration); - } - if (node.body) { - if (!bodyDeclaration) { - bodyDeclaration = node; - } - } - else { - hasOverloads = true; - } - previousDeclaration = node; - if (!inAmbientContextOrInterface) { - lastSeenNonAmbientDeclaration = node; - } - } - } - if (multipleConstructorImplementation) { - ts.forEach(declarations, function (declaration) { - error(declaration, ts.Diagnostics.Multiple_constructor_implementations_are_not_allowed); - }); - } - if (duplicateFunctionDeclaration) { - ts.forEach(declarations, function (declaration) { - error(declaration.name, ts.Diagnostics.Duplicate_function_implementation); - }); - } - if (!isExportSymbolInsideModule && lastSeenNonAmbientDeclaration && !lastSeenNonAmbientDeclaration.body) { - reportImplementationExpectedError(lastSeenNonAmbientDeclaration); - } - if (hasOverloads) { - checkFlagAgreementBetweenOverloads(declarations, bodyDeclaration, flagsToCheck, someNodeFlags, allNodeFlags); - if (bodyDeclaration) { - var signatures = getSignaturesOfSymbol(symbol); - var bodySignature = getSignatureFromDeclaration(bodyDeclaration); - if (!bodySignature.hasStringLiterals) { - for (var i = 0, len = signatures.length; i < len; ++i) { - if (!signatures[i].hasStringLiterals && !isSignatureAssignableTo(bodySignature, signatures[i])) { - error(signatures[i].declaration, ts.Diagnostics.Overload_signature_is_not_compatible_with_function_implementation); - break; - } - } - } - } - } - } - function checkExportsOnMergedDeclarations(node) { - if (!fullTypeCheck) { - return; - } - var symbol; - var symbol = node.localSymbol; - if (!symbol) { - symbol = getSymbolOfNode(node); - if (!(symbol.flags & ts.SymbolFlags.Export)) { - return; - } - } - if (getDeclarationOfKind(symbol, node.kind) !== node) { - return; - } - var exportedDeclarationSpaces = 0; - var nonExportedDeclarationSpaces = 0; - ts.forEach(symbol.declarations, function (d) { - var declarationSpaces = getDeclarationSpaces(d); - if (getEffectiveDeclarationFlags(d, 1 /* Export */)) { - exportedDeclarationSpaces |= declarationSpaces; - } - else { - nonExportedDeclarationSpaces |= declarationSpaces; - } - }); - var commonDeclarationSpace = exportedDeclarationSpaces & nonExportedDeclarationSpaces; - if (commonDeclarationSpace) { - ts.forEach(symbol.declarations, function (d) { - if (getDeclarationSpaces(d) & commonDeclarationSpace) { - error(d.name, ts.Diagnostics.Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local, ts.identifierToString(d.name)); - } - }); - } - function getDeclarationSpaces(d) { - switch (d.kind) { - case 175 /* InterfaceDeclaration */: - return 1048576 /* ExportType */; - case 177 /* ModuleDeclaration */: - return d.name.kind === 7 /* StringLiteral */ || ts.isInstantiated(d) ? 2097152 /* ExportNamespace */ | 524288 /* ExportValue */ : 2097152 /* ExportNamespace */; - case 174 /* ClassDeclaration */: - case 176 /* EnumDeclaration */: - return 1048576 /* ExportType */ | 524288 /* ExportValue */; - case 179 /* ImportDeclaration */: - var result = 0; - var target = resolveImport(getSymbolOfNode(d)); - ts.forEach(target.declarations, function (d) { - result |= getDeclarationSpaces(d); - }); - return result; - default: - return 524288 /* ExportValue */; - } - } - } - function checkFunctionDeclaration(node) { - checkSignatureDeclaration(node); - var symbol = getSymbolOfNode(node); - var localSymbol = node.localSymbol || symbol; - var firstDeclaration = getDeclarationOfKind(localSymbol, node.kind); - if (node === firstDeclaration) { - checkFunctionOrConstructorSymbol(localSymbol); - } - if (symbol.parent) { - if (getDeclarationOfKind(symbol, node.kind) === node) { - checkFunctionOrConstructorSymbol(symbol); - } - } - checkSourceElement(node.body); - if (node.type && !isAccessor(node.kind)) { - checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNode(node.type)); - } - if (fullTypeCheck && compilerOptions.noImplicitAny && !node.body && !node.type) { - if (!isPrivateWithinAmbient(node)) { - var typeName = typeToString(anyType); - if (node.name) { - error(node, ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type, ts.identifierToString(node.name), typeName); - } - else { - error(node, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeName); - } - } - } - } - function checkBlock(node) { - ts.forEach(node.statements, checkSourceElement); - } - function checkCollisionWithArgumentsInGeneratedCode(node) { - if (!ts.hasRestParameters(node) || ts.isInAmbientContext(node) || !node.body) { - return; - } - ts.forEach(node.parameters, function (p) { - if (p.name && p.name.text === argumentsSymbol.name) { - error(p, ts.Diagnostics.Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters); - } - }); - } - function checkCollisionWithIndexVariableInGeneratedCode(node, name) { - if (!(name && name.text === "_i")) { - return; - } - if (node.kind === 118 /* Parameter */) { - if (node.parent.body && ts.hasRestParameters(node.parent) && !ts.isInAmbientContext(node)) { - error(node, ts.Diagnostics.Duplicate_identifier_i_Compiler_uses_i_to_initialize_rest_parameter); - } - return; - } - var symbol = getNodeLinks(node).resolvedSymbol; - if (symbol === unknownSymbol) { - return; - } - var current = node; - while (current) { - var definedOnCurrentLevel = ts.forEach(symbol.declarations, function (d) { return d.parent === current ? d : undefined; }); - if (definedOnCurrentLevel) { - return; - } - switch (current.kind) { - case 172 /* FunctionDeclaration */: - case 141 /* FunctionExpression */: - case 120 /* Method */: - case 142 /* ArrowFunction */: - case 121 /* Constructor */: - if (ts.hasRestParameters(current)) { - error(node, ts.Diagnostics.Expression_resolves_to_variable_declaration_i_that_compiler_uses_to_initialize_rest_parameter); - return; - } - break; - } - current = current.parent; - } - } - function needCollisionCheckForIdentifier(node, identifier, name) { - if (!(identifier && identifier.text === name)) { - return false; - } - if (node.kind === 119 /* Property */ || node.kind === 120 /* Method */ || node.kind === 122 /* GetAccessor */ || node.kind === 123 /* SetAccessor */) { - return false; - } - if (ts.isInAmbientContext(node)) { - return false; - } - if (node.kind === 118 /* Parameter */ && !node.parent.body) { - return false; - } - return true; - } - function checkCollisionWithCapturedThisVariable(node, name) { - if (!needCollisionCheckForIdentifier(node, name, "_this")) { - return; - } - potentialThisCollisions.push(node); - } - function checkIfThisIsCapturedInEnclosingScope(node) { - var current = node; - while (current) { - if (getNodeCheckFlags(current) & 4 /* CaptureThis */) { - var isDeclaration = node.kind !== 59 /* Identifier */; - if (isDeclaration) { - error(node.name, ts.Diagnostics.Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference); - } - else { - error(node, ts.Diagnostics.Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference); - } - return; - } - current = current.parent; - } - } - function checkCollisionWithCapturedSuperVariable(node, name) { - if (!needCollisionCheckForIdentifier(node, name, "_super")) { - return; - } - var enclosingClass = ts.getAncestor(node, 174 /* ClassDeclaration */); - if (!enclosingClass || ts.isInAmbientContext(enclosingClass)) { - return; - } - if (enclosingClass.baseType) { - var isDeclaration = node.kind !== 59 /* Identifier */; - if (isDeclaration) { - error(node, ts.Diagnostics.Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference); - } - else { - error(node, ts.Diagnostics.Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference); - } - } - } - function checkCollisionWithRequireExportsInGeneratedCode(node, name) { - if (!needCollisionCheckForIdentifier(node, name, "require") && !needCollisionCheckForIdentifier(node, name, "exports")) { - return; - } - if (node.kind === 177 /* ModuleDeclaration */ && !ts.isInstantiated(node)) { - return; - } - var parent = node.kind === 171 /* VariableDeclaration */ ? node.parent.parent : node.parent; - if (parent.kind === 182 /* SourceFile */ && ts.isExternalModule(parent)) { - error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module, name.text, name.text); - } - } - function checkVariableDeclaration(node) { - checkSourceElement(node.type); - checkExportsOnMergedDeclarations(node); - if (fullTypeCheck) { - var symbol = getSymbolOfNode(node); - var typeOfValueDeclaration = getTypeOfVariableOrParameterOrProperty(symbol); - var type; - var useTypeFromValueDeclaration = node === symbol.valueDeclaration; - if (useTypeFromValueDeclaration) { - type = typeOfValueDeclaration; - } - else { - type = getTypeOfVariableDeclaration(node); - } - if (node.initializer) { - if (!(getNodeLinks(node.initializer).flags & 1 /* TypeChecked */)) { - checkTypeAssignableTo(checkAndMarkExpression(node.initializer), type, node, undefined, undefined); - } - } - checkCollisionWithCapturedSuperVariable(node, node.name); - checkCollisionWithCapturedThisVariable(node, node.name); - checkCollisionWithRequireExportsInGeneratedCode(node, node.name); - if (!useTypeFromValueDeclaration) { - if (typeOfValueDeclaration !== unknownType && type !== unknownType && !isTypeIdenticalTo(typeOfValueDeclaration, type)) { - error(node.name, ts.Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2, ts.identifierToString(node.name), typeToString(typeOfValueDeclaration), typeToString(type)); - } - } - } - } - function checkVariableStatement(node) { - ts.forEach(node.declarations, checkVariableDeclaration); - } - function checkExpressionStatement(node) { - checkExpression(node.expression); - } - function checkIfStatement(node) { - checkExpression(node.expression); - checkSourceElement(node.thenStatement); - checkSourceElement(node.elseStatement); - } - function checkDoStatement(node) { - checkSourceElement(node.statement); - checkExpression(node.expression); - } - function checkWhileStatement(node) { - checkExpression(node.expression); - checkSourceElement(node.statement); - } - function checkForStatement(node) { - if (node.declarations) - ts.forEach(node.declarations, checkVariableDeclaration); - if (node.initializer) - checkExpression(node.initializer); - if (node.condition) - checkExpression(node.condition); - if (node.iterator) - checkExpression(node.iterator); - checkSourceElement(node.statement); - } - function checkForInStatement(node) { - if (node.declaration) { - checkVariableDeclaration(node.declaration); - if (node.declaration.type) { - error(node.declaration, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation); - } - } - if (node.variable) { - var exprType = checkExpression(node.variable); - if (exprType !== anyType && exprType !== stringType) { - error(node.variable, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any); - } - else { - checkReferenceExpression(node.variable, ts.Diagnostics.Invalid_left_hand_side_in_for_in_statement); - } - } - var exprType = checkExpression(node.expression); - if (!isTypeAnyTypeObjectTypeOrTypeParameter(exprType) && exprType !== unknownType) { - error(node.expression, ts.Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter); - } - checkSourceElement(node.statement); - } - function checkBreakOrContinueStatement(node) { - } - function checkReturnStatement(node) { - if (node.expression && !(getNodeLinks(node.expression).flags & 1 /* TypeChecked */)) { - var func = ts.getContainingFunction(node); - if (func) { - if (func.kind === 123 /* SetAccessor */) { - if (node.expression) { - error(node.expression, ts.Diagnostics.Setters_cannot_return_a_value); - } - } - else { - var returnType = getReturnTypeOfSignature(getSignatureFromDeclaration(func)); - var checkAssignability = func.type || (func.kind === 122 /* GetAccessor */ && getSetAccessorTypeAnnotationNode(getDeclarationOfKind(func.symbol, 123 /* SetAccessor */))); - if (checkAssignability) { - checkTypeAssignableTo(checkExpression(node.expression), returnType, node.expression, undefined, undefined); - } - else if (func.kind == 121 /* Constructor */) { - if (!isTypeAssignableTo(checkExpression(node.expression), returnType)) { - error(node.expression, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); - } - } - } - } - } - } - function checkWithStatement(node) { - checkExpression(node.expression); - error(node.expression, ts.Diagnostics.All_symbols_within_a_with_block_will_be_resolved_to_any); - } - function checkSwitchStatement(node) { - var expressionType = checkExpression(node.expression); - ts.forEach(node.clauses, function (clause) { - if (fullTypeCheck && clause.expression) { - var caseType = checkExpression(clause.expression); - if (!isTypeAssignableTo(expressionType, caseType)) { - checkTypeAssignableTo(caseType, expressionType, clause.expression, undefined, undefined); - } - } - checkBlock(clause); - }); - } - function checkLabeledStatement(node) { - checkSourceElement(node.statement); - } - function checkThrowStatement(node) { - checkExpression(node.expression); - } - function checkTryStatement(node) { - checkBlock(node.tryBlock); - if (node.catchBlock) - checkBlock(node.catchBlock); - if (node.finallyBlock) - checkBlock(node.finallyBlock); - } - function checkIndexConstraints(type) { - function checkIndexConstraintForProperty(prop, propertyType, indexDeclaration, indexType, indexKind) { - if (!indexType) { - return; - } - if (indexKind === 1 /* Number */ && !isNumericName(prop.name)) { - return; - } - var errorNode; - if (prop.parent === type.symbol) { - errorNode = prop.valueDeclaration; - } - else if (indexDeclaration) { - errorNode = indexDeclaration; - } - else if (type.flags & 2048 /* Interface */) { - var someBaseClassHasBothPropertyAndIndexer = ts.forEach(type.baseTypes, function (base) { return getPropertyOfType(base, prop.name) && getIndexTypeOfType(base, indexKind); }); - errorNode = someBaseClassHasBothPropertyAndIndexer ? undefined : type.symbol.declarations[0]; - } - if (errorNode && !isTypeAssignableTo(propertyType, indexType)) { - var errorMessage = indexKind === 0 /* String */ ? ts.Diagnostics.Property_0_of_type_1_is_not_assignable_to_string_index_type_2 : ts.Diagnostics.Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2; - error(errorNode, errorMessage, symbolToString(prop), typeToString(propertyType), typeToString(indexType)); - } - } - var declaredNumberIndexer = getIndexDeclarationOfSymbol(type.symbol, 1 /* Number */); - var declaredStringIndexer = getIndexDeclarationOfSymbol(type.symbol, 0 /* String */); - var stringIndexType = getIndexTypeOfType(type, 0 /* String */); - var numberIndexType = getIndexTypeOfType(type, 1 /* Number */); - if (stringIndexType || numberIndexType) { - ts.forEach(getPropertiesOfType(type), function (prop) { - var propType = getTypeOfSymbol(prop); - checkIndexConstraintForProperty(prop, propType, declaredStringIndexer, stringIndexType, 0 /* String */); - checkIndexConstraintForProperty(prop, propType, declaredNumberIndexer, numberIndexType, 1 /* Number */); - }); - } - var errorNode; - if (stringIndexType && numberIndexType) { - errorNode = declaredNumberIndexer || declaredStringIndexer; - if (!errorNode && (type.flags & 2048 /* Interface */)) { - var someBaseTypeHasBothIndexers = ts.forEach(type.baseTypes, function (base) { return getIndexTypeOfType(base, 0 /* String */) && getIndexTypeOfType(base, 1 /* Number */); }); - errorNode = someBaseTypeHasBothIndexers ? undefined : type.symbol.declarations[0]; - } - } - if (errorNode && !isTypeAssignableTo(numberIndexType, stringIndexType)) { - error(errorNode, ts.Diagnostics.Numeric_index_type_0_is_not_assignable_to_string_index_type_1, typeToString(numberIndexType), typeToString(stringIndexType)); - } - } - function checkTypeNameIsReserved(name, message) { - switch (name.text) { - case "any": - case "number": - case "boolean": - case "string": - case "void": - error(name, message, name.text); - } - } - function checkTypeParameters(typeParameterDeclarations) { - if (typeParameterDeclarations) { - for (var i = 0; i < typeParameterDeclarations.length; i++) { - var node = typeParameterDeclarations[i]; - checkTypeParameter(node); - if (fullTypeCheck) { - for (var j = 0; j < i; j++) { - if (typeParameterDeclarations[j].symbol === node.symbol) { - error(node.name, ts.Diagnostics.Duplicate_identifier_0, ts.identifierToString(node.name)); - } - } - } - } - } - } - function checkClassDeclaration(node) { - checkTypeNameIsReserved(node.name, ts.Diagnostics.Class_name_cannot_be_0); - checkTypeParameters(node.typeParameters); - checkCollisionWithCapturedThisVariable(node, node.name); - checkCollisionWithRequireExportsInGeneratedCode(node, node.name); - checkExportsOnMergedDeclarations(node); - var symbol = getSymbolOfNode(node); - var type = getDeclaredTypeOfSymbol(symbol); - var staticType = getTypeOfSymbol(symbol); - if (node.baseType) { - emitExtends = emitExtends || !ts.isInAmbientContext(node); - checkTypeReference(node.baseType); - } - if (type.baseTypes.length) { - if (fullTypeCheck) { - var baseType = type.baseTypes[0]; - checkTypeAssignableTo(type, baseType, node.name, ts.Diagnostics.Class_0_incorrectly_extends_base_class_1_Colon, ts.Diagnostics.Class_0_incorrectly_extends_base_class_1); - var staticBaseType = getTypeOfSymbol(baseType.symbol); - checkTypeAssignableTo(staticType, getTypeWithoutConstructors(staticBaseType), node.name, ts.Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1_Colon, ts.Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1); - if (baseType.symbol !== resolveEntityName(node, node.baseType.typeName, ts.SymbolFlags.Value)) { - error(node.baseType, ts.Diagnostics.Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0, typeToString(baseType)); - } - checkKindsOfPropertyMemberOverrides(type, baseType); - } - checkExpression(node.baseType.typeName); - } - if (node.implementedTypes) { - ts.forEach(node.implementedTypes, function (typeRefNode) { - checkTypeReference(typeRefNode); - if (fullTypeCheck) { - var t = getTypeFromTypeReferenceNode(typeRefNode); - if (t !== unknownType) { - var declaredType = (t.flags & 4096 /* Reference */) ? t.target : t; - if (declaredType.flags & (1024 /* Class */ | 2048 /* Interface */)) { - checkTypeAssignableTo(type, t, node.name, ts.Diagnostics.Class_0_incorrectly_implements_interface_1_Colon, ts.Diagnostics.Class_0_incorrectly_implements_interface_1); - } - else { - error(typeRefNode, ts.Diagnostics.A_class_may_only_implement_another_class_or_interface); - } - } - } - }); - } - ts.forEach(node.members, checkSourceElement); - if (fullTypeCheck) { - checkIndexConstraints(type); - checkTypeForDuplicateIndexSignatures(node); - } - } - function getTargetSymbol(s) { - return s.flags & 8388608 /* Instantiated */ ? getSymbolLinks(s).target : s; - } - function checkKindsOfPropertyMemberOverrides(type, baseType) { - var baseProperties = getPropertiesOfType(baseType); - for (var i = 0, len = baseProperties.length; i < len; ++i) { - var base = getTargetSymbol(baseProperties[i]); - if (base.flags & 67108864 /* Prototype */) { - continue; - } - var derived = getTargetSymbol(getPropertyOfType(type, base.name)); - if (derived) { - var baseDeclarationFlags = getDeclarationFlagsFromSymbol(base); - var derivedDeclarationFlags = getDeclarationFlagsFromSymbol(derived); - if ((baseDeclarationFlags & 32 /* Private */) || (derivedDeclarationFlags & 32 /* Private */)) { - continue; - } - if ((baseDeclarationFlags & 128 /* Static */) !== (derivedDeclarationFlags & 128 /* Static */)) { - continue; - } - if ((base.flags & derived.flags & 2048 /* Method */) || ((base.flags & ts.SymbolFlags.PropertyOrAccessor) && (derived.flags & ts.SymbolFlags.PropertyOrAccessor))) { - continue; - } - var errorMessage; - if (base.flags & 2048 /* Method */) { - if (derived.flags & ts.SymbolFlags.Accessor) { - errorMessage = ts.Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor; - } - else { - ts.Debug.assert(derived.flags & 2 /* Property */); - errorMessage = ts.Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property; - } - } - else if (base.flags & 2 /* Property */) { - ts.Debug.assert(derived.flags & 2048 /* Method */); - errorMessage = ts.Diagnostics.Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function; - } - else { - ts.Debug.assert(base.flags & ts.SymbolFlags.Accessor); - ts.Debug.assert(derived.flags & 2048 /* Method */); - errorMessage = ts.Diagnostics.Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function; - } - error(derived.valueDeclaration.name, errorMessage, typeToString(baseType), symbolToString(base), typeToString(type)); - } - } - } - function isAccessor(kind) { - return kind === 122 /* GetAccessor */ || kind === 123 /* SetAccessor */; - } - function areTypeParametersIdentical(list1, list2) { - if (!list1 && !list2) { - return true; - } - if (!list1 || !list2 || list1.length !== list2.length) { - return false; - } - for (var i = 0, len = list1.length; i < len; i++) { - var tp1 = list1[i]; - var tp2 = list2[i]; - if (tp1.name.text !== tp2.name.text) { - return false; - } - if (!tp1.constraint && !tp2.constraint) { - continue; - } - if (!tp1.constraint || !tp2.constraint) { - return false; - } - if (!isTypeIdenticalTo(getTypeFromTypeNode(tp1.constraint), getTypeFromTypeNode(tp2.constraint))) { - return false; - } - } - return true; - } - function checkInterfaceDeclaration(node) { - checkTypeParameters(node.typeParameters); - if (fullTypeCheck) { - checkTypeNameIsReserved(node.name, ts.Diagnostics.Interface_name_cannot_be_0); - checkExportsOnMergedDeclarations(node); - var symbol = getSymbolOfNode(node); - var firstInterfaceDecl = getDeclarationOfKind(symbol, 175 /* InterfaceDeclaration */); - if (symbol.declarations.length > 1) { - if (node !== firstInterfaceDecl && !areTypeParametersIdentical(firstInterfaceDecl.typeParameters, node.typeParameters)) { - error(node.name, ts.Diagnostics.All_declarations_of_an_interface_must_have_identical_type_parameters); - } - } - if (node === firstInterfaceDecl) { - var type = getDeclaredTypeOfSymbol(symbol); - if (checkInheritedPropertiesAreIdentical(type, node.name)) { - ts.forEach(type.baseTypes, function (baseType) { - checkTypeAssignableTo(type, baseType, node.name, ts.Diagnostics.Interface_0_incorrectly_extends_interface_1_Colon, ts.Diagnostics.Interface_0_incorrectly_extends_interface_1); - }); - checkIndexConstraints(type); - } - } - } - ts.forEach(node.baseTypes, checkTypeReference); - ts.forEach(node.members, checkSourceElement); - if (fullTypeCheck) { - checkTypeForDuplicateIndexSignatures(node); - } - } - function getConstantValueForExpression(node) { - var isNegative = false; - if (node.kind === 143 /* PrefixOperator */) { - var unaryExpression = node; - if (unaryExpression.operator === 29 /* MinusToken */ || unaryExpression.operator === 28 /* PlusToken */) { - node = unaryExpression.operand; - isNegative = unaryExpression.operator === 29 /* MinusToken */; - } - } - if (node.kind === 6 /* NumericLiteral */) { - var literalText = node.text; - return isNegative ? -literalText : +literalText; - } - return undefined; - } - function computeEnumMemberValues(node) { - var nodeLinks = getNodeLinks(node); - if (!(nodeLinks.flags & 128 /* EnumValuesComputed */)) { - var enumSymbol = getSymbolOfNode(node); - var enumType = getDeclaredTypeOfSymbol(enumSymbol); - var autoValue = 0; - var ambient = ts.isInAmbientContext(node); - ts.forEach(node.members, function (member) { - if (isNumericName(member.name.text)) { - error(member.name, ts.Diagnostics.An_enum_member_cannot_have_a_numeric_name); - } - var initializer = member.initializer; - if (initializer) { - autoValue = getConstantValueForExpression(initializer); - if (autoValue === undefined && !ambient) { - checkTypeAssignableTo(checkExpression(initializer), enumType, initializer, undefined, undefined); - } - } - else if (ambient) { - autoValue = undefined; - } - if (autoValue !== undefined) { - getNodeLinks(member).enumMemberValue = autoValue++; - } - }); - nodeLinks.flags |= 128 /* EnumValuesComputed */; - } - } - function checkEnumDeclaration(node) { - if (!fullTypeCheck) { - return; - } - checkTypeNameIsReserved(node.name, ts.Diagnostics.Enum_name_cannot_be_0); - checkCollisionWithCapturedThisVariable(node, node.name); - checkCollisionWithRequireExportsInGeneratedCode(node, node.name); - checkExportsOnMergedDeclarations(node); - computeEnumMemberValues(node); - var enumSymbol = getSymbolOfNode(node); - var firstDeclaration = getDeclarationOfKind(enumSymbol, node.kind); - if (node === firstDeclaration) { - var seenEnumMissingInitialInitializer = false; - ts.forEach(enumSymbol.declarations, function (declaration) { - if (declaration.kind !== 176 /* EnumDeclaration */) { - return false; - } - var enumDeclaration = declaration; - if (!enumDeclaration.members.length) { - return false; - } - var firstEnumMember = enumDeclaration.members[0]; - if (!firstEnumMember.initializer) { - if (seenEnumMissingInitialInitializer) { - error(firstEnumMember.name, ts.Diagnostics.In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element); - } - else { - seenEnumMissingInitialInitializer = true; - } - } - }); - } - } - function getFirstNonAmbientClassOrFunctionDeclaration(symbol) { - var declarations = symbol.declarations; - for (var i = 0; i < declarations.length; i++) { - var declaration = declarations[i]; - if ((declaration.kind === 174 /* ClassDeclaration */ || (declaration.kind === 172 /* FunctionDeclaration */ && declaration.body)) && !ts.isInAmbientContext(declaration)) { - return declaration; - } - } - return undefined; - } - function checkModuleDeclaration(node) { - if (fullTypeCheck) { - checkCollisionWithCapturedThisVariable(node, node.name); - checkCollisionWithRequireExportsInGeneratedCode(node, node.name); - checkExportsOnMergedDeclarations(node); - var symbol = getSymbolOfNode(node); - if (symbol.flags & 128 /* ValueModule */ && symbol.declarations.length > 1 && !ts.isInAmbientContext(node)) { - var classOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol); - if (classOrFunc) { - if (ts.getSourceFileOfNode(node) !== ts.getSourceFileOfNode(classOrFunc)) { - error(node.name, ts.Diagnostics.A_module_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged); - } - else if (node.pos < classOrFunc.pos) { - error(node.name, ts.Diagnostics.A_module_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged); - } - } - } - if (node.name.kind === 7 /* StringLiteral */) { - if (!isGlobalSourceFile(node.parent)) { - error(node.name, ts.Diagnostics.Ambient_external_modules_cannot_be_nested_in_other_modules); - } - if (isExternalModuleNameRelative(node.name.text)) { - error(node.name, ts.Diagnostics.Ambient_external_module_declaration_cannot_specify_relative_module_name); - } - } - } - checkSourceElement(node.body); - } - function getFirstIdentifier(node) { - while (node.kind === 116 /* QualifiedName */) { - node = node.left; - } - return node; - } - function checkImportDeclaration(node) { - checkCollisionWithCapturedThisVariable(node, node.name); - checkCollisionWithRequireExportsInGeneratedCode(node, node.name); - var symbol = getSymbolOfNode(node); - var target; - if (node.entityName) { - target = resolveImport(symbol); - if (target !== unknownSymbol) { - if (target.flags & ts.SymbolFlags.Value) { - var moduleName = getFirstIdentifier(node.entityName); - if (resolveEntityName(node, moduleName, ts.SymbolFlags.Value | ts.SymbolFlags.Namespace).flags & ts.SymbolFlags.Namespace) { - checkExpression(node.entityName); - } - else { - error(moduleName, ts.Diagnostics.Module_0_is_hidden_by_a_local_declaration_with_the_same_name, ts.identifierToString(moduleName)); - } - } - if (target.flags & ts.SymbolFlags.Type) { - checkTypeNameIsReserved(node.name, ts.Diagnostics.Import_name_cannot_be_0); - } - } - } - else { - if (node.parent.kind === 182 /* SourceFile */) { - target = resolveImport(symbol); - } - else if (node.parent.kind === 178 /* ModuleBlock */ && node.parent.parent.name.kind === 7 /* StringLiteral */) { - if (isExternalModuleNameRelative(node.externalModuleName.text)) { - error(node, ts.Diagnostics.Import_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name); - target = unknownSymbol; - } - else { - target = resolveImport(symbol); - } - } - else { - target = unknownSymbol; - } - } - if (target !== unknownSymbol) { - var excludedMeanings = (symbol.flags & ts.SymbolFlags.Value ? ts.SymbolFlags.Value : 0) | (symbol.flags & ts.SymbolFlags.Type ? ts.SymbolFlags.Type : 0) | (symbol.flags & ts.SymbolFlags.Namespace ? ts.SymbolFlags.Namespace : 0); - if (target.flags & excludedMeanings) { - error(node, ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0, symbolToString(symbol)); - } - } - } - function checkExportAssignment(node) { - var container = node.parent; - if (container.kind !== 182 /* SourceFile */) { - container = container.parent; - } - checkTypeOfExportAssignmentSymbol(getSymbolOfNode(container)); - } - function checkSourceElement(node) { - if (!node) - return; - switch (node.kind) { - case 117 /* TypeParameter */: - return checkTypeParameter(node); - case 118 /* Parameter */: - return checkParameter(node); - case 119 /* Property */: - return checkPropertyDeclaration(node); - case 124 /* CallSignature */: - case 125 /* ConstructSignature */: - case 126 /* IndexSignature */: - return checkSignatureDeclaration(node); - case 120 /* Method */: - return checkMethodDeclaration(node); - case 121 /* Constructor */: - return checkConstructorDeclaration(node); - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - return checkAccessorDeclaration(node); - case 127 /* TypeReference */: - return checkTypeReference(node); - case 128 /* TypeQuery */: - return checkTypeQuery(node); - case 129 /* TypeLiteral */: - return checkTypeLiteral(node); - case 130 /* ArrayType */: - return checkArrayType(node); - case 131 /* TupleType */: - return checkTupleType(node); - case 172 /* FunctionDeclaration */: - return checkFunctionDeclaration(node); - case 148 /* Block */: - return checkBlock(node); - case 173 /* FunctionBlock */: - case 178 /* ModuleBlock */: - return checkBody(node); - case 149 /* VariableStatement */: - return checkVariableStatement(node); - case 151 /* ExpressionStatement */: - return checkExpressionStatement(node); - case 152 /* IfStatement */: - return checkIfStatement(node); - case 153 /* DoStatement */: - return checkDoStatement(node); - case 154 /* WhileStatement */: - return checkWhileStatement(node); - case 155 /* ForStatement */: - return checkForStatement(node); - case 156 /* ForInStatement */: - return checkForInStatement(node); - case 157 /* ContinueStatement */: - case 158 /* BreakStatement */: - return checkBreakOrContinueStatement(node); - case 159 /* ReturnStatement */: - return checkReturnStatement(node); - case 160 /* WithStatement */: - return checkWithStatement(node); - case 161 /* SwitchStatement */: - return checkSwitchStatement(node); - case 164 /* LabeledStatement */: - return checkLabeledStatement(node); - case 165 /* ThrowStatement */: - return checkThrowStatement(node); - case 166 /* TryStatement */: - return checkTryStatement(node); - case 171 /* VariableDeclaration */: - return ts.Debug.fail("Checker encountered variable declaration"); - case 174 /* ClassDeclaration */: - return checkClassDeclaration(node); - case 175 /* InterfaceDeclaration */: - return checkInterfaceDeclaration(node); - case 176 /* EnumDeclaration */: - return checkEnumDeclaration(node); - case 177 /* ModuleDeclaration */: - return checkModuleDeclaration(node); - case 179 /* ImportDeclaration */: - return checkImportDeclaration(node); - case 180 /* ExportAssignment */: - return checkExportAssignment(node); - } - } - function checkFunctionExpressionBodies(node) { - switch (node.kind) { - case 141 /* FunctionExpression */: - case 142 /* ArrowFunction */: - ts.forEach(node.parameters, checkFunctionExpressionBodies); - checkFunctionExpressionBody(node); - break; - case 120 /* Method */: - case 121 /* Constructor */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 172 /* FunctionDeclaration */: - ts.forEach(node.parameters, checkFunctionExpressionBodies); - break; - case 160 /* WithStatement */: - checkFunctionExpressionBodies(node.expression); - break; - case 118 /* Parameter */: - case 119 /* Property */: - case 132 /* ArrayLiteral */: - case 133 /* ObjectLiteral */: - case 134 /* PropertyAssignment */: - case 135 /* PropertyAccess */: - case 136 /* IndexedAccess */: - case 137 /* CallExpression */: - case 138 /* NewExpression */: - case 139 /* TypeAssertion */: - case 140 /* ParenExpression */: - case 143 /* PrefixOperator */: - case 144 /* PostfixOperator */: - case 145 /* BinaryExpression */: - case 146 /* ConditionalExpression */: - case 148 /* Block */: - case 173 /* FunctionBlock */: - case 178 /* ModuleBlock */: - case 149 /* VariableStatement */: - case 151 /* ExpressionStatement */: - case 152 /* IfStatement */: - case 153 /* DoStatement */: - case 154 /* WhileStatement */: - case 155 /* ForStatement */: - case 156 /* ForInStatement */: - case 157 /* ContinueStatement */: - case 158 /* BreakStatement */: - case 159 /* ReturnStatement */: - case 161 /* SwitchStatement */: - case 162 /* CaseClause */: - case 163 /* DefaultClause */: - case 164 /* LabeledStatement */: - case 165 /* ThrowStatement */: - case 166 /* TryStatement */: - case 167 /* TryBlock */: - case 168 /* CatchBlock */: - case 169 /* FinallyBlock */: - case 171 /* VariableDeclaration */: - case 174 /* ClassDeclaration */: - case 176 /* EnumDeclaration */: - case 181 /* EnumMember */: - case 182 /* SourceFile */: - ts.forEachChild(node, checkFunctionExpressionBodies); - break; - } - } - function checkBody(node) { - checkBlock(node); - checkFunctionExpressionBodies(node); - } - function checkSourceFile(node) { - var links = getNodeLinks(node); - if (!(links.flags & 1 /* TypeChecked */)) { - emitExtends = false; - potentialThisCollisions.length = 0; - checkBody(node); - if (ts.isExternalModule(node)) { - var symbol = getExportAssignmentSymbol(node.symbol); - if (symbol && symbol.flags & 4194304 /* Import */) { - getSymbolLinks(symbol).referenced = true; - } - } - if (potentialThisCollisions.length) { - ts.forEach(potentialThisCollisions, checkIfThisIsCapturedInEnclosingScope); - potentialThisCollisions.length = 0; - } - if (emitExtends) - links.flags |= 8 /* EmitExtends */; - links.flags |= 1 /* TypeChecked */; - } - } - function checkProgram() { - ts.forEach(program.getSourceFiles(), checkSourceFile); - } - function getSortedDiagnostics() { - ts.Debug.assert(fullTypeCheck, "diagnostics are available only in the full typecheck mode"); - if (diagnosticsModified) { - diagnostics.sort(ts.compareDiagnostics); - diagnostics = ts.deduplicateSortedDiagnostics(diagnostics); - diagnosticsModified = false; - } - return diagnostics; - } - function getDiagnostics(sourceFile) { - if (sourceFile) { - checkSourceFile(sourceFile); - return ts.filter(getSortedDiagnostics(), function (d) { return d.file === sourceFile; }); - } - checkProgram(); - return getSortedDiagnostics(); - } - function getDeclarationDiagnostics(targetSourceFile) { - var resolver = createResolver(); - checkSourceFile(targetSourceFile); - return ts.getDeclarationDiagnostics(program, resolver, targetSourceFile); - } - function getGlobalDiagnostics() { - return ts.filter(getSortedDiagnostics(), function (d) { return !d.file; }); - } - function getNodeAtPosition(sourceFile, position) { - function findChildAtPosition(parent) { - var child = ts.forEachChild(parent, function (node) { - if (position >= node.pos && position <= node.end && position >= ts.getTokenPosOfNode(node)) { - return findChildAtPosition(node); - } - }); - return child || parent; - } - if (position < sourceFile.pos) - position = sourceFile.pos; - if (position > sourceFile.end) - position = sourceFile.end; - return findChildAtPosition(sourceFile); - } - function isInsideWithStatementBody(node) { - if (node) { - while (node.parent) { - if (node.parent.kind === 160 /* WithStatement */ && node.parent.statement === node) { - return true; - } - node = node.parent; - } - } - return false; - } - function getSymbolsInScope(location, meaning) { - var symbols = {}; - var memberFlags = 0; - function copySymbol(symbol, meaning) { - if (symbol.flags & meaning) { - var id = symbol.name; - if (!isReservedMemberName(id) && !ts.hasProperty(symbols, id)) { - symbols[id] = symbol; - } - } - } - function copySymbols(source, meaning) { - if (meaning) { - for (var id in source) { - if (ts.hasProperty(source, id)) { - copySymbol(source[id], meaning); - } - } - } - } - if (isInsideWithStatementBody(location)) { - return []; - } - while (location) { - if (location.locals && !isGlobalSourceFile(location)) { - copySymbols(location.locals, meaning); - } - switch (location.kind) { - case 182 /* SourceFile */: - if (!ts.isExternalModule(location)) - break; - case 177 /* ModuleDeclaration */: - copySymbols(getSymbolOfNode(location).exports, meaning & ts.SymbolFlags.ModuleMember); - break; - case 176 /* EnumDeclaration */: - copySymbols(getSymbolOfNode(location).exports, meaning & 4 /* EnumMember */); - break; - case 174 /* ClassDeclaration */: - case 175 /* InterfaceDeclaration */: - if (!(memberFlags & 128 /* Static */)) { - copySymbols(getSymbolOfNode(location).members, meaning & ts.SymbolFlags.Type); - } - break; - case 141 /* FunctionExpression */: - if (location.name) { - copySymbol(location.symbol, meaning); - } - break; - case 168 /* CatchBlock */: - if (location.variable.text) { - copySymbol(location.symbol, meaning); - } - break; - } - memberFlags = location.flags; - location = location.parent; - } - copySymbols(globals, meaning); - return ts.mapToArray(symbols); - } - function isTypeDeclarationName(name) { - return name.kind == 59 /* Identifier */ && isTypeDeclaration(name.parent) && name.parent.name === name; - } - function isTypeDeclaration(node) { - switch (node.kind) { - case 117 /* TypeParameter */: - case 174 /* ClassDeclaration */: - case 175 /* InterfaceDeclaration */: - case 176 /* EnumDeclaration */: - return true; - } - } - function isTypeReferenceIdentifier(entityName) { - var node = entityName; - while (node.parent && node.parent.kind === 116 /* QualifiedName */) - node = node.parent; - return node.parent && node.parent.kind === 127 /* TypeReference */; - } - function isExpression(node) { - switch (node.kind) { - case 87 /* ThisKeyword */: - case 85 /* SuperKeyword */: - case 83 /* NullKeyword */: - case 89 /* TrueKeyword */: - case 74 /* FalseKeyword */: - case 8 /* RegularExpressionLiteral */: - case 132 /* ArrayLiteral */: - case 133 /* ObjectLiteral */: - case 135 /* PropertyAccess */: - case 136 /* IndexedAccess */: - case 137 /* CallExpression */: - case 138 /* NewExpression */: - case 139 /* TypeAssertion */: - case 140 /* ParenExpression */: - case 141 /* FunctionExpression */: - case 142 /* ArrowFunction */: - case 143 /* PrefixOperator */: - case 144 /* PostfixOperator */: - case 145 /* BinaryExpression */: - case 146 /* ConditionalExpression */: - case 147 /* OmittedExpression */: - return true; - case 116 /* QualifiedName */: - while (node.parent.kind === 116 /* QualifiedName */) - node = node.parent; - return node.parent.kind === 128 /* TypeQuery */; - case 59 /* Identifier */: - if (node.parent.kind === 128 /* TypeQuery */) { - return true; - } - case 6 /* NumericLiteral */: - case 7 /* StringLiteral */: - var parent = node.parent; - switch (parent.kind) { - case 171 /* VariableDeclaration */: - case 118 /* Parameter */: - case 119 /* Property */: - case 181 /* EnumMember */: - case 134 /* PropertyAssignment */: - return parent.initializer === node; - case 151 /* ExpressionStatement */: - case 152 /* IfStatement */: - case 153 /* DoStatement */: - case 154 /* WhileStatement */: - case 159 /* ReturnStatement */: - case 160 /* WithStatement */: - case 161 /* SwitchStatement */: - case 162 /* CaseClause */: - case 165 /* ThrowStatement */: - case 161 /* SwitchStatement */: - return parent.expression === node; - case 155 /* ForStatement */: - return parent.initializer === node || parent.condition === node || parent.iterator === node; - case 156 /* ForInStatement */: - return parent.variable === node || parent.expression === node; - case 139 /* TypeAssertion */: - return node === parent.operand; - default: - if (isExpression(parent)) { - return true; - } - } - } - return false; - } - function isTypeNode(node) { - if (ts.SyntaxKind.FirstTypeNode <= node.kind && node.kind <= ts.SyntaxKind.LastTypeNode) { - return true; - } - switch (node.kind) { - case 105 /* AnyKeyword */: - case 112 /* NumberKeyword */: - case 114 /* StringKeyword */: - case 106 /* BooleanKeyword */: - return true; - case 93 /* VoidKeyword */: - return node.parent.kind !== 143 /* PrefixOperator */; - case 7 /* StringLiteral */: - return node.parent.kind === 118 /* Parameter */; - case 59 /* Identifier */: - if (node.parent.kind === 116 /* QualifiedName */) { - node = node.parent; - } - case 116 /* QualifiedName */: - ts.Debug.assert(node.kind === 59 /* Identifier */ || node.kind === 116 /* QualifiedName */, "'node' was expected to be a qualified name or identifier in 'isTypeNode'."); - var parent = node.parent; - if (parent.kind === 128 /* TypeQuery */) { - return false; - } - if (ts.SyntaxKind.FirstTypeNode <= parent.kind && parent.kind <= ts.SyntaxKind.LastTypeNode) { - return true; - } - switch (parent.kind) { - case 117 /* TypeParameter */: - return node === parent.constraint; - case 119 /* Property */: - case 118 /* Parameter */: - case 171 /* VariableDeclaration */: - return node === parent.type; - case 172 /* FunctionDeclaration */: - case 141 /* FunctionExpression */: - case 142 /* ArrowFunction */: - case 121 /* Constructor */: - case 120 /* Method */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - return node === parent.type; - case 124 /* CallSignature */: - case 125 /* ConstructSignature */: - case 126 /* IndexSignature */: - return node === parent.type; - case 139 /* TypeAssertion */: - return node === parent.type; - case 137 /* CallExpression */: - case 138 /* NewExpression */: - return parent.typeArguments && parent.typeArguments.indexOf(node) >= 0; - } - } - return false; - } - function isInRightSideOfImportOrExportAssignment(node) { - while (node.parent.kind === 116 /* QualifiedName */) { - node = node.parent; - } - if (node.parent.kind === 179 /* ImportDeclaration */) { - return node.parent.entityName === node; - } - if (node.parent.kind === 180 /* ExportAssignment */) { - return node.parent.exportName === node; - } - return false; - } - function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 116 /* QualifiedName */ || node.parent.kind === 135 /* PropertyAccess */) && node.parent.right === node; - } - function getSymbolOfEntityName(entityName) { - if (ts.isDeclarationOrFunctionExpressionOrCatchVariableName(entityName)) { - return getSymbolOfNode(entityName.parent); - } - if (entityName.parent.kind === 180 /* ExportAssignment */) { - return resolveEntityName(entityName.parent.parent, entityName, ts.SymbolFlags.Value | ts.SymbolFlags.Type | ts.SymbolFlags.Namespace | 4194304 /* Import */); - } - if (isInRightSideOfImportOrExportAssignment(entityName)) { - return getSymbolOfPartOfRightHandSideOfImport(entityName); - } - if (isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { - entityName = entityName.parent; - } - if (isExpression(entityName)) { - if (entityName.kind === 59 /* Identifier */) { - var meaning = ts.SymbolFlags.Value | 4194304 /* Import */; - return resolveEntityName(entityName, entityName, meaning); - } - else if (entityName.kind === 116 /* QualifiedName */ || entityName.kind === 135 /* PropertyAccess */) { - var symbol = getNodeLinks(entityName).resolvedSymbol; - if (!symbol) { - checkPropertyAccess(entityName); - } - return getNodeLinks(entityName).resolvedSymbol; - } - else { - return; - } - } - else if (isTypeReferenceIdentifier(entityName)) { - var meaning = entityName.parent.kind === 127 /* TypeReference */ ? ts.SymbolFlags.Type : ts.SymbolFlags.Namespace; - meaning |= 4194304 /* Import */; - return resolveEntityName(entityName, entityName, meaning); - } - return undefined; - } - function getSymbolInfo(node) { - if (isInsideWithStatementBody(node)) { - return undefined; - } - if (ts.isDeclarationOrFunctionExpressionOrCatchVariableName(node)) { - return getSymbolOfNode(node.parent); - } - if (node.kind === 59 /* Identifier */ && isInRightSideOfImportOrExportAssignment(node)) { - return node.parent.kind === 180 /* ExportAssignment */ ? getSymbolOfEntityName(node) : getSymbolOfPartOfRightHandSideOfImport(node); - } - switch (node.kind) { - case 59 /* Identifier */: - case 135 /* PropertyAccess */: - case 116 /* QualifiedName */: - return getSymbolOfEntityName(node); - case 87 /* ThisKeyword */: - case 85 /* SuperKeyword */: - var type = checkExpression(node); - return type.symbol; - case 107 /* ConstructorKeyword */: - var constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 121 /* Constructor */) { - return constructorDeclaration.parent.symbol; - } - return undefined; - case 7 /* StringLiteral */: - if (node.parent.kind === 179 /* ImportDeclaration */ && node.parent.externalModuleName === node) { - var importSymbol = getSymbolOfNode(node.parent); - var moduleType = getTypeOfSymbol(importSymbol); - return moduleType ? moduleType.symbol : undefined; - } - case 6 /* NumericLiteral */: - if (node.parent.kind == 136 /* IndexedAccess */ && node.parent.index === node) { - var objectType = checkExpression(node.parent.object); - if (objectType === unknownType) - return undefined; - var apparentType = getApparentType(objectType); - if (apparentType === unknownType) - return undefined; - return getPropertyOfApparentType(apparentType, node.text); - } - break; - } - return undefined; - } - function getTypeOfNode(node) { - if (isInsideWithStatementBody(node)) { - return unknownType; - } - if (isExpression(node)) { - return getTypeOfExpression(node); - } - if (isTypeNode(node)) { - return getTypeFromTypeNode(node); - } - if (isTypeDeclaration(node)) { - var symbol = getSymbolOfNode(node); - return getDeclaredTypeOfSymbol(symbol); - } - if (isTypeDeclarationName(node)) { - var symbol = getSymbolInfo(node); - return symbol && getDeclaredTypeOfSymbol(symbol); - } - if (ts.isDeclaration(node)) { - var symbol = getSymbolOfNode(node); - return getTypeOfSymbol(symbol); - } - if (ts.isDeclarationOrFunctionExpressionOrCatchVariableName(node)) { - var symbol = getSymbolInfo(node); - return symbol && getTypeOfSymbol(symbol); - } - if (isInRightSideOfImportOrExportAssignment(node)) { - var symbol = getSymbolInfo(node); - var declaredType = symbol && getDeclaredTypeOfSymbol(symbol); - return declaredType !== unknownType ? declaredType : getTypeOfSymbol(symbol); - } - return unknownType; - } - function getTypeOfExpression(expr) { - if (isRightSideOfQualifiedNameOrPropertyAccess(expr)) { - expr = expr.parent; - } - return checkExpression(expr); - } - function getAugmentedPropertiesOfApparentType(type) { - var apparentType = getApparentType(type); - if (apparentType.flags & ts.TypeFlags.ObjectType) { - var propertiesByName = {}; - var results = []; - ts.forEach(getPropertiesOfType(apparentType), function (s) { - propertiesByName[s.name] = s; - results.push(s); - }); - var resolved = resolveObjectTypeMembers(type); - ts.forEachValue(resolved.members, function (s) { - if (symbolIsValue(s) && !propertiesByName[s.name]) { - propertiesByName[s.name] = s; - results.push(s); - } - }); - if (resolved === anyFunctionType || resolved.callSignatures.length || resolved.constructSignatures.length) { - ts.forEach(getPropertiesOfType(globalFunctionType), function (s) { - if (!propertiesByName[s.name]) { - propertiesByName[s.name] = s; - results.push(s); - } - }); - } - return results; - } - else { - return getPropertiesOfType(apparentType); - } - } - function getRootSymbol(symbol) { - return ((symbol.flags & 33554432 /* Transient */) && getSymbolLinks(symbol).target) || symbol; - } - function isExternalModuleSymbol(symbol) { - return symbol.flags & 128 /* ValueModule */ && symbol.declarations.length === 1 && symbol.declarations[0].kind === 182 /* SourceFile */; - } - function isNodeDescendentOf(node, ancestor) { - while (node) { - if (node === ancestor) - return true; - node = node.parent; - } - return false; - } - function isUniqueLocalName(name, container) { - for (var node = container; isNodeDescendentOf(node, container); node = node.nextContainer) { - if (node.locals && ts.hasProperty(node.locals, name) && node.locals[name].flags & (ts.SymbolFlags.Value | 524288 /* ExportValue */)) { - return false; - } - } - return true; - } - function getLocalNameOfContainer(container) { - var links = getNodeLinks(container); - if (!links.localModuleName) { - var prefix = ""; - var name = ts.unescapeIdentifier(container.name.text); - while (!isUniqueLocalName(ts.escapeIdentifier(prefix + name), container)) { - prefix += "_"; - } - links.localModuleName = prefix + ts.getTextOfNode(container.name); - } - return links.localModuleName; - } - function getLocalNameForSymbol(symbol, location) { - var node = location; - while (node) { - if ((node.kind === 177 /* ModuleDeclaration */ || node.kind === 176 /* EnumDeclaration */) && getSymbolOfNode(node) === symbol) { - return getLocalNameOfContainer(node); - } - node = node.parent; - } - ts.Debug.fail("getLocalNameForSymbol failed"); - } - function getExpressionNamePrefix(node) { - var symbol = getNodeLinks(node).resolvedSymbol; - if (symbol) { - var exportSymbol = getExportSymbolOfValueSymbolIfExported(symbol); - if (symbol !== exportSymbol && !(exportSymbol.flags & ts.SymbolFlags.ExportHasLocal)) { - symbol = exportSymbol; - } - if (symbol.parent) { - return isExternalModuleSymbol(symbol.parent) ? "exports" : getLocalNameForSymbol(getParentOfSymbol(symbol), node.parent); - } - } - } - function getExportAssignmentName(node) { - var symbol = getExportAssignmentSymbol(getSymbolOfNode(node)); - return symbol && symbolIsValue(symbol) ? symbolToString(symbol) : undefined; - } - function isTopLevelValueImportedViaEntityName(node) { - if (node.parent.kind !== 182 /* SourceFile */ || !node.entityName) { - return false; - } - var symbol = getSymbolOfNode(node); - var target = resolveImport(symbol); - return target !== unknownSymbol && ((target.flags & ts.SymbolFlags.Value) !== 0); - } - function hasSemanticErrors() { - return getDiagnostics().length > 0 || getGlobalDiagnostics().length > 0; - } - function isReferencedImportDeclaration(node) { - var symbol = getSymbolOfNode(node); - if (getSymbolLinks(symbol).referenced) { - return true; - } - if (node.flags & 1 /* Export */) { - var target = resolveImport(symbol); - if (target !== unknownSymbol && target.flags & ts.SymbolFlags.Value) { - return true; - } - } - return false; - } - function isImplementationOfOverload(node) { - if (node.body) { - var symbol = getSymbolOfNode(node); - var signaturesOfSymbol = getSignaturesOfSymbol(symbol); - return signaturesOfSymbol.length > 1 || (signaturesOfSymbol.length === 1 && signaturesOfSymbol[0].declaration !== node); - } - return false; - } - function getNodeCheckFlags(node) { - return getNodeLinks(node).flags; - } - function getEnumMemberValue(node) { - computeEnumMemberValues(node.parent); - return getNodeLinks(node).enumMemberValue; - } - function getConstantValue(node) { - var symbol = getNodeLinks(node).resolvedSymbol; - if (symbol && (symbol.flags & 4 /* EnumMember */)) { - var declaration = symbol.valueDeclaration; - var constantValue; - if (declaration.kind === 181 /* EnumMember */ && (constantValue = getNodeLinks(declaration).enumMemberValue) !== undefined) { - return constantValue; - } - } - return undefined; - } - function writeTypeAtLocation(location, enclosingDeclaration, flags, writer) { - var symbol = getSymbolOfNode(location); - var type = symbol && !(symbol.flags & 512 /* TypeLiteral */) ? getTypeOfSymbol(symbol) : getTypeFromTypeNode(location); - writeType(type, writer, enclosingDeclaration, flags); - } - function writeReturnTypeOfSignatureDeclaration(signatureDeclaration, enclosingDeclaration, flags, writer) { - var signature = getSignatureFromDeclaration(signatureDeclaration); - writeType(getReturnTypeOfSignature(signature), writer, enclosingDeclaration, flags); - } - function createResolver() { - return { - getProgram: function () { return program; }, - getLocalNameOfContainer: getLocalNameOfContainer, - getExpressionNamePrefix: getExpressionNamePrefix, - getExportAssignmentName: getExportAssignmentName, - isReferencedImportDeclaration: isReferencedImportDeclaration, - getNodeCheckFlags: getNodeCheckFlags, - getEnumMemberValue: getEnumMemberValue, - isTopLevelValueImportedViaEntityName: isTopLevelValueImportedViaEntityName, - hasSemanticErrors: hasSemanticErrors, - isDeclarationVisible: isDeclarationVisible, - isImplementationOfOverload: isImplementationOfOverload, - writeTypeAtLocation: writeTypeAtLocation, - writeReturnTypeOfSignatureDeclaration: writeReturnTypeOfSignatureDeclaration, - isSymbolAccessible: isSymbolAccessible, - isImportDeclarationEntityNameReferenceDeclarationVisible: isImportDeclarationEntityNameReferenceDeclarationVisible, - getConstantValue: getConstantValue - }; - } - function invokeEmitter(targetSourceFile) { - var resolver = createResolver(); - checkProgram(); - return ts.emitFiles(resolver, targetSourceFile); - } - function initializeTypeChecker() { - ts.forEach(program.getSourceFiles(), function (file) { - ts.bindSourceFile(file); - ts.forEach(file.semanticErrors, addDiagnostic); - }); - ts.forEach(program.getSourceFiles(), function (file) { - if (!ts.isExternalModule(file)) { - extendSymbolTable(globals, file.locals); - } - }); - getSymbolLinks(undefinedSymbol).type = undefinedType; - getSymbolLinks(argumentsSymbol).type = getGlobalType("IArguments"); - getSymbolLinks(unknownSymbol).type = unknownType; - globals[undefinedSymbol.name] = undefinedSymbol; - globalArraySymbol = getGlobalSymbol("Array"); - globalArrayType = getTypeOfGlobalSymbol(globalArraySymbol, 1); - globalObjectType = getGlobalType("Object"); - globalFunctionType = getGlobalType("Function"); - globalStringType = getGlobalType("String"); - globalNumberType = getGlobalType("Number"); - globalBooleanType = getGlobalType("Boolean"); - globalRegExpType = getGlobalType("RegExp"); - } - initializeTypeChecker(); - return checker; - } - ts.createTypeChecker = createTypeChecker; -})(ts || (ts = {})); -var ts; -(function (ts) { - ts.optionDeclarations = [ - { - name: "charset", - type: "string" - }, - { - name: "codepage", - type: "number" - }, - { - name: "declaration", - shortName: "d", - type: "boolean", - description: ts.Diagnostics.Generates_corresponding_d_ts_file - }, - { - name: "diagnostics", - type: "boolean" - }, - { - name: "emitBOM", - type: "boolean" - }, - { - name: "help", - shortName: "h", - type: "boolean", - description: ts.Diagnostics.Print_this_message - }, - { - name: "locale", - type: "string" - }, - { - name: "mapRoot", - type: "string", - description: ts.Diagnostics.Specifies_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations, - paramType: ts.Diagnostics.LOCATION - }, - { - name: "module", - shortName: "m", - type: { - "commonjs": 1 /* CommonJS */, - "amd": 2 /* AMD */ - }, - description: ts.Diagnostics.Specify_module_code_generation_Colon_commonjs_or_amd, - paramType: ts.Diagnostics.KIND, - error: ts.Diagnostics.Argument_for_module_option_must_be_commonjs_or_amd - }, - { - name: "noImplicitAny", - type: "boolean", - description: ts.Diagnostics.Warn_on_expressions_and_declarations_with_an_implied_any_type - }, - { - name: "noLib", - type: "boolean" - }, - { - name: "noLibCheck", - type: "boolean" - }, - { - name: "noResolve", - type: "boolean" - }, - { - name: "out", - type: "string", - description: ts.Diagnostics.Concatenate_and_emit_output_to_single_file, - paramType: ts.Diagnostics.FILE - }, - { - name: "outDir", - type: "string", - description: ts.Diagnostics.Redirect_output_structure_to_the_directory, - paramType: ts.Diagnostics.DIRECTORY - }, - { - name: "removeComments", - type: "boolean", - description: ts.Diagnostics.Do_not_emit_comments_to_output - }, - { - name: "sourceMap", - type: "boolean", - description: ts.Diagnostics.Generates_corresponding_map_file - }, - { - name: "sourceRoot", - type: "string", - description: ts.Diagnostics.Specifies_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations, - paramType: ts.Diagnostics.LOCATION - }, - { - name: "target", - shortName: "t", - type: { "es3": 0 /* ES3 */, "es5": 1 /* ES5 */ }, - description: ts.Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_or_ES5, - paramType: ts.Diagnostics.VERSION, - error: ts.Diagnostics.Argument_for_target_option_must_be_es3_or_es5 - }, - { - name: "version", - shortName: "v", - type: "boolean", - description: ts.Diagnostics.Print_the_compiler_s_version - }, - { - name: "watch", - shortName: "w", - type: "boolean", - description: ts.Diagnostics.Watch_input_files - } - ]; - var shortOptionNames = {}; - var optionNameMap = {}; - ts.forEach(ts.optionDeclarations, function (option) { - optionNameMap[option.name.toLowerCase()] = option; - if (option.shortName) { - shortOptionNames[option.shortName] = option.name; - } - }); - function parseCommandLine(commandLine) { - var options = { - target: 0 /* ES3 */, - module: 0 /* None */ - }; - var filenames = []; - var errors = []; - parseStrings(commandLine); - return { - options: options, - filenames: filenames, - errors: errors - }; - function parseStrings(args) { - var i = 0; - while (i < args.length) { - var s = args[i++]; - if (s.charCodeAt(0) === 64 /* at */) { - parseResponseFile(s.slice(1)); - } - else if (s.charCodeAt(0) === 45 /* minus */) { - s = s.slice(s.charCodeAt(1) === 45 /* minus */ ? 2 : 1).toLowerCase(); - if (ts.hasProperty(shortOptionNames, s)) { - s = shortOptionNames[s]; - } - if (ts.hasProperty(optionNameMap, s)) { - var opt = optionNameMap[s]; - if (!args[i] && opt.type !== "boolean") { - errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Compiler_option_0_expects_an_argument, opt.name)); - } - switch (opt.type) { - case "number": - options[opt.name] = parseInt(args[i++]); - break; - case "boolean": - options[opt.name] = true; - break; - case "string": - options[opt.name] = args[i++] || ""; - break; - default: - var value = (args[i++] || "").toLowerCase(); - if (ts.hasProperty(opt.type, value)) { - options[opt.name] = opt.type[value]; - } - else { - errors.push(ts.createCompilerDiagnostic(opt.error)); - } - } - } - else { - errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Unknown_compiler_option_0, s)); - } - } - else { - filenames.push(s); - } - } - } - function parseResponseFile(filename) { - var text = sys.readFile(filename); - if (!text) { - errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.File_0_not_found, filename)); - return; - } - var args = []; - var pos = 0; - while (true) { - while (pos < text.length && text.charCodeAt(pos) <= 32 /* space */) - pos++; - if (pos >= text.length) - break; - var start = pos; - if (text.charCodeAt(start) === 34 /* doubleQuote */) { - pos++; - while (pos < text.length && text.charCodeAt(pos) !== 34 /* doubleQuote */) - pos++; - if (pos < text.length) { - args.push(text.substring(start + 1, pos)); - pos++; - } - else { - errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Unterminated_quoted_string_in_response_file_0, filename)); - } - } - else { - while (text.charCodeAt(pos) > 32 /* space */) - pos++; - args.push(text.substring(start, pos)); - } - } - parseStrings(args); - } - } - ts.parseCommandLine = parseCommandLine; -})(ts || (ts = {})); -var ts; -(function (ts) { - var version = "1.3.0.0"; - function validateLocaleAndSetLanguage(locale, errors) { - var matchResult = /^([a-z]+)([_\-]([a-z]+))?$/.exec(locale.toLowerCase()); - if (!matchResult) { - errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1, 'en', 'ja-jp')); - return false; - } - var language = matchResult[1]; - var territory = matchResult[3]; - if (!trySetLanguageAndTerritory(language, territory, errors) && !trySetLanguageAndTerritory(language, undefined, errors)) { - errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Unsupported_locale_0, locale)); - return false; - } - return true; - } - function trySetLanguageAndTerritory(language, territory, errors) { - var compilerFilePath = ts.normalizePath(sys.getExecutingFilePath()); - var containingDirectoryPath = ts.getDirectoryPath(compilerFilePath); - var filePath = ts.combinePaths(containingDirectoryPath, language); - if (territory) { - filePath = filePath + "-" + territory; - } - filePath = sys.resolvePath(ts.combinePaths(filePath, "diagnosticMessages.generated.json")); - if (!sys.fileExists(filePath)) { - return false; - } - try { - var fileContents = sys.readFile(filePath); - } - catch (e) { - errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Unable_to_open_file_0, filePath)); - return false; - } - try { - ts.localizedDiagnosticMessages = JSON.parse(fileContents); - } - catch (e) { - errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Corrupted_locale_file_0, filePath)); - return false; - } - return true; - } - function countLines(program) { - var count = 0; - ts.forEach(program.getSourceFiles(), function (file) { - count += file.getLineAndCharacterFromPosition(file.end).line; - }); - return count; - } - function getDiagnosticText(message) { - var args = []; - for (var _i = 1; _i < arguments.length; _i++) { - args[_i - 1] = arguments[_i]; - } - var diagnostic = ts.createCompilerDiagnostic.apply(undefined, arguments); - return diagnostic.messageText; - } - function reportDiagnostic(diagnostic) { - var output = ""; - if (diagnostic.file) { - var loc = diagnostic.file.getLineAndCharacterFromPosition(diagnostic.start); - output += diagnostic.file.filename + "(" + loc.line + "," + loc.character + "): "; - } - var category = ts.DiagnosticCategory[diagnostic.category].toLowerCase(); - output += category + " TS" + diagnostic.code + ": " + diagnostic.messageText + sys.newLine; - sys.write(output); - } - function reportDiagnostics(diagnostics) { - for (var i = 0; i < diagnostics.length; i++) { - reportDiagnostic(diagnostics[i]); - } - } - function padLeft(s, length) { - while (s.length < length) { - s = " " + s; - } - return s; - } - function padRight(s, length) { - while (s.length < length) { - s = s + " "; - } - return s; - } - function reportStatisticalValue(name, value) { - sys.write(padRight(name + ":", 12) + padLeft(value.toString(), 10) + sys.newLine); - } - function reportCountStatistic(name, count) { - reportStatisticalValue(name, "" + count); - } - function reportTimeStatistic(name, time) { - reportStatisticalValue(name, (time / 1000).toFixed(2) + "s"); - } - function createCompilerHost(options) { - var currentDirectory; - var existingDirectories = {}; - function getCanonicalFileName(fileName) { - return sys.useCaseSensitiveFileNames ? fileName : fileName.toLowerCase(); - } - function getSourceFile(filename, languageVersion, onError) { - try { - var text = sys.readFile(filename, options.charset); - } - catch (e) { - if (onError) { - onError(e.message); - } - text = ""; - } - return text !== undefined ? ts.createSourceFile(filename, text, languageVersion, "0") : undefined; - } - function writeFile(fileName, data, writeByteOrderMark, onError) { - function directoryExists(directoryPath) { - if (ts.hasProperty(existingDirectories, directoryPath)) { - return true; - } - if (sys.directoryExists(directoryPath)) { - existingDirectories[directoryPath] = true; - return true; - } - return false; - } - function ensureDirectoriesExist(directoryPath) { - if (directoryPath.length > ts.getRootLength(directoryPath) && !directoryExists(directoryPath)) { - var parentDirectory = ts.getDirectoryPath(directoryPath); - ensureDirectoriesExist(parentDirectory); - sys.createDirectory(directoryPath); - } - } - try { - ensureDirectoriesExist(ts.getDirectoryPath(ts.normalizePath(fileName))); - sys.writeFile(fileName, data, writeByteOrderMark); - } - catch (e) { - if (onError) - onError(e.message); - } - } - return { - getSourceFile: getSourceFile, - getDefaultLibFilename: function () { return ts.combinePaths(ts.getDirectoryPath(ts.normalizePath(sys.getExecutingFilePath())), "lib.d.ts"); }, - writeFile: writeFile, - getCurrentDirectory: function () { return currentDirectory || (currentDirectory = sys.getCurrentDirectory()); }, - useCaseSensitiveFileNames: function () { return sys.useCaseSensitiveFileNames; }, - getCanonicalFileName: getCanonicalFileName, - getNewLine: function () { return sys.newLine; } - }; - } - function executeCommandLine(args) { - var commandLine = ts.parseCommandLine(args); - var compilerOptions = commandLine.options; - if (compilerOptions.locale) { - if (typeof JSON === "undefined") { - reportDiagnostic(ts.createCompilerDiagnostic(ts.Diagnostics.The_current_host_does_not_support_the_0_option, "--locale")); - return sys.exit(1); - } - validateLocaleAndSetLanguage(commandLine.options.locale, commandLine.errors); - } - if (commandLine.errors.length > 0) { - reportDiagnostics(commandLine.errors); - return sys.exit(5 /* CompilerOptionsErrors */); - } - if (compilerOptions.version) { - reportDiagnostic(ts.createCompilerDiagnostic(ts.Diagnostics.Version_0, version)); - return sys.exit(0 /* Succeeded */); - } - if (compilerOptions.help) { - printVersion(); - printHelp(); - return sys.exit(0 /* Succeeded */); - } - if (commandLine.filenames.length === 0) { - printVersion(); - printHelp(); - return sys.exit(5 /* CompilerOptionsErrors */); - } - var defaultCompilerHost = createCompilerHost(compilerOptions); - if (compilerOptions.watch) { - if (!sys.watchFile) { - reportDiagnostic(ts.createCompilerDiagnostic(ts.Diagnostics.The_current_host_does_not_support_the_0_option, "--watch")); - return sys.exit(5 /* CompilerOptionsErrors */); - } - watchProgram(commandLine, defaultCompilerHost); - } - else { - var result = compile(commandLine, defaultCompilerHost).exitStatus; - return sys.exit(result); - } - } - ts.executeCommandLine = executeCommandLine; - function watchProgram(commandLine, compilerHost) { - var watchers = {}; - var updatedFiles = {}; - var program = compile(commandLine, compilerHost).program; - reportDiagnostic(ts.createCompilerDiagnostic(ts.Diagnostics.Compilation_complete_Watching_for_file_changes)); - addWatchers(program); - return; - function addWatchers(program) { - ts.forEach(program.getSourceFiles(), function (f) { - var filename = getCanonicalName(f.filename); - watchers[filename] = sys.watchFile(filename, fileUpdated); - }); - } - function removeWatchers(program) { - ts.forEach(program.getSourceFiles(), function (f) { - var filename = getCanonicalName(f.filename); - if (ts.hasProperty(watchers, filename)) { - watchers[filename].close(); - } - }); - watchers = {}; - } - function fileUpdated(filename) { - var firstNotification = ts.isEmpty(updatedFiles); - updatedFiles[getCanonicalName(filename)] = true; - if (firstNotification) { - setTimeout(function () { - var changedFiles = updatedFiles; - updatedFiles = {}; - recompile(changedFiles); - }, 250); - } - } - function recompile(changedFiles) { - reportDiagnostic(ts.createCompilerDiagnostic(ts.Diagnostics.File_change_detected_Compiling)); - removeWatchers(program); - var oldSourceFiles = ts.arrayToMap(ts.filter(program.getSourceFiles(), function (file) { return !ts.hasProperty(changedFiles, getCanonicalName(file.filename)); }), function (file) { return getCanonicalName(file.filename); }); - var newCompilerHost = ts.clone(compilerHost); - newCompilerHost.getSourceFile = function (fileName, languageVersion, onError) { - fileName = getCanonicalName(fileName); - var sourceFile = ts.lookUp(oldSourceFiles, fileName); - if (sourceFile) { - return sourceFile; - } - return compilerHost.getSourceFile(fileName, languageVersion, onError); - }; - program = compile(commandLine, newCompilerHost).program; - reportDiagnostic(ts.createCompilerDiagnostic(ts.Diagnostics.Compilation_complete_Watching_for_file_changes)); - addWatchers(program); - } - function getCanonicalName(fileName) { - return compilerHost.getCanonicalFileName(fileName); - } - } - function compile(commandLine, compilerHost) { - var parseStart = new Date().getTime(); - var compilerOptions = commandLine.options; - var program = ts.createProgram(commandLine.filenames, compilerOptions, compilerHost); - var bindStart = new Date().getTime(); - var errors = program.getDiagnostics(); - var exitStatus; - if (errors.length) { - var checkStart = bindStart; - var emitStart = bindStart; - var reportStart = bindStart; - exitStatus = 1 /* AllOutputGenerationSkipped */; - } - else { - var checker = program.getTypeChecker(true); - var checkStart = new Date().getTime(); - var semanticErrors = checker.getDiagnostics(); - var emitStart = new Date().getTime(); - var emitOutput = checker.emitFiles(); - var emitErrors = emitOutput.errors; - exitStatus = emitOutput.emitResultStatus; - var reportStart = new Date().getTime(); - errors = ts.concatenate(semanticErrors, emitErrors); - } - reportDiagnostics(errors); - if (commandLine.options.diagnostics) { - var memoryUsed = sys.getMemoryUsage ? sys.getMemoryUsage() : -1; - reportCountStatistic("Files", program.getSourceFiles().length); - reportCountStatistic("Lines", countLines(program)); - reportCountStatistic("Nodes", checker ? checker.getNodeCount() : 0); - reportCountStatistic("Identifiers", checker ? checker.getIdentifierCount() : 0); - reportCountStatistic("Symbols", checker ? checker.getSymbolCount() : 0); - reportCountStatistic("Types", checker ? checker.getTypeCount() : 0); - if (memoryUsed >= 0) { - reportStatisticalValue("Memory used", Math.round(memoryUsed / 1000) + "K"); - } - reportTimeStatistic("Parse time", bindStart - parseStart); - reportTimeStatistic("Bind time", checkStart - bindStart); - reportTimeStatistic("Check time", emitStart - checkStart); - reportTimeStatistic("Emit time", reportStart - emitStart); - reportTimeStatistic("Total time", reportStart - parseStart); - } - return { program: program, exitStatus: exitStatus }; - } - function printVersion() { - sys.write(getDiagnosticText(ts.Diagnostics.Version_0, version) + sys.newLine); - } - function printHelp() { - var output = ""; - var syntaxLength = getDiagnosticText(ts.Diagnostics.Syntax_Colon_0, "").length; - var examplesLength = getDiagnosticText(ts.Diagnostics.Examples_Colon_0, "").length; - var marginLength = Math.max(syntaxLength, examplesLength); - var syntax = makePadding(marginLength - syntaxLength); - syntax += "tsc [" + getDiagnosticText(ts.Diagnostics.options) + "] [" + getDiagnosticText(ts.Diagnostics.file) + " ...]"; - output += getDiagnosticText(ts.Diagnostics.Syntax_Colon_0, syntax); - output += sys.newLine + sys.newLine; - var padding = makePadding(marginLength); - output += getDiagnosticText(ts.Diagnostics.Examples_Colon_0, makePadding(marginLength - examplesLength) + "tsc hello.ts") + sys.newLine; - output += padding + "tsc --out file.js file.ts" + sys.newLine; - output += padding + "tsc @args.txt" + sys.newLine; - output += sys.newLine; - output += getDiagnosticText(ts.Diagnostics.Options_Colon) + sys.newLine; - var optsList = ts.optionDeclarations.slice(); - optsList.sort(function (a, b) { return ts.compareValues(a.name.toLowerCase(), b.name.toLowerCase()); }); - var marginLength = 0; - var usageColumn = []; - var descriptionColumn = []; - for (var i = 0; i < optsList.length; i++) { - var option = optsList[i]; - if (!option.description) { - continue; - } - var usageText = " "; - if (option.shortName) { - usageText += "-" + option.shortName; - usageText += getParamName(option); - usageText += ", "; - } - usageText += "--" + option.name; - usageText += getParamName(option); - usageColumn.push(usageText); - descriptionColumn.push(getDiagnosticText(option.description)); - marginLength = Math.max(usageText.length, marginLength); - } - var usageText = " @<" + getDiagnosticText(ts.Diagnostics.file) + ">"; - usageColumn.push(usageText); - descriptionColumn.push(getDiagnosticText(ts.Diagnostics.Insert_command_line_options_and_files_from_a_file)); - marginLength = Math.max(usageText.length, marginLength); - for (var i = 0; i < usageColumn.length; i++) { - var usage = usageColumn[i]; - var description = descriptionColumn[i]; - output += usage + makePadding(marginLength - usage.length + 2) + description + sys.newLine; - } - sys.write(output); - return; - function getParamName(option) { - if (option.paramName !== undefined) { - return " " + getDiagnosticText(option.paramName); - } - return ""; - } - function makePadding(paddingLength) { - return Array(paddingLength + 1).join(" "); - } - } -})(ts || (ts = {})); -ts.executeCommandLine(sys.args); diff --git a/pages/third_party/typescript/bin/typescriptServices.js b/pages/third_party/typescript/bin/typescriptServices.js deleted file mode 100644 index c3ca7ac497..0000000000 --- a/pages/third_party/typescript/bin/typescriptServices.js +++ /dev/null @@ -1,36534 +0,0 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - -var ts; -(function (ts) { - ts.Diagnostics = { - Unterminated_string_literal: { code: 1002, category: 1 /* Error */, key: "Unterminated string literal." }, - Identifier_expected: { code: 1003, category: 1 /* Error */, key: "Identifier expected." }, - _0_expected: { code: 1005, category: 1 /* Error */, key: "'{0}' expected." }, - A_file_cannot_have_a_reference_to_itself: { code: 1006, category: 1 /* Error */, key: "A file cannot have a reference to itself." }, - Trailing_comma_not_allowed: { code: 1009, category: 1 /* Error */, key: "Trailing comma not allowed." }, - Asterisk_Slash_expected: { code: 1010, category: 1 /* Error */, key: "'*/' expected." }, - Unexpected_token: { code: 1012, category: 1 /* Error */, key: "Unexpected token." }, - Catch_clause_parameter_cannot_have_a_type_annotation: { code: 1013, category: 1 /* Error */, key: "Catch clause parameter cannot have a type annotation." }, - A_rest_parameter_must_be_last_in_a_parameter_list: { code: 1014, category: 1 /* Error */, key: "A rest parameter must be last in a parameter list." }, - Parameter_cannot_have_question_mark_and_initializer: { code: 1015, category: 1 /* Error */, key: "Parameter cannot have question mark and initializer." }, - A_required_parameter_cannot_follow_an_optional_parameter: { code: 1016, category: 1 /* Error */, key: "A required parameter cannot follow an optional parameter." }, - An_index_signature_cannot_have_a_rest_parameter: { code: 1017, category: 1 /* Error */, key: "An index signature cannot have a rest parameter." }, - An_index_signature_parameter_cannot_have_an_accessibility_modifier: { code: 1018, category: 1 /* Error */, key: "An index signature parameter cannot have an accessibility modifier." }, - An_index_signature_parameter_cannot_have_a_question_mark: { code: 1019, category: 1 /* Error */, key: "An index signature parameter cannot have a question mark." }, - An_index_signature_parameter_cannot_have_an_initializer: { code: 1020, category: 1 /* Error */, key: "An index signature parameter cannot have an initializer." }, - An_index_signature_must_have_a_type_annotation: { code: 1021, category: 1 /* Error */, key: "An index signature must have a type annotation." }, - An_index_signature_parameter_must_have_a_type_annotation: { code: 1022, category: 1 /* Error */, key: "An index signature parameter must have a type annotation." }, - An_index_signature_parameter_type_must_be_string_or_number: { code: 1023, category: 1 /* Error */, key: "An index signature parameter type must be 'string' or 'number'." }, - A_class_or_interface_declaration_can_only_have_one_extends_clause: { code: 1024, category: 1 /* Error */, key: "A class or interface declaration can only have one 'extends' clause." }, - An_extends_clause_must_precede_an_implements_clause: { code: 1025, category: 1 /* Error */, key: "An 'extends' clause must precede an 'implements' clause." }, - A_class_can_only_extend_a_single_class: { code: 1026, category: 1 /* Error */, key: "A class can only extend a single class." }, - A_class_declaration_can_only_have_one_implements_clause: { code: 1027, category: 1 /* Error */, key: "A class declaration can only have one 'implements' clause." }, - Accessibility_modifier_already_seen: { code: 1028, category: 1 /* Error */, key: "Accessibility modifier already seen." }, - _0_modifier_must_precede_1_modifier: { code: 1029, category: 1 /* Error */, key: "'{0}' modifier must precede '{1}' modifier." }, - _0_modifier_already_seen: { code: 1030, category: 1 /* Error */, key: "'{0}' modifier already seen." }, - _0_modifier_cannot_appear_on_a_class_element: { code: 1031, category: 1 /* Error */, key: "'{0}' modifier cannot appear on a class element." }, - An_interface_declaration_cannot_have_an_implements_clause: { code: 1032, category: 1 /* Error */, key: "An interface declaration cannot have an 'implements' clause." }, - super_must_be_followed_by_an_argument_list_or_member_access: { code: 1034, category: 1 /* Error */, key: "'super' must be followed by an argument list or member access." }, - Only_ambient_modules_can_use_quoted_names: { code: 1035, category: 1 /* Error */, key: "Only ambient modules can use quoted names." }, - Statements_are_not_allowed_in_ambient_contexts: { code: 1036, category: 1 /* Error */, key: "Statements are not allowed in ambient contexts." }, - A_function_implementation_cannot_be_declared_in_an_ambient_context: { code: 1037, category: 1 /* Error */, key: "A function implementation cannot be declared in an ambient context." }, - A_declare_modifier_cannot_be_used_in_an_already_ambient_context: { code: 1038, category: 1 /* Error */, key: "A 'declare' modifier cannot be used in an already ambient context." }, - Initializers_are_not_allowed_in_ambient_contexts: { code: 1039, category: 1 /* Error */, key: "Initializers are not allowed in ambient contexts." }, - _0_modifier_cannot_appear_on_a_module_element: { code: 1044, category: 1 /* Error */, key: "'{0}' modifier cannot appear on a module element." }, - A_declare_modifier_cannot_be_used_with_an_interface_declaration: { code: 1045, category: 1 /* Error */, key: "A 'declare' modifier cannot be used with an interface declaration." }, - A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file: { code: 1046, category: 1 /* Error */, key: "A 'declare' modifier is required for a top level declaration in a .d.ts file." }, - A_rest_parameter_cannot_be_optional: { code: 1047, category: 1 /* Error */, key: "A rest parameter cannot be optional." }, - A_rest_parameter_cannot_have_an_initializer: { code: 1048, category: 1 /* Error */, key: "A rest parameter cannot have an initializer." }, - A_set_accessor_must_have_exactly_one_parameter: { code: 1049, category: 1 /* Error */, key: "A 'set' accessor must have exactly one parameter." }, - A_set_accessor_cannot_have_an_optional_parameter: { code: 1051, category: 1 /* Error */, key: "A 'set' accessor cannot have an optional parameter." }, - A_set_accessor_parameter_cannot_have_an_initializer: { code: 1052, category: 1 /* Error */, key: "A 'set' accessor parameter cannot have an initializer." }, - A_set_accessor_cannot_have_rest_parameter: { code: 1053, category: 1 /* Error */, key: "A 'set' accessor cannot have rest parameter." }, - A_get_accessor_cannot_have_parameters: { code: 1054, category: 1 /* Error */, key: "A 'get' accessor cannot have parameters." }, - Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: { code: 1056, category: 1 /* Error */, key: "Accessors are only available when targeting ECMAScript 5 and higher." }, - Enum_member_must_have_initializer: { code: 1061, category: 1 /* Error */, key: "Enum member must have initializer." }, - An_export_assignment_cannot_be_used_in_an_internal_module: { code: 1063, category: 1 /* Error */, key: "An export assignment cannot be used in an internal module." }, - Ambient_enum_elements_can_only_have_integer_literal_initializers: { code: 1066, category: 1 /* Error */, key: "Ambient enum elements can only have integer literal initializers." }, - Unexpected_token_A_constructor_method_accessor_or_property_was_expected: { code: 1068, category: 1 /* Error */, key: "Unexpected token. A constructor, method, accessor, or property was expected." }, - A_declare_modifier_cannot_be_used_with_an_import_declaration: { code: 1079, category: 1 /* Error */, key: "A 'declare' modifier cannot be used with an import declaration." }, - Invalid_reference_directive_syntax: { code: 1084, category: 1 /* Error */, key: "Invalid 'reference' directive syntax." }, - Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher: { code: 1085, category: 1 /* Error */, key: "Octal literals are not available when targeting ECMAScript 5 and higher." }, - An_accessor_cannot_be_declared_in_an_ambient_context: { code: 1086, category: 1 /* Error */, key: "An accessor cannot be declared in an ambient context." }, - _0_modifier_cannot_appear_on_a_constructor_declaration: { code: 1089, category: 1 /* Error */, key: "'{0}' modifier cannot appear on a constructor declaration." }, - _0_modifier_cannot_appear_on_a_parameter: { code: 1090, category: 1 /* Error */, key: "'{0}' modifier cannot appear on a parameter." }, - Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement: { code: 1091, category: 1 /* Error */, key: "Only a single variable declaration is allowed in a 'for...in' statement." }, - Type_parameters_cannot_appear_on_a_constructor_declaration: { code: 1092, category: 1 /* Error */, key: "Type parameters cannot appear on a constructor declaration." }, - Type_annotation_cannot_appear_on_a_constructor_declaration: { code: 1093, category: 1 /* Error */, key: "Type annotation cannot appear on a constructor declaration." }, - An_accessor_cannot_have_type_parameters: { code: 1094, category: 1 /* Error */, key: "An accessor cannot have type parameters." }, - A_set_accessor_cannot_have_a_return_type_annotation: { code: 1095, category: 1 /* Error */, key: "A 'set' accessor cannot have a return type annotation." }, - An_index_signature_must_have_exactly_one_parameter: { code: 1096, category: 1 /* Error */, key: "An index signature must have exactly one parameter." }, - _0_list_cannot_be_empty: { code: 1097, category: 1 /* Error */, key: "'{0}' list cannot be empty." }, - Type_parameter_list_cannot_be_empty: { code: 1098, category: 1 /* Error */, key: "Type parameter list cannot be empty." }, - Type_argument_list_cannot_be_empty: { code: 1099, category: 1 /* Error */, key: "Type argument list cannot be empty." }, - Invalid_use_of_0_in_strict_mode: { code: 1100, category: 1 /* Error */, key: "Invalid use of '{0}' in strict mode." }, - with_statements_are_not_allowed_in_strict_mode: { code: 1101, category: 1 /* Error */, key: "'with' statements are not allowed in strict mode." }, - delete_cannot_be_called_on_an_identifier_in_strict_mode: { code: 1102, category: 1 /* Error */, key: "'delete' cannot be called on an identifier in strict mode." }, - A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement: { code: 1104, category: 1 /* Error */, key: "A 'continue' statement can only be used within an enclosing iteration statement." }, - A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement: { code: 1105, category: 1 /* Error */, key: "A 'break' statement can only be used within an enclosing iteration or switch statement." }, - Jump_target_cannot_cross_function_boundary: { code: 1107, category: 1 /* Error */, key: "Jump target cannot cross function boundary." }, - A_return_statement_can_only_be_used_within_a_function_body: { code: 1108, category: 1 /* Error */, key: "A 'return' statement can only be used within a function body." }, - Expression_expected: { code: 1109, category: 1 /* Error */, key: "Expression expected." }, - Type_expected: { code: 1110, category: 1 /* Error */, key: "Type expected." }, - A_constructor_implementation_cannot_be_declared_in_an_ambient_context: { code: 1111, category: 1 /* Error */, key: "A constructor implementation cannot be declared in an ambient context." }, - A_class_member_cannot_be_declared_optional: { code: 1112, category: 1 /* Error */, key: "A class member cannot be declared optional." }, - A_default_clause_cannot_appear_more_than_once_in_a_switch_statement: { code: 1113, category: 1 /* Error */, key: "A 'default' clause cannot appear more than once in a 'switch' statement." }, - Duplicate_label_0: { code: 1114, category: 1 /* Error */, key: "Duplicate label '{0}'" }, - A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: { code: 1115, category: 1 /* Error */, key: "A 'continue' statement can only jump to a label of an enclosing iteration statement." }, - A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: { code: 1116, category: 1 /* Error */, key: "A 'break' statement can only jump to a label of an enclosing statement." }, - An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode: { code: 1117, category: 1 /* Error */, key: "An object literal cannot have multiple properties with the same name in strict mode." }, - An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name: { code: 1118, category: 1 /* Error */, key: "An object literal cannot have multiple get/set accessors with the same name." }, - An_object_literal_cannot_have_property_and_accessor_with_the_same_name: { code: 1119, category: 1 /* Error */, key: "An object literal cannot have property and accessor with the same name." }, - An_export_assignment_cannot_have_modifiers: { code: 1120, category: 1 /* Error */, key: "An export assignment cannot have modifiers." }, - Octal_literals_are_not_allowed_in_strict_mode: { code: 1121, category: 1 /* Error */, key: "Octal literals are not allowed in strict mode." }, - A_tuple_type_element_list_cannot_be_empty: { code: 1122, category: 1 /* Error */, key: "A tuple type element list cannot be empty." }, - Variable_declaration_list_cannot_be_empty: { code: 1123, category: 1 /* Error */, key: "Variable declaration list cannot be empty." }, - Digit_expected: { code: 1124, category: 1 /* Error */, key: "Digit expected." }, - Hexadecimal_digit_expected: { code: 1125, category: 1 /* Error */, key: "Hexadecimal digit expected." }, - Unexpected_end_of_text: { code: 1126, category: 1 /* Error */, key: "Unexpected end of text." }, - Invalid_character: { code: 1127, category: 1 /* Error */, key: "Invalid character." }, - Declaration_or_statement_expected: { code: 1128, category: 1 /* Error */, key: "Declaration or statement expected." }, - Statement_expected: { code: 1129, category: 1 /* Error */, key: "Statement expected." }, - case_or_default_expected: { code: 1130, category: 1 /* Error */, key: "'case' or 'default' expected." }, - Property_or_signature_expected: { code: 1131, category: 1 /* Error */, key: "Property or signature expected." }, - Enum_member_expected: { code: 1132, category: 1 /* Error */, key: "Enum member expected." }, - Type_reference_expected: { code: 1133, category: 1 /* Error */, key: "Type reference expected." }, - Variable_declaration_expected: { code: 1134, category: 1 /* Error */, key: "Variable declaration expected." }, - Argument_expression_expected: { code: 1135, category: 1 /* Error */, key: "Argument expression expected." }, - Property_assignment_expected: { code: 1136, category: 1 /* Error */, key: "Property assignment expected." }, - Expression_or_comma_expected: { code: 1137, category: 1 /* Error */, key: "Expression or comma expected." }, - Parameter_declaration_expected: { code: 1138, category: 1 /* Error */, key: "Parameter declaration expected." }, - Type_parameter_declaration_expected: { code: 1139, category: 1 /* Error */, key: "Type parameter declaration expected." }, - Type_argument_expected: { code: 1140, category: 1 /* Error */, key: "Type argument expected." }, - String_literal_expected: { code: 1141, category: 1 /* Error */, key: "String literal expected." }, - Line_break_not_permitted_here: { code: 1142, category: 1 /* Error */, key: "Line break not permitted here." }, - catch_or_finally_expected: { code: 1143, category: 1 /* Error */, key: "'catch' or 'finally' expected." }, - Block_or_expected: { code: 1144, category: 1 /* Error */, key: "Block or ';' expected." }, - Modifiers_not_permitted_on_index_signature_members: { code: 1145, category: 1 /* Error */, key: "Modifiers not permitted on index signature members." }, - Declaration_expected: { code: 1146, category: 1 /* Error */, key: "Declaration expected." }, - Import_declarations_in_an_internal_module_cannot_reference_an_external_module: { code: 1147, category: 1 /* Error */, key: "Import declarations in an internal module cannot reference an external module." }, - Cannot_compile_external_modules_unless_the_module_flag_is_provided: { code: 1148, category: 1 /* Error */, key: "Cannot compile external modules unless the '--module' flag is provided." }, - Filename_0_differs_from_already_included_filename_1_only_in_casing: { code: 1149, category: 1 /* Error */, key: "Filename '{0}' differs from already included filename '{1}' only in casing" }, - new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: { code: 1150, category: 1 /* Error */, key: "'new T[]' cannot be used to create an array. Use 'new Array()' instead." }, - An_enum_member_cannot_have_a_numeric_name: { code: 1151, category: 1 /* Error */, key: "An enum member cannot have a numeric name." }, - Duplicate_identifier_0: { code: 2300, category: 1 /* Error */, key: "Duplicate identifier '{0}'." }, - Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: 1 /* Error */, key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." }, - Static_members_cannot_reference_class_type_parameters: { code: 2302, category: 1 /* Error */, key: "Static members cannot reference class type parameters." }, - Circular_definition_of_import_alias_0: { code: 2303, category: 1 /* Error */, key: "Circular definition of import alias '{0}'." }, - Cannot_find_name_0: { code: 2304, category: 1 /* Error */, key: "Cannot find name '{0}'." }, - Module_0_has_no_exported_member_1: { code: 2305, category: 1 /* Error */, key: "Module '{0}' has no exported member '{1}'." }, - File_0_is_not_an_external_module: { code: 2306, category: 1 /* Error */, key: "File '{0}' is not an external module." }, - Cannot_find_external_module_0: { code: 2307, category: 1 /* Error */, key: "Cannot find external module '{0}'." }, - A_module_cannot_have_more_than_one_export_assignment: { code: 2308, category: 1 /* Error */, key: "A module cannot have more than one export assignment." }, - An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements: { code: 2309, category: 1 /* Error */, key: "An export assignment cannot be used in a module with other exported elements." }, - Type_0_recursively_references_itself_as_a_base_type: { code: 2310, category: 1 /* Error */, key: "Type '{0}' recursively references itself as a base type." }, - A_class_may_only_extend_another_class: { code: 2311, category: 1 /* Error */, key: "A class may only extend another class." }, - An_interface_may_only_extend_a_class_or_another_interface: { code: 2312, category: 1 /* Error */, key: "An interface may only extend a class or another interface." }, - Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list: { code: 2313, category: 1 /* Error */, key: "Constraint of a type parameter cannot reference any type parameter from the same type parameter list." }, - Generic_type_0_requires_1_type_argument_s: { code: 2314, category: 1 /* Error */, key: "Generic type '{0}' requires {1} type argument(s)." }, - Type_0_is_not_generic: { code: 2315, category: 1 /* Error */, key: "Type '{0}' is not generic." }, - Global_type_0_must_be_a_class_or_interface_type: { code: 2316, category: 1 /* Error */, key: "Global type '{0}' must be a class or interface type." }, - Global_type_0_must_have_1_type_parameter_s: { code: 2317, category: 1 /* Error */, key: "Global type '{0}' must have {1} type parameter(s)." }, - Cannot_find_global_type_0: { code: 2318, category: 1 /* Error */, key: "Cannot find global type '{0}'." }, - Named_properties_0_of_types_1_and_2_are_not_identical: { code: 2319, category: 1 /* Error */, key: "Named properties '{0}' of types '{1}' and '{2}' are not identical." }, - Interface_0_cannot_simultaneously_extend_types_1_and_2_Colon: { code: 2320, category: 1 /* Error */, key: "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}':" }, - Excessive_stack_depth_comparing_types_0_and_1: { code: 2321, category: 1 /* Error */, key: "Excessive stack depth comparing types '{0}' and '{1}'." }, - Type_0_is_not_assignable_to_type_1_Colon: { code: 2322, category: 1 /* Error */, key: "Type '{0}' is not assignable to type '{1}':" }, - Type_0_is_not_assignable_to_type_1: { code: 2323, category: 1 /* Error */, key: "Type '{0}' is not assignable to type '{1}'." }, - Property_0_is_missing_in_type_1: { code: 2324, category: 1 /* Error */, key: "Property '{0}' is missing in type '{1}'." }, - Property_0_is_private_in_type_1_but_not_in_type_2: { code: 2325, category: 1 /* Error */, key: "Property '{0}' is private in type '{1}' but not in type '{2}'." }, - Types_of_property_0_are_incompatible_Colon: { code: 2326, category: 1 /* Error */, key: "Types of property '{0}' are incompatible:" }, - Property_0_is_optional_in_type_1_but_required_in_type_2: { code: 2327, category: 1 /* Error */, key: "Property '{0}' is optional in type '{1}' but required in type '{2}'." }, - Types_of_parameters_0_and_1_are_incompatible_Colon: { code: 2328, category: 1 /* Error */, key: "Types of parameters '{0}' and '{1}' are incompatible:" }, - Index_signature_is_missing_in_type_0: { code: 2329, category: 1 /* Error */, key: "Index signature is missing in type '{0}'." }, - Index_signatures_are_incompatible_Colon: { code: 2330, category: 1 /* Error */, key: "Index signatures are incompatible:" }, - this_cannot_be_referenced_in_a_module_body: { code: 2331, category: 1 /* Error */, key: "'this' cannot be referenced in a module body." }, - this_cannot_be_referenced_in_current_location: { code: 2332, category: 1 /* Error */, key: "'this' cannot be referenced in current location." }, - this_cannot_be_referenced_in_constructor_arguments: { code: 2333, category: 1 /* Error */, key: "'this' cannot be referenced in constructor arguments." }, - this_cannot_be_referenced_in_a_static_property_initializer: { code: 2334, category: 1 /* Error */, key: "'this' cannot be referenced in a static property initializer." }, - super_can_only_be_referenced_in_a_derived_class: { code: 2335, category: 1 /* Error */, key: "'super' can only be referenced in a derived class." }, - super_cannot_be_referenced_in_constructor_arguments: { code: 2336, category: 1 /* Error */, key: "'super' cannot be referenced in constructor arguments." }, - Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors: { code: 2337, category: 1 /* Error */, key: "Super calls are not permitted outside constructors or in nested functions inside constructors" }, - super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class: { code: 2338, category: 1 /* Error */, key: "'super' property access is permitted only in a constructor, member function, or member accessor of a derived class" }, - Property_0_does_not_exist_on_type_1: { code: 2339, category: 1 /* Error */, key: "Property '{0}' does not exist on type '{1}'." }, - Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword: { code: 2340, category: 1 /* Error */, key: "Only public and protected methods of the base class are accessible via the 'super' keyword" }, - Property_0_is_private_and_only_accessible_within_class_1: { code: 2341, category: 1 /* Error */, key: "Property '{0}' is private and only accessible within class '{1}'." }, - An_index_expression_argument_must_be_of_type_string_number_or_any: { code: 2342, category: 1 /* Error */, key: "An index expression argument must be of type 'string', 'number', or 'any'." }, - Type_0_does_not_satisfy_the_constraint_1_Colon: { code: 2343, category: 1 /* Error */, key: "Type '{0}' does not satisfy the constraint '{1}':" }, - Type_0_does_not_satisfy_the_constraint_1: { code: 2344, category: 1 /* Error */, key: "Type '{0}' does not satisfy the constraint '{1}'." }, - Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: { code: 2345, category: 1 /* Error */, key: "Argument of type '{0}' is not assignable to parameter of type '{1}'." }, - Supplied_parameters_do_not_match_any_signature_of_call_target: { code: 2346, category: 1 /* Error */, key: "Supplied parameters do not match any signature of call target." }, - Untyped_function_calls_may_not_accept_type_arguments: { code: 2347, category: 1 /* Error */, key: "Untyped function calls may not accept type arguments." }, - Value_of_type_0_is_not_callable_Did_you_mean_to_include_new: { code: 2348, category: 1 /* Error */, key: "Value of type '{0}' is not callable. Did you mean to include 'new'?" }, - Cannot_invoke_an_expression_whose_type_lacks_a_call_signature: { code: 2349, category: 1 /* Error */, key: "Cannot invoke an expression whose type lacks a call signature." }, - Only_a_void_function_can_be_called_with_the_new_keyword: { code: 2350, category: 1 /* Error */, key: "Only a void function can be called with the 'new' keyword." }, - Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature: { code: 2351, category: 1 /* Error */, key: "Cannot use 'new' with an expression whose type lacks a call or construct signature." }, - Neither_type_0_nor_type_1_is_assignable_to_the_other: { code: 2352, category: 1 /* Error */, key: "Neither type '{0}' nor type '{1}' is assignable to the other." }, - Neither_type_0_nor_type_1_is_assignable_to_the_other_Colon: { code: 2353, category: 1 /* Error */, key: "Neither type '{0}' nor type '{1}' is assignable to the other:" }, - No_best_common_type_exists_among_return_expressions: { code: 2354, category: 1 /* Error */, key: "No best common type exists among return expressions." }, - A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2355, category: 1 /* Error */, key: "A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement." }, - An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type: { code: 2356, category: 1 /* Error */, key: "An arithmetic operand must be of type 'any', 'number' or an enum type." }, - The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer: { code: 2357, category: 1 /* Error */, key: "The operand of an increment or decrement operator must be a variable, property or indexer." }, - The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2358, category: 1 /* Error */, key: "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter." }, - The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: { code: 2359, category: 1 /* Error */, key: "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type." }, - The_left_hand_side_of_an_in_expression_must_be_of_types_any_string_or_number: { code: 2360, category: 1 /* Error */, key: "The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'." }, - The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2361, category: 1 /* Error */, key: "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter" }, - The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2362, category: 1 /* Error */, key: "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, - The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2363, category: 1 /* Error */, key: "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, - Invalid_left_hand_side_of_assignment_expression: { code: 2364, category: 1 /* Error */, key: "Invalid left-hand side of assignment expression." }, - Operator_0_cannot_be_applied_to_types_1_and_2: { code: 2365, category: 1 /* Error */, key: "Operator '{0}' cannot be applied to types '{1}' and '{2}'." }, - No_best_common_type_exists_between_0_1_and_2: { code: 2366, category: 1 /* Error */, key: "No best common type exists between '{0}', '{1}', and '{2}'." }, - No_best_common_type_exists_between_0_and_1: { code: 2367, category: 1 /* Error */, key: "No best common type exists between '{0}' and '{1}'." }, - Type_parameter_name_cannot_be_0: { code: 2368, category: 1 /* Error */, key: "Type parameter name cannot be '{0}'" }, - A_parameter_property_is_only_allowed_in_a_constructor_implementation: { code: 2369, category: 1 /* Error */, key: "A parameter property is only allowed in a constructor implementation." }, - A_rest_parameter_must_be_of_an_array_type: { code: 2370, category: 1 /* Error */, key: "A rest parameter must be of an array type." }, - A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation: { code: 2371, category: 1 /* Error */, key: "A parameter initializer is only allowed in a function or constructor implementation." }, - Parameter_0_cannot_be_referenced_in_its_initializer: { code: 2372, category: 1 /* Error */, key: "Parameter '{0}' cannot be referenced in its initializer." }, - Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it: { code: 2373, category: 1 /* Error */, key: "Initializer of parameter '{0}' cannot reference identifier '{1}' declared after it." }, - Duplicate_string_index_signature: { code: 2374, category: 1 /* Error */, key: "Duplicate string index signature." }, - Duplicate_number_index_signature: { code: 2375, category: 1 /* Error */, key: "Duplicate number index signature." }, - A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties: { code: 2376, category: 1 /* Error */, key: "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties." }, - Constructors_for_derived_classes_must_contain_a_super_call: { code: 2377, category: 1 /* Error */, key: "Constructors for derived classes must contain a 'super' call." }, - A_get_accessor_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2378, category: 1 /* Error */, key: "A 'get' accessor must return a value or consist of a single 'throw' statement." }, - Getter_and_setter_accessors_do_not_agree_in_visibility: { code: 2379, category: 1 /* Error */, key: "Getter and setter accessors do not agree in visibility." }, - get_and_set_accessor_must_have_the_same_type: { code: 2380, category: 1 /* Error */, key: "'get' and 'set' accessor must have the same type." }, - A_signature_with_an_implementation_cannot_use_a_string_literal_type: { code: 2381, category: 1 /* Error */, key: "A signature with an implementation cannot use a string literal type." }, - Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature: { code: 2382, category: 1 /* Error */, key: "Specialized overload signature is not assignable to any non-specialized signature." }, - Overload_signatures_must_all_be_exported_or_not_exported: { code: 2383, category: 1 /* Error */, key: "Overload signatures must all be exported or not exported." }, - Overload_signatures_must_all_be_ambient_or_non_ambient: { code: 2384, category: 1 /* Error */, key: "Overload signatures must all be ambient or non-ambient." }, - Overload_signatures_must_all_be_public_private_or_protected: { code: 2385, category: 1 /* Error */, key: "Overload signatures must all be public, private or protected." }, - Overload_signatures_must_all_be_optional_or_required: { code: 2386, category: 1 /* Error */, key: "Overload signatures must all be optional or required." }, - Function_overload_must_be_static: { code: 2387, category: 1 /* Error */, key: "Function overload must be static." }, - Function_overload_must_not_be_static: { code: 2388, category: 1 /* Error */, key: "Function overload must not be static." }, - Function_implementation_name_must_be_0: { code: 2389, category: 1 /* Error */, key: "Function implementation name must be '{0}'." }, - Constructor_implementation_is_missing: { code: 2390, category: 1 /* Error */, key: "Constructor implementation is missing." }, - Function_implementation_is_missing_or_not_immediately_following_the_declaration: { code: 2391, category: 1 /* Error */, key: "Function implementation is missing or not immediately following the declaration." }, - Multiple_constructor_implementations_are_not_allowed: { code: 2392, category: 1 /* Error */, key: "Multiple constructor implementations are not allowed." }, - Duplicate_function_implementation: { code: 2393, category: 1 /* Error */, key: "Duplicate function implementation." }, - Overload_signature_is_not_compatible_with_function_implementation: { code: 2394, category: 1 /* Error */, key: "Overload signature is not compatible with function implementation." }, - Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local: { code: 2395, category: 1 /* Error */, key: "Individual declarations in merged declaration {0} must be all exported or all local." }, - Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters: { code: 2396, category: 1 /* Error */, key: "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters." }, - Duplicate_identifier_i_Compiler_uses_i_to_initialize_rest_parameter: { code: 2397, category: 1 /* Error */, key: "Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter." }, - Expression_resolves_to_variable_declaration_i_that_compiler_uses_to_initialize_rest_parameter: { code: 2398, category: 1 /* Error */, key: "Expression resolves to variable declaration '_i' that compiler uses to initialize rest parameter." }, - Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference: { code: 2399, category: 1 /* Error */, key: "Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference." }, - Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference: { code: 2400, category: 1 /* Error */, key: "Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference." }, - Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference: { code: 2401, category: 1 /* Error */, key: "Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference." }, - Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference: { code: 2402, category: 1 /* Error */, key: "Expression resolves to '_super' that compiler uses to capture base class reference." }, - Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2: { code: 2403, category: 1 /* Error */, key: "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'." }, - The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation: { code: 2404, category: 1 /* Error */, key: "The left-hand side of a 'for...in' statement cannot use a type annotation." }, - The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any: { code: 2405, category: 1 /* Error */, key: "The left-hand side of a 'for...in' statement must be of type 'string' or 'any'." }, - Invalid_left_hand_side_in_for_in_statement: { code: 2406, category: 1 /* Error */, key: "Invalid left-hand side in 'for...in' statement." }, - The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2407, category: 1 /* Error */, key: "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter." }, - Setters_cannot_return_a_value: { code: 2408, category: 1 /* Error */, key: "Setters cannot return a value." }, - Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: { code: 2409, category: 1 /* Error */, key: "Return type of constructor signature must be assignable to the instance type of the class" }, - All_symbols_within_a_with_block_will_be_resolved_to_any: { code: 2410, category: 1 /* Error */, key: "All symbols within a 'with' block will be resolved to 'any'." }, - Property_0_of_type_1_is_not_assignable_to_string_index_type_2: { code: 2411, category: 1 /* Error */, key: "Property '{0}' of type '{1}' is not assignable to string index type '{2}'." }, - Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2: { code: 2412, category: 1 /* Error */, key: "Property '{0}' of type '{1}' is not assignable to numeric index type '{2}'." }, - Numeric_index_type_0_is_not_assignable_to_string_index_type_1: { code: 2413, category: 1 /* Error */, key: "Numeric index type '{0}' is not assignable to string index type '{1}'." }, - Class_name_cannot_be_0: { code: 2414, category: 1 /* Error */, key: "Class name cannot be '{0}'" }, - Class_0_incorrectly_extends_base_class_1: { code: 2415, category: 1 /* Error */, key: "Class '{0}' incorrectly extends base class '{1}'." }, - Class_0_incorrectly_extends_base_class_1_Colon: { code: 2416, category: 1 /* Error */, key: "Class '{0}' incorrectly extends base class '{1}':" }, - Class_static_side_0_incorrectly_extends_base_class_static_side_1: { code: 2417, category: 1 /* Error */, key: "Class static side '{0}' incorrectly extends base class static side '{1}'." }, - Class_static_side_0_incorrectly_extends_base_class_static_side_1_Colon: { code: 2418, category: 1 /* Error */, key: "Class static side '{0}' incorrectly extends base class static side '{1}':" }, - Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0: { code: 2419, category: 1 /* Error */, key: "Type name '{0}' in extends clause does not reference constructor function for '{0}'." }, - Class_0_incorrectly_implements_interface_1: { code: 2420, category: 1 /* Error */, key: "Class '{0}' incorrectly implements interface '{1}'." }, - Class_0_incorrectly_implements_interface_1_Colon: { code: 2421, category: 1 /* Error */, key: "Class '{0}' incorrectly implements interface '{1}':" }, - A_class_may_only_implement_another_class_or_interface: { code: 2422, category: 1 /* Error */, key: "A class may only implement another class or interface." }, - Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: { code: 2423, category: 1 /* Error */, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor." }, - Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: { code: 2424, category: 1 /* Error */, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property." }, - Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2425, category: 1 /* Error */, key: "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function." }, - Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2426, category: 1 /* Error */, key: "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function." }, - Interface_name_cannot_be_0: { code: 2427, category: 1 /* Error */, key: "Interface name cannot be '{0}'" }, - All_declarations_of_an_interface_must_have_identical_type_parameters: { code: 2428, category: 1 /* Error */, key: "All declarations of an interface must have identical type parameters." }, - Interface_0_incorrectly_extends_interface_1_Colon: { code: 2429, category: 1 /* Error */, key: "Interface '{0}' incorrectly extends interface '{1}':" }, - Interface_0_incorrectly_extends_interface_1: { code: 2430, category: 1 /* Error */, key: "Interface '{0}' incorrectly extends interface '{1}'." }, - Enum_name_cannot_be_0: { code: 2431, category: 1 /* Error */, key: "Enum name cannot be '{0}'" }, - In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element: { code: 2432, category: 1 /* Error */, key: "In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element." }, - A_module_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged: { code: 2433, category: 1 /* Error */, key: "A module declaration cannot be in a different file from a class or function with which it is merged" }, - A_module_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged: { code: 2434, category: 1 /* Error */, key: "A module declaration cannot be located prior to a class or function with which it is merged" }, - Ambient_external_modules_cannot_be_nested_in_other_modules: { code: 2435, category: 1 /* Error */, key: "Ambient external modules cannot be nested in other modules." }, - Ambient_external_module_declaration_cannot_specify_relative_module_name: { code: 2436, category: 1 /* Error */, key: "Ambient external module declaration cannot specify relative module name." }, - Module_0_is_hidden_by_a_local_declaration_with_the_same_name: { code: 2437, category: 1 /* Error */, key: "Module '{0}' is hidden by a local declaration with the same name" }, - Import_name_cannot_be_0: { code: 2438, category: 1 /* Error */, key: "Import name cannot be '{0}'" }, - Import_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name: { code: 2439, category: 1 /* Error */, key: "Import declaration in an ambient external module declaration cannot reference external module through relative external module name." }, - Import_declaration_conflicts_with_local_declaration_of_0: { code: 2440, category: 1 /* Error */, key: "Import declaration conflicts with local declaration of '{0}'" }, - Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module: { code: 2441, category: 1 /* Error */, key: "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of an external module." }, - Types_have_separate_declarations_of_a_private_property_0: { code: 2442, category: 1 /* Error */, key: "Types have separate declarations of a private property '{0}'." }, - Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2: { code: 2443, category: 1 /* Error */, key: "Property '{0}' is protected but type '{1}' is not a class derived from '{2}'." }, - Property_0_is_protected_in_type_1_but_public_in_type_2: { code: 2444, category: 1 /* Error */, key: "Property '{0}' is protected in type '{1}' but public in type '{2}'." }, - Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses: { code: 2445, category: 1 /* Error */, key: "Property '{0}' is protected and only accessible within class '{1}' and its subclasses." }, - Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1: { code: 2446, category: 1 /* Error */, key: "Property '{0}' is protected and only accessible through an instance of class '{1}'." }, - The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead: { code: 2447, category: 1 /* Error */, key: "The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead." }, - Import_declaration_0_is_using_private_name_1: { code: 4000, category: 1 /* Error */, key: "Import declaration '{0}' is using private name '{1}'." }, - Type_parameter_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4001, category: 1 /* Error */, key: "Type parameter '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: 1 /* Error */, key: "Type parameter '{0}' of exported class has or is using private name '{1}'." }, - Type_parameter_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4003, category: 1 /* Error */, key: "Type parameter '{0}' of exported interface has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4004, category: 1 /* Error */, key: "Type parameter '{0}' of exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4005, category: 1 /* Error */, key: "Type parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4006, category: 1 /* Error */, key: "Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4007, category: 1 /* Error */, key: "Type parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4008, category: 1 /* Error */, key: "Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4009, category: 1 /* Error */, key: "Type parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { code: 4010, category: 1 /* Error */, key: "Type parameter '{0}' of public static method from exported class has or is using private name '{1}'." }, - Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4011, category: 1 /* Error */, key: "Type parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { code: 4012, category: 1 /* Error */, key: "Type parameter '{0}' of public method from exported class has or is using private name '{1}'." }, - Type_parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4013, category: 1 /* Error */, key: "Type parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 4014, category: 1 /* Error */, key: "Type parameter '{0}' of method from exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: { code: 4015, category: 1 /* Error */, key: "Type parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'." }, - Type_parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4016, category: 1 /* Error */, key: "Type parameter '{0}' of exported function has or is using private name '{1}'." }, - Implements_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2: { code: 4017, category: 1 /* Error */, key: "Implements clause of exported class '{0}' has or is using name '{1}' from private module '{2}'." }, - Extends_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2: { code: 4018, category: 1 /* Error */, key: "Extends clause of exported class '{0}' has or is using name '{1}' from private module '{2}'." }, - Implements_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4019, category: 1 /* Error */, key: "Implements clause of exported class '{0}' has or is using private name '{1}'." }, - Extends_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4020, category: 1 /* Error */, key: "Extends clause of exported class '{0}' has or is using private name '{1}'." }, - Extends_clause_of_exported_interface_0_has_or_is_using_name_1_from_private_module_2: { code: 4021, category: 1 /* Error */, key: "Extends clause of exported interface '{0}' has or is using name '{1}' from private module '{2}'." }, - Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1: { code: 4022, category: 1 /* Error */, key: "Extends clause of exported interface '{0}' has or is using private name '{1}'." }, - Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4023, category: 1 /* Error */, key: "Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named." }, - Exported_variable_0_has_or_is_using_name_1_from_private_module_2: { code: 4024, category: 1 /* Error */, key: "Exported variable '{0}' has or is using name '{1}' from private module '{2}'." }, - Exported_variable_0_has_or_is_using_private_name_1: { code: 4025, category: 1 /* Error */, key: "Exported variable '{0}' has or is using private name '{1}'." }, - Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4026, category: 1 /* Error */, key: "Public static property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4027, category: 1 /* Error */, key: "Public static property '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, - Public_static_property_0_of_exported_class_has_or_is_using_private_name_1: { code: 4028, category: 1 /* Error */, key: "Public static property '{0}' of exported class has or is using private name '{1}'." }, - Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4029, category: 1 /* Error */, key: "Public property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4030, category: 1 /* Error */, key: "Public property '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, - Public_property_0_of_exported_class_has_or_is_using_private_name_1: { code: 4031, category: 1 /* Error */, key: "Public property '{0}' of exported class has or is using private name '{1}'." }, - Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4032, category: 1 /* Error */, key: "Property '{0}' of exported interface has or is using name '{1}' from private module '{2}'." }, - Property_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4033, category: 1 /* Error */, key: "Property '{0}' of exported interface has or is using private name '{1}'." }, - Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4034, category: 1 /* Error */, key: "Parameter '{0}' of public static property setter from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1: { code: 4035, category: 1 /* Error */, key: "Parameter '{0}' of public static property setter from exported class has or is using private name '{1}'." }, - Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4036, category: 1 /* Error */, key: "Parameter '{0}' of public property setter from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_name_1: { code: 4037, category: 1 /* Error */, key: "Parameter '{0}' of public property setter from exported class has or is using private name '{1}'." }, - Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4038, category: 1 /* Error */, key: "Return type of public static property getter from exported class has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4039, category: 1 /* Error */, key: "Return type of public static property getter from exported class has or is using name '{0}' from private module '{1}'." }, - Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_name_0: { code: 4040, category: 1 /* Error */, key: "Return type of public static property getter from exported class has or is using private name '{0}'." }, - Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4041, category: 1 /* Error */, key: "Return type of public property getter from exported class has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4042, category: 1 /* Error */, key: "Return type of public property getter from exported class has or is using name '{0}' from private module '{1}'." }, - Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_name_0: { code: 4043, category: 1 /* Error */, key: "Return type of public property getter from exported class has or is using private name '{0}'." }, - Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4044, category: 1 /* Error */, key: "Return type of constructor signature from exported interface has or is using name '{0}' from private module '{1}'." }, - Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4045, category: 1 /* Error */, key: "Return type of constructor signature from exported interface has or is using private name '{0}'." }, - Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4046, category: 1 /* Error */, key: "Return type of call signature from exported interface has or is using name '{0}' from private module '{1}'." }, - Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4047, category: 1 /* Error */, key: "Return type of call signature from exported interface has or is using private name '{0}'." }, - Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4048, category: 1 /* Error */, key: "Return type of index signature from exported interface has or is using name '{0}' from private module '{1}'." }, - Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4049, category: 1 /* Error */, key: "Return type of index signature from exported interface has or is using private name '{0}'." }, - Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4050, category: 1 /* Error */, key: "Return type of public static method from exported class has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4051, category: 1 /* Error */, key: "Return type of public static method from exported class has or is using name '{0}' from private module '{1}'." }, - Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0: { code: 4052, category: 1 /* Error */, key: "Return type of public static method from exported class has or is using private name '{0}'." }, - Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4053, category: 1 /* Error */, key: "Return type of public method from exported class has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4054, category: 1 /* Error */, key: "Return type of public method from exported class has or is using name '{0}' from private module '{1}'." }, - Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0: { code: 4055, category: 1 /* Error */, key: "Return type of public method from exported class has or is using private name '{0}'." }, - Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4056, category: 1 /* Error */, key: "Return type of method from exported interface has or is using name '{0}' from private module '{1}'." }, - Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0: { code: 4057, category: 1 /* Error */, key: "Return type of method from exported interface has or is using private name '{0}'." }, - Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4058, category: 1 /* Error */, key: "Return type of exported function has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1: { code: 4059, category: 1 /* Error */, key: "Return type of exported function has or is using name '{0}' from private module '{1}'." }, - Return_type_of_exported_function_has_or_is_using_private_name_0: { code: 4060, category: 1 /* Error */, key: "Return type of exported function has or is using private name '{0}'." }, - Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4061, category: 1 /* Error */, key: "Parameter '{0}' of constructor from exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4062, category: 1 /* Error */, key: "Parameter '{0}' of constructor from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1: { code: 4063, category: 1 /* Error */, key: "Parameter '{0}' of constructor from exported class has or is using private name '{1}'." }, - Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4064, category: 1 /* Error */, key: "Parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4065, category: 1 /* Error */, key: "Parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." }, - Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4066, category: 1 /* Error */, key: "Parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4067, category: 1 /* Error */, key: "Parameter '{0}' of call signature from exported interface has or is using private name '{1}'." }, - Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4068, category: 1 /* Error */, key: "Parameter '{0}' of public static method from exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4069, category: 1 /* Error */, key: "Parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { code: 4070, category: 1 /* Error */, key: "Parameter '{0}' of public static method from exported class has or is using private name '{1}'." }, - Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4071, category: 1 /* Error */, key: "Parameter '{0}' of public method from exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4072, category: 1 /* Error */, key: "Parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { code: 4073, category: 1 /* Error */, key: "Parameter '{0}' of public method from exported class has or is using private name '{1}'." }, - Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4074, category: 1 /* Error */, key: "Parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 4075, category: 1 /* Error */, key: "Parameter '{0}' of method from exported interface has or is using private name '{1}'." }, - Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4076, category: 1 /* Error */, key: "Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named." }, - Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: { code: 4077, category: 1 /* Error */, key: "Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4078, category: 1 /* Error */, key: "Parameter '{0}' of exported function has or is using private name '{1}'." }, - The_current_host_does_not_support_the_0_option: { code: 5001, category: 1 /* Error */, key: "The current host does not support the '{0}' option." }, - Cannot_find_the_common_subdirectory_path_for_the_input_files: { code: 5009, category: 1 /* Error */, key: "Cannot find the common subdirectory path for the input files." }, - Cannot_read_file_0_Colon_1: { code: 5012, category: 1 /* Error */, key: "Cannot read file '{0}': {1}" }, - Unsupported_file_encoding: { code: 5013, category: 1 /* Error */, key: "Unsupported file encoding." }, - Unknown_compiler_option_0: { code: 5023, category: 1 /* Error */, key: "Unknown compiler option '{0}'." }, - Could_not_write_file_0_Colon_1: { code: 5033, category: 1 /* Error */, key: "Could not write file '{0}': {1}" }, - Option_mapRoot_cannot_be_specified_without_specifying_sourcemap_option: { code: 5038, category: 1 /* Error */, key: "Option mapRoot cannot be specified without specifying sourcemap option." }, - Option_sourceRoot_cannot_be_specified_without_specifying_sourcemap_option: { code: 5039, category: 1 /* Error */, key: "Option sourceRoot cannot be specified without specifying sourcemap option." }, - Concatenate_and_emit_output_to_single_file: { code: 6001, category: 2 /* Message */, key: "Concatenate and emit output to single file." }, - Generates_corresponding_d_ts_file: { code: 6002, category: 2 /* Message */, key: "Generates corresponding '.d.ts' file." }, - Specifies_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations: { code: 6003, category: 2 /* Message */, key: "Specifies the location where debugger should locate map files instead of generated locations." }, - Specifies_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations: { code: 6004, category: 2 /* Message */, key: "Specifies the location where debugger should locate TypeScript files instead of source locations." }, - Watch_input_files: { code: 6005, category: 2 /* Message */, key: "Watch input files." }, - Redirect_output_structure_to_the_directory: { code: 6006, category: 2 /* Message */, key: "Redirect output structure to the directory." }, - Do_not_emit_comments_to_output: { code: 6009, category: 2 /* Message */, key: "Do not emit comments to output." }, - Specify_ECMAScript_target_version_Colon_ES3_default_or_ES5: { code: 6015, category: 2 /* Message */, key: "Specify ECMAScript target version: 'ES3' (default), or 'ES5'" }, - Specify_module_code_generation_Colon_commonjs_or_amd: { code: 6016, category: 2 /* Message */, key: "Specify module code generation: 'commonjs' or 'amd'" }, - Print_this_message: { code: 6017, category: 2 /* Message */, key: "Print this message." }, - Print_the_compiler_s_version: { code: 6019, category: 2 /* Message */, key: "Print the compiler's version." }, - Syntax_Colon_0: { code: 6023, category: 2 /* Message */, key: "Syntax: {0}" }, - options: { code: 6024, category: 2 /* Message */, key: "options" }, - file: { code: 6025, category: 2 /* Message */, key: "file" }, - Examples_Colon_0: { code: 6026, category: 2 /* Message */, key: "Examples: {0}" }, - Options_Colon: { code: 6027, category: 2 /* Message */, key: "Options:" }, - Version_0: { code: 6029, category: 2 /* Message */, key: "Version {0}" }, - Insert_command_line_options_and_files_from_a_file: { code: 6030, category: 2 /* Message */, key: "Insert command line options and files from a file." }, - File_change_detected_Compiling: { code: 6032, category: 2 /* Message */, key: "File change detected. Compiling..." }, - KIND: { code: 6034, category: 2 /* Message */, key: "KIND" }, - FILE: { code: 6035, category: 2 /* Message */, key: "FILE" }, - VERSION: { code: 6036, category: 2 /* Message */, key: "VERSION" }, - LOCATION: { code: 6037, category: 2 /* Message */, key: "LOCATION" }, - DIRECTORY: { code: 6038, category: 2 /* Message */, key: "DIRECTORY" }, - Compilation_complete_Watching_for_file_changes: { code: 6042, category: 2 /* Message */, key: "Compilation complete. Watching for file changes." }, - Generates_corresponding_map_file: { code: 6043, category: 2 /* Message */, key: "Generates corresponding '.map' file." }, - Compiler_option_0_expects_an_argument: { code: 6044, category: 1 /* Error */, key: "Compiler option '{0}' expects an argument." }, - Unterminated_quoted_string_in_response_file_0: { code: 6045, category: 1 /* Error */, key: "Unterminated quoted string in response file '{0}'." }, - Argument_for_module_option_must_be_commonjs_or_amd: { code: 6046, category: 1 /* Error */, key: "Argument for '--module' option must be 'commonjs' or 'amd'." }, - Argument_for_target_option_must_be_es3_or_es5: { code: 6047, category: 1 /* Error */, key: "Argument for '--target' option must be 'es3' or 'es5'." }, - Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: { code: 6048, category: 1 /* Error */, key: "Locale must be of the form or -. For example '{0}' or '{1}'." }, - Unsupported_locale_0: { code: 6049, category: 1 /* Error */, key: "Unsupported locale '{0}'." }, - Unable_to_open_file_0: { code: 6050, category: 1 /* Error */, key: "Unable to open file '{0}'." }, - Corrupted_locale_file_0: { code: 6051, category: 1 /* Error */, key: "Corrupted locale file {0}." }, - Warn_on_expressions_and_declarations_with_an_implied_any_type: { code: 6052, category: 2 /* Message */, key: "Warn on expressions and declarations with an implied 'any' type." }, - File_0_not_found: { code: 6053, category: 1 /* Error */, key: "File '{0}' not found." }, - File_0_must_have_extension_ts_or_d_ts: { code: 6054, category: 1 /* Error */, key: "File '{0}' must have extension '.ts' or '.d.ts'." }, - Variable_0_implicitly_has_an_1_type: { code: 7005, category: 1 /* Error */, key: "Variable '{0}' implicitly has an '{1}' type." }, - Parameter_0_implicitly_has_an_1_type: { code: 7006, category: 1 /* Error */, key: "Parameter '{0}' implicitly has an '{1}' type." }, - Member_0_implicitly_has_an_1_type: { code: 7008, category: 1 /* Error */, key: "Member '{0}' implicitly has an '{1}' type." }, - new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type: { code: 7009, category: 1 /* Error */, key: "'new' expression, whose target lacks a construct signature, implicitly has an 'any' type." }, - _0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type: { code: 7010, category: 1 /* Error */, key: "'{0}', which lacks return-type annotation, implicitly has an '{1}' return type." }, - Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: { code: 7011, category: 1 /* Error */, key: "Function expression, which lacks return-type annotation, implicitly has an '{0}' return type." }, - Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7013, category: 1 /* Error */, key: "Construct signature, which lacks return-type annotation, implicitly has an 'any' return type." }, - Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_type_annotation: { code: 7016, category: 1 /* Error */, key: "Property '{0}' implicitly has type 'any', because its 'set' accessor lacks a type annotation." }, - Index_signature_of_object_type_implicitly_has_an_any_type: { code: 7017, category: 1 /* Error */, key: "Index signature of object type implicitly has an 'any' type." }, - Object_literal_s_property_0_implicitly_has_an_1_type: { code: 7018, category: 1 /* Error */, key: "Object literal's property '{0}' implicitly has an '{1}' type." }, - Rest_parameter_0_implicitly_has_an_any_type: { code: 7019, category: 1 /* Error */, key: "Rest parameter '{0}' implicitly has an 'any[]' type." }, - Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7020, category: 1 /* Error */, key: "Call signature, which lacks return-type annotation, implicitly has an 'any' return type." }, - _0_implicitly_has_type_any_because_it_is_referenced_directly_or_indirectly_in_its_own_type_annotation: { code: 7021, category: 1 /* Error */, key: "'{0}' implicitly has type 'any' because it is referenced directly or indirectly in its own type annotation." }, - _0_implicitly_has_type_any_because_it_is_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer: { code: 7022, category: 1 /* Error */, key: "'{0}' implicitly has type 'any' because it is does not have a type annotation and is referenced directly or indirectly in its own initializer." }, - _0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions: { code: 7023, category: 1 /* Error */, key: "'{0}' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions." }, - Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions: { code: 7024, category: 1 /* Error */, key: "Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions." }, - You_cannot_rename_this_element: { code: 8000, category: 1 /* Error */, key: "You cannot rename this element." } - }; -})(ts || (ts = {})); -var ts; -(function (ts) { - var textToToken = { - "any": 105 /* AnyKeyword */, - "boolean": 106 /* BooleanKeyword */, - "break": 60 /* BreakKeyword */, - "case": 61 /* CaseKeyword */, - "catch": 62 /* CatchKeyword */, - "class": 63 /* ClassKeyword */, - "continue": 65 /* ContinueKeyword */, - "const": 64 /* ConstKeyword */, - "constructor": 107 /* ConstructorKeyword */, - "debugger": 66 /* DebuggerKeyword */, - "declare": 108 /* DeclareKeyword */, - "default": 67 /* DefaultKeyword */, - "delete": 68 /* DeleteKeyword */, - "do": 69 /* DoKeyword */, - "else": 70 /* ElseKeyword */, - "enum": 71 /* EnumKeyword */, - "export": 72 /* ExportKeyword */, - "extends": 73 /* ExtendsKeyword */, - "false": 74 /* FalseKeyword */, - "finally": 75 /* FinallyKeyword */, - "for": 76 /* ForKeyword */, - "function": 77 /* FunctionKeyword */, - "get": 109 /* GetKeyword */, - "if": 78 /* IfKeyword */, - "implements": 96 /* ImplementsKeyword */, - "import": 79 /* ImportKeyword */, - "in": 80 /* InKeyword */, - "instanceof": 81 /* InstanceOfKeyword */, - "interface": 97 /* InterfaceKeyword */, - "let": 98 /* LetKeyword */, - "module": 110 /* ModuleKeyword */, - "new": 82 /* NewKeyword */, - "null": 83 /* NullKeyword */, - "number": 112 /* NumberKeyword */, - "package": 99 /* PackageKeyword */, - "private": 100 /* PrivateKeyword */, - "protected": 101 /* ProtectedKeyword */, - "public": 102 /* PublicKeyword */, - "require": 111 /* RequireKeyword */, - "return": 84 /* ReturnKeyword */, - "set": 113 /* SetKeyword */, - "static": 103 /* StaticKeyword */, - "string": 114 /* StringKeyword */, - "super": 85 /* SuperKeyword */, - "switch": 86 /* SwitchKeyword */, - "this": 87 /* ThisKeyword */, - "throw": 88 /* ThrowKeyword */, - "true": 89 /* TrueKeyword */, - "try": 90 /* TryKeyword */, - "typeof": 91 /* TypeOfKeyword */, - "var": 92 /* VarKeyword */, - "void": 93 /* VoidKeyword */, - "while": 94 /* WhileKeyword */, - "with": 95 /* WithKeyword */, - "yield": 104 /* YieldKeyword */, - "{": 9 /* OpenBraceToken */, - "}": 10 /* CloseBraceToken */, - "(": 11 /* OpenParenToken */, - ")": 12 /* CloseParenToken */, - "[": 13 /* OpenBracketToken */, - "]": 14 /* CloseBracketToken */, - ".": 15 /* DotToken */, - "...": 16 /* DotDotDotToken */, - ";": 17 /* SemicolonToken */, - ",": 18 /* CommaToken */, - "<": 19 /* LessThanToken */, - ">": 20 /* GreaterThanToken */, - "<=": 21 /* LessThanEqualsToken */, - ">=": 22 /* GreaterThanEqualsToken */, - "==": 23 /* EqualsEqualsToken */, - "!=": 24 /* ExclamationEqualsToken */, - "===": 25 /* EqualsEqualsEqualsToken */, - "!==": 26 /* ExclamationEqualsEqualsToken */, - "=>": 27 /* EqualsGreaterThanToken */, - "+": 28 /* PlusToken */, - "-": 29 /* MinusToken */, - "*": 30 /* AsteriskToken */, - "/": 31 /* SlashToken */, - "%": 32 /* PercentToken */, - "++": 33 /* PlusPlusToken */, - "--": 34 /* MinusMinusToken */, - "<<": 35 /* LessThanLessThanToken */, - ">>": 36 /* GreaterThanGreaterThanToken */, - ">>>": 37 /* GreaterThanGreaterThanGreaterThanToken */, - "&": 38 /* AmpersandToken */, - "|": 39 /* BarToken */, - "^": 40 /* CaretToken */, - "!": 41 /* ExclamationToken */, - "~": 42 /* TildeToken */, - "&&": 43 /* AmpersandAmpersandToken */, - "||": 44 /* BarBarToken */, - "?": 45 /* QuestionToken */, - ":": 46 /* ColonToken */, - "=": 47 /* EqualsToken */, - "+=": 48 /* PlusEqualsToken */, - "-=": 49 /* MinusEqualsToken */, - "*=": 50 /* AsteriskEqualsToken */, - "/=": 51 /* SlashEqualsToken */, - "%=": 52 /* PercentEqualsToken */, - "<<=": 53 /* LessThanLessThanEqualsToken */, - ">>=": 54 /* GreaterThanGreaterThanEqualsToken */, - ">>>=": 55 /* GreaterThanGreaterThanGreaterThanEqualsToken */, - "&=": 56 /* AmpersandEqualsToken */, - "|=": 57 /* BarEqualsToken */, - "^=": 58 /* CaretEqualsToken */ - }; - var unicodeES3IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1610, 1649, 1747, 1749, 1749, 1765, 1766, 1786, 1788, 1808, 1808, 1810, 1836, 1920, 1957, 2309, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2784, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3294, 3294, 3296, 3297, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3424, 3425, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3805, 3840, 3840, 3904, 3911, 3913, 3946, 3976, 3979, 4096, 4129, 4131, 4135, 4137, 4138, 4176, 4181, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6067, 6176, 6263, 6272, 6312, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8319, 8319, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12346, 12353, 12436, 12445, 12446, 12449, 12538, 12540, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65138, 65140, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; - var unicodeES3IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 768, 846, 864, 866, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1155, 1158, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1441, 1443, 1465, 1467, 1469, 1471, 1471, 1473, 1474, 1476, 1476, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1621, 1632, 1641, 1648, 1747, 1749, 1756, 1759, 1768, 1770, 1773, 1776, 1788, 1808, 1836, 1840, 1866, 1920, 1968, 2305, 2307, 2309, 2361, 2364, 2381, 2384, 2388, 2392, 2403, 2406, 2415, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2492, 2494, 2500, 2503, 2504, 2507, 2509, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2562, 2562, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2649, 2652, 2654, 2654, 2662, 2676, 2689, 2691, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2784, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2876, 2883, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2913, 2918, 2927, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3031, 3031, 3047, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3134, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3168, 3169, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3262, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3297, 3302, 3311, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3390, 3395, 3398, 3400, 3402, 3405, 3415, 3415, 3424, 3425, 3430, 3439, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3805, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3946, 3953, 3972, 3974, 3979, 3984, 3991, 3993, 4028, 4038, 4038, 4096, 4129, 4131, 4135, 4137, 4138, 4140, 4146, 4150, 4153, 4160, 4169, 4176, 4185, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 4969, 4977, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6099, 6112, 6121, 6160, 6169, 6176, 6263, 6272, 6313, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8319, 8319, 8400, 8412, 8417, 8417, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12346, 12353, 12436, 12441, 12442, 12445, 12446, 12449, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65056, 65059, 65075, 65076, 65101, 65103, 65136, 65138, 65140, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65381, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; - var unicodeES5IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2208, 2208, 2210, 2220, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2423, 2425, 2431, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6000, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6428, 6480, 6509, 6512, 6516, 6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409, 7413, 7414, 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43648, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; - var unicodeES5IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1520, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2048, 2093, 2112, 2139, 2208, 2208, 2210, 2220, 2276, 2302, 2304, 2403, 2406, 2415, 2417, 2423, 2425, 2431, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3161, 3168, 3171, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3396, 3398, 3400, 3402, 3406, 3415, 3415, 3424, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6000, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6263, 6272, 6314, 6320, 6389, 6400, 6428, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6617, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7376, 7378, 7380, 7414, 7424, 7654, 7676, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8204, 8205, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 11823, 11823, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12442, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42647, 42655, 42737, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43047, 43072, 43123, 43136, 43204, 43216, 43225, 43232, 43255, 43259, 43259, 43264, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43643, 43648, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65062, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; - function lookupInUnicodeMap(code, map) { - if (code < map[0]) { - return false; - } - var lo = 0; - var hi = map.length; - var mid; - while (lo + 1 < hi) { - mid = lo + (hi - lo) / 2; - mid -= mid % 2; - if (map[mid] <= code && code <= map[mid + 1]) { - return true; - } - if (code < map[mid]) { - hi = mid; - } - else { - lo = mid + 2; - } - } - return false; - } - function isUnicodeIdentifierStart(code, languageVersion) { - return languageVersion === 0 /* ES3 */ ? lookupInUnicodeMap(code, unicodeES3IdentifierStart) : lookupInUnicodeMap(code, unicodeES5IdentifierStart); - } - function isUnicodeIdentifierPart(code, languageVersion) { - return languageVersion === 0 /* ES3 */ ? lookupInUnicodeMap(code, unicodeES3IdentifierPart) : lookupInUnicodeMap(code, unicodeES5IdentifierPart); - } - function makeReverseMap(source) { - var result = []; - for (var name in source) { - if (source.hasOwnProperty(name)) { - result[source[name]] = name; - } - } - return result; - } - var tokenStrings = makeReverseMap(textToToken); - function tokenToString(t) { - return tokenStrings[t]; - } - ts.tokenToString = tokenToString; - function getLineStarts(text) { - var result = new Array(); - var pos = 0; - var lineStart = 0; - while (pos < text.length) { - var ch = text.charCodeAt(pos++); - switch (ch) { - case 13 /* carriageReturn */: - if (text.charCodeAt(pos) === 10 /* lineFeed */) { - pos++; - } - case 10 /* lineFeed */: - result.push(lineStart); - lineStart = pos; - break; - default: - if (ch > 127 /* maxAsciiCharacter */ && isLineBreak(ch)) { - result.push(lineStart); - lineStart = pos; - } - break; - } - } - result.push(lineStart); - return result; - } - ts.getLineStarts = getLineStarts; - function getPositionFromLineAndCharacter(lineStarts, line, character) { - ts.Debug.assert(line > 0); - return lineStarts[line - 1] + character - 1; - } - ts.getPositionFromLineAndCharacter = getPositionFromLineAndCharacter; - function getLineAndCharacterOfPosition(lineStarts, position) { - var lineNumber = ts.binarySearch(lineStarts, position); - if (lineNumber < 0) { - lineNumber = (~lineNumber) - 1; - } - return { - line: lineNumber + 1, - character: position - lineStarts[lineNumber] + 1 - }; - } - ts.getLineAndCharacterOfPosition = getLineAndCharacterOfPosition; - function positionToLineAndCharacter(text, pos) { - var lineStarts = getLineStarts(text); - return getLineAndCharacterOfPosition(lineStarts, pos); - } - ts.positionToLineAndCharacter = positionToLineAndCharacter; - var hasOwnProperty = Object.prototype.hasOwnProperty; - function isWhiteSpace(ch) { - return ch === 32 /* space */ || ch === 9 /* tab */ || ch === 11 /* verticalTab */ || ch === 12 /* formFeed */ || ch === 160 /* nonBreakingSpace */ || ch === 5760 /* ogham */ || ch >= 8192 /* enQuad */ && ch <= 8203 /* zeroWidthSpace */ || ch === 8239 /* narrowNoBreakSpace */ || ch === 8287 /* mathematicalSpace */ || ch === 12288 /* ideographicSpace */ || ch === 65279 /* byteOrderMark */; - } - ts.isWhiteSpace = isWhiteSpace; - function isLineBreak(ch) { - return ch === 10 /* lineFeed */ || ch === 13 /* carriageReturn */ || ch === 8232 /* lineSeparator */ || ch === 8233 /* paragraphSeparator */ || ch === 133 /* nextLine */; - } - ts.isLineBreak = isLineBreak; - function isDigit(ch) { - return ch >= 48 /* _0 */ && ch <= 57 /* _9 */; - } - function isOctalDigit(ch) { - return ch >= 48 /* _0 */ && ch <= 55 /* _7 */; - } - ts.isOctalDigit = isOctalDigit; - function skipTrivia(text, pos, stopAfterLineBreak) { - while (true) { - var ch = text.charCodeAt(pos); - switch (ch) { - case 13 /* carriageReturn */: - if (text.charCodeAt(pos + 1) === 10 /* lineFeed */) - pos++; - case 10 /* lineFeed */: - pos++; - if (stopAfterLineBreak) - return pos; - continue; - case 9 /* tab */: - case 11 /* verticalTab */: - case 12 /* formFeed */: - case 32 /* space */: - pos++; - continue; - case 47 /* slash */: - if (text.charCodeAt(pos + 1) === 47 /* slash */) { - pos += 2; - while (pos < text.length) { - if (isLineBreak(text.charCodeAt(pos))) { - break; - } - pos++; - } - continue; - } - if (text.charCodeAt(pos + 1) === 42 /* asterisk */) { - pos += 2; - while (pos < text.length) { - if (text.charCodeAt(pos) === 42 /* asterisk */ && text.charCodeAt(pos + 1) === 47 /* slash */) { - pos += 2; - break; - } - pos++; - } - continue; - } - break; - default: - if (ch > 127 /* maxAsciiCharacter */ && (isWhiteSpace(ch) || isLineBreak(ch))) { - pos++; - continue; - } - break; - } - return pos; - } - } - ts.skipTrivia = skipTrivia; - function getCommentRanges(text, pos, trailing) { - var result; - var collecting = trailing || pos === 0; - while (true) { - var ch = text.charCodeAt(pos); - switch (ch) { - case 13 /* carriageReturn */: - if (text.charCodeAt(pos + 1) === 10 /* lineFeed */) - pos++; - case 10 /* lineFeed */: - pos++; - if (trailing) { - return result; - } - collecting = true; - if (result && result.length) { - result[result.length - 1].hasTrailingNewLine = true; - } - continue; - case 9 /* tab */: - case 11 /* verticalTab */: - case 12 /* formFeed */: - case 32 /* space */: - pos++; - continue; - case 47 /* slash */: - var nextChar = text.charCodeAt(pos + 1); - var hasTrailingNewLine = false; - if (nextChar === 47 /* slash */ || nextChar === 42 /* asterisk */) { - var startPos = pos; - pos += 2; - if (nextChar === 47 /* slash */) { - while (pos < text.length) { - if (isLineBreak(text.charCodeAt(pos))) { - hasTrailingNewLine = true; - break; - } - pos++; - } - } - else { - while (pos < text.length) { - if (text.charCodeAt(pos) === 42 /* asterisk */ && text.charCodeAt(pos + 1) === 47 /* slash */) { - pos += 2; - break; - } - pos++; - } - } - if (collecting) { - if (!result) - result = []; - result.push({ pos: startPos, end: pos, hasTrailingNewLine: hasTrailingNewLine }); - } - continue; - } - break; - default: - if (ch > 127 /* maxAsciiCharacter */ && (isWhiteSpace(ch) || isLineBreak(ch))) { - if (result && result.length && isLineBreak(ch)) { - result[result.length - 1].hasTrailingNewLine = true; - } - pos++; - continue; - } - break; - } - return result; - } - } - function getLeadingCommentRanges(text, pos) { - return getCommentRanges(text, pos, false); - } - ts.getLeadingCommentRanges = getLeadingCommentRanges; - function getTrailingCommentRanges(text, pos) { - return getCommentRanges(text, pos, true); - } - ts.getTrailingCommentRanges = getTrailingCommentRanges; - function isIdentifierStart(ch, languageVersion) { - return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch === 36 /* $ */ || ch === 95 /* _ */ || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierStart(ch, languageVersion); - } - ts.isIdentifierStart = isIdentifierStart; - function isIdentifierPart(ch, languageVersion) { - return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch >= 48 /* _0 */ && ch <= 57 /* _9 */ || ch === 36 /* $ */ || ch === 95 /* _ */ || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierPart(ch, languageVersion); - } - ts.isIdentifierPart = isIdentifierPart; - function createScanner(languageVersion, skipTrivia, text, onError, onComment) { - var pos; - var len; - var startPos; - var tokenPos; - var token; - var tokenValue; - var precedingLineBreak; - function error(message) { - if (onError) { - onError(message); - } - } - function isIdentifierStart(ch) { - return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch === 36 /* $ */ || ch === 95 /* _ */ || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierStart(ch, languageVersion); - } - function isIdentifierPart(ch) { - return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch >= 48 /* _0 */ && ch <= 57 /* _9 */ || ch === 36 /* $ */ || ch === 95 /* _ */ || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierPart(ch, languageVersion); - } - function scanNumber() { - var start = pos; - while (isDigit(text.charCodeAt(pos))) - pos++; - if (text.charCodeAt(pos) === 46 /* dot */) { - pos++; - while (isDigit(text.charCodeAt(pos))) - pos++; - } - var end = pos; - if (text.charCodeAt(pos) === 69 /* E */ || text.charCodeAt(pos) === 101 /* e */) { - pos++; - if (text.charCodeAt(pos) === 43 /* plus */ || text.charCodeAt(pos) === 45 /* minus */) - pos++; - if (isDigit(text.charCodeAt(pos))) { - pos++; - while (isDigit(text.charCodeAt(pos))) - pos++; - end = pos; - } - else { - error(ts.Diagnostics.Digit_expected); - } - } - return +(text.substring(start, end)); - } - function scanOctalDigits() { - var start = pos; - while (isOctalDigit(text.charCodeAt(pos))) { - pos++; - } - return +(text.substring(start, pos)); - } - function scanHexDigits(count, exact) { - var digits = 0; - var value = 0; - while (digits < count || !exact) { - var ch = text.charCodeAt(pos); - if (ch >= 48 /* _0 */ && ch <= 57 /* _9 */) { - value = value * 16 + ch - 48 /* _0 */; - } - else if (ch >= 65 /* A */ && ch <= 70 /* F */) { - value = value * 16 + ch - 65 /* A */ + 10; - } - else if (ch >= 97 /* a */ && ch <= 102 /* f */) { - value = value * 16 + ch - 97 /* a */ + 10; - } - else { - break; - } - pos++; - digits++; - } - if (digits < count) { - value = -1; - } - return value; - } - function scanString() { - var quote = text.charCodeAt(pos++); - var result = ""; - var start = pos; - while (true) { - if (pos >= len) { - result += text.substring(start, pos); - error(ts.Diagnostics.Unexpected_end_of_text); - break; - } - var ch = text.charCodeAt(pos); - if (ch === quote) { - result += text.substring(start, pos); - pos++; - break; - } - if (ch === 92 /* backslash */) { - result += text.substring(start, pos); - pos++; - if (pos >= len) { - error(ts.Diagnostics.Unexpected_end_of_text); - break; - } - ch = text.charCodeAt(pos++); - switch (ch) { - case 48 /* _0 */: - result += "\0"; - break; - case 98 /* b */: - result += "\b"; - break; - case 116 /* t */: - result += "\t"; - break; - case 110 /* n */: - result += "\n"; - break; - case 118 /* v */: - result += "\v"; - break; - case 102 /* f */: - result += "\f"; - break; - case 114 /* r */: - result += "\r"; - break; - case 39 /* singleQuote */: - result += "\'"; - break; - case 34 /* doubleQuote */: - result += "\""; - break; - case 120 /* x */: - case 117 /* u */: - var ch = scanHexDigits(ch === 120 /* x */ ? 2 : 4, true); - if (ch >= 0) { - result += String.fromCharCode(ch); - } - else { - error(ts.Diagnostics.Hexadecimal_digit_expected); - } - break; - case 13 /* carriageReturn */: - if (pos < len && text.charCodeAt(pos) === 10 /* lineFeed */) - pos++; - break; - case 10 /* lineFeed */: - case 8232 /* lineSeparator */: - case 8233 /* paragraphSeparator */: - break; - default: - result += String.fromCharCode(ch); - } - start = pos; - continue; - } - if (isLineBreak(ch)) { - result += text.substring(start, pos); - error(ts.Diagnostics.Unterminated_string_literal); - break; - } - pos++; - } - return result; - } - function peekUnicodeEscape() { - if (pos + 5 < len && text.charCodeAt(pos + 1) === 117 /* u */) { - var start = pos; - pos += 2; - var value = scanHexDigits(4, true); - pos = start; - return value; - } - return -1; - } - function scanIdentifierParts() { - var result = ""; - var start = pos; - while (pos < len) { - var ch = text.charCodeAt(pos); - if (isIdentifierPart(ch)) { - pos++; - } - else if (ch === 92 /* backslash */) { - ch = peekUnicodeEscape(); - if (!(ch >= 0 && isIdentifierPart(ch))) { - break; - } - result += text.substring(start, pos); - result += String.fromCharCode(ch); - pos += 6; - start = pos; - } - else { - break; - } - } - result += text.substring(start, pos); - return result; - } - function getIdentifierToken() { - var len = tokenValue.length; - if (len >= 2 && len <= 11) { - var ch = tokenValue.charCodeAt(0); - if (ch >= 97 /* a */ && ch <= 122 /* z */ && hasOwnProperty.call(textToToken, tokenValue)) { - return token = textToToken[tokenValue]; - } - } - return token = 59 /* Identifier */; - } - function scan() { - startPos = pos; - precedingLineBreak = false; - while (true) { - tokenPos = pos; - if (pos >= len) { - return token = 1 /* EndOfFileToken */; - } - var ch = text.charCodeAt(pos); - switch (ch) { - case 10 /* lineFeed */: - case 13 /* carriageReturn */: - precedingLineBreak = true; - if (skipTrivia) { - pos++; - continue; - } - else { - if (ch === 13 /* carriageReturn */ && pos + 1 < len && text.charCodeAt(pos + 1) === 10 /* lineFeed */) { - pos += 2; - } - else { - pos++; - } - return token = 4 /* NewLineTrivia */; - } - case 9 /* tab */: - case 11 /* verticalTab */: - case 12 /* formFeed */: - case 32 /* space */: - if (skipTrivia) { - pos++; - continue; - } - else { - while (pos < len && isWhiteSpace(text.charCodeAt(pos))) { - pos++; - } - return token = 5 /* WhitespaceTrivia */; - } - case 33 /* exclamation */: - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - if (text.charCodeAt(pos + 2) === 61 /* equals */) { - return pos += 3, token = 26 /* ExclamationEqualsEqualsToken */; - } - return pos += 2, token = 24 /* ExclamationEqualsToken */; - } - return pos++, token = 41 /* ExclamationToken */; - case 34 /* doubleQuote */: - case 39 /* singleQuote */: - tokenValue = scanString(); - return token = 7 /* StringLiteral */; - case 37 /* percent */: - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 52 /* PercentEqualsToken */; - } - return pos++, token = 32 /* PercentToken */; - case 38 /* ampersand */: - if (text.charCodeAt(pos + 1) === 38 /* ampersand */) { - return pos += 2, token = 43 /* AmpersandAmpersandToken */; - } - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 56 /* AmpersandEqualsToken */; - } - return pos++, token = 38 /* AmpersandToken */; - case 40 /* openParen */: - return pos++, token = 11 /* OpenParenToken */; - case 41 /* closeParen */: - return pos++, token = 12 /* CloseParenToken */; - case 42 /* asterisk */: - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 50 /* AsteriskEqualsToken */; - } - return pos++, token = 30 /* AsteriskToken */; - case 43 /* plus */: - if (text.charCodeAt(pos + 1) === 43 /* plus */) { - return pos += 2, token = 33 /* PlusPlusToken */; - } - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 48 /* PlusEqualsToken */; - } - return pos++, token = 28 /* PlusToken */; - case 44 /* comma */: - return pos++, token = 18 /* CommaToken */; - case 45 /* minus */: - if (text.charCodeAt(pos + 1) === 45 /* minus */) { - return pos += 2, token = 34 /* MinusMinusToken */; - } - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 49 /* MinusEqualsToken */; - } - return pos++, token = 29 /* MinusToken */; - case 46 /* dot */: - if (isDigit(text.charCodeAt(pos + 1))) { - tokenValue = "" + scanNumber(); - return token = 6 /* NumericLiteral */; - } - if (text.charCodeAt(pos + 1) === 46 /* dot */ && text.charCodeAt(pos + 2) === 46 /* dot */) { - return pos += 3, token = 16 /* DotDotDotToken */; - } - return pos++, token = 15 /* DotToken */; - case 47 /* slash */: - if (text.charCodeAt(pos + 1) === 47 /* slash */) { - pos += 2; - while (pos < len) { - if (isLineBreak(text.charCodeAt(pos))) { - break; - } - pos++; - } - if (onComment) { - onComment(tokenPos, pos); - } - if (skipTrivia) { - continue; - } - else { - return token = 2 /* SingleLineCommentTrivia */; - } - } - if (text.charCodeAt(pos + 1) === 42 /* asterisk */) { - pos += 2; - var commentClosed = false; - while (pos < len) { - var ch = text.charCodeAt(pos); - if (ch === 42 /* asterisk */ && text.charCodeAt(pos + 1) === 47 /* slash */) { - pos += 2; - commentClosed = true; - break; - } - if (isLineBreak(ch)) { - precedingLineBreak = true; - } - pos++; - } - if (!commentClosed) { - error(ts.Diagnostics.Asterisk_Slash_expected); - } - if (onComment) { - onComment(tokenPos, pos); - } - if (skipTrivia) { - continue; - } - else { - return token = 3 /* MultiLineCommentTrivia */; - } - } - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 51 /* SlashEqualsToken */; - } - return pos++, token = 31 /* SlashToken */; - case 48 /* _0 */: - if (pos + 2 < len && (text.charCodeAt(pos + 1) === 88 /* X */ || text.charCodeAt(pos + 1) === 120 /* x */)) { - pos += 2; - var value = scanHexDigits(1, false); - if (value < 0) { - error(ts.Diagnostics.Hexadecimal_digit_expected); - value = 0; - } - tokenValue = "" + value; - return 6 /* NumericLiteral */; - } - if (pos + 1 < len && isOctalDigit(text.charCodeAt(pos + 1))) { - tokenValue = "" + scanOctalDigits(); - return 6 /* NumericLiteral */; - } - case 49 /* _1 */: - case 50 /* _2 */: - case 51 /* _3 */: - case 52 /* _4 */: - case 53 /* _5 */: - case 54 /* _6 */: - case 55 /* _7 */: - case 56 /* _8 */: - case 57 /* _9 */: - tokenValue = "" + scanNumber(); - return token = 6 /* NumericLiteral */; - case 58 /* colon */: - return pos++, token = 46 /* ColonToken */; - case 59 /* semicolon */: - return pos++, token = 17 /* SemicolonToken */; - case 60 /* lessThan */: - if (text.charCodeAt(pos + 1) === 60 /* lessThan */) { - if (text.charCodeAt(pos + 2) === 61 /* equals */) { - return pos += 3, token = 53 /* LessThanLessThanEqualsToken */; - } - return pos += 2, token = 35 /* LessThanLessThanToken */; - } - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 21 /* LessThanEqualsToken */; - } - return pos++, token = 19 /* LessThanToken */; - case 61 /* equals */: - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - if (text.charCodeAt(pos + 2) === 61 /* equals */) { - return pos += 3, token = 25 /* EqualsEqualsEqualsToken */; - } - return pos += 2, token = 23 /* EqualsEqualsToken */; - } - if (text.charCodeAt(pos + 1) === 62 /* greaterThan */) { - return pos += 2, token = 27 /* EqualsGreaterThanToken */; - } - return pos++, token = 47 /* EqualsToken */; - case 62 /* greaterThan */: - return pos++, token = 20 /* GreaterThanToken */; - case 63 /* question */: - return pos++, token = 45 /* QuestionToken */; - case 91 /* openBracket */: - return pos++, token = 13 /* OpenBracketToken */; - case 93 /* closeBracket */: - return pos++, token = 14 /* CloseBracketToken */; - case 94 /* caret */: - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 58 /* CaretEqualsToken */; - } - return pos++, token = 40 /* CaretToken */; - case 123 /* openBrace */: - return pos++, token = 9 /* OpenBraceToken */; - case 124 /* bar */: - if (text.charCodeAt(pos + 1) === 124 /* bar */) { - return pos += 2, token = 44 /* BarBarToken */; - } - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 57 /* BarEqualsToken */; - } - return pos++, token = 39 /* BarToken */; - case 125 /* closeBrace */: - return pos++, token = 10 /* CloseBraceToken */; - case 126 /* tilde */: - return pos++, token = 42 /* TildeToken */; - case 92 /* backslash */: - var ch = peekUnicodeEscape(); - if (ch >= 0 && isIdentifierStart(ch)) { - pos += 6; - tokenValue = String.fromCharCode(ch) + scanIdentifierParts(); - return token = getIdentifierToken(); - } - error(ts.Diagnostics.Invalid_character); - return pos++, token = 0 /* Unknown */; - default: - if (isIdentifierStart(ch)) { - pos++; - while (pos < len && isIdentifierPart(ch = text.charCodeAt(pos))) - pos++; - tokenValue = text.substring(tokenPos, pos); - if (ch === 92 /* backslash */) { - tokenValue += scanIdentifierParts(); - } - return token = getIdentifierToken(); - } - else if (isWhiteSpace(ch)) { - pos++; - continue; - } - else if (isLineBreak(ch)) { - precedingLineBreak = true; - pos++; - continue; - } - error(ts.Diagnostics.Invalid_character); - return pos++, token = 0 /* Unknown */; - } - } - } - function reScanGreaterToken() { - if (token === 20 /* GreaterThanToken */) { - if (text.charCodeAt(pos) === 62 /* greaterThan */) { - if (text.charCodeAt(pos + 1) === 62 /* greaterThan */) { - if (text.charCodeAt(pos + 2) === 61 /* equals */) { - return pos += 3, token = 55 /* GreaterThanGreaterThanGreaterThanEqualsToken */; - } - return pos += 2, token = 37 /* GreaterThanGreaterThanGreaterThanToken */; - } - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 54 /* GreaterThanGreaterThanEqualsToken */; - } - return pos++, token = 36 /* GreaterThanGreaterThanToken */; - } - if (text.charCodeAt(pos) === 61 /* equals */) { - return pos++, token = 22 /* GreaterThanEqualsToken */; - } - } - return token; - } - function reScanSlashToken() { - if (token === 31 /* SlashToken */ || token === 51 /* SlashEqualsToken */) { - var p = tokenPos + 1; - var inEscape = false; - var inCharacterClass = false; - while (true) { - if (p >= len) { - return token; - } - var ch = text.charCodeAt(p); - if (isLineBreak(ch)) { - return token; - } - if (inEscape) { - inEscape = false; - } - else if (ch === 47 /* slash */ && !inCharacterClass) { - break; - } - else if (ch === 91 /* openBracket */) { - inCharacterClass = true; - } - else if (ch === 92 /* backslash */) { - inEscape = true; - } - else if (ch === 93 /* closeBracket */) { - inCharacterClass = false; - } - p++; - } - p++; - while (isIdentifierPart(text.charCodeAt(p))) { - p++; - } - pos = p; - tokenValue = text.substring(tokenPos, pos); - token = 8 /* RegularExpressionLiteral */; - } - return token; - } - function tryScan(callback) { - var savePos = pos; - var saveStartPos = startPos; - var saveTokenPos = tokenPos; - var saveToken = token; - var saveTokenValue = tokenValue; - var savePrecedingLineBreak = precedingLineBreak; - var result = callback(); - if (!result) { - pos = savePos; - startPos = saveStartPos; - tokenPos = saveTokenPos; - token = saveToken; - tokenValue = saveTokenValue; - precedingLineBreak = savePrecedingLineBreak; - } - return result; - } - function setText(newText) { - text = newText || ""; - len = text.length; - setTextPos(0); - } - function setTextPos(textPos) { - pos = textPos; - startPos = textPos; - tokenPos = textPos; - token = 0 /* Unknown */; - precedingLineBreak = false; - } - setText(text); - return { - getStartPos: function () { return startPos; }, - getTextPos: function () { return pos; }, - getToken: function () { return token; }, - getTokenPos: function () { return tokenPos; }, - getTokenText: function () { return text.substring(tokenPos, pos); }, - getTokenValue: function () { return tokenValue; }, - hasPrecedingLineBreak: function () { return precedingLineBreak; }, - isIdentifier: function () { return token === 59 /* Identifier */ || token > ts.SyntaxKind.LastReservedWord; }, - isReservedWord: function () { return token >= ts.SyntaxKind.FirstReservedWord && token <= ts.SyntaxKind.LastReservedWord; }, - reScanGreaterToken: reScanGreaterToken, - reScanSlashToken: reScanSlashToken, - scan: scan, - setText: setText, - setTextPos: setTextPos, - tryScan: tryScan - }; - } - ts.createScanner = createScanner; -})(ts || (ts = {})); -var ts; -(function (ts) { - (function (SyntaxKind) { - SyntaxKind[SyntaxKind["Unknown"] = 0] = "Unknown"; - SyntaxKind[SyntaxKind["EndOfFileToken"] = 1] = "EndOfFileToken"; - SyntaxKind[SyntaxKind["SingleLineCommentTrivia"] = 2] = "SingleLineCommentTrivia"; - SyntaxKind[SyntaxKind["MultiLineCommentTrivia"] = 3] = "MultiLineCommentTrivia"; - SyntaxKind[SyntaxKind["NewLineTrivia"] = 4] = "NewLineTrivia"; - SyntaxKind[SyntaxKind["WhitespaceTrivia"] = 5] = "WhitespaceTrivia"; - SyntaxKind[SyntaxKind["NumericLiteral"] = 6] = "NumericLiteral"; - SyntaxKind[SyntaxKind["StringLiteral"] = 7] = "StringLiteral"; - SyntaxKind[SyntaxKind["RegularExpressionLiteral"] = 8] = "RegularExpressionLiteral"; - SyntaxKind[SyntaxKind["OpenBraceToken"] = 9] = "OpenBraceToken"; - SyntaxKind[SyntaxKind["CloseBraceToken"] = 10] = "CloseBraceToken"; - SyntaxKind[SyntaxKind["OpenParenToken"] = 11] = "OpenParenToken"; - SyntaxKind[SyntaxKind["CloseParenToken"] = 12] = "CloseParenToken"; - SyntaxKind[SyntaxKind["OpenBracketToken"] = 13] = "OpenBracketToken"; - SyntaxKind[SyntaxKind["CloseBracketToken"] = 14] = "CloseBracketToken"; - SyntaxKind[SyntaxKind["DotToken"] = 15] = "DotToken"; - SyntaxKind[SyntaxKind["DotDotDotToken"] = 16] = "DotDotDotToken"; - SyntaxKind[SyntaxKind["SemicolonToken"] = 17] = "SemicolonToken"; - SyntaxKind[SyntaxKind["CommaToken"] = 18] = "CommaToken"; - SyntaxKind[SyntaxKind["LessThanToken"] = 19] = "LessThanToken"; - SyntaxKind[SyntaxKind["GreaterThanToken"] = 20] = "GreaterThanToken"; - SyntaxKind[SyntaxKind["LessThanEqualsToken"] = 21] = "LessThanEqualsToken"; - SyntaxKind[SyntaxKind["GreaterThanEqualsToken"] = 22] = "GreaterThanEqualsToken"; - SyntaxKind[SyntaxKind["EqualsEqualsToken"] = 23] = "EqualsEqualsToken"; - SyntaxKind[SyntaxKind["ExclamationEqualsToken"] = 24] = "ExclamationEqualsToken"; - SyntaxKind[SyntaxKind["EqualsEqualsEqualsToken"] = 25] = "EqualsEqualsEqualsToken"; - SyntaxKind[SyntaxKind["ExclamationEqualsEqualsToken"] = 26] = "ExclamationEqualsEqualsToken"; - SyntaxKind[SyntaxKind["EqualsGreaterThanToken"] = 27] = "EqualsGreaterThanToken"; - SyntaxKind[SyntaxKind["PlusToken"] = 28] = "PlusToken"; - SyntaxKind[SyntaxKind["MinusToken"] = 29] = "MinusToken"; - SyntaxKind[SyntaxKind["AsteriskToken"] = 30] = "AsteriskToken"; - SyntaxKind[SyntaxKind["SlashToken"] = 31] = "SlashToken"; - SyntaxKind[SyntaxKind["PercentToken"] = 32] = "PercentToken"; - SyntaxKind[SyntaxKind["PlusPlusToken"] = 33] = "PlusPlusToken"; - SyntaxKind[SyntaxKind["MinusMinusToken"] = 34] = "MinusMinusToken"; - SyntaxKind[SyntaxKind["LessThanLessThanToken"] = 35] = "LessThanLessThanToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanToken"] = 36] = "GreaterThanGreaterThanToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanToken"] = 37] = "GreaterThanGreaterThanGreaterThanToken"; - SyntaxKind[SyntaxKind["AmpersandToken"] = 38] = "AmpersandToken"; - SyntaxKind[SyntaxKind["BarToken"] = 39] = "BarToken"; - SyntaxKind[SyntaxKind["CaretToken"] = 40] = "CaretToken"; - SyntaxKind[SyntaxKind["ExclamationToken"] = 41] = "ExclamationToken"; - SyntaxKind[SyntaxKind["TildeToken"] = 42] = "TildeToken"; - SyntaxKind[SyntaxKind["AmpersandAmpersandToken"] = 43] = "AmpersandAmpersandToken"; - SyntaxKind[SyntaxKind["BarBarToken"] = 44] = "BarBarToken"; - SyntaxKind[SyntaxKind["QuestionToken"] = 45] = "QuestionToken"; - SyntaxKind[SyntaxKind["ColonToken"] = 46] = "ColonToken"; - SyntaxKind[SyntaxKind["EqualsToken"] = 47] = "EqualsToken"; - SyntaxKind[SyntaxKind["PlusEqualsToken"] = 48] = "PlusEqualsToken"; - SyntaxKind[SyntaxKind["MinusEqualsToken"] = 49] = "MinusEqualsToken"; - SyntaxKind[SyntaxKind["AsteriskEqualsToken"] = 50] = "AsteriskEqualsToken"; - SyntaxKind[SyntaxKind["SlashEqualsToken"] = 51] = "SlashEqualsToken"; - SyntaxKind[SyntaxKind["PercentEqualsToken"] = 52] = "PercentEqualsToken"; - SyntaxKind[SyntaxKind["LessThanLessThanEqualsToken"] = 53] = "LessThanLessThanEqualsToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanEqualsToken"] = 54] = "GreaterThanGreaterThanEqualsToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanEqualsToken"] = 55] = "GreaterThanGreaterThanGreaterThanEqualsToken"; - SyntaxKind[SyntaxKind["AmpersandEqualsToken"] = 56] = "AmpersandEqualsToken"; - SyntaxKind[SyntaxKind["BarEqualsToken"] = 57] = "BarEqualsToken"; - SyntaxKind[SyntaxKind["CaretEqualsToken"] = 58] = "CaretEqualsToken"; - SyntaxKind[SyntaxKind["Identifier"] = 59] = "Identifier"; - SyntaxKind[SyntaxKind["BreakKeyword"] = 60] = "BreakKeyword"; - SyntaxKind[SyntaxKind["CaseKeyword"] = 61] = "CaseKeyword"; - SyntaxKind[SyntaxKind["CatchKeyword"] = 62] = "CatchKeyword"; - SyntaxKind[SyntaxKind["ClassKeyword"] = 63] = "ClassKeyword"; - SyntaxKind[SyntaxKind["ConstKeyword"] = 64] = "ConstKeyword"; - SyntaxKind[SyntaxKind["ContinueKeyword"] = 65] = "ContinueKeyword"; - SyntaxKind[SyntaxKind["DebuggerKeyword"] = 66] = "DebuggerKeyword"; - SyntaxKind[SyntaxKind["DefaultKeyword"] = 67] = "DefaultKeyword"; - SyntaxKind[SyntaxKind["DeleteKeyword"] = 68] = "DeleteKeyword"; - SyntaxKind[SyntaxKind["DoKeyword"] = 69] = "DoKeyword"; - SyntaxKind[SyntaxKind["ElseKeyword"] = 70] = "ElseKeyword"; - SyntaxKind[SyntaxKind["EnumKeyword"] = 71] = "EnumKeyword"; - SyntaxKind[SyntaxKind["ExportKeyword"] = 72] = "ExportKeyword"; - SyntaxKind[SyntaxKind["ExtendsKeyword"] = 73] = "ExtendsKeyword"; - SyntaxKind[SyntaxKind["FalseKeyword"] = 74] = "FalseKeyword"; - SyntaxKind[SyntaxKind["FinallyKeyword"] = 75] = "FinallyKeyword"; - SyntaxKind[SyntaxKind["ForKeyword"] = 76] = "ForKeyword"; - SyntaxKind[SyntaxKind["FunctionKeyword"] = 77] = "FunctionKeyword"; - SyntaxKind[SyntaxKind["IfKeyword"] = 78] = "IfKeyword"; - SyntaxKind[SyntaxKind["ImportKeyword"] = 79] = "ImportKeyword"; - SyntaxKind[SyntaxKind["InKeyword"] = 80] = "InKeyword"; - SyntaxKind[SyntaxKind["InstanceOfKeyword"] = 81] = "InstanceOfKeyword"; - SyntaxKind[SyntaxKind["NewKeyword"] = 82] = "NewKeyword"; - SyntaxKind[SyntaxKind["NullKeyword"] = 83] = "NullKeyword"; - SyntaxKind[SyntaxKind["ReturnKeyword"] = 84] = "ReturnKeyword"; - SyntaxKind[SyntaxKind["SuperKeyword"] = 85] = "SuperKeyword"; - SyntaxKind[SyntaxKind["SwitchKeyword"] = 86] = "SwitchKeyword"; - SyntaxKind[SyntaxKind["ThisKeyword"] = 87] = "ThisKeyword"; - SyntaxKind[SyntaxKind["ThrowKeyword"] = 88] = "ThrowKeyword"; - SyntaxKind[SyntaxKind["TrueKeyword"] = 89] = "TrueKeyword"; - SyntaxKind[SyntaxKind["TryKeyword"] = 90] = "TryKeyword"; - SyntaxKind[SyntaxKind["TypeOfKeyword"] = 91] = "TypeOfKeyword"; - SyntaxKind[SyntaxKind["VarKeyword"] = 92] = "VarKeyword"; - SyntaxKind[SyntaxKind["VoidKeyword"] = 93] = "VoidKeyword"; - SyntaxKind[SyntaxKind["WhileKeyword"] = 94] = "WhileKeyword"; - SyntaxKind[SyntaxKind["WithKeyword"] = 95] = "WithKeyword"; - SyntaxKind[SyntaxKind["ImplementsKeyword"] = 96] = "ImplementsKeyword"; - SyntaxKind[SyntaxKind["InterfaceKeyword"] = 97] = "InterfaceKeyword"; - SyntaxKind[SyntaxKind["LetKeyword"] = 98] = "LetKeyword"; - SyntaxKind[SyntaxKind["PackageKeyword"] = 99] = "PackageKeyword"; - SyntaxKind[SyntaxKind["PrivateKeyword"] = 100] = "PrivateKeyword"; - SyntaxKind[SyntaxKind["ProtectedKeyword"] = 101] = "ProtectedKeyword"; - SyntaxKind[SyntaxKind["PublicKeyword"] = 102] = "PublicKeyword"; - SyntaxKind[SyntaxKind["StaticKeyword"] = 103] = "StaticKeyword"; - SyntaxKind[SyntaxKind["YieldKeyword"] = 104] = "YieldKeyword"; - SyntaxKind[SyntaxKind["AnyKeyword"] = 105] = "AnyKeyword"; - SyntaxKind[SyntaxKind["BooleanKeyword"] = 106] = "BooleanKeyword"; - SyntaxKind[SyntaxKind["ConstructorKeyword"] = 107] = "ConstructorKeyword"; - SyntaxKind[SyntaxKind["DeclareKeyword"] = 108] = "DeclareKeyword"; - SyntaxKind[SyntaxKind["GetKeyword"] = 109] = "GetKeyword"; - SyntaxKind[SyntaxKind["ModuleKeyword"] = 110] = "ModuleKeyword"; - SyntaxKind[SyntaxKind["RequireKeyword"] = 111] = "RequireKeyword"; - SyntaxKind[SyntaxKind["NumberKeyword"] = 112] = "NumberKeyword"; - SyntaxKind[SyntaxKind["SetKeyword"] = 113] = "SetKeyword"; - SyntaxKind[SyntaxKind["StringKeyword"] = 114] = "StringKeyword"; - SyntaxKind[SyntaxKind["Missing"] = 115] = "Missing"; - SyntaxKind[SyntaxKind["QualifiedName"] = 116] = "QualifiedName"; - SyntaxKind[SyntaxKind["TypeParameter"] = 117] = "TypeParameter"; - SyntaxKind[SyntaxKind["Parameter"] = 118] = "Parameter"; - SyntaxKind[SyntaxKind["Property"] = 119] = "Property"; - SyntaxKind[SyntaxKind["Method"] = 120] = "Method"; - SyntaxKind[SyntaxKind["Constructor"] = 121] = "Constructor"; - SyntaxKind[SyntaxKind["GetAccessor"] = 122] = "GetAccessor"; - SyntaxKind[SyntaxKind["SetAccessor"] = 123] = "SetAccessor"; - SyntaxKind[SyntaxKind["CallSignature"] = 124] = "CallSignature"; - SyntaxKind[SyntaxKind["ConstructSignature"] = 125] = "ConstructSignature"; - SyntaxKind[SyntaxKind["IndexSignature"] = 126] = "IndexSignature"; - SyntaxKind[SyntaxKind["TypeReference"] = 127] = "TypeReference"; - SyntaxKind[SyntaxKind["TypeQuery"] = 128] = "TypeQuery"; - SyntaxKind[SyntaxKind["TypeLiteral"] = 129] = "TypeLiteral"; - SyntaxKind[SyntaxKind["ArrayType"] = 130] = "ArrayType"; - SyntaxKind[SyntaxKind["TupleType"] = 131] = "TupleType"; - SyntaxKind[SyntaxKind["ArrayLiteral"] = 132] = "ArrayLiteral"; - SyntaxKind[SyntaxKind["ObjectLiteral"] = 133] = "ObjectLiteral"; - SyntaxKind[SyntaxKind["PropertyAssignment"] = 134] = "PropertyAssignment"; - SyntaxKind[SyntaxKind["PropertyAccess"] = 135] = "PropertyAccess"; - SyntaxKind[SyntaxKind["IndexedAccess"] = 136] = "IndexedAccess"; - SyntaxKind[SyntaxKind["CallExpression"] = 137] = "CallExpression"; - SyntaxKind[SyntaxKind["NewExpression"] = 138] = "NewExpression"; - SyntaxKind[SyntaxKind["TypeAssertion"] = 139] = "TypeAssertion"; - SyntaxKind[SyntaxKind["ParenExpression"] = 140] = "ParenExpression"; - SyntaxKind[SyntaxKind["FunctionExpression"] = 141] = "FunctionExpression"; - SyntaxKind[SyntaxKind["ArrowFunction"] = 142] = "ArrowFunction"; - SyntaxKind[SyntaxKind["PrefixOperator"] = 143] = "PrefixOperator"; - SyntaxKind[SyntaxKind["PostfixOperator"] = 144] = "PostfixOperator"; - SyntaxKind[SyntaxKind["BinaryExpression"] = 145] = "BinaryExpression"; - SyntaxKind[SyntaxKind["ConditionalExpression"] = 146] = "ConditionalExpression"; - SyntaxKind[SyntaxKind["OmittedExpression"] = 147] = "OmittedExpression"; - SyntaxKind[SyntaxKind["Block"] = 148] = "Block"; - SyntaxKind[SyntaxKind["VariableStatement"] = 149] = "VariableStatement"; - SyntaxKind[SyntaxKind["EmptyStatement"] = 150] = "EmptyStatement"; - SyntaxKind[SyntaxKind["ExpressionStatement"] = 151] = "ExpressionStatement"; - SyntaxKind[SyntaxKind["IfStatement"] = 152] = "IfStatement"; - SyntaxKind[SyntaxKind["DoStatement"] = 153] = "DoStatement"; - SyntaxKind[SyntaxKind["WhileStatement"] = 154] = "WhileStatement"; - SyntaxKind[SyntaxKind["ForStatement"] = 155] = "ForStatement"; - SyntaxKind[SyntaxKind["ForInStatement"] = 156] = "ForInStatement"; - SyntaxKind[SyntaxKind["ContinueStatement"] = 157] = "ContinueStatement"; - SyntaxKind[SyntaxKind["BreakStatement"] = 158] = "BreakStatement"; - SyntaxKind[SyntaxKind["ReturnStatement"] = 159] = "ReturnStatement"; - SyntaxKind[SyntaxKind["WithStatement"] = 160] = "WithStatement"; - SyntaxKind[SyntaxKind["SwitchStatement"] = 161] = "SwitchStatement"; - SyntaxKind[SyntaxKind["CaseClause"] = 162] = "CaseClause"; - SyntaxKind[SyntaxKind["DefaultClause"] = 163] = "DefaultClause"; - SyntaxKind[SyntaxKind["LabeledStatement"] = 164] = "LabeledStatement"; - SyntaxKind[SyntaxKind["ThrowStatement"] = 165] = "ThrowStatement"; - SyntaxKind[SyntaxKind["TryStatement"] = 166] = "TryStatement"; - SyntaxKind[SyntaxKind["TryBlock"] = 167] = "TryBlock"; - SyntaxKind[SyntaxKind["CatchBlock"] = 168] = "CatchBlock"; - SyntaxKind[SyntaxKind["FinallyBlock"] = 169] = "FinallyBlock"; - SyntaxKind[SyntaxKind["DebuggerStatement"] = 170] = "DebuggerStatement"; - SyntaxKind[SyntaxKind["VariableDeclaration"] = 171] = "VariableDeclaration"; - SyntaxKind[SyntaxKind["FunctionDeclaration"] = 172] = "FunctionDeclaration"; - SyntaxKind[SyntaxKind["FunctionBlock"] = 173] = "FunctionBlock"; - SyntaxKind[SyntaxKind["ClassDeclaration"] = 174] = "ClassDeclaration"; - SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 175] = "InterfaceDeclaration"; - SyntaxKind[SyntaxKind["EnumDeclaration"] = 176] = "EnumDeclaration"; - SyntaxKind[SyntaxKind["ModuleDeclaration"] = 177] = "ModuleDeclaration"; - SyntaxKind[SyntaxKind["ModuleBlock"] = 178] = "ModuleBlock"; - SyntaxKind[SyntaxKind["ImportDeclaration"] = 179] = "ImportDeclaration"; - SyntaxKind[SyntaxKind["ExportAssignment"] = 180] = "ExportAssignment"; - SyntaxKind[SyntaxKind["EnumMember"] = 181] = "EnumMember"; - SyntaxKind[SyntaxKind["SourceFile"] = 182] = "SourceFile"; - SyntaxKind[SyntaxKind["Program"] = 183] = "Program"; - SyntaxKind[SyntaxKind["SyntaxList"] = 184] = "SyntaxList"; - SyntaxKind[SyntaxKind["Count"] = 185] = "Count"; - SyntaxKind[SyntaxKind["FirstAssignment"] = SyntaxKind.EqualsToken] = "FirstAssignment"; - SyntaxKind[SyntaxKind["LastAssignment"] = SyntaxKind.CaretEqualsToken] = "LastAssignment"; - SyntaxKind[SyntaxKind["FirstReservedWord"] = SyntaxKind.BreakKeyword] = "FirstReservedWord"; - SyntaxKind[SyntaxKind["LastReservedWord"] = SyntaxKind.WithKeyword] = "LastReservedWord"; - SyntaxKind[SyntaxKind["FirstKeyword"] = SyntaxKind.BreakKeyword] = "FirstKeyword"; - SyntaxKind[SyntaxKind["LastKeyword"] = SyntaxKind.StringKeyword] = "LastKeyword"; - SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = SyntaxKind.ImplementsKeyword] = "FirstFutureReservedWord"; - SyntaxKind[SyntaxKind["LastFutureReservedWord"] = SyntaxKind.YieldKeyword] = "LastFutureReservedWord"; - SyntaxKind[SyntaxKind["FirstTypeNode"] = SyntaxKind.TypeReference] = "FirstTypeNode"; - SyntaxKind[SyntaxKind["LastTypeNode"] = SyntaxKind.TupleType] = "LastTypeNode"; - SyntaxKind[SyntaxKind["FirstPunctuation"] = SyntaxKind.OpenBraceToken] = "FirstPunctuation"; - SyntaxKind[SyntaxKind["LastPunctuation"] = SyntaxKind.CaretEqualsToken] = "LastPunctuation"; - SyntaxKind[SyntaxKind["FirstToken"] = SyntaxKind.EndOfFileToken] = "FirstToken"; - SyntaxKind[SyntaxKind["LastToken"] = SyntaxKind.StringKeyword] = "LastToken"; - SyntaxKind[SyntaxKind["FirstTriviaToken"] = SyntaxKind.SingleLineCommentTrivia] = "FirstTriviaToken"; - SyntaxKind[SyntaxKind["LastTriviaToken"] = SyntaxKind.WhitespaceTrivia] = "LastTriviaToken"; - })(ts.SyntaxKind || (ts.SyntaxKind = {})); - var SyntaxKind = ts.SyntaxKind; - (function (NodeFlags) { - NodeFlags[NodeFlags["Export"] = 0x00000001] = "Export"; - NodeFlags[NodeFlags["Ambient"] = 0x00000002] = "Ambient"; - NodeFlags[NodeFlags["QuestionMark"] = 0x00000004] = "QuestionMark"; - NodeFlags[NodeFlags["Rest"] = 0x00000008] = "Rest"; - NodeFlags[NodeFlags["Public"] = 0x00000010] = "Public"; - NodeFlags[NodeFlags["Private"] = 0x00000020] = "Private"; - NodeFlags[NodeFlags["Protected"] = 0x00000040] = "Protected"; - NodeFlags[NodeFlags["Static"] = 0x00000080] = "Static"; - NodeFlags[NodeFlags["MultiLine"] = 0x00000100] = "MultiLine"; - NodeFlags[NodeFlags["Synthetic"] = 0x00000200] = "Synthetic"; - NodeFlags[NodeFlags["DeclarationFile"] = 0x00000400] = "DeclarationFile"; - NodeFlags[NodeFlags["Modifier"] = NodeFlags.Export | NodeFlags.Ambient | NodeFlags.Public | NodeFlags.Private | NodeFlags.Protected | NodeFlags.Static] = "Modifier"; - NodeFlags[NodeFlags["AccessibilityModifier"] = NodeFlags.Public | NodeFlags.Private | NodeFlags.Protected] = "AccessibilityModifier"; - })(ts.NodeFlags || (ts.NodeFlags = {})); - var NodeFlags = ts.NodeFlags; - (function (EmitReturnStatus) { - EmitReturnStatus[EmitReturnStatus["Succeeded"] = 0] = "Succeeded"; - EmitReturnStatus[EmitReturnStatus["AllOutputGenerationSkipped"] = 1] = "AllOutputGenerationSkipped"; - EmitReturnStatus[EmitReturnStatus["JSGeneratedWithSemanticErrors"] = 2] = "JSGeneratedWithSemanticErrors"; - EmitReturnStatus[EmitReturnStatus["DeclarationGenerationSkipped"] = 3] = "DeclarationGenerationSkipped"; - EmitReturnStatus[EmitReturnStatus["EmitErrorsEncountered"] = 4] = "EmitErrorsEncountered"; - EmitReturnStatus[EmitReturnStatus["CompilerOptionsErrors"] = 5] = "CompilerOptionsErrors"; - })(ts.EmitReturnStatus || (ts.EmitReturnStatus = {})); - var EmitReturnStatus = ts.EmitReturnStatus; - (function (TypeFormatFlags) { - TypeFormatFlags[TypeFormatFlags["None"] = 0x00000000] = "None"; - TypeFormatFlags[TypeFormatFlags["WriteArrayAsGenericType"] = 0x00000001] = "WriteArrayAsGenericType"; - TypeFormatFlags[TypeFormatFlags["UseTypeOfFunction"] = 0x00000002] = "UseTypeOfFunction"; - TypeFormatFlags[TypeFormatFlags["NoTruncation"] = 0x00000004] = "NoTruncation"; - TypeFormatFlags[TypeFormatFlags["WriteArrowStyleSignature"] = 0x00000008] = "WriteArrowStyleSignature"; - TypeFormatFlags[TypeFormatFlags["WriteOwnNameForAnyLike"] = 0x00000010] = "WriteOwnNameForAnyLike"; - TypeFormatFlags[TypeFormatFlags["WriteTypeArgumentsOfSignature"] = 0x00000020] = "WriteTypeArgumentsOfSignature"; - })(ts.TypeFormatFlags || (ts.TypeFormatFlags = {})); - var TypeFormatFlags = ts.TypeFormatFlags; - (function (SymbolFormatFlags) { - SymbolFormatFlags[SymbolFormatFlags["None"] = 0x00000000] = "None"; - SymbolFormatFlags[SymbolFormatFlags["WriteTypeParametersOrArguments"] = 0x00000001] = "WriteTypeParametersOrArguments"; - SymbolFormatFlags[SymbolFormatFlags["UseOnlyExternalAliasing"] = 0x00000002] = "UseOnlyExternalAliasing"; - })(ts.SymbolFormatFlags || (ts.SymbolFormatFlags = {})); - var SymbolFormatFlags = ts.SymbolFormatFlags; - (function (SymbolAccessibility) { - SymbolAccessibility[SymbolAccessibility["Accessible"] = 0] = "Accessible"; - SymbolAccessibility[SymbolAccessibility["NotAccessible"] = 1] = "NotAccessible"; - SymbolAccessibility[SymbolAccessibility["CannotBeNamed"] = 2] = "CannotBeNamed"; - })(ts.SymbolAccessibility || (ts.SymbolAccessibility = {})); - var SymbolAccessibility = ts.SymbolAccessibility; - (function (SymbolFlags) { - SymbolFlags[SymbolFlags["Variable"] = 0x00000001] = "Variable"; - SymbolFlags[SymbolFlags["Property"] = 0x00000002] = "Property"; - SymbolFlags[SymbolFlags["EnumMember"] = 0x00000004] = "EnumMember"; - SymbolFlags[SymbolFlags["Function"] = 0x00000008] = "Function"; - SymbolFlags[SymbolFlags["Class"] = 0x00000010] = "Class"; - SymbolFlags[SymbolFlags["Interface"] = 0x00000020] = "Interface"; - SymbolFlags[SymbolFlags["Enum"] = 0x00000040] = "Enum"; - SymbolFlags[SymbolFlags["ValueModule"] = 0x00000080] = "ValueModule"; - SymbolFlags[SymbolFlags["NamespaceModule"] = 0x00000100] = "NamespaceModule"; - SymbolFlags[SymbolFlags["TypeLiteral"] = 0x00000200] = "TypeLiteral"; - SymbolFlags[SymbolFlags["ObjectLiteral"] = 0x00000400] = "ObjectLiteral"; - SymbolFlags[SymbolFlags["Method"] = 0x00000800] = "Method"; - SymbolFlags[SymbolFlags["Constructor"] = 0x00001000] = "Constructor"; - SymbolFlags[SymbolFlags["GetAccessor"] = 0x00002000] = "GetAccessor"; - SymbolFlags[SymbolFlags["SetAccessor"] = 0x00004000] = "SetAccessor"; - SymbolFlags[SymbolFlags["CallSignature"] = 0x00008000] = "CallSignature"; - SymbolFlags[SymbolFlags["ConstructSignature"] = 0x00010000] = "ConstructSignature"; - SymbolFlags[SymbolFlags["IndexSignature"] = 0x00020000] = "IndexSignature"; - SymbolFlags[SymbolFlags["TypeParameter"] = 0x00040000] = "TypeParameter"; - SymbolFlags[SymbolFlags["ExportValue"] = 0x00080000] = "ExportValue"; - SymbolFlags[SymbolFlags["ExportType"] = 0x00100000] = "ExportType"; - SymbolFlags[SymbolFlags["ExportNamespace"] = 0x00200000] = "ExportNamespace"; - SymbolFlags[SymbolFlags["Import"] = 0x00400000] = "Import"; - SymbolFlags[SymbolFlags["Instantiated"] = 0x00800000] = "Instantiated"; - SymbolFlags[SymbolFlags["Merged"] = 0x01000000] = "Merged"; - SymbolFlags[SymbolFlags["Transient"] = 0x02000000] = "Transient"; - SymbolFlags[SymbolFlags["Prototype"] = 0x04000000] = "Prototype"; - SymbolFlags[SymbolFlags["Value"] = SymbolFlags.Variable | SymbolFlags.Property | SymbolFlags.EnumMember | SymbolFlags.Function | SymbolFlags.Class | SymbolFlags.Enum | SymbolFlags.ValueModule | SymbolFlags.Method | SymbolFlags.GetAccessor | SymbolFlags.SetAccessor] = "Value"; - SymbolFlags[SymbolFlags["Type"] = SymbolFlags.Class | SymbolFlags.Interface | SymbolFlags.Enum | SymbolFlags.TypeLiteral | SymbolFlags.ObjectLiteral | SymbolFlags.TypeParameter] = "Type"; - SymbolFlags[SymbolFlags["Namespace"] = SymbolFlags.ValueModule | SymbolFlags.NamespaceModule] = "Namespace"; - SymbolFlags[SymbolFlags["Module"] = SymbolFlags.ValueModule | SymbolFlags.NamespaceModule] = "Module"; - SymbolFlags[SymbolFlags["Accessor"] = SymbolFlags.GetAccessor | SymbolFlags.SetAccessor] = "Accessor"; - SymbolFlags[SymbolFlags["Signature"] = SymbolFlags.CallSignature | SymbolFlags.ConstructSignature | SymbolFlags.IndexSignature] = "Signature"; - SymbolFlags[SymbolFlags["ParameterExcludes"] = SymbolFlags.Value] = "ParameterExcludes"; - SymbolFlags[SymbolFlags["VariableExcludes"] = SymbolFlags.Value & ~SymbolFlags.Variable] = "VariableExcludes"; - SymbolFlags[SymbolFlags["PropertyExcludes"] = SymbolFlags.Value] = "PropertyExcludes"; - SymbolFlags[SymbolFlags["EnumMemberExcludes"] = SymbolFlags.Value] = "EnumMemberExcludes"; - SymbolFlags[SymbolFlags["FunctionExcludes"] = SymbolFlags.Value & ~(SymbolFlags.Function | SymbolFlags.ValueModule)] = "FunctionExcludes"; - SymbolFlags[SymbolFlags["ClassExcludes"] = (SymbolFlags.Value | SymbolFlags.Type) & ~SymbolFlags.ValueModule] = "ClassExcludes"; - SymbolFlags[SymbolFlags["InterfaceExcludes"] = SymbolFlags.Type & ~SymbolFlags.Interface] = "InterfaceExcludes"; - SymbolFlags[SymbolFlags["EnumExcludes"] = (SymbolFlags.Value | SymbolFlags.Type) & ~(SymbolFlags.Enum | SymbolFlags.ValueModule)] = "EnumExcludes"; - SymbolFlags[SymbolFlags["ValueModuleExcludes"] = SymbolFlags.Value & ~(SymbolFlags.Function | SymbolFlags.Class | SymbolFlags.Enum | SymbolFlags.ValueModule)] = "ValueModuleExcludes"; - SymbolFlags[SymbolFlags["NamespaceModuleExcludes"] = 0] = "NamespaceModuleExcludes"; - SymbolFlags[SymbolFlags["MethodExcludes"] = SymbolFlags.Value & ~SymbolFlags.Method] = "MethodExcludes"; - SymbolFlags[SymbolFlags["GetAccessorExcludes"] = SymbolFlags.Value & ~SymbolFlags.SetAccessor] = "GetAccessorExcludes"; - SymbolFlags[SymbolFlags["SetAccessorExcludes"] = SymbolFlags.Value & ~SymbolFlags.GetAccessor] = "SetAccessorExcludes"; - SymbolFlags[SymbolFlags["TypeParameterExcludes"] = SymbolFlags.Type & ~SymbolFlags.TypeParameter] = "TypeParameterExcludes"; - SymbolFlags[SymbolFlags["ImportExcludes"] = SymbolFlags.Import] = "ImportExcludes"; - SymbolFlags[SymbolFlags["ModuleMember"] = SymbolFlags.Variable | SymbolFlags.Function | SymbolFlags.Class | SymbolFlags.Interface | SymbolFlags.Enum | SymbolFlags.Module | SymbolFlags.Import] = "ModuleMember"; - SymbolFlags[SymbolFlags["ExportHasLocal"] = SymbolFlags.Function | SymbolFlags.Class | SymbolFlags.Enum | SymbolFlags.ValueModule] = "ExportHasLocal"; - SymbolFlags[SymbolFlags["HasLocals"] = SymbolFlags.Function | SymbolFlags.Module | SymbolFlags.Method | SymbolFlags.Constructor | SymbolFlags.Accessor | SymbolFlags.Signature] = "HasLocals"; - SymbolFlags[SymbolFlags["HasExports"] = SymbolFlags.Class | SymbolFlags.Enum | SymbolFlags.Module] = "HasExports"; - SymbolFlags[SymbolFlags["HasMembers"] = SymbolFlags.Class | SymbolFlags.Interface | SymbolFlags.TypeLiteral | SymbolFlags.ObjectLiteral] = "HasMembers"; - SymbolFlags[SymbolFlags["IsContainer"] = SymbolFlags.HasLocals | SymbolFlags.HasExports | SymbolFlags.HasMembers] = "IsContainer"; - SymbolFlags[SymbolFlags["PropertyOrAccessor"] = SymbolFlags.Property | SymbolFlags.Accessor] = "PropertyOrAccessor"; - SymbolFlags[SymbolFlags["Export"] = SymbolFlags.ExportNamespace | SymbolFlags.ExportType | SymbolFlags.ExportValue] = "Export"; - })(ts.SymbolFlags || (ts.SymbolFlags = {})); - var SymbolFlags = ts.SymbolFlags; - (function (NodeCheckFlags) { - NodeCheckFlags[NodeCheckFlags["TypeChecked"] = 0x00000001] = "TypeChecked"; - NodeCheckFlags[NodeCheckFlags["LexicalThis"] = 0x00000002] = "LexicalThis"; - NodeCheckFlags[NodeCheckFlags["CaptureThis"] = 0x00000004] = "CaptureThis"; - NodeCheckFlags[NodeCheckFlags["EmitExtends"] = 0x00000008] = "EmitExtends"; - NodeCheckFlags[NodeCheckFlags["SuperInstance"] = 0x00000010] = "SuperInstance"; - NodeCheckFlags[NodeCheckFlags["SuperStatic"] = 0x00000020] = "SuperStatic"; - NodeCheckFlags[NodeCheckFlags["ContextChecked"] = 0x00000040] = "ContextChecked"; - NodeCheckFlags[NodeCheckFlags["EnumValuesComputed"] = 0x00000080] = "EnumValuesComputed"; - })(ts.NodeCheckFlags || (ts.NodeCheckFlags = {})); - var NodeCheckFlags = ts.NodeCheckFlags; - (function (TypeFlags) { - TypeFlags[TypeFlags["Any"] = 0x00000001] = "Any"; - TypeFlags[TypeFlags["String"] = 0x00000002] = "String"; - TypeFlags[TypeFlags["Number"] = 0x00000004] = "Number"; - TypeFlags[TypeFlags["Boolean"] = 0x00000008] = "Boolean"; - TypeFlags[TypeFlags["Void"] = 0x00000010] = "Void"; - TypeFlags[TypeFlags["Undefined"] = 0x00000020] = "Undefined"; - TypeFlags[TypeFlags["Null"] = 0x00000040] = "Null"; - TypeFlags[TypeFlags["Enum"] = 0x00000080] = "Enum"; - TypeFlags[TypeFlags["StringLiteral"] = 0x00000100] = "StringLiteral"; - TypeFlags[TypeFlags["TypeParameter"] = 0x00000200] = "TypeParameter"; - TypeFlags[TypeFlags["Class"] = 0x00000400] = "Class"; - TypeFlags[TypeFlags["Interface"] = 0x00000800] = "Interface"; - TypeFlags[TypeFlags["Reference"] = 0x00001000] = "Reference"; - TypeFlags[TypeFlags["Tuple"] = 0x00002000] = "Tuple"; - TypeFlags[TypeFlags["Anonymous"] = 0x00004000] = "Anonymous"; - TypeFlags[TypeFlags["FromSignature"] = 0x00008000] = "FromSignature"; - TypeFlags[TypeFlags["Intrinsic"] = TypeFlags.Any | TypeFlags.String | TypeFlags.Number | TypeFlags.Boolean | TypeFlags.Void | TypeFlags.Undefined | TypeFlags.Null] = "Intrinsic"; - TypeFlags[TypeFlags["StringLike"] = TypeFlags.String | TypeFlags.StringLiteral] = "StringLike"; - TypeFlags[TypeFlags["NumberLike"] = TypeFlags.Number | TypeFlags.Enum] = "NumberLike"; - TypeFlags[TypeFlags["ObjectType"] = TypeFlags.Class | TypeFlags.Interface | TypeFlags.Reference | TypeFlags.Tuple | TypeFlags.Anonymous] = "ObjectType"; - })(ts.TypeFlags || (ts.TypeFlags = {})); - var TypeFlags = ts.TypeFlags; - (function (SignatureKind) { - SignatureKind[SignatureKind["Call"] = 0] = "Call"; - SignatureKind[SignatureKind["Construct"] = 1] = "Construct"; - })(ts.SignatureKind || (ts.SignatureKind = {})); - var SignatureKind = ts.SignatureKind; - (function (IndexKind) { - IndexKind[IndexKind["String"] = 0] = "String"; - IndexKind[IndexKind["Number"] = 1] = "Number"; - })(ts.IndexKind || (ts.IndexKind = {})); - var IndexKind = ts.IndexKind; - (function (DiagnosticCategory) { - DiagnosticCategory[DiagnosticCategory["Warning"] = 0] = "Warning"; - DiagnosticCategory[DiagnosticCategory["Error"] = 1] = "Error"; - DiagnosticCategory[DiagnosticCategory["Message"] = 2] = "Message"; - })(ts.DiagnosticCategory || (ts.DiagnosticCategory = {})); - var DiagnosticCategory = ts.DiagnosticCategory; - (function (ModuleKind) { - ModuleKind[ModuleKind["None"] = 0] = "None"; - ModuleKind[ModuleKind["CommonJS"] = 1] = "CommonJS"; - ModuleKind[ModuleKind["AMD"] = 2] = "AMD"; - })(ts.ModuleKind || (ts.ModuleKind = {})); - var ModuleKind = ts.ModuleKind; - (function (ScriptTarget) { - ScriptTarget[ScriptTarget["ES3"] = 0] = "ES3"; - ScriptTarget[ScriptTarget["ES5"] = 1] = "ES5"; - })(ts.ScriptTarget || (ts.ScriptTarget = {})); - var ScriptTarget = ts.ScriptTarget; - (function (CharacterCodes) { - CharacterCodes[CharacterCodes["nullCharacter"] = 0] = "nullCharacter"; - CharacterCodes[CharacterCodes["maxAsciiCharacter"] = 0x7F] = "maxAsciiCharacter"; - CharacterCodes[CharacterCodes["lineFeed"] = 0x0A] = "lineFeed"; - CharacterCodes[CharacterCodes["carriageReturn"] = 0x0D] = "carriageReturn"; - CharacterCodes[CharacterCodes["lineSeparator"] = 0x2028] = "lineSeparator"; - CharacterCodes[CharacterCodes["paragraphSeparator"] = 0x2029] = "paragraphSeparator"; - CharacterCodes[CharacterCodes["nextLine"] = 0x0085] = "nextLine"; - CharacterCodes[CharacterCodes["space"] = 0x0020] = "space"; - CharacterCodes[CharacterCodes["nonBreakingSpace"] = 0x00A0] = "nonBreakingSpace"; - CharacterCodes[CharacterCodes["enQuad"] = 0x2000] = "enQuad"; - CharacterCodes[CharacterCodes["emQuad"] = 0x2001] = "emQuad"; - CharacterCodes[CharacterCodes["enSpace"] = 0x2002] = "enSpace"; - CharacterCodes[CharacterCodes["emSpace"] = 0x2003] = "emSpace"; - CharacterCodes[CharacterCodes["threePerEmSpace"] = 0x2004] = "threePerEmSpace"; - CharacterCodes[CharacterCodes["fourPerEmSpace"] = 0x2005] = "fourPerEmSpace"; - CharacterCodes[CharacterCodes["sixPerEmSpace"] = 0x2006] = "sixPerEmSpace"; - CharacterCodes[CharacterCodes["figureSpace"] = 0x2007] = "figureSpace"; - CharacterCodes[CharacterCodes["punctuationSpace"] = 0x2008] = "punctuationSpace"; - CharacterCodes[CharacterCodes["thinSpace"] = 0x2009] = "thinSpace"; - CharacterCodes[CharacterCodes["hairSpace"] = 0x200A] = "hairSpace"; - CharacterCodes[CharacterCodes["zeroWidthSpace"] = 0x200B] = "zeroWidthSpace"; - CharacterCodes[CharacterCodes["narrowNoBreakSpace"] = 0x202F] = "narrowNoBreakSpace"; - CharacterCodes[CharacterCodes["ideographicSpace"] = 0x3000] = "ideographicSpace"; - CharacterCodes[CharacterCodes["mathematicalSpace"] = 0x205F] = "mathematicalSpace"; - CharacterCodes[CharacterCodes["ogham"] = 0x1680] = "ogham"; - CharacterCodes[CharacterCodes["_"] = 0x5F] = "_"; - CharacterCodes[CharacterCodes["$"] = 0x24] = "$"; - CharacterCodes[CharacterCodes["_0"] = 0x30] = "_0"; - CharacterCodes[CharacterCodes["_1"] = 0x31] = "_1"; - CharacterCodes[CharacterCodes["_2"] = 0x32] = "_2"; - CharacterCodes[CharacterCodes["_3"] = 0x33] = "_3"; - CharacterCodes[CharacterCodes["_4"] = 0x34] = "_4"; - CharacterCodes[CharacterCodes["_5"] = 0x35] = "_5"; - CharacterCodes[CharacterCodes["_6"] = 0x36] = "_6"; - CharacterCodes[CharacterCodes["_7"] = 0x37] = "_7"; - CharacterCodes[CharacterCodes["_8"] = 0x38] = "_8"; - CharacterCodes[CharacterCodes["_9"] = 0x39] = "_9"; - CharacterCodes[CharacterCodes["a"] = 0x61] = "a"; - CharacterCodes[CharacterCodes["b"] = 0x62] = "b"; - CharacterCodes[CharacterCodes["c"] = 0x63] = "c"; - CharacterCodes[CharacterCodes["d"] = 0x64] = "d"; - CharacterCodes[CharacterCodes["e"] = 0x65] = "e"; - CharacterCodes[CharacterCodes["f"] = 0x66] = "f"; - CharacterCodes[CharacterCodes["g"] = 0x67] = "g"; - CharacterCodes[CharacterCodes["h"] = 0x68] = "h"; - CharacterCodes[CharacterCodes["i"] = 0x69] = "i"; - CharacterCodes[CharacterCodes["j"] = 0x6A] = "j"; - CharacterCodes[CharacterCodes["k"] = 0x6B] = "k"; - CharacterCodes[CharacterCodes["l"] = 0x6C] = "l"; - CharacterCodes[CharacterCodes["m"] = 0x6D] = "m"; - CharacterCodes[CharacterCodes["n"] = 0x6E] = "n"; - CharacterCodes[CharacterCodes["o"] = 0x6F] = "o"; - CharacterCodes[CharacterCodes["p"] = 0x70] = "p"; - CharacterCodes[CharacterCodes["q"] = 0x71] = "q"; - CharacterCodes[CharacterCodes["r"] = 0x72] = "r"; - CharacterCodes[CharacterCodes["s"] = 0x73] = "s"; - CharacterCodes[CharacterCodes["t"] = 0x74] = "t"; - CharacterCodes[CharacterCodes["u"] = 0x75] = "u"; - CharacterCodes[CharacterCodes["v"] = 0x76] = "v"; - CharacterCodes[CharacterCodes["w"] = 0x77] = "w"; - CharacterCodes[CharacterCodes["x"] = 0x78] = "x"; - CharacterCodes[CharacterCodes["y"] = 0x79] = "y"; - CharacterCodes[CharacterCodes["z"] = 0x7A] = "z"; - CharacterCodes[CharacterCodes["A"] = 0x41] = "A"; - CharacterCodes[CharacterCodes["B"] = 0x42] = "B"; - CharacterCodes[CharacterCodes["C"] = 0x43] = "C"; - CharacterCodes[CharacterCodes["D"] = 0x44] = "D"; - CharacterCodes[CharacterCodes["E"] = 0x45] = "E"; - CharacterCodes[CharacterCodes["F"] = 0x46] = "F"; - CharacterCodes[CharacterCodes["G"] = 0x47] = "G"; - CharacterCodes[CharacterCodes["H"] = 0x48] = "H"; - CharacterCodes[CharacterCodes["I"] = 0x49] = "I"; - CharacterCodes[CharacterCodes["J"] = 0x4A] = "J"; - CharacterCodes[CharacterCodes["K"] = 0x4B] = "K"; - CharacterCodes[CharacterCodes["L"] = 0x4C] = "L"; - CharacterCodes[CharacterCodes["M"] = 0x4D] = "M"; - CharacterCodes[CharacterCodes["N"] = 0x4E] = "N"; - CharacterCodes[CharacterCodes["O"] = 0x4F] = "O"; - CharacterCodes[CharacterCodes["P"] = 0x50] = "P"; - CharacterCodes[CharacterCodes["Q"] = 0x51] = "Q"; - CharacterCodes[CharacterCodes["R"] = 0x52] = "R"; - CharacterCodes[CharacterCodes["S"] = 0x53] = "S"; - CharacterCodes[CharacterCodes["T"] = 0x54] = "T"; - CharacterCodes[CharacterCodes["U"] = 0x55] = "U"; - CharacterCodes[CharacterCodes["V"] = 0x56] = "V"; - CharacterCodes[CharacterCodes["W"] = 0x57] = "W"; - CharacterCodes[CharacterCodes["X"] = 0x58] = "X"; - CharacterCodes[CharacterCodes["Y"] = 0x59] = "Y"; - CharacterCodes[CharacterCodes["Z"] = 0x5a] = "Z"; - CharacterCodes[CharacterCodes["ampersand"] = 0x26] = "ampersand"; - CharacterCodes[CharacterCodes["asterisk"] = 0x2A] = "asterisk"; - CharacterCodes[CharacterCodes["at"] = 0x40] = "at"; - CharacterCodes[CharacterCodes["backslash"] = 0x5C] = "backslash"; - CharacterCodes[CharacterCodes["bar"] = 0x7C] = "bar"; - CharacterCodes[CharacterCodes["caret"] = 0x5E] = "caret"; - CharacterCodes[CharacterCodes["closeBrace"] = 0x7D] = "closeBrace"; - CharacterCodes[CharacterCodes["closeBracket"] = 0x5D] = "closeBracket"; - CharacterCodes[CharacterCodes["closeParen"] = 0x29] = "closeParen"; - CharacterCodes[CharacterCodes["colon"] = 0x3A] = "colon"; - CharacterCodes[CharacterCodes["comma"] = 0x2C] = "comma"; - CharacterCodes[CharacterCodes["dot"] = 0x2E] = "dot"; - CharacterCodes[CharacterCodes["doubleQuote"] = 0x22] = "doubleQuote"; - CharacterCodes[CharacterCodes["equals"] = 0x3D] = "equals"; - CharacterCodes[CharacterCodes["exclamation"] = 0x21] = "exclamation"; - CharacterCodes[CharacterCodes["greaterThan"] = 0x3E] = "greaterThan"; - CharacterCodes[CharacterCodes["lessThan"] = 0x3C] = "lessThan"; - CharacterCodes[CharacterCodes["minus"] = 0x2D] = "minus"; - CharacterCodes[CharacterCodes["openBrace"] = 0x7B] = "openBrace"; - CharacterCodes[CharacterCodes["openBracket"] = 0x5B] = "openBracket"; - CharacterCodes[CharacterCodes["openParen"] = 0x28] = "openParen"; - CharacterCodes[CharacterCodes["percent"] = 0x25] = "percent"; - CharacterCodes[CharacterCodes["plus"] = 0x2B] = "plus"; - CharacterCodes[CharacterCodes["question"] = 0x3F] = "question"; - CharacterCodes[CharacterCodes["semicolon"] = 0x3B] = "semicolon"; - CharacterCodes[CharacterCodes["singleQuote"] = 0x27] = "singleQuote"; - CharacterCodes[CharacterCodes["slash"] = 0x2F] = "slash"; - CharacterCodes[CharacterCodes["tilde"] = 0x7E] = "tilde"; - CharacterCodes[CharacterCodes["backspace"] = 0x08] = "backspace"; - CharacterCodes[CharacterCodes["formFeed"] = 0x0C] = "formFeed"; - CharacterCodes[CharacterCodes["byteOrderMark"] = 0xFEFF] = "byteOrderMark"; - CharacterCodes[CharacterCodes["tab"] = 0x09] = "tab"; - CharacterCodes[CharacterCodes["verticalTab"] = 0x0B] = "verticalTab"; - })(ts.CharacterCodes || (ts.CharacterCodes = {})); - var CharacterCodes = ts.CharacterCodes; - (function (SymbolDisplayPartKind) { - SymbolDisplayPartKind[SymbolDisplayPartKind["aliasName"] = 0] = "aliasName"; - SymbolDisplayPartKind[SymbolDisplayPartKind["className"] = 1] = "className"; - SymbolDisplayPartKind[SymbolDisplayPartKind["enumName"] = 2] = "enumName"; - SymbolDisplayPartKind[SymbolDisplayPartKind["fieldName"] = 3] = "fieldName"; - SymbolDisplayPartKind[SymbolDisplayPartKind["interfaceName"] = 4] = "interfaceName"; - SymbolDisplayPartKind[SymbolDisplayPartKind["keyword"] = 5] = "keyword"; - SymbolDisplayPartKind[SymbolDisplayPartKind["lineBreak"] = 6] = "lineBreak"; - SymbolDisplayPartKind[SymbolDisplayPartKind["numericLiteral"] = 7] = "numericLiteral"; - SymbolDisplayPartKind[SymbolDisplayPartKind["stringLiteral"] = 8] = "stringLiteral"; - SymbolDisplayPartKind[SymbolDisplayPartKind["localName"] = 9] = "localName"; - SymbolDisplayPartKind[SymbolDisplayPartKind["methodName"] = 10] = "methodName"; - SymbolDisplayPartKind[SymbolDisplayPartKind["moduleName"] = 11] = "moduleName"; - SymbolDisplayPartKind[SymbolDisplayPartKind["operator"] = 12] = "operator"; - SymbolDisplayPartKind[SymbolDisplayPartKind["parameterName"] = 13] = "parameterName"; - SymbolDisplayPartKind[SymbolDisplayPartKind["propertyName"] = 14] = "propertyName"; - SymbolDisplayPartKind[SymbolDisplayPartKind["punctuation"] = 15] = "punctuation"; - SymbolDisplayPartKind[SymbolDisplayPartKind["space"] = 16] = "space"; - SymbolDisplayPartKind[SymbolDisplayPartKind["text"] = 17] = "text"; - SymbolDisplayPartKind[SymbolDisplayPartKind["typeParameterName"] = 18] = "typeParameterName"; - SymbolDisplayPartKind[SymbolDisplayPartKind["enumMemberName"] = 19] = "enumMemberName"; - SymbolDisplayPartKind[SymbolDisplayPartKind["functionName"] = 20] = "functionName"; - SymbolDisplayPartKind[SymbolDisplayPartKind["regularExpressionLiteral"] = 21] = "regularExpressionLiteral"; - })(ts.SymbolDisplayPartKind || (ts.SymbolDisplayPartKind = {})); - var SymbolDisplayPartKind = ts.SymbolDisplayPartKind; -})(ts || (ts = {})); -var ts; -(function (ts) { - function forEach(array, callback) { - var result; - if (array) { - for (var i = 0, len = array.length; i < len; i++) { - if (result = callback(array[i])) { - break; - } - } - } - return result; - } - ts.forEach = forEach; - function contains(array, value) { - if (array) { - for (var i = 0, len = array.length; i < len; i++) { - if (array[i] === value) { - return true; - } - } - } - return false; - } - ts.contains = contains; - function indexOf(array, value) { - if (array) { - for (var i = 0, len = array.length; i < len; i++) { - if (array[i] === value) { - return i; - } - } - } - return -1; - } - ts.indexOf = indexOf; - function countWhere(array, predicate) { - var count = 0; - if (array) { - for (var i = 0, len = array.length; i < len; i++) { - if (predicate(array[i])) { - count++; - } - } - } - return count; - } - ts.countWhere = countWhere; - function filter(array, f) { - if (array) { - var result = []; - for (var i = 0, len = array.length; i < len; i++) { - var item = array[i]; - if (f(item)) { - result.push(item); - } - } - } - return result; - } - ts.filter = filter; - function map(array, f) { - if (array) { - var result = []; - for (var i = 0, len = array.length; i < len; i++) { - result.push(f(array[i])); - } - } - return result; - } - ts.map = map; - function concatenate(array1, array2) { - if (!array2 || !array2.length) - return array1; - if (!array1 || !array1.length) - return array2; - return array1.concat(array2); - } - ts.concatenate = concatenate; - function uniqueElements(array) { - if (array) { - var result = []; - for (var i = 0, len = array.length; i < len; i++) { - var item = array[i]; - if (!contains(result, item)) - result.push(item); - } - } - return result; - } - ts.uniqueElements = uniqueElements; - function sum(array, prop) { - var result = 0; - for (var i = 0; i < array.length; i++) { - result += array[i][prop]; - } - return result; - } - ts.sum = sum; - function binarySearch(array, value) { - var low = 0; - var high = array.length - 1; - while (low <= high) { - var middle = low + ((high - low) >> 1); - var midValue = array[middle]; - if (midValue === value) { - return middle; - } - else if (midValue > value) { - high = middle - 1; - } - else { - low = middle + 1; - } - } - return ~low; - } - ts.binarySearch = binarySearch; - var hasOwnProperty = Object.prototype.hasOwnProperty; - function hasProperty(map, key) { - return hasOwnProperty.call(map, key); - } - ts.hasProperty = hasProperty; - function getProperty(map, key) { - return hasOwnProperty.call(map, key) ? map[key] : undefined; - } - ts.getProperty = getProperty; - function isEmpty(map) { - for (var id in map) { - if (hasProperty(map, id)) { - return false; - } - } - return true; - } - ts.isEmpty = isEmpty; - function clone(object) { - var result = {}; - for (var id in object) { - result[id] = object[id]; - } - return result; - } - ts.clone = clone; - function forEachValue(map, callback) { - var result; - for (var id in map) { - if (result = callback(map[id])) - break; - } - return result; - } - ts.forEachValue = forEachValue; - function forEachKey(map, callback) { - var result; - for (var id in map) { - if (result = callback(id)) - break; - } - return result; - } - ts.forEachKey = forEachKey; - function lookUp(map, key) { - return hasProperty(map, key) ? map[key] : undefined; - } - ts.lookUp = lookUp; - function mapToArray(map) { - var result = []; - for (var id in map) { - result.push(map[id]); - } - return result; - } - ts.mapToArray = mapToArray; - function arrayToMap(array, makeKey) { - var result = {}; - forEach(array, function (value) { - result[makeKey(value)] = value; - }); - return result; - } - ts.arrayToMap = arrayToMap; - function formatStringFromArgs(text, args, baseIndex) { - baseIndex = baseIndex || 0; - return text.replace(/{(\d+)}/g, function (match, index) { return args[+index + baseIndex]; }); - } - ts.localizedDiagnosticMessages = undefined; - function getLocaleSpecificMessage(message) { - return ts.localizedDiagnosticMessages && ts.localizedDiagnosticMessages[message] ? ts.localizedDiagnosticMessages[message] : message; - } - ts.getLocaleSpecificMessage = getLocaleSpecificMessage; - function createFileDiagnostic(file, start, length, message) { - Debug.assert(start >= 0, "start must be non-negative, is " + start); - Debug.assert(length >= 0, "length must be non-negative, is " + length); - var text = getLocaleSpecificMessage(message.key); - if (arguments.length > 4) { - text = formatStringFromArgs(text, arguments, 4); - } - return { - file: file, - start: start, - length: length, - messageText: text, - category: message.category, - code: message.code - }; - } - ts.createFileDiagnostic = createFileDiagnostic; - function createCompilerDiagnostic(message) { - var text = getLocaleSpecificMessage(message.key); - if (arguments.length > 1) { - text = formatStringFromArgs(text, arguments, 1); - } - return { - file: undefined, - start: undefined, - length: undefined, - messageText: text, - category: message.category, - code: message.code - }; - } - ts.createCompilerDiagnostic = createCompilerDiagnostic; - function chainDiagnosticMessages(details, message) { - var text = getLocaleSpecificMessage(message.key); - if (arguments.length > 2) { - text = formatStringFromArgs(text, arguments, 2); - } - return { - messageText: text, - category: message.category, - code: message.code, - next: details - }; - } - ts.chainDiagnosticMessages = chainDiagnosticMessages; - function flattenDiagnosticChain(file, start, length, diagnosticChain, newLine) { - Debug.assert(start >= 0, "start must be non-negative, is " + start); - Debug.assert(length >= 0, "length must be non-negative, is " + length); - var code = diagnosticChain.code; - var category = diagnosticChain.category; - var messageText = ""; - var indent = 0; - while (diagnosticChain) { - if (indent) { - messageText += newLine; - for (var i = 0; i < indent; i++) { - messageText += " "; - } - } - messageText += diagnosticChain.messageText; - indent++; - diagnosticChain = diagnosticChain.next; - } - return { - file: file, - start: start, - length: length, - code: code, - category: category, - messageText: messageText - }; - } - ts.flattenDiagnosticChain = flattenDiagnosticChain; - function compareValues(a, b) { - if (a === b) - return 0; - if (a === undefined) - return -1; - if (b === undefined) - return 1; - return a < b ? -1 : 1; - } - ts.compareValues = compareValues; - function getDiagnosticFilename(diagnostic) { - return diagnostic.file ? diagnostic.file.filename : undefined; - } - function compareDiagnostics(d1, d2) { - return compareValues(getDiagnosticFilename(d1), getDiagnosticFilename(d2)) || compareValues(d1.start, d2.start) || compareValues(d1.length, d2.length) || compareValues(d1.code, d2.code) || compareValues(d1.messageText, d2.messageText) || 0; - } - ts.compareDiagnostics = compareDiagnostics; - function deduplicateSortedDiagnostics(diagnostics) { - if (diagnostics.length < 2) { - return diagnostics; - } - var newDiagnostics = [diagnostics[0]]; - var previousDiagnostic = diagnostics[0]; - for (var i = 1; i < diagnostics.length; i++) { - var currentDiagnostic = diagnostics[i]; - var isDupe = compareDiagnostics(currentDiagnostic, previousDiagnostic) === 0; - if (!isDupe) { - newDiagnostics.push(currentDiagnostic); - previousDiagnostic = currentDiagnostic; - } - } - return newDiagnostics; - } - ts.deduplicateSortedDiagnostics = deduplicateSortedDiagnostics; - function normalizeSlashes(path) { - return path.replace(/\\/g, "/"); - } - ts.normalizeSlashes = normalizeSlashes; - function getRootLength(path) { - if (path.charCodeAt(0) === 47 /* slash */) { - if (path.charCodeAt(1) !== 47 /* slash */) - return 1; - var p1 = path.indexOf("/", 2); - if (p1 < 0) - return 2; - var p2 = path.indexOf("/", p1 + 1); - if (p2 < 0) - return p1 + 1; - return p2 + 1; - } - if (path.charCodeAt(1) === 58 /* colon */) { - if (path.charCodeAt(2) === 47 /* slash */) - return 3; - return 2; - } - return 0; - } - ts.getRootLength = getRootLength; - ts.directorySeparator = "/"; - function getNormalizedParts(normalizedSlashedPath, rootLength) { - var parts = normalizedSlashedPath.substr(rootLength).split(ts.directorySeparator); - var normalized = []; - for (var i = 0; i < parts.length; i++) { - var part = parts[i]; - if (part !== ".") { - if (part === ".." && normalized.length > 0 && normalized[normalized.length - 1] !== "..") { - normalized.pop(); - } - else { - normalized.push(part); - } - } - } - return normalized; - } - function normalizePath(path) { - var path = normalizeSlashes(path); - var rootLength = getRootLength(path); - var normalized = getNormalizedParts(path, rootLength); - return path.substr(0, rootLength) + normalized.join(ts.directorySeparator); - } - ts.normalizePath = normalizePath; - function getDirectoryPath(path) { - return path.substr(0, Math.max(getRootLength(path), path.lastIndexOf(ts.directorySeparator))); - } - ts.getDirectoryPath = getDirectoryPath; - function isUrl(path) { - return path && !isRootedDiskPath(path) && path.indexOf("://") !== -1; - } - ts.isUrl = isUrl; - function isRootedDiskPath(path) { - return getRootLength(path) !== 0; - } - ts.isRootedDiskPath = isRootedDiskPath; - function normalizedPathComponents(path, rootLength) { - var normalizedParts = getNormalizedParts(path, rootLength); - return [path.substr(0, rootLength)].concat(normalizedParts); - } - function getNormalizedPathComponents(path, currentDirectory) { - var path = normalizeSlashes(path); - var rootLength = getRootLength(path); - if (rootLength == 0) { - path = combinePaths(normalizeSlashes(currentDirectory), path); - rootLength = getRootLength(path); - } - return normalizedPathComponents(path, rootLength); - } - ts.getNormalizedPathComponents = getNormalizedPathComponents; - function getNormalizedPathFromPathComponents(pathComponents) { - if (pathComponents && pathComponents.length) { - return pathComponents[0] + pathComponents.slice(1).join(ts.directorySeparator); - } - } - ts.getNormalizedPathFromPathComponents = getNormalizedPathFromPathComponents; - function getNormalizedPathComponentsOfUrl(url) { - var urlLength = url.length; - var rootLength = url.indexOf("://") + "://".length; - while (rootLength < urlLength) { - if (url.charCodeAt(rootLength) === 47 /* slash */) { - rootLength++; - } - else { - break; - } - } - if (rootLength === urlLength) { - return [url]; - } - var indexOfNextSlash = url.indexOf(ts.directorySeparator, rootLength); - if (indexOfNextSlash !== -1) { - rootLength = indexOfNextSlash + 1; - return normalizedPathComponents(url, rootLength); - } - else { - return [url + ts.directorySeparator]; - } - } - function getNormalizedPathOrUrlComponents(pathOrUrl, currentDirectory) { - if (isUrl(pathOrUrl)) { - return getNormalizedPathComponentsOfUrl(pathOrUrl); - } - else { - return getNormalizedPathComponents(pathOrUrl, currentDirectory); - } - } - function getRelativePathToDirectoryOrUrl(directoryPathOrUrl, relativeOrAbsolutePath, currentDirectory, getCanonicalFileName, isAbsolutePathAnUrl) { - var pathComponents = getNormalizedPathOrUrlComponents(relativeOrAbsolutePath, currentDirectory); - var directoryComponents = getNormalizedPathOrUrlComponents(directoryPathOrUrl, currentDirectory); - if (directoryComponents.length > 1 && directoryComponents[directoryComponents.length - 1] === "") { - directoryComponents.length--; - } - for (var joinStartIndex = 0; joinStartIndex < pathComponents.length && joinStartIndex < directoryComponents.length; joinStartIndex++) { - if (getCanonicalFileName(directoryComponents[joinStartIndex]) !== getCanonicalFileName(pathComponents[joinStartIndex])) { - break; - } - } - if (joinStartIndex) { - var relativePath = ""; - var relativePathComponents = pathComponents.slice(joinStartIndex, pathComponents.length); - for (; joinStartIndex < directoryComponents.length; joinStartIndex++) { - if (directoryComponents[joinStartIndex] !== "") { - relativePath = relativePath + ".." + ts.directorySeparator; - } - } - return relativePath + relativePathComponents.join(ts.directorySeparator); - } - var absolutePath = getNormalizedPathFromPathComponents(pathComponents); - if (isAbsolutePathAnUrl && isRootedDiskPath(absolutePath)) { - absolutePath = "file:///" + absolutePath; - } - return absolutePath; - } - ts.getRelativePathToDirectoryOrUrl = getRelativePathToDirectoryOrUrl; - function getBaseFilename(path) { - var i = path.lastIndexOf(ts.directorySeparator); - return i < 0 ? path : path.substring(i + 1); - } - ts.getBaseFilename = getBaseFilename; - function combinePaths(path1, path2) { - if (!(path1 && path1.length)) - return path2; - if (!(path2 && path2.length)) - return path1; - if (path2.charAt(0) === ts.directorySeparator) - return path2; - if (path1.charAt(path1.length - 1) === ts.directorySeparator) - return path1 + path2; - return path1 + ts.directorySeparator + path2; - } - ts.combinePaths = combinePaths; - function fileExtensionIs(path, extension) { - var pathLen = path.length; - var extLen = extension.length; - return pathLen > extLen && path.substr(pathLen - extLen, extLen) === extension; - } - ts.fileExtensionIs = fileExtensionIs; - var supportedExtensions = [".d.ts", ".ts", ".js"]; - function removeFileExtension(path) { - for (var i = 0; i < supportedExtensions.length; i++) { - var ext = supportedExtensions[i]; - if (fileExtensionIs(path, ext)) { - return path.substr(0, path.length - ext.length); - } - } - return path; - } - ts.removeFileExtension = removeFileExtension; - var escapedCharsRegExp = /[\t\v\f\b\0\r\n\"\\\u2028\u2029\u0085]/g; - var escapedCharsMap = { - "\t": "\\t", - "\v": "\\v", - "\f": "\\f", - "\b": "\\b", - "\0": "\\0", - "\r": "\\r", - "\n": "\\n", - "\"": "\\\"", - "\u2028": "\\u2028", - "\u2029": "\\u2029", - "\u0085": "\\u0085" - }; - function escapeString(s) { - return escapedCharsRegExp.test(s) ? s.replace(escapedCharsRegExp, function (c) { - return escapedCharsMap[c] || c; - }) : s; - } - ts.escapeString = escapeString; - function Symbol(flags, name) { - this.flags = flags; - this.name = name; - this.declarations = undefined; - } - function Type(checker, flags) { - this.flags = flags; - } - function Signature(checker) { - } - ts.objectAllocator = { - getNodeConstructor: function (kind) { - function Node() { - } - Node.prototype = { - kind: kind, - pos: 0, - end: 0, - flags: 0, - parent: undefined - }; - return Node; - }, - getSymbolConstructor: function () { return Symbol; }, - getTypeConstructor: function () { return Type; }, - getSignatureConstructor: function () { return Signature; } - }; - (function (AssertionLevel) { - AssertionLevel[AssertionLevel["None"] = 0] = "None"; - AssertionLevel[AssertionLevel["Normal"] = 1] = "Normal"; - AssertionLevel[AssertionLevel["Aggressive"] = 2] = "Aggressive"; - AssertionLevel[AssertionLevel["VeryAggressive"] = 3] = "VeryAggressive"; - })(ts.AssertionLevel || (ts.AssertionLevel = {})); - var AssertionLevel = ts.AssertionLevel; - var Debug; - (function (Debug) { - var currentAssertionLevel = 0 /* None */; - function shouldAssert(level) { - return currentAssertionLevel >= level; - } - Debug.shouldAssert = shouldAssert; - function assert(expression, message, verboseDebugInfo) { - if (!expression) { - var verboseDebugString = ""; - if (verboseDebugInfo) { - verboseDebugString = "\r\nVerbose Debug Information: " + verboseDebugInfo(); - } - throw new Error("Debug Failure. False expression: " + (message || "") + verboseDebugString); - } - } - Debug.assert = assert; - function fail(message) { - Debug.assert(false, message); - } - Debug.fail = fail; - })(Debug = ts.Debug || (ts.Debug = {})); -})(ts || (ts = {})); -var ts; -(function (ts) { - var nodeConstructors = new Array(185 /* Count */); - function getNodeConstructor(kind) { - return nodeConstructors[kind] || (nodeConstructors[kind] = ts.objectAllocator.getNodeConstructor(kind)); - } - ts.getNodeConstructor = getNodeConstructor; - function createRootNode(kind, pos, end, flags) { - var node = new (getNodeConstructor(kind))(); - node.pos = pos; - node.end = end; - node.flags = flags; - return node; - } - function getSourceFileOfNode(node) { - while (node && node.kind !== 182 /* SourceFile */) - node = node.parent; - return node; - } - ts.getSourceFileOfNode = getSourceFileOfNode; - function nodePosToString(node) { - var file = getSourceFileOfNode(node); - var loc = file.getLineAndCharacterFromPosition(node.pos); - return file.filename + "(" + loc.line + "," + loc.character + ")"; - } - ts.nodePosToString = nodePosToString; - function getStartPosOfNode(node) { - return node.pos; - } - ts.getStartPosOfNode = getStartPosOfNode; - function getTokenPosOfNode(node, sourceFile) { - return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos); - } - ts.getTokenPosOfNode = getTokenPosOfNode; - function getTextOfNodeFromSourceText(sourceText, node) { - return sourceText.substring(ts.skipTrivia(sourceText, node.pos), node.end); - } - ts.getTextOfNodeFromSourceText = getTextOfNodeFromSourceText; - function getTextOfNode(node) { - var text = getSourceFileOfNode(node).text; - return text.substring(ts.skipTrivia(text, node.pos), node.end); - } - ts.getTextOfNode = getTextOfNode; - function escapeIdentifier(identifier) { - return identifier.length >= 2 && identifier.charCodeAt(0) === 95 /* _ */ && identifier.charCodeAt(1) === 95 /* _ */ ? "_" + identifier : identifier; - } - ts.escapeIdentifier = escapeIdentifier; - function unescapeIdentifier(identifier) { - return identifier.length >= 3 && identifier.charCodeAt(0) === 95 /* _ */ && identifier.charCodeAt(1) === 95 /* _ */ && identifier.charCodeAt(2) === 95 /* _ */ ? identifier.substr(1) : identifier; - } - ts.unescapeIdentifier = unescapeIdentifier; - function identifierToString(identifier) { - return identifier.kind === 115 /* Missing */ ? "(Missing)" : getTextOfNode(identifier); - } - ts.identifierToString = identifierToString; - function createDiagnosticForNode(node, message, arg0, arg1, arg2) { - node = getErrorSpanForNode(node); - var file = getSourceFileOfNode(node); - var start = node.kind === 115 /* Missing */ ? node.pos : ts.skipTrivia(file.text, node.pos); - var length = node.end - start; - return ts.createFileDiagnostic(file, start, length, message, arg0, arg1, arg2); - } - ts.createDiagnosticForNode = createDiagnosticForNode; - function createDiagnosticForNodeFromMessageChain(node, messageChain, newLine) { - node = getErrorSpanForNode(node); - var file = getSourceFileOfNode(node); - var start = ts.skipTrivia(file.text, node.pos); - var length = node.end - start; - return ts.flattenDiagnosticChain(file, start, length, messageChain, newLine); - } - ts.createDiagnosticForNodeFromMessageChain = createDiagnosticForNodeFromMessageChain; - function getErrorSpanForNode(node) { - var errorSpan; - switch (node.kind) { - case 171 /* VariableDeclaration */: - case 174 /* ClassDeclaration */: - case 175 /* InterfaceDeclaration */: - case 177 /* ModuleDeclaration */: - case 176 /* EnumDeclaration */: - case 181 /* EnumMember */: - errorSpan = node.name; - break; - } - return errorSpan && errorSpan.pos < errorSpan.end ? errorSpan : node; - } - ts.getErrorSpanForNode = getErrorSpanForNode; - function isExternalModule(file) { - return file.externalModuleIndicator !== undefined; - } - ts.isExternalModule = isExternalModule; - function isDeclarationFile(file) { - return (file.flags & 1024 /* DeclarationFile */) !== 0; - } - ts.isDeclarationFile = isDeclarationFile; - function isPrologueDirective(node) { - return node.kind === 151 /* ExpressionStatement */ && node.expression.kind === 7 /* StringLiteral */; - } - ts.isPrologueDirective = isPrologueDirective; - function isEvalOrArgumentsIdentifier(node) { - return node.kind === 59 /* Identifier */ && node.text && (node.text === "eval" || node.text === "arguments"); - } - function isUseStrictPrologueDirective(node) { - ts.Debug.assert(isPrologueDirective(node)); - return node.expression.text === "use strict"; - } - function getLeadingCommentRangesOfNode(node, sourceFileOfNode) { - sourceFileOfNode = sourceFileOfNode || getSourceFileOfNode(node); - if (node.kind === 118 /* Parameter */ || node.kind === 117 /* TypeParameter */) { - return ts.concatenate(ts.getTrailingCommentRanges(sourceFileOfNode.text, node.pos), ts.getLeadingCommentRanges(sourceFileOfNode.text, node.pos)); - } - else { - return ts.getLeadingCommentRanges(sourceFileOfNode.text, node.pos); - } - } - ts.getLeadingCommentRangesOfNode = getLeadingCommentRangesOfNode; - function getJsDocComments(node, sourceFileOfNode) { - return ts.filter(getLeadingCommentRangesOfNode(node, sourceFileOfNode), function (comment) { return isJsDocComment(comment); }); - function isJsDocComment(comment) { - return sourceFileOfNode.text.charCodeAt(comment.pos + 1) === 42 /* asterisk */ && sourceFileOfNode.text.charCodeAt(comment.pos + 2) === 42 /* asterisk */ && sourceFileOfNode.text.charCodeAt(comment.pos + 3) !== 47 /* slash */; - } - } - ts.getJsDocComments = getJsDocComments; - ts.fullTripleSlashReferencePathRegEx = /^(\/\/\/\s*/; - function forEachChild(node, cbNode, cbNodes) { - function child(node) { - if (node) - return cbNode(node); - } - function children(nodes) { - if (nodes) { - if (cbNodes) - return cbNodes(nodes); - var result; - for (var i = 0, len = nodes.length; i < len; i++) { - if (result = cbNode(nodes[i])) - break; - } - return result; - } - } - if (!node) - return; - switch (node.kind) { - case 116 /* QualifiedName */: - return child(node.left) || child(node.right); - case 117 /* TypeParameter */: - return child(node.name) || child(node.constraint); - case 118 /* Parameter */: - return child(node.name) || child(node.type) || child(node.initializer); - case 119 /* Property */: - case 134 /* PropertyAssignment */: - return child(node.name) || child(node.type) || child(node.initializer); - case 124 /* CallSignature */: - case 125 /* ConstructSignature */: - case 126 /* IndexSignature */: - return children(node.typeParameters) || children(node.parameters) || child(node.type); - case 120 /* Method */: - case 121 /* Constructor */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 141 /* FunctionExpression */: - case 172 /* FunctionDeclaration */: - case 142 /* ArrowFunction */: - return child(node.name) || children(node.typeParameters) || children(node.parameters) || child(node.type) || child(node.body); - case 127 /* TypeReference */: - return child(node.typeName) || children(node.typeArguments); - case 128 /* TypeQuery */: - return child(node.exprName); - case 129 /* TypeLiteral */: - return children(node.members); - case 130 /* ArrayType */: - return child(node.elementType); - case 131 /* TupleType */: - return children(node.elementTypes); - case 132 /* ArrayLiteral */: - return children(node.elements); - case 133 /* ObjectLiteral */: - return children(node.properties); - case 135 /* PropertyAccess */: - return child(node.left) || child(node.right); - case 136 /* IndexedAccess */: - return child(node.object) || child(node.index); - case 137 /* CallExpression */: - case 138 /* NewExpression */: - return child(node.func) || children(node.typeArguments) || children(node.arguments); - case 139 /* TypeAssertion */: - return child(node.type) || child(node.operand); - case 140 /* ParenExpression */: - return child(node.expression); - case 143 /* PrefixOperator */: - case 144 /* PostfixOperator */: - return child(node.operand); - case 145 /* BinaryExpression */: - return child(node.left) || child(node.right); - case 146 /* ConditionalExpression */: - return child(node.condition) || child(node.whenTrue) || child(node.whenFalse); - case 148 /* Block */: - case 167 /* TryBlock */: - case 169 /* FinallyBlock */: - case 173 /* FunctionBlock */: - case 178 /* ModuleBlock */: - case 182 /* SourceFile */: - return children(node.statements); - case 149 /* VariableStatement */: - return children(node.declarations); - case 151 /* ExpressionStatement */: - return child(node.expression); - case 152 /* IfStatement */: - return child(node.expression) || child(node.thenStatement) || child(node.elseStatement); - case 153 /* DoStatement */: - return child(node.statement) || child(node.expression); - case 154 /* WhileStatement */: - return child(node.expression) || child(node.statement); - case 155 /* ForStatement */: - return children(node.declarations) || child(node.initializer) || child(node.condition) || child(node.iterator) || child(node.statement); - case 156 /* ForInStatement */: - return child(node.declaration) || child(node.variable) || child(node.expression) || child(node.statement); - case 157 /* ContinueStatement */: - case 158 /* BreakStatement */: - return child(node.label); - case 159 /* ReturnStatement */: - return child(node.expression); - case 160 /* WithStatement */: - return child(node.expression) || child(node.statement); - case 161 /* SwitchStatement */: - return child(node.expression) || children(node.clauses); - case 162 /* CaseClause */: - case 163 /* DefaultClause */: - return child(node.expression) || children(node.statements); - case 164 /* LabeledStatement */: - return child(node.label) || child(node.statement); - case 165 /* ThrowStatement */: - return child(node.expression); - case 166 /* TryStatement */: - return child(node.tryBlock) || child(node.catchBlock) || child(node.finallyBlock); - case 168 /* CatchBlock */: - return child(node.variable) || children(node.statements); - case 171 /* VariableDeclaration */: - return child(node.name) || child(node.type) || child(node.initializer); - case 174 /* ClassDeclaration */: - return child(node.name) || children(node.typeParameters) || child(node.baseType) || children(node.implementedTypes) || children(node.members); - case 175 /* InterfaceDeclaration */: - return child(node.name) || children(node.typeParameters) || children(node.baseTypes) || children(node.members); - case 176 /* EnumDeclaration */: - return child(node.name) || children(node.members); - case 181 /* EnumMember */: - return child(node.name) || child(node.initializer); - case 177 /* ModuleDeclaration */: - return child(node.name) || child(node.body); - case 179 /* ImportDeclaration */: - return child(node.name) || child(node.entityName) || child(node.externalModuleName); - case 180 /* ExportAssignment */: - return child(node.exportName); - } - } - ts.forEachChild = forEachChild; - function forEachReturnStatement(body, visitor) { - return traverse(body); - function traverse(node) { - switch (node.kind) { - case 159 /* ReturnStatement */: - return visitor(node); - case 148 /* Block */: - case 173 /* FunctionBlock */: - case 152 /* IfStatement */: - case 153 /* DoStatement */: - case 154 /* WhileStatement */: - case 155 /* ForStatement */: - case 156 /* ForInStatement */: - case 160 /* WithStatement */: - case 161 /* SwitchStatement */: - case 162 /* CaseClause */: - case 163 /* DefaultClause */: - case 164 /* LabeledStatement */: - case 166 /* TryStatement */: - case 167 /* TryBlock */: - case 168 /* CatchBlock */: - case 169 /* FinallyBlock */: - return forEachChild(node, traverse); - } - } - } - ts.forEachReturnStatement = forEachReturnStatement; - function isAnyFunction(node) { - if (node) { - switch (node.kind) { - case 141 /* FunctionExpression */: - case 172 /* FunctionDeclaration */: - case 142 /* ArrowFunction */: - case 120 /* Method */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 121 /* Constructor */: - return true; - } - } - return false; - } - ts.isAnyFunction = isAnyFunction; - function getContainingFunction(node) { - while (true) { - node = node.parent; - if (!node || isAnyFunction(node)) { - return node; - } - } - } - ts.getContainingFunction = getContainingFunction; - function getThisContainer(node, includeArrowFunctions) { - while (true) { - node = node.parent; - if (!node) { - return undefined; - } - switch (node.kind) { - case 142 /* ArrowFunction */: - if (!includeArrowFunctions) { - continue; - } - case 172 /* FunctionDeclaration */: - case 141 /* FunctionExpression */: - case 177 /* ModuleDeclaration */: - case 119 /* Property */: - case 120 /* Method */: - case 121 /* Constructor */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 176 /* EnumDeclaration */: - case 182 /* SourceFile */: - return node; - } - } - } - ts.getThisContainer = getThisContainer; - function getSuperContainer(node) { - while (true) { - node = node.parent; - if (!node) { - return undefined; - } - switch (node.kind) { - case 119 /* Property */: - case 120 /* Method */: - case 121 /* Constructor */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - return node; - } - } - } - ts.getSuperContainer = getSuperContainer; - function hasRestParameters(s) { - return s.parameters.length > 0 && (s.parameters[s.parameters.length - 1].flags & 8 /* Rest */) !== 0; - } - ts.hasRestParameters = hasRestParameters; - function isInAmbientContext(node) { - while (node) { - if (node.flags & (2 /* Ambient */ | 1024 /* DeclarationFile */)) - return true; - node = node.parent; - } - return false; - } - ts.isInAmbientContext = isInAmbientContext; - function isDeclaration(node) { - switch (node.kind) { - case 117 /* TypeParameter */: - case 118 /* Parameter */: - case 171 /* VariableDeclaration */: - case 119 /* Property */: - case 134 /* PropertyAssignment */: - case 181 /* EnumMember */: - case 120 /* Method */: - case 172 /* FunctionDeclaration */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 174 /* ClassDeclaration */: - case 175 /* InterfaceDeclaration */: - case 176 /* EnumDeclaration */: - case 177 /* ModuleDeclaration */: - case 179 /* ImportDeclaration */: - return true; - } - return false; - } - ts.isDeclaration = isDeclaration; - function isStatement(n) { - switch (n.kind) { - case 158 /* BreakStatement */: - case 157 /* ContinueStatement */: - case 170 /* DebuggerStatement */: - case 153 /* DoStatement */: - case 151 /* ExpressionStatement */: - case 150 /* EmptyStatement */: - case 156 /* ForInStatement */: - case 155 /* ForStatement */: - case 152 /* IfStatement */: - case 164 /* LabeledStatement */: - case 159 /* ReturnStatement */: - case 161 /* SwitchStatement */: - case 88 /* ThrowKeyword */: - case 166 /* TryStatement */: - case 149 /* VariableStatement */: - case 154 /* WhileStatement */: - case 160 /* WithStatement */: - case 180 /* ExportAssignment */: - return true; - default: - return false; - } - } - ts.isStatement = isStatement; - function isDeclarationOrFunctionExpressionOrCatchVariableName(name) { - if (name.kind !== 59 /* Identifier */ && name.kind !== 7 /* StringLiteral */ && name.kind !== 6 /* NumericLiteral */) { - return false; - } - var parent = name.parent; - if (isDeclaration(parent) || parent.kind === 141 /* FunctionExpression */) { - return parent.name === name; - } - if (parent.kind === 168 /* CatchBlock */) { - return parent.variable === name; - } - return false; - } - ts.isDeclarationOrFunctionExpressionOrCatchVariableName = isDeclarationOrFunctionExpressionOrCatchVariableName; - function getAncestor(node, kind) { - switch (kind) { - case 174 /* ClassDeclaration */: - while (node) { - switch (node.kind) { - case 174 /* ClassDeclaration */: - return node; - case 176 /* EnumDeclaration */: - case 175 /* InterfaceDeclaration */: - case 177 /* ModuleDeclaration */: - case 179 /* ImportDeclaration */: - return undefined; - default: - node = node.parent; - continue; - } - } - break; - default: - while (node) { - if (node.kind === kind) { - return node; - } - node = node.parent; - } - break; - } - return undefined; - } - ts.getAncestor = getAncestor; - var ParsingContext; - (function (ParsingContext) { - ParsingContext[ParsingContext["SourceElements"] = 0] = "SourceElements"; - ParsingContext[ParsingContext["ModuleElements"] = 1] = "ModuleElements"; - ParsingContext[ParsingContext["BlockStatements"] = 2] = "BlockStatements"; - ParsingContext[ParsingContext["SwitchClauses"] = 3] = "SwitchClauses"; - ParsingContext[ParsingContext["SwitchClauseStatements"] = 4] = "SwitchClauseStatements"; - ParsingContext[ParsingContext["TypeMembers"] = 5] = "TypeMembers"; - ParsingContext[ParsingContext["ClassMembers"] = 6] = "ClassMembers"; - ParsingContext[ParsingContext["EnumMembers"] = 7] = "EnumMembers"; - ParsingContext[ParsingContext["BaseTypeReferences"] = 8] = "BaseTypeReferences"; - ParsingContext[ParsingContext["VariableDeclarations"] = 9] = "VariableDeclarations"; - ParsingContext[ParsingContext["ArgumentExpressions"] = 10] = "ArgumentExpressions"; - ParsingContext[ParsingContext["ObjectLiteralMembers"] = 11] = "ObjectLiteralMembers"; - ParsingContext[ParsingContext["ArrayLiteralMembers"] = 12] = "ArrayLiteralMembers"; - ParsingContext[ParsingContext["Parameters"] = 13] = "Parameters"; - ParsingContext[ParsingContext["TypeParameters"] = 14] = "TypeParameters"; - ParsingContext[ParsingContext["TypeArguments"] = 15] = "TypeArguments"; - ParsingContext[ParsingContext["TupleElementTypes"] = 16] = "TupleElementTypes"; - ParsingContext[ParsingContext["Count"] = 17] = "Count"; - })(ParsingContext || (ParsingContext = {})); - var Tristate; - (function (Tristate) { - Tristate[Tristate["False"] = 0] = "False"; - Tristate[Tristate["True"] = 1] = "True"; - Tristate[Tristate["Unknown"] = 2] = "Unknown"; - })(Tristate || (Tristate = {})); - function parsingContextErrors(context) { - switch (context) { - case 0 /* SourceElements */: - return ts.Diagnostics.Declaration_or_statement_expected; - case 1 /* ModuleElements */: - return ts.Diagnostics.Declaration_or_statement_expected; - case 2 /* BlockStatements */: - return ts.Diagnostics.Statement_expected; - case 3 /* SwitchClauses */: - return ts.Diagnostics.case_or_default_expected; - case 4 /* SwitchClauseStatements */: - return ts.Diagnostics.Statement_expected; - case 5 /* TypeMembers */: - return ts.Diagnostics.Property_or_signature_expected; - case 6 /* ClassMembers */: - return ts.Diagnostics.Unexpected_token_A_constructor_method_accessor_or_property_was_expected; - case 7 /* EnumMembers */: - return ts.Diagnostics.Enum_member_expected; - case 8 /* BaseTypeReferences */: - return ts.Diagnostics.Type_reference_expected; - case 9 /* VariableDeclarations */: - return ts.Diagnostics.Variable_declaration_expected; - case 10 /* ArgumentExpressions */: - return ts.Diagnostics.Argument_expression_expected; - case 11 /* ObjectLiteralMembers */: - return ts.Diagnostics.Property_assignment_expected; - case 12 /* ArrayLiteralMembers */: - return ts.Diagnostics.Expression_or_comma_expected; - case 13 /* Parameters */: - return ts.Diagnostics.Parameter_declaration_expected; - case 14 /* TypeParameters */: - return ts.Diagnostics.Type_parameter_declaration_expected; - case 15 /* TypeArguments */: - return ts.Diagnostics.Type_argument_expected; - case 16 /* TupleElementTypes */: - return ts.Diagnostics.Type_expected; - } - } - ; - var LookAheadMode; - (function (LookAheadMode) { - LookAheadMode[LookAheadMode["NotLookingAhead"] = 0] = "NotLookingAhead"; - LookAheadMode[LookAheadMode["NoErrorYet"] = 1] = "NoErrorYet"; - LookAheadMode[LookAheadMode["Error"] = 2] = "Error"; - })(LookAheadMode || (LookAheadMode = {})); - var ModifierContext; - (function (ModifierContext) { - ModifierContext[ModifierContext["SourceElements"] = 0] = "SourceElements"; - ModifierContext[ModifierContext["ModuleElements"] = 1] = "ModuleElements"; - ModifierContext[ModifierContext["ClassMembers"] = 2] = "ClassMembers"; - ModifierContext[ModifierContext["Parameters"] = 3] = "Parameters"; - })(ModifierContext || (ModifierContext = {})); - var ControlBlockContext; - (function (ControlBlockContext) { - ControlBlockContext[ControlBlockContext["NotNested"] = 0] = "NotNested"; - ControlBlockContext[ControlBlockContext["Nested"] = 1] = "Nested"; - ControlBlockContext[ControlBlockContext["CrossingFunctionBoundary"] = 2] = "CrossingFunctionBoundary"; - })(ControlBlockContext || (ControlBlockContext = {})); - function isKeyword(token) { - return ts.SyntaxKind.FirstKeyword <= token && token <= ts.SyntaxKind.LastKeyword; - } - ts.isKeyword = isKeyword; - function isTrivia(token) { - return ts.SyntaxKind.FirstTriviaToken <= token && token <= ts.SyntaxKind.LastTriviaToken; - } - ts.isTrivia = isTrivia; - function isModifier(token) { - switch (token) { - case 102 /* PublicKeyword */: - case 100 /* PrivateKeyword */: - case 101 /* ProtectedKeyword */: - case 103 /* StaticKeyword */: - case 72 /* ExportKeyword */: - case 108 /* DeclareKeyword */: - return true; - } - return false; - } - ts.isModifier = isModifier; - function createSourceFile(filename, sourceText, languageVersion, version, isOpen) { - if (isOpen === void 0) { isOpen = false; } - var file; - var scanner; - var token; - var parsingContext; - var commentRanges; - var identifiers = {}; - var identifierCount = 0; - var nodeCount = 0; - var lineStarts; - var isInStrictMode = false; - var lookAheadMode = 0 /* NotLookingAhead */; - var inAmbientContext = false; - var inFunctionBody = false; - var inSwitchStatement = 0 /* NotNested */; - var inIterationStatement = 0 /* NotNested */; - var labelledStatementInfo = (function () { - var functionBoundarySentinel; - var currentLabelSet; - var labelSetStack; - var isIterationStack; - function addLabel(label) { - if (!currentLabelSet) { - currentLabelSet = {}; - } - currentLabelSet[label.text] = true; - } - function pushCurrentLabelSet(isIterationStatement) { - if (!labelSetStack && !isIterationStack) { - labelSetStack = []; - isIterationStack = []; - } - ts.Debug.assert(currentLabelSet !== undefined); - labelSetStack.push(currentLabelSet); - isIterationStack.push(isIterationStatement); - currentLabelSet = undefined; - } - function pushFunctionBoundary() { - if (!functionBoundarySentinel) { - functionBoundarySentinel = {}; - if (!labelSetStack && !isIterationStack) { - labelSetStack = []; - isIterationStack = []; - } - } - ts.Debug.assert(currentLabelSet === undefined); - labelSetStack.push(functionBoundarySentinel); - isIterationStack.push(false); - } - function pop() { - ts.Debug.assert(labelSetStack.length && isIterationStack.length && currentLabelSet === undefined); - labelSetStack.pop(); - isIterationStack.pop(); - } - function nodeIsNestedInLabel(label, requireIterationStatement, stopAtFunctionBoundary) { - if (!requireIterationStatement && currentLabelSet && ts.hasProperty(currentLabelSet, label.text)) { - return 1 /* Nested */; - } - if (!labelSetStack) { - return 0 /* NotNested */; - } - var crossedFunctionBoundary = false; - for (var i = labelSetStack.length - 1; i >= 0; i--) { - var labelSet = labelSetStack[i]; - if (labelSet === functionBoundarySentinel) { - if (stopAtFunctionBoundary) { - break; - } - else { - crossedFunctionBoundary = true; - continue; - } - } - if (requireIterationStatement && isIterationStack[i] === false) { - continue; - } - if (ts.hasProperty(labelSet, label.text)) { - return crossedFunctionBoundary ? 2 /* CrossingFunctionBoundary */ : 1 /* Nested */; - } - } - return 0 /* NotNested */; - } - return { - addLabel: addLabel, - pushCurrentLabelSet: pushCurrentLabelSet, - pushFunctionBoundary: pushFunctionBoundary, - pop: pop, - nodeIsNestedInLabel: nodeIsNestedInLabel - }; - })(); - function getLineAndCharacterlFromSourcePosition(position) { - if (!lineStarts) { - lineStarts = ts.getLineStarts(sourceText); - } - return ts.getLineAndCharacterOfPosition(lineStarts, position); - } - function getPositionFromSourceLineAndCharacter(line, character) { - if (!lineStarts) { - lineStarts = ts.getLineStarts(sourceText); - } - return ts.getPositionFromLineAndCharacter(lineStarts, line, character); - } - function error(message, arg0, arg1, arg2) { - var start = scanner.getTokenPos(); - var length = scanner.getTextPos() - start; - errorAtPos(start, length, message, arg0, arg1, arg2); - } - function grammarErrorOnNode(node, message, arg0, arg1, arg2) { - var span = getErrorSpanForNode(node); - var start = span.end > span.pos ? ts.skipTrivia(file.text, span.pos) : span.pos; - var length = span.end - start; - file.syntacticErrors.push(ts.createFileDiagnostic(file, start, length, message, arg0, arg1, arg2)); - } - function reportInvalidUseInStrictMode(node) { - var name = sourceText.substring(ts.skipTrivia(sourceText, node.pos), node.end); - grammarErrorOnNode(node, ts.Diagnostics.Invalid_use_of_0_in_strict_mode, name); - } - function grammarErrorAtPos(start, length, message, arg0, arg1, arg2) { - file.syntacticErrors.push(ts.createFileDiagnostic(file, start, length, message, arg0, arg1, arg2)); - } - function errorAtPos(start, length, message, arg0, arg1, arg2) { - var lastErrorPos = file.syntacticErrors.length ? file.syntacticErrors[file.syntacticErrors.length - 1].start : -1; - if (start !== lastErrorPos) { - file.syntacticErrors.push(ts.createFileDiagnostic(file, start, length, message, arg0, arg1, arg2)); - } - if (lookAheadMode === 1 /* NoErrorYet */) { - lookAheadMode = 2 /* Error */; - } - } - function scanError(message) { - var pos = scanner.getTextPos(); - errorAtPos(pos, 0, message); - } - function onComment(pos, end) { - if (commentRanges) - commentRanges.push({ pos: pos, end: end }); - } - function getNodePos() { - return scanner.getStartPos(); - } - function getNodeEnd() { - return scanner.getStartPos(); - } - function nextToken() { - return token = scanner.scan(); - } - function getTokenPos(pos) { - return ts.skipTrivia(sourceText, pos); - } - function reScanGreaterToken() { - return token = scanner.reScanGreaterToken(); - } - function reScanSlashToken() { - return token = scanner.reScanSlashToken(); - } - function lookAheadHelper(callback, alwaysResetState) { - var saveToken = token; - var saveSyntacticErrorsLength = file.syntacticErrors.length; - var saveLookAheadMode = lookAheadMode; - lookAheadMode = 1 /* NoErrorYet */; - var result = callback(); - ts.Debug.assert(lookAheadMode === 2 /* Error */ || lookAheadMode === 1 /* NoErrorYet */); - if (lookAheadMode === 2 /* Error */) { - result = undefined; - } - lookAheadMode = saveLookAheadMode; - if (!result || alwaysResetState) { - token = saveToken; - file.syntacticErrors.length = saveSyntacticErrorsLength; - } - return result; - } - function lookAhead(callback) { - var result; - scanner.tryScan(function () { - result = lookAheadHelper(callback, true); - return false; - }); - return result; - } - function tryParse(callback) { - return scanner.tryScan(function () { return lookAheadHelper(callback, false); }); - } - function isIdentifier() { - return token === 59 /* Identifier */ || (isInStrictMode ? token > ts.SyntaxKind.LastFutureReservedWord : token > ts.SyntaxKind.LastReservedWord); - } - function parseExpected(t) { - if (token === t) { - nextToken(); - return true; - } - error(ts.Diagnostics._0_expected, ts.tokenToString(t)); - return false; - } - function parseOptional(t) { - if (token === t) { - nextToken(); - return true; - } - return false; - } - function canParseSemicolon() { - if (token === 17 /* SemicolonToken */) { - return true; - } - return token === 10 /* CloseBraceToken */ || token === 1 /* EndOfFileToken */ || scanner.hasPrecedingLineBreak(); - } - function parseSemicolon() { - if (canParseSemicolon()) { - if (token === 17 /* SemicolonToken */) { - nextToken(); - } - } - else { - error(ts.Diagnostics._0_expected, ";"); - } - } - function createNode(kind, pos) { - nodeCount++; - var node = new (nodeConstructors[kind] || (nodeConstructors[kind] = ts.objectAllocator.getNodeConstructor(kind)))(); - if (!(pos >= 0)) - pos = scanner.getStartPos(); - node.pos = pos; - node.end = pos; - return node; - } - function finishNode(node) { - node.end = scanner.getStartPos(); - return node; - } - function createMissingNode() { - return createNode(115 /* Missing */); - } - function internIdentifier(text) { - return ts.hasProperty(identifiers, text) ? identifiers[text] : (identifiers[text] = text); - } - function createIdentifier(isIdentifier) { - identifierCount++; - if (isIdentifier) { - var node = createNode(59 /* Identifier */); - var text = escapeIdentifier(scanner.getTokenValue()); - node.text = internIdentifier(text); - nextToken(); - return finishNode(node); - } - error(ts.Diagnostics.Identifier_expected); - var node = createMissingNode(); - node.text = ""; - return node; - } - function parseIdentifier() { - return createIdentifier(isIdentifier()); - } - function parseIdentifierName() { - return createIdentifier(token >= 59 /* Identifier */); - } - function isPropertyName() { - return token >= 59 /* Identifier */ || token === 7 /* StringLiteral */ || token === 6 /* NumericLiteral */; - } - function parsePropertyName() { - if (token === 7 /* StringLiteral */ || token === 6 /* NumericLiteral */) { - return parseLiteralNode(true); - } - return parseIdentifierName(); - } - function parseContextualModifier(t) { - return token === t && tryParse(function () { - nextToken(); - return token === 13 /* OpenBracketToken */ || isPropertyName(); - }); - } - function parseAnyContextualModifier() { - return isModifier(token) && tryParse(function () { - nextToken(); - return token === 13 /* OpenBracketToken */ || isPropertyName(); - }); - } - function isListElement(kind, inErrorRecovery) { - switch (kind) { - case 0 /* SourceElements */: - case 1 /* ModuleElements */: - return isSourceElement(inErrorRecovery); - case 2 /* BlockStatements */: - case 4 /* SwitchClauseStatements */: - return isStatement(inErrorRecovery); - case 3 /* SwitchClauses */: - return token === 61 /* CaseKeyword */ || token === 67 /* DefaultKeyword */; - case 5 /* TypeMembers */: - return isTypeMember(); - case 6 /* ClassMembers */: - return lookAhead(isClassMemberStart); - case 7 /* EnumMembers */: - case 11 /* ObjectLiteralMembers */: - return isPropertyName(); - case 8 /* BaseTypeReferences */: - return isIdentifier() && ((token !== 73 /* ExtendsKeyword */ && token !== 96 /* ImplementsKeyword */) || !lookAhead(function () { return (nextToken(), isIdentifier()); })); - case 9 /* VariableDeclarations */: - case 14 /* TypeParameters */: - return isIdentifier(); - case 10 /* ArgumentExpressions */: - return token === 18 /* CommaToken */ || isExpression(); - case 12 /* ArrayLiteralMembers */: - return token === 18 /* CommaToken */ || isExpression(); - case 13 /* Parameters */: - return isParameter(); - case 15 /* TypeArguments */: - case 16 /* TupleElementTypes */: - return isType(); - } - ts.Debug.fail("Non-exhaustive case in 'isListElement'."); - } - function isListTerminator(kind) { - if (token === 1 /* EndOfFileToken */) { - return true; - } - switch (kind) { - case 1 /* ModuleElements */: - case 2 /* BlockStatements */: - case 3 /* SwitchClauses */: - case 5 /* TypeMembers */: - case 6 /* ClassMembers */: - case 7 /* EnumMembers */: - case 11 /* ObjectLiteralMembers */: - return token === 10 /* CloseBraceToken */; - case 4 /* SwitchClauseStatements */: - return token === 10 /* CloseBraceToken */ || token === 61 /* CaseKeyword */ || token === 67 /* DefaultKeyword */; - case 8 /* BaseTypeReferences */: - return token === 9 /* OpenBraceToken */ || token === 73 /* ExtendsKeyword */ || token === 96 /* ImplementsKeyword */; - case 9 /* VariableDeclarations */: - return isVariableDeclaratorListTerminator(); - case 14 /* TypeParameters */: - return token === 20 /* GreaterThanToken */ || token === 11 /* OpenParenToken */ || token === 9 /* OpenBraceToken */ || token === 73 /* ExtendsKeyword */ || token === 96 /* ImplementsKeyword */; - case 10 /* ArgumentExpressions */: - return token === 12 /* CloseParenToken */ || token === 17 /* SemicolonToken */; - case 12 /* ArrayLiteralMembers */: - case 16 /* TupleElementTypes */: - return token === 14 /* CloseBracketToken */; - case 13 /* Parameters */: - return token === 12 /* CloseParenToken */ || token === 14 /* CloseBracketToken */ || token === 9 /* OpenBraceToken */; - case 15 /* TypeArguments */: - return token === 20 /* GreaterThanToken */ || token === 11 /* OpenParenToken */; - } - } - function isVariableDeclaratorListTerminator() { - if (canParseSemicolon()) { - return true; - } - if (token === 80 /* InKeyword */) { - return true; - } - if (token === 27 /* EqualsGreaterThanToken */) { - return true; - } - return false; - } - function isInSomeParsingContext() { - for (var kind = 0; kind < 17 /* Count */; kind++) { - if (parsingContext & (1 << kind)) { - if (isListElement(kind, true) || isListTerminator(kind)) { - return true; - } - } - } - return false; - } - function parseList(kind, checkForStrictMode, parseElement) { - var saveParsingContext = parsingContext; - parsingContext |= 1 << kind; - var result = []; - result.pos = getNodePos(); - var saveIsInStrictMode = isInStrictMode; - while (!isListTerminator(kind)) { - if (isListElement(kind, false)) { - var element = parseElement(); - result.push(element); - if (!isInStrictMode && checkForStrictMode) { - if (isPrologueDirective(element)) { - if (isUseStrictPrologueDirective(element)) { - isInStrictMode = true; - checkForStrictMode = false; - } - } - else { - checkForStrictMode = false; - } - } - } - else { - error(parsingContextErrors(kind)); - if (isInSomeParsingContext()) { - break; - } - nextToken(); - } - } - isInStrictMode = saveIsInStrictMode; - result.end = getNodeEnd(); - parsingContext = saveParsingContext; - return result; - } - function parseDelimitedList(kind, parseElement, allowTrailingComma) { - var saveParsingContext = parsingContext; - parsingContext |= 1 << kind; - var result = []; - result.pos = getNodePos(); - var errorCountBeforeParsingList = file.syntacticErrors.length; - var commaStart = -1; - while (true) { - if (isListElement(kind, false)) { - result.push(parseElement()); - commaStart = scanner.getTokenPos(); - if (parseOptional(18 /* CommaToken */)) { - continue; - } - commaStart = -1; - if (isListTerminator(kind)) { - break; - } - error(ts.Diagnostics._0_expected, ","); - } - else if (isListTerminator(kind)) { - break; - } - else { - error(parsingContextErrors(kind)); - if (isInSomeParsingContext()) { - break; - } - nextToken(); - } - } - if (commaStart >= 0) { - if (!allowTrailingComma) { - if (file.syntacticErrors.length === errorCountBeforeParsingList) { - grammarErrorAtPos(commaStart, scanner.getStartPos() - commaStart, ts.Diagnostics.Trailing_comma_not_allowed); - } - } - result.hasTrailingComma = true; - } - result.end = getNodeEnd(); - parsingContext = saveParsingContext; - return result; - } - function createMissingList() { - var pos = getNodePos(); - var result = []; - result.pos = pos; - result.end = pos; - return result; - } - function createNodeArray(node) { - var result = [node]; - result.pos = node.pos; - result.end = node.end; - return result; - } - function parseBracketedList(kind, parseElement, startToken, endToken) { - if (parseExpected(startToken)) { - var result = parseDelimitedList(kind, parseElement, false); - parseExpected(endToken); - return result; - } - return createMissingList(); - } - function parseEntityName(allowReservedWords) { - var entity = parseIdentifier(); - while (parseOptional(15 /* DotToken */)) { - var node = createNode(116 /* QualifiedName */, entity.pos); - node.left = entity; - node.right = allowReservedWords ? parseIdentifierName() : parseIdentifier(); - entity = finishNode(node); - } - return entity; - } - function parseTokenNode() { - var node = createNode(token); - nextToken(); - return finishNode(node); - } - function parseLiteralNode(internName) { - var node = createNode(token); - var text = scanner.getTokenValue(); - node.text = internName ? internIdentifier(text) : text; - var tokenPos = scanner.getTokenPos(); - nextToken(); - finishNode(node); - if (node.kind === 6 /* NumericLiteral */ && sourceText.charCodeAt(tokenPos) === 48 /* _0 */ && ts.isOctalDigit(sourceText.charCodeAt(tokenPos + 1))) { - if (isInStrictMode) { - grammarErrorOnNode(node, ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode); - } - else if (languageVersion >= 1 /* ES5 */) { - grammarErrorOnNode(node, ts.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher); - } - } - return node; - } - function parseStringLiteral() { - if (token === 7 /* StringLiteral */) - return parseLiteralNode(true); - error(ts.Diagnostics.String_literal_expected); - return createMissingNode(); - } - function parseTypeReference() { - var node = createNode(127 /* TypeReference */); - node.typeName = parseEntityName(false); - if (!scanner.hasPrecedingLineBreak() && token === 19 /* LessThanToken */) { - node.typeArguments = parseTypeArguments(); - } - return finishNode(node); - } - function parseTypeQuery() { - var node = createNode(128 /* TypeQuery */); - parseExpected(91 /* TypeOfKeyword */); - node.exprName = parseEntityName(true); - return finishNode(node); - } - function parseTypeParameter() { - var node = createNode(117 /* TypeParameter */); - node.name = parseIdentifier(); - if (parseOptional(73 /* ExtendsKeyword */)) { - if (isType() || !isExpression()) { - node.constraint = parseType(); - } - else { - var expr = parseUnaryExpression(); - grammarErrorOnNode(expr, ts.Diagnostics.Type_expected); - } - } - return finishNode(node); - } - function parseTypeParameters() { - if (token === 19 /* LessThanToken */) { - var pos = getNodePos(); - var result = parseBracketedList(14 /* TypeParameters */, parseTypeParameter, 19 /* LessThanToken */, 20 /* GreaterThanToken */); - if (!result.length) { - var start = getTokenPos(pos); - var length = getNodePos() - start; - errorAtPos(start, length, ts.Diagnostics.Type_parameter_list_cannot_be_empty); - } - return result; - } - } - function parseParameterType() { - return parseOptional(46 /* ColonToken */) ? token === 7 /* StringLiteral */ ? parseStringLiteral() : parseType() : undefined; - } - function isParameter() { - return token === 16 /* DotDotDotToken */ || isIdentifier() || isModifier(token); - } - function parseParameter(flags) { - if (flags === void 0) { flags = 0; } - var node = createNode(118 /* Parameter */); - node.flags |= parseAndCheckModifiers(3 /* Parameters */); - if (parseOptional(16 /* DotDotDotToken */)) { - node.flags |= 8 /* Rest */; - } - node.name = parseIdentifier(); - if (node.name.kind === 115 /* Missing */ && node.flags === 0 && isModifier(token)) { - nextToken(); - } - if (parseOptional(45 /* QuestionToken */)) { - node.flags |= 4 /* QuestionMark */; - } - node.type = parseParameterType(); - node.initializer = parseInitializer(true); - return finishNode(node); - } - function parseSignature(kind, returnToken, returnTokenRequired) { - if (kind === 125 /* ConstructSignature */) { - parseExpected(82 /* NewKeyword */); - } - var typeParameters = parseTypeParameters(); - var parameters = parseParameterList(11 /* OpenParenToken */, 12 /* CloseParenToken */); - checkParameterList(parameters); - var type; - if (returnTokenRequired) { - parseExpected(returnToken); - type = parseType(); - } - else if (parseOptional(returnToken)) { - type = parseType(); - } - return { - typeParameters: typeParameters, - parameters: parameters, - type: type - }; - } - function parseParameterList(startDelimiter, endDelimiter) { - return parseBracketedList(13 /* Parameters */, parseParameter, startDelimiter, endDelimiter); - } - function checkParameterList(parameters) { - var seenOptionalParameter = false; - var parameterCount = parameters.length; - for (var i = 0; i < parameterCount; i++) { - var parameter = parameters[i]; - if (isInStrictMode && isEvalOrArgumentsIdentifier(parameter.name)) { - reportInvalidUseInStrictMode(parameter.name); - return; - } - else if (parameter.flags & 8 /* Rest */) { - if (i !== (parameterCount - 1)) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list); - return; - } - if (parameter.flags & 4 /* QuestionMark */) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.A_rest_parameter_cannot_be_optional); - return; - } - if (parameter.initializer) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.A_rest_parameter_cannot_have_an_initializer); - return; - } - } - else if (parameter.flags & 4 /* QuestionMark */ || parameter.initializer) { - seenOptionalParameter = true; - if (parameter.flags & 4 /* QuestionMark */ && parameter.initializer) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.Parameter_cannot_have_question_mark_and_initializer); - return; - } - } - else { - if (seenOptionalParameter) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.A_required_parameter_cannot_follow_an_optional_parameter); - return; - } - } - } - } - function parseSignatureMember(kind, returnToken) { - var node = createNode(kind); - var sig = parseSignature(kind, returnToken, false); - node.typeParameters = sig.typeParameters; - node.parameters = sig.parameters; - node.type = sig.type; - parseSemicolon(); - return finishNode(node); - } - function parseIndexSignatureMember() { - var node = createNode(126 /* IndexSignature */); - var errorCountBeforeIndexSignature = file.syntacticErrors.length; - var indexerStart = scanner.getTokenPos(); - node.parameters = parseParameterList(13 /* OpenBracketToken */, 14 /* CloseBracketToken */); - var indexerLength = scanner.getStartPos() - indexerStart; - node.type = parseTypeAnnotation(); - parseSemicolon(); - if (file.syntacticErrors.length === errorCountBeforeIndexSignature) { - checkIndexSignature(node, indexerStart, indexerLength); - } - return finishNode(node); - } - function checkIndexSignature(node, indexerStart, indexerLength) { - var parameter = node.parameters[0]; - if (node.parameters.length !== 1) { - var arityDiagnostic = ts.Diagnostics.An_index_signature_must_have_exactly_one_parameter; - if (parameter) { - grammarErrorOnNode(parameter.name, arityDiagnostic); - } - else { - grammarErrorAtPos(indexerStart, indexerLength, arityDiagnostic); - } - return; - } - else if (parameter.flags & 8 /* Rest */) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_cannot_have_a_rest_parameter); - return; - } - else if (parameter.flags & ts.NodeFlags.Modifier) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_cannot_have_an_accessibility_modifier); - return; - } - else if (parameter.flags & 4 /* QuestionMark */) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_cannot_have_a_question_mark); - return; - } - else if (parameter.initializer) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_cannot_have_an_initializer); - return; - } - else if (!parameter.type) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); - return; - } - else if (parameter.type.kind !== 114 /* StringKeyword */ && parameter.type.kind !== 112 /* NumberKeyword */) { - grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_must_be_string_or_number); - return; - } - else if (!node.type) { - grammarErrorAtPos(indexerStart, indexerLength, ts.Diagnostics.An_index_signature_must_have_a_type_annotation); - return; - } - } - function parsePropertyOrMethod() { - var node = createNode(0 /* Unknown */); - node.name = parsePropertyName(); - if (parseOptional(45 /* QuestionToken */)) { - node.flags |= 4 /* QuestionMark */; - } - if (token === 11 /* OpenParenToken */ || token === 19 /* LessThanToken */) { - node.kind = 120 /* Method */; - var sig = parseSignature(124 /* CallSignature */, 46 /* ColonToken */, false); - node.typeParameters = sig.typeParameters; - node.parameters = sig.parameters; - node.type = sig.type; - } - else { - node.kind = 119 /* Property */; - node.type = parseTypeAnnotation(); - } - parseSemicolon(); - return finishNode(node); - } - function isTypeMember() { - switch (token) { - case 11 /* OpenParenToken */: - case 19 /* LessThanToken */: - case 13 /* OpenBracketToken */: - return true; - default: - return isPropertyName() && lookAhead(function () { return nextToken() === 11 /* OpenParenToken */ || token === 19 /* LessThanToken */ || token === 45 /* QuestionToken */ || token === 46 /* ColonToken */ || canParseSemicolon(); }); - } - } - function parseTypeMember() { - switch (token) { - case 11 /* OpenParenToken */: - case 19 /* LessThanToken */: - return parseSignatureMember(124 /* CallSignature */, 46 /* ColonToken */); - case 13 /* OpenBracketToken */: - return parseIndexSignatureMember(); - case 82 /* NewKeyword */: - if (lookAhead(function () { return nextToken() === 11 /* OpenParenToken */ || token === 19 /* LessThanToken */; })) { - return parseSignatureMember(125 /* ConstructSignature */, 46 /* ColonToken */); - } - case 7 /* StringLiteral */: - case 6 /* NumericLiteral */: - return parsePropertyOrMethod(); - default: - if (token >= 59 /* Identifier */) { - return parsePropertyOrMethod(); - } - } - } - function parseTypeLiteral() { - var node = createNode(129 /* TypeLiteral */); - if (parseExpected(9 /* OpenBraceToken */)) { - node.members = parseList(5 /* TypeMembers */, false, parseTypeMember); - parseExpected(10 /* CloseBraceToken */); - } - else { - node.members = createMissingList(); - } - return finishNode(node); - } - function parseTupleType() { - var node = createNode(131 /* TupleType */); - var startTokenPos = scanner.getTokenPos(); - var startErrorCount = file.syntacticErrors.length; - node.elementTypes = parseBracketedList(16 /* TupleElementTypes */, parseType, 13 /* OpenBracketToken */, 14 /* CloseBracketToken */); - if (!node.elementTypes.length && file.syntacticErrors.length === startErrorCount) { - grammarErrorAtPos(startTokenPos, scanner.getStartPos() - startTokenPos, ts.Diagnostics.A_tuple_type_element_list_cannot_be_empty); - } - return finishNode(node); - } - function parseFunctionType(signatureKind) { - var node = createNode(129 /* TypeLiteral */); - var member = createNode(signatureKind); - var sig = parseSignature(signatureKind, 27 /* EqualsGreaterThanToken */, true); - member.typeParameters = sig.typeParameters; - member.parameters = sig.parameters; - member.type = sig.type; - finishNode(member); - node.members = createNodeArray(member); - return finishNode(node); - } - function parseKeywordAndNoDot() { - var node = parseTokenNode(); - return token === 15 /* DotToken */ ? undefined : node; - } - function parseNonArrayType() { - switch (token) { - case 105 /* AnyKeyword */: - case 114 /* StringKeyword */: - case 112 /* NumberKeyword */: - case 106 /* BooleanKeyword */: - case 93 /* VoidKeyword */: - var node = tryParse(parseKeywordAndNoDot); - return node || parseTypeReference(); - case 91 /* TypeOfKeyword */: - return parseTypeQuery(); - case 9 /* OpenBraceToken */: - return parseTypeLiteral(); - case 13 /* OpenBracketToken */: - return parseTupleType(); - case 11 /* OpenParenToken */: - case 19 /* LessThanToken */: - return parseFunctionType(124 /* CallSignature */); - case 82 /* NewKeyword */: - return parseFunctionType(125 /* ConstructSignature */); - default: - if (isIdentifier()) { - return parseTypeReference(); - } - } - error(ts.Diagnostics.Type_expected); - return createMissingNode(); - } - function isType() { - switch (token) { - case 105 /* AnyKeyword */: - case 114 /* StringKeyword */: - case 112 /* NumberKeyword */: - case 106 /* BooleanKeyword */: - case 93 /* VoidKeyword */: - case 91 /* TypeOfKeyword */: - case 9 /* OpenBraceToken */: - case 13 /* OpenBracketToken */: - case 19 /* LessThanToken */: - case 82 /* NewKeyword */: - return true; - case 11 /* OpenParenToken */: - return lookAhead(function () { - nextToken(); - return token === 12 /* CloseParenToken */ || isParameter(); - }); - default: - return isIdentifier(); - } - } - function parseType() { - var type = parseNonArrayType(); - while (type && !scanner.hasPrecedingLineBreak() && parseOptional(13 /* OpenBracketToken */)) { - parseExpected(14 /* CloseBracketToken */); - var node = createNode(130 /* ArrayType */, type.pos); - node.elementType = type; - type = finishNode(node); - } - return type; - } - function parseTypeAnnotation() { - return parseOptional(46 /* ColonToken */) ? parseType() : undefined; - } - function isExpression() { - switch (token) { - case 87 /* ThisKeyword */: - case 85 /* SuperKeyword */: - case 83 /* NullKeyword */: - case 89 /* TrueKeyword */: - case 74 /* FalseKeyword */: - case 6 /* NumericLiteral */: - case 7 /* StringLiteral */: - case 11 /* OpenParenToken */: - case 13 /* OpenBracketToken */: - case 9 /* OpenBraceToken */: - case 77 /* FunctionKeyword */: - case 82 /* NewKeyword */: - case 31 /* SlashToken */: - case 51 /* SlashEqualsToken */: - case 28 /* PlusToken */: - case 29 /* MinusToken */: - case 42 /* TildeToken */: - case 41 /* ExclamationToken */: - case 68 /* DeleteKeyword */: - case 91 /* TypeOfKeyword */: - case 93 /* VoidKeyword */: - case 33 /* PlusPlusToken */: - case 34 /* MinusMinusToken */: - case 19 /* LessThanToken */: - case 59 /* Identifier */: - return true; - default: - return isIdentifier(); - } - } - function isExpressionStatement() { - return token !== 9 /* OpenBraceToken */ && token !== 77 /* FunctionKeyword */ && isExpression(); - } - function parseExpression(noIn) { - var expr = parseAssignmentExpression(noIn); - while (parseOptional(18 /* CommaToken */)) { - expr = makeBinaryExpression(expr, 18 /* CommaToken */, parseAssignmentExpression(noIn)); - } - return expr; - } - function parseInitializer(inParameter, noIn) { - if (token !== 47 /* EqualsToken */) { - if (scanner.hasPrecedingLineBreak() || (inParameter && token === 9 /* OpenBraceToken */) || !isExpression()) { - return undefined; - } - } - parseExpected(47 /* EqualsToken */); - return parseAssignmentExpression(noIn); - } - function parseAssignmentExpression(noIn) { - var arrowExpression = tryParseParenthesizedArrowFunctionExpression(); - if (arrowExpression) { - return arrowExpression; - } - var expr = parseConditionalExpression(noIn); - if (expr.kind === 59 /* Identifier */ && token === 27 /* EqualsGreaterThanToken */) { - return parseSimpleArrowFunctionExpression(expr); - } - if (isLeftHandSideExpression(expr) && isAssignmentOperator()) { - if (isInStrictMode && isEvalOrArgumentsIdentifier(expr)) { - reportInvalidUseInStrictMode(expr); - } - var operator = token; - nextToken(); - return makeBinaryExpression(expr, operator, parseAssignmentExpression(noIn)); - } - return expr; - } - function isLeftHandSideExpression(expr) { - if (expr) { - switch (expr.kind) { - case 135 /* PropertyAccess */: - case 136 /* IndexedAccess */: - case 138 /* NewExpression */: - case 137 /* CallExpression */: - case 132 /* ArrayLiteral */: - case 140 /* ParenExpression */: - case 133 /* ObjectLiteral */: - case 141 /* FunctionExpression */: - case 59 /* Identifier */: - case 115 /* Missing */: - case 8 /* RegularExpressionLiteral */: - case 6 /* NumericLiteral */: - case 7 /* StringLiteral */: - case 74 /* FalseKeyword */: - case 83 /* NullKeyword */: - case 87 /* ThisKeyword */: - case 89 /* TrueKeyword */: - case 85 /* SuperKeyword */: - return true; - } - } - return false; - } - function parseSimpleArrowFunctionExpression(identifier) { - ts.Debug.assert(token === 27 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); - parseExpected(27 /* EqualsGreaterThanToken */); - var parameter = createNode(118 /* Parameter */, identifier.pos); - parameter.name = identifier; - finishNode(parameter); - var parameters = []; - parameters.push(parameter); - parameters.pos = parameter.pos; - parameters.end = parameter.end; - var signature = { parameters: parameters }; - return parseArrowExpressionTail(identifier.pos, signature, false); - } - function tryParseParenthesizedArrowFunctionExpression() { - var triState = isParenthesizedArrowFunctionExpression(); - if (triState === 0 /* False */) { - return undefined; - } - var pos = getNodePos(); - if (triState === 1 /* True */) { - var sig = parseSignature(124 /* CallSignature */, 46 /* ColonToken */, false); - if (parseExpected(27 /* EqualsGreaterThanToken */) || token === 9 /* OpenBraceToken */) { - return parseArrowExpressionTail(pos, sig, false); - } - else { - return makeFunctionExpression(142 /* ArrowFunction */, pos, undefined, sig, createMissingNode()); - } - } - var sig = tryParseSignatureIfArrowOrBraceFollows(); - if (sig) { - parseExpected(27 /* EqualsGreaterThanToken */); - return parseArrowExpressionTail(pos, sig, false); - } - else { - return undefined; - } - } - function isParenthesizedArrowFunctionExpression() { - if (token === 11 /* OpenParenToken */ || token === 19 /* LessThanToken */) { - return lookAhead(function () { - var first = token; - var second = nextToken(); - if (first === 11 /* OpenParenToken */) { - if (second === 12 /* CloseParenToken */) { - var third = nextToken(); - switch (third) { - case 27 /* EqualsGreaterThanToken */: - case 46 /* ColonToken */: - case 9 /* OpenBraceToken */: - return 1 /* True */; - default: - return 0 /* False */; - } - } - if (second === 16 /* DotDotDotToken */) { - return 1 /* True */; - } - if (!isIdentifier()) { - return 0 /* False */; - } - if (nextToken() === 46 /* ColonToken */) { - return 1 /* True */; - } - return 2 /* Unknown */; - } - else { - ts.Debug.assert(first === 19 /* LessThanToken */); - if (!isIdentifier()) { - return 0 /* False */; - } - return 2 /* Unknown */; - } - }); - } - if (token === 27 /* EqualsGreaterThanToken */) { - return 1 /* True */; - } - return 0 /* False */; - } - function tryParseSignatureIfArrowOrBraceFollows() { - return tryParse(function () { - var sig = parseSignature(124 /* CallSignature */, 46 /* ColonToken */, false); - if (token === 27 /* EqualsGreaterThanToken */ || token === 9 /* OpenBraceToken */) { - return sig; - } - return undefined; - }); - } - function parseArrowExpressionTail(pos, sig, noIn) { - var body; - if (token === 9 /* OpenBraceToken */) { - body = parseBody(false); - } - else if (isStatement(true) && !isExpressionStatement() && token !== 77 /* FunctionKeyword */) { - body = parseBody(true); - } - else { - body = parseAssignmentExpression(noIn); - } - return makeFunctionExpression(142 /* ArrowFunction */, pos, undefined, sig, body); - } - function isAssignmentOperator() { - return token >= ts.SyntaxKind.FirstAssignment && token <= ts.SyntaxKind.LastAssignment; - } - function parseConditionalExpression(noIn) { - var expr = parseBinaryExpression(noIn); - while (parseOptional(45 /* QuestionToken */)) { - var node = createNode(146 /* ConditionalExpression */, expr.pos); - node.condition = expr; - node.whenTrue = parseAssignmentExpression(false); - parseExpected(46 /* ColonToken */); - node.whenFalse = parseAssignmentExpression(noIn); - expr = finishNode(node); - } - return expr; - } - function parseBinaryExpression(noIn) { - return parseBinaryOperators(parseUnaryExpression(), 0, noIn); - } - function parseBinaryOperators(expr, minPrecedence, noIn) { - while (true) { - reScanGreaterToken(); - var precedence = getOperatorPrecedence(); - if (precedence && precedence > minPrecedence && (!noIn || token !== 80 /* InKeyword */)) { - var operator = token; - nextToken(); - expr = makeBinaryExpression(expr, operator, parseBinaryOperators(parseUnaryExpression(), precedence, noIn)); - continue; - } - return expr; - } - } - function getOperatorPrecedence() { - switch (token) { - case 44 /* BarBarToken */: - return 1; - case 43 /* AmpersandAmpersandToken */: - return 2; - case 39 /* BarToken */: - return 3; - case 40 /* CaretToken */: - return 4; - case 38 /* AmpersandToken */: - return 5; - case 23 /* EqualsEqualsToken */: - case 24 /* ExclamationEqualsToken */: - case 25 /* EqualsEqualsEqualsToken */: - case 26 /* ExclamationEqualsEqualsToken */: - return 6; - case 19 /* LessThanToken */: - case 20 /* GreaterThanToken */: - case 21 /* LessThanEqualsToken */: - case 22 /* GreaterThanEqualsToken */: - case 81 /* InstanceOfKeyword */: - case 80 /* InKeyword */: - return 7; - case 35 /* LessThanLessThanToken */: - case 36 /* GreaterThanGreaterThanToken */: - case 37 /* GreaterThanGreaterThanGreaterThanToken */: - return 8; - case 28 /* PlusToken */: - case 29 /* MinusToken */: - return 9; - case 30 /* AsteriskToken */: - case 31 /* SlashToken */: - case 32 /* PercentToken */: - return 10; - } - return undefined; - } - function makeBinaryExpression(left, operator, right) { - var node = createNode(145 /* BinaryExpression */, left.pos); - node.left = left; - node.operator = operator; - node.right = right; - return finishNode(node); - } - function parseUnaryExpression() { - var pos = getNodePos(); - switch (token) { - case 28 /* PlusToken */: - case 29 /* MinusToken */: - case 42 /* TildeToken */: - case 41 /* ExclamationToken */: - case 68 /* DeleteKeyword */: - case 91 /* TypeOfKeyword */: - case 93 /* VoidKeyword */: - case 33 /* PlusPlusToken */: - case 34 /* MinusMinusToken */: - var operator = token; - nextToken(); - var operand = parseUnaryExpression(); - if (isInStrictMode) { - if ((operator === 33 /* PlusPlusToken */ || operator === 34 /* MinusMinusToken */) && isEvalOrArgumentsIdentifier(operand)) { - reportInvalidUseInStrictMode(operand); - } - else if (operator === 68 /* DeleteKeyword */ && operand.kind === 59 /* Identifier */) { - grammarErrorOnNode(operand, ts.Diagnostics.delete_cannot_be_called_on_an_identifier_in_strict_mode); - } - } - return makeUnaryExpression(143 /* PrefixOperator */, pos, operator, operand); - case 19 /* LessThanToken */: - return parseTypeAssertion(); - } - var primaryExpression = parsePrimaryExpression(); - var illegalUsageOfSuperKeyword = primaryExpression.kind === 85 /* SuperKeyword */ && token !== 11 /* OpenParenToken */ && token !== 15 /* DotToken */; - if (illegalUsageOfSuperKeyword) { - error(ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); - } - var expr = parseCallAndAccess(primaryExpression, false); - ts.Debug.assert(isLeftHandSideExpression(expr)); - if ((token === 33 /* PlusPlusToken */ || token === 34 /* MinusMinusToken */) && !scanner.hasPrecedingLineBreak()) { - if (isInStrictMode && isEvalOrArgumentsIdentifier(expr)) { - reportInvalidUseInStrictMode(expr); - } - var operator = token; - nextToken(); - expr = makeUnaryExpression(144 /* PostfixOperator */, expr.pos, operator, expr); - } - return expr; - } - function parseTypeAssertion() { - var node = createNode(139 /* TypeAssertion */); - parseExpected(19 /* LessThanToken */); - node.type = parseType(); - parseExpected(20 /* GreaterThanToken */); - node.operand = parseUnaryExpression(); - return finishNode(node); - } - function makeUnaryExpression(kind, pos, operator, operand) { - var node = createNode(kind, pos); - node.operator = operator; - node.operand = operand; - return finishNode(node); - } - function parseCallAndAccess(expr, inNewExpression) { - while (true) { - var dotStart = scanner.getTokenPos(); - if (parseOptional(15 /* DotToken */)) { - var propertyAccess = createNode(135 /* PropertyAccess */, expr.pos); - if (scanner.hasPrecedingLineBreak() && scanner.isReservedWord() && lookAhead(function () { return scanner.isReservedWord(); })) { - grammarErrorAtPos(dotStart, scanner.getStartPos() - dotStart, ts.Diagnostics.Identifier_expected); - var id = createMissingNode(); - } - else { - var id = parseIdentifierName(); - } - propertyAccess.left = expr; - propertyAccess.right = id; - expr = finishNode(propertyAccess); - continue; - } - var bracketStart = scanner.getTokenPos(); - if (parseOptional(13 /* OpenBracketToken */)) { - var indexedAccess = createNode(136 /* IndexedAccess */, expr.pos); - indexedAccess.object = expr; - if (inNewExpression && parseOptional(14 /* CloseBracketToken */)) { - indexedAccess.index = createMissingNode(); - grammarErrorAtPos(bracketStart, scanner.getStartPos() - bracketStart, ts.Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); - } - else { - indexedAccess.index = parseExpression(); - if (indexedAccess.index.kind === 7 /* StringLiteral */ || indexedAccess.index.kind === 6 /* NumericLiteral */) { - var literal = indexedAccess.index; - literal.text = internIdentifier(literal.text); - } - parseExpected(14 /* CloseBracketToken */); - } - expr = finishNode(indexedAccess); - continue; - } - if ((token === 11 /* OpenParenToken */ || token === 19 /* LessThanToken */) && !inNewExpression) { - var callExpr = createNode(137 /* CallExpression */, expr.pos); - callExpr.func = expr; - if (token === 19 /* LessThanToken */) { - if (!(callExpr.typeArguments = tryParse(parseTypeArgumentsAndOpenParen))) - return expr; - } - else { - parseExpected(11 /* OpenParenToken */); - } - callExpr.arguments = parseDelimitedList(10 /* ArgumentExpressions */, parseArgumentExpression, false); - parseExpected(12 /* CloseParenToken */); - expr = finishNode(callExpr); - continue; - } - return expr; - } - } - function parseTypeArgumentsAndOpenParen() { - var result = parseTypeArguments(); - parseExpected(11 /* OpenParenToken */); - return result; - } - function parseTypeArguments() { - var typeArgumentListStart = scanner.getTokenPos(); - var errorCountBeforeTypeParameterList = file.syntacticErrors.length; - var result = parseBracketedList(15 /* TypeArguments */, parseType, 19 /* LessThanToken */, 20 /* GreaterThanToken */); - if (!result.length && file.syntacticErrors.length === errorCountBeforeTypeParameterList) { - grammarErrorAtPos(typeArgumentListStart, scanner.getStartPos() - typeArgumentListStart, ts.Diagnostics.Type_argument_list_cannot_be_empty); - } - return result; - } - function parsePrimaryExpression() { - switch (token) { - case 87 /* ThisKeyword */: - case 85 /* SuperKeyword */: - case 83 /* NullKeyword */: - case 89 /* TrueKeyword */: - case 74 /* FalseKeyword */: - return parseTokenNode(); - case 6 /* NumericLiteral */: - case 7 /* StringLiteral */: - return parseLiteralNode(); - case 11 /* OpenParenToken */: - return parseParenExpression(); - case 13 /* OpenBracketToken */: - return parseArrayLiteral(); - case 9 /* OpenBraceToken */: - return parseObjectLiteral(); - case 77 /* FunctionKeyword */: - return parseFunctionExpression(); - case 82 /* NewKeyword */: - return parseNewExpression(); - case 31 /* SlashToken */: - case 51 /* SlashEqualsToken */: - if (reScanSlashToken() === 8 /* RegularExpressionLiteral */) { - return parseLiteralNode(); - } - break; - default: - if (isIdentifier()) { - return parseIdentifier(); - } - } - error(ts.Diagnostics.Expression_expected); - return createMissingNode(); - } - function parseParenExpression() { - var node = createNode(140 /* ParenExpression */); - parseExpected(11 /* OpenParenToken */); - node.expression = parseExpression(); - parseExpected(12 /* CloseParenToken */); - return finishNode(node); - } - function parseAssignmentExpressionOrOmittedExpression(omittedExpressionDiagnostic) { - if (token === 18 /* CommaToken */) { - if (omittedExpressionDiagnostic) { - var errorStart = scanner.getTokenPos(); - var errorLength = scanner.getTextPos() - errorStart; - grammarErrorAtPos(errorStart, errorLength, omittedExpressionDiagnostic); - } - return createNode(147 /* OmittedExpression */); - } - return parseAssignmentExpression(); - } - function parseArrayLiteralElement() { - return parseAssignmentExpressionOrOmittedExpression(undefined); - } - function parseArgumentExpression() { - return parseAssignmentExpressionOrOmittedExpression(ts.Diagnostics.Argument_expression_expected); - } - function parseArrayLiteral() { - var node = createNode(132 /* ArrayLiteral */); - parseExpected(13 /* OpenBracketToken */); - if (scanner.hasPrecedingLineBreak()) - node.flags |= 256 /* MultiLine */; - node.elements = parseDelimitedList(12 /* ArrayLiteralMembers */, parseArrayLiteralElement, true); - parseExpected(14 /* CloseBracketToken */); - return finishNode(node); - } - function parsePropertyAssignment() { - var node = createNode(134 /* PropertyAssignment */); - node.name = parsePropertyName(); - if (token === 11 /* OpenParenToken */ || token === 19 /* LessThanToken */) { - var sig = parseSignature(124 /* CallSignature */, 46 /* ColonToken */, false); - var body = parseBody(false); - node.initializer = makeFunctionExpression(141 /* FunctionExpression */, node.pos, undefined, sig, body); - } - else { - parseExpected(46 /* ColonToken */); - node.initializer = parseAssignmentExpression(false); - } - return finishNode(node); - } - function parseObjectLiteralMember() { - var initialPos = getNodePos(); - var initialToken = token; - if (parseContextualModifier(109 /* GetKeyword */) || parseContextualModifier(113 /* SetKeyword */)) { - var kind = initialToken === 109 /* GetKeyword */ ? 122 /* GetAccessor */ : 123 /* SetAccessor */; - return parseAndCheckMemberAccessorDeclaration(kind, initialPos, 0); - } - return parsePropertyAssignment(); - } - function parseObjectLiteral() { - var node = createNode(133 /* ObjectLiteral */); - parseExpected(9 /* OpenBraceToken */); - if (scanner.hasPrecedingLineBreak()) { - node.flags |= 256 /* MultiLine */; - } - node.properties = parseDelimitedList(11 /* ObjectLiteralMembers */, parseObjectLiteralMember, true); - parseExpected(10 /* CloseBraceToken */); - var seen = {}; - var Property = 1; - var GetAccessor = 2; - var SetAccesor = 4; - var GetOrSetAccessor = GetAccessor | SetAccesor; - ts.forEach(node.properties, function (p) { - if (p.kind === 147 /* OmittedExpression */) { - return; - } - var currentKind; - if (p.kind === 134 /* PropertyAssignment */) { - currentKind = Property; - } - else if (p.kind === 122 /* GetAccessor */) { - currentKind = GetAccessor; - } - else if (p.kind === 123 /* SetAccessor */) { - currentKind = SetAccesor; - } - else { - ts.Debug.fail("Unexpected syntax kind:" + ts.SyntaxKind[p.kind]); - } - if (!ts.hasProperty(seen, p.name.text)) { - seen[p.name.text] = currentKind; - } - else { - var existingKind = seen[p.name.text]; - if (currentKind === Property && existingKind === Property) { - if (isInStrictMode) { - grammarErrorOnNode(p.name, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode); - } - } - else if ((currentKind & GetOrSetAccessor) && (existingKind & GetOrSetAccessor)) { - if (existingKind !== GetOrSetAccessor && currentKind !== existingKind) { - seen[p.name.text] = currentKind | existingKind; - } - else { - grammarErrorOnNode(p.name, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); - } - } - else { - grammarErrorOnNode(p.name, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); - } - } - }); - return finishNode(node); - } - function parseFunctionExpression() { - var pos = getNodePos(); - parseExpected(77 /* FunctionKeyword */); - var name = isIdentifier() ? parseIdentifier() : undefined; - var sig = parseSignature(124 /* CallSignature */, 46 /* ColonToken */, false); - var body = parseBody(false); - if (name && isInStrictMode && isEvalOrArgumentsIdentifier(name)) { - reportInvalidUseInStrictMode(name); - } - return makeFunctionExpression(141 /* FunctionExpression */, pos, name, sig, body); - } - function makeFunctionExpression(kind, pos, name, sig, body) { - var node = createNode(kind, pos); - node.name = name; - node.typeParameters = sig.typeParameters; - node.parameters = sig.parameters; - node.type = sig.type; - node.body = body; - return finishNode(node); - } - function parseNewExpression() { - var node = createNode(138 /* NewExpression */); - parseExpected(82 /* NewKeyword */); - node.func = parseCallAndAccess(parsePrimaryExpression(), true); - if (parseOptional(11 /* OpenParenToken */) || token === 19 /* LessThanToken */ && (node.typeArguments = tryParse(parseTypeArgumentsAndOpenParen))) { - node.arguments = parseDelimitedList(10 /* ArgumentExpressions */, parseArgumentExpression, false); - parseExpected(12 /* CloseParenToken */); - } - return finishNode(node); - } - function parseBlock(ignoreMissingOpenBrace, checkForStrictMode) { - var node = createNode(148 /* Block */); - if (parseExpected(9 /* OpenBraceToken */) || ignoreMissingOpenBrace) { - node.statements = parseList(2 /* BlockStatements */, checkForStrictMode, parseStatement); - parseExpected(10 /* CloseBraceToken */); - } - else { - node.statements = createMissingList(); - } - return finishNode(node); - } - function parseBody(ignoreMissingOpenBrace) { - var saveInFunctionBody = inFunctionBody; - var saveInSwitchStatement = inSwitchStatement; - var saveInIterationStatement = inIterationStatement; - inFunctionBody = true; - if (inSwitchStatement === 1 /* Nested */) { - inSwitchStatement = 2 /* CrossingFunctionBoundary */; - } - if (inIterationStatement === 1 /* Nested */) { - inIterationStatement = 2 /* CrossingFunctionBoundary */; - } - labelledStatementInfo.pushFunctionBoundary(); - var block = parseBlock(ignoreMissingOpenBrace, true); - block.kind = 173 /* FunctionBlock */; - labelledStatementInfo.pop(); - inFunctionBody = saveInFunctionBody; - inSwitchStatement = saveInSwitchStatement; - inIterationStatement = saveInIterationStatement; - return block; - } - function parseEmptyStatement() { - var node = createNode(150 /* EmptyStatement */); - parseExpected(17 /* SemicolonToken */); - return finishNode(node); - } - function parseIfStatement() { - var node = createNode(152 /* IfStatement */); - parseExpected(78 /* IfKeyword */); - parseExpected(11 /* OpenParenToken */); - node.expression = parseExpression(); - parseExpected(12 /* CloseParenToken */); - node.thenStatement = parseStatement(); - node.elseStatement = parseOptional(70 /* ElseKeyword */) ? parseStatement() : undefined; - return finishNode(node); - } - function parseDoStatement() { - var node = createNode(153 /* DoStatement */); - parseExpected(69 /* DoKeyword */); - var saveInIterationStatement = inIterationStatement; - inIterationStatement = 1 /* Nested */; - node.statement = parseStatement(); - inIterationStatement = saveInIterationStatement; - parseExpected(94 /* WhileKeyword */); - parseExpected(11 /* OpenParenToken */); - node.expression = parseExpression(); - parseExpected(12 /* CloseParenToken */); - parseOptional(17 /* SemicolonToken */); - return finishNode(node); - } - function parseWhileStatement() { - var node = createNode(154 /* WhileStatement */); - parseExpected(94 /* WhileKeyword */); - parseExpected(11 /* OpenParenToken */); - node.expression = parseExpression(); - parseExpected(12 /* CloseParenToken */); - var saveInIterationStatement = inIterationStatement; - inIterationStatement = 1 /* Nested */; - node.statement = parseStatement(); - inIterationStatement = saveInIterationStatement; - return finishNode(node); - } - function parseForOrForInStatement() { - var pos = getNodePos(); - parseExpected(76 /* ForKeyword */); - parseExpected(11 /* OpenParenToken */); - if (token !== 17 /* SemicolonToken */) { - if (parseOptional(92 /* VarKeyword */)) { - var declarations = parseVariableDeclarationList(0, true); - if (!declarations.length) { - error(ts.Diagnostics.Variable_declaration_list_cannot_be_empty); - } - } - else { - var varOrInit = parseExpression(true); - } - } - var forOrForInStatement; - if (parseOptional(80 /* InKeyword */)) { - var forInStatement = createNode(156 /* ForInStatement */, pos); - if (declarations) { - if (declarations.length > 1) { - error(ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement); - } - forInStatement.declaration = declarations[0]; - } - else { - forInStatement.variable = varOrInit; - } - forInStatement.expression = parseExpression(); - parseExpected(12 /* CloseParenToken */); - forOrForInStatement = forInStatement; - } - else { - var forStatement = createNode(155 /* ForStatement */, pos); - if (declarations) - forStatement.declarations = declarations; - if (varOrInit) - forStatement.initializer = varOrInit; - parseExpected(17 /* SemicolonToken */); - if (token !== 17 /* SemicolonToken */ && token !== 12 /* CloseParenToken */) { - forStatement.condition = parseExpression(); - } - parseExpected(17 /* SemicolonToken */); - if (token !== 12 /* CloseParenToken */) { - forStatement.iterator = parseExpression(); - } - parseExpected(12 /* CloseParenToken */); - forOrForInStatement = forStatement; - } - var saveInIterationStatement = inIterationStatement; - inIterationStatement = 1 /* Nested */; - forOrForInStatement.statement = parseStatement(); - inIterationStatement = saveInIterationStatement; - return finishNode(forOrForInStatement); - } - function parseBreakOrContinueStatement(kind) { - var node = createNode(kind); - var errorCountBeforeStatement = file.syntacticErrors.length; - parseExpected(kind === 158 /* BreakStatement */ ? 60 /* BreakKeyword */ : 65 /* ContinueKeyword */); - if (!canParseSemicolon()) - node.label = parseIdentifier(); - parseSemicolon(); - finishNode(node); - if (!inAmbientContext && errorCountBeforeStatement === file.syntacticErrors.length) { - if (node.label) { - checkBreakOrContinueStatementWithLabel(node); - } - else { - checkBareBreakOrContinueStatement(node); - } - } - return node; - } - function checkBareBreakOrContinueStatement(node) { - if (node.kind === 158 /* BreakStatement */) { - if (inIterationStatement === 1 /* Nested */ || inSwitchStatement === 1 /* Nested */) { - return; - } - else if (inIterationStatement === 0 /* NotNested */ && inSwitchStatement === 0 /* NotNested */) { - grammarErrorOnNode(node, ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement); - return; - } - } - else if (node.kind === 157 /* ContinueStatement */) { - if (inIterationStatement === 1 /* Nested */) { - return; - } - else if (inIterationStatement === 0 /* NotNested */) { - grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement); - return; - } - } - else { - ts.Debug.fail("checkAnonymousBreakOrContinueStatement"); - } - ts.Debug.assert(inIterationStatement === 2 /* CrossingFunctionBoundary */ || inSwitchStatement === 2 /* CrossingFunctionBoundary */); - grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); - } - function checkBreakOrContinueStatementWithLabel(node) { - var nodeIsNestedInLabel = labelledStatementInfo.nodeIsNestedInLabel(node.label, node.kind === 157 /* ContinueStatement */, false); - if (nodeIsNestedInLabel === 1 /* Nested */) { - return; - } - if (nodeIsNestedInLabel === 2 /* CrossingFunctionBoundary */) { - grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); - return; - } - if (node.kind === 157 /* ContinueStatement */) { - grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); - } - else if (node.kind === 158 /* BreakStatement */) { - grammarErrorOnNode(node, ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement); - } - else { - ts.Debug.fail("checkBreakOrContinueStatementWithLabel"); - } - } - function parseReturnStatement() { - var node = createNode(159 /* ReturnStatement */); - var errorCountBeforeReturnStatement = file.syntacticErrors.length; - var returnTokenStart = scanner.getTokenPos(); - var returnTokenLength = scanner.getTextPos() - returnTokenStart; - parseExpected(84 /* ReturnKeyword */); - if (!canParseSemicolon()) - node.expression = parseExpression(); - parseSemicolon(); - if (!inFunctionBody && !inAmbientContext && errorCountBeforeReturnStatement === file.syntacticErrors.length) { - grammarErrorAtPos(returnTokenStart, returnTokenLength, ts.Diagnostics.A_return_statement_can_only_be_used_within_a_function_body); - } - return finishNode(node); - } - function parseWithStatement() { - var node = createNode(160 /* WithStatement */); - var startPos = scanner.getTokenPos(); - parseExpected(95 /* WithKeyword */); - var endPos = scanner.getStartPos(); - parseExpected(11 /* OpenParenToken */); - node.expression = parseExpression(); - parseExpected(12 /* CloseParenToken */); - node.statement = parseStatement(); - node = finishNode(node); - if (isInStrictMode) { - grammarErrorAtPos(startPos, endPos - startPos, ts.Diagnostics.with_statements_are_not_allowed_in_strict_mode); - } - return node; - } - function parseCaseClause() { - var node = createNode(162 /* CaseClause */); - parseExpected(61 /* CaseKeyword */); - node.expression = parseExpression(); - parseExpected(46 /* ColonToken */); - node.statements = parseList(4 /* SwitchClauseStatements */, false, parseStatement); - return finishNode(node); - } - function parseDefaultClause() { - var node = createNode(163 /* DefaultClause */); - parseExpected(67 /* DefaultKeyword */); - parseExpected(46 /* ColonToken */); - node.statements = parseList(4 /* SwitchClauseStatements */, false, parseStatement); - return finishNode(node); - } - function parseCaseOrDefaultClause() { - return token === 61 /* CaseKeyword */ ? parseCaseClause() : parseDefaultClause(); - } - function parseSwitchStatement() { - var node = createNode(161 /* SwitchStatement */); - parseExpected(86 /* SwitchKeyword */); - parseExpected(11 /* OpenParenToken */); - node.expression = parseExpression(); - parseExpected(12 /* CloseParenToken */); - parseExpected(9 /* OpenBraceToken */); - var saveInSwitchStatement = inSwitchStatement; - inSwitchStatement = 1 /* Nested */; - node.clauses = parseList(3 /* SwitchClauses */, false, parseCaseOrDefaultClause); - inSwitchStatement = saveInSwitchStatement; - parseExpected(10 /* CloseBraceToken */); - var defaultClauses = ts.filter(node.clauses, function (clause) { return clause.kind === 163 /* DefaultClause */; }); - for (var i = 1, n = defaultClauses.length; i < n; i++) { - var clause = defaultClauses[i]; - var start = ts.skipTrivia(file.text, clause.pos); - var end = clause.statements.length > 0 ? clause.statements[0].pos : clause.end; - grammarErrorAtPos(start, end - start, ts.Diagnostics.A_default_clause_cannot_appear_more_than_once_in_a_switch_statement); - } - return finishNode(node); - } - function parseThrowStatement() { - var node = createNode(165 /* ThrowStatement */); - parseExpected(88 /* ThrowKeyword */); - if (scanner.hasPrecedingLineBreak()) { - error(ts.Diagnostics.Line_break_not_permitted_here); - } - node.expression = parseExpression(); - parseSemicolon(); - return finishNode(node); - } - function parseTryStatement() { - var node = createNode(166 /* TryStatement */); - node.tryBlock = parseTokenAndBlock(90 /* TryKeyword */, 167 /* TryBlock */); - if (token === 62 /* CatchKeyword */) { - node.catchBlock = parseCatchBlock(); - } - if (token === 75 /* FinallyKeyword */) { - node.finallyBlock = parseTokenAndBlock(75 /* FinallyKeyword */, 169 /* FinallyBlock */); - } - if (!(node.catchBlock || node.finallyBlock)) { - error(ts.Diagnostics.catch_or_finally_expected); - } - return finishNode(node); - } - function parseTokenAndBlock(token, kind) { - var pos = getNodePos(); - parseExpected(token); - var result = parseBlock(false, false); - result.kind = kind; - result.pos = pos; - return result; - } - function parseCatchBlock() { - var pos = getNodePos(); - parseExpected(62 /* CatchKeyword */); - parseExpected(11 /* OpenParenToken */); - var variable = parseIdentifier(); - var typeAnnotationColonStart = scanner.getTokenPos(); - var typeAnnotationColonLength = scanner.getTextPos() - typeAnnotationColonStart; - var typeAnnotation = parseTypeAnnotation(); - parseExpected(12 /* CloseParenToken */); - var result = parseBlock(false, false); - result.kind = 168 /* CatchBlock */; - result.pos = pos; - result.variable = variable; - if (typeAnnotation) { - errorAtPos(typeAnnotationColonStart, typeAnnotationColonLength, ts.Diagnostics.Catch_clause_parameter_cannot_have_a_type_annotation); - } - if (isInStrictMode && isEvalOrArgumentsIdentifier(variable)) { - reportInvalidUseInStrictMode(variable); - } - return result; - } - function parseDebuggerStatement() { - var node = createNode(170 /* DebuggerStatement */); - parseExpected(66 /* DebuggerKeyword */); - parseSemicolon(); - return finishNode(node); - } - function isIterationStatementStart() { - return token === 94 /* WhileKeyword */ || token === 69 /* DoKeyword */ || token === 76 /* ForKeyword */; - } - function parseStatementWithLabelSet() { - labelledStatementInfo.pushCurrentLabelSet(isIterationStatementStart()); - var statement = parseStatement(); - labelledStatementInfo.pop(); - return statement; - } - function isLabel() { - return isIdentifier() && lookAhead(function () { return nextToken() === 46 /* ColonToken */; }); - } - function parseLabelledStatement() { - var node = createNode(164 /* LabeledStatement */); - node.label = parseIdentifier(); - parseExpected(46 /* ColonToken */); - if (labelledStatementInfo.nodeIsNestedInLabel(node.label, false, true)) { - grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, getTextOfNodeFromSourceText(sourceText, node.label)); - } - labelledStatementInfo.addLabel(node.label); - node.statement = isLabel() ? parseLabelledStatement() : parseStatementWithLabelSet(); - return finishNode(node); - } - function parseExpressionStatement() { - var node = createNode(151 /* ExpressionStatement */); - node.expression = parseExpression(); - parseSemicolon(); - return finishNode(node); - } - function isStatement(inErrorRecovery) { - switch (token) { - case 17 /* SemicolonToken */: - return !inErrorRecovery; - case 9 /* OpenBraceToken */: - case 92 /* VarKeyword */: - case 77 /* FunctionKeyword */: - case 78 /* IfKeyword */: - case 69 /* DoKeyword */: - case 94 /* WhileKeyword */: - case 76 /* ForKeyword */: - case 65 /* ContinueKeyword */: - case 60 /* BreakKeyword */: - case 84 /* ReturnKeyword */: - case 95 /* WithKeyword */: - case 86 /* SwitchKeyword */: - case 88 /* ThrowKeyword */: - case 90 /* TryKeyword */: - case 66 /* DebuggerKeyword */: - case 62 /* CatchKeyword */: - case 75 /* FinallyKeyword */: - return true; - case 97 /* InterfaceKeyword */: - case 63 /* ClassKeyword */: - case 110 /* ModuleKeyword */: - case 71 /* EnumKeyword */: - if (isDeclaration()) { - return false; - } - case 102 /* PublicKeyword */: - case 100 /* PrivateKeyword */: - case 101 /* ProtectedKeyword */: - case 103 /* StaticKeyword */: - if (lookAhead(function () { return nextToken() >= 59 /* Identifier */; })) { - return false; - } - default: - return isExpression(); - } - } - function parseStatement() { - switch (token) { - case 9 /* OpenBraceToken */: - return parseBlock(false, false); - case 92 /* VarKeyword */: - return parseVariableStatement(); - case 77 /* FunctionKeyword */: - return parseFunctionDeclaration(); - case 17 /* SemicolonToken */: - return parseEmptyStatement(); - case 78 /* IfKeyword */: - return parseIfStatement(); - case 69 /* DoKeyword */: - return parseDoStatement(); - case 94 /* WhileKeyword */: - return parseWhileStatement(); - case 76 /* ForKeyword */: - return parseForOrForInStatement(); - case 65 /* ContinueKeyword */: - return parseBreakOrContinueStatement(157 /* ContinueStatement */); - case 60 /* BreakKeyword */: - return parseBreakOrContinueStatement(158 /* BreakStatement */); - case 84 /* ReturnKeyword */: - return parseReturnStatement(); - case 95 /* WithKeyword */: - return parseWithStatement(); - case 86 /* SwitchKeyword */: - return parseSwitchStatement(); - case 88 /* ThrowKeyword */: - return parseThrowStatement(); - case 90 /* TryKeyword */: - case 62 /* CatchKeyword */: - case 75 /* FinallyKeyword */: - return parseTryStatement(); - case 66 /* DebuggerKeyword */: - return parseDebuggerStatement(); - default: - if (isLabel()) { - return parseLabelledStatement(); - } - return parseExpressionStatement(); - } - } - function parseStatementOrFunction() { - return token === 77 /* FunctionKeyword */ ? parseFunctionDeclaration() : parseStatement(); - } - function parseAndCheckFunctionBody(isConstructor) { - var initialPosition = scanner.getTokenPos(); - var errorCountBeforeBody = file.syntacticErrors.length; - if (token === 9 /* OpenBraceToken */) { - var body = parseBody(false); - if (body && inAmbientContext && file.syntacticErrors.length === errorCountBeforeBody) { - var diagnostic = isConstructor ? ts.Diagnostics.A_constructor_implementation_cannot_be_declared_in_an_ambient_context : ts.Diagnostics.A_function_implementation_cannot_be_declared_in_an_ambient_context; - grammarErrorAtPos(initialPosition, 1, diagnostic); - } - return body; - } - if (canParseSemicolon()) { - parseSemicolon(); - return undefined; - } - error(ts.Diagnostics.Block_or_expected); - } - function parseVariableDeclaration(flags, noIn) { - var node = createNode(171 /* VariableDeclaration */); - node.flags = flags; - var errorCountBeforeVariableDeclaration = file.syntacticErrors.length; - node.name = parseIdentifier(); - node.type = parseTypeAnnotation(); - var initializerStart = scanner.getTokenPos(); - var initializerFirstTokenLength = scanner.getTextPos() - initializerStart; - node.initializer = parseInitializer(false, noIn); - if (inAmbientContext && node.initializer && errorCountBeforeVariableDeclaration === file.syntacticErrors.length) { - grammarErrorAtPos(initializerStart, initializerFirstTokenLength, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); - } - if (isInStrictMode && isEvalOrArgumentsIdentifier(node.name)) { - reportInvalidUseInStrictMode(node.name); - } - return finishNode(node); - } - function parseVariableDeclarationList(flags, noIn) { - return parseDelimitedList(9 /* VariableDeclarations */, function () { return parseVariableDeclaration(flags, noIn); }, false); - } - function parseVariableStatement(pos, flags) { - var node = createNode(149 /* VariableStatement */, pos); - if (flags) - node.flags = flags; - var errorCountBeforeVarStatement = file.syntacticErrors.length; - parseExpected(92 /* VarKeyword */); - node.declarations = parseVariableDeclarationList(flags, false); - parseSemicolon(); - finishNode(node); - if (!node.declarations.length && file.syntacticErrors.length === errorCountBeforeVarStatement) { - grammarErrorOnNode(node, ts.Diagnostics.Variable_declaration_list_cannot_be_empty); - } - return node; - } - function parseFunctionDeclaration(pos, flags) { - var node = createNode(172 /* FunctionDeclaration */, pos); - if (flags) - node.flags = flags; - parseExpected(77 /* FunctionKeyword */); - node.name = parseIdentifier(); - var sig = parseSignature(124 /* CallSignature */, 46 /* ColonToken */, false); - node.typeParameters = sig.typeParameters; - node.parameters = sig.parameters; - node.type = sig.type; - node.body = parseAndCheckFunctionBody(false); - if (isInStrictMode && isEvalOrArgumentsIdentifier(node.name)) { - reportInvalidUseInStrictMode(node.name); - } - return finishNode(node); - } - function parseConstructorDeclaration(pos, flags) { - var node = createNode(121 /* Constructor */, pos); - node.flags = flags; - parseExpected(107 /* ConstructorKeyword */); - var sig = parseSignature(124 /* CallSignature */, 46 /* ColonToken */, false); - node.typeParameters = sig.typeParameters; - node.parameters = sig.parameters; - node.type = sig.type; - node.body = parseAndCheckFunctionBody(true); - if (node.typeParameters) { - grammarErrorAtPos(node.typeParameters.pos, node.typeParameters.end - node.typeParameters.pos, ts.Diagnostics.Type_parameters_cannot_appear_on_a_constructor_declaration); - } - if (node.type) { - grammarErrorOnNode(node.type, ts.Diagnostics.Type_annotation_cannot_appear_on_a_constructor_declaration); - } - return finishNode(node); - } - function parsePropertyMemberDeclaration(pos, flags) { - var errorCountBeforePropertyDeclaration = file.syntacticErrors.length; - var name = parsePropertyName(); - var questionStart = scanner.getTokenPos(); - if (parseOptional(45 /* QuestionToken */)) { - errorAtPos(questionStart, scanner.getStartPos() - questionStart, ts.Diagnostics.A_class_member_cannot_be_declared_optional); - } - if (token === 11 /* OpenParenToken */ || token === 19 /* LessThanToken */) { - var method = createNode(120 /* Method */, pos); - method.flags = flags; - method.name = name; - var sig = parseSignature(124 /* CallSignature */, 46 /* ColonToken */, false); - method.typeParameters = sig.typeParameters; - method.parameters = sig.parameters; - method.type = sig.type; - method.body = parseAndCheckFunctionBody(false); - return finishNode(method); - } - else { - var property = createNode(119 /* Property */, pos); - property.flags = flags; - property.name = name; - property.type = parseTypeAnnotation(); - var initializerStart = scanner.getTokenPos(); - var initializerFirstTokenLength = scanner.getTextPos() - initializerStart; - property.initializer = parseInitializer(false); - parseSemicolon(); - if (inAmbientContext && property.initializer && errorCountBeforePropertyDeclaration === file.syntacticErrors.length) { - grammarErrorAtPos(initializerStart, initializerFirstTokenLength, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); - } - return finishNode(property); - } - } - function parseAndCheckMemberAccessorDeclaration(kind, pos, flags) { - var errorCountBeforeAccessor = file.syntacticErrors.length; - var accessor = parseMemberAccessorDeclaration(kind, pos, flags); - if (errorCountBeforeAccessor === file.syntacticErrors.length) { - if (languageVersion < 1 /* ES5 */) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher); - } - else if (inAmbientContext) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_be_declared_in_an_ambient_context); - } - else if (accessor.typeParameters) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); - } - else if (kind === 122 /* GetAccessor */ && accessor.parameters.length) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.A_get_accessor_cannot_have_parameters); - } - else if (kind === 123 /* SetAccessor */) { - if (accessor.type) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); - } - else if (accessor.parameters.length !== 1) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter); - } - else { - var parameter = accessor.parameters[0]; - if (parameter.flags & 8 /* Rest */) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_rest_parameter); - } - else if (parameter.flags & ts.NodeFlags.Modifier) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); - } - else if (parameter.flags & 4 /* QuestionMark */) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_an_optional_parameter); - } - else if (parameter.initializer) { - grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_parameter_cannot_have_an_initializer); - } - } - } - } - return accessor; - } - function parseMemberAccessorDeclaration(kind, pos, flags) { - var node = createNode(kind, pos); - node.flags = flags; - node.name = parsePropertyName(); - var sig = parseSignature(124 /* CallSignature */, 46 /* ColonToken */, false); - node.typeParameters = sig.typeParameters; - node.parameters = sig.parameters; - node.type = sig.type; - if (inAmbientContext && canParseSemicolon()) { - parseSemicolon(); - node.body = createMissingNode(); - } - else { - node.body = parseBody(false); - } - return finishNode(node); - } - function isClassMemberStart() { - var idToken; - while (isModifier(token)) { - idToken = token; - nextToken(); - } - if (isPropertyName()) { - idToken = token; - nextToken(); - } - if (token === 13 /* OpenBracketToken */) { - return true; - } - if (idToken !== undefined) { - if (!isKeyword(idToken) || idToken === 113 /* SetKeyword */ || idToken === 109 /* GetKeyword */) { - return true; - } - switch (token) { - case 11 /* OpenParenToken */: - case 19 /* LessThanToken */: - case 46 /* ColonToken */: - case 47 /* EqualsToken */: - case 45 /* QuestionToken */: - return true; - default: - return canParseSemicolon(); - } - } - return false; - } - function parseAndCheckModifiers(context) { - var flags = 0; - var lastStaticModifierStart; - var lastStaticModifierLength; - var lastDeclareModifierStart; - var lastDeclareModifierLength; - var lastPrivateModifierStart; - var lastPrivateModifierLength; - var lastProtectedModifierStart; - var lastProtectedModifierLength; - while (true) { - var modifierStart = scanner.getTokenPos(); - var modifierToken = token; - if (!parseAnyContextualModifier()) - break; - var modifierLength = scanner.getStartPos() - modifierStart; - switch (modifierToken) { - case 102 /* PublicKeyword */: - if (flags & ts.NodeFlags.AccessibilityModifier) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics.Accessibility_modifier_already_seen); - } - else if (flags & 128 /* Static */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_must_precede_1_modifier, "public", "static"); - } - else if (context === 1 /* ModuleElements */ || context === 0 /* SourceElements */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, "public"); - } - flags |= 16 /* Public */; - break; - case 100 /* PrivateKeyword */: - if (flags & ts.NodeFlags.AccessibilityModifier) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics.Accessibility_modifier_already_seen); - } - else if (flags & 128 /* Static */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_must_precede_1_modifier, "private", "static"); - } - else if (context === 1 /* ModuleElements */ || context === 0 /* SourceElements */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, "private"); - } - lastPrivateModifierStart = modifierStart; - lastPrivateModifierLength = modifierLength; - flags |= 32 /* Private */; - break; - case 101 /* ProtectedKeyword */: - if (flags & 16 /* Public */ || flags & 32 /* Private */ || flags & 64 /* Protected */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics.Accessibility_modifier_already_seen); - } - else if (flags & 128 /* Static */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_must_precede_1_modifier, "protected", "static"); - } - else if (context === 1 /* ModuleElements */ || context === 0 /* SourceElements */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, "protected"); - } - lastProtectedModifierStart = modifierStart; - lastProtectedModifierLength = modifierLength; - flags |= 64 /* Protected */; - break; - case 103 /* StaticKeyword */: - if (flags & 128 /* Static */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_already_seen, "static"); - } - else if (context === 1 /* ModuleElements */ || context === 0 /* SourceElements */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, "static"); - } - else if (context === 3 /* Parameters */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); - } - lastStaticModifierStart = modifierStart; - lastStaticModifierLength = modifierLength; - flags |= 128 /* Static */; - break; - case 72 /* ExportKeyword */: - if (flags & 1 /* Export */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_already_seen, "export"); - } - else if (flags & 2 /* Ambient */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_must_precede_1_modifier, "export", "declare"); - } - else if (context === 2 /* ClassMembers */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); - } - else if (context === 3 /* Parameters */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); - } - flags |= 1 /* Export */; - break; - case 108 /* DeclareKeyword */: - if (flags & 2 /* Ambient */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_already_seen, "declare"); - } - else if (context === 2 /* ClassMembers */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); - } - else if (context === 3 /* Parameters */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); - } - else if (inAmbientContext && context === 1 /* ModuleElements */) { - grammarErrorAtPos(modifierStart, modifierLength, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); - } - lastDeclareModifierStart = modifierStart; - lastDeclareModifierLength = modifierLength; - flags |= 2 /* Ambient */; - break; - } - } - if (token === 107 /* ConstructorKeyword */ && flags & 128 /* Static */) { - grammarErrorAtPos(lastStaticModifierStart, lastStaticModifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); - } - else if (token === 107 /* ConstructorKeyword */ && flags & 32 /* Private */) { - grammarErrorAtPos(lastPrivateModifierStart, lastPrivateModifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "private"); - } - else if (token === 107 /* ConstructorKeyword */ && flags & 64 /* Protected */) { - grammarErrorAtPos(lastProtectedModifierStart, lastProtectedModifierLength, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "protected"); - } - else if (token === 79 /* ImportKeyword */) { - if (flags & 2 /* Ambient */) { - grammarErrorAtPos(lastDeclareModifierStart, lastDeclareModifierLength, ts.Diagnostics.A_declare_modifier_cannot_be_used_with_an_import_declaration, "declare"); - } - } - else if (token === 97 /* InterfaceKeyword */) { - if (flags & 2 /* Ambient */) { - grammarErrorAtPos(lastDeclareModifierStart, lastDeclareModifierLength, ts.Diagnostics.A_declare_modifier_cannot_be_used_with_an_interface_declaration, "declare"); - } - } - else if (token !== 72 /* ExportKeyword */ && !(flags & 2 /* Ambient */) && inAmbientContext && context === 0 /* SourceElements */) { - var declarationStart = scanner.getTokenPos(); - var declarationFirstTokenLength = scanner.getTextPos() - declarationStart; - grammarErrorAtPos(declarationStart, declarationFirstTokenLength, ts.Diagnostics.A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file); - } - return flags; - } - function parseClassMemberDeclaration() { - var pos = getNodePos(); - var flags = parseAndCheckModifiers(2 /* ClassMembers */); - if (parseContextualModifier(109 /* GetKeyword */)) { - return parseAndCheckMemberAccessorDeclaration(122 /* GetAccessor */, pos, flags); - } - if (parseContextualModifier(113 /* SetKeyword */)) { - return parseAndCheckMemberAccessorDeclaration(123 /* SetAccessor */, pos, flags); - } - if (token === 107 /* ConstructorKeyword */) { - return parseConstructorDeclaration(pos, flags); - } - if (token >= 59 /* Identifier */ || token === 7 /* StringLiteral */ || token === 6 /* NumericLiteral */) { - return parsePropertyMemberDeclaration(pos, flags); - } - if (token === 13 /* OpenBracketToken */) { - if (flags) { - var start = getTokenPos(pos); - var length = getNodePos() - start; - errorAtPos(start, length, ts.Diagnostics.Modifiers_not_permitted_on_index_signature_members); - } - return parseIndexSignatureMember(); - } - ts.Debug.fail("Should not have attempted to parse class member declaration."); - } - function parseClassDeclaration(pos, flags) { - var node = createNode(174 /* ClassDeclaration */, pos); - node.flags = flags; - var errorCountBeforeClassDeclaration = file.syntacticErrors.length; - parseExpected(63 /* ClassKeyword */); - node.name = parseIdentifier(); - node.typeParameters = parseTypeParameters(); - node.baseType = parseOptional(73 /* ExtendsKeyword */) ? parseTypeReference() : undefined; - var implementsKeywordStart = scanner.getTokenPos(); - var implementsKeywordLength; - if (parseOptional(96 /* ImplementsKeyword */)) { - implementsKeywordLength = scanner.getStartPos() - implementsKeywordStart; - node.implementedTypes = parseDelimitedList(8 /* BaseTypeReferences */, parseTypeReference, false); - } - var errorCountBeforeClassBody = file.syntacticErrors.length; - if (parseExpected(9 /* OpenBraceToken */)) { - node.members = parseList(6 /* ClassMembers */, false, parseClassMemberDeclaration); - parseExpected(10 /* CloseBraceToken */); - } - else { - node.members = createMissingList(); - } - if (node.implementedTypes && !node.implementedTypes.length && errorCountBeforeClassBody === errorCountBeforeClassDeclaration) { - grammarErrorAtPos(implementsKeywordStart, implementsKeywordLength, ts.Diagnostics._0_list_cannot_be_empty, "implements"); - } - return finishNode(node); - } - function parseInterfaceDeclaration(pos, flags) { - var node = createNode(175 /* InterfaceDeclaration */, pos); - node.flags = flags; - var errorCountBeforeInterfaceDeclaration = file.syntacticErrors.length; - parseExpected(97 /* InterfaceKeyword */); - node.name = parseIdentifier(); - node.typeParameters = parseTypeParameters(); - var extendsKeywordStart = scanner.getTokenPos(); - var extendsKeywordLength; - if (parseOptional(73 /* ExtendsKeyword */)) { - extendsKeywordLength = scanner.getStartPos() - extendsKeywordStart; - node.baseTypes = parseDelimitedList(8 /* BaseTypeReferences */, parseTypeReference, false); - } - var errorCountBeforeInterfaceBody = file.syntacticErrors.length; - node.members = parseTypeLiteral().members; - if (node.baseTypes && !node.baseTypes.length && errorCountBeforeInterfaceBody === errorCountBeforeInterfaceDeclaration) { - grammarErrorAtPos(extendsKeywordStart, extendsKeywordLength, ts.Diagnostics._0_list_cannot_be_empty, "extends"); - } - return finishNode(node); - } - function parseAndCheckEnumDeclaration(pos, flags) { - function isIntegerLiteral(expression) { - function isInteger(literalExpression) { - return /^[0-9]+([eE]\+?[0-9]+)?$/.test(literalExpression.text); - } - if (expression.kind === 143 /* PrefixOperator */) { - var unaryExpression = expression; - if (unaryExpression.operator === 28 /* PlusToken */ || unaryExpression.operator === 29 /* MinusToken */) { - expression = unaryExpression.operand; - } - } - if (expression.kind === 6 /* NumericLiteral */) { - return isInteger(expression); - } - return false; - } - var inConstantEnumMemberSection = true; - function parseAndCheckEnumMember() { - var node = createNode(181 /* EnumMember */); - var errorCountBeforeEnumMember = file.syntacticErrors.length; - node.name = parsePropertyName(); - node.initializer = parseInitializer(false); - if (inAmbientContext) { - if (node.initializer && !isIntegerLiteral(node.initializer) && errorCountBeforeEnumMember === file.syntacticErrors.length) { - grammarErrorOnNode(node.name, ts.Diagnostics.Ambient_enum_elements_can_only_have_integer_literal_initializers); - } - } - else if (node.initializer) { - inConstantEnumMemberSection = isIntegerLiteral(node.initializer); - } - else if (!inConstantEnumMemberSection && errorCountBeforeEnumMember === file.syntacticErrors.length) { - grammarErrorOnNode(node.name, ts.Diagnostics.Enum_member_must_have_initializer); - } - return finishNode(node); - } - var node = createNode(176 /* EnumDeclaration */, pos); - node.flags = flags; - parseExpected(71 /* EnumKeyword */); - node.name = parseIdentifier(); - if (parseExpected(9 /* OpenBraceToken */)) { - node.members = parseDelimitedList(7 /* EnumMembers */, parseAndCheckEnumMember, true); - parseExpected(10 /* CloseBraceToken */); - } - else { - node.members = createMissingList(); - } - return finishNode(node); - } - function parseModuleBody() { - var node = createNode(178 /* ModuleBlock */); - if (parseExpected(9 /* OpenBraceToken */)) { - node.statements = parseList(1 /* ModuleElements */, false, parseModuleElement); - parseExpected(10 /* CloseBraceToken */); - } - else { - node.statements = createMissingList(); - } - return finishNode(node); - } - function parseInternalModuleTail(pos, flags) { - var node = createNode(177 /* ModuleDeclaration */, pos); - node.flags = flags; - node.name = parseIdentifier(); - if (parseOptional(15 /* DotToken */)) { - node.body = parseInternalModuleTail(getNodePos(), 1 /* Export */); - } - else { - node.body = parseModuleBody(); - ts.forEach(node.body.statements, function (s) { - if (s.kind === 180 /* ExportAssignment */) { - grammarErrorOnNode(s, ts.Diagnostics.An_export_assignment_cannot_be_used_in_an_internal_module); - } - else if (s.kind === 179 /* ImportDeclaration */ && s.externalModuleName) { - grammarErrorOnNode(s, ts.Diagnostics.Import_declarations_in_an_internal_module_cannot_reference_an_external_module); - } - }); - } - return finishNode(node); - } - function parseAmbientExternalModuleDeclaration(pos, flags) { - var node = createNode(177 /* ModuleDeclaration */, pos); - node.flags = flags; - node.name = parseStringLiteral(); - if (!inAmbientContext) { - var errorCount = file.syntacticErrors.length; - if (!errorCount || file.syntacticErrors[errorCount - 1].start < getTokenPos(pos)) { - grammarErrorOnNode(node.name, ts.Diagnostics.Only_ambient_modules_can_use_quoted_names); - } - } - var saveInAmbientContext = inAmbientContext; - inAmbientContext = true; - node.body = parseModuleBody(); - inAmbientContext = saveInAmbientContext; - return finishNode(node); - } - function parseModuleDeclaration(pos, flags) { - parseExpected(110 /* ModuleKeyword */); - return token === 7 /* StringLiteral */ ? parseAmbientExternalModuleDeclaration(pos, flags) : parseInternalModuleTail(pos, flags); - } - function parseImportDeclaration(pos, flags) { - var node = createNode(179 /* ImportDeclaration */, pos); - node.flags = flags; - parseExpected(79 /* ImportKeyword */); - node.name = parseIdentifier(); - parseExpected(47 /* EqualsToken */); - var entityName = parseEntityName(false); - if (entityName.kind === 59 /* Identifier */ && entityName.text === "require" && parseOptional(11 /* OpenParenToken */)) { - node.externalModuleName = parseStringLiteral(); - parseExpected(12 /* CloseParenToken */); - } - else { - node.entityName = entityName; - } - parseSemicolon(); - return finishNode(node); - } - function parseExportAssignmentTail(pos) { - var node = createNode(180 /* ExportAssignment */, pos); - node.exportName = parseIdentifier(); - parseSemicolon(); - return finishNode(node); - } - function isDeclaration() { - switch (token) { - case 92 /* VarKeyword */: - case 77 /* FunctionKeyword */: - return true; - case 63 /* ClassKeyword */: - case 97 /* InterfaceKeyword */: - case 71 /* EnumKeyword */: - case 79 /* ImportKeyword */: - return lookAhead(function () { return nextToken() >= 59 /* Identifier */; }); - case 110 /* ModuleKeyword */: - return lookAhead(function () { return nextToken() >= 59 /* Identifier */ || token === 7 /* StringLiteral */; }); - case 72 /* ExportKeyword */: - return lookAhead(function () { return nextToken() === 47 /* EqualsToken */ || isDeclaration(); }); - case 108 /* DeclareKeyword */: - case 102 /* PublicKeyword */: - case 100 /* PrivateKeyword */: - case 101 /* ProtectedKeyword */: - case 103 /* StaticKeyword */: - return lookAhead(function () { - nextToken(); - return isDeclaration(); - }); - } - } - function parseDeclaration(modifierContext) { - var pos = getNodePos(); - var errorCountBeforeModifiers = file.syntacticErrors.length; - var flags = parseAndCheckModifiers(modifierContext); - if (token === 72 /* ExportKeyword */) { - var modifiersEnd = scanner.getStartPos(); - nextToken(); - if (parseOptional(47 /* EqualsToken */)) { - var exportAssignmentTail = parseExportAssignmentTail(pos); - if (flags !== 0 && errorCountBeforeModifiers === file.syntacticErrors.length) { - var modifiersStart = ts.skipTrivia(sourceText, pos); - grammarErrorAtPos(modifiersStart, modifiersEnd - modifiersStart, ts.Diagnostics.An_export_assignment_cannot_have_modifiers); - } - return exportAssignmentTail; - } - } - var saveInAmbientContext = inAmbientContext; - if (flags & 2 /* Ambient */) { - inAmbientContext = true; - } - var result; - switch (token) { - case 92 /* VarKeyword */: - result = parseVariableStatement(pos, flags); - break; - case 77 /* FunctionKeyword */: - result = parseFunctionDeclaration(pos, flags); - break; - case 63 /* ClassKeyword */: - result = parseClassDeclaration(pos, flags); - break; - case 97 /* InterfaceKeyword */: - result = parseInterfaceDeclaration(pos, flags); - break; - case 71 /* EnumKeyword */: - result = parseAndCheckEnumDeclaration(pos, flags); - break; - case 110 /* ModuleKeyword */: - result = parseModuleDeclaration(pos, flags); - break; - case 79 /* ImportKeyword */: - result = parseImportDeclaration(pos, flags); - break; - default: - error(ts.Diagnostics.Declaration_expected); - } - inAmbientContext = saveInAmbientContext; - return result; - } - function isSourceElement(inErrorRecovery) { - return isDeclaration() || isStatement(inErrorRecovery); - } - function parseSourceElement() { - return parseSourceElementOrModuleElement(0 /* SourceElements */); - } - function parseModuleElement() { - return parseSourceElementOrModuleElement(1 /* ModuleElements */); - } - function parseSourceElementOrModuleElement(modifierContext) { - if (isDeclaration()) { - return parseDeclaration(modifierContext); - } - var statementStart = scanner.getTokenPos(); - var statementFirstTokenLength = scanner.getTextPos() - statementStart; - var errorCountBeforeStatement = file.syntacticErrors.length; - var statement = parseStatement(); - if (inAmbientContext && file.syntacticErrors.length === errorCountBeforeStatement) { - grammarErrorAtPos(statementStart, statementFirstTokenLength, ts.Diagnostics.Statements_are_not_allowed_in_ambient_contexts); - } - return statement; - } - function processReferenceComments() { - var referencedFiles = []; - var amdDependencies = []; - commentRanges = []; - token = scanner.scan(); - for (var i = 0; i < commentRanges.length; i++) { - var range = commentRanges[i]; - var comment = sourceText.substring(range.pos, range.end); - var simpleReferenceRegEx = /^\/\/\/\s*/gim; - if (isNoDefaultLibRegEx.exec(comment)) { - file.hasNoDefaultLib = true; - } - else { - var matchResult = ts.fullTripleSlashReferencePathRegEx.exec(comment); - var start = range.pos; - var end = range.end; - var length = end - start; - if (!matchResult) { - errorAtPos(start, length, ts.Diagnostics.Invalid_reference_directive_syntax); - } - else { - referencedFiles.push({ - pos: start, - end: end, - filename: matchResult[3] - }); - } - } - } - else { - var amdDependencyRegEx = /^\/\/\/\s*= 0; - } - function processRootFile(filename, isDefaultLib) { - processSourceFile(ts.normalizePath(filename), isDefaultLib); - } - function processSourceFile(filename, isDefaultLib, refFile, refPos, refEnd) { - if (refEnd !== undefined && refPos !== undefined) { - var start = refPos; - var length = refEnd - refPos; - } - var diagnostic; - if (hasExtension(filename)) { - if (!ts.fileExtensionIs(filename, ".ts")) { - diagnostic = ts.Diagnostics.File_0_must_have_extension_ts_or_d_ts; - } - else if (!findSourceFile(filename, isDefaultLib, refFile, refPos, refEnd)) { - diagnostic = ts.Diagnostics.File_0_not_found; - } - else if (refFile && host.getCanonicalFileName(filename) === host.getCanonicalFileName(refFile.filename)) { - diagnostic = ts.Diagnostics.A_file_cannot_have_a_reference_to_itself; - } - } - else { - if (!(findSourceFile(filename + ".ts", isDefaultLib, refFile, refPos, refEnd) || findSourceFile(filename + ".d.ts", isDefaultLib, refFile, refPos, refEnd))) { - diagnostic = ts.Diagnostics.File_0_not_found; - filename += ".ts"; - } - } - if (diagnostic) { - if (refFile) { - errors.push(ts.createFileDiagnostic(refFile, start, length, diagnostic, filename)); - } - else { - errors.push(ts.createCompilerDiagnostic(diagnostic, filename)); - } - } - } - function findSourceFile(filename, isDefaultLib, refFile, refStart, refLength) { - var canonicalName = host.getCanonicalFileName(filename); - if (ts.hasProperty(filesByName, canonicalName)) { - var file = filesByName[canonicalName]; - if (file && host.useCaseSensitiveFileNames() && canonicalName !== file.filename) { - errors.push(ts.createFileDiagnostic(refFile, refStart, refLength, ts.Diagnostics.Filename_0_differs_from_already_included_filename_1_only_in_casing, filename, file.filename)); - } - } - else { - var file = filesByName[canonicalName] = host.getSourceFile(filename, options.target, function (hostErrorMessage) { - errors.push(ts.createFileDiagnostic(refFile, refStart, refLength, ts.Diagnostics.Cannot_read_file_0_Colon_1, filename, hostErrorMessage)); - }); - if (file) { - seenNoDefaultLib = seenNoDefaultLib || file.hasNoDefaultLib; - if (!options.noResolve) { - var basePath = ts.getDirectoryPath(filename); - processReferencedFiles(file, basePath); - processImportedModules(file, basePath); - } - if (isDefaultLib) { - files.unshift(file); - } - else { - files.push(file); - } - ts.forEach(file.syntacticErrors, function (e) { - errors.push(e); - }); - } - } - return file; - } - function processReferencedFiles(file, basePath) { - ts.forEach(file.referencedFiles, function (ref) { - var referencedFilename = ts.isRootedDiskPath(ref.filename) ? ref.filename : ts.combinePaths(basePath, ref.filename); - processSourceFile(ts.normalizePath(referencedFilename), false, file, ref.pos, ref.end); - }); - } - function processImportedModules(file, basePath) { - ts.forEach(file.statements, function (node) { - if (node.kind === 179 /* ImportDeclaration */ && node.externalModuleName) { - var nameLiteral = node.externalModuleName; - var moduleName = nameLiteral.text; - if (moduleName) { - var searchPath = basePath; - while (true) { - var searchName = ts.normalizePath(ts.combinePaths(searchPath, moduleName)); - if (findModuleSourceFile(searchName + ".ts", nameLiteral) || findModuleSourceFile(searchName + ".d.ts", nameLiteral)) { - break; - } - var parentPath = ts.getDirectoryPath(searchPath); - if (parentPath === searchPath) { - break; - } - searchPath = parentPath; - } - } - } - else if (node.kind === 177 /* ModuleDeclaration */ && node.name.kind === 7 /* StringLiteral */ && (node.flags & 2 /* Ambient */ || isDeclarationFile(file))) { - forEachChild(node.body, function (node) { - if (node.kind === 179 /* ImportDeclaration */ && node.externalModuleName) { - var nameLiteral = node.externalModuleName; - var moduleName = nameLiteral.text; - if (moduleName) { - var searchName = ts.normalizePath(ts.combinePaths(basePath, moduleName)); - var tsFile = findModuleSourceFile(searchName + ".ts", nameLiteral); - if (!tsFile) { - findModuleSourceFile(searchName + ".d.ts", nameLiteral); - } - } - } - }); - } - }); - function findModuleSourceFile(filename, nameLiteral) { - return findSourceFile(filename, false, file, nameLiteral.pos, nameLiteral.end - nameLiteral.pos); - } - } - function verifyCompilerOptions() { - if (!options.sourceMap && (options.mapRoot || options.sourceRoot)) { - if (options.mapRoot) { - errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Option_mapRoot_cannot_be_specified_without_specifying_sourcemap_option)); - } - if (options.sourceRoot) { - errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Option_sourceRoot_cannot_be_specified_without_specifying_sourcemap_option)); - } - return; - } - var firstExternalModule = ts.forEach(files, function (f) { return isExternalModule(f) ? f : undefined; }); - if (firstExternalModule && options.module === 0 /* None */) { - var externalModuleErrorSpan = getErrorSpanForNode(firstExternalModule.externalModuleIndicator); - var errorStart = ts.skipTrivia(firstExternalModule.text, externalModuleErrorSpan.pos); - var errorLength = externalModuleErrorSpan.end - errorStart; - errors.push(ts.createFileDiagnostic(firstExternalModule, errorStart, errorLength, ts.Diagnostics.Cannot_compile_external_modules_unless_the_module_flag_is_provided)); - } - if (options.outDir || options.sourceRoot || (options.mapRoot && (!options.out || firstExternalModule !== undefined))) { - var commonPathComponents; - ts.forEach(files, function (sourceFile) { - if (!(sourceFile.flags & 1024 /* DeclarationFile */) && !ts.fileExtensionIs(sourceFile.filename, ".js")) { - var sourcePathComponents = ts.getNormalizedPathComponents(sourceFile.filename, host.getCurrentDirectory()); - sourcePathComponents.pop(); - if (commonPathComponents) { - for (var i = 0; i < Math.min(commonPathComponents.length, sourcePathComponents.length); i++) { - if (commonPathComponents[i] !== sourcePathComponents[i]) { - if (i === 0) { - errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files)); - return; - } - commonPathComponents.length = i; - break; - } - } - if (sourcePathComponents.length < commonPathComponents.length) { - commonPathComponents.length = sourcePathComponents.length; - } - } - else { - commonPathComponents = sourcePathComponents; - } - } - }); - commonSourceDirectory = ts.getNormalizedPathFromPathComponents(commonPathComponents); - if (commonSourceDirectory) { - commonSourceDirectory += ts.directorySeparator; - } - } - } - } - ts.createProgram = createProgram; -})(ts || (ts = {})); -var ts; -(function (ts) { - function isInstantiated(node) { - if (node.kind === 175 /* InterfaceDeclaration */) { - return false; - } - else if (node.kind === 179 /* ImportDeclaration */ && !(node.flags & 1 /* Export */)) { - return false; - } - else if (node.kind === 178 /* ModuleBlock */ && !ts.forEachChild(node, isInstantiated)) { - return false; - } - else if (node.kind === 177 /* ModuleDeclaration */ && !isInstantiated(node.body)) { - return false; - } - else { - return true; - } - } - ts.isInstantiated = isInstantiated; - function bindSourceFile(file) { - var parent; - var container; - var lastContainer; - var symbolCount = 0; - var Symbol = ts.objectAllocator.getSymbolConstructor(); - if (!file.locals) { - file.locals = {}; - container = file; - bind(file); - file.symbolCount = symbolCount; - } - function createSymbol(flags, name) { - symbolCount++; - return new Symbol(flags, name); - } - function addDeclarationToSymbol(symbol, node, symbolKind) { - symbol.flags |= symbolKind; - if (!symbol.declarations) - symbol.declarations = []; - symbol.declarations.push(node); - if (symbolKind & ts.SymbolFlags.HasExports && !symbol.exports) - symbol.exports = {}; - if (symbolKind & ts.SymbolFlags.HasMembers && !symbol.members) - symbol.members = {}; - node.symbol = symbol; - if (symbolKind & ts.SymbolFlags.Value && !symbol.valueDeclaration) - symbol.valueDeclaration = node; - } - function getDeclarationName(node) { - if (node.name) { - if (node.kind === 177 /* ModuleDeclaration */ && node.name.kind === 7 /* StringLiteral */) { - return '"' + node.name.text + '"'; - } - return node.name.text; - } - switch (node.kind) { - case 121 /* Constructor */: - return "__constructor"; - case 124 /* CallSignature */: - return "__call"; - case 125 /* ConstructSignature */: - return "__new"; - case 126 /* IndexSignature */: - return "__index"; - } - } - function getDisplayName(node) { - return node.name ? ts.identifierToString(node.name) : getDeclarationName(node); - } - function declareSymbol(symbols, parent, node, includes, excludes) { - var name = getDeclarationName(node); - if (name !== undefined) { - var symbol = ts.hasProperty(symbols, name) ? symbols[name] : (symbols[name] = createSymbol(0, name)); - if (symbol.flags & excludes) { - if (node.name) { - node.name.parent = node; - } - ts.forEach(symbol.declarations, function (declaration) { - file.semanticErrors.push(ts.createDiagnosticForNode(declaration.name, ts.Diagnostics.Duplicate_identifier_0, getDisplayName(declaration))); - }); - file.semanticErrors.push(ts.createDiagnosticForNode(node.name, ts.Diagnostics.Duplicate_identifier_0, getDisplayName(node))); - symbol = createSymbol(0, name); - } - } - else { - symbol = createSymbol(0, "__missing"); - } - addDeclarationToSymbol(symbol, node, includes); - symbol.parent = parent; - if (node.kind === 174 /* ClassDeclaration */ && symbol.exports) { - var prototypeSymbol = createSymbol(2 /* Property */ | 67108864 /* Prototype */, "prototype"); - if (ts.hasProperty(symbol.exports, prototypeSymbol.name)) { - if (node.name) { - node.name.parent = node; - } - file.semanticErrors.push(ts.createDiagnosticForNode(symbol.exports[prototypeSymbol.name].declarations[0], ts.Diagnostics.Duplicate_identifier_0, prototypeSymbol.name)); - } - symbol.exports[prototypeSymbol.name] = prototypeSymbol; - prototypeSymbol.parent = symbol; - } - return symbol; - } - function isAmbientContext(node) { - while (node) { - if (node.flags & 2 /* Ambient */) - return true; - node = node.parent; - } - return false; - } - function declareModuleMember(node, symbolKind, symbolExcludes) { - var exportKind = 0; - if (symbolKind & ts.SymbolFlags.Value) { - exportKind |= 524288 /* ExportValue */; - } - if (symbolKind & ts.SymbolFlags.Type) { - exportKind |= 1048576 /* ExportType */; - } - if (symbolKind & ts.SymbolFlags.Namespace) { - exportKind |= 2097152 /* ExportNamespace */; - } - if (node.flags & 1 /* Export */ || (node.kind !== 179 /* ImportDeclaration */ && isAmbientContext(container))) { - if (exportKind) { - var local = declareSymbol(container.locals, undefined, node, exportKind, symbolExcludes); - local.exportSymbol = declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); - node.localSymbol = local; - } - else { - declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); - } - } - else { - declareSymbol(container.locals, undefined, node, symbolKind, symbolExcludes); - } - } - function bindChildren(node, symbolKind) { - if (symbolKind & ts.SymbolFlags.HasLocals) { - node.locals = {}; - } - var saveParent = parent; - var saveContainer = container; - parent = node; - if (symbolKind & ts.SymbolFlags.IsContainer) { - container = node; - if (lastContainer !== container && !container.nextContainer) { - if (lastContainer) { - lastContainer.nextContainer = container; - } - lastContainer = container; - } - } - ts.forEachChild(node, bind); - container = saveContainer; - parent = saveParent; - } - function bindDeclaration(node, symbolKind, symbolExcludes) { - switch (container.kind) { - case 177 /* ModuleDeclaration */: - declareModuleMember(node, symbolKind, symbolExcludes); - break; - case 182 /* SourceFile */: - if (ts.isExternalModule(container)) { - declareModuleMember(node, symbolKind, symbolExcludes); - break; - } - case 124 /* CallSignature */: - case 125 /* ConstructSignature */: - case 126 /* IndexSignature */: - case 120 /* Method */: - case 121 /* Constructor */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 172 /* FunctionDeclaration */: - case 141 /* FunctionExpression */: - case 142 /* ArrowFunction */: - declareSymbol(container.locals, undefined, node, symbolKind, symbolExcludes); - break; - case 174 /* ClassDeclaration */: - if (node.flags & 128 /* Static */) { - declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); - break; - } - case 129 /* TypeLiteral */: - case 133 /* ObjectLiteral */: - case 175 /* InterfaceDeclaration */: - declareSymbol(container.symbol.members, container.symbol, node, symbolKind, symbolExcludes); - break; - case 176 /* EnumDeclaration */: - declareSymbol(container.symbol.exports, container.symbol, node, symbolKind, symbolExcludes); - break; - } - bindChildren(node, symbolKind); - } - function bindConstructorDeclaration(node) { - bindDeclaration(node, 4096 /* Constructor */, 0); - ts.forEach(node.parameters, function (p) { - if (p.flags & (16 /* Public */ | 32 /* Private */ | 64 /* Protected */)) { - bindDeclaration(p, 2 /* Property */, ts.SymbolFlags.PropertyExcludes); - } - }); - } - function bindModuleDeclaration(node) { - if (node.name.kind === 7 /* StringLiteral */) { - bindDeclaration(node, 128 /* ValueModule */, ts.SymbolFlags.ValueModuleExcludes); - } - else if (isInstantiated(node)) { - bindDeclaration(node, 128 /* ValueModule */, ts.SymbolFlags.ValueModuleExcludes); - } - else { - bindDeclaration(node, 256 /* NamespaceModule */, 0 /* NamespaceModuleExcludes */); - } - } - function bindAnonymousDeclaration(node, symbolKind, name) { - var symbol = createSymbol(symbolKind, name); - addDeclarationToSymbol(symbol, node, symbolKind); - bindChildren(node, symbolKind); - } - function bindCatchVariableDeclaration(node) { - var symbol = createSymbol(1 /* Variable */, node.variable.text || "__missing"); - addDeclarationToSymbol(symbol, node, 1 /* Variable */); - var saveParent = parent; - parent = node; - ts.forEachChild(node, bind); - parent = saveParent; - } - function bind(node) { - node.parent = parent; - switch (node.kind) { - case 117 /* TypeParameter */: - bindDeclaration(node, 262144 /* TypeParameter */, ts.SymbolFlags.TypeParameterExcludes); - break; - case 118 /* Parameter */: - bindDeclaration(node, 1 /* Variable */, ts.SymbolFlags.ParameterExcludes); - break; - case 171 /* VariableDeclaration */: - bindDeclaration(node, 1 /* Variable */, ts.SymbolFlags.VariableExcludes); - break; - case 119 /* Property */: - case 134 /* PropertyAssignment */: - bindDeclaration(node, 2 /* Property */, ts.SymbolFlags.PropertyExcludes); - break; - case 181 /* EnumMember */: - bindDeclaration(node, 4 /* EnumMember */, ts.SymbolFlags.EnumMemberExcludes); - break; - case 124 /* CallSignature */: - bindDeclaration(node, 32768 /* CallSignature */, 0); - break; - case 120 /* Method */: - bindDeclaration(node, 2048 /* Method */, ts.SymbolFlags.MethodExcludes); - break; - case 125 /* ConstructSignature */: - bindDeclaration(node, 65536 /* ConstructSignature */, 0); - break; - case 126 /* IndexSignature */: - bindDeclaration(node, 131072 /* IndexSignature */, 0); - break; - case 172 /* FunctionDeclaration */: - bindDeclaration(node, 8 /* Function */, ts.SymbolFlags.FunctionExcludes); - break; - case 121 /* Constructor */: - bindConstructorDeclaration(node); - break; - case 122 /* GetAccessor */: - bindDeclaration(node, 8192 /* GetAccessor */, ts.SymbolFlags.GetAccessorExcludes); - break; - case 123 /* SetAccessor */: - bindDeclaration(node, 16384 /* SetAccessor */, ts.SymbolFlags.SetAccessorExcludes); - break; - case 129 /* TypeLiteral */: - bindAnonymousDeclaration(node, 512 /* TypeLiteral */, "__type"); - break; - case 133 /* ObjectLiteral */: - bindAnonymousDeclaration(node, 1024 /* ObjectLiteral */, "__object"); - break; - case 141 /* FunctionExpression */: - case 142 /* ArrowFunction */: - bindAnonymousDeclaration(node, 8 /* Function */, "__function"); - break; - case 168 /* CatchBlock */: - bindCatchVariableDeclaration(node); - break; - case 174 /* ClassDeclaration */: - bindDeclaration(node, 16 /* Class */, ts.SymbolFlags.ClassExcludes); - break; - case 175 /* InterfaceDeclaration */: - bindDeclaration(node, 32 /* Interface */, ts.SymbolFlags.InterfaceExcludes); - break; - case 176 /* EnumDeclaration */: - bindDeclaration(node, 64 /* Enum */, ts.SymbolFlags.EnumExcludes); - break; - case 177 /* ModuleDeclaration */: - bindModuleDeclaration(node); - break; - case 179 /* ImportDeclaration */: - bindDeclaration(node, 4194304 /* Import */, ts.SymbolFlags.ImportExcludes); - break; - case 182 /* SourceFile */: - if (ts.isExternalModule(node)) { - bindAnonymousDeclaration(node, 128 /* ValueModule */, '"' + ts.removeFileExtension(node.filename) + '"'); - break; - } - default: - var saveParent = parent; - parent = node; - ts.forEachChild(node, bind); - parent = saveParent; - } - } - } - ts.bindSourceFile = bindSourceFile; -})(ts || (ts = {})); -var ts; -(function (ts) { - var indentStrings = ["", " "]; - function getIndentString(level) { - if (indentStrings[level] === undefined) { - indentStrings[level] = getIndentString(level - 1) + indentStrings[1]; - } - return indentStrings[level]; - } - ts.getIndentString = getIndentString; - function getIndentSize() { - return indentStrings[1].length; - } - function shouldEmitToOwnFile(sourceFile, compilerOptions) { - if (!ts.isDeclarationFile(sourceFile)) { - if ((ts.isExternalModule(sourceFile) || !compilerOptions.out) && !ts.fileExtensionIs(sourceFile.filename, ".js")) { - return true; - } - return false; - } - return false; - } - ts.shouldEmitToOwnFile = shouldEmitToOwnFile; - function isExternalModuleOrDeclarationFile(sourceFile) { - return ts.isExternalModule(sourceFile) || ts.isDeclarationFile(sourceFile); - } - ts.isExternalModuleOrDeclarationFile = isExternalModuleOrDeclarationFile; - function createTextWriter(newLine, trackSymbol) { - var output = ""; - var indent = 0; - var lineStart = true; - var lineCount = 0; - var linePos = 0; - function write(s) { - if (s && s.length) { - if (lineStart) { - output += getIndentString(indent); - lineStart = false; - } - output += s; - } - } - function rawWrite(s) { - if (s !== undefined) { - if (lineStart) { - lineStart = false; - } - output += s; - } - } - function writeLiteral(s) { - if (s && s.length) { - write(s); - var lineStartsOfS = ts.getLineStarts(s); - if (lineStartsOfS.length > 1) { - lineCount = lineCount + lineStartsOfS.length - 1; - linePos = output.length - s.length + lineStartsOfS[lineStartsOfS.length - 1]; - } - } - } - function writeLine() { - if (!lineStart) { - output += newLine; - lineCount++; - linePos = output.length; - lineStart = true; - } - } - function writeKind(text, kind) { - write(text); - } - function writeSymbol(text, symbol) { - write(text); - } - return { - write: write, - trackSymbol: trackSymbol, - writeKind: writeKind, - writeSymbol: writeSymbol, - rawWrite: rawWrite, - writeLiteral: writeLiteral, - writeLine: writeLine, - increaseIndent: function () { return indent++; }, - decreaseIndent: function () { return indent--; }, - getIndent: function () { return indent; }, - getTextPos: function () { return output.length; }, - getLine: function () { return lineCount + 1; }, - getColumn: function () { return lineStart ? indent * getIndentSize() + 1 : output.length - linePos + 1; }, - getText: function () { return output; }, - clear: function () { - } - }; - } - function getSourceTextOfLocalNode(currentSourceFile, node) { - var text = currentSourceFile.text; - return text.substring(ts.skipTrivia(text, node.pos), node.end); - } - function getLineOfLocalPosition(currentSourceFile, pos) { - return currentSourceFile.getLineAndCharacterFromPosition(pos).line; - } - function emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments) { - if (leadingComments && leadingComments.length && node.pos !== leadingComments[0].pos && getLineOfLocalPosition(currentSourceFile, node.pos) !== getLineOfLocalPosition(currentSourceFile, leadingComments[0].pos)) { - writer.writeLine(); - } - } - function emitComments(currentSourceFile, writer, comments, trailingSeparator, newLine, writeComment) { - var emitLeadingSpace = !trailingSeparator; - ts.forEach(comments, function (comment) { - if (emitLeadingSpace) { - writer.write(" "); - emitLeadingSpace = false; - } - writeComment(currentSourceFile, writer, comment, newLine); - if (comment.hasTrailingNewLine) { - writer.writeLine(); - } - else if (trailingSeparator) { - writer.write(" "); - } - else { - emitLeadingSpace = true; - } - }); - } - function writeCommentRange(currentSourceFile, writer, comment, newLine) { - if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 42 /* asterisk */) { - var firstCommentLineAndCharacter = currentSourceFile.getLineAndCharacterFromPosition(comment.pos); - var firstCommentLineIndent; - for (var pos = comment.pos, currentLine = firstCommentLineAndCharacter.line; pos < comment.end; currentLine++) { - var nextLineStart = currentSourceFile.getPositionFromLineAndCharacter(currentLine + 1, 1); - if (pos !== comment.pos) { - if (firstCommentLineIndent === undefined) { - firstCommentLineIndent = calculateIndent(currentSourceFile.getPositionFromLineAndCharacter(firstCommentLineAndCharacter.line, 1), comment.pos); - } - var currentWriterIndentSpacing = writer.getIndent() * getIndentSize(); - var spacesToEmit = currentWriterIndentSpacing - firstCommentLineIndent + calculateIndent(pos, nextLineStart); - if (spacesToEmit > 0) { - var numberOfSingleSpacesToEmit = spacesToEmit % getIndentSize(); - var indentSizeSpaceString = getIndentString((spacesToEmit - numberOfSingleSpacesToEmit) / getIndentSize()); - writer.rawWrite(indentSizeSpaceString); - while (numberOfSingleSpacesToEmit) { - writer.rawWrite(" "); - numberOfSingleSpacesToEmit--; - } - } - else { - writer.rawWrite(""); - } - } - writeTrimmedCurrentLine(pos, nextLineStart); - pos = nextLineStart; - } - } - else { - writer.write(currentSourceFile.text.substring(comment.pos, comment.end)); - } - function writeTrimmedCurrentLine(pos, nextLineStart) { - var end = Math.min(comment.end, nextLineStart - 1); - var currentLineText = currentSourceFile.text.substring(pos, end).replace(/^\s+|\s+$/g, ''); - if (currentLineText) { - writer.write(currentLineText); - if (end !== comment.end) { - writer.writeLine(); - } - } - else { - writer.writeLiteral(newLine); - } - } - function calculateIndent(pos, end) { - var currentLineIndent = 0; - for (; pos < end && ts.isWhiteSpace(currentSourceFile.text.charCodeAt(pos)); pos++) { - if (currentSourceFile.text.charCodeAt(pos) === 9 /* tab */) { - currentLineIndent += getIndentSize() - (currentLineIndent % getIndentSize()); - } - else { - currentLineIndent++; - } - } - return currentLineIndent; - } - } - function getFirstConstructorWithBody(node) { - return ts.forEach(node.members, function (member) { - if (member.kind === 121 /* Constructor */ && member.body) { - return member; - } - }); - } - function getAllAccessorDeclarations(node, accessor) { - var firstAccessor; - var getAccessor; - var setAccessor; - ts.forEach(node.members, function (member) { - if ((member.kind === 122 /* GetAccessor */ || member.kind === 123 /* SetAccessor */) && member.name.text === accessor.name.text && (member.flags & 128 /* Static */) === (accessor.flags & 128 /* Static */)) { - if (!firstAccessor) { - firstAccessor = member; - } - if (member.kind === 122 /* GetAccessor */ && !getAccessor) { - getAccessor = member; - } - if (member.kind === 123 /* SetAccessor */ && !setAccessor) { - setAccessor = member; - } - } - }); - return { - firstAccessor: firstAccessor, - getAccessor: getAccessor, - setAccessor: setAccessor - }; - } - function getSourceFilePathInNewDir(sourceFile, program, newDirPath) { - var compilerHost = program.getCompilerHost(); - var sourceFilePath = ts.getNormalizedPathFromPathComponents(ts.getNormalizedPathComponents(sourceFile.filename, compilerHost.getCurrentDirectory())); - sourceFilePath = sourceFilePath.replace(program.getCommonSourceDirectory(), ""); - return ts.combinePaths(newDirPath, sourceFilePath); - } - function getOwnEmitOutputFilePath(sourceFile, program, extension) { - var compilerOptions = program.getCompilerOptions(); - if (compilerOptions.outDir) { - var emitOutputFilePathWithoutExtension = ts.removeFileExtension(getSourceFilePathInNewDir(sourceFile, program, compilerOptions.outDir)); - } - else { - var emitOutputFilePathWithoutExtension = ts.removeFileExtension(sourceFile.filename); - } - return emitOutputFilePathWithoutExtension + extension; - } - function writeFile(compilerHost, diagnostics, filename, data, writeByteOrderMark) { - compilerHost.writeFile(filename, data, writeByteOrderMark, function (hostErrorMessage) { - diagnostics.push(ts.createCompilerDiagnostic(ts.Diagnostics.Could_not_write_file_0_Colon_1, filename, hostErrorMessage)); - }); - } - function emitDeclarations(program, resolver, diagnostics, jsFilePath, root) { - var newLine = program.getCompilerHost().getNewLine(); - var compilerOptions = program.getCompilerOptions(); - var compilerHost = program.getCompilerHost(); - var writer = createTextWriter(newLine, trackSymbol); - var write = writer.write; - var writeLine = writer.writeLine; - var increaseIndent = writer.increaseIndent; - var decreaseIndent = writer.decreaseIndent; - var enclosingDeclaration; - var currentSourceFile; - var reportedDeclarationError = false; - var emitJsDocComments = compilerOptions.removeComments ? function (declaration) { - } : writeJsDocComments; - var aliasDeclarationEmitInfo = []; - var getSymbolVisibilityDiagnosticMessage; - function writeAsychronousImportDeclarations(importDeclarations) { - var oldWriter = writer; - ts.forEach(importDeclarations, function (aliasToWrite) { - var aliasEmitInfo = ts.forEach(aliasDeclarationEmitInfo, function (declEmitInfo) { return declEmitInfo.declaration === aliasToWrite ? declEmitInfo : undefined; }); - if (aliasEmitInfo) { - writer = createTextWriter(newLine, trackSymbol); - for (var declarationIndent = aliasEmitInfo.indent; declarationIndent; declarationIndent--) { - writer.increaseIndent(); - } - writeImportDeclaration(aliasToWrite); - aliasEmitInfo.asynchronousOutput = writer.getText(); - } - }); - writer = oldWriter; - } - function trackSymbol(symbol, enclosingDeclaration, meaning) { - var symbolAccesibilityResult = resolver.isSymbolAccessible(symbol, enclosingDeclaration, meaning); - if (symbolAccesibilityResult.accessibility === 0 /* Accessible */) { - if (symbolAccesibilityResult && symbolAccesibilityResult.aliasesToMakeVisible) { - writeAsychronousImportDeclarations(symbolAccesibilityResult.aliasesToMakeVisible); - } - } - else { - reportedDeclarationError = true; - var errorInfo = getSymbolVisibilityDiagnosticMessage(symbolAccesibilityResult); - if (errorInfo) { - if (errorInfo.typeName) { - diagnostics.push(ts.createDiagnosticForNode(errorInfo.errorNode, errorInfo.diagnosticMessage, getSourceTextOfLocalNode(currentSourceFile, errorInfo.typeName), symbolAccesibilityResult.errorSymbolName, symbolAccesibilityResult.errorModuleName)); - } - else { - diagnostics.push(ts.createDiagnosticForNode(errorInfo.errorNode, errorInfo.diagnosticMessage, symbolAccesibilityResult.errorSymbolName, symbolAccesibilityResult.errorModuleName)); - } - } - } - } - function emitLines(nodes) { - for (var i = 0, n = nodes.length; i < n; i++) { - emitNode(nodes[i]); - } - } - function emitCommaList(nodes, eachNodeEmitFn) { - var currentWriterPos = writer.getTextPos(); - for (var i = 0, n = nodes.length; i < n; i++) { - if (currentWriterPos !== writer.getTextPos()) { - write(", "); - } - currentWriterPos = writer.getTextPos(); - eachNodeEmitFn(nodes[i]); - } - } - function writeJsDocComments(declaration) { - if (declaration) { - var jsDocComments = ts.getJsDocComments(declaration, currentSourceFile); - emitNewLineBeforeLeadingComments(currentSourceFile, writer, declaration, jsDocComments); - emitComments(currentSourceFile, writer, jsDocComments, true, newLine, writeCommentRange); - } - } - function emitSourceTextOfNode(node) { - write(getSourceTextOfLocalNode(currentSourceFile, node)); - } - function emitSourceFile(node) { - currentSourceFile = node; - enclosingDeclaration = node; - emitLines(node.statements); - } - function emitExportAssignment(node) { - write("export = "); - emitSourceTextOfNode(node.exportName); - write(";"); - writeLine(); - } - function emitDeclarationFlags(node) { - if (node.flags & 128 /* Static */) { - if (node.flags & 32 /* Private */) { - write("private "); - } - else if (node.flags & 64 /* Protected */) { - write("protected "); - } - write("static "); - } - else { - if (node.flags & 32 /* Private */) { - write("private "); - } - else if (node.flags & 64 /* Protected */) { - write("protected "); - } - else if (node.parent === currentSourceFile) { - if (node.flags & 1 /* Export */) { - write("export "); - } - if (node.kind !== 175 /* InterfaceDeclaration */) { - write("declare "); - } - } - } - } - function emitImportDeclaration(node) { - var nodeEmitInfo = { - declaration: node, - outputPos: writer.getTextPos(), - indent: writer.getIndent(), - hasWritten: resolver.isDeclarationVisible(node) - }; - aliasDeclarationEmitInfo.push(nodeEmitInfo); - if (nodeEmitInfo.hasWritten) { - writeImportDeclaration(node); - } - } - function writeImportDeclaration(node) { - emitJsDocComments(node); - if (node.flags & 1 /* Export */) { - writer.write("export "); - } - writer.write("import "); - writer.write(getSourceTextOfLocalNode(currentSourceFile, node.name)); - writer.write(" = "); - if (node.entityName) { - checkEntityNameAccessible(); - writer.write(getSourceTextOfLocalNode(currentSourceFile, node.entityName)); - writer.write(";"); - } - else { - writer.write("require("); - writer.write(getSourceTextOfLocalNode(currentSourceFile, node.externalModuleName)); - writer.write(");"); - } - writer.writeLine(); - function checkEntityNameAccessible() { - var symbolAccesibilityResult = resolver.isImportDeclarationEntityNameReferenceDeclarationVisible(node.entityName); - if (symbolAccesibilityResult.accessibility === 0 /* Accessible */) { - if (symbolAccesibilityResult.aliasesToMakeVisible) { - writeAsychronousImportDeclarations(symbolAccesibilityResult.aliasesToMakeVisible); - } - } - else { - reportedDeclarationError = true; - diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.Import_declaration_0_is_using_private_name_1, getSourceTextOfLocalNode(currentSourceFile, node.name), symbolAccesibilityResult.errorSymbolName)); - } - } - } - function emitModuleDeclaration(node) { - if (resolver.isDeclarationVisible(node)) { - emitJsDocComments(node); - emitDeclarationFlags(node); - write("module "); - emitSourceTextOfNode(node.name); - while (node.body.kind !== 178 /* ModuleBlock */) { - node = node.body; - write("."); - emitSourceTextOfNode(node.name); - } - var prevEnclosingDeclaration = enclosingDeclaration; - enclosingDeclaration = node; - write(" {"); - writeLine(); - increaseIndent(); - emitLines(node.body.statements); - decreaseIndent(); - write("}"); - writeLine(); - enclosingDeclaration = prevEnclosingDeclaration; - } - } - function emitEnumDeclaration(node) { - if (resolver.isDeclarationVisible(node)) { - emitJsDocComments(node); - emitDeclarationFlags(node); - write("enum "); - emitSourceTextOfNode(node.name); - write(" {"); - writeLine(); - increaseIndent(); - emitLines(node.members); - decreaseIndent(); - write("}"); - writeLine(); - } - } - function emitEnumMemberDeclaration(node) { - emitJsDocComments(node); - emitSourceTextOfNode(node.name); - var enumMemberValue = resolver.getEnumMemberValue(node); - if (enumMemberValue !== undefined) { - write(" = "); - write(enumMemberValue.toString()); - } - write(","); - writeLine(); - } - function emitTypeParameters(typeParameters) { - function emitTypeParameter(node) { - function getTypeParameterConstraintVisibilityError(symbolAccesibilityResult) { - var diagnosticMessage; - switch (node.parent.kind) { - case 174 /* ClassDeclaration */: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; - break; - case 175 /* InterfaceDeclaration */: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; - break; - case 125 /* ConstructSignature */: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; - break; - case 124 /* CallSignature */: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; - break; - case 120 /* Method */: - if (node.parent.flags & 128 /* Static */) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; - } - else if (node.parent.parent.kind === 174 /* ClassDeclaration */) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; - } - else { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; - } - break; - case 172 /* FunctionDeclaration */: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; - break; - default: - ts.Debug.fail("This is unknown parent for type parameter: " + ts.SyntaxKind[node.parent.kind]); - } - return { - diagnosticMessage: diagnosticMessage, - errorNode: node, - typeName: node.name - }; - } - increaseIndent(); - emitJsDocComments(node); - decreaseIndent(); - emitSourceTextOfNode(node.name); - if (node.constraint && (node.parent.kind !== 120 /* Method */ || !(node.parent.flags & 32 /* Private */))) { - write(" extends "); - getSymbolVisibilityDiagnosticMessage = getTypeParameterConstraintVisibilityError; - resolver.writeTypeAtLocation(node.constraint, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); - } - } - if (typeParameters) { - write("<"); - emitCommaList(typeParameters, emitTypeParameter); - write(">"); - } - } - function emitHeritageClause(typeReferences, isImplementsList) { - if (typeReferences) { - write(isImplementsList ? " implements " : " extends "); - emitCommaList(typeReferences, emitTypeOfTypeReference); - } - function emitTypeOfTypeReference(node) { - getSymbolVisibilityDiagnosticMessage = getHeritageClauseVisibilityError; - resolver.writeTypeAtLocation(node, enclosingDeclaration, 1 /* WriteArrayAsGenericType */ | 2 /* UseTypeOfFunction */, writer); - function getHeritageClauseVisibilityError(symbolAccesibilityResult) { - var diagnosticMessage; - if (node.parent.kind === 174 /* ClassDeclaration */) { - if (symbolAccesibilityResult.errorModuleName) { - diagnosticMessage = isImplementsList ? ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Extends_clause_of_exported_class_0_has_or_is_using_name_1_from_private_module_2; - } - else { - diagnosticMessage = isImplementsList ? ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : ts.Diagnostics.Extends_clause_of_exported_class_0_has_or_is_using_private_name_1; - } - } - else { - if (symbolAccesibilityResult.errorModuleName) { - diagnosticMessage = ts.Diagnostics.Extends_clause_of_exported_interface_0_has_or_is_using_name_1_from_private_module_2; - } - else { - diagnosticMessage = ts.Diagnostics.Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1; - } - } - return { - diagnosticMessage: diagnosticMessage, - errorNode: node, - typeName: node.parent.name - }; - } - } - } - function emitClassDeclaration(node) { - function emitParameterProperties(constructorDeclaration) { - if (constructorDeclaration) { - ts.forEach(constructorDeclaration.parameters, function (param) { - if (param.flags & ts.NodeFlags.AccessibilityModifier) { - emitPropertyDeclaration(param); - } - }); - } - } - if (resolver.isDeclarationVisible(node)) { - emitJsDocComments(node); - emitDeclarationFlags(node); - write("class "); - emitSourceTextOfNode(node.name); - var prevEnclosingDeclaration = enclosingDeclaration; - enclosingDeclaration = node; - emitTypeParameters(node.typeParameters); - if (node.baseType) { - emitHeritageClause([node.baseType], false); - } - emitHeritageClause(node.implementedTypes, true); - write(" {"); - writeLine(); - increaseIndent(); - emitParameterProperties(getFirstConstructorWithBody(node)); - emitLines(node.members); - decreaseIndent(); - write("}"); - writeLine(); - enclosingDeclaration = prevEnclosingDeclaration; - } - } - function emitInterfaceDeclaration(node) { - if (resolver.isDeclarationVisible(node)) { - emitJsDocComments(node); - emitDeclarationFlags(node); - write("interface "); - emitSourceTextOfNode(node.name); - var prevEnclosingDeclaration = enclosingDeclaration; - enclosingDeclaration = node; - emitTypeParameters(node.typeParameters); - emitHeritageClause(node.baseTypes, false); - write(" {"); - writeLine(); - increaseIndent(); - emitLines(node.members); - decreaseIndent(); - write("}"); - writeLine(); - enclosingDeclaration = prevEnclosingDeclaration; - } - } - function emitPropertyDeclaration(node) { - emitJsDocComments(node); - emitDeclarationFlags(node); - emitVariableDeclaration(node); - write(";"); - writeLine(); - } - function emitVariableDeclaration(node) { - if (node.kind !== 171 /* VariableDeclaration */ || resolver.isDeclarationVisible(node)) { - emitSourceTextOfNode(node.name); - if (node.kind === 119 /* Property */ && (node.flags & 4 /* QuestionMark */)) { - write("?"); - } - if (!(node.flags & 32 /* Private */)) { - write(": "); - getSymbolVisibilityDiagnosticMessage = getVariableDeclarationTypeVisibilityError; - resolver.writeTypeAtLocation(node, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); - } - } - function getVariableDeclarationTypeVisibilityError(symbolAccesibilityResult) { - var diagnosticMessage; - if (node.kind === 171 /* VariableDeclaration */) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Exported_variable_0_has_or_is_using_private_name_1; - } - else if (node.kind === 119 /* Property */) { - if (node.flags & 128 /* Static */) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; - } - else if (node.parent.kind === 174 /* ClassDeclaration */) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1; - } - else { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Property_0_of_exported_interface_has_or_is_using_private_name_1; - } - } - return diagnosticMessage !== undefined ? { - diagnosticMessage: diagnosticMessage, - errorNode: node, - typeName: node.name - } : undefined; - } - } - function emitVariableStatement(node) { - var hasDeclarationWithEmit = ts.forEach(node.declarations, function (varDeclaration) { return resolver.isDeclarationVisible(varDeclaration); }); - if (hasDeclarationWithEmit) { - emitJsDocComments(node); - emitDeclarationFlags(node); - write("var "); - emitCommaList(node.declarations, emitVariableDeclaration); - write(";"); - writeLine(); - } - } - function emitAccessorDeclaration(node) { - var accessors = getAllAccessorDeclarations(node.parent, node); - if (node === accessors.firstAccessor) { - emitJsDocComments(accessors.getAccessor); - emitJsDocComments(accessors.setAccessor); - emitDeclarationFlags(node); - emitSourceTextOfNode(node.name); - if (!(node.flags & 32 /* Private */)) { - write(": "); - getSymbolVisibilityDiagnosticMessage = getAccessorDeclarationTypeVisibilityError; - resolver.writeTypeAtLocation(node, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); - } - write(";"); - writeLine(); - } - function getAccessorDeclarationTypeVisibilityError(symbolAccesibilityResult) { - var diagnosticMessage; - if (node.kind === 123 /* SetAccessor */) { - if (node.parent.flags & 128 /* Static */) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1; - } - else { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_name_1; - } - return { - diagnosticMessage: diagnosticMessage, - errorNode: node.parameters[0], - typeName: node.name - }; - } - else { - if (node.flags & 128 /* Static */) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts.Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_name_0; - } - else { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts.Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_name_0; - } - return { - diagnosticMessage: diagnosticMessage, - errorNode: node.name, - typeName: undefined - }; - } - } - } - function emitFunctionDeclaration(node) { - if ((node.kind !== 172 /* FunctionDeclaration */ || resolver.isDeclarationVisible(node)) && !resolver.isImplementationOfOverload(node)) { - emitJsDocComments(node); - emitDeclarationFlags(node); - if (node.kind === 172 /* FunctionDeclaration */) { - write("function "); - emitSourceTextOfNode(node.name); - } - else if (node.kind === 121 /* Constructor */) { - write("constructor"); - } - else { - emitSourceTextOfNode(node.name); - if (node.flags & 4 /* QuestionMark */) { - write("?"); - } - } - emitSignatureDeclaration(node); - } - } - function emitConstructSignatureDeclaration(node) { - emitJsDocComments(node); - write("new "); - emitSignatureDeclaration(node); - } - function emitSignatureDeclaration(node) { - if (node.kind === 124 /* CallSignature */ || node.kind === 126 /* IndexSignature */) { - emitJsDocComments(node); - } - emitTypeParameters(node.typeParameters); - if (node.kind === 126 /* IndexSignature */) { - write("["); - } - else { - write("("); - } - emitCommaList(node.parameters, emitParameterDeclaration); - if (node.kind === 126 /* IndexSignature */) { - write("]"); - } - else { - write(")"); - } - if (node.kind !== 121 /* Constructor */ && !(node.flags & 32 /* Private */)) { - write(": "); - getSymbolVisibilityDiagnosticMessage = getReturnTypeVisibilityError; - resolver.writeReturnTypeOfSignatureDeclaration(node, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); - } - write(";"); - writeLine(); - function getReturnTypeVisibilityError(symbolAccesibilityResult) { - var diagnosticMessage; - switch (node.kind) { - case 125 /* ConstructSignature */: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0; - break; - case 124 /* CallSignature */: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0; - break; - case 126 /* IndexSignature */: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0; - break; - case 120 /* Method */: - if (node.flags & 128 /* Static */) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0; - } - else if (node.parent.kind === 174 /* ClassDeclaration */) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0; - } - else { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; - } - break; - case 172 /* FunctionDeclaration */: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_private_name_0; - break; - default: - ts.Debug.fail("This is unknown kind for signature: " + ts.SyntaxKind[node.kind]); - } - return { - diagnosticMessage: diagnosticMessage, - errorNode: node.name || node - }; - } - } - function emitParameterDeclaration(node) { - increaseIndent(); - emitJsDocComments(node); - if (node.flags & 8 /* Rest */) { - write("..."); - } - emitSourceTextOfNode(node.name); - if (node.initializer || (node.flags & 4 /* QuestionMark */)) { - write("?"); - } - decreaseIndent(); - if (!(node.parent.flags & 32 /* Private */)) { - write(": "); - getSymbolVisibilityDiagnosticMessage = getParameterDeclarationTypeVisibilityError; - resolver.writeTypeAtLocation(node, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); - } - function getParameterDeclarationTypeVisibilityError(symbolAccesibilityResult) { - var diagnosticMessage; - switch (node.parent.kind) { - case 121 /* Constructor */: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1; - break; - case 125 /* ConstructSignature */: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; - break; - case 124 /* CallSignature */: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; - break; - case 120 /* Method */: - if (node.parent.flags & 128 /* Static */) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; - } - else if (node.parent.parent.kind === 174 /* ClassDeclaration */) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; - } - else { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; - } - break; - case 172 /* FunctionDeclaration */: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1; - break; - default: - ts.Debug.fail("This is unknown parent for parameter: " + ts.SyntaxKind[node.parent.kind]); - } - return { - diagnosticMessage: diagnosticMessage, - errorNode: node, - typeName: node.name - }; - } - } - function emitNode(node) { - switch (node.kind) { - case 121 /* Constructor */: - case 172 /* FunctionDeclaration */: - case 120 /* Method */: - return emitFunctionDeclaration(node); - case 125 /* ConstructSignature */: - return emitConstructSignatureDeclaration(node); - case 124 /* CallSignature */: - case 126 /* IndexSignature */: - return emitSignatureDeclaration(node); - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - return emitAccessorDeclaration(node); - case 149 /* VariableStatement */: - return emitVariableStatement(node); - case 119 /* Property */: - return emitPropertyDeclaration(node); - case 175 /* InterfaceDeclaration */: - return emitInterfaceDeclaration(node); - case 174 /* ClassDeclaration */: - return emitClassDeclaration(node); - case 181 /* EnumMember */: - return emitEnumMemberDeclaration(node); - case 176 /* EnumDeclaration */: - return emitEnumDeclaration(node); - case 177 /* ModuleDeclaration */: - return emitModuleDeclaration(node); - case 179 /* ImportDeclaration */: - return emitImportDeclaration(node); - case 180 /* ExportAssignment */: - return emitExportAssignment(node); - case 182 /* SourceFile */: - return emitSourceFile(node); - } - } - function tryResolveScriptReference(sourceFile, reference) { - var referenceFileName = ts.normalizePath(ts.combinePaths(ts.getDirectoryPath(sourceFile.filename), reference.filename)); - return program.getSourceFile(referenceFileName); - } - var referencePathsOutput = ""; - function writeReferencePath(referencedFile) { - var declFileName = referencedFile.flags & 1024 /* DeclarationFile */ ? referencedFile.filename : shouldEmitToOwnFile(referencedFile, compilerOptions) ? getOwnEmitOutputFilePath(referencedFile, program, ".d.ts") : ts.removeFileExtension(compilerOptions.out) + ".d.ts"; - declFileName = ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizeSlashes(jsFilePath)), declFileName, compilerHost.getCurrentDirectory(), compilerHost.getCanonicalFileName, false); - referencePathsOutput += "/// " + newLine; - } - if (root) { - if (!compilerOptions.noResolve) { - var addedGlobalFileReference = false; - ts.forEach(root.referencedFiles, function (fileReference) { - var referencedFile = tryResolveScriptReference(root, fileReference); - if (referencedFile && ((referencedFile.flags & 1024 /* DeclarationFile */) || shouldEmitToOwnFile(referencedFile, compilerOptions) || !addedGlobalFileReference)) { - writeReferencePath(referencedFile); - if (!isExternalModuleOrDeclarationFile(referencedFile)) { - addedGlobalFileReference = true; - } - } - }); - } - emitNode(root); - } - else { - var emittedReferencedFiles = []; - ts.forEach(program.getSourceFiles(), function (sourceFile) { - if (!isExternalModuleOrDeclarationFile(sourceFile)) { - if (!compilerOptions.noResolve) { - ts.forEach(sourceFile.referencedFiles, function (fileReference) { - var referencedFile = tryResolveScriptReference(sourceFile, fileReference); - if (referencedFile && (isExternalModuleOrDeclarationFile(referencedFile) && !ts.contains(emittedReferencedFiles, referencedFile))) { - writeReferencePath(referencedFile); - emittedReferencedFiles.push(referencedFile); - } - }); - } - emitNode(sourceFile); - } - }); - } - return { - reportedDeclarationError: reportedDeclarationError, - aliasDeclarationEmitInfo: aliasDeclarationEmitInfo, - synchronousDeclarationOutput: writer.getText(), - declarationOutput: referencePathsOutput - }; - } - function writeDeclarationToFile(compilerHost, compilerOptions, diagnostics, aliasDeclarationEmitInfo, synchronousDeclarationOutput, jsFilePath, declarationOutput) { - var appliedSyncOutputPos = 0; - ts.forEach(aliasDeclarationEmitInfo, function (aliasEmitInfo) { - if (aliasEmitInfo.asynchronousOutput) { - declarationOutput += synchronousDeclarationOutput.substring(appliedSyncOutputPos, aliasEmitInfo.outputPos); - declarationOutput += aliasEmitInfo.asynchronousOutput; - appliedSyncOutputPos = aliasEmitInfo.outputPos; - } - }); - declarationOutput += synchronousDeclarationOutput.substring(appliedSyncOutputPos); - writeFile(compilerHost, diagnostics, ts.removeFileExtension(jsFilePath) + ".d.ts", declarationOutput, compilerOptions.emitBOM); - } - function getDeclarationDiagnostics(program, resolver, targetSourceFile) { - var diagnostics = []; - var jsFilePath = getOwnEmitOutputFilePath(targetSourceFile, program, ".js"); - emitDeclarations(program, resolver, diagnostics, jsFilePath, targetSourceFile); - return diagnostics; - } - ts.getDeclarationDiagnostics = getDeclarationDiagnostics; - function emitFiles(resolver, targetSourceFile) { - var program = resolver.getProgram(); - var compilerHost = program.getCompilerHost(); - var compilerOptions = program.getCompilerOptions(); - var sourceMapDataList = compilerOptions.sourceMap ? [] : undefined; - var diagnostics = []; - var newLine = program.getCompilerHost().getNewLine(); - function emitJavaScript(jsFilePath, root) { - var writer = createTextWriter(newLine, trackSymbol); - var write = writer.write; - var writeLine = writer.writeLine; - var increaseIndent = writer.increaseIndent; - var decreaseIndent = writer.decreaseIndent; - var currentSourceFile; - var extendsEmitted = false; - var writeEmittedFiles = writeJavaScriptFile; - var emitLeadingComments = compilerOptions.removeComments ? function (node) { - } : emitLeadingDeclarationComments; - var emitTrailingComments = compilerOptions.removeComments ? function (node) { - } : emitTrailingDeclarationComments; - var emitLeadingCommentsOfPosition = compilerOptions.removeComments ? function (pos) { - } : emitLeadingCommentsOfLocalPosition; - var detachedCommentsInfo; - var emitDetachedComments = compilerOptions.removeComments ? function (node) { - } : emitDetachedCommentsAtPosition; - var emitPinnedOrTripleSlashComments = compilerOptions.removeComments ? function (node) { - } : emitPinnedOrTripleSlashCommentsOfNode; - var writeComment = writeCommentRange; - var emit = emitNode; - var emitStart = function (node) { - }; - var emitEnd = function (node) { - }; - var emitToken = emitTokenText; - var scopeEmitStart = function (scopeDeclaration, scopeName) { - }; - var scopeEmitEnd = function () { - }; - var sourceMapData; - function trackSymbol(symbol, enclosingDeclaration, meaning) { - } - function initializeEmitterWithSourceMaps() { - var sourceMapDir; - var sourceMapSourceIndex = -1; - var sourceMapNameIndexMap = {}; - var sourceMapNameIndices = []; - function getSourceMapNameIndex() { - return sourceMapNameIndices.length ? sourceMapNameIndices[sourceMapNameIndices.length - 1] : -1; - } - var lastRecordedSourceMapSpan; - var lastEncodedSourceMapSpan = { - emittedLine: 1, - emittedColumn: 1, - sourceLine: 1, - sourceColumn: 1, - sourceIndex: 0 - }; - var lastEncodedNameIndex = 0; - function encodeLastRecordedSourceMapSpan() { - if (!lastRecordedSourceMapSpan || lastRecordedSourceMapSpan === lastEncodedSourceMapSpan) { - return; - } - var prevEncodedEmittedColumn = lastEncodedSourceMapSpan.emittedColumn; - if (lastEncodedSourceMapSpan.emittedLine == lastRecordedSourceMapSpan.emittedLine) { - if (sourceMapData.sourceMapMappings) { - sourceMapData.sourceMapMappings += ","; - } - } - else { - for (var encodedLine = lastEncodedSourceMapSpan.emittedLine; encodedLine < lastRecordedSourceMapSpan.emittedLine; encodedLine++) { - sourceMapData.sourceMapMappings += ";"; - } - prevEncodedEmittedColumn = 1; - } - sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.emittedColumn - prevEncodedEmittedColumn); - sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceIndex - lastEncodedSourceMapSpan.sourceIndex); - sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceLine - lastEncodedSourceMapSpan.sourceLine); - sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceColumn - lastEncodedSourceMapSpan.sourceColumn); - if (lastRecordedSourceMapSpan.nameIndex >= 0) { - sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.nameIndex - lastEncodedNameIndex); - lastEncodedNameIndex = lastRecordedSourceMapSpan.nameIndex; - } - lastEncodedSourceMapSpan = lastRecordedSourceMapSpan; - sourceMapData.sourceMapDecodedMappings.push(lastEncodedSourceMapSpan); - function base64VLQFormatEncode(inValue) { - function base64FormatEncode(inValue) { - if (inValue < 64) { - return 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.charAt(inValue); - } - throw TypeError(inValue + ": not a 64 based value"); - } - if (inValue < 0) { - inValue = ((-inValue) << 1) + 1; - } - else { - inValue = inValue << 1; - } - var encodedStr = ""; - do { - var currentDigit = inValue & 31; - inValue = inValue >> 5; - if (inValue > 0) { - currentDigit = currentDigit | 32; - } - encodedStr = encodedStr + base64FormatEncode(currentDigit); - } while (inValue > 0); - return encodedStr; - } - } - function recordSourceMapSpan(pos) { - var sourceLinePos = currentSourceFile.getLineAndCharacterFromPosition(pos); - var emittedLine = writer.getLine(); - var emittedColumn = writer.getColumn(); - if (!lastRecordedSourceMapSpan || lastRecordedSourceMapSpan.emittedLine != emittedLine || lastRecordedSourceMapSpan.emittedColumn != emittedColumn || (lastRecordedSourceMapSpan.sourceIndex === sourceMapSourceIndex && (lastRecordedSourceMapSpan.sourceLine > sourceLinePos.line || (lastRecordedSourceMapSpan.sourceLine === sourceLinePos.line && lastRecordedSourceMapSpan.sourceColumn > sourceLinePos.character)))) { - encodeLastRecordedSourceMapSpan(); - lastRecordedSourceMapSpan = { - emittedLine: emittedLine, - emittedColumn: emittedColumn, - sourceLine: sourceLinePos.line, - sourceColumn: sourceLinePos.character, - nameIndex: getSourceMapNameIndex(), - sourceIndex: sourceMapSourceIndex - }; - } - else { - lastRecordedSourceMapSpan.sourceLine = sourceLinePos.line; - lastRecordedSourceMapSpan.sourceColumn = sourceLinePos.character; - lastRecordedSourceMapSpan.sourceIndex = sourceMapSourceIndex; - } - } - function recordEmitNodeStartSpan(node) { - recordSourceMapSpan(ts.skipTrivia(currentSourceFile.text, node.pos)); - } - function recordEmitNodeEndSpan(node) { - recordSourceMapSpan(node.end); - } - function writeTextWithSpanRecord(tokenKind, startPos, emitFn) { - var tokenStartPos = ts.skipTrivia(currentSourceFile.text, startPos); - recordSourceMapSpan(tokenStartPos); - var tokenEndPos = emitTokenText(tokenKind, tokenStartPos, emitFn); - recordSourceMapSpan(tokenEndPos); - return tokenEndPos; - } - function recordNewSourceFileStart(node) { - var sourcesDirectoryPath = compilerOptions.sourceRoot ? program.getCommonSourceDirectory() : sourceMapDir; - sourceMapData.sourceMapSources.push(ts.getRelativePathToDirectoryOrUrl(sourcesDirectoryPath, node.filename, compilerHost.getCurrentDirectory(), compilerHost.getCanonicalFileName, true)); - sourceMapSourceIndex = sourceMapData.sourceMapSources.length - 1; - sourceMapData.inputSourceFileNames.push(node.filename); - } - function recordScopeNameOfNode(node, scopeName) { - function recordScopeNameIndex(scopeNameIndex) { - sourceMapNameIndices.push(scopeNameIndex); - } - function recordScopeNameStart(scopeName) { - var scopeNameIndex = -1; - if (scopeName) { - var parentIndex = getSourceMapNameIndex(); - if (parentIndex !== -1) { - scopeName = sourceMapData.sourceMapNames[parentIndex] + "." + scopeName; - } - scopeNameIndex = ts.getProperty(sourceMapNameIndexMap, scopeName); - if (scopeNameIndex === undefined) { - scopeNameIndex = sourceMapData.sourceMapNames.length; - sourceMapData.sourceMapNames.push(scopeName); - sourceMapNameIndexMap[scopeName] = scopeNameIndex; - } - } - recordScopeNameIndex(scopeNameIndex); - } - if (scopeName) { - recordScopeNameStart(scopeName); - } - else if (node.kind === 172 /* FunctionDeclaration */ || node.kind === 141 /* FunctionExpression */ || node.kind === 120 /* Method */ || node.kind === 122 /* GetAccessor */ || node.kind === 123 /* SetAccessor */ || node.kind === 177 /* ModuleDeclaration */ || node.kind === 174 /* ClassDeclaration */ || node.kind === 176 /* EnumDeclaration */) { - if (node.name) { - scopeName = node.name.text; - } - recordScopeNameStart(scopeName); - } - else { - recordScopeNameIndex(getSourceMapNameIndex()); - } - } - function recordScopeNameEnd() { - sourceMapNameIndices.pop(); - } - ; - function writeCommentRangeWithMap(curentSourceFile, writer, comment, newLine) { - recordSourceMapSpan(comment.pos); - writeCommentRange(currentSourceFile, writer, comment, newLine); - recordSourceMapSpan(comment.end); - } - function serializeSourceMapContents(version, file, sourceRoot, sources, names, mappings) { - if (typeof JSON !== "undefined") { - return JSON.stringify({ - version: version, - file: file, - sourceRoot: sourceRoot, - sources: sources, - names: names, - mappings: mappings - }); - } - return "{\"version\":" + version + ",\"file\":\"" + ts.escapeString(file) + "\",\"sourceRoot\":\"" + ts.escapeString(sourceRoot) + "\",\"sources\":[" + serializeStringArray(sources) + "],\"names\":[" + serializeStringArray(names) + "],\"mappings\":\"" + ts.escapeString(mappings) + "\"}"; - function serializeStringArray(list) { - var output = ""; - for (var i = 0, n = list.length; i < n; i++) { - if (i) { - output += ","; - } - output += "\"" + ts.escapeString(list[i]) + "\""; - } - return output; - } - } - function writeJavaScriptAndSourceMapFile(emitOutput, writeByteOrderMark) { - encodeLastRecordedSourceMapSpan(); - writeFile(compilerHost, diagnostics, sourceMapData.sourceMapFilePath, serializeSourceMapContents(3, sourceMapData.sourceMapFile, sourceMapData.sourceMapSourceRoot, sourceMapData.sourceMapSources, sourceMapData.sourceMapNames, sourceMapData.sourceMapMappings), false); - sourceMapDataList.push(sourceMapData); - writeJavaScriptFile(emitOutput + "//# sourceMappingURL=" + sourceMapData.jsSourceMappingURL, writeByteOrderMark); - } - var sourceMapJsFile = ts.getBaseFilename(ts.normalizeSlashes(jsFilePath)); - sourceMapData = { - sourceMapFilePath: jsFilePath + ".map", - jsSourceMappingURL: sourceMapJsFile + ".map", - sourceMapFile: sourceMapJsFile, - sourceMapSourceRoot: compilerOptions.sourceRoot || "", - sourceMapSources: [], - inputSourceFileNames: [], - sourceMapNames: [], - sourceMapMappings: "", - sourceMapDecodedMappings: [] - }; - sourceMapData.sourceMapSourceRoot = ts.normalizeSlashes(sourceMapData.sourceMapSourceRoot); - if (sourceMapData.sourceMapSourceRoot.length && sourceMapData.sourceMapSourceRoot.charCodeAt(sourceMapData.sourceMapSourceRoot.length - 1) !== 47 /* slash */) { - sourceMapData.sourceMapSourceRoot += ts.directorySeparator; - } - if (compilerOptions.mapRoot) { - sourceMapDir = ts.normalizeSlashes(compilerOptions.mapRoot); - if (root) { - sourceMapDir = ts.getDirectoryPath(getSourceFilePathInNewDir(root, program, sourceMapDir)); - } - if (!ts.isRootedDiskPath(sourceMapDir) && !ts.isUrl(sourceMapDir)) { - sourceMapDir = ts.combinePaths(program.getCommonSourceDirectory(), sourceMapDir); - sourceMapData.jsSourceMappingURL = ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizePath(jsFilePath)), ts.combinePaths(sourceMapDir, sourceMapData.jsSourceMappingURL), compilerHost.getCurrentDirectory(), compilerHost.getCanonicalFileName, true); - } - else { - sourceMapData.jsSourceMappingURL = ts.combinePaths(sourceMapDir, sourceMapData.jsSourceMappingURL); - } - } - else { - sourceMapDir = ts.getDirectoryPath(ts.normalizePath(jsFilePath)); - } - function emitNodeWithMap(node) { - if (node) { - if (node.kind != 182 /* SourceFile */) { - recordEmitNodeStartSpan(node); - emitNode(node); - recordEmitNodeEndSpan(node); - } - else { - recordNewSourceFileStart(node); - emitNode(node); - } - } - } - writeEmittedFiles = writeJavaScriptAndSourceMapFile; - emit = emitNodeWithMap; - emitStart = recordEmitNodeStartSpan; - emitEnd = recordEmitNodeEndSpan; - emitToken = writeTextWithSpanRecord; - scopeEmitStart = recordScopeNameOfNode; - scopeEmitEnd = recordScopeNameEnd; - writeComment = writeCommentRangeWithMap; - } - function writeJavaScriptFile(emitOutput, writeByteOrderMark) { - writeFile(compilerHost, diagnostics, jsFilePath, emitOutput, writeByteOrderMark); - } - function emitTokenText(tokenKind, startPos, emitFn) { - var tokenString = ts.tokenToString(tokenKind); - if (emitFn) { - emitFn(); - } - else { - write(tokenString); - } - return startPos + tokenString.length; - } - function emitOptional(prefix, node) { - if (node) { - write(prefix); - emit(node); - } - } - function emitTrailingCommaIfPresent(nodeList, isMultiline) { - if (nodeList.hasTrailingComma) { - write(","); - if (isMultiline) { - writeLine(); - } - } - } - function emitCommaList(nodes, includeTrailingComma, count) { - if (!(count >= 0)) { - count = nodes.length; - } - if (nodes) { - for (var i = 0; i < count; i++) { - if (i) { - write(", "); - } - emit(nodes[i]); - } - if (includeTrailingComma) { - emitTrailingCommaIfPresent(nodes, false); - } - } - } - function emitMultiLineList(nodes, includeTrailingComma) { - if (nodes) { - for (var i = 0; i < nodes.length; i++) { - if (i) { - write(","); - } - writeLine(); - emit(nodes[i]); - } - if (includeTrailingComma) { - emitTrailingCommaIfPresent(nodes, true); - } - } - } - function emitLines(nodes) { - emitLinesStartingAt(nodes, 0); - } - function emitLinesStartingAt(nodes, startIndex) { - for (var i = startIndex; i < nodes.length; i++) { - writeLine(); - emit(nodes[i]); - } - } - function emitLiteral(node) { - var text = getSourceTextOfLocalNode(currentSourceFile, node); - if (node.kind === 7 /* StringLiteral */ && compilerOptions.sourceMap) { - writer.writeLiteral(text); - } - else { - write(text); - } - } - function emitQuotedIdentifier(node) { - if (node.kind === 7 /* StringLiteral */) { - emitLiteral(node); - } - else { - write("\""); - if (node.kind === 6 /* NumericLiteral */) { - write(node.text); - } - else { - write(getSourceTextOfLocalNode(currentSourceFile, node)); - } - write("\""); - } - } - function isNonExpressionIdentifier(node) { - var parent = node.parent; - switch (parent.kind) { - case 118 /* Parameter */: - case 171 /* VariableDeclaration */: - case 119 /* Property */: - case 134 /* PropertyAssignment */: - case 181 /* EnumMember */: - case 120 /* Method */: - case 172 /* FunctionDeclaration */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 141 /* FunctionExpression */: - case 174 /* ClassDeclaration */: - case 175 /* InterfaceDeclaration */: - case 176 /* EnumDeclaration */: - case 177 /* ModuleDeclaration */: - case 179 /* ImportDeclaration */: - return parent.name === node; - case 158 /* BreakStatement */: - case 157 /* ContinueStatement */: - case 180 /* ExportAssignment */: - return false; - case 164 /* LabeledStatement */: - return node.parent.label === node; - case 168 /* CatchBlock */: - return node.parent.variable === node; - } - } - function emitIdentifier(node) { - if (!isNonExpressionIdentifier(node)) { - var prefix = resolver.getExpressionNamePrefix(node); - if (prefix) { - write(prefix); - write("."); - } - } - write(getSourceTextOfLocalNode(currentSourceFile, node)); - } - function emitThis(node) { - if (resolver.getNodeCheckFlags(node) & 2 /* LexicalThis */) { - write("_this"); - } - else { - write("this"); - } - } - function emitSuper(node) { - var flags = resolver.getNodeCheckFlags(node); - if (flags & 16 /* SuperInstance */) { - write("_super.prototype"); - } - else if (flags & 32 /* SuperStatic */) { - write("_super"); - } - else { - write("super"); - } - } - function emitArrayLiteral(node) { - if (node.flags & 256 /* MultiLine */) { - write("["); - increaseIndent(); - emitMultiLineList(node.elements, true); - decreaseIndent(); - writeLine(); - write("]"); - } - else { - write("["); - emitCommaList(node.elements, true); - write("]"); - } - } - function emitObjectLiteral(node) { - if (!node.properties.length) { - write("{}"); - } - else if (node.flags & 256 /* MultiLine */) { - write("{"); - increaseIndent(); - emitMultiLineList(node.properties, compilerOptions.target >= 1 /* ES5 */); - decreaseIndent(); - writeLine(); - write("}"); - } - else { - write("{ "); - emitCommaList(node.properties, compilerOptions.target >= 1 /* ES5 */); - write(" }"); - } - } - function emitPropertyAssignment(node) { - emitLeadingComments(node); - emit(node.name); - write(": "); - emit(node.initializer); - emitTrailingComments(node); - } - function emitPropertyAccess(node) { - var constantValue = resolver.getConstantValue(node); - if (constantValue !== undefined) { - write(constantValue.toString() + " /* " + ts.identifierToString(node.right) + " */"); - } - else { - emit(node.left); - write("."); - emit(node.right); - } - } - function emitIndexedAccess(node) { - emit(node.object); - write("["); - emit(node.index); - write("]"); - } - function emitCallExpression(node) { - var superCall = false; - if (node.func.kind === 85 /* SuperKeyword */) { - write("_super"); - superCall = true; - } - else { - emit(node.func); - superCall = node.func.kind === 135 /* PropertyAccess */ && node.func.left.kind === 85 /* SuperKeyword */; - } - if (superCall) { - write(".call("); - emitThis(node.func); - if (node.arguments.length) { - write(", "); - emitCommaList(node.arguments, false); - } - write(")"); - } - else { - write("("); - emitCommaList(node.arguments, false); - write(")"); - } - } - function emitNewExpression(node) { - write("new "); - emit(node.func); - if (node.arguments) { - write("("); - emitCommaList(node.arguments, false); - write(")"); - } - } - function emitParenExpression(node) { - if (node.expression.kind === 139 /* TypeAssertion */) { - var operand = node.expression.operand; - while (operand.kind == 139 /* TypeAssertion */) { - operand = operand.operand; - } - if (operand.kind !== 143 /* PrefixOperator */ && operand.kind !== 144 /* PostfixOperator */ && operand.kind !== 138 /* NewExpression */ && !(operand.kind === 137 /* CallExpression */ && node.parent.kind === 138 /* NewExpression */) && !(operand.kind === 141 /* FunctionExpression */ && node.parent.kind === 137 /* CallExpression */)) { - emit(operand); - return; - } - } - write("("); - emit(node.expression); - write(")"); - } - function emitUnaryExpression(node) { - if (node.kind === 143 /* PrefixOperator */) { - write(ts.tokenToString(node.operator)); - } - if (node.operator >= 59 /* Identifier */) { - write(" "); - } - else if (node.kind === 143 /* PrefixOperator */ && node.operand.kind === 143 /* PrefixOperator */) { - var operand = node.operand; - if (node.operator === 28 /* PlusToken */ && (operand.operator === 28 /* PlusToken */ || operand.operator === 33 /* PlusPlusToken */)) { - write(" "); - } - else if (node.operator === 29 /* MinusToken */ && (operand.operator === 29 /* MinusToken */ || operand.operator === 34 /* MinusMinusToken */)) { - write(" "); - } - } - emit(node.operand); - if (node.kind === 144 /* PostfixOperator */) { - write(ts.tokenToString(node.operator)); - } - } - function emitBinaryExpression(node) { - emit(node.left); - if (node.operator !== 18 /* CommaToken */) - write(" "); - write(ts.tokenToString(node.operator)); - write(" "); - emit(node.right); - } - function emitConditionalExpression(node) { - emit(node.condition); - write(" ? "); - emit(node.whenTrue); - write(" : "); - emit(node.whenFalse); - } - function emitBlock(node) { - emitToken(9 /* OpenBraceToken */, node.pos); - increaseIndent(); - scopeEmitStart(node.parent); - if (node.kind === 178 /* ModuleBlock */) { - ts.Debug.assert(node.parent.kind === 177 /* ModuleDeclaration */); - emitCaptureThisForNodeIfNecessary(node.parent); - } - emitLines(node.statements); - decreaseIndent(); - writeLine(); - emitToken(10 /* CloseBraceToken */, node.statements.end); - scopeEmitEnd(); - } - function emitEmbeddedStatement(node) { - if (node.kind === 148 /* Block */) { - write(" "); - emit(node); - } - else { - increaseIndent(); - writeLine(); - emit(node); - decreaseIndent(); - } - } - function emitExpressionStatement(node) { - var isArrowExpression = node.expression.kind === 142 /* ArrowFunction */; - emitLeadingComments(node); - if (isArrowExpression) - write("("); - emit(node.expression); - if (isArrowExpression) - write(")"); - write(";"); - emitTrailingComments(node); - } - function emitIfStatement(node) { - emitLeadingComments(node); - var endPos = emitToken(78 /* IfKeyword */, node.pos); - write(" "); - endPos = emitToken(11 /* OpenParenToken */, endPos); - emit(node.expression); - emitToken(12 /* CloseParenToken */, node.expression.end); - emitEmbeddedStatement(node.thenStatement); - if (node.elseStatement) { - writeLine(); - emitToken(70 /* ElseKeyword */, node.thenStatement.end); - if (node.elseStatement.kind === 152 /* IfStatement */) { - write(" "); - emit(node.elseStatement); - } - else { - emitEmbeddedStatement(node.elseStatement); - } - } - emitTrailingComments(node); - } - function emitDoStatement(node) { - write("do"); - emitEmbeddedStatement(node.statement); - if (node.statement.kind === 148 /* Block */) { - write(" "); - } - else { - writeLine(); - } - write("while ("); - emit(node.expression); - write(");"); - } - function emitWhileStatement(node) { - write("while ("); - emit(node.expression); - write(")"); - emitEmbeddedStatement(node.statement); - } - function emitForStatement(node) { - var endPos = emitToken(76 /* ForKeyword */, node.pos); - write(" "); - endPos = emitToken(11 /* OpenParenToken */, endPos); - if (node.declarations) { - emitToken(92 /* VarKeyword */, endPos); - write(" "); - emitCommaList(node.declarations, false); - } - if (node.initializer) { - emit(node.initializer); - } - write(";"); - emitOptional(" ", node.condition); - write(";"); - emitOptional(" ", node.iterator); - write(")"); - emitEmbeddedStatement(node.statement); - } - function emitForInStatement(node) { - var endPos = emitToken(76 /* ForKeyword */, node.pos); - write(" "); - endPos = emitToken(11 /* OpenParenToken */, endPos); - if (node.declaration) { - emitToken(92 /* VarKeyword */, endPos); - write(" "); - emit(node.declaration); - } - else { - emit(node.variable); - } - write(" in "); - emit(node.expression); - emitToken(12 /* CloseParenToken */, node.expression.end); - emitEmbeddedStatement(node.statement); - } - function emitBreakOrContinueStatement(node) { - emitToken(node.kind === 158 /* BreakStatement */ ? 60 /* BreakKeyword */ : 65 /* ContinueKeyword */, node.pos); - emitOptional(" ", node.label); - write(";"); - } - function emitReturnStatement(node) { - emitLeadingComments(node); - emitToken(84 /* ReturnKeyword */, node.pos); - emitOptional(" ", node.expression); - write(";"); - emitTrailingComments(node); - } - function emitWithStatement(node) { - write("with ("); - emit(node.expression); - write(")"); - emitEmbeddedStatement(node.statement); - } - function emitSwitchStatement(node) { - var endPos = emitToken(86 /* SwitchKeyword */, node.pos); - write(" "); - emitToken(11 /* OpenParenToken */, endPos); - emit(node.expression); - endPos = emitToken(12 /* CloseParenToken */, node.expression.end); - write(" "); - emitToken(9 /* OpenBraceToken */, endPos); - increaseIndent(); - emitLines(node.clauses); - decreaseIndent(); - writeLine(); - emitToken(10 /* CloseBraceToken */, node.clauses.end); - } - function emitCaseOrDefaultClause(node) { - if (node.kind === 162 /* CaseClause */) { - write("case "); - emit(node.expression); - write(":"); - } - else { - write("default:"); - } - increaseIndent(); - emitLines(node.statements); - decreaseIndent(); - } - function emitThrowStatement(node) { - write("throw "); - emit(node.expression); - write(";"); - } - function emitTryStatement(node) { - write("try "); - emit(node.tryBlock); - emit(node.catchBlock); - if (node.finallyBlock) { - writeLine(); - write("finally "); - emit(node.finallyBlock); - } - } - function emitCatchBlock(node) { - writeLine(); - var endPos = emitToken(62 /* CatchKeyword */, node.pos); - write(" "); - emitToken(11 /* OpenParenToken */, endPos); - emit(node.variable); - emitToken(12 /* CloseParenToken */, node.variable.end); - write(" "); - emitBlock(node); - } - function emitDebuggerStatement(node) { - emitToken(66 /* DebuggerKeyword */, node.pos); - write(";"); - } - function emitLabelledStatement(node) { - emit(node.label); - write(": "); - emit(node.statement); - } - function getContainingModule(node) { - do { - node = node.parent; - } while (node && node.kind !== 177 /* ModuleDeclaration */); - return node; - } - function emitModuleMemberName(node) { - emitStart(node.name); - if (node.flags & 1 /* Export */) { - var container = getContainingModule(node); - write(container ? resolver.getLocalNameOfContainer(container) : "exports"); - write("."); - } - emitNode(node.name); - emitEnd(node.name); - } - function emitVariableDeclaration(node) { - emitLeadingComments(node); - emitModuleMemberName(node); - emitOptional(" = ", node.initializer); - emitTrailingComments(node); - } - function emitVariableStatement(node) { - emitLeadingComments(node); - if (!(node.flags & 1 /* Export */)) - write("var "); - emitCommaList(node.declarations, false); - write(";"); - emitTrailingComments(node); - } - function emitParameter(node) { - emitLeadingComments(node); - emit(node.name); - emitTrailingComments(node); - } - function emitDefaultValueAssignments(node) { - ts.forEach(node.parameters, function (param) { - if (param.initializer) { - writeLine(); - emitStart(param); - write("if ("); - emitNode(param.name); - write(" === void 0)"); - emitEnd(param); - write(" { "); - emitStart(param); - emitNode(param.name); - write(" = "); - emitNode(param.initializer); - emitEnd(param); - write("; }"); - } - }); - } - function emitRestParameter(node) { - if (ts.hasRestParameters(node)) { - var restIndex = node.parameters.length - 1; - var restParam = node.parameters[restIndex]; - writeLine(); - emitLeadingComments(restParam); - emitStart(restParam); - write("var "); - emitNode(restParam.name); - write(" = [];"); - emitEnd(restParam); - emitTrailingComments(restParam); - writeLine(); - write("for ("); - emitStart(restParam); - write("var _i = " + restIndex + ";"); - emitEnd(restParam); - write(" "); - emitStart(restParam); - write("_i < arguments.length;"); - emitEnd(restParam); - write(" "); - emitStart(restParam); - write("_i++"); - emitEnd(restParam); - write(") {"); - increaseIndent(); - writeLine(); - emitStart(restParam); - emitNode(restParam.name); - write("[_i - " + restIndex + "] = arguments[_i];"); - emitEnd(restParam); - decreaseIndent(); - writeLine(); - write("}"); - } - } - function emitAccessor(node) { - emitLeadingComments(node); - write(node.kind === 122 /* GetAccessor */ ? "get " : "set "); - emit(node.name); - emitSignatureAndBody(node); - emitTrailingComments(node); - } - function emitFunctionDeclaration(node) { - if (!node.body) { - return emitPinnedOrTripleSlashComments(node); - } - if (node.kind !== 120 /* Method */) { - emitLeadingComments(node); - } - write("function "); - if (node.kind === 172 /* FunctionDeclaration */ || (node.kind === 141 /* FunctionExpression */ && node.name)) { - emit(node.name); - } - emitSignatureAndBody(node); - if (node.kind !== 120 /* Method */) { - emitTrailingComments(node); - } - } - function emitCaptureThisForNodeIfNecessary(node) { - if (resolver.getNodeCheckFlags(node) & 4 /* CaptureThis */) { - writeLine(); - emitStart(node); - write("var _this = this;"); - emitEnd(node); - } - } - function emitSignatureParameters(node) { - increaseIndent(); - write("("); - if (node) { - emitCommaList(node.parameters, false, node.parameters.length - (ts.hasRestParameters(node) ? 1 : 0)); - } - write(")"); - decreaseIndent(); - } - function emitSignatureAndBody(node) { - emitSignatureParameters(node); - write(" {"); - scopeEmitStart(node); - increaseIndent(); - emitDetachedComments(node.body.kind === 173 /* FunctionBlock */ ? node.body.statements : node.body); - var startIndex = 0; - if (node.body.kind === 173 /* FunctionBlock */) { - startIndex = emitDirectivePrologues(node.body.statements, true); - } - var outPos = writer.getTextPos(); - emitCaptureThisForNodeIfNecessary(node); - emitDefaultValueAssignments(node); - emitRestParameter(node); - if (node.body.kind !== 173 /* FunctionBlock */ && outPos === writer.getTextPos()) { - decreaseIndent(); - write(" "); - emitStart(node.body); - write("return "); - emitNode(node.body); - emitEnd(node.body); - write("; "); - emitStart(node.body); - write("}"); - emitEnd(node.body); - } - else { - if (node.body.kind === 173 /* FunctionBlock */) { - emitLinesStartingAt(node.body.statements, startIndex); - } - else { - writeLine(); - emitLeadingComments(node.body); - write("return "); - emit(node.body); - write(";"); - emitTrailingComments(node.body); - } - writeLine(); - if (node.body.kind === 173 /* FunctionBlock */) { - emitLeadingCommentsOfPosition(node.body.statements.end); - decreaseIndent(); - emitToken(10 /* CloseBraceToken */, node.body.statements.end); - } - else { - decreaseIndent(); - emitStart(node.body); - write("}"); - emitEnd(node.body); - } - } - scopeEmitEnd(); - if (node.flags & 1 /* Export */) { - writeLine(); - emitStart(node); - emitModuleMemberName(node); - write(" = "); - emit(node.name); - emitEnd(node); - write(";"); - } - } - function findInitialSuperCall(ctor) { - if (ctor.body) { - var statement = ctor.body.statements[0]; - if (statement && statement.kind === 151 /* ExpressionStatement */) { - var expr = statement.expression; - if (expr && expr.kind === 137 /* CallExpression */) { - var func = expr.func; - if (func && func.kind === 85 /* SuperKeyword */) { - return statement; - } - } - } - } - } - function emitParameterPropertyAssignments(node) { - ts.forEach(node.parameters, function (param) { - if (param.flags & ts.NodeFlags.AccessibilityModifier) { - writeLine(); - emitStart(param); - emitStart(param.name); - write("this."); - emitNode(param.name); - emitEnd(param.name); - write(" = "); - emit(param.name); - write(";"); - emitEnd(param); - } - }); - } - function emitMemberAccess(memberName) { - if (memberName.kind === 7 /* StringLiteral */ || memberName.kind === 6 /* NumericLiteral */) { - write("["); - emitNode(memberName); - write("]"); - } - else { - write("."); - emitNode(memberName); - } - } - function emitMemberAssignments(node, staticFlag) { - ts.forEach(node.members, function (member) { - if (member.kind === 119 /* Property */ && (member.flags & 128 /* Static */) === staticFlag && member.initializer) { - writeLine(); - emitLeadingComments(member); - emitStart(member); - emitStart(member.name); - if (staticFlag) { - emitNode(node.name); - } - else { - write("this"); - } - emitMemberAccess(member.name); - emitEnd(member.name); - write(" = "); - emit(member.initializer); - write(";"); - emitEnd(member); - emitTrailingComments(member); - } - }); - } - function emitMemberFunctions(node) { - ts.forEach(node.members, function (member) { - if (member.kind === 120 /* Method */) { - if (!member.body) { - return emitPinnedOrTripleSlashComments(member); - } - writeLine(); - emitLeadingComments(member); - emitStart(member); - emitStart(member.name); - emitNode(node.name); - if (!(member.flags & 128 /* Static */)) { - write(".prototype"); - } - emitMemberAccess(member.name); - emitEnd(member.name); - write(" = "); - emitStart(member); - emitFunctionDeclaration(member); - emitEnd(member); - emitEnd(member); - write(";"); - emitTrailingComments(member); - } - else if (member.kind === 122 /* GetAccessor */ || member.kind === 123 /* SetAccessor */) { - var accessors = getAllAccessorDeclarations(node, member); - if (member === accessors.firstAccessor) { - writeLine(); - emitStart(member); - write("Object.defineProperty("); - emitStart(member.name); - emitNode(node.name); - if (!(member.flags & 128 /* Static */)) { - write(".prototype"); - } - write(", "); - emitQuotedIdentifier(member.name); - emitEnd(member.name); - write(", {"); - increaseIndent(); - if (accessors.getAccessor) { - writeLine(); - emitLeadingComments(accessors.getAccessor); - write("get: "); - emitStart(accessors.getAccessor); - write("function "); - emitSignatureAndBody(accessors.getAccessor); - emitEnd(accessors.getAccessor); - emitTrailingComments(accessors.getAccessor); - write(","); - } - if (accessors.setAccessor) { - writeLine(); - emitLeadingComments(accessors.setAccessor); - write("set: "); - emitStart(accessors.setAccessor); - write("function "); - emitSignatureAndBody(accessors.setAccessor); - emitEnd(accessors.setAccessor); - emitTrailingComments(accessors.setAccessor); - write(","); - } - writeLine(); - write("enumerable: true,"); - writeLine(); - write("configurable: true"); - decreaseIndent(); - writeLine(); - write("});"); - emitEnd(member); - } - } - }); - } - function emitClassDeclaration(node) { - emitLeadingComments(node); - write("var "); - emit(node.name); - write(" = (function ("); - if (node.baseType) { - write("_super"); - } - write(") {"); - increaseIndent(); - scopeEmitStart(node); - if (node.baseType) { - writeLine(); - emitStart(node.baseType); - write("__extends("); - emit(node.name); - write(", _super);"); - emitEnd(node.baseType); - } - writeLine(); - emitConstructorOfClass(); - emitMemberFunctions(node); - emitMemberAssignments(node, 128 /* Static */); - writeLine(); - function emitClassReturnStatement() { - write("return "); - emitNode(node.name); - } - emitToken(10 /* CloseBraceToken */, node.members.end, emitClassReturnStatement); - write(";"); - decreaseIndent(); - writeLine(); - emitToken(10 /* CloseBraceToken */, node.members.end); - scopeEmitEnd(); - emitStart(node); - write(")("); - if (node.baseType) { - emit(node.baseType.typeName); - } - write(");"); - emitEnd(node); - if (node.flags & 1 /* Export */) { - writeLine(); - emitStart(node); - emitModuleMemberName(node); - write(" = "); - emit(node.name); - emitEnd(node); - write(";"); - } - emitTrailingComments(node); - function emitConstructorOfClass() { - ts.forEach(node.members, function (member) { - if (member.kind === 121 /* Constructor */ && !member.body) { - emitPinnedOrTripleSlashComments(member); - } - }); - var ctor = getFirstConstructorWithBody(node); - if (ctor) { - emitLeadingComments(ctor); - } - emitStart(ctor || node); - write("function "); - emit(node.name); - emitSignatureParameters(ctor); - write(" {"); - scopeEmitStart(node, "constructor"); - increaseIndent(); - if (ctor) { - emitDetachedComments(ctor.body.statements); - } - emitCaptureThisForNodeIfNecessary(node); - if (ctor) { - emitDefaultValueAssignments(ctor); - emitRestParameter(ctor); - if (node.baseType) { - var superCall = findInitialSuperCall(ctor); - if (superCall) { - writeLine(); - emit(superCall); - } - } - emitParameterPropertyAssignments(ctor); - } - else { - if (node.baseType) { - writeLine(); - emitStart(node.baseType); - write("_super.apply(this, arguments);"); - emitEnd(node.baseType); - } - } - emitMemberAssignments(node, 0); - if (ctor) { - var statements = ctor.body.statements; - if (superCall) - statements = statements.slice(1); - emitLines(statements); - } - writeLine(); - if (ctor) { - emitLeadingCommentsOfPosition(ctor.body.statements.end); - } - decreaseIndent(); - emitToken(10 /* CloseBraceToken */, ctor ? ctor.body.statements.end : node.members.end); - scopeEmitEnd(); - emitEnd(ctor || node); - if (ctor) { - emitTrailingComments(ctor); - } - } - } - function emitInterfaceDeclaration(node) { - emitPinnedOrTripleSlashComments(node); - } - function emitEnumDeclaration(node) { - emitLeadingComments(node); - if (!(node.flags & 1 /* Export */)) { - emitStart(node); - write("var "); - emit(node.name); - emitEnd(node); - write(";"); - } - writeLine(); - emitStart(node); - write("(function ("); - emitStart(node.name); - write(resolver.getLocalNameOfContainer(node)); - emitEnd(node.name); - write(") {"); - increaseIndent(); - scopeEmitStart(node); - emitEnumMemberDeclarations(); - decreaseIndent(); - writeLine(); - emitToken(10 /* CloseBraceToken */, node.members.end); - scopeEmitEnd(); - write(")("); - emitModuleMemberName(node); - write(" || ("); - emitModuleMemberName(node); - write(" = {}));"); - emitEnd(node); - if (node.flags & 1 /* Export */) { - writeLine(); - emitStart(node); - write("var "); - emit(node.name); - write(" = "); - emitModuleMemberName(node); - emitEnd(node); - write(";"); - } - emitTrailingComments(node); - function emitEnumMemberDeclarations() { - ts.forEach(node.members, function (member) { - writeLine(); - emitLeadingComments(member); - emitStart(member); - write(resolver.getLocalNameOfContainer(node)); - write("["); - write(resolver.getLocalNameOfContainer(node)); - write("["); - emitQuotedIdentifier(member.name); - write("] = "); - if (member.initializer) { - emit(member.initializer); - } - else { - write(resolver.getEnumMemberValue(member).toString()); - } - write("] = "); - emitQuotedIdentifier(member.name); - emitEnd(member); - write(";"); - emitTrailingComments(member); - }); - } - } - function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 177 /* ModuleDeclaration */) { - var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); - return recursiveInnerModule || moduleDeclaration.body; - } - } - function emitModuleDeclaration(node) { - if (!ts.isInstantiated(node)) { - return emitPinnedOrTripleSlashComments(node); - } - emitLeadingComments(node); - emitStart(node); - write("var "); - emit(node.name); - write(";"); - emitEnd(node); - writeLine(); - emitStart(node); - write("(function ("); - emitStart(node.name); - write(resolver.getLocalNameOfContainer(node)); - emitEnd(node.name); - write(") "); - if (node.body.kind === 178 /* ModuleBlock */) { - emit(node.body); - } - else { - write("{"); - increaseIndent(); - scopeEmitStart(node); - emitCaptureThisForNodeIfNecessary(node); - writeLine(); - emit(node.body); - decreaseIndent(); - writeLine(); - var moduleBlock = getInnerMostModuleDeclarationFromDottedModule(node).body; - emitToken(10 /* CloseBraceToken */, moduleBlock.statements.end); - scopeEmitEnd(); - } - write(")("); - if (node.flags & 1 /* Export */) { - emit(node.name); - write(" = "); - } - emitModuleMemberName(node); - write(" || ("); - emitModuleMemberName(node); - write(" = {}));"); - emitEnd(node); - emitTrailingComments(node); - } - function emitImportDeclaration(node) { - var emitImportDeclaration = resolver.isReferencedImportDeclaration(node); - if (!emitImportDeclaration) { - emitImportDeclaration = !ts.isExternalModule(currentSourceFile) && resolver.isTopLevelValueImportedViaEntityName(node); - } - if (emitImportDeclaration) { - if (node.externalModuleName && node.parent.kind === 182 /* SourceFile */ && compilerOptions.module === 2 /* AMD */) { - if (node.flags & 1 /* Export */) { - writeLine(); - emitLeadingComments(node); - emitStart(node); - emitModuleMemberName(node); - write(" = "); - emit(node.name); - write(";"); - emitEnd(node); - emitTrailingComments(node); - } - } - else { - writeLine(); - emitLeadingComments(node); - emitStart(node); - if (!(node.flags & 1 /* Export */)) - write("var "); - emitModuleMemberName(node); - write(" = "); - if (node.entityName) { - emit(node.entityName); - } - else { - write("require("); - emitStart(node.externalModuleName); - emitLiteral(node.externalModuleName); - emitEnd(node.externalModuleName); - emitToken(12 /* CloseParenToken */, node.externalModuleName.end); - } - write(";"); - emitEnd(node); - emitTrailingComments(node); - } - } - } - function getExternalImportDeclarations(node) { - var result = []; - ts.forEach(node.statements, function (stat) { - if (stat.kind === 179 /* ImportDeclaration */ && stat.externalModuleName && resolver.isReferencedImportDeclaration(stat)) { - result.push(stat); - } - }); - return result; - } - function getFirstExportAssignment(sourceFile) { - return ts.forEach(sourceFile.statements, function (node) { - if (node.kind === 180 /* ExportAssignment */) { - return node; - } - }); - } - function emitAMDModule(node, startIndex) { - var imports = getExternalImportDeclarations(node); - writeLine(); - write("define([\"require\", \"exports\""); - ts.forEach(imports, function (imp) { - write(", "); - emitLiteral(imp.externalModuleName); - }); - ts.forEach(node.amdDependencies, function (amdDependency) { - var text = "\"" + amdDependency + "\""; - write(", "); - write(text); - }); - write("], function (require, exports"); - ts.forEach(imports, function (imp) { - write(", "); - emit(imp.name); - }); - write(") {"); - increaseIndent(); - emitCaptureThisForNodeIfNecessary(node); - emitLinesStartingAt(node.statements, startIndex); - var exportName = resolver.getExportAssignmentName(node); - if (exportName) { - writeLine(); - var exportAssignement = getFirstExportAssignment(node); - emitStart(exportAssignement); - write("return "); - emitStart(exportAssignement.exportName); - write(exportName); - emitEnd(exportAssignement.exportName); - write(";"); - emitEnd(exportAssignement); - } - decreaseIndent(); - writeLine(); - write("});"); - } - function emitCommonJSModule(node, startIndex) { - emitCaptureThisForNodeIfNecessary(node); - emitLinesStartingAt(node.statements, startIndex); - var exportName = resolver.getExportAssignmentName(node); - if (exportName) { - writeLine(); - var exportAssignement = getFirstExportAssignment(node); - emitStart(exportAssignement); - write("module.exports = "); - emitStart(exportAssignement.exportName); - write(exportName); - emitEnd(exportAssignement.exportName); - write(";"); - emitEnd(exportAssignement); - } - } - function emitDirectivePrologues(statements, startWithNewLine) { - for (var i = 0; i < statements.length; ++i) { - if (ts.isPrologueDirective(statements[i])) { - if (startWithNewLine || i > 0) { - writeLine(); - } - emit(statements[i]); - } - else { - return i; - } - } - return statements.length; - } - function emitSourceFile(node) { - currentSourceFile = node; - writeLine(); - emitDetachedComments(node); - var startIndex = emitDirectivePrologues(node.statements, false); - if (!extendsEmitted && resolver.getNodeCheckFlags(node) & 8 /* EmitExtends */) { - writeLine(); - write("var __extends = this.__extends || function (d, b) {"); - increaseIndent(); - writeLine(); - write("for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];"); - writeLine(); - write("function __() { this.constructor = d; }"); - writeLine(); - write("__.prototype = b.prototype;"); - writeLine(); - write("d.prototype = new __();"); - decreaseIndent(); - writeLine(); - write("};"); - extendsEmitted = true; - } - if (ts.isExternalModule(node)) { - if (compilerOptions.module === 2 /* AMD */) { - emitAMDModule(node, startIndex); - } - else { - emitCommonJSModule(node, startIndex); - } - } - else { - emitCaptureThisForNodeIfNecessary(node); - emitLinesStartingAt(node.statements, startIndex); - } - } - function emitNode(node) { - if (!node) { - return; - } - if (node.flags & 2 /* Ambient */) { - return emitPinnedOrTripleSlashComments(node); - } - switch (node.kind) { - case 59 /* Identifier */: - return emitIdentifier(node); - case 118 /* Parameter */: - return emitParameter(node); - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - return emitAccessor(node); - case 87 /* ThisKeyword */: - return emitThis(node); - case 85 /* SuperKeyword */: - return emitSuper(node); - case 83 /* NullKeyword */: - return write("null"); - case 89 /* TrueKeyword */: - return write("true"); - case 74 /* FalseKeyword */: - return write("false"); - case 6 /* NumericLiteral */: - case 7 /* StringLiteral */: - case 8 /* RegularExpressionLiteral */: - return emitLiteral(node); - case 116 /* QualifiedName */: - return emitPropertyAccess(node); - case 132 /* ArrayLiteral */: - return emitArrayLiteral(node); - case 133 /* ObjectLiteral */: - return emitObjectLiteral(node); - case 134 /* PropertyAssignment */: - return emitPropertyAssignment(node); - case 135 /* PropertyAccess */: - return emitPropertyAccess(node); - case 136 /* IndexedAccess */: - return emitIndexedAccess(node); - case 137 /* CallExpression */: - return emitCallExpression(node); - case 138 /* NewExpression */: - return emitNewExpression(node); - case 139 /* TypeAssertion */: - return emit(node.operand); - case 140 /* ParenExpression */: - return emitParenExpression(node); - case 172 /* FunctionDeclaration */: - case 141 /* FunctionExpression */: - case 142 /* ArrowFunction */: - return emitFunctionDeclaration(node); - case 143 /* PrefixOperator */: - case 144 /* PostfixOperator */: - return emitUnaryExpression(node); - case 145 /* BinaryExpression */: - return emitBinaryExpression(node); - case 146 /* ConditionalExpression */: - return emitConditionalExpression(node); - case 147 /* OmittedExpression */: - return; - case 148 /* Block */: - case 167 /* TryBlock */: - case 169 /* FinallyBlock */: - case 173 /* FunctionBlock */: - case 178 /* ModuleBlock */: - return emitBlock(node); - case 149 /* VariableStatement */: - return emitVariableStatement(node); - case 150 /* EmptyStatement */: - return write(";"); - case 151 /* ExpressionStatement */: - return emitExpressionStatement(node); - case 152 /* IfStatement */: - return emitIfStatement(node); - case 153 /* DoStatement */: - return emitDoStatement(node); - case 154 /* WhileStatement */: - return emitWhileStatement(node); - case 155 /* ForStatement */: - return emitForStatement(node); - case 156 /* ForInStatement */: - return emitForInStatement(node); - case 157 /* ContinueStatement */: - case 158 /* BreakStatement */: - return emitBreakOrContinueStatement(node); - case 159 /* ReturnStatement */: - return emitReturnStatement(node); - case 160 /* WithStatement */: - return emitWithStatement(node); - case 161 /* SwitchStatement */: - return emitSwitchStatement(node); - case 162 /* CaseClause */: - case 163 /* DefaultClause */: - return emitCaseOrDefaultClause(node); - case 164 /* LabeledStatement */: - return emitLabelledStatement(node); - case 165 /* ThrowStatement */: - return emitThrowStatement(node); - case 166 /* TryStatement */: - return emitTryStatement(node); - case 168 /* CatchBlock */: - return emitCatchBlock(node); - case 170 /* DebuggerStatement */: - return emitDebuggerStatement(node); - case 171 /* VariableDeclaration */: - return emitVariableDeclaration(node); - case 174 /* ClassDeclaration */: - return emitClassDeclaration(node); - case 175 /* InterfaceDeclaration */: - return emitInterfaceDeclaration(node); - case 176 /* EnumDeclaration */: - return emitEnumDeclaration(node); - case 177 /* ModuleDeclaration */: - return emitModuleDeclaration(node); - case 179 /* ImportDeclaration */: - return emitImportDeclaration(node); - case 182 /* SourceFile */: - return emitSourceFile(node); - } - } - function hasDetachedComments(pos) { - return detachedCommentsInfo !== undefined && detachedCommentsInfo[detachedCommentsInfo.length - 1].nodePos === pos; - } - function getLeadingCommentsWithoutDetachedComments() { - var leadingComments = ts.getLeadingCommentRanges(currentSourceFile.text, detachedCommentsInfo[detachedCommentsInfo.length - 1].detachedCommentEndPos); - if (detachedCommentsInfo.length - 1) { - detachedCommentsInfo.pop(); - } - else { - detachedCommentsInfo = undefined; - } - return leadingComments; - } - function getLeadingCommentsToEmit(node) { - if (node.parent.kind === 182 /* SourceFile */ || node.pos !== node.parent.pos) { - var leadingComments; - if (hasDetachedComments(node.pos)) { - leadingComments = getLeadingCommentsWithoutDetachedComments(); - } - else { - leadingComments = ts.getLeadingCommentRangesOfNode(node, currentSourceFile); - } - return leadingComments; - } - } - function emitLeadingDeclarationComments(node) { - var leadingComments = getLeadingCommentsToEmit(node); - emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments); - emitComments(currentSourceFile, writer, leadingComments, true, newLine, writeComment); - } - function emitTrailingDeclarationComments(node) { - if (node.parent.kind === 182 /* SourceFile */ || node.end !== node.parent.end) { - var trailingComments = ts.getTrailingCommentRanges(currentSourceFile.text, node.end); - emitComments(currentSourceFile, writer, trailingComments, false, newLine, writeComment); - } - } - function emitLeadingCommentsOfLocalPosition(pos) { - var leadingComments; - if (hasDetachedComments(pos)) { - leadingComments = getLeadingCommentsWithoutDetachedComments(); - } - else { - leadingComments = ts.getLeadingCommentRanges(currentSourceFile.text, pos); - } - emitNewLineBeforeLeadingComments(currentSourceFile, writer, { pos: pos, end: pos }, leadingComments); - emitComments(currentSourceFile, writer, leadingComments, true, newLine, writeComment); - } - function emitDetachedCommentsAtPosition(node) { - var leadingComments = ts.getLeadingCommentRanges(currentSourceFile.text, node.pos); - if (leadingComments) { - var detachedComments = []; - var lastComment; - ts.forEach(leadingComments, function (comment) { - if (lastComment) { - var lastCommentLine = getLineOfLocalPosition(currentSourceFile, lastComment.end); - var commentLine = getLineOfLocalPosition(currentSourceFile, comment.pos); - if (commentLine >= lastCommentLine + 2) { - return detachedComments; - } - } - detachedComments.push(comment); - lastComment = comment; - }); - if (detachedComments.length) { - var lastCommentLine = getLineOfLocalPosition(currentSourceFile, detachedComments[detachedComments.length - 1].end); - var astLine = getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node.pos)); - if (astLine >= lastCommentLine + 2) { - emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments); - emitComments(currentSourceFile, writer, detachedComments, true, newLine, writeComment); - var currentDetachedCommentInfo = { nodePos: node.pos, detachedCommentEndPos: detachedComments[detachedComments.length - 1].end }; - if (detachedCommentsInfo) { - detachedCommentsInfo.push(currentDetachedCommentInfo); - } - else { - detachedCommentsInfo = [currentDetachedCommentInfo]; - } - } - } - } - } - function emitPinnedOrTripleSlashCommentsOfNode(node) { - var pinnedComments = ts.filter(getLeadingCommentsToEmit(node), isPinnedOrTripleSlashComment); - function isPinnedOrTripleSlashComment(comment) { - if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 42 /* asterisk */) { - return currentSourceFile.text.charCodeAt(comment.pos + 2) === 33 /* exclamation */; - } - else if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 47 /* slash */ && comment.pos + 2 < comment.end && currentSourceFile.text.charCodeAt(comment.pos + 2) === 47 /* slash */ && currentSourceFile.text.substring(comment.pos, comment.end).match(ts.fullTripleSlashReferencePathRegEx)) { - return true; - } - } - emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, pinnedComments); - emitComments(currentSourceFile, writer, pinnedComments, true, newLine, writeComment); - } - if (compilerOptions.sourceMap) { - initializeEmitterWithSourceMaps(); - } - if (root) { - emit(root); - } - else { - ts.forEach(program.getSourceFiles(), function (sourceFile) { - if (!isExternalModuleOrDeclarationFile(sourceFile)) { - emit(sourceFile); - } - }); - } - writeLine(); - writeEmittedFiles(writer.getText(), compilerOptions.emitBOM); - } - var hasSemanticErrors = resolver.hasSemanticErrors(); - function emitFile(jsFilePath, sourceFile) { - emitJavaScript(jsFilePath, sourceFile); - if (!hasSemanticErrors && compilerOptions.declaration) { - var emitDeclarationResult = emitDeclarations(program, resolver, diagnostics, jsFilePath, sourceFile); - if (!emitDeclarationResult.reportedDeclarationError) { - writeDeclarationToFile(compilerHost, compilerOptions, diagnostics, emitDeclarationResult.aliasDeclarationEmitInfo, emitDeclarationResult.synchronousDeclarationOutput, jsFilePath, emitDeclarationResult.declarationOutput); - } - } - } - if (targetSourceFile === undefined) { - ts.forEach(program.getSourceFiles(), function (sourceFile) { - if (shouldEmitToOwnFile(sourceFile, compilerOptions)) { - var jsFilePath = getOwnEmitOutputFilePath(sourceFile, program, ".js"); - emitFile(jsFilePath, sourceFile); - } - }); - if (compilerOptions.out) { - emitFile(compilerOptions.out); - } - } - else { - if (shouldEmitToOwnFile(targetSourceFile, compilerOptions)) { - var jsFilePath = getOwnEmitOutputFilePath(targetSourceFile, program, ".js"); - emitFile(jsFilePath, targetSourceFile); - } - else if (!ts.isDeclarationFile(targetSourceFile) && compilerOptions.out) { - emitFile(compilerOptions.out); - } - } - diagnostics.sort(ts.compareDiagnostics); - diagnostics = ts.deduplicateSortedDiagnostics(diagnostics); - var hasEmitterError = ts.forEach(diagnostics, function (diagnostic) { return diagnostic.category === 1 /* Error */; }); - var returnCode; - if (hasEmitterError) { - returnCode = 4 /* EmitErrorsEncountered */; - } - else if (hasSemanticErrors && compilerOptions.declaration) { - returnCode = 3 /* DeclarationGenerationSkipped */; - } - else if (hasSemanticErrors && !compilerOptions.declaration) { - returnCode = 2 /* JSGeneratedWithSemanticErrors */; - } - else { - returnCode = 0 /* Succeeded */; - } - return { - emitResultStatus: returnCode, - errors: diagnostics, - sourceMaps: sourceMapDataList - }; - } - ts.emitFiles = emitFiles; -})(ts || (ts = {})); -var ts; -(function (ts) { - var nextSymbolId = 1; - var nextNodeId = 1; - var nextMergeId = 1; - function getDeclarationOfKind(symbol, kind) { - var declarations = symbol.declarations; - for (var i = 0; i < declarations.length; i++) { - var declaration = declarations[i]; - if (declaration.kind === kind) { - return declaration; - } - } - return undefined; - } - ts.getDeclarationOfKind = getDeclarationOfKind; - var stringWriters = []; - function getSingleLineStringWriter() { - if (stringWriters.length == 0) { - var str = ""; - return { - string: function () { return str; }, - writeKind: function (text) { return str += text; }, - writeSymbol: function (text) { return str += text; }, - writeLine: function () { return str += " "; }, - increaseIndent: function () { - }, - decreaseIndent: function () { - }, - clear: function () { return str = ""; }, - trackSymbol: function () { - } - }; - } - return stringWriters.pop(); - } - ts.getSingleLineStringWriter = getSingleLineStringWriter; - function createTypeChecker(program, fullTypeCheck) { - var Symbol = ts.objectAllocator.getSymbolConstructor(); - var Type = ts.objectAllocator.getTypeConstructor(); - var Signature = ts.objectAllocator.getSignatureConstructor(); - var typeCount = 0; - var emptyArray = []; - var emptySymbols = {}; - var compilerOptions = program.getCompilerOptions(); - var checker = { - getProgram: function () { return program; }, - getDiagnostics: getDiagnostics, - getDeclarationDiagnostics: getDeclarationDiagnostics, - getGlobalDiagnostics: getGlobalDiagnostics, - getNodeCount: function () { return ts.sum(program.getSourceFiles(), "nodeCount"); }, - getIdentifierCount: function () { return ts.sum(program.getSourceFiles(), "identifierCount"); }, - getSymbolCount: function () { return ts.sum(program.getSourceFiles(), "symbolCount"); }, - getTypeCount: function () { return typeCount; }, - checkProgram: checkProgram, - emitFiles: invokeEmitter, - getParentOfSymbol: getParentOfSymbol, - getTypeOfSymbol: getTypeOfSymbol, - getPropertiesOfType: getPropertiesOfType, - getPropertyOfType: getPropertyOfType, - getSignaturesOfType: getSignaturesOfType, - getIndexTypeOfType: getIndexTypeOfType, - getReturnTypeOfSignature: getReturnTypeOfSignature, - getSymbolsInScope: getSymbolsInScope, - getSymbolInfo: getSymbolInfo, - getTypeOfNode: getTypeOfNode, - getApparentType: getApparentType, - typeToString: typeToString, - writeType: writeType, - symbolToString: symbolToString, - writeSymbol: writeSymbol, - getAugmentedPropertiesOfApparentType: getAugmentedPropertiesOfApparentType, - getRootSymbol: getRootSymbol, - getContextualType: getContextualType, - getFullyQualifiedName: getFullyQualifiedName, - getResolvedSignature: getResolvedSignature, - getEnumMemberValue: getEnumMemberValue, - isValidPropertyAccess: isValidPropertyAccess, - getSignatureFromDeclaration: getSignatureFromDeclaration, - writeSignature: writeSignature, - writeTypeParameter: writeTypeParameter, - writeTypeParametersOfSymbol: writeTypeParametersOfSymbol, - isImplementationOfOverload: isImplementationOfOverload, - getAliasedSymbol: resolveImport, - isUndefinedSymbol: function (symbol) { return symbol === undefinedSymbol; }, - isArgumentsSymbol: function (symbol) { return symbol === argumentsSymbol; } - }; - var undefinedSymbol = createSymbol(2 /* Property */ | 33554432 /* Transient */, "undefined"); - var argumentsSymbol = createSymbol(2 /* Property */ | 33554432 /* Transient */, "arguments"); - var unknownSymbol = createSymbol(2 /* Property */ | 33554432 /* Transient */, "unknown"); - var resolvingSymbol = createSymbol(33554432 /* Transient */, "__resolving__"); - var anyType = createIntrinsicType(1 /* Any */, "any"); - var stringType = createIntrinsicType(2 /* String */, "string"); - var numberType = createIntrinsicType(4 /* Number */, "number"); - var booleanType = createIntrinsicType(8 /* Boolean */, "boolean"); - var voidType = createIntrinsicType(16 /* Void */, "void"); - var undefinedType = createIntrinsicType(32 /* Undefined */, "undefined"); - var nullType = createIntrinsicType(64 /* Null */, "null"); - var unknownType = createIntrinsicType(1 /* Any */, "unknown"); - var resolvingType = createIntrinsicType(1 /* Any */, "__resolving__"); - var emptyObjectType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); - var anyFunctionType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); - var noConstraintType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); - var anySignature = createSignature(undefined, undefined, emptyArray, anyType, 0, false, false); - var unknownSignature = createSignature(undefined, undefined, emptyArray, unknownType, 0, false, false); - var globals = {}; - var globalArraySymbol; - var globalObjectType; - var globalFunctionType; - var globalArrayType; - var globalStringType; - var globalNumberType; - var globalBooleanType; - var globalRegExpType; - var tupleTypes = {}; - var stringLiteralTypes = {}; - var emitExtends = false; - var mergedSymbols = []; - var symbolLinks = []; - var nodeLinks = []; - var potentialThisCollisions = []; - var diagnostics = []; - var diagnosticsModified = false; - function addDiagnostic(diagnostic) { - diagnostics.push(diagnostic); - diagnosticsModified = true; - } - function error(location, message, arg0, arg1, arg2) { - var diagnostic = location ? ts.createDiagnosticForNode(location, message, arg0, arg1, arg2) : ts.createCompilerDiagnostic(message, arg0, arg1, arg2); - addDiagnostic(diagnostic); - } - function createSymbol(flags, name) { - return new Symbol(flags, name); - } - function getExcludedSymbolFlags(flags) { - var result = 0; - if (flags & 1 /* Variable */) - result |= ts.SymbolFlags.VariableExcludes; - if (flags & 2 /* Property */) - result |= ts.SymbolFlags.PropertyExcludes; - if (flags & 4 /* EnumMember */) - result |= ts.SymbolFlags.EnumMemberExcludes; - if (flags & 8 /* Function */) - result |= ts.SymbolFlags.FunctionExcludes; - if (flags & 16 /* Class */) - result |= ts.SymbolFlags.ClassExcludes; - if (flags & 32 /* Interface */) - result |= ts.SymbolFlags.InterfaceExcludes; - if (flags & 64 /* Enum */) - result |= ts.SymbolFlags.EnumExcludes; - if (flags & 128 /* ValueModule */) - result |= ts.SymbolFlags.ValueModuleExcludes; - if (flags & 2048 /* Method */) - result |= ts.SymbolFlags.MethodExcludes; - if (flags & 8192 /* GetAccessor */) - result |= ts.SymbolFlags.GetAccessorExcludes; - if (flags & 16384 /* SetAccessor */) - result |= ts.SymbolFlags.SetAccessorExcludes; - if (flags & 262144 /* TypeParameter */) - result |= ts.SymbolFlags.TypeParameterExcludes; - if (flags & 4194304 /* Import */) - result |= ts.SymbolFlags.ImportExcludes; - return result; - } - function recordMergedSymbol(target, source) { - if (!source.mergeId) - source.mergeId = nextMergeId++; - mergedSymbols[source.mergeId] = target; - } - function cloneSymbol(symbol) { - var result = createSymbol(symbol.flags | 16777216 /* Merged */, symbol.name); - result.declarations = symbol.declarations.slice(0); - result.parent = symbol.parent; - if (symbol.valueDeclaration) - result.valueDeclaration = symbol.valueDeclaration; - if (symbol.members) - result.members = cloneSymbolTable(symbol.members); - if (symbol.exports) - result.exports = cloneSymbolTable(symbol.exports); - recordMergedSymbol(result, symbol); - return result; - } - function extendSymbol(target, source) { - if (!(target.flags & getExcludedSymbolFlags(source.flags))) { - target.flags |= source.flags; - if (!target.valueDeclaration && source.valueDeclaration) - target.valueDeclaration = source.valueDeclaration; - ts.forEach(source.declarations, function (node) { - target.declarations.push(node); - }); - if (source.members) { - if (!target.members) - target.members = {}; - extendSymbolTable(target.members, source.members); - } - if (source.exports) { - if (!target.exports) - target.exports = {}; - extendSymbolTable(target.exports, source.exports); - } - recordMergedSymbol(target, source); - } - else { - ts.forEach(source.declarations, function (node) { - error(node.name ? node.name : node, ts.Diagnostics.Duplicate_identifier_0, symbolToString(source)); - }); - } - } - function cloneSymbolTable(symbolTable) { - var result = {}; - for (var id in symbolTable) { - if (ts.hasProperty(symbolTable, id)) { - result[id] = symbolTable[id]; - } - } - return result; - } - function extendSymbolTable(target, source) { - for (var id in source) { - if (ts.hasProperty(source, id)) { - if (!ts.hasProperty(target, id)) { - target[id] = source[id]; - } - else { - var symbol = target[id]; - if (!(symbol.flags & 16777216 /* Merged */)) { - target[id] = symbol = cloneSymbol(symbol); - } - extendSymbol(symbol, source[id]); - } - } - } - } - function getSymbolLinks(symbol) { - if (symbol.flags & 33554432 /* Transient */) - return symbol; - if (!symbol.id) - symbol.id = nextSymbolId++; - return symbolLinks[symbol.id] || (symbolLinks[symbol.id] = {}); - } - function getNodeLinks(node) { - if (!node.id) - node.id = nextNodeId++; - return nodeLinks[node.id] || (nodeLinks[node.id] = {}); - } - function getSourceFile(node) { - return ts.getAncestor(node, 182 /* SourceFile */); - } - function isGlobalSourceFile(node) { - return node.kind === 182 /* SourceFile */ && !ts.isExternalModule(node); - } - function getSymbol(symbols, name, meaning) { - if (meaning && ts.hasProperty(symbols, name)) { - var symbol = symbols[name]; - ts.Debug.assert((symbol.flags & 8388608 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); - if (symbol.flags & meaning) { - return symbol; - } - if (symbol.flags & 4194304 /* Import */) { - var target = resolveImport(symbol); - if (target === unknownSymbol || target.flags & meaning) { - return symbol; - } - } - } - } - function resolveName(location, name, meaning, nameNotFoundMessage, nameArg) { - var errorLocation = location; - var result; - var lastLocation; - var memberWithInitializerThatReferencesIdentifierFromConstructor; - function returnResolvedSymbol(s) { - if (s && memberWithInitializerThatReferencesIdentifierFromConstructor) { - var propertyName = memberWithInitializerThatReferencesIdentifierFromConstructor.name; - error(errorLocation, ts.Diagnostics.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor, ts.identifierToString(propertyName), nameArg); - return undefined; - } - if (!s && nameNotFoundMessage) { - error(errorLocation, nameNotFoundMessage, nameArg); - } - return s; - } - while (location) { - if (location.locals && !isGlobalSourceFile(location)) { - if (result = getSymbol(location.locals, name, meaning)) { - return returnResolvedSymbol(result); - } - } - switch (location.kind) { - case 182 /* SourceFile */: - if (!ts.isExternalModule(location)) - break; - case 177 /* ModuleDeclaration */: - if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & ts.SymbolFlags.ModuleMember)) { - return returnResolvedSymbol(result); - } - break; - case 176 /* EnumDeclaration */: - if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 4 /* EnumMember */)) { - return returnResolvedSymbol(result); - } - break; - case 119 /* Property */: - if (location.parent.kind === 174 /* ClassDeclaration */ && !(location.flags & 128 /* Static */)) { - var ctor = findConstructorDeclaration(location.parent); - if (ctor && ctor.locals) { - if (getSymbol(ctor.locals, name, meaning & ts.SymbolFlags.Value)) { - memberWithInitializerThatReferencesIdentifierFromConstructor = location; - } - } - } - break; - case 174 /* ClassDeclaration */: - case 175 /* InterfaceDeclaration */: - if (result = getSymbol(getSymbolOfNode(location).members, name, meaning & ts.SymbolFlags.Type)) { - if (lastLocation && lastLocation.flags & 128 /* Static */) { - error(errorLocation, ts.Diagnostics.Static_members_cannot_reference_class_type_parameters); - return undefined; - } - else { - return returnResolvedSymbol(result); - } - } - break; - case 120 /* Method */: - case 121 /* Constructor */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 172 /* FunctionDeclaration */: - case 142 /* ArrowFunction */: - if (name === "arguments") { - return returnResolvedSymbol(argumentsSymbol); - } - break; - case 141 /* FunctionExpression */: - if (name === "arguments") { - return returnResolvedSymbol(argumentsSymbol); - } - var id = location.name; - if (id && name === id.text) { - return returnResolvedSymbol(location.symbol); - } - break; - case 168 /* CatchBlock */: - var id = location.variable; - if (name === id.text) { - return returnResolvedSymbol(location.symbol); - } - break; - } - lastLocation = location; - location = location.parent; - } - if (result = getSymbol(globals, name, meaning)) { - return returnResolvedSymbol(result); - } - return returnResolvedSymbol(undefined); - } - function resolveImport(symbol) { - ts.Debug.assert((symbol.flags & 4194304 /* Import */) !== 0, "Should only get Imports here."); - var links = getSymbolLinks(symbol); - if (!links.target) { - links.target = resolvingSymbol; - var node = getDeclarationOfKind(symbol, 179 /* ImportDeclaration */); - var target = node.externalModuleName ? resolveExternalModuleName(node, node.externalModuleName) : getSymbolOfPartOfRightHandSideOfImport(node.entityName, node); - if (links.target === resolvingSymbol) { - links.target = target || unknownSymbol; - } - else { - error(node, ts.Diagnostics.Circular_definition_of_import_alias_0, symbolToString(symbol)); - } - } - else if (links.target === resolvingSymbol) { - links.target = unknownSymbol; - } - return links.target; - } - function getSymbolOfPartOfRightHandSideOfImport(entityName, importDeclaration) { - if (!importDeclaration) { - importDeclaration = ts.getAncestor(entityName, 179 /* ImportDeclaration */); - ts.Debug.assert(importDeclaration); - } - if (entityName.kind === 59 /* Identifier */ && isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { - entityName = entityName.parent; - } - if (entityName.kind === 59 /* Identifier */ || entityName.parent.kind === 116 /* QualifiedName */) { - return resolveEntityName(importDeclaration, entityName, ts.SymbolFlags.Namespace); - } - else { - ts.Debug.assert(entityName.parent.kind === 179 /* ImportDeclaration */); - return resolveEntityName(importDeclaration, entityName, ts.SymbolFlags.Value | ts.SymbolFlags.Type | ts.SymbolFlags.Namespace); - } - } - function getFullyQualifiedName(symbol) { - return symbol.parent ? getFullyQualifiedName(symbol.parent) + "." + symbolToString(symbol) : symbolToString(symbol); - } - function resolveEntityName(location, name, meaning) { - if (name.kind === 59 /* Identifier */) { - var symbol = resolveName(location, name.text, meaning, ts.Diagnostics.Cannot_find_name_0, ts.identifierToString(name)); - if (!symbol) { - return; - } - } - else if (name.kind === 116 /* QualifiedName */) { - var namespace = resolveEntityName(location, name.left, ts.SymbolFlags.Namespace); - if (!namespace || namespace === unknownSymbol || name.right.kind === 115 /* Missing */) - return; - var symbol = getSymbol(namespace.exports, name.right.text, meaning); - if (!symbol) { - error(location, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(namespace), ts.identifierToString(name.right)); - return; - } - } - else { - return; - } - ts.Debug.assert((symbol.flags & 8388608 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); - return symbol.flags & meaning ? symbol : resolveImport(symbol); - } - function isExternalModuleNameRelative(moduleName) { - return moduleName.substr(0, 2) === "./" || moduleName.substr(0, 3) === "../" || moduleName.substr(0, 2) === ".\\" || moduleName.substr(0, 3) === "..\\"; - } - function resolveExternalModuleName(location, moduleLiteral) { - var searchPath = ts.getDirectoryPath(getSourceFile(location).filename); - var moduleName = moduleLiteral.text; - if (!moduleName) - return; - var isRelative = isExternalModuleNameRelative(moduleName); - if (!isRelative) { - var symbol = getSymbol(globals, '"' + moduleName + '"', 128 /* ValueModule */); - if (symbol) { - return getResolvedExportSymbol(symbol); - } - } - while (true) { - var filename = ts.normalizePath(ts.combinePaths(searchPath, moduleName)); - var sourceFile = program.getSourceFile(filename + ".ts") || program.getSourceFile(filename + ".d.ts"); - if (sourceFile || isRelative) - break; - var parentPath = ts.getDirectoryPath(searchPath); - if (parentPath === searchPath) - break; - searchPath = parentPath; - } - if (sourceFile) { - if (sourceFile.symbol) { - return getResolvedExportSymbol(sourceFile.symbol); - } - error(moduleLiteral, ts.Diagnostics.File_0_is_not_an_external_module, sourceFile.filename); - return; - } - error(moduleLiteral, ts.Diagnostics.Cannot_find_external_module_0, moduleName); - } - function getResolvedExportSymbol(moduleSymbol) { - var symbol = getExportAssignmentSymbol(moduleSymbol); - if (symbol) { - if (symbol.flags & (ts.SymbolFlags.Value | ts.SymbolFlags.Type | ts.SymbolFlags.Namespace)) { - return symbol; - } - if (symbol.flags & 4194304 /* Import */) { - return resolveImport(symbol); - } - } - return moduleSymbol; - } - function getExportAssignmentSymbol(symbol) { - checkTypeOfExportAssignmentSymbol(symbol); - var symbolLinks = getSymbolLinks(symbol); - return symbolLinks.exportAssignSymbol === unknownSymbol ? undefined : symbolLinks.exportAssignSymbol; - } - function checkTypeOfExportAssignmentSymbol(containerSymbol) { - var symbolLinks = getSymbolLinks(containerSymbol); - if (!symbolLinks.exportAssignSymbol) { - var exportInformation = collectExportInformationForSourceFileOrModule(containerSymbol); - if (exportInformation.exportAssignments.length) { - if (exportInformation.exportAssignments.length > 1) { - ts.forEach(exportInformation.exportAssignments, function (node) { return error(node, ts.Diagnostics.A_module_cannot_have_more_than_one_export_assignment); }); - } - var node = exportInformation.exportAssignments[0]; - if (exportInformation.hasExportedMember) { - error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements); - } - if (node.exportName.text) { - var meaning = ts.SymbolFlags.Value | ts.SymbolFlags.Type | ts.SymbolFlags.Namespace; - var exportSymbol = resolveName(node, node.exportName.text, meaning, ts.Diagnostics.Cannot_find_name_0, ts.identifierToString(node.exportName)); - } - } - symbolLinks.exportAssignSymbol = exportSymbol || unknownSymbol; - } - } - function collectExportInformationForSourceFileOrModule(symbol) { - var seenExportedMember = false; - var result = []; - ts.forEach(symbol.declarations, function (declaration) { - var block = (declaration.kind === 182 /* SourceFile */ ? declaration : declaration.body); - ts.forEach(block.statements, function (node) { - if (node.kind === 180 /* ExportAssignment */) { - result.push(node); - } - else { - seenExportedMember = seenExportedMember || (node.flags & 1 /* Export */) !== 0; - } - }); - }); - return { - hasExportedMember: seenExportedMember, - exportAssignments: result - }; - } - function getMergedSymbol(symbol) { - var merged; - return symbol && symbol.mergeId && (merged = mergedSymbols[symbol.mergeId]) ? merged : symbol; - } - function getSymbolOfNode(node) { - return getMergedSymbol(node.symbol); - } - function getParentOfSymbol(symbol) { - return getMergedSymbol(symbol.parent); - } - function getExportSymbolOfValueSymbolIfExported(symbol) { - return symbol && (symbol.flags & 524288 /* ExportValue */) !== 0 ? getMergedSymbol(symbol.exportSymbol) : symbol; - } - function symbolIsValue(symbol) { - if (symbol.flags & ts.SymbolFlags.Value) { - return true; - } - if (symbol.flags & 4194304 /* Import */) { - return (resolveImport(symbol).flags & ts.SymbolFlags.Value) !== 0; - } - if (symbol.flags & 8388608 /* Instantiated */) { - return (getSymbolLinks(symbol).target.flags & ts.SymbolFlags.Value) !== 0; - } - return false; - } - function findConstructorDeclaration(node) { - var members = node.members; - for (var i = 0; i < members.length; i++) { - var member = members[i]; - if (member.kind === 121 /* Constructor */ && member.body) { - return member; - } - } - } - function createType(flags) { - var result = new Type(checker, flags); - result.id = typeCount++; - return result; - } - function createIntrinsicType(kind, intrinsicName) { - var type = createType(kind); - type.intrinsicName = intrinsicName; - return type; - } - function createObjectType(kind, symbol) { - var type = createType(kind); - type.symbol = symbol; - return type; - } - function isReservedMemberName(name) { - return name.charCodeAt(0) === 95 /* _ */ && name.charCodeAt(1) === 95 /* _ */ && name.charCodeAt(2) !== 95 /* _ */; - } - function getNamedMembers(members) { - var result; - for (var id in members) { - if (ts.hasProperty(members, id)) { - if (!isReservedMemberName(id)) { - if (!result) - result = []; - var symbol = members[id]; - if (symbolIsValue(symbol)) { - result.push(symbol); - } - } - } - } - return result || emptyArray; - } - function setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType) { - type.members = members; - type.properties = getNamedMembers(members); - type.callSignatures = callSignatures; - type.constructSignatures = constructSignatures; - if (stringIndexType) - type.stringIndexType = stringIndexType; - if (numberIndexType) - type.numberIndexType = numberIndexType; - return type; - } - function createAnonymousType(symbol, members, callSignatures, constructSignatures, stringIndexType, numberIndexType) { - return setObjectTypeMembers(createObjectType(16384 /* Anonymous */, symbol), members, callSignatures, constructSignatures, stringIndexType, numberIndexType); - } - function isOptionalProperty(propertySymbol) { - return propertySymbol.valueDeclaration && propertySymbol.valueDeclaration.flags & 4 /* QuestionMark */ && propertySymbol.valueDeclaration.kind !== 118 /* Parameter */; - } - function forEachSymbolTableInScope(enclosingDeclaration, callback) { - var result; - for (var location = enclosingDeclaration; location; location = location.parent) { - if (location.locals && !isGlobalSourceFile(location)) { - if (result = callback(location.locals)) { - return result; - } - } - switch (location.kind) { - case 182 /* SourceFile */: - if (!ts.isExternalModule(location)) { - break; - } - case 177 /* ModuleDeclaration */: - if (result = callback(getSymbolOfNode(location).exports)) { - return result; - } - break; - case 174 /* ClassDeclaration */: - case 175 /* InterfaceDeclaration */: - if (result = callback(getSymbolOfNode(location).members)) { - return result; - } - break; - } - } - return callback(globals); - } - function getQualifiedLeftMeaning(rightMeaning) { - return rightMeaning === ts.SymbolFlags.Value ? ts.SymbolFlags.Value : ts.SymbolFlags.Namespace; - } - function getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning, useOnlyExternalAliasing) { - function getAccessibleSymbolChainFromSymbolTable(symbols) { - function canQualifySymbol(symbolFromSymbolTable, meaning) { - if (!needsQualification(symbolFromSymbolTable, enclosingDeclaration, meaning)) { - return true; - } - var accessibleParent = getAccessibleSymbolChain(symbolFromSymbolTable.parent, enclosingDeclaration, getQualifiedLeftMeaning(meaning), useOnlyExternalAliasing); - return !!accessibleParent; - } - function isAccessible(symbolFromSymbolTable, resolvedAliasSymbol) { - if (symbol === (resolvedAliasSymbol || symbolFromSymbolTable)) { - return !ts.forEach(symbolFromSymbolTable.declarations, function (declaration) { return hasExternalModuleSymbol(declaration); }) && canQualifySymbol(symbolFromSymbolTable, meaning); - } - } - if (isAccessible(ts.lookUp(symbols, symbol.name))) { - return [symbol]; - } - return ts.forEachValue(symbols, function (symbolFromSymbolTable) { - if (symbolFromSymbolTable.flags & 4194304 /* Import */) { - if (!useOnlyExternalAliasing || ts.forEach(symbolFromSymbolTable.declarations, function (declaration) { return declaration.kind === 179 /* ImportDeclaration */ && declaration.externalModuleName; })) { - var resolvedImportedSymbol = resolveImport(symbolFromSymbolTable); - if (isAccessible(symbolFromSymbolTable, resolveImport(symbolFromSymbolTable))) { - return [symbolFromSymbolTable]; - } - var accessibleSymbolsFromExports = resolvedImportedSymbol.exports ? getAccessibleSymbolChainFromSymbolTable(resolvedImportedSymbol.exports) : undefined; - if (accessibleSymbolsFromExports && canQualifySymbol(symbolFromSymbolTable, getQualifiedLeftMeaning(meaning))) { - return [symbolFromSymbolTable].concat(accessibleSymbolsFromExports); - } - } - } - }); - } - if (symbol) { - return forEachSymbolTableInScope(enclosingDeclaration, getAccessibleSymbolChainFromSymbolTable); - } - } - function needsQualification(symbol, enclosingDeclaration, meaning) { - var qualify = false; - forEachSymbolTableInScope(enclosingDeclaration, function (symbolTable) { - if (!ts.hasProperty(symbolTable, symbol.name)) { - return false; - } - var symbolFromSymbolTable = symbolTable[symbol.name]; - if (symbolFromSymbolTable === symbol) { - return true; - } - symbolFromSymbolTable = (symbolFromSymbolTable.flags & 4194304 /* Import */) ? resolveImport(symbolFromSymbolTable) : symbolFromSymbolTable; - if (symbolFromSymbolTable.flags & meaning) { - qualify = true; - return true; - } - return false; - }); - return qualify; - } - function isSymbolAccessible(symbol, enclosingDeclaration, meaning) { - if (symbol && enclosingDeclaration && !(symbol.flags & 262144 /* TypeParameter */)) { - var initialSymbol = symbol; - var meaningToLook = meaning; - while (symbol) { - var accessibleSymbolChain = getAccessibleSymbolChain(symbol, enclosingDeclaration, meaningToLook, false); - if (accessibleSymbolChain) { - var hasAccessibleDeclarations = hasVisibleDeclarations(accessibleSymbolChain[0]); - if (!hasAccessibleDeclarations) { - return { - accessibility: 1 /* NotAccessible */, - errorSymbolName: symbolToString(initialSymbol, enclosingDeclaration, meaning), - errorModuleName: symbol !== initialSymbol ? symbolToString(symbol, enclosingDeclaration, ts.SymbolFlags.Namespace) : undefined - }; - } - return { accessibility: 0 /* Accessible */, aliasesToMakeVisible: hasAccessibleDeclarations.aliasesToMakeVisible }; - } - meaningToLook = getQualifiedLeftMeaning(meaning); - symbol = getParentOfSymbol(symbol); - } - var symbolExternalModule = ts.forEach(initialSymbol.declarations, function (declaration) { return getExternalModuleContainer(declaration); }); - if (symbolExternalModule) { - var enclosingExternalModule = getExternalModuleContainer(enclosingDeclaration); - if (symbolExternalModule !== enclosingExternalModule) { - return { - accessibility: 2 /* CannotBeNamed */, - errorSymbolName: symbolToString(initialSymbol, enclosingDeclaration, meaning), - errorModuleName: symbolToString(symbolExternalModule) - }; - } - } - return { - accessibility: 1 /* NotAccessible */, - errorSymbolName: symbolToString(initialSymbol, enclosingDeclaration, meaning) - }; - } - return { accessibility: 0 /* Accessible */ }; - function getExternalModuleContainer(declaration) { - for (; declaration; declaration = declaration.parent) { - if (hasExternalModuleSymbol(declaration)) { - return getSymbolOfNode(declaration); - } - } - } - } - function hasExternalModuleSymbol(declaration) { - return (declaration.kind === 177 /* ModuleDeclaration */ && declaration.name.kind === 7 /* StringLiteral */) || (declaration.kind === 182 /* SourceFile */ && ts.isExternalModule(declaration)); - } - function hasVisibleDeclarations(symbol) { - var aliasesToMakeVisible; - if (ts.forEach(symbol.declarations, function (declaration) { return !getIsDeclarationVisible(declaration); })) { - return undefined; - } - return { aliasesToMakeVisible: aliasesToMakeVisible }; - function getIsDeclarationVisible(declaration) { - if (!isDeclarationVisible(declaration)) { - if (declaration.kind === 179 /* ImportDeclaration */ && !(declaration.flags & 1 /* Export */) && isDeclarationVisible(declaration.parent)) { - getNodeLinks(declaration).isVisible = true; - if (aliasesToMakeVisible) { - if (!ts.contains(aliasesToMakeVisible, declaration)) { - aliasesToMakeVisible.push(declaration); - } - } - else { - aliasesToMakeVisible = [declaration]; - } - return true; - } - return false; - } - return true; - } - } - function isImportDeclarationEntityNameReferenceDeclarationVisible(entityName) { - var firstIdentifier = getFirstIdentifier(entityName); - var firstIdentifierName = ts.identifierToString(firstIdentifier); - var symbolOfNameSpace = resolveName(entityName.parent, firstIdentifier.text, ts.SymbolFlags.Namespace, ts.Diagnostics.Cannot_find_name_0, firstIdentifierName); - var hasNamespaceDeclarationsVisibile = hasVisibleDeclarations(symbolOfNameSpace); - return hasNamespaceDeclarationsVisibile ? { accessibility: 0 /* Accessible */, aliasesToMakeVisible: hasNamespaceDeclarationsVisibile.aliasesToMakeVisible } : { accessibility: 1 /* NotAccessible */, errorSymbolName: firstIdentifierName }; - } - function releaseStringWriter(writer) { - writer.clear(); - stringWriters.push(writer); - } - function writeKeyword(writer, kind) { - writer.writeKind(ts.tokenToString(kind), 5 /* keyword */); - } - function writePunctuation(writer, kind) { - writer.writeKind(ts.tokenToString(kind), 15 /* punctuation */); - } - function writeOperator(writer, kind) { - writer.writeKind(ts.tokenToString(kind), 12 /* operator */); - } - function writeSpace(writer) { - writer.writeKind(" ", 16 /* space */); - } - function symbolToString(symbol, enclosingDeclaration, meaning) { - var writer = getSingleLineStringWriter(); - writeSymbol(symbol, writer, enclosingDeclaration, meaning); - var result = writer.string(); - releaseStringWriter(writer); - return result; - } - function writeSymbol(symbol, writer, enclosingDeclaration, meaning, flags) { - var parentSymbol; - function writeSymbolName(symbol) { - if (parentSymbol) { - if (flags & 1 /* WriteTypeParametersOrArguments */) { - if (symbol.flags & 8388608 /* Instantiated */) { - writeTypeArguments(getTypeParametersOfClassOrInterface(parentSymbol), symbol.mapper, writer, enclosingDeclaration); - } - else { - writeTypeParametersOfSymbol(parentSymbol, writer, enclosingDeclaration); - } - } - writePunctuation(writer, 15 /* DotToken */); - } - parentSymbol = symbol; - if (symbol.declarations && symbol.declarations.length > 0) { - var declaration = symbol.declarations[0]; - if (declaration.name) { - writer.writeSymbol(ts.identifierToString(declaration.name), symbol); - return; - } - } - writer.writeSymbol(symbol.name, symbol); - } - writer.trackSymbol(symbol, enclosingDeclaration, meaning); - function walkSymbol(symbol, meaning) { - if (symbol) { - var accessibleSymbolChain = getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning, !!(flags & 2 /* UseOnlyExternalAliasing */)); - if (!accessibleSymbolChain || needsQualification(accessibleSymbolChain[0], enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) { - walkSymbol(getParentOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol), getQualifiedLeftMeaning(meaning)); - } - if (accessibleSymbolChain) { - for (var i = 0, n = accessibleSymbolChain.length; i < n; i++) { - writeSymbolName(accessibleSymbolChain[i]); - } - } - else { - if (!parentSymbol && ts.forEach(symbol.declarations, function (declaration) { return hasExternalModuleSymbol(declaration); })) { - return; - } - if (symbol.flags & 512 /* TypeLiteral */ || symbol.flags & 1024 /* ObjectLiteral */) { - return; - } - writeSymbolName(symbol); - } - } - } - if (enclosingDeclaration && !(symbol.flags & 262144 /* TypeParameter */)) { - walkSymbol(symbol, meaning); - return; - } - return writeSymbolName(symbol); - } - function typeToString(type, enclosingDeclaration, flags) { - var writer = getSingleLineStringWriter(); - writeType(type, writer, enclosingDeclaration, flags); - var result = writer.string(); - releaseStringWriter(writer); - var maxLength = compilerOptions.noErrorTruncation || flags & 4 /* NoTruncation */ ? undefined : 100; - if (maxLength && result.length >= maxLength) { - result = result.substr(0, maxLength - "...".length) + "..."; - } - return result; - } - function writeType(type, writer, enclosingDeclaration, flags, typeStack) { - return writeType(type, flags | 8 /* WriteArrowStyleSignature */); - function writeType(type, flags) { - if (type.flags & ts.TypeFlags.Intrinsic) { - writer.writeKind(!(flags & 16 /* WriteOwnNameForAnyLike */) && (type.flags & 1 /* Any */) ? "any" : type.intrinsicName, 5 /* keyword */); - } - else if (type.flags & 4096 /* Reference */) { - writeTypeReference(type); - } - else if (type.flags & (1024 /* Class */ | 2048 /* Interface */ | 128 /* Enum */ | 512 /* TypeParameter */)) { - writeSymbol(type.symbol, writer, enclosingDeclaration, ts.SymbolFlags.Type); - } - else if (type.flags & 8192 /* Tuple */) { - writeTupleType(type); - } - else if (type.flags & 16384 /* Anonymous */) { - writeAnonymousType(type, flags); - } - else if (type.flags & 256 /* StringLiteral */) { - writer.writeKind(type.text, 8 /* stringLiteral */); - } - else { - writePunctuation(writer, 9 /* OpenBraceToken */); - writeSpace(writer); - writePunctuation(writer, 16 /* DotDotDotToken */); - writeSpace(writer); - writePunctuation(writer, 10 /* CloseBraceToken */); - } - } - function writeTypeList(types) { - for (var i = 0; i < types.length; i++) { - if (i > 0) { - writePunctuation(writer, 18 /* CommaToken */); - writeSpace(writer); - } - writeType(types[i], flags | 8 /* WriteArrowStyleSignature */); - } - } - function writeTypeReference(type) { - if (type.target === globalArrayType && !(flags & 1 /* WriteArrayAsGenericType */)) { - writeType(type.typeArguments[0], flags & ~8 /* WriteArrowStyleSignature */); - writePunctuation(writer, 13 /* OpenBracketToken */); - writePunctuation(writer, 14 /* CloseBracketToken */); - } - else { - writeSymbol(type.target.symbol, writer, enclosingDeclaration, ts.SymbolFlags.Type); - writePunctuation(writer, 19 /* LessThanToken */); - writeTypeList(type.typeArguments); - writePunctuation(writer, 20 /* GreaterThanToken */); - } - } - function writeTupleType(type) { - writePunctuation(writer, 13 /* OpenBracketToken */); - writeTypeList(type.elementTypes); - writePunctuation(writer, 14 /* CloseBracketToken */); - } - function writeAnonymousType(type, flags) { - if (type.symbol && type.symbol.flags & (16 /* Class */ | 64 /* Enum */ | 128 /* ValueModule */)) { - writeTypeofSymbol(type); - } - else if (shouldWriteTypeOfFunctionSymbol()) { - writeTypeofSymbol(type); - } - else if (typeStack && ts.contains(typeStack, type)) { - writeKeyword(writer, 105 /* AnyKeyword */); - } - else { - if (!typeStack) { - typeStack = []; - } - typeStack.push(type); - writeLiteralType(type, flags); - typeStack.pop(); - } - function shouldWriteTypeOfFunctionSymbol() { - if (type.symbol) { - var isStaticMethodSymbol = !!(type.symbol.flags & 2048 /* Method */ && ts.forEach(type.symbol.declarations, function (declaration) { return declaration.flags & 128 /* Static */; })); - var isNonLocalFunctionSymbol = !!(type.symbol.flags & 8 /* Function */) && (type.symbol.parent || ts.forEach(type.symbol.declarations, function (declaration) { return declaration.parent.kind === 182 /* SourceFile */ || declaration.parent.kind === 178 /* ModuleBlock */; })); - if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { - return !!(flags & 2 /* UseTypeOfFunction */) || (typeStack && ts.contains(typeStack, type)); - } - } - } - } - function writeTypeofSymbol(type) { - writeKeyword(writer, 91 /* TypeOfKeyword */); - writeSpace(writer); - writeSymbol(type.symbol, writer, enclosingDeclaration, ts.SymbolFlags.Value); - } - function writeLiteralType(type, flags) { - var resolved = resolveObjectTypeMembers(type); - if (!resolved.properties.length && !resolved.stringIndexType && !resolved.numberIndexType) { - if (!resolved.callSignatures.length && !resolved.constructSignatures.length) { - writePunctuation(writer, 9 /* OpenBraceToken */); - writePunctuation(writer, 10 /* CloseBraceToken */); - return; - } - if (flags & 8 /* WriteArrowStyleSignature */) { - if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { - writeSignature(resolved.callSignatures[0], writer, enclosingDeclaration, flags, typeStack); - return; - } - if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { - writeKeyword(writer, 82 /* NewKeyword */); - writeSpace(writer); - writeSignature(resolved.constructSignatures[0], writer, enclosingDeclaration, flags, typeStack); - return; - } - } - } - writePunctuation(writer, 9 /* OpenBraceToken */); - writer.writeLine(); - writer.increaseIndent(); - for (var i = 0; i < resolved.callSignatures.length; i++) { - writeSignature(resolved.callSignatures[i], writer, enclosingDeclaration, flags & ~8 /* WriteArrowStyleSignature */, typeStack); - writePunctuation(writer, 17 /* SemicolonToken */); - writer.writeLine(); - } - for (var i = 0; i < resolved.constructSignatures.length; i++) { - writeKeyword(writer, 82 /* NewKeyword */); - writeSpace(writer); - writeSignature(resolved.constructSignatures[i], writer, enclosingDeclaration, flags & ~8 /* WriteArrowStyleSignature */, typeStack); - writePunctuation(writer, 17 /* SemicolonToken */); - writer.writeLine(); - } - if (resolved.stringIndexType) { - writePunctuation(writer, 13 /* OpenBracketToken */); - writer.writeKind("x", 13 /* parameterName */); - writePunctuation(writer, 46 /* ColonToken */); - writeSpace(writer); - writeKeyword(writer, 114 /* StringKeyword */); - writePunctuation(writer, 14 /* CloseBracketToken */); - writePunctuation(writer, 46 /* ColonToken */); - writeSpace(writer); - writeType(resolved.stringIndexType, flags | 8 /* WriteArrowStyleSignature */); - writePunctuation(writer, 17 /* SemicolonToken */); - writer.writeLine(); - } - if (resolved.numberIndexType) { - writePunctuation(writer, 13 /* OpenBracketToken */); - writer.writeKind("x", 13 /* parameterName */); - writePunctuation(writer, 46 /* ColonToken */); - writeSpace(writer); - writeKeyword(writer, 112 /* NumberKeyword */); - writePunctuation(writer, 14 /* CloseBracketToken */); - writePunctuation(writer, 46 /* ColonToken */); - writeSpace(writer); - writeType(resolved.numberIndexType, flags | 8 /* WriteArrowStyleSignature */); - writePunctuation(writer, 17 /* SemicolonToken */); - writer.writeLine(); - } - for (var i = 0; i < resolved.properties.length; i++) { - var p = resolved.properties[i]; - var t = getTypeOfSymbol(p); - if (p.flags & (8 /* Function */ | 2048 /* Method */) && !getPropertiesOfType(t).length) { - var signatures = getSignaturesOfType(t, 0 /* Call */); - for (var j = 0; j < signatures.length; j++) { - writeSymbol(p, writer); - if (isOptionalProperty(p)) { - writePunctuation(writer, 45 /* QuestionToken */); - } - writeSignature(signatures[j], writer, enclosingDeclaration, flags & ~8 /* WriteArrowStyleSignature */, typeStack); - writePunctuation(writer, 17 /* SemicolonToken */); - writer.writeLine(); - } - } - else { - writeSymbol(p, writer); - if (isOptionalProperty(p)) { - writePunctuation(writer, 45 /* QuestionToken */); - } - writePunctuation(writer, 46 /* ColonToken */); - writeSpace(writer); - writeType(t, flags | 8 /* WriteArrowStyleSignature */); - writePunctuation(writer, 17 /* SemicolonToken */); - writer.writeLine(); - } - } - writer.decreaseIndent(); - writePunctuation(writer, 10 /* CloseBraceToken */); - } - } - function writeTypeParameter(tp, writer, enclosingDeclaration, flags, typeStack) { - writeSymbol(tp.symbol, writer); - var constraint = getConstraintOfTypeParameter(tp); - if (constraint) { - writeSpace(writer); - writeKeyword(writer, 73 /* ExtendsKeyword */); - writeSpace(writer); - writeType(constraint, writer, enclosingDeclaration, flags, typeStack); - } - } - function writeTypeParameters(typeParameters, writer, enclosingDeclaration, flags, typeStack) { - if (typeParameters && typeParameters.length) { - writePunctuation(writer, 19 /* LessThanToken */); - for (var i = 0; i < typeParameters.length; i++) { - if (i > 0) { - writePunctuation(writer, 18 /* CommaToken */); - writeSpace(writer); - } - writeTypeParameter(typeParameters[i], writer, enclosingDeclaration, flags, typeStack); - } - writePunctuation(writer, 20 /* GreaterThanToken */); - } - } - function writeTypeArguments(typeParameters, mapper, writer, enclosingDeclaration, flags, typeStack) { - if (typeParameters && typeParameters.length) { - writePunctuation(writer, 19 /* LessThanToken */); - for (var i = 0; i < typeParameters.length; i++) { - if (i > 0) { - writePunctuation(writer, 18 /* CommaToken */); - writeSpace(writer); - } - writeType(mapper(typeParameters[i]), writer, enclosingDeclaration, 8 /* WriteArrowStyleSignature */); - } - writePunctuation(writer, 20 /* GreaterThanToken */); - } - } - function writeTypeParametersOfSymbol(symbol, writer, enclosingDeclaraiton, flags) { - var rootSymbol = getRootSymbol(symbol); - if (rootSymbol.flags & 16 /* Class */ || rootSymbol.flags & 32 /* Interface */) { - writeTypeParameters(getTypeParametersOfClassOrInterface(symbol), writer, enclosingDeclaraiton, flags); - } - } - function writeSignature(signature, writer, enclosingDeclaration, flags, typeStack) { - if (signature.target && (flags & 32 /* WriteTypeArgumentsOfSignature */)) { - writeTypeArguments(signature.target.typeParameters, signature.mapper, writer, enclosingDeclaration); - } - else { - writeTypeParameters(signature.typeParameters, writer, enclosingDeclaration, flags, typeStack); - } - writePunctuation(writer, 11 /* OpenParenToken */); - for (var i = 0; i < signature.parameters.length; i++) { - if (i > 0) { - writePunctuation(writer, 18 /* CommaToken */); - writeSpace(writer); - } - var p = signature.parameters[i]; - if (getDeclarationFlagsFromSymbol(p) & 8 /* Rest */) { - writePunctuation(writer, 16 /* DotDotDotToken */); - } - writeSymbol(p, writer); - if (p.valueDeclaration.flags & 4 /* QuestionMark */ || p.valueDeclaration.initializer) { - writePunctuation(writer, 45 /* QuestionToken */); - } - writePunctuation(writer, 46 /* ColonToken */); - writeSpace(writer); - writeType(getTypeOfSymbol(p), writer, enclosingDeclaration, flags, typeStack); - } - writePunctuation(writer, 12 /* CloseParenToken */); - if (flags & 8 /* WriteArrowStyleSignature */) { - writeSpace(writer); - writePunctuation(writer, 27 /* EqualsGreaterThanToken */); - } - else { - writePunctuation(writer, 46 /* ColonToken */); - } - writeSpace(writer); - writeType(getReturnTypeOfSignature(signature), writer, enclosingDeclaration, flags, typeStack); - } - function isDeclarationVisible(node) { - function getContainingExternalModule(node) { - for (; node; node = node.parent) { - if (node.kind === 177 /* ModuleDeclaration */) { - if (node.name.kind === 7 /* StringLiteral */) { - return node; - } - } - else if (node.kind === 182 /* SourceFile */) { - return ts.isExternalModule(node) ? node : undefined; - } - } - ts.Debug.fail("getContainingModule cant reach here"); - } - function isUsedInExportAssignment(node) { - var externalModule = getContainingExternalModule(node); - if (externalModule) { - var externalModuleSymbol = getSymbolOfNode(externalModule); - var exportAssignmentSymbol = getExportAssignmentSymbol(externalModuleSymbol); - var resolvedExportSymbol; - var symbolOfNode = getSymbolOfNode(node); - if (isSymbolUsedInExportAssignment(symbolOfNode)) { - return true; - } - if (symbolOfNode.flags & 4194304 /* Import */) { - return isSymbolUsedInExportAssignment(resolveImport(symbolOfNode)); - } - } - function isSymbolUsedInExportAssignment(symbol) { - if (exportAssignmentSymbol === symbol) { - return true; - } - if (exportAssignmentSymbol && !!(exportAssignmentSymbol.flags & 4194304 /* Import */)) { - resolvedExportSymbol = resolvedExportSymbol || resolveImport(exportAssignmentSymbol); - if (resolvedExportSymbol === symbol) { - return true; - } - return ts.forEach(resolvedExportSymbol.declarations, function (declaration) { - while (declaration) { - if (declaration === node) { - return true; - } - declaration = declaration.parent; - } - }); - } - } - } - function determineIfDeclarationIsVisible() { - switch (node.kind) { - case 171 /* VariableDeclaration */: - case 177 /* ModuleDeclaration */: - case 174 /* ClassDeclaration */: - case 175 /* InterfaceDeclaration */: - case 172 /* FunctionDeclaration */: - case 176 /* EnumDeclaration */: - case 179 /* ImportDeclaration */: - var parent = node.kind === 171 /* VariableDeclaration */ ? node.parent.parent : node.parent; - if (!(node.flags & 1 /* Export */) && !(node.kind !== 179 /* ImportDeclaration */ && parent.kind !== 182 /* SourceFile */ && ts.isInAmbientContext(parent))) { - return isGlobalSourceFile(parent) || isUsedInExportAssignment(node); - } - return isDeclarationVisible(parent); - case 119 /* Property */: - case 120 /* Method */: - if (node.flags & (32 /* Private */ | 64 /* Protected */)) { - return false; - } - case 121 /* Constructor */: - case 125 /* ConstructSignature */: - case 124 /* CallSignature */: - case 126 /* IndexSignature */: - case 118 /* Parameter */: - case 178 /* ModuleBlock */: - return isDeclarationVisible(node.parent); - case 182 /* SourceFile */: - return true; - default: - ts.Debug.fail("isDeclarationVisible unknown: SyntaxKind: " + ts.SyntaxKind[node.kind]); - } - } - if (node) { - var links = getNodeLinks(node); - if (links.isVisible === undefined) { - links.isVisible = !!determineIfDeclarationIsVisible(); - } - return links.isVisible; - } - } - function getApparentType(type) { - if (type.flags & 512 /* TypeParameter */) { - do { - type = getConstraintOfTypeParameter(type); - } while (type && type.flags & 512 /* TypeParameter */); - if (!type) - type = emptyObjectType; - } - if (type.flags & ts.TypeFlags.StringLike) { - type = globalStringType; - } - else if (type.flags & ts.TypeFlags.NumberLike) { - type = globalNumberType; - } - else if (type.flags & 8 /* Boolean */) { - type = globalBooleanType; - } - return type; - } - function getTypeOfPrototypeProperty(prototype) { - var classType = getDeclaredTypeOfSymbol(prototype.parent); - return classType.typeParameters ? createTypeReference(classType, ts.map(classType.typeParameters, function (_) { return anyType; })) : classType; - } - function getTypeOfVariableDeclaration(declaration) { - if (declaration.parent.kind === 156 /* ForInStatement */) { - return anyType; - } - if (declaration.type) { - return getTypeFromTypeNode(declaration.type); - } - if (declaration.kind === 118 /* Parameter */) { - var func = declaration.parent; - if (func.kind === 123 /* SetAccessor */) { - var getter = getDeclarationOfKind(declaration.parent.symbol, 122 /* GetAccessor */); - if (getter) { - return getReturnTypeOfSignature(getSignatureFromDeclaration(getter)); - } - } - var type = getContextuallyTypedParameterType(declaration); - if (type) { - return type; - } - } - if (declaration.initializer) { - var type = checkAndMarkExpression(declaration.initializer); - if (declaration.kind !== 134 /* PropertyAssignment */) { - var unwidenedType = type; - type = getWidenedType(type); - if (type !== unwidenedType) { - checkImplicitAny(type); - } - } - return type; - } - var type = declaration.flags & 8 /* Rest */ ? createArrayType(anyType) : anyType; - checkImplicitAny(type); - return type; - function checkImplicitAny(type) { - if (!fullTypeCheck || !compilerOptions.noImplicitAny) { - return; - } - if (getInnermostTypeOfNestedArrayTypes(type) !== anyType) { - return; - } - if (isPrivateWithinAmbient(declaration) || (declaration.kind === 118 /* Parameter */ && isPrivateWithinAmbient(declaration.parent))) { - return; - } - switch (declaration.kind) { - case 119 /* Property */: - var diagnostic = ts.Diagnostics.Member_0_implicitly_has_an_1_type; - break; - case 118 /* Parameter */: - var diagnostic = declaration.flags & 8 /* Rest */ ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type; - break; - default: - var diagnostic = ts.Diagnostics.Variable_0_implicitly_has_an_1_type; - } - error(declaration, diagnostic, ts.identifierToString(declaration.name), typeToString(type)); - } - } - function getTypeOfVariableOrParameterOrProperty(symbol) { - var links = getSymbolLinks(symbol); - if (!links.type) { - if (symbol.flags & 67108864 /* Prototype */) { - return links.type = getTypeOfPrototypeProperty(symbol); - } - var declaration = symbol.valueDeclaration; - if (declaration.kind === 168 /* CatchBlock */) { - return links.type = anyType; - } - links.type = resolvingType; - var type = getTypeOfVariableDeclaration(declaration); - if (links.type === resolvingType) { - links.type = type; - } - } - else if (links.type === resolvingType) { - links.type = anyType; - if (compilerOptions.noImplicitAny) { - var diagnostic = symbol.valueDeclaration.type ? ts.Diagnostics._0_implicitly_has_type_any_because_it_is_referenced_directly_or_indirectly_in_its_own_type_annotation : ts.Diagnostics._0_implicitly_has_type_any_because_it_is_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer; - error(symbol.valueDeclaration, diagnostic, symbolToString(symbol)); - } - } - return links.type; - } - function getSetAccessorTypeAnnotationNode(accessor) { - return accessor && accessor.parameters.length > 0 && accessor.parameters[0].type; - } - function getAnnotatedAccessorType(accessor) { - if (accessor) { - if (accessor.kind === 122 /* GetAccessor */) { - return accessor.type && getTypeFromTypeNode(accessor.type); - } - else { - var setterTypeAnnotation = getSetAccessorTypeAnnotationNode(accessor); - return setterTypeAnnotation && getTypeFromTypeNode(setterTypeAnnotation); - } - } - return undefined; - } - function getTypeOfAccessors(symbol) { - var links = getSymbolLinks(symbol); - checkAndStoreTypeOfAccessors(symbol, links); - return links.type; - } - function checkAndStoreTypeOfAccessors(symbol, links) { - links = links || getSymbolLinks(symbol); - if (!links.type) { - links.type = resolvingType; - var getter = getDeclarationOfKind(symbol, 122 /* GetAccessor */); - var setter = getDeclarationOfKind(symbol, 123 /* SetAccessor */); - var type; - var getterReturnType = getAnnotatedAccessorType(getter); - if (getterReturnType) { - type = getterReturnType; - } - else { - var setterParameterType = getAnnotatedAccessorType(setter); - if (setterParameterType) { - type = setterParameterType; - } - else { - if (getter) { - type = getReturnTypeFromBody(getter); - } - else { - if (compilerOptions.noImplicitAny) { - error(setter, ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_type_annotation, symbolToString(symbol)); - } - type = anyType; - } - } - } - if (links.type === resolvingType) { - links.type = type; - } - } - else if (links.type === resolvingType) { - links.type = anyType; - if (compilerOptions.noImplicitAny) { - var getter = getDeclarationOfKind(symbol, 122 /* GetAccessor */); - error(getter, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol)); - } - } - } - function getTypeOfFuncClassEnumModule(symbol) { - var links = getSymbolLinks(symbol); - if (!links.type) { - links.type = createObjectType(16384 /* Anonymous */, symbol); - } - return links.type; - } - function getTypeOfEnumMember(symbol) { - var links = getSymbolLinks(symbol); - if (!links.type) { - links.type = getDeclaredTypeOfEnum(getParentOfSymbol(symbol)); - } - return links.type; - } - function getTypeOfImport(symbol) { - var links = getSymbolLinks(symbol); - if (!links.type) { - links.type = getTypeOfSymbol(resolveImport(symbol)); - } - return links.type; - } - function getTypeOfInstantiatedSymbol(symbol) { - var links = getSymbolLinks(symbol); - if (!links.type) { - links.type = instantiateType(getTypeOfSymbol(links.target), links.mapper); - } - return links.type; - } - function getTypeOfSymbol(symbol) { - if (symbol.flags & (1 /* Variable */ | 2 /* Property */)) { - return getTypeOfVariableOrParameterOrProperty(symbol); - } - if (symbol.flags & (8 /* Function */ | 2048 /* Method */ | 16 /* Class */ | 64 /* Enum */ | 128 /* ValueModule */)) { - return getTypeOfFuncClassEnumModule(symbol); - } - if (symbol.flags & 4 /* EnumMember */) { - return getTypeOfEnumMember(symbol); - } - if (symbol.flags & ts.SymbolFlags.Accessor) { - return getTypeOfAccessors(symbol); - } - if (symbol.flags & 4194304 /* Import */) { - return getTypeOfImport(symbol); - } - if (symbol.flags & 8388608 /* Instantiated */) { - return getTypeOfInstantiatedSymbol(symbol); - } - return unknownType; - } - function getTargetType(type) { - return type.flags & 4096 /* Reference */ ? type.target : type; - } - function hasBaseType(type, checkBase) { - return check(type); - function check(type) { - var target = getTargetType(type); - return target === checkBase || ts.forEach(target.baseTypes, check); - } - } - function getTypeParametersOfClassOrInterface(symbol) { - var result; - ts.forEach(symbol.declarations, function (node) { - if (node.kind === 175 /* InterfaceDeclaration */ || node.kind === 174 /* ClassDeclaration */) { - var declaration = node; - if (declaration.typeParameters && declaration.typeParameters.length) { - ts.forEach(declaration.typeParameters, function (node) { - var tp = getDeclaredTypeOfTypeParameter(getSymbolOfNode(node)); - if (!result) { - result = [tp]; - } - else if (!ts.contains(result, tp)) { - result.push(tp); - } - }); - } - } - }); - return result; - } - function getDeclaredTypeOfClass(symbol) { - var links = getSymbolLinks(symbol); - if (!links.declaredType) { - var type = links.declaredType = createObjectType(1024 /* Class */, symbol); - var typeParameters = getTypeParametersOfClassOrInterface(symbol); - if (typeParameters) { - type.flags |= 4096 /* Reference */; - type.typeParameters = typeParameters; - type.instantiations = {}; - type.instantiations[getTypeListId(type.typeParameters)] = type; - type.target = type; - type.typeArguments = type.typeParameters; - } - type.baseTypes = []; - var declaration = getDeclarationOfKind(symbol, 174 /* ClassDeclaration */); - if (declaration.baseType) { - var baseType = getTypeFromTypeReferenceNode(declaration.baseType); - if (baseType !== unknownType) { - if (getTargetType(baseType).flags & 1024 /* Class */) { - if (type !== baseType && !hasBaseType(baseType, type)) { - type.baseTypes.push(baseType); - } - else { - error(declaration, ts.Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, undefined, 1 /* WriteArrayAsGenericType */)); - } - } - else { - error(declaration.baseType, ts.Diagnostics.A_class_may_only_extend_another_class); - } - } - } - type.declaredProperties = getNamedMembers(symbol.members); - type.declaredCallSignatures = emptyArray; - type.declaredConstructSignatures = emptyArray; - type.declaredStringIndexType = getIndexTypeOfSymbol(symbol, 0 /* String */); - type.declaredNumberIndexType = getIndexTypeOfSymbol(symbol, 1 /* Number */); - } - return links.declaredType; - } - function getDeclaredTypeOfInterface(symbol) { - var links = getSymbolLinks(symbol); - if (!links.declaredType) { - var type = links.declaredType = createObjectType(2048 /* Interface */, symbol); - var typeParameters = getTypeParametersOfClassOrInterface(symbol); - if (typeParameters) { - type.flags |= 4096 /* Reference */; - type.typeParameters = typeParameters; - type.instantiations = {}; - type.instantiations[getTypeListId(type.typeParameters)] = type; - type.target = type; - type.typeArguments = type.typeParameters; - } - type.baseTypes = []; - ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 175 /* InterfaceDeclaration */ && declaration.baseTypes) { - ts.forEach(declaration.baseTypes, function (node) { - var baseType = getTypeFromTypeReferenceNode(node); - if (baseType !== unknownType) { - if (getTargetType(baseType).flags & (1024 /* Class */ | 2048 /* Interface */)) { - if (type !== baseType && !hasBaseType(baseType, type)) { - type.baseTypes.push(baseType); - } - else { - error(declaration, ts.Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, undefined, 1 /* WriteArrayAsGenericType */)); - } - } - else { - error(node, ts.Diagnostics.An_interface_may_only_extend_a_class_or_another_interface); - } - } - }); - } - }); - type.declaredProperties = getNamedMembers(symbol.members); - type.declaredCallSignatures = getSignaturesOfSymbol(symbol.members["__call"]); - type.declaredConstructSignatures = getSignaturesOfSymbol(symbol.members["__new"]); - type.declaredStringIndexType = getIndexTypeOfSymbol(symbol, 0 /* String */); - type.declaredNumberIndexType = getIndexTypeOfSymbol(symbol, 1 /* Number */); - } - return links.declaredType; - } - function getDeclaredTypeOfEnum(symbol) { - var links = getSymbolLinks(symbol); - if (!links.declaredType) { - var type = createType(128 /* Enum */); - type.symbol = symbol; - links.declaredType = type; - } - return links.declaredType; - } - function getDeclaredTypeOfTypeParameter(symbol) { - var links = getSymbolLinks(symbol); - if (!links.declaredType) { - var type = createType(512 /* TypeParameter */); - type.symbol = symbol; - if (!getDeclarationOfKind(symbol, 117 /* TypeParameter */).constraint) { - type.constraint = noConstraintType; - } - links.declaredType = type; - } - return links.declaredType; - } - function getDeclaredTypeOfImport(symbol) { - var links = getSymbolLinks(symbol); - if (!links.declaredType) { - links.declaredType = getDeclaredTypeOfSymbol(resolveImport(symbol)); - } - return links.declaredType; - } - function getDeclaredTypeOfSymbol(symbol) { - if (symbol.flags & 16 /* Class */) { - return getDeclaredTypeOfClass(symbol); - } - if (symbol.flags & 32 /* Interface */) { - return getDeclaredTypeOfInterface(symbol); - } - if (symbol.flags & 64 /* Enum */) { - return getDeclaredTypeOfEnum(symbol); - } - if (symbol.flags & 262144 /* TypeParameter */) { - return getDeclaredTypeOfTypeParameter(symbol); - } - if (symbol.flags & 4194304 /* Import */) { - return getDeclaredTypeOfImport(symbol); - } - ts.Debug.assert((symbol.flags & 8388608 /* Instantiated */) === 0); - return unknownType; - } - function createSymbolTable(symbols) { - var result = {}; - for (var i = 0; i < symbols.length; i++) { - var symbol = symbols[i]; - result[symbol.name] = symbol; - } - return result; - } - function createInstantiatedSymbolTable(symbols, mapper) { - var result = {}; - for (var i = 0; i < symbols.length; i++) { - var symbol = symbols[i]; - result[symbol.name] = instantiateSymbol(symbol, mapper); - } - return result; - } - function addInheritedMembers(symbols, baseSymbols) { - for (var i = 0; i < baseSymbols.length; i++) { - var s = baseSymbols[i]; - if (!ts.hasProperty(symbols, s.name)) { - symbols[s.name] = s; - } - } - } - function addInheritedSignatures(signatures, baseSignatures) { - if (baseSignatures) { - for (var i = 0; i < baseSignatures.length; i++) { - signatures.push(baseSignatures[i]); - } - } - } - function resolveClassOrInterfaceMembers(type) { - var members = type.symbol.members; - var callSignatures = type.declaredCallSignatures; - var constructSignatures = type.declaredConstructSignatures; - var stringIndexType = type.declaredStringIndexType; - var numberIndexType = type.declaredNumberIndexType; - if (type.baseTypes.length) { - members = createSymbolTable(type.declaredProperties); - ts.forEach(type.baseTypes, function (baseType) { - addInheritedMembers(members, getPropertiesOfType(baseType)); - callSignatures = ts.concatenate(callSignatures, getSignaturesOfType(baseType, 0 /* Call */)); - constructSignatures = ts.concatenate(constructSignatures, getSignaturesOfType(baseType, 1 /* Construct */)); - stringIndexType = stringIndexType || getIndexTypeOfType(baseType, 0 /* String */); - numberIndexType = numberIndexType || getIndexTypeOfType(baseType, 1 /* Number */); - }); - } - setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); - } - function resolveTypeReferenceMembers(type) { - var target = type.target; - var mapper = createTypeMapper(target.typeParameters, type.typeArguments); - var members = createInstantiatedSymbolTable(target.declaredProperties, mapper); - var callSignatures = instantiateList(target.declaredCallSignatures, mapper, instantiateSignature); - var constructSignatures = instantiateList(target.declaredConstructSignatures, mapper, instantiateSignature); - var stringIndexType = target.declaredStringIndexType ? instantiateType(target.declaredStringIndexType, mapper) : undefined; - var numberIndexType = target.declaredNumberIndexType ? instantiateType(target.declaredNumberIndexType, mapper) : undefined; - ts.forEach(target.baseTypes, function (baseType) { - var instantiatedBaseType = instantiateType(baseType, mapper); - addInheritedMembers(members, getPropertiesOfType(instantiatedBaseType)); - callSignatures = ts.concatenate(callSignatures, getSignaturesOfType(instantiatedBaseType, 0 /* Call */)); - constructSignatures = ts.concatenate(constructSignatures, getSignaturesOfType(instantiatedBaseType, 1 /* Construct */)); - stringIndexType = stringIndexType || getIndexTypeOfType(instantiatedBaseType, 0 /* String */); - numberIndexType = numberIndexType || getIndexTypeOfType(instantiatedBaseType, 1 /* Number */); - }); - setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); - } - function createSignature(declaration, typeParameters, parameters, resolvedReturnType, minArgumentCount, hasRestParameter, hasStringLiterals) { - var sig = new Signature(checker); - sig.declaration = declaration; - sig.typeParameters = typeParameters; - sig.parameters = parameters; - sig.resolvedReturnType = resolvedReturnType; - sig.minArgumentCount = minArgumentCount; - sig.hasRestParameter = hasRestParameter; - sig.hasStringLiterals = hasStringLiterals; - return sig; - } - function cloneSignature(sig) { - return createSignature(sig.declaration, sig.typeParameters, sig.parameters, sig.resolvedReturnType, sig.minArgumentCount, sig.hasRestParameter, sig.hasStringLiterals); - } - function getDefaultConstructSignatures(classType) { - if (classType.baseTypes.length) { - var baseType = classType.baseTypes[0]; - var baseSignatures = getSignaturesOfType(getTypeOfSymbol(baseType.symbol), 1 /* Construct */); - return ts.map(baseSignatures, function (baseSignature) { - var signature = baseType.flags & 4096 /* Reference */ ? getSignatureInstantiation(baseSignature, baseType.typeArguments) : cloneSignature(baseSignature); - signature.typeParameters = classType.typeParameters; - signature.resolvedReturnType = classType; - return signature; - }); - } - return [createSignature(undefined, classType.typeParameters, emptyArray, classType, 0, false, false)]; - } - function createTupleTypeMemberSymbols(memberTypes) { - var members = {}; - for (var i = 0; i < memberTypes.length; i++) { - var symbol = createSymbol(2 /* Property */ | 33554432 /* Transient */, "" + i); - symbol.type = memberTypes[i]; - members[i] = symbol; - } - return members; - } - function resolveTupleTypeMembers(type) { - var arrayType = resolveObjectTypeMembers(createArrayType(getBestCommonType(type.elementTypes))); - var members = createTupleTypeMemberSymbols(type.elementTypes); - addInheritedMembers(members, arrayType.properties); - setObjectTypeMembers(type, members, arrayType.callSignatures, arrayType.constructSignatures, arrayType.stringIndexType, arrayType.numberIndexType); - } - function resolveAnonymousTypeMembers(type) { - var symbol = type.symbol; - if (symbol.flags & 512 /* TypeLiteral */) { - var members = symbol.members; - var callSignatures = getSignaturesOfSymbol(members["__call"]); - var constructSignatures = getSignaturesOfSymbol(members["__new"]); - var stringIndexType = getIndexTypeOfSymbol(symbol, 0 /* String */); - var numberIndexType = getIndexTypeOfSymbol(symbol, 1 /* Number */); - } - else { - var members = emptySymbols; - var callSignatures = emptyArray; - var constructSignatures = emptyArray; - if (symbol.flags & ts.SymbolFlags.HasExports) { - members = symbol.exports; - } - if (symbol.flags & (8 /* Function */ | 2048 /* Method */)) { - callSignatures = getSignaturesOfSymbol(symbol); - } - if (symbol.flags & 16 /* Class */) { - var classType = getDeclaredTypeOfClass(symbol); - constructSignatures = getSignaturesOfSymbol(symbol.members["__constructor"]); - if (!constructSignatures.length) { - constructSignatures = getDefaultConstructSignatures(classType); - } - if (classType.baseTypes.length) { - members = createSymbolTable(getNamedMembers(members)); - addInheritedMembers(members, getPropertiesOfType(getTypeOfSymbol(classType.baseTypes[0].symbol))); - } - } - var stringIndexType = undefined; - var numberIndexType = (symbol.flags & 64 /* Enum */) ? stringType : undefined; - } - setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); - } - function resolveObjectTypeMembers(type) { - if (!type.members) { - if (type.flags & (1024 /* Class */ | 2048 /* Interface */)) { - resolveClassOrInterfaceMembers(type); - } - else if (type.flags & 16384 /* Anonymous */) { - resolveAnonymousTypeMembers(type); - } - else if (type.flags & 8192 /* Tuple */) { - resolveTupleTypeMembers(type); - } - else { - resolveTypeReferenceMembers(type); - } - } - return type; - } - function getPropertiesOfType(type) { - if (type.flags & ts.TypeFlags.ObjectType) { - return resolveObjectTypeMembers(type).properties; - } - return emptyArray; - } - function getPropertyOfType(type, name) { - if (type.flags & ts.TypeFlags.ObjectType) { - var resolved = resolveObjectTypeMembers(type); - if (ts.hasProperty(resolved.members, name)) { - var symbol = resolved.members[name]; - if (symbolIsValue(symbol)) { - return symbol; - } - } - } - } - function getPropertyOfApparentType(type, name) { - if (type.flags & ts.TypeFlags.ObjectType) { - var resolved = resolveObjectTypeMembers(type); - if (ts.hasProperty(resolved.members, name)) { - var symbol = resolved.members[name]; - if (symbolIsValue(symbol)) { - return symbol; - } - } - if (resolved === anyFunctionType || resolved.callSignatures.length || resolved.constructSignatures.length) { - var symbol = getPropertyOfType(globalFunctionType, name); - if (symbol) - return symbol; - } - return getPropertyOfType(globalObjectType, name); - } - } - function getSignaturesOfType(type, kind) { - if (type.flags & ts.TypeFlags.ObjectType) { - var resolved = resolveObjectTypeMembers(type); - return kind === 0 /* Call */ ? resolved.callSignatures : resolved.constructSignatures; - } - return emptyArray; - } - function getIndexTypeOfType(type, kind) { - if (type.flags & ts.TypeFlags.ObjectType) { - var resolved = resolveObjectTypeMembers(type); - return kind === 0 /* String */ ? resolved.stringIndexType : resolved.numberIndexType; - } - } - function getTypeParametersFromDeclaration(typeParameterDeclarations) { - var result = []; - ts.forEach(typeParameterDeclarations, function (node) { - var tp = getDeclaredTypeOfTypeParameter(node.symbol); - if (!ts.contains(result, tp)) { - result.push(tp); - } - }); - return result; - } - function getSignatureFromDeclaration(declaration) { - var links = getNodeLinks(declaration); - if (!links.resolvedSignature) { - var classType = declaration.kind === 121 /* Constructor */ ? getDeclaredTypeOfClass(declaration.parent.symbol) : undefined; - var typeParameters = classType ? classType.typeParameters : declaration.typeParameters ? getTypeParametersFromDeclaration(declaration.typeParameters) : undefined; - var parameters = []; - var hasStringLiterals = false; - var minArgumentCount = -1; - for (var i = 0, n = declaration.parameters.length; i < n; i++) { - var param = declaration.parameters[i]; - parameters.push(param.symbol); - if (param.type && param.type.kind === 7 /* StringLiteral */) { - hasStringLiterals = true; - } - if (minArgumentCount < 0) { - if (param.initializer || param.flags & (4 /* QuestionMark */ | 8 /* Rest */)) { - minArgumentCount = i; - } - } - } - if (minArgumentCount < 0) { - minArgumentCount = declaration.parameters.length; - } - var returnType; - if (classType) { - returnType = classType; - } - else if (declaration.type) { - returnType = getTypeFromTypeNode(declaration.type); - } - else { - if (declaration.kind === 122 /* GetAccessor */) { - var setter = getDeclarationOfKind(declaration.symbol, 123 /* SetAccessor */); - returnType = getAnnotatedAccessorType(setter); - } - if (!returnType && !declaration.body) { - returnType = anyType; - } - } - links.resolvedSignature = createSignature(declaration, typeParameters, parameters, returnType, minArgumentCount, ts.hasRestParameters(declaration), hasStringLiterals); - } - return links.resolvedSignature; - } - function getSignaturesOfSymbol(symbol) { - if (!symbol) - return emptyArray; - var result = []; - for (var i = 0, len = symbol.declarations.length; i < len; i++) { - var node = symbol.declarations[i]; - switch (node.kind) { - case 172 /* FunctionDeclaration */: - case 120 /* Method */: - case 121 /* Constructor */: - case 124 /* CallSignature */: - case 125 /* ConstructSignature */: - case 126 /* IndexSignature */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 141 /* FunctionExpression */: - case 142 /* ArrowFunction */: - if (i > 0 && node.body) { - var previous = symbol.declarations[i - 1]; - if (node.parent === previous.parent && node.kind === previous.kind && node.pos === previous.end) { - break; - } - } - result.push(getSignatureFromDeclaration(node)); - } - } - return result; - } - function getReturnTypeOfSignature(signature) { - if (!signature.resolvedReturnType) { - signature.resolvedReturnType = resolvingType; - if (signature.target) { - var type = instantiateType(getReturnTypeOfSignature(signature.target), signature.mapper); - } - else { - var type = getReturnTypeFromBody(signature.declaration); - } - if (signature.resolvedReturnType === resolvingType) { - signature.resolvedReturnType = type; - } - } - else if (signature.resolvedReturnType === resolvingType) { - signature.resolvedReturnType = anyType; - if (compilerOptions.noImplicitAny) { - var declaration = signature.declaration; - if (declaration.name) { - error(declaration.name, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, ts.identifierToString(declaration.name)); - } - else { - error(declaration, ts.Diagnostics.Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions); - } - } - } - return signature.resolvedReturnType; - } - function getRestTypeOfSignature(signature) { - if (signature.hasRestParameter) { - var type = getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]); - if (type.flags & 4096 /* Reference */ && type.target === globalArrayType) { - return type.typeArguments[0]; - } - } - return anyType; - } - function getSignatureInstantiation(signature, typeArguments) { - return instantiateSignature(signature, createTypeMapper(signature.typeParameters, typeArguments), true); - } - function getErasedSignature(signature) { - if (!signature.typeParameters) - return signature; - if (!signature.erasedSignatureCache) { - if (signature.target) { - signature.erasedSignatureCache = instantiateSignature(getErasedSignature(signature.target), signature.mapper); - } - else { - signature.erasedSignatureCache = instantiateSignature(signature, createTypeEraser(signature.typeParameters), true); - } - } - return signature.erasedSignatureCache; - } - function getOrCreateTypeFromSignature(signature) { - if (!signature.isolatedSignatureType) { - var isConstructor = signature.declaration.kind === 121 /* Constructor */ || signature.declaration.kind === 125 /* ConstructSignature */; - var type = createObjectType(16384 /* Anonymous */ | 32768 /* FromSignature */); - type.members = emptySymbols; - type.properties = emptyArray; - type.callSignatures = !isConstructor ? [signature] : emptyArray; - type.constructSignatures = isConstructor ? [signature] : emptyArray; - signature.isolatedSignatureType = type; - } - return signature.isolatedSignatureType; - } - function getIndexSymbol(symbol) { - return symbol.members["__index"]; - } - function getIndexDeclarationOfSymbol(symbol, kind) { - var syntaxKind = kind === 1 /* Number */ ? 112 /* NumberKeyword */ : 114 /* StringKeyword */; - var indexSymbol = getIndexSymbol(symbol); - if (indexSymbol) { - var len = indexSymbol.declarations.length; - for (var i = 0; i < len; i++) { - var node = indexSymbol.declarations[i]; - if (node.parameters.length === 1) { - var parameter = node.parameters[0]; - if (parameter && parameter.type && parameter.type.kind === syntaxKind) { - return node; - } - } - } - } - return undefined; - } - function getIndexTypeOfSymbol(symbol, kind) { - var declaration = getIndexDeclarationOfSymbol(symbol, kind); - return declaration ? declaration.type ? getTypeFromTypeNode(declaration.type) : anyType : undefined; - } - function getConstraintOfTypeParameter(type) { - if (!type.constraint) { - if (type.target) { - var targetConstraint = getConstraintOfTypeParameter(type.target); - type.constraint = targetConstraint ? instantiateType(targetConstraint, type.mapper) : noConstraintType; - } - else { - type.constraint = getTypeFromTypeNode(getDeclarationOfKind(type.symbol, 117 /* TypeParameter */).constraint); - } - } - return type.constraint === noConstraintType ? undefined : type.constraint; - } - function getTypeListId(types) { - switch (types.length) { - case 1: - return "" + types[0].id; - case 2: - return types[0].id + "," + types[1].id; - default: - var result = ""; - for (var i = 0; i < types.length; i++) { - if (i > 0) - result += ","; - result += types[i].id; - } - return result; - } - } - function createTypeReference(target, typeArguments) { - var id = getTypeListId(typeArguments); - var type = target.instantiations[id]; - if (!type) { - type = target.instantiations[id] = createObjectType(4096 /* Reference */, target.symbol); - type.target = target; - type.typeArguments = typeArguments; - } - return type; - } - function isTypeParameterReferenceIllegalInConstraint(typeReferenceNode, typeParameterSymbol) { - var links = getNodeLinks(typeReferenceNode); - if (links.isIllegalTypeReferenceInConstraint !== undefined) { - return links.isIllegalTypeReferenceInConstraint; - } - var currentNode = typeReferenceNode; - while (!ts.forEach(typeParameterSymbol.declarations, function (d) { return d.parent === currentNode.parent; })) { - currentNode = currentNode.parent; - } - links.isIllegalTypeReferenceInConstraint = currentNode.kind === 117 /* TypeParameter */; - return links.isIllegalTypeReferenceInConstraint; - } - function checkTypeParameterHasIllegalReferencesInConstraint(typeParameter) { - var typeParameterSymbol; - function check(n) { - if (n.kind === 127 /* TypeReference */ && n.typeName.kind === 59 /* Identifier */) { - var links = getNodeLinks(n); - if (links.isIllegalTypeReferenceInConstraint === undefined) { - var symbol = resolveName(typeParameter, n.typeName.text, ts.SymbolFlags.Type, undefined, undefined); - if (symbol && (symbol.flags & 262144 /* TypeParameter */)) { - links.isIllegalTypeReferenceInConstraint = ts.forEach(symbol.declarations, function (d) { return d.parent == typeParameter.parent; }); - } - } - if (links.isIllegalTypeReferenceInConstraint) { - error(typeParameter, ts.Diagnostics.Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list); - } - } - ts.forEachChild(n, check); - } - if (typeParameter.constraint) { - typeParameterSymbol = getSymbolOfNode(typeParameter); - check(typeParameter.constraint); - } - } - function getTypeFromTypeReferenceNode(node) { - var links = getNodeLinks(node); - if (!links.resolvedType) { - var symbol = resolveEntityName(node, node.typeName, ts.SymbolFlags.Type); - if (symbol) { - var type; - if ((symbol.flags & 262144 /* TypeParameter */) && isTypeParameterReferenceIllegalInConstraint(node, symbol)) { - type = unknownType; - } - else { - type = getDeclaredTypeOfSymbol(symbol); - if (type.flags & (1024 /* Class */ | 2048 /* Interface */) && type.flags & 4096 /* Reference */) { - var typeParameters = type.typeParameters; - if (node.typeArguments && node.typeArguments.length === typeParameters.length) { - type = createTypeReference(type, ts.map(node.typeArguments, getTypeFromTypeNode)); - } - else { - error(node, ts.Diagnostics.Generic_type_0_requires_1_type_argument_s, typeToString(type, undefined, 1 /* WriteArrayAsGenericType */), typeParameters.length); - type = undefined; - } - } - else { - if (node.typeArguments) { - error(node, ts.Diagnostics.Type_0_is_not_generic, typeToString(type)); - type = undefined; - } - } - } - } - links.resolvedType = type || unknownType; - } - return links.resolvedType; - } - function getTypeFromTypeQueryNode(node) { - var links = getNodeLinks(node); - if (!links.resolvedType) { - links.resolvedType = getWidenedType(checkExpression(node.exprName)); - } - return links.resolvedType; - } - function getTypeOfGlobalSymbol(symbol, arity) { - function getTypeDeclaration(symbol) { - var declarations = symbol.declarations; - for (var i = 0; i < declarations.length; i++) { - var declaration = declarations[i]; - switch (declaration.kind) { - case 174 /* ClassDeclaration */: - case 175 /* InterfaceDeclaration */: - case 176 /* EnumDeclaration */: - return declaration; - } - } - } - if (!symbol) { - return emptyObjectType; - } - var type = getDeclaredTypeOfSymbol(symbol); - if (!(type.flags & ts.TypeFlags.ObjectType)) { - error(getTypeDeclaration(symbol), ts.Diagnostics.Global_type_0_must_be_a_class_or_interface_type, symbol.name); - return emptyObjectType; - } - if ((type.typeParameters ? type.typeParameters.length : 0) !== arity) { - error(getTypeDeclaration(symbol), ts.Diagnostics.Global_type_0_must_have_1_type_parameter_s, symbol.name, arity); - return emptyObjectType; - } - return type; - } - function getGlobalSymbol(name) { - return resolveName(undefined, name, ts.SymbolFlags.Type, ts.Diagnostics.Cannot_find_global_type_0, name); - } - function getGlobalType(name) { - return getTypeOfGlobalSymbol(getGlobalSymbol(name), 0); - } - function createArrayType(elementType) { - var arrayType = globalArrayType || getDeclaredTypeOfSymbol(globalArraySymbol); - return arrayType !== emptyObjectType ? createTypeReference(arrayType, [elementType]) : emptyObjectType; - } - function getTypeFromArrayTypeNode(node) { - var links = getNodeLinks(node); - if (!links.resolvedType) { - links.resolvedType = createArrayType(getTypeFromTypeNode(node.elementType)); - } - return links.resolvedType; - } - function createTupleType(elementTypes) { - var id = getTypeListId(elementTypes); - var type = tupleTypes[id]; - if (!type) { - type = tupleTypes[id] = createObjectType(8192 /* Tuple */); - type.elementTypes = elementTypes; - } - return type; - } - function getTypeFromTupleTypeNode(node) { - var links = getNodeLinks(node); - if (!links.resolvedType) { - links.resolvedType = createTupleType(ts.map(node.elementTypes, getTypeFromTypeNode)); - } - return links.resolvedType; - } - function getTypeFromTypeLiteralNode(node) { - var links = getNodeLinks(node); - if (!links.resolvedType) { - links.resolvedType = createObjectType(16384 /* Anonymous */, node.symbol); - } - return links.resolvedType; - } - function getStringLiteralType(node) { - if (ts.hasProperty(stringLiteralTypes, node.text)) - return stringLiteralTypes[node.text]; - var type = stringLiteralTypes[node.text] = createType(256 /* StringLiteral */); - type.text = ts.getTextOfNode(node); - return type; - } - function getTypeFromStringLiteral(node) { - var links = getNodeLinks(node); - if (!links.resolvedType) { - links.resolvedType = getStringLiteralType(node); - } - return links.resolvedType; - } - function getTypeFromTypeNode(node) { - switch (node.kind) { - case 105 /* AnyKeyword */: - return anyType; - case 114 /* StringKeyword */: - return stringType; - case 112 /* NumberKeyword */: - return numberType; - case 106 /* BooleanKeyword */: - return booleanType; - case 93 /* VoidKeyword */: - return voidType; - case 7 /* StringLiteral */: - return getTypeFromStringLiteral(node); - case 127 /* TypeReference */: - return getTypeFromTypeReferenceNode(node); - case 128 /* TypeQuery */: - return getTypeFromTypeQueryNode(node); - case 130 /* ArrayType */: - return getTypeFromArrayTypeNode(node); - case 131 /* TupleType */: - return getTypeFromTupleTypeNode(node); - case 129 /* TypeLiteral */: - return getTypeFromTypeLiteralNode(node); - case 59 /* Identifier */: - case 116 /* QualifiedName */: - var symbol = getSymbolInfo(node); - return symbol && getDeclaredTypeOfSymbol(symbol); - default: - return unknownType; - } - } - function instantiateList(items, mapper, instantiator) { - if (items && items.length) { - var result = []; - for (var i = 0; i < items.length; i++) { - result.push(instantiator(items[i], mapper)); - } - return result; - } - return items; - } - function createUnaryTypeMapper(source, target) { - return function (t) { return t === source ? target : t; }; - } - function createBinaryTypeMapper(source1, target1, source2, target2) { - return function (t) { return t === source1 ? target1 : t === source2 ? target2 : t; }; - } - function createTypeMapper(sources, targets) { - switch (sources.length) { - case 1: - return createUnaryTypeMapper(sources[0], targets[0]); - case 2: - return createBinaryTypeMapper(sources[0], targets[0], sources[1], targets[1]); - } - return function (t) { - for (var i = 0; i < sources.length; i++) { - if (t === sources[i]) - return targets[i]; - } - return t; - }; - } - function createUnaryTypeEraser(source) { - return function (t) { return t === source ? anyType : t; }; - } - function createBinaryTypeEraser(source1, source2) { - return function (t) { return t === source1 || t === source2 ? anyType : t; }; - } - function createTypeEraser(sources) { - switch (sources.length) { - case 1: - return createUnaryTypeEraser(sources[0]); - case 2: - return createBinaryTypeEraser(sources[0], sources[1]); - } - return function (t) { - for (var i = 0; i < sources.length; i++) { - if (t === sources[i]) - return anyType; - } - return t; - }; - } - function createInferenceMapper(context) { - return function (t) { - for (var i = 0; i < context.typeParameters.length; i++) { - if (t === context.typeParameters[i]) { - return getInferredType(context, i); - } - } - return t; - }; - } - function identityMapper(type) { - return type; - } - function combineTypeMappers(mapper1, mapper2) { - return function (t) { return mapper2(mapper1(t)); }; - } - function instantiateTypeParameter(typeParameter, mapper) { - var result = createType(512 /* TypeParameter */); - result.symbol = typeParameter.symbol; - if (typeParameter.constraint) { - result.constraint = instantiateType(typeParameter.constraint, mapper); - } - else { - result.target = typeParameter; - result.mapper = mapper; - } - return result; - } - function instantiateSignature(signature, mapper, eraseTypeParameters) { - if (signature.typeParameters && !eraseTypeParameters) { - var freshTypeParameters = instantiateList(signature.typeParameters, mapper, instantiateTypeParameter); - mapper = combineTypeMappers(createTypeMapper(signature.typeParameters, freshTypeParameters), mapper); - } - var result = createSignature(signature.declaration, freshTypeParameters, instantiateList(signature.parameters, mapper, instantiateSymbol), signature.resolvedReturnType ? instantiateType(signature.resolvedReturnType, mapper) : undefined, signature.minArgumentCount, signature.hasRestParameter, signature.hasStringLiterals); - result.target = signature; - result.mapper = mapper; - return result; - } - function instantiateSymbol(symbol, mapper) { - if (symbol.flags & 8388608 /* Instantiated */) { - var links = getSymbolLinks(symbol); - symbol = links.target; - mapper = combineTypeMappers(links.mapper, mapper); - } - var result = createSymbol(8388608 /* Instantiated */ | 33554432 /* Transient */, symbol.name); - result.declarations = symbol.declarations; - result.parent = symbol.parent; - result.target = symbol; - result.mapper = mapper; - if (symbol.valueDeclaration) { - result.valueDeclaration = symbol.valueDeclaration; - } - return result; - } - function instantiateAnonymousType(type, mapper) { - var result = createObjectType(16384 /* Anonymous */, type.symbol); - result.properties = instantiateList(getPropertiesOfType(type), mapper, instantiateSymbol); - result.members = createSymbolTable(result.properties); - result.callSignatures = instantiateList(getSignaturesOfType(type, 0 /* Call */), mapper, instantiateSignature); - result.constructSignatures = instantiateList(getSignaturesOfType(type, 1 /* Construct */), mapper, instantiateSignature); - var stringIndexType = getIndexTypeOfType(type, 0 /* String */); - var numberIndexType = getIndexTypeOfType(type, 1 /* Number */); - if (stringIndexType) - result.stringIndexType = instantiateType(stringIndexType, mapper); - if (numberIndexType) - result.numberIndexType = instantiateType(numberIndexType, mapper); - return result; - } - function instantiateType(type, mapper) { - if (mapper !== identityMapper) { - if (type.flags & 512 /* TypeParameter */) { - return mapper(type); - } - if (type.flags & 16384 /* Anonymous */) { - return type.symbol && type.symbol.flags & (8 /* Function */ | 2048 /* Method */ | 512 /* TypeLiteral */ | 1024 /* ObjectLiteral */) ? instantiateAnonymousType(type, mapper) : type; - } - if (type.flags & 4096 /* Reference */) { - return createTypeReference(type.target, instantiateList(type.typeArguments, mapper, instantiateType)); - } - if (type.flags & 8192 /* Tuple */) { - return createTupleType(instantiateList(type.elementTypes, mapper, instantiateType)); - } - } - return type; - } - function isContextSensitiveExpression(node) { - switch (node.kind) { - case 141 /* FunctionExpression */: - case 142 /* ArrowFunction */: - return !node.typeParameters && !ts.forEach(node.parameters, function (p) { return p.type; }); - case 133 /* ObjectLiteral */: - return ts.forEach(node.properties, function (p) { return p.kind === 134 /* PropertyAssignment */ && isContextSensitiveExpression(p.initializer); }); - case 132 /* ArrayLiteral */: - return ts.forEach(node.elements, function (e) { return isContextSensitiveExpression(e); }); - case 146 /* ConditionalExpression */: - return isContextSensitiveExpression(node.whenTrue) || isContextSensitiveExpression(node.whenFalse); - case 145 /* BinaryExpression */: - return node.operator === 44 /* BarBarToken */ && (isContextSensitiveExpression(node.left) || isContextSensitiveExpression(node.right)); - } - return false; - } - function getTypeWithoutConstructors(type) { - if (type.flags & ts.TypeFlags.ObjectType) { - var resolved = resolveObjectTypeMembers(type); - if (resolved.constructSignatures.length) { - var result = createObjectType(16384 /* Anonymous */, type.symbol); - result.members = resolved.members; - result.properties = resolved.properties; - result.callSignatures = resolved.callSignatures; - result.constructSignatures = emptyArray; - type = result; - } - } - return type; - } - var subtypeRelation = {}; - var assignableRelation = {}; - var identityRelation = {}; - function isTypeIdenticalTo(source, target) { - return checkTypeRelatedTo(source, target, identityRelation, undefined, undefined, undefined); - } - function isTypeSubtypeOf(source, target) { - return checkTypeSubtypeOf(source, target, undefined, undefined, undefined); - } - function checkTypeSubtypeOf(source, target, errorNode, chainedMessage, terminalMessage) { - return checkTypeRelatedTo(source, target, subtypeRelation, errorNode, chainedMessage, terminalMessage); - } - function isTypeAssignableTo(source, target) { - return checkTypeAssignableTo(source, target, undefined, undefined, undefined); - } - function checkTypeAssignableTo(source, target, errorNode, chainedMessage, terminalMessage) { - return checkTypeRelatedTo(source, target, assignableRelation, errorNode, chainedMessage, terminalMessage); - } - function isTypeRelatedTo(source, target, relation) { - return checkTypeRelatedTo(source, target, relation, undefined, undefined, undefined); - } - function isSignatureAssignableTo(source, target) { - var sourceType = getOrCreateTypeFromSignature(source); - var targetType = getOrCreateTypeFromSignature(target); - return checkTypeRelatedTo(sourceType, targetType, assignableRelation, undefined, undefined, undefined); - } - function isPropertyIdenticalTo(sourceProp, targetProp) { - return isPropertyIdenticalToRecursive(sourceProp, targetProp, false, function (s, t, _reportErrors) { return isTypeIdenticalTo(s, t); }); - } - function checkInheritedPropertiesAreIdentical(type, typeNode) { - if (!type.baseTypes.length || type.baseTypes.length === 1) { - return true; - } - var seen = {}; - ts.forEach(type.declaredProperties, function (p) { - seen[p.name] = { prop: p, containingType: type }; - }); - var ok = true; - for (var i = 0, len = type.baseTypes.length; i < len; ++i) { - var base = type.baseTypes[i]; - var properties = getPropertiesOfType(base); - for (var j = 0, proplen = properties.length; j < proplen; ++j) { - var prop = properties[j]; - if (!ts.hasProperty(seen, prop.name)) { - seen[prop.name] = { prop: prop, containingType: base }; - } - else { - var existing = seen[prop.name]; - var isInheritedProperty = existing.containingType !== type; - if (isInheritedProperty && !isPropertyIdenticalTo(existing.prop, prop)) { - ok = false; - var typeName1 = typeToString(existing.containingType); - var typeName2 = typeToString(base); - var errorInfo = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Named_properties_0_of_types_1_and_2_are_not_identical, prop.name, typeName1, typeName2); - errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Interface_0_cannot_simultaneously_extend_types_1_and_2_Colon, typeToString(type), typeName1, typeName2); - addDiagnostic(ts.createDiagnosticForNodeFromMessageChain(typeNode, errorInfo, program.getCompilerHost().getNewLine())); - } - } - } - } - return ok; - } - function isPropertyIdenticalToRecursive(sourceProp, targetProp, reportErrors, relate) { - if (sourceProp === targetProp) { - return true; - } - var sourcePropAccessibility = getDeclarationFlagsFromSymbol(sourceProp) & (32 /* Private */ | 64 /* Protected */); - var targetPropAccessibility = getDeclarationFlagsFromSymbol(targetProp) & (32 /* Private */ | 64 /* Protected */); - if (sourcePropAccessibility !== targetPropAccessibility) { - return false; - } - if (sourcePropAccessibility) { - return getTargetSymbol(sourceProp) === getTargetSymbol(targetProp) && relate(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp), reportErrors); - } - else { - return isOptionalProperty(sourceProp) === isOptionalProperty(targetProp) && relate(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp), reportErrors); - } - } - function checkTypeRelatedTo(source, target, relation, errorNode, chainedMessage, terminalMessage) { - var errorInfo; - var sourceStack; - var targetStack; - var expandingFlags; - var depth = 0; - var overflow = false; - ts.Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking"); - var result = isRelatedToWithCustomErrors(source, target, errorNode !== undefined, chainedMessage, terminalMessage); - if (overflow) { - error(errorNode, ts.Diagnostics.Excessive_stack_depth_comparing_types_0_and_1, typeToString(source), typeToString(target)); - } - else if (errorInfo) { - addDiagnostic(ts.createDiagnosticForNodeFromMessageChain(errorNode, errorInfo, program.getCompilerHost().getNewLine())); - } - return result; - function reportError(message, arg0, arg1, arg2) { - errorInfo = ts.chainDiagnosticMessages(errorInfo, message, arg0, arg1, arg2); - } - function isRelatedTo(source, target, reportErrors) { - return isRelatedToWithCustomErrors(source, target, reportErrors, undefined, undefined); - } - function isRelatedToWithCustomErrors(source, target, reportErrors, chainedMessage, terminalMessage) { - if (relation === identityRelation) { - if (source === target) - return true; - } - else { - if (source === target) - return true; - if (target.flags & 1 /* Any */) - return true; - if (source === undefinedType) - return true; - if (source === nullType && target !== undefinedType) - return true; - if (source.flags & 128 /* Enum */ && target === numberType) - return true; - if (source.flags & 256 /* StringLiteral */ && target === stringType) - return true; - if (relation === assignableRelation) { - if (source.flags & 1 /* Any */) - return true; - if (source === numberType && target.flags & 128 /* Enum */) - return true; - } - } - if (source.flags & 512 /* TypeParameter */ && target.flags & 512 /* TypeParameter */) { - if (typeParameterRelatedTo(source, target, reportErrors)) { - return true; - } - } - else { - var saveErrorInfo = errorInfo; - if (source.flags & 4096 /* Reference */ && target.flags & 4096 /* Reference */ && source.target === target.target) { - if (typesRelatedTo(source.typeArguments, target.typeArguments, reportErrors)) { - return true; - } - } - var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo; - var sourceOrApparentType = relation === identityRelation ? source : getApparentType(source); - if (sourceOrApparentType.flags & ts.TypeFlags.ObjectType && target.flags & ts.TypeFlags.ObjectType && objectTypeRelatedTo(sourceOrApparentType, target, reportStructuralErrors)) { - errorInfo = saveErrorInfo; - return true; - } - } - if (reportErrors) { - chainedMessage = chainedMessage || ts.Diagnostics.Type_0_is_not_assignable_to_type_1_Colon; - terminalMessage = terminalMessage || ts.Diagnostics.Type_0_is_not_assignable_to_type_1; - var diagnosticKey = errorInfo ? chainedMessage : terminalMessage; - ts.Debug.assert(diagnosticKey); - reportError(diagnosticKey, typeToString(source), typeToString(target)); - } - return false; - } - function typesRelatedTo(sources, targets, reportErrors) { - for (var i = 0, len = sources.length; i < len; i++) { - if (!isRelatedTo(sources[i], targets[i], reportErrors)) - return false; - } - return true; - } - function typeParameterRelatedTo(source, target, reportErrors) { - if (relation === identityRelation) { - if (source.symbol.name !== target.symbol.name) { - return false; - } - if (source.constraint === target.constraint) { - return true; - } - if (source.constraint === noConstraintType || target.constraint === noConstraintType) { - return false; - } - return isRelatedTo(source.constraint, target.constraint, reportErrors); - } - else { - while (true) { - var constraint = getConstraintOfTypeParameter(source); - if (constraint === target) - return true; - if (!(constraint && constraint.flags & 512 /* TypeParameter */)) - break; - source = constraint; - } - return false; - } - } - function objectTypeRelatedTo(source, target, reportErrors) { - if (overflow) - return false; - var result; - var id = source.id + "," + target.id; - if ((result = relation[id]) !== undefined) - return result; - if (depth > 0) { - for (var i = 0; i < depth; i++) { - if (source === sourceStack[i] && target === targetStack[i]) - return true; - } - if (depth === 100) { - overflow = true; - return false; - } - } - else { - sourceStack = []; - targetStack = []; - expandingFlags = 0; - } - sourceStack[depth] = source; - targetStack[depth] = target; - depth++; - var saveExpandingFlags = expandingFlags; - if (!(expandingFlags & 1) && isDeeplyNestedGeneric(source, sourceStack)) - expandingFlags |= 1; - if (!(expandingFlags & 2) && isDeeplyNestedGeneric(target, targetStack)) - expandingFlags |= 2; - result = expandingFlags === 3 || propertiesRelatedTo(source, target, reportErrors) && signaturesRelatedTo(source, target, 0 /* Call */, reportErrors) && signaturesRelatedTo(source, target, 1 /* Construct */, reportErrors) && stringIndexTypesRelatedTo(source, target, reportErrors) && numberIndexTypesRelatedTo(source, target, reportErrors); - expandingFlags = saveExpandingFlags; - depth--; - if (depth === 0) { - relation[id] = result; - } - return result; - } - function isDeeplyNestedGeneric(type, stack) { - if (type.flags & 4096 /* Reference */ && depth >= 10) { - var target = type.target; - var count = 0; - for (var i = 0; i < depth; i++) { - var t = stack[i]; - if (t.flags & 4096 /* Reference */ && t.target === target) { - count++; - if (count >= 10) - return true; - } - } - } - return false; - } - function propertiesRelatedTo(source, target, reportErrors) { - if (relation === identityRelation) { - return propertiesAreIdenticalTo(source, target, reportErrors); - } - else { - return propertiesAreSubtypeOrAssignableTo(source, target, reportErrors); - } - } - function propertiesAreIdenticalTo(source, target, reportErrors) { - var sourceProperties = getPropertiesOfType(source); - var targetProperties = getPropertiesOfType(target); - if (sourceProperties.length !== targetProperties.length) { - return false; - } - for (var i = 0, len = sourceProperties.length; i < len; ++i) { - var sourceProp = sourceProperties[i]; - var targetProp = getPropertyOfType(target, sourceProp.name); - if (!targetProp || !isPropertyIdenticalToRecursive(sourceProp, targetProp, reportErrors, isRelatedTo)) { - return false; - } - } - return true; - } - function propertiesAreSubtypeOrAssignableTo(source, target, reportErrors) { - var properties = getPropertiesOfType(target); - for (var i = 0; i < properties.length; i++) { - var targetProp = properties[i]; - var sourceProp = getPropertyOfApparentType(source, targetProp.name); - if (sourceProp !== targetProp) { - if (!sourceProp) { - if (!isOptionalProperty(targetProp)) { - if (reportErrors) { - reportError(ts.Diagnostics.Property_0_is_missing_in_type_1, symbolToString(targetProp), typeToString(source)); - } - return false; - } - } - else if (!(targetProp.flags & 67108864 /* Prototype */)) { - var sourceFlags = getDeclarationFlagsFromSymbol(sourceProp); - var targetFlags = getDeclarationFlagsFromSymbol(targetProp); - if (sourceFlags & 32 /* Private */ || targetFlags & 32 /* Private */) { - if (sourceProp.valueDeclaration !== targetProp.valueDeclaration) { - if (reportErrors) { - if (sourceFlags & 32 /* Private */ && targetFlags & 32 /* Private */) { - reportError(ts.Diagnostics.Types_have_separate_declarations_of_a_private_property_0, symbolToString(targetProp)); - } - else { - reportError(ts.Diagnostics.Property_0_is_private_in_type_1_but_not_in_type_2, symbolToString(targetProp), typeToString(sourceFlags & 32 /* Private */ ? source : target), typeToString(sourceFlags & 32 /* Private */ ? target : source)); - } - } - return false; - } - } - else if (targetFlags & 64 /* Protected */) { - var sourceDeclaredInClass = sourceProp.parent && sourceProp.parent.flags & 16 /* Class */; - var sourceClass = sourceDeclaredInClass ? getDeclaredTypeOfSymbol(sourceProp.parent) : undefined; - var targetClass = getDeclaredTypeOfSymbol(targetProp.parent); - if (!sourceClass || !hasBaseType(sourceClass, targetClass)) { - if (reportErrors) { - reportError(ts.Diagnostics.Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2, symbolToString(targetProp), typeToString(sourceClass || source), typeToString(targetClass)); - } - return false; - } - } - else if (sourceFlags & 64 /* Protected */) { - if (reportErrors) { - reportError(ts.Diagnostics.Property_0_is_protected_in_type_1_but_public_in_type_2, symbolToString(targetProp), typeToString(source), typeToString(target)); - } - return false; - } - if (!isRelatedTo(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp), reportErrors)) { - if (reportErrors) { - reportError(ts.Diagnostics.Types_of_property_0_are_incompatible_Colon, symbolToString(targetProp)); - } - return false; - } - if (isOptionalProperty(sourceProp) && !isOptionalProperty(targetProp)) { - if (reportErrors) { - reportError(ts.Diagnostics.Property_0_is_optional_in_type_1_but_required_in_type_2, symbolToString(targetProp), typeToString(source), typeToString(target)); - } - return false; - } - } - } - } - return true; - } - function signaturesRelatedTo(source, target, kind, reportErrors) { - if (relation === identityRelation) { - return areSignaturesIdenticalTo(source, target, kind, reportErrors); - } - else { - return areSignaturesSubtypeOrAssignableTo(source, target, kind, reportErrors); - } - } - function areSignaturesIdenticalTo(source, target, kind, reportErrors) { - var sourceSignatures = getSignaturesOfType(source, kind); - var targetSignatures = getSignaturesOfType(target, kind); - if (sourceSignatures.length !== targetSignatures.length) { - return false; - } - for (var i = 0, len = sourceSignatures.length; i < len; ++i) { - if (!isSignatureIdenticalTo(sourceSignatures[i], targetSignatures[i], reportErrors)) { - return false; - } - } - return true; - } - function isSignatureIdenticalTo(source, target, reportErrors) { - if (source === target) { - return true; - } - if (source.hasRestParameter !== target.hasRestParameter) { - return false; - } - if (source.parameters.length !== target.parameters.length) { - return false; - } - if (source.minArgumentCount !== target.minArgumentCount) { - return false; - } - if (source.typeParameters && target.typeParameters) { - if (source.typeParameters.length !== target.typeParameters.length) { - return false; - } - for (var i = 0, len = source.typeParameters.length; i < len; ++i) { - if (!isRelatedTo(source.typeParameters[i], target.typeParameters[i], reportErrors)) { - return false; - } - } - } - else if (source.typeParameters || source.typeParameters) { - return false; - } - source = getErasedSignature(source); - target = getErasedSignature(target); - for (var i = 0, len = source.parameters.length; i < len; i++) { - var s = source.hasRestParameter && i === len - 1 ? getRestTypeOfSignature(source) : getTypeOfSymbol(source.parameters[i]); - var t = target.hasRestParameter && i === len - 1 ? getRestTypeOfSignature(target) : getTypeOfSymbol(target.parameters[i]); - if (!isRelatedTo(s, t, reportErrors)) { - return false; - } - } - var t = getReturnTypeOfSignature(target); - var s = getReturnTypeOfSignature(source); - return isRelatedTo(s, t, reportErrors); - } - function areSignaturesSubtypeOrAssignableTo(source, target, kind, reportErrors) { - if (target === anyFunctionType || source === anyFunctionType) - return true; - var sourceSignatures = getSignaturesOfType(source, kind); - var targetSignatures = getSignaturesOfType(target, kind); - var saveErrorInfo = errorInfo; - outer: for (var i = 0; i < targetSignatures.length; i++) { - var t = targetSignatures[i]; - if (!t.hasStringLiterals || target.flags & 32768 /* FromSignature */) { - var localErrors = reportErrors; - for (var j = 0; j < sourceSignatures.length; j++) { - var s = sourceSignatures[j]; - if (!s.hasStringLiterals || source.flags & 32768 /* FromSignature */) { - if (isSignatureSubtypeOrAssignableTo(s, t, localErrors)) { - errorInfo = saveErrorInfo; - continue outer; - } - localErrors = false; - } - } - return false; - } - } - return true; - } - function isSignatureSubtypeOrAssignableTo(source, target, reportErrors) { - if (source === target) { - return true; - } - if (!target.hasRestParameter && source.minArgumentCount > target.parameters.length) { - return false; - } - var sourceMax = source.parameters.length; - var targetMax = target.parameters.length; - var checkCount; - if (source.hasRestParameter && target.hasRestParameter) { - checkCount = sourceMax > targetMax ? sourceMax : targetMax; - sourceMax--; - targetMax--; - } - else if (source.hasRestParameter) { - sourceMax--; - checkCount = targetMax; - } - else if (target.hasRestParameter) { - targetMax--; - checkCount = sourceMax; - } - else { - checkCount = sourceMax < targetMax ? sourceMax : targetMax; - } - source = getErasedSignature(source); - target = getErasedSignature(target); - for (var i = 0; i < checkCount; i++) { - var s = i < sourceMax ? getTypeOfSymbol(source.parameters[i]) : getRestTypeOfSignature(source); - var t = i < targetMax ? getTypeOfSymbol(target.parameters[i]) : getRestTypeOfSignature(target); - var saveErrorInfo = errorInfo; - if (!isRelatedTo(s, t, reportErrors)) { - if (!isRelatedTo(t, s, false)) { - if (reportErrors) { - reportError(ts.Diagnostics.Types_of_parameters_0_and_1_are_incompatible_Colon, source.parameters[i < sourceMax ? i : sourceMax].name, target.parameters[i < targetMax ? i : targetMax].name); - } - return false; - } - errorInfo = saveErrorInfo; - } - } - var t = getReturnTypeOfSignature(target); - if (t === voidType) - return true; - var s = getReturnTypeOfSignature(source); - return isRelatedTo(s, t, reportErrors); - } - function stringIndexTypesRelatedTo(source, target, reportErrors) { - if (relation === identityRelation) { - return areIndexTypesIdenticalTo(0 /* String */, source, target, reportErrors); - } - else { - var targetType = getIndexTypeOfType(target, 0 /* String */); - if (targetType) { - var sourceType = getIndexTypeOfType(source, 0 /* String */); - if (!sourceType) { - if (reportErrors) { - reportError(ts.Diagnostics.Index_signature_is_missing_in_type_0, typeToString(source)); - } - return false; - } - if (!isRelatedTo(sourceType, targetType, reportErrors)) { - if (reportErrors) { - reportError(ts.Diagnostics.Index_signatures_are_incompatible_Colon); - } - return false; - } - } - return true; - } - } - function numberIndexTypesRelatedTo(source, target, reportErrors) { - if (relation === identityRelation) { - return areIndexTypesIdenticalTo(1 /* Number */, source, target, reportErrors); - } - else { - var targetType = getIndexTypeOfType(target, 1 /* Number */); - if (targetType) { - var sourceStringType = getIndexTypeOfType(source, 0 /* String */); - var sourceNumberType = getIndexTypeOfType(source, 1 /* Number */); - if (!(sourceStringType || sourceNumberType)) { - if (reportErrors) { - reportError(ts.Diagnostics.Index_signature_is_missing_in_type_0, typeToString(source)); - } - return false; - } - if (sourceStringType && sourceNumberType) { - var compatible = isRelatedTo(sourceStringType, targetType, false) || isRelatedTo(sourceNumberType, targetType, reportErrors); - } - else { - var compatible = isRelatedTo(sourceStringType || sourceNumberType, targetType, reportErrors); - } - if (!compatible) { - if (reportErrors) { - reportError(ts.Diagnostics.Index_signatures_are_incompatible_Colon); - } - return false; - } - } - return true; - } - } - function areIndexTypesIdenticalTo(indexKind, source, target, reportErrors) { - var targetType = getIndexTypeOfType(target, indexKind); - var sourceType = getIndexTypeOfType(source, indexKind); - return (!sourceType && !targetType) || (sourceType && targetType && isRelatedTo(sourceType, targetType, reportErrors)); - } - } - function isSupertypeOfEach(candidate, types) { - for (var i = 0, len = types.length; i < len; i++) { - if (candidate !== types[i] && !isTypeSubtypeOf(types[i], candidate)) - return false; - } - return true; - } - function getBestCommonType(types, contextualType, candidatesOnly) { - if (contextualType && isSupertypeOfEach(contextualType, types)) - return contextualType; - return ts.forEach(types, function (t) { return isSupertypeOfEach(t, types) ? t : undefined; }) || (candidatesOnly ? undefined : emptyObjectType); - } - function isTypeOfObjectLiteral(type) { - return (type.flags & 16384 /* Anonymous */) && type.symbol && (type.symbol.flags & 1024 /* ObjectLiteral */) ? true : false; - } - function isArrayType(type) { - return type.flags & 4096 /* Reference */ && type.target === globalArrayType; - } - function getInnermostTypeOfNestedArrayTypes(type) { - while (isArrayType(type)) { - type = type.typeArguments[0]; - } - return type; - } - function getWidenedType(type, supressNoImplicitAnyErrors) { - if (type.flags & (32 /* Undefined */ | 64 /* Null */)) { - return anyType; - } - if (isTypeOfObjectLiteral(type)) { - return getWidenedTypeOfObjectLiteral(type); - } - if (isArrayType(type)) { - return getWidenedTypeOfArrayLiteral(type); - } - return type; - function getWidenedTypeOfObjectLiteral(type) { - var properties = getPropertiesOfType(type); - if (properties.length) { - var widenedTypes = []; - var propTypeWasWidened = false; - ts.forEach(properties, function (p) { - var propType = getTypeOfSymbol(p); - var widenedType = getWidenedType(propType); - if (propType !== widenedType) { - propTypeWasWidened = true; - if (!supressNoImplicitAnyErrors && program.getCompilerOptions().noImplicitAny && getInnermostTypeOfNestedArrayTypes(widenedType) === anyType) { - error(p.valueDeclaration, ts.Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, p.name, typeToString(widenedType)); - } - } - widenedTypes.push(widenedType); - }); - if (propTypeWasWidened) { - var members = {}; - var index = 0; - ts.forEach(properties, function (p) { - var symbol = createSymbol(2 /* Property */ | 33554432 /* Transient */, p.name); - symbol.declarations = p.declarations; - symbol.parent = p.parent; - symbol.type = widenedTypes[index++]; - symbol.target = p; - if (p.valueDeclaration) - symbol.valueDeclaration = p.valueDeclaration; - members[symbol.name] = symbol; - }); - var stringIndexType = getIndexTypeOfType(type, 0 /* String */); - var numberIndexType = getIndexTypeOfType(type, 1 /* Number */); - if (stringIndexType) - stringIndexType = getWidenedType(stringIndexType); - if (numberIndexType) - numberIndexType = getWidenedType(numberIndexType); - type = createAnonymousType(type.symbol, members, emptyArray, emptyArray, stringIndexType, numberIndexType); - } - } - return type; - } - function getWidenedTypeOfArrayLiteral(type) { - var elementType = type.typeArguments[0]; - var widenedType = getWidenedType(elementType, supressNoImplicitAnyErrors); - type = elementType !== widenedType ? createArrayType(widenedType) : type; - return type; - } - } - function forEachMatchingParameterType(source, target, callback) { - var sourceMax = source.parameters.length; - var targetMax = target.parameters.length; - var count; - if (source.hasRestParameter && target.hasRestParameter) { - count = sourceMax > targetMax ? sourceMax : targetMax; - sourceMax--; - targetMax--; - } - else if (source.hasRestParameter) { - sourceMax--; - count = targetMax; - } - else if (target.hasRestParameter) { - targetMax--; - count = sourceMax; - } - else { - count = sourceMax < targetMax ? sourceMax : targetMax; - } - for (var i = 0; i < count; i++) { - var s = i < sourceMax ? getTypeOfSymbol(source.parameters[i]) : getRestTypeOfSignature(source); - var t = i < targetMax ? getTypeOfSymbol(target.parameters[i]) : getRestTypeOfSignature(target); - callback(s, t); - } - } - function createInferenceContext(typeParameters) { - var inferences = []; - for (var i = 0; i < typeParameters.length; i++) - inferences.push([]); - return { - typeParameters: typeParameters, - inferences: inferences, - inferredTypes: new Array(typeParameters.length) - }; - } - function inferTypes(context, source, target) { - var sourceStack; - var targetStack; - var depth = 0; - inferFromTypes(source, target); - function isInProcess(source, target) { - for (var i = 0; i < depth; i++) { - if (source === sourceStack[i] && target === targetStack[i]) - return true; - } - return false; - } - function isWithinDepthLimit(type, stack) { - if (depth >= 5) { - var target = type.target; - var count = 0; - for (var i = 0; i < depth; i++) { - var t = stack[i]; - if (t.flags & 4096 /* Reference */ && t.target === target) - count++; - } - return count < 5; - } - return true; - } - function inferFromTypes(source, target) { - if (target.flags & 512 /* TypeParameter */) { - var typeParameters = context.typeParameters; - for (var i = 0; i < typeParameters.length; i++) { - if (target === typeParameters[i]) { - var inferences = context.inferences[i]; - if (!ts.contains(inferences, source)) - inferences.push(source); - break; - } - } - } - else if (source.flags & 4096 /* Reference */ && target.flags & 4096 /* Reference */ && source.target === target.target) { - var sourceTypes = source.typeArguments; - var targetTypes = target.typeArguments; - for (var i = 0; i < sourceTypes.length; i++) { - inferFromTypes(sourceTypes[i], targetTypes[i]); - } - } - else if (source.flags & ts.TypeFlags.ObjectType && (target.flags & (4096 /* Reference */ | 8192 /* Tuple */) || (target.flags & 16384 /* Anonymous */) && target.symbol && target.symbol.flags & (2048 /* Method */ | 512 /* TypeLiteral */))) { - if (!isInProcess(source, target) && isWithinDepthLimit(source, sourceStack) && isWithinDepthLimit(target, targetStack)) { - if (depth === 0) { - sourceStack = []; - targetStack = []; - } - sourceStack[depth] = source; - targetStack[depth] = target; - depth++; - inferFromProperties(source, target); - inferFromSignatures(source, target, 0 /* Call */); - inferFromSignatures(source, target, 1 /* Construct */); - inferFromIndexTypes(source, target, 0 /* String */, 0 /* String */); - inferFromIndexTypes(source, target, 1 /* Number */, 1 /* Number */); - inferFromIndexTypes(source, target, 0 /* String */, 1 /* Number */); - depth--; - } - } - } - function inferFromProperties(source, target) { - var properties = getPropertiesOfType(target); - for (var i = 0; i < properties.length; i++) { - var targetProp = properties[i]; - var sourceProp = getPropertyOfType(source, targetProp.name); - if (sourceProp) { - inferFromTypes(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp)); - } - } - } - function inferFromSignatures(source, target, kind) { - var sourceSignatures = getSignaturesOfType(source, kind); - var targetSignatures = getSignaturesOfType(target, kind); - var sourceLen = sourceSignatures.length; - var targetLen = targetSignatures.length; - var len = sourceLen < targetLen ? sourceLen : targetLen; - for (var i = 0; i < len; i++) { - inferFromSignature(getErasedSignature(sourceSignatures[sourceLen - len + i]), getErasedSignature(targetSignatures[targetLen - len + i])); - } - } - function inferFromSignature(source, target) { - forEachMatchingParameterType(source, target, inferFromTypes); - inferFromTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target)); - } - function inferFromIndexTypes(source, target, sourceKind, targetKind) { - var targetIndexType = getIndexTypeOfType(target, targetKind); - if (targetIndexType) { - var sourceIndexType = getIndexTypeOfType(source, sourceKind); - if (sourceIndexType) { - inferFromTypes(sourceIndexType, targetIndexType); - } - } - } - } - function getInferredType(context, index) { - var result = context.inferredTypes[index]; - if (!result) { - var commonType = getWidenedType(getBestCommonType(context.inferences[index])); - var constraint = getConstraintOfTypeParameter(context.typeParameters[index]); - var result = constraint && !isTypeAssignableTo(commonType, constraint) ? constraint : commonType; - context.inferredTypes[index] = result; - } - return result; - } - function getInferredTypes(context) { - for (var i = 0; i < context.inferredTypes.length; i++) { - getInferredType(context, i); - } - context.inferences = undefined; - return context.inferredTypes; - } - function hasAncestor(node, kind) { - return ts.getAncestor(node, kind) !== undefined; - } - function checkIdentifier(node) { - function isInTypeQuery(node) { - while (node) { - switch (node.kind) { - case 128 /* TypeQuery */: - return true; - case 59 /* Identifier */: - case 116 /* QualifiedName */: - node = node.parent; - continue; - default: - return false; - } - } - ts.Debug.fail("should not get here"); - } - var symbol = resolveName(node, node.text, ts.SymbolFlags.Value | 524288 /* ExportValue */, ts.Diagnostics.Cannot_find_name_0, ts.identifierToString(node)); - if (!symbol) { - symbol = unknownSymbol; - } - if (symbol.flags & 4194304 /* Import */) { - getSymbolLinks(symbol).referenced = !isInTypeQuery(node); - } - getNodeLinks(node).resolvedSymbol = symbol; - checkCollisionWithCapturedSuperVariable(node, node); - checkCollisionWithCapturedThisVariable(node, node); - checkCollisionWithIndexVariableInGeneratedCode(node, node); - return getTypeOfSymbol(getExportSymbolOfValueSymbolIfExported(symbol)); - } - function captureLexicalThis(node, container) { - var classNode = container.parent && container.parent.kind === 174 /* ClassDeclaration */ ? container.parent : undefined; - getNodeLinks(node).flags |= 2 /* LexicalThis */; - if (container.kind === 119 /* Property */ || container.kind === 121 /* Constructor */) { - getNodeLinks(classNode).flags |= 4 /* CaptureThis */; - } - else { - getNodeLinks(container).flags |= 4 /* CaptureThis */; - } - } - function checkThisExpression(node) { - var container = ts.getThisContainer(node, true); - var needToCaptureLexicalThis = false; - if (container.kind === 142 /* ArrowFunction */) { - container = ts.getThisContainer(container, false); - needToCaptureLexicalThis = true; - } - switch (container.kind) { - case 177 /* ModuleDeclaration */: - error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_body); - break; - case 176 /* EnumDeclaration */: - error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); - break; - case 121 /* Constructor */: - if (isInConstructorArgumentInitializer(node, container)) { - error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); - } - break; - case 119 /* Property */: - if (container.flags & 128 /* Static */) { - error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); - } - break; - } - if (needToCaptureLexicalThis) { - captureLexicalThis(node, container); - } - var classNode = container.parent && container.parent.kind === 174 /* ClassDeclaration */ ? container.parent : undefined; - if (classNode) { - var symbol = getSymbolOfNode(classNode); - return container.flags & 128 /* Static */ ? getTypeOfSymbol(symbol) : getDeclaredTypeOfSymbol(symbol); - } - return anyType; - } - function getSuperContainer(node) { - while (true) { - node = node.parent; - if (!node) - return node; - switch (node.kind) { - case 172 /* FunctionDeclaration */: - case 141 /* FunctionExpression */: - case 142 /* ArrowFunction */: - case 119 /* Property */: - case 120 /* Method */: - case 121 /* Constructor */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - return node; - } - } - } - function isInConstructorArgumentInitializer(node, constructorDecl) { - for (var n = node; n && n !== constructorDecl; n = n.parent) { - if (n.kind === 118 /* Parameter */) { - return true; - } - } - return false; - } - function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 137 /* CallExpression */ && node.parent.func === node; - var enclosingClass = ts.getAncestor(node, 174 /* ClassDeclaration */); - var baseClass; - if (enclosingClass && enclosingClass.baseType) { - var classType = getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClass)); - baseClass = classType.baseTypes.length && classType.baseTypes[0]; - } - if (!baseClass) { - error(node, ts.Diagnostics.super_can_only_be_referenced_in_a_derived_class); - return unknownType; - } - var container = getSuperContainer(node); - if (container) { - var canUseSuperExpression = false; - if (isCallExpression) { - canUseSuperExpression = container.kind === 121 /* Constructor */; - } - else { - var needToCaptureLexicalThis = false; - while (container && container.kind === 142 /* ArrowFunction */) { - container = getSuperContainer(container); - needToCaptureLexicalThis = true; - } - if (container && container.parent && container.parent.kind === 174 /* ClassDeclaration */) { - if (container.flags & 128 /* Static */) { - canUseSuperExpression = container.kind === 120 /* Method */ || container.kind === 122 /* GetAccessor */ || container.kind === 123 /* SetAccessor */; - } - else { - canUseSuperExpression = container.kind === 120 /* Method */ || container.kind === 122 /* GetAccessor */ || container.kind === 123 /* SetAccessor */ || container.kind === 119 /* Property */ || container.kind === 121 /* Constructor */; - } - } - } - if (canUseSuperExpression) { - var returnType; - if ((container.flags & 128 /* Static */) || isCallExpression) { - getNodeLinks(node).flags |= 32 /* SuperStatic */; - returnType = getTypeOfSymbol(baseClass.symbol); - } - else { - getNodeLinks(node).flags |= 16 /* SuperInstance */; - returnType = baseClass; - } - if (container.kind === 121 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { - error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); - returnType = unknownType; - } - if (!isCallExpression && needToCaptureLexicalThis) { - captureLexicalThis(node.parent, container); - } - return returnType; - } - } - if (isCallExpression) { - error(node, ts.Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors); - } - else { - error(node, ts.Diagnostics.super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class); - } - return unknownType; - } - function getContextuallyTypedParameterType(parameter) { - var func = parameter.parent; - if (func.kind === 141 /* FunctionExpression */ || func.kind === 142 /* ArrowFunction */) { - if (isContextSensitiveExpression(func)) { - var contextualSignature = getContextualSignature(func); - if (contextualSignature) { - var funcHasRestParameters = ts.hasRestParameters(func); - var len = func.parameters.length - (funcHasRestParameters ? 1 : 0); - var indexOfParameter = ts.indexOf(func.parameters, parameter); - if (indexOfParameter < len) { - return getTypeAtPosition(contextualSignature, indexOfParameter); - } - if (indexOfParameter === (func.parameters.length - 1) && funcHasRestParameters && contextualSignature.hasRestParameter && func.parameters.length >= contextualSignature.parameters.length) { - return getTypeOfSymbol(contextualSignature.parameters[contextualSignature.parameters.length - 1]); - } - } - } - } - return undefined; - } - function getContextualTypeForInitializerExpression(node) { - var declaration = node.parent; - if (node === declaration.initializer) { - if (declaration.type) { - return getTypeFromTypeNode(declaration.type); - } - if (declaration.kind === 118 /* Parameter */) { - return getContextuallyTypedParameterType(declaration); - } - } - return undefined; - } - function getContextualTypeForReturnExpression(node) { - var func = ts.getContainingFunction(node); - if (func) { - if (func.type || func.kind === 121 /* Constructor */ || func.kind === 122 /* GetAccessor */ && getSetAccessorTypeAnnotationNode(getDeclarationOfKind(func.symbol, 123 /* SetAccessor */))) { - return getReturnTypeOfSignature(getSignatureFromDeclaration(func)); - } - var signature = getContextualSignature(func); - if (signature) { - return getReturnTypeOfSignature(signature); - } - } - return undefined; - } - function getContextualTypeForArgument(node) { - var callExpression = node.parent; - var argIndex = ts.indexOf(callExpression.arguments, node); - if (argIndex >= 0) { - var signature = getResolvedSignature(callExpression); - return getTypeAtPosition(signature, argIndex); - } - return undefined; - } - function getContextualTypeForBinaryOperand(node) { - var binaryExpression = node.parent; - var operator = binaryExpression.operator; - if (operator >= ts.SyntaxKind.FirstAssignment && operator <= ts.SyntaxKind.LastAssignment) { - if (node === binaryExpression.right) { - return checkExpression(binaryExpression.left); - } - } - else if (operator === 44 /* BarBarToken */) { - var type = getContextualType(binaryExpression); - if (!type && node === binaryExpression.right) { - type = checkExpression(binaryExpression.left); - } - return type; - } - return undefined; - } - function getContextualTypeForPropertyExpression(node) { - var declaration = node.parent; - var objectLiteral = declaration.parent; - var type = getContextualType(objectLiteral); - var name = declaration.name.text; - if (type && name) { - var prop = getPropertyOfType(type, name); - if (prop) { - return getTypeOfSymbol(prop); - } - return isNumericName(name) && getIndexTypeOfType(type, 1 /* Number */) || getIndexTypeOfType(type, 0 /* String */); - } - return undefined; - } - function getContextualTypeForElementExpression(node) { - var arrayLiteral = node.parent; - var type = getContextualType(arrayLiteral); - if (type) { - var index = ts.indexOf(arrayLiteral.elements, node); - var prop = getPropertyOfType(type, "" + index); - if (prop) { - return getTypeOfSymbol(prop); - } - return getIndexTypeOfType(type, 1 /* Number */); - } - return undefined; - } - function getContextualTypeForConditionalOperand(node) { - var conditional = node.parent; - return node === conditional.whenTrue || node === conditional.whenFalse ? getContextualType(conditional) : undefined; - } - function getContextualType(node) { - if (isInsideWithStatementBody(node)) { - return undefined; - } - if (node.contextualType) { - return node.contextualType; - } - var parent = node.parent; - switch (parent.kind) { - case 171 /* VariableDeclaration */: - case 118 /* Parameter */: - case 119 /* Property */: - return getContextualTypeForInitializerExpression(node); - case 142 /* ArrowFunction */: - case 159 /* ReturnStatement */: - return getContextualTypeForReturnExpression(node); - case 137 /* CallExpression */: - case 138 /* NewExpression */: - return getContextualTypeForArgument(node); - case 139 /* TypeAssertion */: - return getTypeFromTypeNode(parent.type); - case 145 /* BinaryExpression */: - return getContextualTypeForBinaryOperand(node); - case 134 /* PropertyAssignment */: - return getContextualTypeForPropertyExpression(node); - case 132 /* ArrayLiteral */: - return getContextualTypeForElementExpression(node); - case 146 /* ConditionalExpression */: - return getContextualTypeForConditionalOperand(node); - } - return undefined; - } - function getContextualSignature(node) { - var type = getContextualType(node); - if (type) { - var signatures = getSignaturesOfType(type, 0 /* Call */); - if (signatures.length === 1) { - var signature = signatures[0]; - if (!signature.typeParameters) { - return signature; - } - } - } - return undefined; - } - function isInferentialContext(mapper) { - return mapper && mapper !== identityMapper; - } - function checkArrayLiteral(node, contextualMapper) { - var contextualType = getContextualType(node); - var elements = node.elements; - var elementTypes = []; - var isTupleLiteral = false; - for (var i = 0; i < elements.length; i++) { - if (contextualType && getPropertyOfType(contextualType, "" + i)) { - isTupleLiteral = true; - } - var element = elements[i]; - var type = element.kind !== 147 /* OmittedExpression */ ? checkExpression(element, contextualMapper) : undefinedType; - elementTypes.push(type); - } - if (isTupleLiteral) { - return createTupleType(elementTypes); - } - var contextualElementType = contextualType && !isInferentialContext(contextualMapper) ? getIndexTypeOfType(contextualType, 1 /* Number */) : undefined; - var elementType = getBestCommonType(ts.uniqueElements(elementTypes), contextualElementType, true); - if (!elementType) { - elementType = elements.length ? emptyObjectType : undefinedType; - } - return createArrayType(elementType); - } - function isNumericName(name) { - return (name !== "") && !isNaN(name); - } - function checkObjectLiteral(node, contextualMapper) { - var members = node.symbol.members; - var properties = {}; - var contextualType = getContextualType(node); - for (var id in members) { - if (ts.hasProperty(members, id)) { - var member = members[id]; - if (member.flags & 2 /* Property */) { - var type = checkExpression(member.declarations[0].initializer, contextualMapper); - var prop = createSymbol(2 /* Property */ | 33554432 /* Transient */, member.name); - prop.declarations = member.declarations; - prop.parent = member.parent; - if (member.valueDeclaration) - prop.valueDeclaration = member.valueDeclaration; - prop.type = type; - prop.target = member; - member = prop; - } - else { - var getAccessor = getDeclarationOfKind(member, 122 /* GetAccessor */); - if (getAccessor) { - checkAccessorDeclaration(getAccessor); - } - var setAccessor = getDeclarationOfKind(member, 123 /* SetAccessor */); - if (setAccessor) { - checkAccessorDeclaration(setAccessor); - } - } - properties[member.name] = member; - } - } - var stringIndexType = getIndexType(0 /* String */); - var numberIndexType = getIndexType(1 /* Number */); - return createAnonymousType(node.symbol, properties, emptyArray, emptyArray, stringIndexType, numberIndexType); - function getIndexType(kind) { - if (contextualType) { - var indexType = getIndexTypeOfType(contextualType, kind); - if (indexType) { - var propTypes = []; - for (var id in properties) { - if (ts.hasProperty(properties, id)) { - if (kind === 0 /* String */ || isNumericName(id)) { - var type = getTypeOfSymbol(properties[id]); - if (!ts.contains(propTypes, type)) - propTypes.push(type); - } - } - } - return getBestCommonType(propTypes, isInferentialContext(contextualMapper) ? undefined : indexType); - } - } - } - } - function getDeclarationKindFromSymbol(s) { - return s.valueDeclaration ? s.valueDeclaration.kind : 119 /* Property */; - } - function getDeclarationFlagsFromSymbol(s) { - return s.valueDeclaration ? s.valueDeclaration.flags : s.flags & 67108864 /* Prototype */ ? 16 /* Public */ | 128 /* Static */ : 0; - } - function checkClassPropertyAccess(node, type, prop) { - var flags = getDeclarationFlagsFromSymbol(prop); - if (!(flags & (32 /* Private */ | 64 /* Protected */))) { - return; - } - var enclosingClassDeclaration = ts.getAncestor(node, 174 /* ClassDeclaration */); - var enclosingClass = enclosingClassDeclaration ? getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClassDeclaration)) : undefined; - var declaringClass = getDeclaredTypeOfSymbol(prop.parent); - if (flags & 32 /* Private */) { - if (declaringClass !== enclosingClass) { - error(node, ts.Diagnostics.Property_0_is_private_and_only_accessible_within_class_1, symbolToString(prop), typeToString(declaringClass)); - } - return; - } - if (node.left.kind === 85 /* SuperKeyword */) { - return; - } - if (!enclosingClass || !hasBaseType(enclosingClass, declaringClass)) { - error(node, ts.Diagnostics.Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses, symbolToString(prop), typeToString(declaringClass)); - return; - } - if (flags & 128 /* Static */) { - return; - } - if (!(getTargetType(type).flags & (1024 /* Class */ | 2048 /* Interface */) && hasBaseType(type, enclosingClass))) { - error(node, ts.Diagnostics.Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1, symbolToString(prop), typeToString(enclosingClass)); - } - } - function checkPropertyAccess(node) { - var type = checkExpression(node.left); - if (type === unknownType) - return type; - if (type !== anyType) { - var apparentType = getApparentType(getWidenedType(type)); - if (apparentType === unknownType) { - return unknownType; - } - var prop = getPropertyOfApparentType(apparentType, node.right.text); - if (!prop) { - if (node.right.text) { - error(node.right, ts.Diagnostics.Property_0_does_not_exist_on_type_1, ts.identifierToString(node.right), typeToString(type)); - } - return unknownType; - } - getNodeLinks(node).resolvedSymbol = prop; - if (prop.parent && prop.parent.flags & 16 /* Class */) { - if (node.left.kind === 85 /* SuperKeyword */ && getDeclarationKindFromSymbol(prop) !== 120 /* Method */) { - error(node.right, ts.Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword); - } - else { - checkClassPropertyAccess(node, type, prop); - } - } - return getTypeOfSymbol(prop); - } - return anyType; - } - function isValidPropertyAccess(node, propertyName) { - var type = checkExpression(node.left); - if (type !== unknownType && type !== anyType) { - var apparentType = getApparentType(getWidenedType(type)); - var prop = getPropertyOfApparentType(apparentType, propertyName); - if (prop && prop.parent && prop.parent.flags & 16 /* Class */) { - if (node.left.kind === 85 /* SuperKeyword */ && getDeclarationKindFromSymbol(prop) !== 120 /* Method */) { - return false; - } - else { - var diagnosticsCount = diagnostics.length; - checkClassPropertyAccess(node, type, prop); - return diagnostics.length === diagnosticsCount; - } - } - } - return true; - } - function checkIndexedAccess(node) { - var objectType = checkExpression(node.object); - var indexType = checkExpression(node.index); - if (objectType === unknownType) - return unknownType; - var apparentType = getApparentType(objectType); - if (apparentType === unknownType) { - return unknownType; - } - if (node.index.kind === 7 /* StringLiteral */ || node.index.kind === 6 /* NumericLiteral */) { - var name = node.index.text; - var prop = getPropertyOfApparentType(apparentType, name); - if (prop) { - return getTypeOfSymbol(prop); - } - } - if (indexType.flags & (1 /* Any */ | ts.TypeFlags.StringLike | ts.TypeFlags.NumberLike)) { - if (indexType.flags & (1 /* Any */ | ts.TypeFlags.NumberLike)) { - var numberIndexType = getIndexTypeOfType(apparentType, 1 /* Number */); - if (numberIndexType) { - return numberIndexType; - } - } - var stringIndexType = getIndexTypeOfType(apparentType, 0 /* String */); - if (stringIndexType) { - return stringIndexType; - } - if (compilerOptions.noImplicitAny && objectType !== anyType) { - error(node, ts.Diagnostics.Index_signature_of_object_type_implicitly_has_an_any_type); - } - return anyType; - } - error(node, ts.Diagnostics.An_index_expression_argument_must_be_of_type_string_number_or_any); - return unknownType; - } - function resolveUntypedCall(node) { - ts.forEach(node.arguments, function (argument) { - checkExpression(argument); - }); - return anySignature; - } - function resolveErrorCall(node) { - resolveUntypedCall(node); - return unknownSignature; - } - function signatureHasCorrectArity(node, signature) { - if (!node.arguments) { - return signature.minArgumentCount === 0; - } - var args = node.arguments; - var numberOfArgs = args.hasTrailingComma ? args.length + 1 : args.length; - var hasTooManyArguments = !signature.hasRestParameter && numberOfArgs > signature.parameters.length; - var hasRightNumberOfTypeArguments = !node.typeArguments || (signature.typeParameters && node.typeArguments.length === signature.typeParameters.length); - if (hasTooManyArguments || !hasRightNumberOfTypeArguments) { - return false; - } - var callIsIncomplete = args.end === node.end; - var hasEnoughArguments = numberOfArgs >= signature.minArgumentCount; - return callIsIncomplete || hasEnoughArguments; - } - function getSingleCallSignature(type) { - if (type.flags & ts.TypeFlags.ObjectType) { - var resolved = resolveObjectTypeMembers(type); - if (resolved.callSignatures.length === 1 && resolved.constructSignatures.length === 0 && resolved.properties.length === 0 && !resolved.stringIndexType && !resolved.numberIndexType) { - return resolved.callSignatures[0]; - } - } - return undefined; - } - function instantiateSignatureInContextOf(signature, contextualSignature, contextualMapper) { - var context = createInferenceContext(signature.typeParameters); - forEachMatchingParameterType(contextualSignature, signature, function (source, target) { - inferTypes(context, instantiateType(source, contextualMapper), target); - }); - return getSignatureInstantiation(signature, getInferredTypes(context)); - } - function inferTypeArguments(signature, args, excludeArgument) { - var typeParameters = signature.typeParameters; - var context = createInferenceContext(typeParameters); - var mapper = createInferenceMapper(context); - for (var i = 0; i < args.length; i++) { - if (args[i].kind === 147 /* OmittedExpression */) { - continue; - } - if (!excludeArgument || excludeArgument[i] === undefined) { - var parameterType = getTypeAtPosition(signature, i); - inferTypes(context, checkExpressionWithContextualType(args[i], parameterType, mapper), parameterType); - } - } - if (excludeArgument) { - for (var i = 0; i < args.length; i++) { - if (args[i].kind === 147 /* OmittedExpression */) { - continue; - } - if (excludeArgument[i] === false) { - var parameterType = getTypeAtPosition(signature, i); - inferTypes(context, checkExpressionWithContextualType(args[i], parameterType, mapper), parameterType); - } - } - } - return getInferredTypes(context); - } - function checkTypeArguments(signature, typeArguments) { - var typeParameters = signature.typeParameters; - var result = []; - for (var i = 0; i < typeParameters.length; i++) { - var typeArgNode = typeArguments[i]; - var typeArgument = getTypeFromTypeNode(typeArgNode); - var constraint = getConstraintOfTypeParameter(typeParameters[i]); - if (constraint && fullTypeCheck) { - checkTypeAssignableTo(typeArgument, constraint, typeArgNode, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1_Colon, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); - } - result.push(typeArgument); - } - return result; - } - function checkApplicableSignature(node, signature, relation, excludeArgument, reportErrors) { - if (node.arguments) { - for (var i = 0; i < node.arguments.length; i++) { - var arg = node.arguments[i]; - if (arg.kind === 147 /* OmittedExpression */) { - continue; - } - var paramType = getTypeAtPosition(signature, i); - var argType = arg.kind === 7 /* StringLiteral */ && !reportErrors ? getStringLiteralType(arg) : checkExpressionWithContextualType(arg, paramType, excludeArgument && excludeArgument[i] ? identityMapper : undefined); - var isValidArgument = checkTypeRelatedTo(argType, paramType, relation, reportErrors ? arg : undefined, ts.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1, ts.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1); - if (!isValidArgument) { - return false; - } - } - } - return true; - } - function resolveCall(node, signatures, candidatesOutArray) { - ts.forEach(node.typeArguments, checkSourceElement); - var candidates = candidatesOutArray || []; - collectCandidates(); - if (!candidates.length) { - error(node, ts.Diagnostics.Supplied_parameters_do_not_match_any_signature_of_call_target); - return resolveErrorCall(node); - } - var args = node.arguments || emptyArray; - var excludeArgument; - for (var i = 0; i < args.length; i++) { - if (isContextSensitiveExpression(args[i])) { - if (!excludeArgument) - excludeArgument = new Array(args.length); - excludeArgument[i] = true; - } - } - var relation = candidates.length === 1 ? assignableRelation : subtypeRelation; - while (true) { - for (var i = 0; i < candidates.length; i++) { - if (!signatureHasCorrectArity(node, candidates[i])) { - continue; - } - while (true) { - var candidateWithCorrectArity = candidates[i]; - if (candidateWithCorrectArity.typeParameters) { - var typeArguments = node.typeArguments ? checkTypeArguments(candidateWithCorrectArity, node.typeArguments) : inferTypeArguments(candidateWithCorrectArity, args, excludeArgument); - candidateWithCorrectArity = getSignatureInstantiation(candidateWithCorrectArity, typeArguments); - } - if (!checkApplicableSignature(node, candidateWithCorrectArity, relation, excludeArgument, false)) { - break; - } - var index = excludeArgument ? ts.indexOf(excludeArgument, true) : -1; - if (index < 0) { - return candidateWithCorrectArity; - } - excludeArgument[index] = false; - } - } - if (relation === assignableRelation) { - break; - } - relation = assignableRelation; - } - if (candidateWithCorrectArity) { - checkApplicableSignature(node, candidateWithCorrectArity, relation, undefined, true); - } - else { - error(node, ts.Diagnostics.Supplied_parameters_do_not_match_any_signature_of_call_target); - } - if (!fullTypeCheck) { - for (var i = 0, n = candidates.length; i < n; i++) { - if (signatureHasCorrectArity(node, candidates[i])) { - return candidates[i]; - } - } - } - return resolveErrorCall(node); - function collectCandidates() { - var result = candidates; - var lastParent; - var lastSymbol; - var cutoffPos = 0; - var pos; - ts.Debug.assert(!result.length); - for (var i = 0; i < signatures.length; i++) { - var signature = signatures[i]; - if (true) { - var symbol = signature.declaration && getSymbolOfNode(signature.declaration); - var parent = signature.declaration && signature.declaration.parent; - if (!lastSymbol || symbol === lastSymbol) { - if (lastParent && parent === lastParent) { - pos++; - } - else { - lastParent = parent; - pos = cutoffPos; - } - } - else { - pos = cutoffPos = result.length; - lastParent = parent; - } - lastSymbol = symbol; - for (var j = result.length; j > pos; j--) { - result[j] = result[j - 1]; - } - result[pos] = signature; - } - } - } - } - function resolveCallExpression(node, candidatesOutArray) { - if (node.func.kind === 85 /* SuperKeyword */) { - var superType = checkSuperExpression(node.func); - if (superType !== unknownType) { - return resolveCall(node, getSignaturesOfType(superType, 1 /* Construct */), candidatesOutArray); - } - return resolveUntypedCall(node); - } - var funcType = checkExpression(node.func); - if (funcType === unknownType) { - return resolveErrorCall(node); - } - var apparentType = getApparentType(funcType); - if (apparentType === unknownType) { - return resolveErrorCall(node); - } - var callSignatures = getSignaturesOfType(apparentType, 0 /* Call */); - var constructSignatures = getSignaturesOfType(apparentType, 1 /* Construct */); - if ((funcType === anyType) || (!callSignatures.length && !constructSignatures.length && isTypeAssignableTo(funcType, globalFunctionType))) { - if (node.typeArguments) { - error(node, ts.Diagnostics.Untyped_function_calls_may_not_accept_type_arguments); - } - return resolveUntypedCall(node); - } - if (!callSignatures.length) { - if (constructSignatures.length) { - error(node, ts.Diagnostics.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new, typeToString(funcType)); - } - else { - error(node, ts.Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature); - } - return resolveErrorCall(node); - } - return resolveCall(node, callSignatures, candidatesOutArray); - } - function resolveNewExpression(node, candidatesOutArray) { - var expressionType = checkExpression(node.func); - if (expressionType === unknownType) { - return resolveErrorCall(node); - } - if (expressionType === anyType) { - if (node.typeArguments) { - error(node, ts.Diagnostics.Untyped_function_calls_may_not_accept_type_arguments); - } - return resolveUntypedCall(node); - } - expressionType = getApparentType(expressionType); - if (expressionType === unknownType) { - return resolveErrorCall(node); - } - var constructSignatures = getSignaturesOfType(expressionType, 1 /* Construct */); - if (constructSignatures.length) { - return resolveCall(node, constructSignatures, candidatesOutArray); - } - var callSignatures = getSignaturesOfType(expressionType, 0 /* Call */); - if (callSignatures.length) { - var signature = resolveCall(node, callSignatures, candidatesOutArray); - if (getReturnTypeOfSignature(signature) !== voidType) { - error(node, ts.Diagnostics.Only_a_void_function_can_be_called_with_the_new_keyword); - } - return signature; - } - error(node, ts.Diagnostics.Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature); - return resolveErrorCall(node); - } - function getResolvedSignature(node, candidatesOutArray) { - var links = getNodeLinks(node); - if (!links.resolvedSignature || candidatesOutArray) { - links.resolvedSignature = anySignature; - links.resolvedSignature = node.kind === 137 /* CallExpression */ ? resolveCallExpression(node, candidatesOutArray) : resolveNewExpression(node, candidatesOutArray); - } - return links.resolvedSignature; - } - function checkCallExpression(node) { - var signature = getResolvedSignature(node); - if (node.func.kind === 85 /* SuperKeyword */) { - return voidType; - } - if (node.kind === 138 /* NewExpression */) { - var declaration = signature.declaration; - if (declaration && (declaration.kind !== 121 /* Constructor */ && declaration.kind !== 125 /* ConstructSignature */)) { - if (compilerOptions.noImplicitAny) { - error(node, ts.Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type); - } - return anyType; - } - } - return getReturnTypeOfSignature(signature); - } - function checkTypeAssertion(node) { - var exprType = checkExpression(node.operand); - var targetType = getTypeFromTypeNode(node.type); - if (fullTypeCheck && targetType !== unknownType) { - var widenedType = getWidenedType(exprType, true); - if (!(isTypeAssignableTo(targetType, widenedType))) { - checkTypeAssignableTo(exprType, targetType, node, ts.Diagnostics.Neither_type_0_nor_type_1_is_assignable_to_the_other_Colon, ts.Diagnostics.Neither_type_0_nor_type_1_is_assignable_to_the_other); - } - } - return targetType; - } - function getTypeAtPosition(signature, pos) { - return signature.hasRestParameter ? pos < signature.parameters.length - 1 ? getTypeOfSymbol(signature.parameters[pos]) : getRestTypeOfSignature(signature) : pos < signature.parameters.length ? getTypeOfSymbol(signature.parameters[pos]) : anyType; - } - function assignContextualParameterTypes(signature, context, mapper) { - var len = signature.parameters.length - (signature.hasRestParameter ? 1 : 0); - for (var i = 0; i < len; i++) { - var parameter = signature.parameters[i]; - var links = getSymbolLinks(parameter); - links.type = instantiateType(getTypeAtPosition(context, i), mapper); - } - if (signature.hasRestParameter && context.hasRestParameter && signature.parameters.length >= context.parameters.length) { - var parameter = signature.parameters[signature.parameters.length - 1]; - var links = getSymbolLinks(parameter); - links.type = instantiateType(getTypeOfSymbol(context.parameters[context.parameters.length - 1]), mapper); - } - } - function getReturnTypeFromBody(func, contextualMapper) { - if (func.body.kind !== 173 /* FunctionBlock */) { - var unwidenedType = checkAndMarkExpression(func.body, contextualMapper); - var widenedType = getWidenedType(unwidenedType); - if (fullTypeCheck && compilerOptions.noImplicitAny && widenedType !== unwidenedType && getInnermostTypeOfNestedArrayTypes(widenedType) === anyType) { - error(func, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeToString(widenedType)); - } - return widenedType; - } - var types = checkAndAggregateReturnExpressionTypes(func.body, contextualMapper); - if (types.length > 0) { - var commonType = getBestCommonType(types, undefined, true); - if (!commonType) { - error(func, ts.Diagnostics.No_best_common_type_exists_among_return_expressions); - return unknownType; - } - var widenedType = getWidenedType(commonType); - if (fullTypeCheck && compilerOptions.noImplicitAny && widenedType !== commonType && getInnermostTypeOfNestedArrayTypes(widenedType) === anyType) { - var typeName = typeToString(widenedType); - if (func.name) { - error(func, ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type, ts.identifierToString(func.name), typeName); - } - else { - error(func, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeName); - } - } - return widenedType; - } - return voidType; - } - function checkAndAggregateReturnExpressionTypes(body, contextualMapper) { - var aggregatedTypes = []; - ts.forEachReturnStatement(body, function (returnStatement) { - var expr = returnStatement.expression; - if (expr) { - var type = checkAndMarkExpression(expr, contextualMapper); - if (!ts.contains(aggregatedTypes, type)) { - aggregatedTypes.push(type); - } - } - }); - return aggregatedTypes; - } - function bodyContainsAReturnStatement(funcBody) { - return ts.forEachReturnStatement(funcBody, function (returnStatement) { - return true; - }); - } - function bodyContainsSingleThrowStatement(body) { - return (body.statements.length === 1) && (body.statements[0].kind === 165 /* ThrowStatement */); - } - function checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(func, returnType) { - if (!fullTypeCheck) { - return; - } - if (returnType === voidType || returnType === anyType) { - return; - } - if (!func.body || func.body.kind !== 173 /* FunctionBlock */) { - return; - } - var bodyBlock = func.body; - if (bodyContainsAReturnStatement(bodyBlock)) { - return; - } - if (bodyContainsSingleThrowStatement(bodyBlock)) { - return; - } - error(func.type, ts.Diagnostics.A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_or_consist_of_a_single_throw_statement); - } - function checkFunctionExpression(node, contextualMapper) { - if (contextualMapper === identityMapper) { - return anyFunctionType; - } - var links = getNodeLinks(node); - var type = getTypeOfSymbol(node.symbol); - if (!(links.flags & 64 /* ContextChecked */)) { - var contextualSignature = getContextualSignature(node); - if (!(links.flags & 64 /* ContextChecked */)) { - links.flags |= 64 /* ContextChecked */; - if (contextualSignature) { - var signature = getSignaturesOfType(type, 0 /* Call */)[0]; - if (isContextSensitiveExpression(node)) { - assignContextualParameterTypes(signature, contextualSignature, contextualMapper || identityMapper); - } - if (!node.type) { - signature.resolvedReturnType = resolvingType; - var returnType = getReturnTypeFromBody(node, contextualMapper); - if (signature.resolvedReturnType === resolvingType) { - signature.resolvedReturnType = returnType; - } - } - } - checkSignatureDeclaration(node); - } - } - return type; - } - function checkFunctionExpressionBody(node) { - if (node.type) { - checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNode(node.type)); - } - if (node.body.kind === 173 /* FunctionBlock */) { - checkSourceElement(node.body); - } - else { - var exprType = checkExpression(node.body); - if (node.type) { - checkTypeAssignableTo(exprType, getTypeFromTypeNode(node.type), node.body, undefined, undefined); - } - checkFunctionExpressionBodies(node.body); - } - } - function checkArithmeticOperandType(operand, type, diagnostic) { - if (!(type.flags & (1 /* Any */ | ts.TypeFlags.NumberLike))) { - error(operand, diagnostic); - return false; - } - return true; - } - function checkReferenceExpression(n, message) { - function findSymbol(n) { - var symbol = getNodeLinks(n).resolvedSymbol; - return symbol && getExportSymbolOfValueSymbolIfExported(symbol); - } - function isReferenceOrErrorExpression(n) { - switch (n.kind) { - case 59 /* Identifier */: - var symbol = findSymbol(n); - return !symbol || symbol === unknownSymbol || symbol === argumentsSymbol || (symbol.flags & 1 /* Variable */) !== 0; - case 135 /* PropertyAccess */: - var symbol = findSymbol(n); - return !symbol || symbol === unknownSymbol || (symbol.flags & ~4 /* EnumMember */) !== 0; - case 136 /* IndexedAccess */: - return true; - case 140 /* ParenExpression */: - return isReferenceOrErrorExpression(n.expression); - default: - return false; - } - } - if (!isReferenceOrErrorExpression(n)) { - error(n, message); - return false; - } - return true; - } - function checkPrefixExpression(node) { - var operandType = checkExpression(node.operand); - switch (node.operator) { - case 28 /* PlusToken */: - case 29 /* MinusToken */: - case 42 /* TildeToken */: - return numberType; - case 41 /* ExclamationToken */: - case 68 /* DeleteKeyword */: - return booleanType; - case 91 /* TypeOfKeyword */: - return stringType; - case 93 /* VoidKeyword */: - return undefinedType; - case 33 /* PlusPlusToken */: - case 34 /* MinusMinusToken */: - var ok = checkArithmeticOperandType(node.operand, operandType, ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); - if (ok) { - checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer); - } - return numberType; - } - return unknownType; - } - function checkPostfixExpression(node) { - var operandType = checkExpression(node.operand); - var ok = checkArithmeticOperandType(node.operand, operandType, ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); - if (ok) { - checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer); - } - return numberType; - } - function isTypeAnyTypeObjectTypeOrTypeParameter(type) { - return type === anyType || ((type.flags & (ts.TypeFlags.ObjectType | 512 /* TypeParameter */)) !== 0); - } - function checkInstanceOfExpression(node, leftType, rightType) { - if (leftType !== unknownType && !isTypeAnyTypeObjectTypeOrTypeParameter(leftType)) { - error(node.left, ts.Diagnostics.The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); - } - if (rightType !== unknownType && rightType !== anyType && !isTypeSubtypeOf(rightType, globalFunctionType)) { - error(node.right, ts.Diagnostics.The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type); - } - return booleanType; - } - function checkInExpression(node, leftType, rightType) { - if (leftType !== anyType && leftType !== stringType && leftType !== numberType) { - error(node.left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_types_any_string_or_number); - } - if (!isTypeAnyTypeObjectTypeOrTypeParameter(rightType)) { - error(node.right, ts.Diagnostics.The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); - } - return booleanType; - } - function checkBinaryExpression(node, contextualMapper) { - var operator = node.operator; - var leftType = checkExpression(node.left, contextualMapper); - var rightType = checkExpression(node.right, contextualMapper); - switch (operator) { - case 30 /* AsteriskToken */: - case 50 /* AsteriskEqualsToken */: - case 31 /* SlashToken */: - case 51 /* SlashEqualsToken */: - case 32 /* PercentToken */: - case 52 /* PercentEqualsToken */: - case 29 /* MinusToken */: - case 49 /* MinusEqualsToken */: - case 35 /* LessThanLessThanToken */: - case 53 /* LessThanLessThanEqualsToken */: - case 36 /* GreaterThanGreaterThanToken */: - case 54 /* GreaterThanGreaterThanEqualsToken */: - case 37 /* GreaterThanGreaterThanGreaterThanToken */: - case 55 /* GreaterThanGreaterThanGreaterThanEqualsToken */: - case 39 /* BarToken */: - case 57 /* BarEqualsToken */: - case 40 /* CaretToken */: - case 58 /* CaretEqualsToken */: - case 38 /* AmpersandToken */: - case 56 /* AmpersandEqualsToken */: - if (leftType.flags & (32 /* Undefined */ | 64 /* Null */)) - leftType = rightType; - if (rightType.flags & (32 /* Undefined */ | 64 /* Null */)) - rightType = leftType; - var suggestedOperator; - if ((leftType.flags & 8 /* Boolean */) && (rightType.flags & 8 /* Boolean */) && (suggestedOperator = getSuggestedBooleanOperator(node.operator)) !== undefined) { - error(node, ts.Diagnostics.The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead, ts.tokenToString(node.operator), ts.tokenToString(suggestedOperator)); - } - else { - var leftOk = checkArithmeticOperandType(node.left, leftType, ts.Diagnostics.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type); - var rightOk = checkArithmeticOperandType(node.right, rightType, ts.Diagnostics.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type); - if (leftOk && rightOk) { - checkAssignmentOperator(numberType); - } - } - return numberType; - case 28 /* PlusToken */: - case 48 /* PlusEqualsToken */: - if (leftType.flags & (32 /* Undefined */ | 64 /* Null */)) - leftType = rightType; - if (rightType.flags & (32 /* Undefined */ | 64 /* Null */)) - rightType = leftType; - var resultType; - if (leftType.flags & ts.TypeFlags.NumberLike && rightType.flags & ts.TypeFlags.NumberLike) { - resultType = numberType; - } - else if (leftType.flags & ts.TypeFlags.StringLike || rightType.flags & ts.TypeFlags.StringLike) { - resultType = stringType; - } - else if (leftType.flags & 1 /* Any */ || leftType === unknownType || rightType.flags & 1 /* Any */ || rightType === unknownType) { - resultType = anyType; - } - if (!resultType) { - reportOperatorError(); - return anyType; - } - if (operator === 48 /* PlusEqualsToken */) { - checkAssignmentOperator(resultType); - } - return resultType; - case 23 /* EqualsEqualsToken */: - case 24 /* ExclamationEqualsToken */: - case 25 /* EqualsEqualsEqualsToken */: - case 26 /* ExclamationEqualsEqualsToken */: - case 19 /* LessThanToken */: - case 20 /* GreaterThanToken */: - case 21 /* LessThanEqualsToken */: - case 22 /* GreaterThanEqualsToken */: - if (!isTypeSubtypeOf(leftType, rightType) && !isTypeSubtypeOf(rightType, leftType)) { - reportOperatorError(); - } - return booleanType; - case 81 /* InstanceOfKeyword */: - return checkInstanceOfExpression(node, leftType, rightType); - case 80 /* InKeyword */: - return checkInExpression(node, leftType, rightType); - case 43 /* AmpersandAmpersandToken */: - return rightType; - case 44 /* BarBarToken */: - return getBestCommonType([leftType, rightType], isInferentialContext(contextualMapper) ? undefined : getContextualType(node)); - case 47 /* EqualsToken */: - checkAssignmentOperator(rightType); - return rightType; - case 18 /* CommaToken */: - return rightType; - } - function getSuggestedBooleanOperator(operator) { - switch (operator) { - case 39 /* BarToken */: - case 57 /* BarEqualsToken */: - return 44 /* BarBarToken */; - case 40 /* CaretToken */: - case 58 /* CaretEqualsToken */: - return 26 /* ExclamationEqualsEqualsToken */; - case 38 /* AmpersandToken */: - case 56 /* AmpersandEqualsToken */: - return 43 /* AmpersandAmpersandToken */; - default: - return undefined; - } - } - function checkAssignmentOperator(valueType) { - if (fullTypeCheck && operator >= ts.SyntaxKind.FirstAssignment && operator <= ts.SyntaxKind.LastAssignment) { - var ok = checkReferenceExpression(node.left, ts.Diagnostics.Invalid_left_hand_side_of_assignment_expression); - if (ok) { - checkTypeAssignableTo(valueType, leftType, node.left, undefined, undefined); - } - } - } - function reportOperatorError() { - error(node, ts.Diagnostics.Operator_0_cannot_be_applied_to_types_1_and_2, ts.tokenToString(node.operator), typeToString(leftType), typeToString(rightType)); - } - } - function checkConditionalExpression(node, contextualMapper) { - checkExpression(node.condition); - var type1 = checkExpression(node.whenTrue, contextualMapper); - var type2 = checkExpression(node.whenFalse, contextualMapper); - var contextualType = isInferentialContext(contextualMapper) ? undefined : getContextualType(node); - var resultType = getBestCommonType([type1, type2], contextualType, true); - if (!resultType) { - if (contextualType) { - error(node, ts.Diagnostics.No_best_common_type_exists_between_0_1_and_2, typeToString(contextualType), typeToString(type1), typeToString(type2)); - } - else { - error(node, ts.Diagnostics.No_best_common_type_exists_between_0_and_1, typeToString(type1), typeToString(type2)); - } - resultType = emptyObjectType; - } - return resultType; - } - function checkExpressionWithContextualType(node, contextualType, contextualMapper) { - var saveContextualType = node.contextualType; - node.contextualType = contextualType; - var result = checkExpression(node, contextualMapper); - node.contextualType = saveContextualType; - return result; - } - function checkAndMarkExpression(node, contextualMapper) { - var result = checkExpression(node, contextualMapper); - getNodeLinks(node).flags |= 1 /* TypeChecked */; - return result; - } - function checkExpression(node, contextualMapper) { - var type = checkExpressionNode(node, contextualMapper); - if (contextualMapper && contextualMapper !== identityMapper) { - var signature = getSingleCallSignature(type); - if (signature && signature.typeParameters) { - var contextualType = getContextualType(node); - if (contextualType) { - var contextualSignature = getSingleCallSignature(contextualType); - if (contextualSignature && !contextualSignature.typeParameters) { - type = getOrCreateTypeFromSignature(instantiateSignatureInContextOf(signature, contextualSignature, contextualMapper)); - } - } - } - } - return type; - } - function checkExpressionNode(node, contextualMapper) { - switch (node.kind) { - case 59 /* Identifier */: - return checkIdentifier(node); - case 87 /* ThisKeyword */: - return checkThisExpression(node); - case 85 /* SuperKeyword */: - return checkSuperExpression(node); - case 83 /* NullKeyword */: - return nullType; - case 89 /* TrueKeyword */: - case 74 /* FalseKeyword */: - return booleanType; - case 6 /* NumericLiteral */: - return numberType; - case 7 /* StringLiteral */: - return stringType; - case 8 /* RegularExpressionLiteral */: - return globalRegExpType; - case 116 /* QualifiedName */: - return checkPropertyAccess(node); - case 132 /* ArrayLiteral */: - return checkArrayLiteral(node, contextualMapper); - case 133 /* ObjectLiteral */: - return checkObjectLiteral(node, contextualMapper); - case 135 /* PropertyAccess */: - return checkPropertyAccess(node); - case 136 /* IndexedAccess */: - return checkIndexedAccess(node); - case 137 /* CallExpression */: - case 138 /* NewExpression */: - return checkCallExpression(node); - case 139 /* TypeAssertion */: - return checkTypeAssertion(node); - case 140 /* ParenExpression */: - return checkExpression(node.expression); - case 141 /* FunctionExpression */: - case 142 /* ArrowFunction */: - return checkFunctionExpression(node, contextualMapper); - case 143 /* PrefixOperator */: - return checkPrefixExpression(node); - case 144 /* PostfixOperator */: - return checkPostfixExpression(node); - case 145 /* BinaryExpression */: - return checkBinaryExpression(node, contextualMapper); - case 146 /* ConditionalExpression */: - return checkConditionalExpression(node, contextualMapper); - } - return unknownType; - } - function checkTypeParameter(node) { - checkSourceElement(node.constraint); - if (fullTypeCheck) { - checkTypeParameterHasIllegalReferencesInConstraint(node); - checkTypeNameIsReserved(node.name, ts.Diagnostics.Type_parameter_name_cannot_be_0); - } - } - function checkParameter(parameterDeclaration) { - checkVariableDeclaration(parameterDeclaration); - if (fullTypeCheck) { - checkCollisionWithIndexVariableInGeneratedCode(parameterDeclaration, parameterDeclaration.name); - if (parameterDeclaration.flags & (16 /* Public */ | 32 /* Private */ | 64 /* Protected */) && !(parameterDeclaration.parent.kind === 121 /* Constructor */ && parameterDeclaration.parent.body)) { - error(parameterDeclaration, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); - } - if (parameterDeclaration.flags & 8 /* Rest */) { - if (!isArrayType(getTypeOfSymbol(parameterDeclaration.symbol))) { - error(parameterDeclaration, ts.Diagnostics.A_rest_parameter_must_be_of_an_array_type); - } - } - else { - if (parameterDeclaration.initializer && !parameterDeclaration.parent.body) { - error(parameterDeclaration, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); - } - } - } - function checkReferencesInInitializer(n) { - if (n.kind === 59 /* Identifier */) { - var referencedSymbol = getNodeLinks(n).resolvedSymbol; - if (referencedSymbol && referencedSymbol !== unknownSymbol && getSymbol(parameterDeclaration.parent.locals, referencedSymbol.name, ts.SymbolFlags.Value) === referencedSymbol) { - if (referencedSymbol.valueDeclaration.kind === 118 /* Parameter */) { - if (referencedSymbol.valueDeclaration === parameterDeclaration) { - error(n, ts.Diagnostics.Parameter_0_cannot_be_referenced_in_its_initializer, ts.identifierToString(parameterDeclaration.name)); - return; - } - var enclosingOrReferencedParameter = ts.forEach(parameterDeclaration.parent.parameters, function (p) { return p === parameterDeclaration || p === referencedSymbol.valueDeclaration ? p : undefined; }); - if (enclosingOrReferencedParameter === referencedSymbol.valueDeclaration) { - return; - } - } - error(n, ts.Diagnostics.Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it, ts.identifierToString(parameterDeclaration.name), ts.identifierToString(n)); - } - } - else { - ts.forEachChild(n, checkReferencesInInitializer); - } - } - if (parameterDeclaration.initializer) { - checkReferencesInInitializer(parameterDeclaration.initializer); - } - } - function checkSignatureDeclaration(node) { - checkTypeParameters(node.typeParameters); - ts.forEach(node.parameters, checkParameter); - if (node.type) { - checkSourceElement(node.type); - } - if (fullTypeCheck) { - checkCollisionWithCapturedSuperVariable(node, node.name); - checkCollisionWithCapturedThisVariable(node, node.name); - checkCollisionWithRequireExportsInGeneratedCode(node, node.name); - checkCollisionWithArgumentsInGeneratedCode(node); - if (compilerOptions.noImplicitAny && !node.type) { - switch (node.kind) { - case 125 /* ConstructSignature */: - error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); - break; - case 124 /* CallSignature */: - error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); - break; - } - } - } - checkSpecializedSignatureDeclaration(node); - } - function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 175 /* InterfaceDeclaration */) { - var nodeSymbol = getSymbolOfNode(node); - if (nodeSymbol.declarations.length > 0 && nodeSymbol.declarations[0] !== node) { - return; - } - } - var indexSymbol = getIndexSymbol(getSymbolOfNode(node)); - if (indexSymbol) { - var seenNumericIndexer = false; - var seenStringIndexer = false; - for (var i = 0, len = indexSymbol.declarations.length; i < len; ++i) { - var declaration = indexSymbol.declarations[i]; - if (declaration.parameters.length == 1 && declaration.parameters[0].type) { - switch (declaration.parameters[0].type.kind) { - case 114 /* StringKeyword */: - if (!seenStringIndexer) { - seenStringIndexer = true; - } - else { - error(declaration, ts.Diagnostics.Duplicate_string_index_signature); - } - break; - case 112 /* NumberKeyword */: - if (!seenNumericIndexer) { - seenNumericIndexer = true; - } - else { - error(declaration, ts.Diagnostics.Duplicate_number_index_signature); - } - break; - } - } - } - } - } - function checkPropertyDeclaration(node) { - checkVariableDeclaration(node); - } - function checkMethodDeclaration(node) { - checkFunctionDeclaration(node); - } - function checkConstructorDeclaration(node) { - checkSignatureDeclaration(node); - checkSourceElement(node.body); - var symbol = getSymbolOfNode(node); - var firstDeclaration = getDeclarationOfKind(symbol, node.kind); - if (node === firstDeclaration) { - checkFunctionOrConstructorSymbol(symbol); - } - if (!node.body) { - return; - } - if (!fullTypeCheck) { - return; - } - function isSuperCallExpression(n) { - return n.kind === 137 /* CallExpression */ && n.func.kind === 85 /* SuperKeyword */; - } - function containsSuperCall(n) { - if (isSuperCallExpression(n)) { - return true; - } - switch (n.kind) { - case 141 /* FunctionExpression */: - case 172 /* FunctionDeclaration */: - case 142 /* ArrowFunction */: - case 133 /* ObjectLiteral */: - return false; - default: - return ts.forEachChild(n, containsSuperCall); - } - } - function markThisReferencesAsErrors(n) { - if (n.kind === 87 /* ThisKeyword */) { - error(n, ts.Diagnostics.this_cannot_be_referenced_in_current_location); - } - else if (n.kind !== 141 /* FunctionExpression */ && n.kind !== 172 /* FunctionDeclaration */) { - ts.forEachChild(n, markThisReferencesAsErrors); - } - } - function isInstancePropertyWithInitializer(n) { - return n.kind === 119 /* Property */ && !(n.flags & 128 /* Static */) && !!n.initializer; - } - if (node.parent.baseType) { - if (containsSuperCall(node.body)) { - var superCallShouldBeFirst = ts.forEach(node.parent.members, isInstancePropertyWithInitializer) || ts.forEach(node.parameters, function (p) { return p.flags & (16 /* Public */ | 32 /* Private */ | 64 /* Protected */); }); - if (superCallShouldBeFirst) { - var statements = node.body.statements; - if (!statements.length || statements[0].kind !== 151 /* ExpressionStatement */ || !isSuperCallExpression(statements[0].expression)) { - error(node, ts.Diagnostics.A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties); - } - else { - markThisReferencesAsErrors(statements[0].expression); - } - } - } - else { - error(node, ts.Diagnostics.Constructors_for_derived_classes_must_contain_a_super_call); - } - } - } - function checkAccessorDeclaration(node) { - if (fullTypeCheck) { - if (node.kind === 122 /* GetAccessor */) { - if (!ts.isInAmbientContext(node) && node.body && !(bodyContainsAReturnStatement(node.body) || bodyContainsSingleThrowStatement(node.body))) { - error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value_or_consist_of_a_single_throw_statement); - } - } - var otherKind = node.kind === 122 /* GetAccessor */ ? 123 /* SetAccessor */ : 122 /* GetAccessor */; - var otherAccessor = getDeclarationOfKind(node.symbol, otherKind); - if (otherAccessor) { - if (((node.flags & ts.NodeFlags.AccessibilityModifier) !== (otherAccessor.flags & ts.NodeFlags.AccessibilityModifier))) { - error(node.name, ts.Diagnostics.Getter_and_setter_accessors_do_not_agree_in_visibility); - } - var thisType = getAnnotatedAccessorType(node); - var otherType = getAnnotatedAccessorType(otherAccessor); - if (thisType && otherType) { - if (!isTypeIdenticalTo(thisType, otherType)) { - error(node, ts.Diagnostics.get_and_set_accessor_must_have_the_same_type); - } - } - } - } - checkFunctionDeclaration(node); - checkAndStoreTypeOfAccessors(getSymbolOfNode(node)); - } - function checkTypeReference(node) { - var type = getTypeFromTypeReferenceNode(node); - if (type !== unknownType && node.typeArguments) { - var len = node.typeArguments.length; - for (var i = 0; i < len; i++) { - checkSourceElement(node.typeArguments[i]); - var constraint = getConstraintOfTypeParameter(type.target.typeParameters[i]); - if (fullTypeCheck && constraint) { - var typeArgument = type.typeArguments[i]; - checkTypeAssignableTo(typeArgument, constraint, node, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1_Colon, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); - } - } - } - } - function checkTypeQuery(node) { - getTypeFromTypeQueryNode(node); - } - function checkTypeLiteral(node) { - ts.forEach(node.members, checkSourceElement); - if (fullTypeCheck) { - var type = getTypeFromTypeLiteralNode(node); - checkIndexConstraints(type); - checkTypeForDuplicateIndexSignatures(node); - } - } - function checkArrayType(node) { - checkSourceElement(node.elementType); - } - function checkTupleType(node) { - ts.forEach(node.elementTypes, checkSourceElement); - } - function isPrivateWithinAmbient(node) { - return (node.flags & 32 /* Private */) && ts.isInAmbientContext(node); - } - function checkSpecializedSignatureDeclaration(signatureDeclarationNode) { - if (!fullTypeCheck) { - return; - } - var signature = getSignatureFromDeclaration(signatureDeclarationNode); - if (!signature.hasStringLiterals) { - return; - } - if (signatureDeclarationNode.body) { - error(signatureDeclarationNode, ts.Diagnostics.A_signature_with_an_implementation_cannot_use_a_string_literal_type); - return; - } - var symbol = getSymbolOfNode(signatureDeclarationNode); - var signaturesToCheck; - if (!signatureDeclarationNode.name && signatureDeclarationNode.parent && signatureDeclarationNode.parent.kind === 175 /* InterfaceDeclaration */) { - ts.Debug.assert(signatureDeclarationNode.kind === 124 /* CallSignature */ || signatureDeclarationNode.kind === 125 /* ConstructSignature */); - var signatureKind = signatureDeclarationNode.kind === 124 /* CallSignature */ ? 0 /* Call */ : 1 /* Construct */; - var containingSymbol = getSymbolOfNode(signatureDeclarationNode.parent); - var containingType = getDeclaredTypeOfSymbol(containingSymbol); - signaturesToCheck = getSignaturesOfType(containingType, signatureKind); - } - else { - signaturesToCheck = getSignaturesOfSymbol(getSymbolOfNode(signatureDeclarationNode)); - } - for (var i = 0; i < signaturesToCheck.length; i++) { - var otherSignature = signaturesToCheck[i]; - if (!otherSignature.hasStringLiterals && isSignatureAssignableTo(signature, otherSignature)) { - return; - } - } - error(signatureDeclarationNode, ts.Diagnostics.Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature); - } - function getEffectiveDeclarationFlags(n, flagsToCheck) { - var flags = n.flags; - if (n.parent.kind !== 175 /* InterfaceDeclaration */ && ts.isInAmbientContext(n)) { - if (!(flags & 2 /* Ambient */)) { - flags |= 1 /* Export */; - } - flags |= 2 /* Ambient */; - } - return flags & flagsToCheck; - } - function checkFunctionOrConstructorSymbol(symbol) { - if (!fullTypeCheck) { - return; - } - function checkFlagAgreementBetweenOverloads(overloads, implementation, flagsToCheck, someOverloadFlags, allOverloadFlags) { - var someButNotAllOverloadFlags = someOverloadFlags ^ allOverloadFlags; - if (someButNotAllOverloadFlags !== 0) { - var implementationSharesContainerWithFirstOverload = implementation !== undefined && implementation.parent === overloads[0].parent; - var canonicalFlags = implementationSharesContainerWithFirstOverload ? getEffectiveDeclarationFlags(implementation, flagsToCheck) : getEffectiveDeclarationFlags(overloads[0], flagsToCheck); - ts.forEach(overloads, function (o) { - var deviation = getEffectiveDeclarationFlags(o, flagsToCheck) ^ canonicalFlags; - if (deviation & 1 /* Export */) { - error(o.name, ts.Diagnostics.Overload_signatures_must_all_be_exported_or_not_exported); - } - else if (deviation & 2 /* Ambient */) { - error(o.name, ts.Diagnostics.Overload_signatures_must_all_be_ambient_or_non_ambient); - } - else if (deviation & (32 /* Private */ | 64 /* Protected */)) { - error(o.name, ts.Diagnostics.Overload_signatures_must_all_be_public_private_or_protected); - } - else if (deviation & 4 /* QuestionMark */) { - error(o.name, ts.Diagnostics.Overload_signatures_must_all_be_optional_or_required); - } - }); - } - } - var flagsToCheck = 1 /* Export */ | 2 /* Ambient */ | 32 /* Private */ | 64 /* Protected */ | 4 /* QuestionMark */; - var someNodeFlags = 0; - var allNodeFlags = flagsToCheck; - var hasOverloads = false; - var bodyDeclaration; - var lastSeenNonAmbientDeclaration; - var previousDeclaration; - var declarations = symbol.declarations; - var isConstructor = (symbol.flags & 4096 /* Constructor */) !== 0; - function reportImplementationExpectedError(node) { - if (node.name && node.name.kind === 115 /* Missing */) { - return; - } - var seen = false; - var subsequentNode = ts.forEachChild(node.parent, function (c) { - if (seen) { - return c; - } - else { - seen = c === node; - } - }); - if (subsequentNode) { - if (subsequentNode.kind === node.kind) { - var errorNode = subsequentNode.name || subsequentNode; - if (node.name && subsequentNode.name && node.name.text === subsequentNode.name.text) { - ts.Debug.assert(node.kind === 120 /* Method */); - ts.Debug.assert((node.flags & 128 /* Static */) !== (subsequentNode.flags & 128 /* Static */)); - var diagnostic = node.flags & 128 /* Static */ ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static; - error(errorNode, diagnostic); - return; - } - else if (subsequentNode.body) { - error(errorNode, ts.Diagnostics.Function_implementation_name_must_be_0, ts.identifierToString(node.name)); - return; - } - } - } - var errorNode = node.name || node; - if (isConstructor) { - error(errorNode, ts.Diagnostics.Constructor_implementation_is_missing); - } - else { - error(errorNode, ts.Diagnostics.Function_implementation_is_missing_or_not_immediately_following_the_declaration); - } - } - var isExportSymbolInsideModule = symbol.parent && symbol.parent.flags & ts.SymbolFlags.Module; - var duplicateFunctionDeclaration = false; - var multipleConstructorImplementation = false; - for (var i = 0; i < declarations.length; i++) { - var node = declarations[i]; - var inAmbientContext = ts.isInAmbientContext(node); - var inAmbientContextOrInterface = node.parent.kind === 175 /* InterfaceDeclaration */ || node.parent.kind === 129 /* TypeLiteral */ || inAmbientContext; - if (inAmbientContextOrInterface) { - previousDeclaration = undefined; - } - if (node.kind === 172 /* FunctionDeclaration */ || node.kind === 120 /* Method */ || node.kind === 121 /* Constructor */) { - var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); - someNodeFlags |= currentNodeFlags; - allNodeFlags &= currentNodeFlags; - if (node.body && bodyDeclaration) { - if (isConstructor) { - multipleConstructorImplementation = true; - } - else { - duplicateFunctionDeclaration = true; - } - } - else if (!isExportSymbolInsideModule && previousDeclaration && previousDeclaration.parent === node.parent && previousDeclaration.end !== node.pos) { - reportImplementationExpectedError(previousDeclaration); - } - if (node.body) { - if (!bodyDeclaration) { - bodyDeclaration = node; - } - } - else { - hasOverloads = true; - } - previousDeclaration = node; - if (!inAmbientContextOrInterface) { - lastSeenNonAmbientDeclaration = node; - } - } - } - if (multipleConstructorImplementation) { - ts.forEach(declarations, function (declaration) { - error(declaration, ts.Diagnostics.Multiple_constructor_implementations_are_not_allowed); - }); - } - if (duplicateFunctionDeclaration) { - ts.forEach(declarations, function (declaration) { - error(declaration.name, ts.Diagnostics.Duplicate_function_implementation); - }); - } - if (!isExportSymbolInsideModule && lastSeenNonAmbientDeclaration && !lastSeenNonAmbientDeclaration.body) { - reportImplementationExpectedError(lastSeenNonAmbientDeclaration); - } - if (hasOverloads) { - checkFlagAgreementBetweenOverloads(declarations, bodyDeclaration, flagsToCheck, someNodeFlags, allNodeFlags); - if (bodyDeclaration) { - var signatures = getSignaturesOfSymbol(symbol); - var bodySignature = getSignatureFromDeclaration(bodyDeclaration); - if (!bodySignature.hasStringLiterals) { - for (var i = 0, len = signatures.length; i < len; ++i) { - if (!signatures[i].hasStringLiterals && !isSignatureAssignableTo(bodySignature, signatures[i])) { - error(signatures[i].declaration, ts.Diagnostics.Overload_signature_is_not_compatible_with_function_implementation); - break; - } - } - } - } - } - } - function checkExportsOnMergedDeclarations(node) { - if (!fullTypeCheck) { - return; - } - var symbol; - var symbol = node.localSymbol; - if (!symbol) { - symbol = getSymbolOfNode(node); - if (!(symbol.flags & ts.SymbolFlags.Export)) { - return; - } - } - if (getDeclarationOfKind(symbol, node.kind) !== node) { - return; - } - var exportedDeclarationSpaces = 0; - var nonExportedDeclarationSpaces = 0; - ts.forEach(symbol.declarations, function (d) { - var declarationSpaces = getDeclarationSpaces(d); - if (getEffectiveDeclarationFlags(d, 1 /* Export */)) { - exportedDeclarationSpaces |= declarationSpaces; - } - else { - nonExportedDeclarationSpaces |= declarationSpaces; - } - }); - var commonDeclarationSpace = exportedDeclarationSpaces & nonExportedDeclarationSpaces; - if (commonDeclarationSpace) { - ts.forEach(symbol.declarations, function (d) { - if (getDeclarationSpaces(d) & commonDeclarationSpace) { - error(d.name, ts.Diagnostics.Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local, ts.identifierToString(d.name)); - } - }); - } - function getDeclarationSpaces(d) { - switch (d.kind) { - case 175 /* InterfaceDeclaration */: - return 1048576 /* ExportType */; - case 177 /* ModuleDeclaration */: - return d.name.kind === 7 /* StringLiteral */ || ts.isInstantiated(d) ? 2097152 /* ExportNamespace */ | 524288 /* ExportValue */ : 2097152 /* ExportNamespace */; - case 174 /* ClassDeclaration */: - case 176 /* EnumDeclaration */: - return 1048576 /* ExportType */ | 524288 /* ExportValue */; - case 179 /* ImportDeclaration */: - var result = 0; - var target = resolveImport(getSymbolOfNode(d)); - ts.forEach(target.declarations, function (d) { - result |= getDeclarationSpaces(d); - }); - return result; - default: - return 524288 /* ExportValue */; - } - } - } - function checkFunctionDeclaration(node) { - checkSignatureDeclaration(node); - var symbol = getSymbolOfNode(node); - var localSymbol = node.localSymbol || symbol; - var firstDeclaration = getDeclarationOfKind(localSymbol, node.kind); - if (node === firstDeclaration) { - checkFunctionOrConstructorSymbol(localSymbol); - } - if (symbol.parent) { - if (getDeclarationOfKind(symbol, node.kind) === node) { - checkFunctionOrConstructorSymbol(symbol); - } - } - checkSourceElement(node.body); - if (node.type && !isAccessor(node.kind)) { - checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNode(node.type)); - } - if (fullTypeCheck && compilerOptions.noImplicitAny && !node.body && !node.type) { - if (!isPrivateWithinAmbient(node)) { - var typeName = typeToString(anyType); - if (node.name) { - error(node, ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type, ts.identifierToString(node.name), typeName); - } - else { - error(node, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeName); - } - } - } - } - function checkBlock(node) { - ts.forEach(node.statements, checkSourceElement); - } - function checkCollisionWithArgumentsInGeneratedCode(node) { - if (!ts.hasRestParameters(node) || ts.isInAmbientContext(node) || !node.body) { - return; - } - ts.forEach(node.parameters, function (p) { - if (p.name && p.name.text === argumentsSymbol.name) { - error(p, ts.Diagnostics.Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters); - } - }); - } - function checkCollisionWithIndexVariableInGeneratedCode(node, name) { - if (!(name && name.text === "_i")) { - return; - } - if (node.kind === 118 /* Parameter */) { - if (node.parent.body && ts.hasRestParameters(node.parent) && !ts.isInAmbientContext(node)) { - error(node, ts.Diagnostics.Duplicate_identifier_i_Compiler_uses_i_to_initialize_rest_parameter); - } - return; - } - var symbol = getNodeLinks(node).resolvedSymbol; - if (symbol === unknownSymbol) { - return; - } - var current = node; - while (current) { - var definedOnCurrentLevel = ts.forEach(symbol.declarations, function (d) { return d.parent === current ? d : undefined; }); - if (definedOnCurrentLevel) { - return; - } - switch (current.kind) { - case 172 /* FunctionDeclaration */: - case 141 /* FunctionExpression */: - case 120 /* Method */: - case 142 /* ArrowFunction */: - case 121 /* Constructor */: - if (ts.hasRestParameters(current)) { - error(node, ts.Diagnostics.Expression_resolves_to_variable_declaration_i_that_compiler_uses_to_initialize_rest_parameter); - return; - } - break; - } - current = current.parent; - } - } - function needCollisionCheckForIdentifier(node, identifier, name) { - if (!(identifier && identifier.text === name)) { - return false; - } - if (node.kind === 119 /* Property */ || node.kind === 120 /* Method */ || node.kind === 122 /* GetAccessor */ || node.kind === 123 /* SetAccessor */) { - return false; - } - if (ts.isInAmbientContext(node)) { - return false; - } - if (node.kind === 118 /* Parameter */ && !node.parent.body) { - return false; - } - return true; - } - function checkCollisionWithCapturedThisVariable(node, name) { - if (!needCollisionCheckForIdentifier(node, name, "_this")) { - return; - } - potentialThisCollisions.push(node); - } - function checkIfThisIsCapturedInEnclosingScope(node) { - var current = node; - while (current) { - if (getNodeCheckFlags(current) & 4 /* CaptureThis */) { - var isDeclaration = node.kind !== 59 /* Identifier */; - if (isDeclaration) { - error(node.name, ts.Diagnostics.Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference); - } - else { - error(node, ts.Diagnostics.Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference); - } - return; - } - current = current.parent; - } - } - function checkCollisionWithCapturedSuperVariable(node, name) { - if (!needCollisionCheckForIdentifier(node, name, "_super")) { - return; - } - var enclosingClass = ts.getAncestor(node, 174 /* ClassDeclaration */); - if (!enclosingClass || ts.isInAmbientContext(enclosingClass)) { - return; - } - if (enclosingClass.baseType) { - var isDeclaration = node.kind !== 59 /* Identifier */; - if (isDeclaration) { - error(node, ts.Diagnostics.Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference); - } - else { - error(node, ts.Diagnostics.Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference); - } - } - } - function checkCollisionWithRequireExportsInGeneratedCode(node, name) { - if (!needCollisionCheckForIdentifier(node, name, "require") && !needCollisionCheckForIdentifier(node, name, "exports")) { - return; - } - if (node.kind === 177 /* ModuleDeclaration */ && !ts.isInstantiated(node)) { - return; - } - var parent = node.kind === 171 /* VariableDeclaration */ ? node.parent.parent : node.parent; - if (parent.kind === 182 /* SourceFile */ && ts.isExternalModule(parent)) { - error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module, name.text, name.text); - } - } - function checkVariableDeclaration(node) { - checkSourceElement(node.type); - checkExportsOnMergedDeclarations(node); - if (fullTypeCheck) { - var symbol = getSymbolOfNode(node); - var typeOfValueDeclaration = getTypeOfVariableOrParameterOrProperty(symbol); - var type; - var useTypeFromValueDeclaration = node === symbol.valueDeclaration; - if (useTypeFromValueDeclaration) { - type = typeOfValueDeclaration; - } - else { - type = getTypeOfVariableDeclaration(node); - } - if (node.initializer) { - if (!(getNodeLinks(node.initializer).flags & 1 /* TypeChecked */)) { - checkTypeAssignableTo(checkAndMarkExpression(node.initializer), type, node, undefined, undefined); - } - } - checkCollisionWithCapturedSuperVariable(node, node.name); - checkCollisionWithCapturedThisVariable(node, node.name); - checkCollisionWithRequireExportsInGeneratedCode(node, node.name); - if (!useTypeFromValueDeclaration) { - if (typeOfValueDeclaration !== unknownType && type !== unknownType && !isTypeIdenticalTo(typeOfValueDeclaration, type)) { - error(node.name, ts.Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2, ts.identifierToString(node.name), typeToString(typeOfValueDeclaration), typeToString(type)); - } - } - } - } - function checkVariableStatement(node) { - ts.forEach(node.declarations, checkVariableDeclaration); - } - function checkExpressionStatement(node) { - checkExpression(node.expression); - } - function checkIfStatement(node) { - checkExpression(node.expression); - checkSourceElement(node.thenStatement); - checkSourceElement(node.elseStatement); - } - function checkDoStatement(node) { - checkSourceElement(node.statement); - checkExpression(node.expression); - } - function checkWhileStatement(node) { - checkExpression(node.expression); - checkSourceElement(node.statement); - } - function checkForStatement(node) { - if (node.declarations) - ts.forEach(node.declarations, checkVariableDeclaration); - if (node.initializer) - checkExpression(node.initializer); - if (node.condition) - checkExpression(node.condition); - if (node.iterator) - checkExpression(node.iterator); - checkSourceElement(node.statement); - } - function checkForInStatement(node) { - if (node.declaration) { - checkVariableDeclaration(node.declaration); - if (node.declaration.type) { - error(node.declaration, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation); - } - } - if (node.variable) { - var exprType = checkExpression(node.variable); - if (exprType !== anyType && exprType !== stringType) { - error(node.variable, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any); - } - else { - checkReferenceExpression(node.variable, ts.Diagnostics.Invalid_left_hand_side_in_for_in_statement); - } - } - var exprType = checkExpression(node.expression); - if (!isTypeAnyTypeObjectTypeOrTypeParameter(exprType) && exprType !== unknownType) { - error(node.expression, ts.Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter); - } - checkSourceElement(node.statement); - } - function checkBreakOrContinueStatement(node) { - } - function checkReturnStatement(node) { - if (node.expression && !(getNodeLinks(node.expression).flags & 1 /* TypeChecked */)) { - var func = ts.getContainingFunction(node); - if (func) { - if (func.kind === 123 /* SetAccessor */) { - if (node.expression) { - error(node.expression, ts.Diagnostics.Setters_cannot_return_a_value); - } - } - else { - var returnType = getReturnTypeOfSignature(getSignatureFromDeclaration(func)); - var checkAssignability = func.type || (func.kind === 122 /* GetAccessor */ && getSetAccessorTypeAnnotationNode(getDeclarationOfKind(func.symbol, 123 /* SetAccessor */))); - if (checkAssignability) { - checkTypeAssignableTo(checkExpression(node.expression), returnType, node.expression, undefined, undefined); - } - else if (func.kind == 121 /* Constructor */) { - if (!isTypeAssignableTo(checkExpression(node.expression), returnType)) { - error(node.expression, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); - } - } - } - } - } - } - function checkWithStatement(node) { - checkExpression(node.expression); - error(node.expression, ts.Diagnostics.All_symbols_within_a_with_block_will_be_resolved_to_any); - } - function checkSwitchStatement(node) { - var expressionType = checkExpression(node.expression); - ts.forEach(node.clauses, function (clause) { - if (fullTypeCheck && clause.expression) { - var caseType = checkExpression(clause.expression); - if (!isTypeAssignableTo(expressionType, caseType)) { - checkTypeAssignableTo(caseType, expressionType, clause.expression, undefined, undefined); - } - } - checkBlock(clause); - }); - } - function checkLabeledStatement(node) { - checkSourceElement(node.statement); - } - function checkThrowStatement(node) { - checkExpression(node.expression); - } - function checkTryStatement(node) { - checkBlock(node.tryBlock); - if (node.catchBlock) - checkBlock(node.catchBlock); - if (node.finallyBlock) - checkBlock(node.finallyBlock); - } - function checkIndexConstraints(type) { - function checkIndexConstraintForProperty(prop, propertyType, indexDeclaration, indexType, indexKind) { - if (!indexType) { - return; - } - if (indexKind === 1 /* Number */ && !isNumericName(prop.name)) { - return; - } - var errorNode; - if (prop.parent === type.symbol) { - errorNode = prop.valueDeclaration; - } - else if (indexDeclaration) { - errorNode = indexDeclaration; - } - else if (type.flags & 2048 /* Interface */) { - var someBaseClassHasBothPropertyAndIndexer = ts.forEach(type.baseTypes, function (base) { return getPropertyOfType(base, prop.name) && getIndexTypeOfType(base, indexKind); }); - errorNode = someBaseClassHasBothPropertyAndIndexer ? undefined : type.symbol.declarations[0]; - } - if (errorNode && !isTypeAssignableTo(propertyType, indexType)) { - var errorMessage = indexKind === 0 /* String */ ? ts.Diagnostics.Property_0_of_type_1_is_not_assignable_to_string_index_type_2 : ts.Diagnostics.Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2; - error(errorNode, errorMessage, symbolToString(prop), typeToString(propertyType), typeToString(indexType)); - } - } - var declaredNumberIndexer = getIndexDeclarationOfSymbol(type.symbol, 1 /* Number */); - var declaredStringIndexer = getIndexDeclarationOfSymbol(type.symbol, 0 /* String */); - var stringIndexType = getIndexTypeOfType(type, 0 /* String */); - var numberIndexType = getIndexTypeOfType(type, 1 /* Number */); - if (stringIndexType || numberIndexType) { - ts.forEach(getPropertiesOfType(type), function (prop) { - var propType = getTypeOfSymbol(prop); - checkIndexConstraintForProperty(prop, propType, declaredStringIndexer, stringIndexType, 0 /* String */); - checkIndexConstraintForProperty(prop, propType, declaredNumberIndexer, numberIndexType, 1 /* Number */); - }); - } - var errorNode; - if (stringIndexType && numberIndexType) { - errorNode = declaredNumberIndexer || declaredStringIndexer; - if (!errorNode && (type.flags & 2048 /* Interface */)) { - var someBaseTypeHasBothIndexers = ts.forEach(type.baseTypes, function (base) { return getIndexTypeOfType(base, 0 /* String */) && getIndexTypeOfType(base, 1 /* Number */); }); - errorNode = someBaseTypeHasBothIndexers ? undefined : type.symbol.declarations[0]; - } - } - if (errorNode && !isTypeAssignableTo(numberIndexType, stringIndexType)) { - error(errorNode, ts.Diagnostics.Numeric_index_type_0_is_not_assignable_to_string_index_type_1, typeToString(numberIndexType), typeToString(stringIndexType)); - } - } - function checkTypeNameIsReserved(name, message) { - switch (name.text) { - case "any": - case "number": - case "boolean": - case "string": - case "void": - error(name, message, name.text); - } - } - function checkTypeParameters(typeParameterDeclarations) { - if (typeParameterDeclarations) { - for (var i = 0; i < typeParameterDeclarations.length; i++) { - var node = typeParameterDeclarations[i]; - checkTypeParameter(node); - if (fullTypeCheck) { - for (var j = 0; j < i; j++) { - if (typeParameterDeclarations[j].symbol === node.symbol) { - error(node.name, ts.Diagnostics.Duplicate_identifier_0, ts.identifierToString(node.name)); - } - } - } - } - } - } - function checkClassDeclaration(node) { - checkTypeNameIsReserved(node.name, ts.Diagnostics.Class_name_cannot_be_0); - checkTypeParameters(node.typeParameters); - checkCollisionWithCapturedThisVariable(node, node.name); - checkCollisionWithRequireExportsInGeneratedCode(node, node.name); - checkExportsOnMergedDeclarations(node); - var symbol = getSymbolOfNode(node); - var type = getDeclaredTypeOfSymbol(symbol); - var staticType = getTypeOfSymbol(symbol); - if (node.baseType) { - emitExtends = emitExtends || !ts.isInAmbientContext(node); - checkTypeReference(node.baseType); - } - if (type.baseTypes.length) { - if (fullTypeCheck) { - var baseType = type.baseTypes[0]; - checkTypeAssignableTo(type, baseType, node.name, ts.Diagnostics.Class_0_incorrectly_extends_base_class_1_Colon, ts.Diagnostics.Class_0_incorrectly_extends_base_class_1); - var staticBaseType = getTypeOfSymbol(baseType.symbol); - checkTypeAssignableTo(staticType, getTypeWithoutConstructors(staticBaseType), node.name, ts.Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1_Colon, ts.Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1); - if (baseType.symbol !== resolveEntityName(node, node.baseType.typeName, ts.SymbolFlags.Value)) { - error(node.baseType, ts.Diagnostics.Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0, typeToString(baseType)); - } - checkKindsOfPropertyMemberOverrides(type, baseType); - } - checkExpression(node.baseType.typeName); - } - if (node.implementedTypes) { - ts.forEach(node.implementedTypes, function (typeRefNode) { - checkTypeReference(typeRefNode); - if (fullTypeCheck) { - var t = getTypeFromTypeReferenceNode(typeRefNode); - if (t !== unknownType) { - var declaredType = (t.flags & 4096 /* Reference */) ? t.target : t; - if (declaredType.flags & (1024 /* Class */ | 2048 /* Interface */)) { - checkTypeAssignableTo(type, t, node.name, ts.Diagnostics.Class_0_incorrectly_implements_interface_1_Colon, ts.Diagnostics.Class_0_incorrectly_implements_interface_1); - } - else { - error(typeRefNode, ts.Diagnostics.A_class_may_only_implement_another_class_or_interface); - } - } - } - }); - } - ts.forEach(node.members, checkSourceElement); - if (fullTypeCheck) { - checkIndexConstraints(type); - checkTypeForDuplicateIndexSignatures(node); - } - } - function getTargetSymbol(s) { - return s.flags & 8388608 /* Instantiated */ ? getSymbolLinks(s).target : s; - } - function checkKindsOfPropertyMemberOverrides(type, baseType) { - var baseProperties = getPropertiesOfType(baseType); - for (var i = 0, len = baseProperties.length; i < len; ++i) { - var base = getTargetSymbol(baseProperties[i]); - if (base.flags & 67108864 /* Prototype */) { - continue; - } - var derived = getTargetSymbol(getPropertyOfType(type, base.name)); - if (derived) { - var baseDeclarationFlags = getDeclarationFlagsFromSymbol(base); - var derivedDeclarationFlags = getDeclarationFlagsFromSymbol(derived); - if ((baseDeclarationFlags & 32 /* Private */) || (derivedDeclarationFlags & 32 /* Private */)) { - continue; - } - if ((baseDeclarationFlags & 128 /* Static */) !== (derivedDeclarationFlags & 128 /* Static */)) { - continue; - } - if ((base.flags & derived.flags & 2048 /* Method */) || ((base.flags & ts.SymbolFlags.PropertyOrAccessor) && (derived.flags & ts.SymbolFlags.PropertyOrAccessor))) { - continue; - } - var errorMessage; - if (base.flags & 2048 /* Method */) { - if (derived.flags & ts.SymbolFlags.Accessor) { - errorMessage = ts.Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor; - } - else { - ts.Debug.assert(derived.flags & 2 /* Property */); - errorMessage = ts.Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property; - } - } - else if (base.flags & 2 /* Property */) { - ts.Debug.assert(derived.flags & 2048 /* Method */); - errorMessage = ts.Diagnostics.Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function; - } - else { - ts.Debug.assert(base.flags & ts.SymbolFlags.Accessor); - ts.Debug.assert(derived.flags & 2048 /* Method */); - errorMessage = ts.Diagnostics.Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function; - } - error(derived.valueDeclaration.name, errorMessage, typeToString(baseType), symbolToString(base), typeToString(type)); - } - } - } - function isAccessor(kind) { - return kind === 122 /* GetAccessor */ || kind === 123 /* SetAccessor */; - } - function areTypeParametersIdentical(list1, list2) { - if (!list1 && !list2) { - return true; - } - if (!list1 || !list2 || list1.length !== list2.length) { - return false; - } - for (var i = 0, len = list1.length; i < len; i++) { - var tp1 = list1[i]; - var tp2 = list2[i]; - if (tp1.name.text !== tp2.name.text) { - return false; - } - if (!tp1.constraint && !tp2.constraint) { - continue; - } - if (!tp1.constraint || !tp2.constraint) { - return false; - } - if (!isTypeIdenticalTo(getTypeFromTypeNode(tp1.constraint), getTypeFromTypeNode(tp2.constraint))) { - return false; - } - } - return true; - } - function checkInterfaceDeclaration(node) { - checkTypeParameters(node.typeParameters); - if (fullTypeCheck) { - checkTypeNameIsReserved(node.name, ts.Diagnostics.Interface_name_cannot_be_0); - checkExportsOnMergedDeclarations(node); - var symbol = getSymbolOfNode(node); - var firstInterfaceDecl = getDeclarationOfKind(symbol, 175 /* InterfaceDeclaration */); - if (symbol.declarations.length > 1) { - if (node !== firstInterfaceDecl && !areTypeParametersIdentical(firstInterfaceDecl.typeParameters, node.typeParameters)) { - error(node.name, ts.Diagnostics.All_declarations_of_an_interface_must_have_identical_type_parameters); - } - } - if (node === firstInterfaceDecl) { - var type = getDeclaredTypeOfSymbol(symbol); - if (checkInheritedPropertiesAreIdentical(type, node.name)) { - ts.forEach(type.baseTypes, function (baseType) { - checkTypeAssignableTo(type, baseType, node.name, ts.Diagnostics.Interface_0_incorrectly_extends_interface_1_Colon, ts.Diagnostics.Interface_0_incorrectly_extends_interface_1); - }); - checkIndexConstraints(type); - } - } - } - ts.forEach(node.baseTypes, checkTypeReference); - ts.forEach(node.members, checkSourceElement); - if (fullTypeCheck) { - checkTypeForDuplicateIndexSignatures(node); - } - } - function getConstantValueForExpression(node) { - var isNegative = false; - if (node.kind === 143 /* PrefixOperator */) { - var unaryExpression = node; - if (unaryExpression.operator === 29 /* MinusToken */ || unaryExpression.operator === 28 /* PlusToken */) { - node = unaryExpression.operand; - isNegative = unaryExpression.operator === 29 /* MinusToken */; - } - } - if (node.kind === 6 /* NumericLiteral */) { - var literalText = node.text; - return isNegative ? -literalText : +literalText; - } - return undefined; - } - function computeEnumMemberValues(node) { - var nodeLinks = getNodeLinks(node); - if (!(nodeLinks.flags & 128 /* EnumValuesComputed */)) { - var enumSymbol = getSymbolOfNode(node); - var enumType = getDeclaredTypeOfSymbol(enumSymbol); - var autoValue = 0; - var ambient = ts.isInAmbientContext(node); - ts.forEach(node.members, function (member) { - if (isNumericName(member.name.text)) { - error(member.name, ts.Diagnostics.An_enum_member_cannot_have_a_numeric_name); - } - var initializer = member.initializer; - if (initializer) { - autoValue = getConstantValueForExpression(initializer); - if (autoValue === undefined && !ambient) { - checkTypeAssignableTo(checkExpression(initializer), enumType, initializer, undefined, undefined); - } - } - else if (ambient) { - autoValue = undefined; - } - if (autoValue !== undefined) { - getNodeLinks(member).enumMemberValue = autoValue++; - } - }); - nodeLinks.flags |= 128 /* EnumValuesComputed */; - } - } - function checkEnumDeclaration(node) { - if (!fullTypeCheck) { - return; - } - checkTypeNameIsReserved(node.name, ts.Diagnostics.Enum_name_cannot_be_0); - checkCollisionWithCapturedThisVariable(node, node.name); - checkCollisionWithRequireExportsInGeneratedCode(node, node.name); - checkExportsOnMergedDeclarations(node); - computeEnumMemberValues(node); - var enumSymbol = getSymbolOfNode(node); - var firstDeclaration = getDeclarationOfKind(enumSymbol, node.kind); - if (node === firstDeclaration) { - var seenEnumMissingInitialInitializer = false; - ts.forEach(enumSymbol.declarations, function (declaration) { - if (declaration.kind !== 176 /* EnumDeclaration */) { - return false; - } - var enumDeclaration = declaration; - if (!enumDeclaration.members.length) { - return false; - } - var firstEnumMember = enumDeclaration.members[0]; - if (!firstEnumMember.initializer) { - if (seenEnumMissingInitialInitializer) { - error(firstEnumMember.name, ts.Diagnostics.In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element); - } - else { - seenEnumMissingInitialInitializer = true; - } - } - }); - } - } - function getFirstNonAmbientClassOrFunctionDeclaration(symbol) { - var declarations = symbol.declarations; - for (var i = 0; i < declarations.length; i++) { - var declaration = declarations[i]; - if ((declaration.kind === 174 /* ClassDeclaration */ || (declaration.kind === 172 /* FunctionDeclaration */ && declaration.body)) && !ts.isInAmbientContext(declaration)) { - return declaration; - } - } - return undefined; - } - function checkModuleDeclaration(node) { - if (fullTypeCheck) { - checkCollisionWithCapturedThisVariable(node, node.name); - checkCollisionWithRequireExportsInGeneratedCode(node, node.name); - checkExportsOnMergedDeclarations(node); - var symbol = getSymbolOfNode(node); - if (symbol.flags & 128 /* ValueModule */ && symbol.declarations.length > 1 && !ts.isInAmbientContext(node)) { - var classOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol); - if (classOrFunc) { - if (ts.getSourceFileOfNode(node) !== ts.getSourceFileOfNode(classOrFunc)) { - error(node.name, ts.Diagnostics.A_module_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged); - } - else if (node.pos < classOrFunc.pos) { - error(node.name, ts.Diagnostics.A_module_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged); - } - } - } - if (node.name.kind === 7 /* StringLiteral */) { - if (!isGlobalSourceFile(node.parent)) { - error(node.name, ts.Diagnostics.Ambient_external_modules_cannot_be_nested_in_other_modules); - } - if (isExternalModuleNameRelative(node.name.text)) { - error(node.name, ts.Diagnostics.Ambient_external_module_declaration_cannot_specify_relative_module_name); - } - } - } - checkSourceElement(node.body); - } - function getFirstIdentifier(node) { - while (node.kind === 116 /* QualifiedName */) { - node = node.left; - } - return node; - } - function checkImportDeclaration(node) { - checkCollisionWithCapturedThisVariable(node, node.name); - checkCollisionWithRequireExportsInGeneratedCode(node, node.name); - var symbol = getSymbolOfNode(node); - var target; - if (node.entityName) { - target = resolveImport(symbol); - if (target !== unknownSymbol) { - if (target.flags & ts.SymbolFlags.Value) { - var moduleName = getFirstIdentifier(node.entityName); - if (resolveEntityName(node, moduleName, ts.SymbolFlags.Value | ts.SymbolFlags.Namespace).flags & ts.SymbolFlags.Namespace) { - checkExpression(node.entityName); - } - else { - error(moduleName, ts.Diagnostics.Module_0_is_hidden_by_a_local_declaration_with_the_same_name, ts.identifierToString(moduleName)); - } - } - if (target.flags & ts.SymbolFlags.Type) { - checkTypeNameIsReserved(node.name, ts.Diagnostics.Import_name_cannot_be_0); - } - } - } - else { - if (node.parent.kind === 182 /* SourceFile */) { - target = resolveImport(symbol); - } - else if (node.parent.kind === 178 /* ModuleBlock */ && node.parent.parent.name.kind === 7 /* StringLiteral */) { - if (isExternalModuleNameRelative(node.externalModuleName.text)) { - error(node, ts.Diagnostics.Import_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name); - target = unknownSymbol; - } - else { - target = resolveImport(symbol); - } - } - else { - target = unknownSymbol; - } - } - if (target !== unknownSymbol) { - var excludedMeanings = (symbol.flags & ts.SymbolFlags.Value ? ts.SymbolFlags.Value : 0) | (symbol.flags & ts.SymbolFlags.Type ? ts.SymbolFlags.Type : 0) | (symbol.flags & ts.SymbolFlags.Namespace ? ts.SymbolFlags.Namespace : 0); - if (target.flags & excludedMeanings) { - error(node, ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0, symbolToString(symbol)); - } - } - } - function checkExportAssignment(node) { - var container = node.parent; - if (container.kind !== 182 /* SourceFile */) { - container = container.parent; - } - checkTypeOfExportAssignmentSymbol(getSymbolOfNode(container)); - } - function checkSourceElement(node) { - if (!node) - return; - switch (node.kind) { - case 117 /* TypeParameter */: - return checkTypeParameter(node); - case 118 /* Parameter */: - return checkParameter(node); - case 119 /* Property */: - return checkPropertyDeclaration(node); - case 124 /* CallSignature */: - case 125 /* ConstructSignature */: - case 126 /* IndexSignature */: - return checkSignatureDeclaration(node); - case 120 /* Method */: - return checkMethodDeclaration(node); - case 121 /* Constructor */: - return checkConstructorDeclaration(node); - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - return checkAccessorDeclaration(node); - case 127 /* TypeReference */: - return checkTypeReference(node); - case 128 /* TypeQuery */: - return checkTypeQuery(node); - case 129 /* TypeLiteral */: - return checkTypeLiteral(node); - case 130 /* ArrayType */: - return checkArrayType(node); - case 131 /* TupleType */: - return checkTupleType(node); - case 172 /* FunctionDeclaration */: - return checkFunctionDeclaration(node); - case 148 /* Block */: - return checkBlock(node); - case 173 /* FunctionBlock */: - case 178 /* ModuleBlock */: - return checkBody(node); - case 149 /* VariableStatement */: - return checkVariableStatement(node); - case 151 /* ExpressionStatement */: - return checkExpressionStatement(node); - case 152 /* IfStatement */: - return checkIfStatement(node); - case 153 /* DoStatement */: - return checkDoStatement(node); - case 154 /* WhileStatement */: - return checkWhileStatement(node); - case 155 /* ForStatement */: - return checkForStatement(node); - case 156 /* ForInStatement */: - return checkForInStatement(node); - case 157 /* ContinueStatement */: - case 158 /* BreakStatement */: - return checkBreakOrContinueStatement(node); - case 159 /* ReturnStatement */: - return checkReturnStatement(node); - case 160 /* WithStatement */: - return checkWithStatement(node); - case 161 /* SwitchStatement */: - return checkSwitchStatement(node); - case 164 /* LabeledStatement */: - return checkLabeledStatement(node); - case 165 /* ThrowStatement */: - return checkThrowStatement(node); - case 166 /* TryStatement */: - return checkTryStatement(node); - case 171 /* VariableDeclaration */: - return ts.Debug.fail("Checker encountered variable declaration"); - case 174 /* ClassDeclaration */: - return checkClassDeclaration(node); - case 175 /* InterfaceDeclaration */: - return checkInterfaceDeclaration(node); - case 176 /* EnumDeclaration */: - return checkEnumDeclaration(node); - case 177 /* ModuleDeclaration */: - return checkModuleDeclaration(node); - case 179 /* ImportDeclaration */: - return checkImportDeclaration(node); - case 180 /* ExportAssignment */: - return checkExportAssignment(node); - } - } - function checkFunctionExpressionBodies(node) { - switch (node.kind) { - case 141 /* FunctionExpression */: - case 142 /* ArrowFunction */: - ts.forEach(node.parameters, checkFunctionExpressionBodies); - checkFunctionExpressionBody(node); - break; - case 120 /* Method */: - case 121 /* Constructor */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 172 /* FunctionDeclaration */: - ts.forEach(node.parameters, checkFunctionExpressionBodies); - break; - case 160 /* WithStatement */: - checkFunctionExpressionBodies(node.expression); - break; - case 118 /* Parameter */: - case 119 /* Property */: - case 132 /* ArrayLiteral */: - case 133 /* ObjectLiteral */: - case 134 /* PropertyAssignment */: - case 135 /* PropertyAccess */: - case 136 /* IndexedAccess */: - case 137 /* CallExpression */: - case 138 /* NewExpression */: - case 139 /* TypeAssertion */: - case 140 /* ParenExpression */: - case 143 /* PrefixOperator */: - case 144 /* PostfixOperator */: - case 145 /* BinaryExpression */: - case 146 /* ConditionalExpression */: - case 148 /* Block */: - case 173 /* FunctionBlock */: - case 178 /* ModuleBlock */: - case 149 /* VariableStatement */: - case 151 /* ExpressionStatement */: - case 152 /* IfStatement */: - case 153 /* DoStatement */: - case 154 /* WhileStatement */: - case 155 /* ForStatement */: - case 156 /* ForInStatement */: - case 157 /* ContinueStatement */: - case 158 /* BreakStatement */: - case 159 /* ReturnStatement */: - case 161 /* SwitchStatement */: - case 162 /* CaseClause */: - case 163 /* DefaultClause */: - case 164 /* LabeledStatement */: - case 165 /* ThrowStatement */: - case 166 /* TryStatement */: - case 167 /* TryBlock */: - case 168 /* CatchBlock */: - case 169 /* FinallyBlock */: - case 171 /* VariableDeclaration */: - case 174 /* ClassDeclaration */: - case 176 /* EnumDeclaration */: - case 181 /* EnumMember */: - case 182 /* SourceFile */: - ts.forEachChild(node, checkFunctionExpressionBodies); - break; - } - } - function checkBody(node) { - checkBlock(node); - checkFunctionExpressionBodies(node); - } - function checkSourceFile(node) { - var links = getNodeLinks(node); - if (!(links.flags & 1 /* TypeChecked */)) { - emitExtends = false; - potentialThisCollisions.length = 0; - checkBody(node); - if (ts.isExternalModule(node)) { - var symbol = getExportAssignmentSymbol(node.symbol); - if (symbol && symbol.flags & 4194304 /* Import */) { - getSymbolLinks(symbol).referenced = true; - } - } - if (potentialThisCollisions.length) { - ts.forEach(potentialThisCollisions, checkIfThisIsCapturedInEnclosingScope); - potentialThisCollisions.length = 0; - } - if (emitExtends) - links.flags |= 8 /* EmitExtends */; - links.flags |= 1 /* TypeChecked */; - } - } - function checkProgram() { - ts.forEach(program.getSourceFiles(), checkSourceFile); - } - function getSortedDiagnostics() { - ts.Debug.assert(fullTypeCheck, "diagnostics are available only in the full typecheck mode"); - if (diagnosticsModified) { - diagnostics.sort(ts.compareDiagnostics); - diagnostics = ts.deduplicateSortedDiagnostics(diagnostics); - diagnosticsModified = false; - } - return diagnostics; - } - function getDiagnostics(sourceFile) { - if (sourceFile) { - checkSourceFile(sourceFile); - return ts.filter(getSortedDiagnostics(), function (d) { return d.file === sourceFile; }); - } - checkProgram(); - return getSortedDiagnostics(); - } - function getDeclarationDiagnostics(targetSourceFile) { - var resolver = createResolver(); - checkSourceFile(targetSourceFile); - return ts.getDeclarationDiagnostics(program, resolver, targetSourceFile); - } - function getGlobalDiagnostics() { - return ts.filter(getSortedDiagnostics(), function (d) { return !d.file; }); - } - function getNodeAtPosition(sourceFile, position) { - function findChildAtPosition(parent) { - var child = ts.forEachChild(parent, function (node) { - if (position >= node.pos && position <= node.end && position >= ts.getTokenPosOfNode(node)) { - return findChildAtPosition(node); - } - }); - return child || parent; - } - if (position < sourceFile.pos) - position = sourceFile.pos; - if (position > sourceFile.end) - position = sourceFile.end; - return findChildAtPosition(sourceFile); - } - function isInsideWithStatementBody(node) { - if (node) { - while (node.parent) { - if (node.parent.kind === 160 /* WithStatement */ && node.parent.statement === node) { - return true; - } - node = node.parent; - } - } - return false; - } - function getSymbolsInScope(location, meaning) { - var symbols = {}; - var memberFlags = 0; - function copySymbol(symbol, meaning) { - if (symbol.flags & meaning) { - var id = symbol.name; - if (!isReservedMemberName(id) && !ts.hasProperty(symbols, id)) { - symbols[id] = symbol; - } - } - } - function copySymbols(source, meaning) { - if (meaning) { - for (var id in source) { - if (ts.hasProperty(source, id)) { - copySymbol(source[id], meaning); - } - } - } - } - if (isInsideWithStatementBody(location)) { - return []; - } - while (location) { - if (location.locals && !isGlobalSourceFile(location)) { - copySymbols(location.locals, meaning); - } - switch (location.kind) { - case 182 /* SourceFile */: - if (!ts.isExternalModule(location)) - break; - case 177 /* ModuleDeclaration */: - copySymbols(getSymbolOfNode(location).exports, meaning & ts.SymbolFlags.ModuleMember); - break; - case 176 /* EnumDeclaration */: - copySymbols(getSymbolOfNode(location).exports, meaning & 4 /* EnumMember */); - break; - case 174 /* ClassDeclaration */: - case 175 /* InterfaceDeclaration */: - if (!(memberFlags & 128 /* Static */)) { - copySymbols(getSymbolOfNode(location).members, meaning & ts.SymbolFlags.Type); - } - break; - case 141 /* FunctionExpression */: - if (location.name) { - copySymbol(location.symbol, meaning); - } - break; - case 168 /* CatchBlock */: - if (location.variable.text) { - copySymbol(location.symbol, meaning); - } - break; - } - memberFlags = location.flags; - location = location.parent; - } - copySymbols(globals, meaning); - return ts.mapToArray(symbols); - } - function isTypeDeclarationName(name) { - return name.kind == 59 /* Identifier */ && isTypeDeclaration(name.parent) && name.parent.name === name; - } - function isTypeDeclaration(node) { - switch (node.kind) { - case 117 /* TypeParameter */: - case 174 /* ClassDeclaration */: - case 175 /* InterfaceDeclaration */: - case 176 /* EnumDeclaration */: - return true; - } - } - function isTypeReferenceIdentifier(entityName) { - var node = entityName; - while (node.parent && node.parent.kind === 116 /* QualifiedName */) - node = node.parent; - return node.parent && node.parent.kind === 127 /* TypeReference */; - } - function isExpression(node) { - switch (node.kind) { - case 87 /* ThisKeyword */: - case 85 /* SuperKeyword */: - case 83 /* NullKeyword */: - case 89 /* TrueKeyword */: - case 74 /* FalseKeyword */: - case 8 /* RegularExpressionLiteral */: - case 132 /* ArrayLiteral */: - case 133 /* ObjectLiteral */: - case 135 /* PropertyAccess */: - case 136 /* IndexedAccess */: - case 137 /* CallExpression */: - case 138 /* NewExpression */: - case 139 /* TypeAssertion */: - case 140 /* ParenExpression */: - case 141 /* FunctionExpression */: - case 142 /* ArrowFunction */: - case 143 /* PrefixOperator */: - case 144 /* PostfixOperator */: - case 145 /* BinaryExpression */: - case 146 /* ConditionalExpression */: - case 147 /* OmittedExpression */: - return true; - case 116 /* QualifiedName */: - while (node.parent.kind === 116 /* QualifiedName */) - node = node.parent; - return node.parent.kind === 128 /* TypeQuery */; - case 59 /* Identifier */: - if (node.parent.kind === 128 /* TypeQuery */) { - return true; - } - case 6 /* NumericLiteral */: - case 7 /* StringLiteral */: - var parent = node.parent; - switch (parent.kind) { - case 171 /* VariableDeclaration */: - case 118 /* Parameter */: - case 119 /* Property */: - case 181 /* EnumMember */: - case 134 /* PropertyAssignment */: - return parent.initializer === node; - case 151 /* ExpressionStatement */: - case 152 /* IfStatement */: - case 153 /* DoStatement */: - case 154 /* WhileStatement */: - case 159 /* ReturnStatement */: - case 160 /* WithStatement */: - case 161 /* SwitchStatement */: - case 162 /* CaseClause */: - case 165 /* ThrowStatement */: - case 161 /* SwitchStatement */: - return parent.expression === node; - case 155 /* ForStatement */: - return parent.initializer === node || parent.condition === node || parent.iterator === node; - case 156 /* ForInStatement */: - return parent.variable === node || parent.expression === node; - case 139 /* TypeAssertion */: - return node === parent.operand; - default: - if (isExpression(parent)) { - return true; - } - } - } - return false; - } - function isTypeNode(node) { - if (ts.SyntaxKind.FirstTypeNode <= node.kind && node.kind <= ts.SyntaxKind.LastTypeNode) { - return true; - } - switch (node.kind) { - case 105 /* AnyKeyword */: - case 112 /* NumberKeyword */: - case 114 /* StringKeyword */: - case 106 /* BooleanKeyword */: - return true; - case 93 /* VoidKeyword */: - return node.parent.kind !== 143 /* PrefixOperator */; - case 7 /* StringLiteral */: - return node.parent.kind === 118 /* Parameter */; - case 59 /* Identifier */: - if (node.parent.kind === 116 /* QualifiedName */) { - node = node.parent; - } - case 116 /* QualifiedName */: - ts.Debug.assert(node.kind === 59 /* Identifier */ || node.kind === 116 /* QualifiedName */, "'node' was expected to be a qualified name or identifier in 'isTypeNode'."); - var parent = node.parent; - if (parent.kind === 128 /* TypeQuery */) { - return false; - } - if (ts.SyntaxKind.FirstTypeNode <= parent.kind && parent.kind <= ts.SyntaxKind.LastTypeNode) { - return true; - } - switch (parent.kind) { - case 117 /* TypeParameter */: - return node === parent.constraint; - case 119 /* Property */: - case 118 /* Parameter */: - case 171 /* VariableDeclaration */: - return node === parent.type; - case 172 /* FunctionDeclaration */: - case 141 /* FunctionExpression */: - case 142 /* ArrowFunction */: - case 121 /* Constructor */: - case 120 /* Method */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - return node === parent.type; - case 124 /* CallSignature */: - case 125 /* ConstructSignature */: - case 126 /* IndexSignature */: - return node === parent.type; - case 139 /* TypeAssertion */: - return node === parent.type; - case 137 /* CallExpression */: - case 138 /* NewExpression */: - return parent.typeArguments && parent.typeArguments.indexOf(node) >= 0; - } - } - return false; - } - function isInRightSideOfImportOrExportAssignment(node) { - while (node.parent.kind === 116 /* QualifiedName */) { - node = node.parent; - } - if (node.parent.kind === 179 /* ImportDeclaration */) { - return node.parent.entityName === node; - } - if (node.parent.kind === 180 /* ExportAssignment */) { - return node.parent.exportName === node; - } - return false; - } - function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 116 /* QualifiedName */ || node.parent.kind === 135 /* PropertyAccess */) && node.parent.right === node; - } - function getSymbolOfEntityName(entityName) { - if (ts.isDeclarationOrFunctionExpressionOrCatchVariableName(entityName)) { - return getSymbolOfNode(entityName.parent); - } - if (entityName.parent.kind === 180 /* ExportAssignment */) { - return resolveEntityName(entityName.parent.parent, entityName, ts.SymbolFlags.Value | ts.SymbolFlags.Type | ts.SymbolFlags.Namespace | 4194304 /* Import */); - } - if (isInRightSideOfImportOrExportAssignment(entityName)) { - return getSymbolOfPartOfRightHandSideOfImport(entityName); - } - if (isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { - entityName = entityName.parent; - } - if (isExpression(entityName)) { - if (entityName.kind === 59 /* Identifier */) { - var meaning = ts.SymbolFlags.Value | 4194304 /* Import */; - return resolveEntityName(entityName, entityName, meaning); - } - else if (entityName.kind === 116 /* QualifiedName */ || entityName.kind === 135 /* PropertyAccess */) { - var symbol = getNodeLinks(entityName).resolvedSymbol; - if (!symbol) { - checkPropertyAccess(entityName); - } - return getNodeLinks(entityName).resolvedSymbol; - } - else { - return; - } - } - else if (isTypeReferenceIdentifier(entityName)) { - var meaning = entityName.parent.kind === 127 /* TypeReference */ ? ts.SymbolFlags.Type : ts.SymbolFlags.Namespace; - meaning |= 4194304 /* Import */; - return resolveEntityName(entityName, entityName, meaning); - } - return undefined; - } - function getSymbolInfo(node) { - if (isInsideWithStatementBody(node)) { - return undefined; - } - if (ts.isDeclarationOrFunctionExpressionOrCatchVariableName(node)) { - return getSymbolOfNode(node.parent); - } - if (node.kind === 59 /* Identifier */ && isInRightSideOfImportOrExportAssignment(node)) { - return node.parent.kind === 180 /* ExportAssignment */ ? getSymbolOfEntityName(node) : getSymbolOfPartOfRightHandSideOfImport(node); - } - switch (node.kind) { - case 59 /* Identifier */: - case 135 /* PropertyAccess */: - case 116 /* QualifiedName */: - return getSymbolOfEntityName(node); - case 87 /* ThisKeyword */: - case 85 /* SuperKeyword */: - var type = checkExpression(node); - return type.symbol; - case 107 /* ConstructorKeyword */: - var constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 121 /* Constructor */) { - return constructorDeclaration.parent.symbol; - } - return undefined; - case 7 /* StringLiteral */: - if (node.parent.kind === 179 /* ImportDeclaration */ && node.parent.externalModuleName === node) { - var importSymbol = getSymbolOfNode(node.parent); - var moduleType = getTypeOfSymbol(importSymbol); - return moduleType ? moduleType.symbol : undefined; - } - case 6 /* NumericLiteral */: - if (node.parent.kind == 136 /* IndexedAccess */ && node.parent.index === node) { - var objectType = checkExpression(node.parent.object); - if (objectType === unknownType) - return undefined; - var apparentType = getApparentType(objectType); - if (apparentType === unknownType) - return undefined; - return getPropertyOfApparentType(apparentType, node.text); - } - break; - } - return undefined; - } - function getTypeOfNode(node) { - if (isInsideWithStatementBody(node)) { - return unknownType; - } - if (isExpression(node)) { - return getTypeOfExpression(node); - } - if (isTypeNode(node)) { - return getTypeFromTypeNode(node); - } - if (isTypeDeclaration(node)) { - var symbol = getSymbolOfNode(node); - return getDeclaredTypeOfSymbol(symbol); - } - if (isTypeDeclarationName(node)) { - var symbol = getSymbolInfo(node); - return symbol && getDeclaredTypeOfSymbol(symbol); - } - if (ts.isDeclaration(node)) { - var symbol = getSymbolOfNode(node); - return getTypeOfSymbol(symbol); - } - if (ts.isDeclarationOrFunctionExpressionOrCatchVariableName(node)) { - var symbol = getSymbolInfo(node); - return symbol && getTypeOfSymbol(symbol); - } - if (isInRightSideOfImportOrExportAssignment(node)) { - var symbol = getSymbolInfo(node); - var declaredType = symbol && getDeclaredTypeOfSymbol(symbol); - return declaredType !== unknownType ? declaredType : getTypeOfSymbol(symbol); - } - return unknownType; - } - function getTypeOfExpression(expr) { - if (isRightSideOfQualifiedNameOrPropertyAccess(expr)) { - expr = expr.parent; - } - return checkExpression(expr); - } - function getAugmentedPropertiesOfApparentType(type) { - var apparentType = getApparentType(type); - if (apparentType.flags & ts.TypeFlags.ObjectType) { - var propertiesByName = {}; - var results = []; - ts.forEach(getPropertiesOfType(apparentType), function (s) { - propertiesByName[s.name] = s; - results.push(s); - }); - var resolved = resolveObjectTypeMembers(type); - ts.forEachValue(resolved.members, function (s) { - if (symbolIsValue(s) && !propertiesByName[s.name]) { - propertiesByName[s.name] = s; - results.push(s); - } - }); - if (resolved === anyFunctionType || resolved.callSignatures.length || resolved.constructSignatures.length) { - ts.forEach(getPropertiesOfType(globalFunctionType), function (s) { - if (!propertiesByName[s.name]) { - propertiesByName[s.name] = s; - results.push(s); - } - }); - } - return results; - } - else { - return getPropertiesOfType(apparentType); - } - } - function getRootSymbol(symbol) { - return ((symbol.flags & 33554432 /* Transient */) && getSymbolLinks(symbol).target) || symbol; - } - function isExternalModuleSymbol(symbol) { - return symbol.flags & 128 /* ValueModule */ && symbol.declarations.length === 1 && symbol.declarations[0].kind === 182 /* SourceFile */; - } - function isNodeDescendentOf(node, ancestor) { - while (node) { - if (node === ancestor) - return true; - node = node.parent; - } - return false; - } - function isUniqueLocalName(name, container) { - for (var node = container; isNodeDescendentOf(node, container); node = node.nextContainer) { - if (node.locals && ts.hasProperty(node.locals, name) && node.locals[name].flags & (ts.SymbolFlags.Value | 524288 /* ExportValue */)) { - return false; - } - } - return true; - } - function getLocalNameOfContainer(container) { - var links = getNodeLinks(container); - if (!links.localModuleName) { - var prefix = ""; - var name = ts.unescapeIdentifier(container.name.text); - while (!isUniqueLocalName(ts.escapeIdentifier(prefix + name), container)) { - prefix += "_"; - } - links.localModuleName = prefix + ts.getTextOfNode(container.name); - } - return links.localModuleName; - } - function getLocalNameForSymbol(symbol, location) { - var node = location; - while (node) { - if ((node.kind === 177 /* ModuleDeclaration */ || node.kind === 176 /* EnumDeclaration */) && getSymbolOfNode(node) === symbol) { - return getLocalNameOfContainer(node); - } - node = node.parent; - } - ts.Debug.fail("getLocalNameForSymbol failed"); - } - function getExpressionNamePrefix(node) { - var symbol = getNodeLinks(node).resolvedSymbol; - if (symbol) { - var exportSymbol = getExportSymbolOfValueSymbolIfExported(symbol); - if (symbol !== exportSymbol && !(exportSymbol.flags & ts.SymbolFlags.ExportHasLocal)) { - symbol = exportSymbol; - } - if (symbol.parent) { - return isExternalModuleSymbol(symbol.parent) ? "exports" : getLocalNameForSymbol(getParentOfSymbol(symbol), node.parent); - } - } - } - function getExportAssignmentName(node) { - var symbol = getExportAssignmentSymbol(getSymbolOfNode(node)); - return symbol && symbolIsValue(symbol) ? symbolToString(symbol) : undefined; - } - function isTopLevelValueImportedViaEntityName(node) { - if (node.parent.kind !== 182 /* SourceFile */ || !node.entityName) { - return false; - } - var symbol = getSymbolOfNode(node); - var target = resolveImport(symbol); - return target !== unknownSymbol && ((target.flags & ts.SymbolFlags.Value) !== 0); - } - function hasSemanticErrors() { - return getDiagnostics().length > 0 || getGlobalDiagnostics().length > 0; - } - function isReferencedImportDeclaration(node) { - var symbol = getSymbolOfNode(node); - if (getSymbolLinks(symbol).referenced) { - return true; - } - if (node.flags & 1 /* Export */) { - var target = resolveImport(symbol); - if (target !== unknownSymbol && target.flags & ts.SymbolFlags.Value) { - return true; - } - } - return false; - } - function isImplementationOfOverload(node) { - if (node.body) { - var symbol = getSymbolOfNode(node); - var signaturesOfSymbol = getSignaturesOfSymbol(symbol); - return signaturesOfSymbol.length > 1 || (signaturesOfSymbol.length === 1 && signaturesOfSymbol[0].declaration !== node); - } - return false; - } - function getNodeCheckFlags(node) { - return getNodeLinks(node).flags; - } - function getEnumMemberValue(node) { - computeEnumMemberValues(node.parent); - return getNodeLinks(node).enumMemberValue; - } - function getConstantValue(node) { - var symbol = getNodeLinks(node).resolvedSymbol; - if (symbol && (symbol.flags & 4 /* EnumMember */)) { - var declaration = symbol.valueDeclaration; - var constantValue; - if (declaration.kind === 181 /* EnumMember */ && (constantValue = getNodeLinks(declaration).enumMemberValue) !== undefined) { - return constantValue; - } - } - return undefined; - } - function writeTypeAtLocation(location, enclosingDeclaration, flags, writer) { - var symbol = getSymbolOfNode(location); - var type = symbol && !(symbol.flags & 512 /* TypeLiteral */) ? getTypeOfSymbol(symbol) : getTypeFromTypeNode(location); - writeType(type, writer, enclosingDeclaration, flags); - } - function writeReturnTypeOfSignatureDeclaration(signatureDeclaration, enclosingDeclaration, flags, writer) { - var signature = getSignatureFromDeclaration(signatureDeclaration); - writeType(getReturnTypeOfSignature(signature), writer, enclosingDeclaration, flags); - } - function createResolver() { - return { - getProgram: function () { return program; }, - getLocalNameOfContainer: getLocalNameOfContainer, - getExpressionNamePrefix: getExpressionNamePrefix, - getExportAssignmentName: getExportAssignmentName, - isReferencedImportDeclaration: isReferencedImportDeclaration, - getNodeCheckFlags: getNodeCheckFlags, - getEnumMemberValue: getEnumMemberValue, - isTopLevelValueImportedViaEntityName: isTopLevelValueImportedViaEntityName, - hasSemanticErrors: hasSemanticErrors, - isDeclarationVisible: isDeclarationVisible, - isImplementationOfOverload: isImplementationOfOverload, - writeTypeAtLocation: writeTypeAtLocation, - writeReturnTypeOfSignatureDeclaration: writeReturnTypeOfSignatureDeclaration, - isSymbolAccessible: isSymbolAccessible, - isImportDeclarationEntityNameReferenceDeclarationVisible: isImportDeclarationEntityNameReferenceDeclarationVisible, - getConstantValue: getConstantValue - }; - } - function invokeEmitter(targetSourceFile) { - var resolver = createResolver(); - checkProgram(); - return ts.emitFiles(resolver, targetSourceFile); - } - function initializeTypeChecker() { - ts.forEach(program.getSourceFiles(), function (file) { - ts.bindSourceFile(file); - ts.forEach(file.semanticErrors, addDiagnostic); - }); - ts.forEach(program.getSourceFiles(), function (file) { - if (!ts.isExternalModule(file)) { - extendSymbolTable(globals, file.locals); - } - }); - getSymbolLinks(undefinedSymbol).type = undefinedType; - getSymbolLinks(argumentsSymbol).type = getGlobalType("IArguments"); - getSymbolLinks(unknownSymbol).type = unknownType; - globals[undefinedSymbol.name] = undefinedSymbol; - globalArraySymbol = getGlobalSymbol("Array"); - globalArrayType = getTypeOfGlobalSymbol(globalArraySymbol, 1); - globalObjectType = getGlobalType("Object"); - globalFunctionType = getGlobalType("Function"); - globalStringType = getGlobalType("String"); - globalNumberType = getGlobalType("Number"); - globalBooleanType = getGlobalType("Boolean"); - globalRegExpType = getGlobalType("RegExp"); - } - initializeTypeChecker(); - return checker; - } - ts.createTypeChecker = createTypeChecker; -})(ts || (ts = {})); -var TypeScript; -(function (TypeScript) { - TypeScript.DiagnosticCode = { - error_TS_0_1: "error TS{0}: {1}", - warning_TS_0_1: "warning TS{0}: {1}", - Unrecognized_escape_sequence: "Unrecognized escape sequence.", - Unexpected_character_0: "Unexpected character {0}.", - Missing_close_quote_character: "Missing close quote character.", - Identifier_expected: "Identifier expected.", - _0_keyword_expected: "'{0}' keyword expected.", - _0_expected: "'{0}' expected.", - Identifier_expected_0_is_a_keyword: "Identifier expected; '{0}' is a keyword.", - Automatic_semicolon_insertion_not_allowed: "Automatic semicolon insertion not allowed.", - Unexpected_token_0_expected: "Unexpected token; '{0}' expected.", - Trailing_comma_not_allowed: "Trailing comma not allowed.", - AsteriskSlash_expected: "'*/' expected.", - public_or_private_modifier_must_precede_static: "'public' or 'private' modifier must precede 'static'.", - Unexpected_token: "Unexpected token.", - Catch_clause_parameter_cannot_have_a_type_annotation: "Catch clause parameter cannot have a type annotation.", - A_rest_parameter_must_be_last_in_a_parameter_list: "A rest parameter must be last in a parameter list.", - Parameter_cannot_have_question_mark_and_initializer: "Parameter cannot have question mark and initializer.", - A_required_parameter_cannot_follow_an_optional_parameter: "A required parameter cannot follow an optional parameter.", - Index_signatures_cannot_have_rest_parameters: "Index signatures cannot have rest parameters.", - Index_signature_parameter_cannot_have_accessibility_modifiers: "Index signature parameter cannot have accessibility modifiers.", - Index_signature_parameter_cannot_have_a_question_mark: "Index signature parameter cannot have a question mark.", - Index_signature_parameter_cannot_have_an_initializer: "Index signature parameter cannot have an initializer.", - Index_signature_must_have_a_type_annotation: "Index signature must have a type annotation.", - Index_signature_parameter_must_have_a_type_annotation: "Index signature parameter must have a type annotation.", - Index_signature_parameter_type_must_be_string_or_number: "Index signature parameter type must be 'string' or 'number'.", - extends_clause_already_seen: "'extends' clause already seen.", - extends_clause_must_precede_implements_clause: "'extends' clause must precede 'implements' clause.", - Classes_can_only_extend_a_single_class: "Classes can only extend a single class.", - implements_clause_already_seen: "'implements' clause already seen.", - Accessibility_modifier_already_seen: "Accessibility modifier already seen.", - _0_modifier_must_precede_1_modifier: "'{0}' modifier must precede '{1}' modifier.", - _0_modifier_already_seen: "'{0}' modifier already seen.", - _0_modifier_cannot_appear_on_a_class_element: "'{0}' modifier cannot appear on a class element.", - Interface_declaration_cannot_have_implements_clause: "Interface declaration cannot have 'implements' clause.", - super_invocation_cannot_have_type_arguments: "'super' invocation cannot have type arguments.", - Only_ambient_modules_can_use_quoted_names: "Only ambient modules can use quoted names.", - Statements_are_not_allowed_in_ambient_contexts: "Statements are not allowed in ambient contexts.", - A_function_implementation_cannot_be_declared_in_an_ambient_context: "A function implementation cannot be declared in an ambient context.", - A_declare_modifier_cannot_be_used_in_an_already_ambient_context: "A 'declare' modifier cannot be used in an already ambient context.", - Initializers_are_not_allowed_in_ambient_contexts: "Initializers are not allowed in ambient contexts.", - _0_modifier_cannot_appear_on_a_module_element: "'{0}' modifier cannot appear on a module element.", - A_declare_modifier_cannot_be_used_with_an_interface_declaration: "A 'declare' modifier cannot be used with an interface declaration.", - A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file: "A 'declare' modifier is required for a top level declaration in a .d.ts file.", - A_rest_parameter_cannot_be_optional: "A rest parameter cannot be optional.", - A_rest_parameter_cannot_have_an_initializer: "A rest parameter cannot have an initializer.", - set_accessor_must_have_exactly_one_parameter: "'set' accessor must have exactly one parameter.", - set_accessor_parameter_cannot_be_optional: "'set' accessor parameter cannot be optional.", - set_accessor_parameter_cannot_have_an_initializer: "'set' accessor parameter cannot have an initializer.", - set_accessor_cannot_have_rest_parameter: "'set' accessor cannot have rest parameter.", - get_accessor_cannot_have_parameters: "'get' accessor cannot have parameters.", - Modifiers_cannot_appear_here: "Modifiers cannot appear here.", - Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: "Accessors are only available when targeting ECMAScript 5 and higher.", - Enum_member_must_have_initializer: "Enum member must have initializer.", - Export_assignment_cannot_be_used_in_internal_modules: "Export assignment cannot be used in internal modules.", - Ambient_enum_elements_can_only_have_integer_literal_initializers: "Ambient enum elements can only have integer literal initializers.", - module_class_interface_enum_import_or_statement: "module, class, interface, enum, import or statement", - constructor_function_accessor_or_variable: "constructor, function, accessor or variable", - statement: "statement", - case_or_default_clause: "case or default clause", - identifier: "identifier", - call_construct_index_property_or_function_signature: "call, construct, index, property or function signature", - expression: "expression", - type_name: "type name", - property_or_accessor: "property or accessor", - parameter: "parameter", - type: "type", - type_parameter: "type parameter", - A_declare_modifier_cannot_be_used_with_an_import_declaration: "A 'declare' modifier cannot be used with an import declaration.", - Invalid_reference_directive_syntax: "Invalid 'reference' directive syntax.", - Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher: "Octal literals are not available when targeting ECMAScript 5 and higher.", - Accessors_are_not_allowed_in_ambient_contexts: "Accessors are not allowed in ambient contexts.", - _0_modifier_cannot_appear_on_a_constructor_declaration: "'{0}' modifier cannot appear on a constructor declaration.", - _0_modifier_cannot_appear_on_a_parameter: "'{0}' modifier cannot appear on a parameter.", - Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement: "Only a single variable declaration is allowed in a 'for...in' statement.", - Type_parameters_cannot_appear_on_a_constructor_declaration: "Type parameters cannot appear on a constructor declaration.", - Type_annotation_cannot_appear_on_a_constructor_declaration: "Type annotation cannot appear on a constructor declaration.", - Type_parameters_cannot_appear_on_an_accessor: "Type parameters cannot appear on an accessor.", - Type_annotation_cannot_appear_on_a_set_accessor: "Type annotation cannot appear on a 'set' accessor.", - Index_signature_must_have_exactly_one_parameter: "Index signature must have exactly one parameter.", - _0_list_cannot_be_empty: "'{0}' list cannot be empty.", - variable_declaration: "variable declaration", - type_argument: "type argument", - Invalid_use_of_0_in_strict_mode: "Invalid use of '{0}' in strict mode.", - with_statements_are_not_allowed_in_strict_mode: "'with' statements are not allowed in strict mode.", - delete_cannot_be_called_on_an_identifier_in_strict_mode: "'delete' cannot be called on an identifier in strict mode.", - Invalid_left_hand_side_in_for_in_statement: "Invalid left-hand side in 'for...in' statement.", - continue_statement_can_only_be_used_within_an_enclosing_iteration_statement: "'continue' statement can only be used within an enclosing iteration statement.", - break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement: "'break' statement can only be used within an enclosing iteration or switch statement.", - Jump_target_not_found: "Jump target not found.", - Jump_target_cannot_cross_function_boundary: "Jump target cannot cross function boundary.", - return_statement_must_be_contained_within_a_function_body: "'return' statement must be contained within a function body.", - Expression_expected: "Expression expected.", - Type_expected: "Type expected.", - Duplicate_identifier_0: "Duplicate identifier '{0}'.", - The_name_0_does_not_exist_in_the_current_scope: "The name '{0}' does not exist in the current scope.", - The_name_0_does_not_refer_to_a_value: "The name '{0}' does not refer to a value.", - super_can_only_be_used_inside_a_class_instance_method: "'super' can only be used inside a class instance method.", - The_left_hand_side_of_an_assignment_expression_must_be_a_variable_property_or_indexer: "The left-hand side of an assignment expression must be a variable, property or indexer.", - Value_of_type_0_is_not_callable_Did_you_mean_to_include_new: "Value of type '{0}' is not callable. Did you mean to include 'new'?", - Value_of_type_0_is_not_callable: "Value of type '{0}' is not callable.", - Value_of_type_0_is_not_newable: "Value of type '{0}' is not newable.", - An_index_expression_argument_must_be_string_number_or_any: "An index expression argument must be 'string', 'number', or 'any'.", - Operator_0_cannot_be_applied_to_types_1_and_2: "Operator '{0}' cannot be applied to types '{1}' and '{2}'.", - Type_0_is_not_assignable_to_type_1: "Type '{0}' is not assignable to type '{1}'.", - Type_0_is_not_assignable_to_type_1_NL_2: "Type '{0}' is not assignable to type '{1}':{NL}{2}", - Expected_var_class_interface_or_module: "Expected var, class, interface, or module.", - Getter_0_already_declared: "Getter '{0}' already declared.", - Setter_0_already_declared: "Setter '{0}' already declared.", - Exported_class_0_extends_private_class_1: "Exported class '{0}' extends private class '{1}'.", - Exported_class_0_implements_private_interface_1: "Exported class '{0}' implements private interface '{1}'.", - Exported_interface_0_extends_private_interface_1: "Exported interface '{0}' extends private interface '{1}'.", - Exported_class_0_extends_class_from_inaccessible_module_1: "Exported class '{0}' extends class from inaccessible module {1}.", - Exported_class_0_implements_interface_from_inaccessible_module_1: "Exported class '{0}' implements interface from inaccessible module {1}.", - Exported_interface_0_extends_interface_from_inaccessible_module_1: "Exported interface '{0}' extends interface from inaccessible module {1}.", - Public_static_property_0_of_exported_class_has_or_is_using_private_type_1: "Public static property '{0}' of exported class has or is using private type '{1}'.", - Public_property_0_of_exported_class_has_or_is_using_private_type_1: "Public property '{0}' of exported class has or is using private type '{1}'.", - Property_0_of_exported_interface_has_or_is_using_private_type_1: "Property '{0}' of exported interface has or is using private type '{1}'.", - Exported_variable_0_has_or_is_using_private_type_1: "Exported variable '{0}' has or is using private type '{1}'.", - Public_static_property_0_of_exported_class_is_using_inaccessible_module_1: "Public static property '{0}' of exported class is using inaccessible module {1}.", - Public_property_0_of_exported_class_is_using_inaccessible_module_1: "Public property '{0}' of exported class is using inaccessible module {1}.", - Property_0_of_exported_interface_is_using_inaccessible_module_1: "Property '{0}' of exported interface is using inaccessible module {1}.", - Exported_variable_0_is_using_inaccessible_module_1: "Exported variable '{0}' is using inaccessible module {1}.", - Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_type_1: "Parameter '{0}' of constructor from exported class has or is using private type '{1}'.", - Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_type_1: "Parameter '{0}' of public static property setter from exported class has or is using private type '{1}'.", - Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_type_1: "Parameter '{0}' of public property setter from exported class has or is using private type '{1}'.", - Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_type_1: "Parameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.", - Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_type_1: "Parameter '{0}' of call signature from exported interface has or is using private type '{1}'.", - Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_type_1: "Parameter '{0}' of public static method from exported class has or is using private type '{1}'.", - Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_type_1: "Parameter '{0}' of public method from exported class has or is using private type '{1}'.", - Parameter_0_of_method_from_exported_interface_has_or_is_using_private_type_1: "Parameter '{0}' of method from exported interface has or is using private type '{1}'.", - Parameter_0_of_exported_function_has_or_is_using_private_type_1: "Parameter '{0}' of exported function has or is using private type '{1}'.", - Parameter_0_of_constructor_from_exported_class_is_using_inaccessible_module_1: "Parameter '{0}' of constructor from exported class is using inaccessible module {1}.", - Parameter_0_of_public_static_property_setter_from_exported_class_is_using_inaccessible_module_1: "Parameter '{0}' of public static property setter from exported class is using inaccessible module {1}.", - Parameter_0_of_public_property_setter_from_exported_class_is_using_inaccessible_module_1: "Parameter '{0}' of public property setter from exported class is using inaccessible module {1}.", - Parameter_0_of_constructor_signature_from_exported_interface_is_using_inaccessible_module_1: "Parameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.", - Parameter_0_of_call_signature_from_exported_interface_is_using_inaccessible_module_1: "Parameter '{0}' of call signature from exported interface is using inaccessible module {1}", - Parameter_0_of_public_static_method_from_exported_class_is_using_inaccessible_module_1: "Parameter '{0}' of public static method from exported class is using inaccessible module {1}.", - Parameter_0_of_public_method_from_exported_class_is_using_inaccessible_module_1: "Parameter '{0}' of public method from exported class is using inaccessible module {1}.", - Parameter_0_of_method_from_exported_interface_is_using_inaccessible_module_1: "Parameter '{0}' of method from exported interface is using inaccessible module {1}.", - Parameter_0_of_exported_function_is_using_inaccessible_module_1: "Parameter '{0}' of exported function is using inaccessible module {1}.", - Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_type_0: "Return type of public static property getter from exported class has or is using private type '{0}'.", - Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_type_0: "Return type of public property getter from exported class has or is using private type '{0}'.", - Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_type_0: "Return type of constructor signature from exported interface has or is using private type '{0}'.", - Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_type_0: "Return type of call signature from exported interface has or is using private type '{0}'.", - Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_type_0: "Return type of index signature from exported interface has or is using private type '{0}'.", - Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_type_0: "Return type of public static method from exported class has or is using private type '{0}'.", - Return_type_of_public_method_from_exported_class_has_or_is_using_private_type_0: "Return type of public method from exported class has or is using private type '{0}'.", - Return_type_of_method_from_exported_interface_has_or_is_using_private_type_0: "Return type of method from exported interface has or is using private type '{0}'.", - Return_type_of_exported_function_has_or_is_using_private_type_0: "Return type of exported function has or is using private type '{0}'.", - Return_type_of_public_static_property_getter_from_exported_class_is_using_inaccessible_module_0: "Return type of public static property getter from exported class is using inaccessible module {0}.", - Return_type_of_public_property_getter_from_exported_class_is_using_inaccessible_module_0: "Return type of public property getter from exported class is using inaccessible module {0}.", - Return_type_of_constructor_signature_from_exported_interface_is_using_inaccessible_module_0: "Return type of constructor signature from exported interface is using inaccessible module {0}.", - Return_type_of_call_signature_from_exported_interface_is_using_inaccessible_module_0: "Return type of call signature from exported interface is using inaccessible module {0}.", - Return_type_of_index_signature_from_exported_interface_is_using_inaccessible_module_0: "Return type of index signature from exported interface is using inaccessible module {0}.", - Return_type_of_public_static_method_from_exported_class_is_using_inaccessible_module_0: "Return type of public static method from exported class is using inaccessible module {0}.", - Return_type_of_public_method_from_exported_class_is_using_inaccessible_module_0: "Return type of public method from exported class is using inaccessible module {0}.", - Return_type_of_method_from_exported_interface_is_using_inaccessible_module_0: "Return type of method from exported interface is using inaccessible module {0}.", - Return_type_of_exported_function_is_using_inaccessible_module_0: "Return type of exported function is using inaccessible module {0}.", - new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: "'new T[]' cannot be used to create an array. Use 'new Array()' instead.", - A_parameter_list_must_follow_a_generic_type_argument_list_expected: "A parameter list must follow a generic type argument list. '(' expected.", - Multiple_constructor_implementations_are_not_allowed: "Multiple constructor implementations are not allowed.", - Cannot_find_external_module_0: "Cannot find external module '{0}'.", - Module_cannot_be_aliased_to_a_non_module_type: "Module cannot be aliased to a non-module type.", - A_class_may_only_extend_another_class: "A class may only extend another class.", - A_class_may_only_implement_another_class_or_interface: "A class may only implement another class or interface.", - An_interface_may_only_extend_a_class_or_another_interface: "An interface may only extend a class or another interface.", - Unable_to_resolve_type: "Unable to resolve type.", - Unable_to_resolve_type_of_0: "Unable to resolve type of '{0}'.", - Unable_to_resolve_type_parameter_constraint: "Unable to resolve type parameter constraint.", - Type_parameter_constraint_cannot_be_a_primitive_type: "Type parameter constraint cannot be a primitive type.", - Supplied_parameters_do_not_match_any_signature_of_call_target: "Supplied parameters do not match any signature of call target.", - Supplied_parameters_do_not_match_any_signature_of_call_target_NL_0: "Supplied parameters do not match any signature of call target:{NL}{0}", - Cannot_use_new_with_an_expression_whose_type_lacks_a_signature: "Cannot use 'new' with an expression whose type lacks a signature.", - Only_a_void_function_can_be_called_with_the_new_keyword: "Only a void function can be called with the 'new' keyword.", - Could_not_select_overload_for_new_expression: "Could not select overload for 'new' expression.", - Type_0_does_not_satisfy_the_constraint_1: "Type '{0}' does not satisfy the constraint '{1}'.", - Could_not_select_overload_for_call_expression: "Could not select overload for 'call' expression.", - Cannot_invoke_an_expression_whose_type_lacks_a_call_signature: "Cannot invoke an expression whose type lacks a call signature.", - Calls_to_super_are_only_valid_inside_a_class: "Calls to 'super' are only valid inside a class.", - Generic_type_0_requires_1_type_argument_s: "Generic type '{0}' requires {1} type argument(s).", - Type_of_array_literal_cannot_be_determined_Best_common_type_could_not_be_found_for_array_elements: "Type of array literal cannot be determined. Best common type could not be found for array elements.", - Could_not_find_enclosing_symbol_for_dotted_name_0: "Could not find enclosing symbol for dotted name '{0}'.", - Property_0_does_not_exist_on_value_of_type_1: "Property '{0}' does not exist on value of type '{1}'.", - Cannot_find_name_0: "Cannot find name '{0}'.", - get_and_set_accessor_must_have_the_same_type: "'get' and 'set' accessor must have the same type.", - this_cannot_be_referenced_in_current_location: "'this' cannot be referenced in current location.", - Static_members_cannot_reference_class_type_parameters: "Static members cannot reference class type parameters.", - Type_0_recursively_references_itself_as_a_base_type: "Type '{0}' recursively references itself as a base type.", - super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class: "'super' property access is permitted only in a constructor, member function, or member accessor of a derived class.", - super_can_only_be_referenced_in_a_derived_class: "'super' can only be referenced in a derived class.", - A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties: "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.", - Constructors_for_derived_classes_must_contain_a_super_call: "Constructors for derived classes must contain a 'super' call.", - Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors: "Super calls are not permitted outside constructors or in nested functions inside constructors.", - _0_1_is_inaccessible: "'{0}.{1}' is inaccessible.", - this_cannot_be_referenced_in_a_module_body: "'this' cannot be referenced in a module body.", - Invalid_expression_types_not_known_to_support_the_addition_operator: "Invalid '+' expression - types not known to support the addition operator.", - The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.", - The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.", - An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type: "An arithmetic operand must be of type 'any', 'number' or an enum type.", - Variable_declarations_of_a_for_statement_cannot_use_a_type_annotation: "Variable declarations of a 'for' statement cannot use a type annotation.", - Variable_declarations_of_a_for_statement_must_be_of_types_string_or_any: "Variable declarations of a 'for' statement must be of types 'string' or 'any'.", - The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter: "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.", - The_left_hand_side_of_an_in_expression_must_be_of_types_any_string_or_number: "The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'.", - The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter.", - The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.", - The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type.", - Setters_cannot_return_a_value: "Setters cannot return a value.", - Tried_to_query_type_of_uninitialized_module_0: "Tried to query type of uninitialized module '{0}'.", - Tried_to_set_variable_type_to_uninitialized_module_type_0: "Tried to set variable type to uninitialized module type '{0}'.", - Type_0_is_not_generic: "Type '{0}' is not generic.", - Getters_must_return_a_value: "Getters must return a value.", - Getter_and_setter_accessors_do_not_agree_in_visibility: "Getter and setter accessors do not agree in visibility.", - Invalid_left_hand_side_of_assignment_expression: "Invalid left-hand side of assignment expression.", - Function_declared_a_non_void_return_type_but_has_no_return_expression: "Function declared a non-void return type, but has no return expression.", - Cannot_resolve_return_type_reference: "Cannot resolve return type reference.", - Constructors_cannot_have_a_return_type_of_void: "Constructors cannot have a return type of 'void'.", - Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2: "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.", - All_symbols_within_a_with_block_will_be_resolved_to_any: "All symbols within a with block will be resolved to 'any'.", - Import_declarations_in_an_internal_module_cannot_reference_an_external_module: "Import declarations in an internal module cannot reference an external module.", - Class_0_declares_interface_1_but_does_not_implement_it_NL_2: "Class {0} declares interface {1} but does not implement it:{NL}{2}", - Class_0_declares_class_1_as_an_interface_but_does_not_implement_it_NL_2: "Class {0} declares class {1} as an interface but does not implement it:{NL}{2}", - The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer: "The operand of an increment or decrement operator must be a variable, property or indexer.", - this_cannot_be_referenced_in_a_static_property_initializer: "'this' cannot be referenced in a static property initializer.", - Class_0_cannot_extend_class_1_NL_2: "Class '{0}' cannot extend class '{1}':{NL}{2}", - Interface_0_cannot_extend_class_1_NL_2: "Interface '{0}' cannot extend class '{1}':{NL}{2}", - Interface_0_cannot_extend_interface_1_NL_2: "Interface '{0}' cannot extend interface '{1}':{NL}{2}", - Overload_signature_is_not_compatible_with_function_definition: "Overload signature is not compatible with function definition.", - Overload_signature_is_not_compatible_with_function_definition_NL_0: "Overload signature is not compatible with function definition:{NL}{0}", - Overload_signatures_must_all_be_public_or_private: "Overload signatures must all be public or private.", - Overload_signatures_must_all_be_exported_or_not_exported: "Overload signatures must all be exported or not exported.", - Overload_signatures_must_all_be_ambient_or_non_ambient: "Overload signatures must all be ambient or non-ambient.", - Overload_signatures_must_all_be_optional_or_required: "Overload signatures must all be optional or required.", - Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature: "Specialized overload signature is not assignable to any non-specialized signature.", - this_cannot_be_referenced_in_constructor_arguments: "'this' cannot be referenced in constructor arguments.", - Instance_member_cannot_be_accessed_off_a_class: "Instance member cannot be accessed off a class.", - Untyped_function_calls_may_not_accept_type_arguments: "Untyped function calls may not accept type arguments.", - Non_generic_functions_may_not_accept_type_arguments: "Non-generic functions may not accept type arguments.", - A_generic_type_may_not_reference_itself_with_a_wrapped_form_of_its_own_type_parameters: "A generic type may not reference itself with a wrapped form of its own type parameters.", - A_rest_parameter_must_be_of_an_array_type: "A rest parameter must be of an array type.", - Overload_signature_implementation_cannot_use_specialized_type: "Overload signature implementation cannot use specialized type.", - Export_assignments_may_only_be_used_at_the_top_level_of_external_modules: "Export assignments may only be used at the top-level of external modules.", - Export_assignments_may_only_be_made_with_variables_functions_classes_interfaces_enums_and_internal_modules: "Export assignments may only be made with variables, functions, classes, interfaces, enums and internal modules.", - Only_public_methods_of_the_base_class_are_accessible_via_the_super_keyword: "Only public methods of the base class are accessible via the 'super' keyword.", - Numeric_indexer_type_0_must_be_assignable_to_string_indexer_type_1: "Numeric indexer type '{0}' must be assignable to string indexer type '{1}'.", - Numeric_indexer_type_0_must_be_assignable_to_string_indexer_type_1_NL_2: "Numeric indexer type '{0}' must be assignable to string indexer type '{1}':{NL}{2}", - All_numerically_named_properties_must_be_assignable_to_numeric_indexer_type_0: "All numerically named properties must be assignable to numeric indexer type '{0}'.", - All_numerically_named_properties_must_be_assignable_to_numeric_indexer_type_0_NL_1: "All numerically named properties must be assignable to numeric indexer type '{0}':{NL}{1}", - All_named_properties_must_be_assignable_to_string_indexer_type_0: "All named properties must be assignable to string indexer type '{0}'.", - All_named_properties_must_be_assignable_to_string_indexer_type_0_NL_1: "All named properties must be assignable to string indexer type '{0}':{NL}{1}", - A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation: "A parameter initializer is only allowed in a function or constructor implementation.", - Function_expression_declared_a_non_void_return_type_but_has_no_return_expression: "Function expression declared a non-void return type, but has no return expression.", - Import_declaration_referencing_identifier_from_internal_module_can_only_be_made_with_variables_functions_classes_interfaces_enums_and_internal_modules: "Import declaration referencing identifier from internal module can only be made with variables, functions, classes, interfaces, enums and internal modules.", - Module_0_has_no_exported_member_1: "Module '{0}' has no exported member '{1}'.", - Unable_to_resolve_module_reference_0: "Unable to resolve module reference '{0}'.", - Could_not_find_module_0_in_module_1: "Could not find module '{0}' in module '{1}'.", - Exported_import_declaration_0_is_assigned_value_with_type_that_has_or_is_using_private_type_1: "Exported import declaration '{0}' is assigned value with type that has or is using private type '{1}'.", - Exported_import_declaration_0_is_assigned_value_with_type_that_is_using_inaccessible_module_1: "Exported import declaration '{0}' is assigned value with type that is using inaccessible module '{1}'.", - Exported_import_declaration_0_is_assigned_type_that_has_or_is_using_private_type_1: "Exported import declaration '{0}' is assigned type that has or is using private type '{1}'.", - Exported_import_declaration_0_is_assigned_type_that_is_using_inaccessible_module_1: "Exported import declaration '{0}' is assigned type that is using inaccessible module '{1}'.", - Exported_import_declaration_0_is_assigned_container_that_is_or_is_using_inaccessible_module_1: "Exported import declaration '{0}' is assigned container that is or is using inaccessible module '{1}'.", - Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_1: "Type name '{0}' in extends clause does not reference constructor function for '{1}'.", - Internal_module_reference_0_in_import_declaration_does_not_reference_module_instance_for_1: "Internal module reference '{0}' in import declaration does not reference module instance for '{1}'.", - Module_0_cannot_merge_with_previous_declaration_of_1_in_a_different_file_2: "Module '{0}' cannot merge with previous declaration of '{1}' in a different file '{2}'.", - Interface_0_cannot_simultaneously_extend_types_1_and_2_NL_3: "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}':{NL}{3}", - Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it: "Initializer of parameter '{0}' cannot reference identifier '{1}' declared after it.", - Ambient_external_module_declaration_cannot_be_reopened: "Ambient external module declaration cannot be reopened.", - All_declarations_of_merged_declaration_0_must_be_exported_or_not_exported: "All declarations of merged declaration '{0}' must be exported or not exported.", - super_cannot_be_referenced_in_constructor_arguments: "'super' cannot be referenced in constructor arguments.", - Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: "Return type of constructor signature must be assignable to the instance type of the class.", - Ambient_external_module_declaration_must_be_defined_in_global_context: "Ambient external module declaration must be defined in global context.", - Ambient_external_module_declaration_cannot_specify_relative_module_name: "Ambient external module declaration cannot specify relative module name.", - Import_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name: "Import declaration in an ambient external module declaration cannot reference external module through relative external module name.", - No_best_common_type_exists_among_return_expressions: "No best common type exists among return expressions.", - Import_declaration_cannot_refer_to_external_module_reference_when_noResolve_option_is_set: "Import declaration cannot refer to external module reference when --noResolve option is set.", - Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference: "Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference.", - Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference: "Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference.", - Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference: "Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference.", - Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference: "Expression resolves to '_super' that compiler uses to capture base class reference.", - TypeParameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_type_1: "TypeParameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.", - TypeParameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_type_1: "TypeParameter '{0}' of call signature from exported interface has or is using private type '{1}'.", - TypeParameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_type_1: "TypeParameter '{0}' of public static method from exported class has or is using private type '{1}'.", - TypeParameter_0_of_public_method_from_exported_class_has_or_is_using_private_type_1: "TypeParameter '{0}' of public method from exported class has or is using private type '{1}'.", - TypeParameter_0_of_method_from_exported_interface_has_or_is_using_private_type_1: "TypeParameter '{0}' of method from exported interface has or is using private type '{1}'.", - TypeParameter_0_of_exported_function_has_or_is_using_private_type_1: "TypeParameter '{0}' of exported function has or is using private type '{1}'.", - TypeParameter_0_of_constructor_signature_from_exported_interface_is_using_inaccessible_module_1: "TypeParameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.", - TypeParameter_0_of_call_signature_from_exported_interface_is_using_inaccessible_module_1: "TypeParameter '{0}' of call signature from exported interface is using inaccessible module {1}", - TypeParameter_0_of_public_static_method_from_exported_class_is_using_inaccessible_module_1: "TypeParameter '{0}' of public static method from exported class is using inaccessible module {1}.", - TypeParameter_0_of_public_method_from_exported_class_is_using_inaccessible_module_1: "TypeParameter '{0}' of public method from exported class is using inaccessible module {1}.", - TypeParameter_0_of_method_from_exported_interface_is_using_inaccessible_module_1: "TypeParameter '{0}' of method from exported interface is using inaccessible module {1}.", - TypeParameter_0_of_exported_function_is_using_inaccessible_module_1: "TypeParameter '{0}' of exported function is using inaccessible module {1}.", - TypeParameter_0_of_exported_class_has_or_is_using_private_type_1: "TypeParameter '{0}' of exported class has or is using private type '{1}'.", - TypeParameter_0_of_exported_interface_has_or_is_using_private_type_1: "TypeParameter '{0}' of exported interface has or is using private type '{1}'.", - TypeParameter_0_of_exported_class_is_using_inaccessible_module_1: "TypeParameter '{0}' of exported class is using inaccessible module {1}.", - TypeParameter_0_of_exported_interface_is_using_inaccessible_module_1: "TypeParameter '{0}' of exported interface is using inaccessible module {1}.", - Duplicate_identifier_i_Compiler_uses_i_to_initialize_rest_parameter: "Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter.", - Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters: "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", - No_best_common_type_exists_between_0_and_1: "No best common type exists between '{0}' and '{1}'.", - No_best_common_type_exists_between_0_1_and_2: "No best common type exists between '{0}', '{1}', and '{2}'.", - Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module: "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of an external module.", - Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list: "Constraint of a type parameter cannot reference any type parameter from the same type parameter list.", - Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor.", - Parameter_0_cannot_be_referenced_in_its_initializer: "Parameter '{0}' cannot be referenced in its initializer.", - Duplicate_string_index_signature: "Duplicate string index signature.", - Duplicate_number_index_signature: "Duplicate number index signature.", - All_declarations_of_an_interface_must_have_identical_type_parameters: "All declarations of an interface must have identical type parameters.", - Expression_resolves_to_variable_declaration_i_that_compiler_uses_to_initialize_rest_parameter: "Expression resolves to variable declaration '_i' that compiler uses to initialize rest parameter.", - Neither_type_0_nor_type_1_is_assignable_to_the_other: "Neither type '{0}' nor type '{1}' is assignable to the other.", - Neither_type_0_nor_type_1_is_assignable_to_the_other_NL_2: "Neither type '{0}' nor type '{1}' is assignable to the other:{NL}{2}", - Duplicate_function_implementation: "Duplicate function implementation.", - Function_implementation_expected: "Function implementation expected.", - Function_overload_name_must_be_0: "Function overload name must be '{0}'.", - Constructor_implementation_expected: "Constructor implementation expected.", - Class_name_cannot_be_0: "Class name cannot be '{0}'.", - Interface_name_cannot_be_0: "Interface name cannot be '{0}'.", - Enum_name_cannot_be_0: "Enum name cannot be '{0}'.", - A_module_cannot_have_multiple_export_assignments: "A module cannot have multiple export assignments.", - Export_assignment_not_allowed_in_module_with_exported_element: "Export assignment not allowed in module with exported element.", - A_parameter_property_is_only_allowed_in_a_constructor_implementation: "A parameter property is only allowed in a constructor implementation.", - Function_overload_must_be_static: "Function overload must be static.", - Function_overload_must_not_be_static: "Function overload must not be static.", - Type_0_is_missing_property_1_from_type_2: "Type '{0}' is missing property '{1}' from type '{2}'.", - Types_of_property_0_of_types_1_and_2_are_incompatible: "Types of property '{0}' of types '{1}' and '{2}' are incompatible.", - Types_of_property_0_of_types_1_and_2_are_incompatible_NL_3: "Types of property '{0}' of types '{1}' and '{2}' are incompatible:{NL}{3}", - Property_0_defined_as_private_in_type_1_is_defined_as_public_in_type_2: "Property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.", - Property_0_defined_as_public_in_type_1_is_defined_as_private_in_type_2: "Property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.", - Types_0_and_1_define_property_2_as_private: "Types '{0}' and '{1}' define property '{2}' as private.", - Call_signatures_of_types_0_and_1_are_incompatible: "Call signatures of types '{0}' and '{1}' are incompatible.", - Call_signatures_of_types_0_and_1_are_incompatible_NL_2: "Call signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - Type_0_requires_a_call_signature_but_type_1_lacks_one: "Type '{0}' requires a call signature, but type '{1}' lacks one.", - Construct_signatures_of_types_0_and_1_are_incompatible: "Construct signatures of types '{0}' and '{1}' are incompatible.", - Construct_signatures_of_types_0_and_1_are_incompatible_NL_2: "Construct signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - Type_0_requires_a_construct_signature_but_type_1_lacks_one: "Type '{0}' requires a construct signature, but type '{1}' lacks one.", - Index_signatures_of_types_0_and_1_are_incompatible: "Index signatures of types '{0}' and '{1}' are incompatible.", - Index_signatures_of_types_0_and_1_are_incompatible_NL_2: "Index signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - Call_signature_expects_0_or_fewer_parameters: "Call signature expects {0} or fewer parameters.", - Could_not_apply_type_0_to_argument_1_which_is_of_type_2: "Could not apply type '{0}' to argument {1} which is of type '{2}'.", - Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.", - Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.", - Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.", - Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.", - Types_of_static_property_0_of_class_1_and_class_2_are_incompatible: "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible.", - Types_of_static_property_0_of_class_1_and_class_2_are_incompatible_NL_3: "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible:{NL}{3}", - Type_reference_cannot_refer_to_container_0: "Type reference cannot refer to container '{0}'.", - Type_reference_must_refer_to_type: "Type reference must refer to type.", - In_enums_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_the_first_enum_element: "In enums with multiple declarations only one declaration can omit an initializer for the first enum element.", - _0_overload_s: " (+ {0} overload(s))", - Variable_declaration_cannot_have_the_same_name_as_an_import_declaration: "Variable declaration cannot have the same name as an import declaration.", - Signature_expected_0_type_arguments_got_1_instead: "Signature expected {0} type arguments, got {1} instead.", - Property_0_defined_as_optional_in_type_1_but_is_required_in_type_2: "Property '{0}' defined as optional in type '{1}', but is required in type '{2}'.", - Types_0_and_1_originating_in_infinitely_expanding_type_reference_do_not_refer_to_same_named_type: "Types '{0}' and '{1}' originating in infinitely expanding type reference do not refer to same named type.", - Types_0_and_1_originating_in_infinitely_expanding_type_reference_have_incompatible_type_arguments: "Types '{0}' and '{1}' originating in infinitely expanding type reference have incompatible type arguments.", - Types_0_and_1_originating_in_infinitely_expanding_type_reference_have_incompatible_type_arguments_NL_2: "Types '{0}' and '{1}' originating in infinitely expanding type reference have incompatible type arguments:{NL}{2}", - Named_properties_0_of_types_1_and_2_are_not_identical: "Named properties '{0}' of types '{1}' and '{2}' are not identical.", - Types_of_string_indexer_of_types_0_and_1_are_not_identical: "Types of string indexer of types '{0}' and '{1}' are not identical.", - Types_of_number_indexer_of_types_0_and_1_are_not_identical: "Types of number indexer of types '{0}' and '{1}' are not identical.", - Type_of_number_indexer_in_type_0_is_not_assignable_to_string_indexer_type_in_type_1_NL_2: "Type of number indexer in type '{0}' is not assignable to string indexer type in type '{1}'.{NL}{2}", - Type_of_property_0_in_type_1_is_not_assignable_to_string_indexer_type_in_type_2_NL_3: "Type of property '{0}' in type '{1}' is not assignable to string indexer type in type '{2}'.{NL}{3}", - Type_of_property_0_in_type_1_is_not_assignable_to_number_indexer_type_in_type_2_NL_3: "Type of property '{0}' in type '{1}' is not assignable to number indexer type in type '{2}'.{NL}{3}", - Static_property_0_defined_as_private_in_type_1_is_defined_as_public_in_type_2: "Static property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.", - Static_property_0_defined_as_public_in_type_1_is_defined_as_private_in_type_2: "Static property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.", - Types_0_and_1_define_static_property_2_as_private: "Types '{0}' and '{1}' define static property '{2}' as private.", - Current_host_does_not_support_0_option: "Current host does not support '{0}' option.", - ECMAScript_target_version_0_not_supported_Specify_a_valid_target_version_1_default_or_2: "ECMAScript target version '{0}' not supported. Specify a valid target version: '{1}' (default), or '{2}'", - Argument_for_0_option_must_be_1_or_2: "Argument for '{0}' option must be '{1}' or '{2}'", - Could_not_find_file_0: "Could not find file: '{0}'.", - A_file_cannot_have_a_reference_to_itself: "A file cannot have a reference to itself.", - Cannot_resolve_referenced_file_0: "Cannot resolve referenced file: '{0}'.", - Cannot_find_the_common_subdirectory_path_for_the_input_files: "Cannot find the common subdirectory path for the input files.", - Emit_Error_0: "Emit Error: {0}.", - Cannot_read_file_0_1: "Cannot read file '{0}': {1}", - Unsupported_file_encoding: "Unsupported file encoding.", - Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: "Locale must be of the form or -. For example '{0}' or '{1}'.", - Unsupported_locale_0: "Unsupported locale: '{0}'.", - Execution_Failed_NL: "Execution Failed.{NL}", - Invalid_call_to_up: "Invalid call to 'up'", - Invalid_call_to_down: "Invalid call to 'down'", - Base64_value_0_finished_with_a_continuation_bit: "Base64 value '{0}' finished with a continuation bit.", - Unknown_compiler_option_0: "Unknown compiler option '{0}'", - Expected_0_arguments_to_message_got_1_instead: "Expected {0} arguments to message, got {1} instead.", - Expected_the_message_0_to_have_1_arguments_but_it_had_2: "Expected the message '{0}' to have {1} arguments, but it had {2}", - Could_not_delete_file_0: "Could not delete file '{0}'", - Could_not_create_directory_0: "Could not create directory '{0}'", - Error_while_executing_file_0: "Error while executing file '{0}': ", - Cannot_compile_external_modules_unless_the_module_flag_is_provided: "Cannot compile external modules unless the '--module' flag is provided.", - Option_mapRoot_cannot_be_specified_without_specifying_sourcemap_option: "Option mapRoot cannot be specified without specifying sourcemap option.", - Option_sourceRoot_cannot_be_specified_without_specifying_sourcemap_option: "Option sourceRoot cannot be specified without specifying sourcemap option.", - Options_mapRoot_and_sourceRoot_cannot_be_specified_without_specifying_sourcemap_option: "Options mapRoot and sourceRoot cannot be specified without specifying sourcemap option.", - Option_0_specified_without_1: "Option '{0}' specified without '{1}'", - codepage_option_not_supported_on_current_platform: "'codepage' option not supported on current platform.", - Concatenate_and_emit_output_to_single_file: "Concatenate and emit output to single file.", - Generates_corresponding_0_file: "Generates corresponding {0} file.", - Specifies_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations: "Specifies the location where debugger should locate map files instead of generated locations.", - Specifies_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations: "Specifies the location where debugger should locate TypeScript files instead of source locations.", - Watch_input_files: "Watch input files.", - Redirect_output_structure_to_the_directory: "Redirect output structure to the directory.", - Do_not_emit_comments_to_output: "Do not emit comments to output.", - Skip_resolution_and_preprocessing: "Skip resolution and preprocessing.", - Specify_ECMAScript_target_version_0_default_or_1: "Specify ECMAScript target version: '{0}' (default), or '{1}'", - Specify_module_code_generation_0_or_1: "Specify module code generation: '{0}' or '{1}'", - Print_this_message: "Print this message.", - Print_the_compiler_s_version_0: "Print the compiler's version: {0}", - Allow_use_of_deprecated_0_keyword_when_referencing_an_external_module: "Allow use of deprecated '{0}' keyword when referencing an external module.", - Specify_locale_for_errors_and_messages_For_example_0_or_1: "Specify locale for errors and messages. For example '{0}' or '{1}'", - Syntax_0: "Syntax: {0}", - options: "options", - file1: "file", - Examples: "Examples:", - Options: "Options:", - Insert_command_line_options_and_files_from_a_file: "Insert command line options and files from a file.", - Version_0: "Version {0}", - Use_the_0_flag_to_see_options: "Use the '{0}' flag to see options.", - NL_Recompiling_0: "{NL}Recompiling ({0}):", - STRING: "STRING", - KIND: "KIND", - file2: "FILE", - VERSION: "VERSION", - LOCATION: "LOCATION", - DIRECTORY: "DIRECTORY", - NUMBER: "NUMBER", - Specify_the_codepage_to_use_when_opening_source_files: "Specify the codepage to use when opening source files.", - Additional_locations: "Additional locations:", - This_version_of_the_Javascript_runtime_does_not_support_the_0_function: "This version of the Javascript runtime does not support the '{0}' function.", - Unknown_rule: "Unknown rule.", - Invalid_line_number_0: "Invalid line number ({0})", - Warn_on_expressions_and_declarations_with_an_implied_any_type: "Warn on expressions and declarations with an implied 'any' type.", - Variable_0_implicitly_has_an_any_type: "Variable '{0}' implicitly has an 'any' type.", - Parameter_0_of_1_implicitly_has_an_any_type: "Parameter '{0}' of '{1}' implicitly has an 'any' type.", - Parameter_0_of_function_type_implicitly_has_an_any_type: "Parameter '{0}' of function type implicitly has an 'any' type.", - Member_0_of_object_type_implicitly_has_an_any_type: "Member '{0}' of object type implicitly has an 'any' type.", - new_expression_which_lacks_a_constructor_signature_implicitly_has_an_any_type: "'new' expression, which lacks a constructor signature, implicitly has an 'any' type.", - _0_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: "'{0}', which lacks return-type annotation, implicitly has an 'any' return type.", - Function_expression_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: "Function expression, which lacks return-type annotation, implicitly has an 'any' return type.", - Parameter_0_of_lambda_function_implicitly_has_an_any_type: "Parameter '{0}' of lambda function implicitly has an 'any' type.", - Constructor_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: "Constructor signature, which lacks return-type annotation, implicitly has an 'any' return type.", - Lambda_Function_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: "Lambda Function, which lacks return-type annotation, implicitly has an 'any' return type.", - Array_Literal_implicitly_has_an_any_type_from_widening: "Array Literal implicitly has an 'any' type from widening.", - _0_which_lacks_get_accessor_and_parameter_type_annotation_on_set_accessor_implicitly_has_an_any_type: "'{0}', which lacks 'get' accessor and parameter type annotation on 'set' accessor, implicitly has an 'any' type.", - Index_signature_of_object_type_implicitly_has_an_any_type: "Index signature of object type implicitly has an 'any' type.", - Object_literal_s_property_0_implicitly_has_an_any_type_from_widening: "Object literal's property '{0}' implicitly has an 'any' type from widening." - }; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (DiagnosticCategory) { - DiagnosticCategory[DiagnosticCategory["Warning"] = 0] = "Warning"; - DiagnosticCategory[DiagnosticCategory["Error"] = 1] = "Error"; - DiagnosticCategory[DiagnosticCategory["Message"] = 2] = "Message"; - DiagnosticCategory[DiagnosticCategory["NoPrefix"] = 3] = "NoPrefix"; - })(TypeScript.DiagnosticCategory || (TypeScript.DiagnosticCategory = {})); - var DiagnosticCategory = TypeScript.DiagnosticCategory; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - TypeScript.diagnosticInformationMap = { - "error TS{0}: {1}": { "code": 0, "category": 3 /* NoPrefix */ }, - "warning TS{0}: {1}": { "code": 1, "category": 3 /* NoPrefix */ }, - "Unrecognized escape sequence.": { "code": 1000, "category": 1 /* Error */ }, - "Unexpected character {0}.": { "code": 1001, "category": 1 /* Error */ }, - "Missing close quote character.": { "code": 1002, "category": 1 /* Error */ }, - "Identifier expected.": { "code": 1003, "category": 1 /* Error */ }, - "'{0}' keyword expected.": { "code": 1004, "category": 1 /* Error */ }, - "'{0}' expected.": { "code": 1005, "category": 1 /* Error */ }, - "Identifier expected; '{0}' is a keyword.": { "code": 1006, "category": 1 /* Error */ }, - "Automatic semicolon insertion not allowed.": { "code": 1007, "category": 1 /* Error */ }, - "Unexpected token; '{0}' expected.": { "code": 1008, "category": 1 /* Error */ }, - "Trailing comma not allowed.": { "code": 1009, "category": 1 /* Error */ }, - "'*/' expected.": { "code": 1010, "category": 1 /* Error */ }, - "'public' or 'private' modifier must precede 'static'.": { "code": 1011, "category": 1 /* Error */ }, - "Unexpected token.": { "code": 1012, "category": 1 /* Error */ }, - "Catch clause parameter cannot have a type annotation.": { "code": 1013, "category": 1 /* Error */ }, - "A rest parameter must be last in a parameter list.": { "code": 1014, "category": 1 /* Error */ }, - "Parameter cannot have question mark and initializer.": { "code": 1015, "category": 1 /* Error */ }, - "A required parameter cannot follow an optional parameter.": { "code": 1016, "category": 1 /* Error */ }, - "Index signatures cannot have rest parameters.": { "code": 1017, "category": 1 /* Error */ }, - "Index signature parameter cannot have accessibility modifiers.": { "code": 1018, "category": 1 /* Error */ }, - "Index signature parameter cannot have a question mark.": { "code": 1019, "category": 1 /* Error */ }, - "Index signature parameter cannot have an initializer.": { "code": 1020, "category": 1 /* Error */ }, - "Index signature must have a type annotation.": { "code": 1021, "category": 1 /* Error */ }, - "Index signature parameter must have a type annotation.": { "code": 1022, "category": 1 /* Error */ }, - "Index signature parameter type must be 'string' or 'number'.": { "code": 1023, "category": 1 /* Error */ }, - "'extends' clause already seen.": { "code": 1024, "category": 1 /* Error */ }, - "'extends' clause must precede 'implements' clause.": { "code": 1025, "category": 1 /* Error */ }, - "Classes can only extend a single class.": { "code": 1026, "category": 1 /* Error */ }, - "'implements' clause already seen.": { "code": 1027, "category": 1 /* Error */ }, - "Accessibility modifier already seen.": { "code": 1028, "category": 1 /* Error */ }, - "'{0}' modifier must precede '{1}' modifier.": { "code": 1029, "category": 1 /* Error */ }, - "'{0}' modifier already seen.": { "code": 1030, "category": 1 /* Error */ }, - "'{0}' modifier cannot appear on a class element.": { "code": 1031, "category": 1 /* Error */ }, - "Interface declaration cannot have 'implements' clause.": { "code": 1032, "category": 1 /* Error */ }, - "'super' invocation cannot have type arguments.": { "code": 1034, "category": 1 /* Error */ }, - "Only ambient modules can use quoted names.": { "code": 1035, "category": 1 /* Error */ }, - "Statements are not allowed in ambient contexts.": { "code": 1036, "category": 1 /* Error */ }, - "A function implementation cannot be declared in an ambient context.": { "code": 1037, "category": 1 /* Error */ }, - "A 'declare' modifier cannot be used in an already ambient context.": { "code": 1038, "category": 1 /* Error */ }, - "Initializers are not allowed in ambient contexts.": { "code": 1039, "category": 1 /* Error */ }, - "'{0}' modifier cannot appear on a module element.": { "code": 1044, "category": 1 /* Error */ }, - "A 'declare' modifier cannot be used with an interface declaration.": { "code": 1045, "category": 1 /* Error */ }, - "A 'declare' modifier is required for a top level declaration in a .d.ts file.": { "code": 1046, "category": 1 /* Error */ }, - "A rest parameter cannot be optional.": { "code": 1047, "category": 1 /* Error */ }, - "A rest parameter cannot have an initializer.": { "code": 1048, "category": 1 /* Error */ }, - "'set' accessor must have exactly one parameter.": { "code": 1049, "category": 1 /* Error */ }, - "'set' accessor parameter cannot be optional.": { "code": 1051, "category": 1 /* Error */ }, - "'set' accessor parameter cannot have an initializer.": { "code": 1052, "category": 1 /* Error */ }, - "'set' accessor cannot have rest parameter.": { "code": 1053, "category": 1 /* Error */ }, - "'get' accessor cannot have parameters.": { "code": 1054, "category": 1 /* Error */ }, - "Modifiers cannot appear here.": { "code": 1055, "category": 1 /* Error */ }, - "Accessors are only available when targeting ECMAScript 5 and higher.": { "code": 1056, "category": 1 /* Error */ }, - "Enum member must have initializer.": { "code": 1061, "category": 1 /* Error */ }, - "Export assignment cannot be used in internal modules.": { "code": 1063, "category": 1 /* Error */ }, - "Ambient enum elements can only have integer literal initializers.": { "code": 1066, "category": 1 /* Error */ }, - "module, class, interface, enum, import or statement": { "code": 1067, "category": 3 /* NoPrefix */ }, - "constructor, function, accessor or variable": { "code": 1068, "category": 3 /* NoPrefix */ }, - "statement": { "code": 1069, "category": 3 /* NoPrefix */ }, - "case or default clause": { "code": 1070, "category": 3 /* NoPrefix */ }, - "identifier": { "code": 1071, "category": 3 /* NoPrefix */ }, - "call, construct, index, property or function signature": { "code": 1072, "category": 3 /* NoPrefix */ }, - "expression": { "code": 1073, "category": 3 /* NoPrefix */ }, - "type name": { "code": 1074, "category": 3 /* NoPrefix */ }, - "property or accessor": { "code": 1075, "category": 3 /* NoPrefix */ }, - "parameter": { "code": 1076, "category": 3 /* NoPrefix */ }, - "type": { "code": 1077, "category": 3 /* NoPrefix */ }, - "type parameter": { "code": 1078, "category": 3 /* NoPrefix */ }, - "A 'declare' modifier cannot be used with an import declaration.": { "code": 1079, "category": 1 /* Error */ }, - "Invalid 'reference' directive syntax.": { "code": 1084, "category": 1 /* Error */ }, - "Octal literals are not available when targeting ECMAScript 5 and higher.": { "code": 1085, "category": 1 /* Error */ }, - "Accessors are not allowed in ambient contexts.": { "code": 1086, "category": 1 /* Error */ }, - "'{0}' modifier cannot appear on a constructor declaration.": { "code": 1089, "category": 1 /* Error */ }, - "'{0}' modifier cannot appear on a parameter.": { "code": 1090, "category": 1 /* Error */ }, - "Only a single variable declaration is allowed in a 'for...in' statement.": { "code": 1091, "category": 1 /* Error */ }, - "Type parameters cannot appear on a constructor declaration.": { "code": 1092, "category": 1 /* Error */ }, - "Type annotation cannot appear on a constructor declaration.": { "code": 1093, "category": 1 /* Error */ }, - "Type parameters cannot appear on an accessor.": { "code": 1094, "category": 1 /* Error */ }, - "Type annotation cannot appear on a 'set' accessor.": { "code": 1095, "category": 1 /* Error */ }, - "Index signature must have exactly one parameter.": { "code": 1096, "category": 1 /* Error */ }, - "'{0}' list cannot be empty.": { "code": 1097, "category": 1 /* Error */ }, - "variable declaration": { "code": 1098, "category": 3 /* NoPrefix */ }, - "type argument": { "code": 1099, "category": 3 /* NoPrefix */ }, - "Invalid use of '{0}' in strict mode.": { "code": 1100, "category": 1 /* Error */ }, - "'with' statements are not allowed in strict mode.": { "code": 1101, "category": 1 /* Error */ }, - "'delete' cannot be called on an identifier in strict mode.": { "code": 1102, "category": 1 /* Error */ }, - "Invalid left-hand side in 'for...in' statement.": { "code": 1103, "category": 1 /* Error */ }, - "'continue' statement can only be used within an enclosing iteration statement.": { "code": 1104, "category": 1 /* Error */ }, - "'break' statement can only be used within an enclosing iteration or switch statement.": { "code": 1105, "category": 1 /* Error */ }, - "Jump target not found.": { "code": 1106, "category": 1 /* Error */ }, - "Jump target cannot cross function boundary.": { "code": 1107, "category": 1 /* Error */ }, - "'return' statement must be contained within a function body.": { "code": 1108, "category": 1 /* Error */ }, - "Expression expected.": { "code": 1109, "category": 1 /* Error */ }, - "Type expected.": { "code": 1110, "category": 1 /* Error */ }, - "Duplicate identifier '{0}'.": { "code": 2000, "category": 1 /* Error */ }, - "The name '{0}' does not exist in the current scope.": { "code": 2001, "category": 1 /* Error */ }, - "The name '{0}' does not refer to a value.": { "code": 2002, "category": 1 /* Error */ }, - "'super' can only be used inside a class instance method.": { "code": 2003, "category": 1 /* Error */ }, - "The left-hand side of an assignment expression must be a variable, property or indexer.": { "code": 2004, "category": 1 /* Error */ }, - "Value of type '{0}' is not callable. Did you mean to include 'new'?": { "code": 2161, "category": 1 /* Error */ }, - "Value of type '{0}' is not callable.": { "code": 2006, "category": 1 /* Error */ }, - "Value of type '{0}' is not newable.": { "code": 2007, "category": 1 /* Error */ }, - "An index expression argument must be 'string', 'number', or 'any'.": { "code": 2008, "category": 1 /* Error */ }, - "Operator '{0}' cannot be applied to types '{1}' and '{2}'.": { "code": 2009, "category": 1 /* Error */ }, - "Type '{0}' is not assignable to type '{1}'.": { "code": 2011, "category": 1 /* Error */ }, - "Type '{0}' is not assignable to type '{1}':{NL}{2}": { "code": 2012, "category": 1 /* Error */ }, - "Expected var, class, interface, or module.": { "code": 2013, "category": 1 /* Error */ }, - "Getter '{0}' already declared.": { "code": 2015, "category": 1 /* Error */ }, - "Setter '{0}' already declared.": { "code": 2016, "category": 1 /* Error */ }, - "Exported class '{0}' extends private class '{1}'.": { "code": 2018, "category": 1 /* Error */ }, - "Exported class '{0}' implements private interface '{1}'.": { "code": 2019, "category": 1 /* Error */ }, - "Exported interface '{0}' extends private interface '{1}'.": { "code": 2020, "category": 1 /* Error */ }, - "Exported class '{0}' extends class from inaccessible module {1}.": { "code": 2021, "category": 1 /* Error */ }, - "Exported class '{0}' implements interface from inaccessible module {1}.": { "code": 2022, "category": 1 /* Error */ }, - "Exported interface '{0}' extends interface from inaccessible module {1}.": { "code": 2023, "category": 1 /* Error */ }, - "Public static property '{0}' of exported class has or is using private type '{1}'.": { "code": 2024, "category": 1 /* Error */ }, - "Public property '{0}' of exported class has or is using private type '{1}'.": { "code": 2025, "category": 1 /* Error */ }, - "Property '{0}' of exported interface has or is using private type '{1}'.": { "code": 2026, "category": 1 /* Error */ }, - "Exported variable '{0}' has or is using private type '{1}'.": { "code": 2027, "category": 1 /* Error */ }, - "Public static property '{0}' of exported class is using inaccessible module {1}.": { "code": 2028, "category": 1 /* Error */ }, - "Public property '{0}' of exported class is using inaccessible module {1}.": { "code": 2029, "category": 1 /* Error */ }, - "Property '{0}' of exported interface is using inaccessible module {1}.": { "code": 2030, "category": 1 /* Error */ }, - "Exported variable '{0}' is using inaccessible module {1}.": { "code": 2031, "category": 1 /* Error */ }, - "Parameter '{0}' of constructor from exported class has or is using private type '{1}'.": { "code": 2032, "category": 1 /* Error */ }, - "Parameter '{0}' of public static property setter from exported class has or is using private type '{1}'.": { "code": 2033, "category": 1 /* Error */ }, - "Parameter '{0}' of public property setter from exported class has or is using private type '{1}'.": { "code": 2034, "category": 1 /* Error */ }, - "Parameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.": { "code": 2035, "category": 1 /* Error */ }, - "Parameter '{0}' of call signature from exported interface has or is using private type '{1}'.": { "code": 2036, "category": 1 /* Error */ }, - "Parameter '{0}' of public static method from exported class has or is using private type '{1}'.": { "code": 2037, "category": 1 /* Error */ }, - "Parameter '{0}' of public method from exported class has or is using private type '{1}'.": { "code": 2038, "category": 1 /* Error */ }, - "Parameter '{0}' of method from exported interface has or is using private type '{1}'.": { "code": 2039, "category": 1 /* Error */ }, - "Parameter '{0}' of exported function has or is using private type '{1}'.": { "code": 2040, "category": 1 /* Error */ }, - "Parameter '{0}' of constructor from exported class is using inaccessible module {1}.": { "code": 2041, "category": 1 /* Error */ }, - "Parameter '{0}' of public static property setter from exported class is using inaccessible module {1}.": { "code": 2042, "category": 1 /* Error */ }, - "Parameter '{0}' of public property setter from exported class is using inaccessible module {1}.": { "code": 2043, "category": 1 /* Error */ }, - "Parameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.": { "code": 2044, "category": 1 /* Error */ }, - "Parameter '{0}' of call signature from exported interface is using inaccessible module {1}": { "code": 2045, "category": 1 /* Error */ }, - "Parameter '{0}' of public static method from exported class is using inaccessible module {1}.": { "code": 2046, "category": 1 /* Error */ }, - "Parameter '{0}' of public method from exported class is using inaccessible module {1}.": { "code": 2047, "category": 1 /* Error */ }, - "Parameter '{0}' of method from exported interface is using inaccessible module {1}.": { "code": 2048, "category": 1 /* Error */ }, - "Parameter '{0}' of exported function is using inaccessible module {1}.": { "code": 2049, "category": 1 /* Error */ }, - "Return type of public static property getter from exported class has or is using private type '{0}'.": { "code": 2050, "category": 1 /* Error */ }, - "Return type of public property getter from exported class has or is using private type '{0}'.": { "code": 2051, "category": 1 /* Error */ }, - "Return type of constructor signature from exported interface has or is using private type '{0}'.": { "code": 2052, "category": 1 /* Error */ }, - "Return type of call signature from exported interface has or is using private type '{0}'.": { "code": 2053, "category": 1 /* Error */ }, - "Return type of index signature from exported interface has or is using private type '{0}'.": { "code": 2054, "category": 1 /* Error */ }, - "Return type of public static method from exported class has or is using private type '{0}'.": { "code": 2055, "category": 1 /* Error */ }, - "Return type of public method from exported class has or is using private type '{0}'.": { "code": 2056, "category": 1 /* Error */ }, - "Return type of method from exported interface has or is using private type '{0}'.": { "code": 2057, "category": 1 /* Error */ }, - "Return type of exported function has or is using private type '{0}'.": { "code": 2058, "category": 1 /* Error */ }, - "Return type of public static property getter from exported class is using inaccessible module {0}.": { "code": 2059, "category": 1 /* Error */ }, - "Return type of public property getter from exported class is using inaccessible module {0}.": { "code": 2060, "category": 1 /* Error */ }, - "Return type of constructor signature from exported interface is using inaccessible module {0}.": { "code": 2061, "category": 1 /* Error */ }, - "Return type of call signature from exported interface is using inaccessible module {0}.": { "code": 2062, "category": 1 /* Error */ }, - "Return type of index signature from exported interface is using inaccessible module {0}.": { "code": 2063, "category": 1 /* Error */ }, - "Return type of public static method from exported class is using inaccessible module {0}.": { "code": 2064, "category": 1 /* Error */ }, - "Return type of public method from exported class is using inaccessible module {0}.": { "code": 2065, "category": 1 /* Error */ }, - "Return type of method from exported interface is using inaccessible module {0}.": { "code": 2066, "category": 1 /* Error */ }, - "Return type of exported function is using inaccessible module {0}.": { "code": 2067, "category": 1 /* Error */ }, - "'new T[]' cannot be used to create an array. Use 'new Array()' instead.": { "code": 2068, "category": 1 /* Error */ }, - "A parameter list must follow a generic type argument list. '(' expected.": { "code": 2069, "category": 1 /* Error */ }, - "Multiple constructor implementations are not allowed.": { "code": 2070, "category": 1 /* Error */ }, - "Cannot find external module '{0}'.": { "code": 2071, "category": 1 /* Error */ }, - "Module cannot be aliased to a non-module type.": { "code": 2072, "category": 1 /* Error */ }, - "A class may only extend another class.": { "code": 2073, "category": 1 /* Error */ }, - "A class may only implement another class or interface.": { "code": 2074, "category": 1 /* Error */ }, - "An interface may only extend a class or another interface.": { "code": 2075, "category": 1 /* Error */ }, - "Unable to resolve type.": { "code": 2077, "category": 1 /* Error */ }, - "Unable to resolve type of '{0}'.": { "code": 2078, "category": 1 /* Error */ }, - "Unable to resolve type parameter constraint.": { "code": 2079, "category": 1 /* Error */ }, - "Type parameter constraint cannot be a primitive type.": { "code": 2080, "category": 1 /* Error */ }, - "Supplied parameters do not match any signature of call target.": { "code": 2081, "category": 1 /* Error */ }, - "Supplied parameters do not match any signature of call target:{NL}{0}": { "code": 2082, "category": 1 /* Error */ }, - "Cannot use 'new' with an expression whose type lacks a signature.": { "code": 2083, "category": 1 /* Error */ }, - "Only a void function can be called with the 'new' keyword.": { "code": 2084, "category": 1 /* Error */ }, - "Could not select overload for 'new' expression.": { "code": 2085, "category": 1 /* Error */ }, - "Type '{0}' does not satisfy the constraint '{1}'.": { "code": 2086, "category": 1 /* Error */ }, - "Could not select overload for 'call' expression.": { "code": 2087, "category": 1 /* Error */ }, - "Cannot invoke an expression whose type lacks a call signature.": { "code": 2088, "category": 1 /* Error */ }, - "Calls to 'super' are only valid inside a class.": { "code": 2089, "category": 1 /* Error */ }, - "Generic type '{0}' requires {1} type argument(s).": { "code": 2090, "category": 1 /* Error */ }, - "Type of array literal cannot be determined. Best common type could not be found for array elements.": { "code": 2092, "category": 1 /* Error */ }, - "Could not find enclosing symbol for dotted name '{0}'.": { "code": 2093, "category": 1 /* Error */ }, - "Property '{0}' does not exist on value of type '{1}'.": { "code": 2094, "category": 1 /* Error */ }, - "Cannot find name '{0}'.": { "code": 2095, "category": 1 /* Error */ }, - "'get' and 'set' accessor must have the same type.": { "code": 2096, "category": 1 /* Error */ }, - "'this' cannot be referenced in current location.": { "code": 2097, "category": 1 /* Error */ }, - "Static members cannot reference class type parameters.": { "code": 2099, "category": 1 /* Error */ }, - "Type '{0}' recursively references itself as a base type.": { "code": 2100, "category": 1 /* Error */ }, - "'super' property access is permitted only in a constructor, member function, or member accessor of a derived class.": { "code": 2102, "category": 1 /* Error */ }, - "'super' can only be referenced in a derived class.": { "code": 2103, "category": 1 /* Error */ }, - "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.": { "code": 2104, "category": 1 /* Error */ }, - "Constructors for derived classes must contain a 'super' call.": { "code": 2105, "category": 1 /* Error */ }, - "Super calls are not permitted outside constructors or in nested functions inside constructors.": { "code": 2106, "category": 1 /* Error */ }, - "'{0}.{1}' is inaccessible.": { "code": 2107, "category": 1 /* Error */ }, - "'this' cannot be referenced in a module body.": { "code": 2108, "category": 1 /* Error */ }, - "Invalid '+' expression - types not known to support the addition operator.": { "code": 2111, "category": 1 /* Error */ }, - "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": { "code": 2112, "category": 1 /* Error */ }, - "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": { "code": 2113, "category": 1 /* Error */ }, - "An arithmetic operand must be of type 'any', 'number' or an enum type.": { "code": 2114, "category": 1 /* Error */ }, - "Variable declarations of a 'for' statement cannot use a type annotation.": { "code": 2115, "category": 1 /* Error */ }, - "Variable declarations of a 'for' statement must be of types 'string' or 'any'.": { "code": 2116, "category": 1 /* Error */ }, - "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.": { "code": 2117, "category": 1 /* Error */ }, - "The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'.": { "code": 2118, "category": 1 /* Error */ }, - "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter.": { "code": 2119, "category": 1 /* Error */ }, - "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.": { "code": 2120, "category": 1 /* Error */ }, - "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type.": { "code": 2121, "category": 1 /* Error */ }, - "Setters cannot return a value.": { "code": 2122, "category": 1 /* Error */ }, - "Tried to query type of uninitialized module '{0}'.": { "code": 2123, "category": 1 /* Error */ }, - "Tried to set variable type to uninitialized module type '{0}'.": { "code": 2124, "category": 1 /* Error */ }, - "Type '{0}' is not generic.": { "code": 2125, "category": 1 /* Error */ }, - "Getters must return a value.": { "code": 2126, "category": 1 /* Error */ }, - "Getter and setter accessors do not agree in visibility.": { "code": 2127, "category": 1 /* Error */ }, - "Invalid left-hand side of assignment expression.": { "code": 2130, "category": 1 /* Error */ }, - "Function declared a non-void return type, but has no return expression.": { "code": 2131, "category": 1 /* Error */ }, - "Cannot resolve return type reference.": { "code": 2132, "category": 1 /* Error */ }, - "Constructors cannot have a return type of 'void'.": { "code": 2133, "category": 1 /* Error */ }, - "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.": { "code": 2134, "category": 1 /* Error */ }, - "All symbols within a with block will be resolved to 'any'.": { "code": 2135, "category": 1 /* Error */ }, - "Import declarations in an internal module cannot reference an external module.": { "code": 2136, "category": 1 /* Error */ }, - "Class {0} declares interface {1} but does not implement it:{NL}{2}": { "code": 2137, "category": 1 /* Error */ }, - "Class {0} declares class {1} as an interface but does not implement it:{NL}{2}": { "code": 2138, "category": 1 /* Error */ }, - "The operand of an increment or decrement operator must be a variable, property or indexer.": { "code": 2139, "category": 1 /* Error */ }, - "'this' cannot be referenced in a static property initializer.": { "code": 2140, "category": 1 /* Error */ }, - "Class '{0}' cannot extend class '{1}':{NL}{2}": { "code": 2141, "category": 1 /* Error */ }, - "Interface '{0}' cannot extend class '{1}':{NL}{2}": { "code": 2142, "category": 1 /* Error */ }, - "Interface '{0}' cannot extend interface '{1}':{NL}{2}": { "code": 2143, "category": 1 /* Error */ }, - "Overload signature is not compatible with function definition.": { "code": 2148, "category": 1 /* Error */ }, - "Overload signature is not compatible with function definition:{NL}{0}": { "code": 2149, "category": 1 /* Error */ }, - "Overload signatures must all be public or private.": { "code": 2150, "category": 1 /* Error */ }, - "Overload signatures must all be exported or not exported.": { "code": 2151, "category": 1 /* Error */ }, - "Overload signatures must all be ambient or non-ambient.": { "code": 2152, "category": 1 /* Error */ }, - "Overload signatures must all be optional or required.": { "code": 2153, "category": 1 /* Error */ }, - "Specialized overload signature is not assignable to any non-specialized signature.": { "code": 2154, "category": 1 /* Error */ }, - "'this' cannot be referenced in constructor arguments.": { "code": 2155, "category": 1 /* Error */ }, - "Instance member cannot be accessed off a class.": { "code": 2157, "category": 1 /* Error */ }, - "Untyped function calls may not accept type arguments.": { "code": 2158, "category": 1 /* Error */ }, - "Non-generic functions may not accept type arguments.": { "code": 2159, "category": 1 /* Error */ }, - "A generic type may not reference itself with a wrapped form of its own type parameters.": { "code": 2160, "category": 1 /* Error */ }, - "A rest parameter must be of an array type.": { "code": 2162, "category": 1 /* Error */ }, - "Overload signature implementation cannot use specialized type.": { "code": 2163, "category": 1 /* Error */ }, - "Export assignments may only be used at the top-level of external modules.": { "code": 2164, "category": 1 /* Error */ }, - "Export assignments may only be made with variables, functions, classes, interfaces, enums and internal modules.": { "code": 2165, "category": 1 /* Error */ }, - "Only public methods of the base class are accessible via the 'super' keyword.": { "code": 2166, "category": 1 /* Error */ }, - "Numeric indexer type '{0}' must be assignable to string indexer type '{1}'.": { "code": 2167, "category": 1 /* Error */ }, - "Numeric indexer type '{0}' must be assignable to string indexer type '{1}':{NL}{2}": { "code": 2168, "category": 1 /* Error */ }, - "All numerically named properties must be assignable to numeric indexer type '{0}'.": { "code": 2169, "category": 1 /* Error */ }, - "All numerically named properties must be assignable to numeric indexer type '{0}':{NL}{1}": { "code": 2170, "category": 1 /* Error */ }, - "All named properties must be assignable to string indexer type '{0}'.": { "code": 2171, "category": 1 /* Error */ }, - "All named properties must be assignable to string indexer type '{0}':{NL}{1}": { "code": 2172, "category": 1 /* Error */ }, - "A parameter initializer is only allowed in a function or constructor implementation.": { "code": 2174, "category": 1 /* Error */ }, - "Function expression declared a non-void return type, but has no return expression.": { "code": 2176, "category": 1 /* Error */ }, - "Import declaration referencing identifier from internal module can only be made with variables, functions, classes, interfaces, enums and internal modules.": { "code": 2177, "category": 1 /* Error */ }, - "Module '{0}' has no exported member '{1}'.": { "code": 2178, "category": 1 /* Error */ }, - "Unable to resolve module reference '{0}'.": { "code": 2179, "category": 1 /* Error */ }, - "Could not find module '{0}' in module '{1}'.": { "code": 2180, "category": 1 /* Error */ }, - "Exported import declaration '{0}' is assigned value with type that has or is using private type '{1}'.": { "code": 2181, "category": 1 /* Error */ }, - "Exported import declaration '{0}' is assigned value with type that is using inaccessible module '{1}'.": { "code": 2182, "category": 1 /* Error */ }, - "Exported import declaration '{0}' is assigned type that has or is using private type '{1}'.": { "code": 2183, "category": 1 /* Error */ }, - "Exported import declaration '{0}' is assigned type that is using inaccessible module '{1}'.": { "code": 2184, "category": 1 /* Error */ }, - "Exported import declaration '{0}' is assigned container that is or is using inaccessible module '{1}'.": { "code": 2185, "category": 1 /* Error */ }, - "Type name '{0}' in extends clause does not reference constructor function for '{1}'.": { "code": 2186, "category": 1 /* Error */ }, - "Internal module reference '{0}' in import declaration does not reference module instance for '{1}'.": { "code": 2187, "category": 1 /* Error */ }, - "Module '{0}' cannot merge with previous declaration of '{1}' in a different file '{2}'.": { "code": 2188, "category": 1 /* Error */ }, - "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}':{NL}{3}": { "code": 2189, "category": 1 /* Error */ }, - "Initializer of parameter '{0}' cannot reference identifier '{1}' declared after it.": { "code": 2190, "category": 1 /* Error */ }, - "Ambient external module declaration cannot be reopened.": { "code": 2191, "category": 1 /* Error */ }, - "All declarations of merged declaration '{0}' must be exported or not exported.": { "code": 2192, "category": 1 /* Error */ }, - "'super' cannot be referenced in constructor arguments.": { "code": 2193, "category": 1 /* Error */ }, - "Return type of constructor signature must be assignable to the instance type of the class.": { "code": 2194, "category": 1 /* Error */ }, - "Ambient external module declaration must be defined in global context.": { "code": 2195, "category": 1 /* Error */ }, - "Ambient external module declaration cannot specify relative module name.": { "code": 2196, "category": 1 /* Error */ }, - "Import declaration in an ambient external module declaration cannot reference external module through relative external module name.": { "code": 2197, "category": 1 /* Error */ }, - "No best common type exists among return expressions.": { "code": 2198, "category": 1 /* Error */ }, - "Import declaration cannot refer to external module reference when --noResolve option is set.": { "code": 2199, "category": 1 /* Error */ }, - "Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference.": { "code": 2200, "category": 1 /* Error */ }, - "Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference.": { "code": 2205, "category": 1 /* Error */ }, - "Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference.": { "code": 2206, "category": 1 /* Error */ }, - "Expression resolves to '_super' that compiler uses to capture base class reference.": { "code": 2207, "category": 1 /* Error */ }, - "TypeParameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.": { "code": 2208, "category": 1 /* Error */ }, - "TypeParameter '{0}' of call signature from exported interface has or is using private type '{1}'.": { "code": 2209, "category": 1 /* Error */ }, - "TypeParameter '{0}' of public static method from exported class has or is using private type '{1}'.": { "code": 2210, "category": 1 /* Error */ }, - "TypeParameter '{0}' of public method from exported class has or is using private type '{1}'.": { "code": 2211, "category": 1 /* Error */ }, - "TypeParameter '{0}' of method from exported interface has or is using private type '{1}'.": { "code": 2212, "category": 1 /* Error */ }, - "TypeParameter '{0}' of exported function has or is using private type '{1}'.": { "code": 2213, "category": 1 /* Error */ }, - "TypeParameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.": { "code": 2214, "category": 1 /* Error */ }, - "TypeParameter '{0}' of call signature from exported interface is using inaccessible module {1}": { "code": 2215, "category": 1 /* Error */ }, - "TypeParameter '{0}' of public static method from exported class is using inaccessible module {1}.": { "code": 2216, "category": 1 /* Error */ }, - "TypeParameter '{0}' of public method from exported class is using inaccessible module {1}.": { "code": 2217, "category": 1 /* Error */ }, - "TypeParameter '{0}' of method from exported interface is using inaccessible module {1}.": { "code": 2218, "category": 1 /* Error */ }, - "TypeParameter '{0}' of exported function is using inaccessible module {1}.": { "code": 2219, "category": 1 /* Error */ }, - "TypeParameter '{0}' of exported class has or is using private type '{1}'.": { "code": 2220, "category": 1 /* Error */ }, - "TypeParameter '{0}' of exported interface has or is using private type '{1}'.": { "code": 2221, "category": 1 /* Error */ }, - "TypeParameter '{0}' of exported class is using inaccessible module {1}.": { "code": 2222, "category": 1 /* Error */ }, - "TypeParameter '{0}' of exported interface is using inaccessible module {1}.": { "code": 2223, "category": 1 /* Error */ }, - "Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter.": { "code": 2224, "category": 1 /* Error */ }, - "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.": { "code": 2225, "category": 1 /* Error */ }, - "No best common type exists between '{0}' and '{1}'.": { "code": 2226, "category": 1 /* Error */ }, - "No best common type exists between '{0}', '{1}', and '{2}'.": { "code": 2227, "category": 1 /* Error */ }, - "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of an external module.": { "code": 2228, "category": 1 /* Error */ }, - "Constraint of a type parameter cannot reference any type parameter from the same type parameter list.": { "code": 2229, "category": 1 /* Error */ }, - "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor.": { "code": 2230, "category": 1 /* Error */ }, - "Parameter '{0}' cannot be referenced in its initializer.": { "code": 2231, "category": 1 /* Error */ }, - "Duplicate string index signature.": { "code": 2232, "category": 1 /* Error */ }, - "Duplicate number index signature.": { "code": 2233, "category": 1 /* Error */ }, - "All declarations of an interface must have identical type parameters.": { "code": 2234, "category": 1 /* Error */ }, - "Expression resolves to variable declaration '_i' that compiler uses to initialize rest parameter.": { "code": 2235, "category": 1 /* Error */ }, - "Neither type '{0}' nor type '{1}' is assignable to the other.": { "code": 2236, "category": 1 /* Error */ }, - "Neither type '{0}' nor type '{1}' is assignable to the other:{NL}{2}": { "code": 2237, "category": 1 /* Error */ }, - "Duplicate function implementation.": { "code": 2237, "category": 1 /* Error */ }, - "Function implementation expected.": { "code": 2238, "category": 1 /* Error */ }, - "Function overload name must be '{0}'.": { "code": 2239, "category": 1 /* Error */ }, - "Constructor implementation expected.": { "code": 2240, "category": 1 /* Error */ }, - "Class name cannot be '{0}'.": { "code": 2241, "category": 1 /* Error */ }, - "Interface name cannot be '{0}'.": { "code": 2242, "category": 1 /* Error */ }, - "Enum name cannot be '{0}'.": { "code": 2243, "category": 1 /* Error */ }, - "A module cannot have multiple export assignments.": { "code": 2244, "category": 1 /* Error */ }, - "Export assignment not allowed in module with exported element.": { "code": 2245, "category": 1 /* Error */ }, - "A parameter property is only allowed in a constructor implementation.": { "code": 2246, "category": 1 /* Error */ }, - "Function overload must be static.": { "code": 2247, "category": 1 /* Error */ }, - "Function overload must not be static.": { "code": 2248, "category": 1 /* Error */ }, - "Type '{0}' is missing property '{1}' from type '{2}'.": { "code": 4000, "category": 3 /* NoPrefix */ }, - "Types of property '{0}' of types '{1}' and '{2}' are incompatible.": { "code": 4001, "category": 3 /* NoPrefix */ }, - "Types of property '{0}' of types '{1}' and '{2}' are incompatible:{NL}{3}": { "code": 4002, "category": 3 /* NoPrefix */ }, - "Property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.": { "code": 4003, "category": 3 /* NoPrefix */ }, - "Property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.": { "code": 4004, "category": 3 /* NoPrefix */ }, - "Types '{0}' and '{1}' define property '{2}' as private.": { "code": 4005, "category": 3 /* NoPrefix */ }, - "Call signatures of types '{0}' and '{1}' are incompatible.": { "code": 4006, "category": 3 /* NoPrefix */ }, - "Call signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": { "code": 4007, "category": 3 /* NoPrefix */ }, - "Type '{0}' requires a call signature, but type '{1}' lacks one.": { "code": 4008, "category": 3 /* NoPrefix */ }, - "Construct signatures of types '{0}' and '{1}' are incompatible.": { "code": 4009, "category": 3 /* NoPrefix */ }, - "Construct signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": { "code": 4010, "category": 3 /* NoPrefix */ }, - "Type '{0}' requires a construct signature, but type '{1}' lacks one.": { "code": 4011, "category": 3 /* NoPrefix */ }, - "Index signatures of types '{0}' and '{1}' are incompatible.": { "code": 4012, "category": 3 /* NoPrefix */ }, - "Index signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": { "code": 4013, "category": 3 /* NoPrefix */ }, - "Call signature expects {0} or fewer parameters.": { "code": 4014, "category": 3 /* NoPrefix */ }, - "Could not apply type '{0}' to argument {1} which is of type '{2}'.": { "code": 4015, "category": 3 /* NoPrefix */ }, - "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.": { "code": 4016, "category": 3 /* NoPrefix */ }, - "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.": { "code": 4017, "category": 3 /* NoPrefix */ }, - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.": { "code": 4018, "category": 3 /* NoPrefix */ }, - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.": { "code": 4019, "category": 3 /* NoPrefix */ }, - "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible.": { "code": 4020, "category": 3 /* NoPrefix */ }, - "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible:{NL}{3}": { "code": 4021, "category": 3 /* NoPrefix */ }, - "Type reference cannot refer to container '{0}'.": { "code": 4022, "category": 1 /* Error */ }, - "Type reference must refer to type.": { "code": 4023, "category": 1 /* Error */ }, - "In enums with multiple declarations only one declaration can omit an initializer for the first enum element.": { "code": 4024, "category": 1 /* Error */ }, - " (+ {0} overload(s))": { "code": 4025, "category": 2 /* Message */ }, - "Variable declaration cannot have the same name as an import declaration.": { "code": 4026, "category": 1 /* Error */ }, - "Signature expected {0} type arguments, got {1} instead.": { "code": 4027, "category": 1 /* Error */ }, - "Property '{0}' defined as optional in type '{1}', but is required in type '{2}'.": { "code": 4028, "category": 3 /* NoPrefix */ }, - "Types '{0}' and '{1}' originating in infinitely expanding type reference do not refer to same named type.": { "code": 4029, "category": 3 /* NoPrefix */ }, - "Types '{0}' and '{1}' originating in infinitely expanding type reference have incompatible type arguments.": { "code": 4030, "category": 3 /* NoPrefix */ }, - "Types '{0}' and '{1}' originating in infinitely expanding type reference have incompatible type arguments:{NL}{2}": { "code": 4031, "category": 3 /* NoPrefix */ }, - "Named properties '{0}' of types '{1}' and '{2}' are not identical.": { "code": 4032, "category": 3 /* NoPrefix */ }, - "Types of string indexer of types '{0}' and '{1}' are not identical.": { "code": 4033, "category": 3 /* NoPrefix */ }, - "Types of number indexer of types '{0}' and '{1}' are not identical.": { "code": 4034, "category": 3 /* NoPrefix */ }, - "Type of number indexer in type '{0}' is not assignable to string indexer type in type '{1}'.{NL}{2}": { "code": 4035, "category": 3 /* NoPrefix */ }, - "Type of property '{0}' in type '{1}' is not assignable to string indexer type in type '{2}'.{NL}{3}": { "code": 4036, "category": 3 /* NoPrefix */ }, - "Type of property '{0}' in type '{1}' is not assignable to number indexer type in type '{2}'.{NL}{3}": { "code": 4037, "category": 3 /* NoPrefix */ }, - "Static property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.": { "code": 4038, "category": 3 /* NoPrefix */ }, - "Static property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.": { "code": 4039, "category": 3 /* NoPrefix */ }, - "Types '{0}' and '{1}' define static property '{2}' as private.": { "code": 4040, "category": 3 /* NoPrefix */ }, - "Current host does not support '{0}' option.": { "code": 5001, "category": 1 /* Error */ }, - "ECMAScript target version '{0}' not supported. Specify a valid target version: '{1}' (default), or '{2}'": { "code": 5002, "category": 1 /* Error */ }, - "Argument for '{0}' option must be '{1}' or '{2}'": { "code": 5003, "category": 1 /* Error */ }, - "Could not find file: '{0}'.": { "code": 5004, "category": 1 /* Error */ }, - "A file cannot have a reference to itself.": { "code": 5006, "category": 1 /* Error */ }, - "Cannot resolve referenced file: '{0}'.": { "code": 5007, "category": 1 /* Error */ }, - "Cannot find the common subdirectory path for the input files.": { "code": 5009, "category": 1 /* Error */ }, - "Emit Error: {0}.": { "code": 5011, "category": 1 /* Error */ }, - "Cannot read file '{0}': {1}": { "code": 5012, "category": 1 /* Error */ }, - "Unsupported file encoding.": { "code": 5013, "category": 3 /* NoPrefix */ }, - "Locale must be of the form or -. For example '{0}' or '{1}'.": { "code": 5014, "category": 1 /* Error */ }, - "Unsupported locale: '{0}'.": { "code": 5015, "category": 1 /* Error */ }, - "Execution Failed.{NL}": { "code": 5016, "category": 1 /* Error */ }, - "Invalid call to 'up'": { "code": 5019, "category": 1 /* Error */ }, - "Invalid call to 'down'": { "code": 5020, "category": 1 /* Error */ }, - "Base64 value '{0}' finished with a continuation bit.": { "code": 5021, "category": 1 /* Error */ }, - "Unknown compiler option '{0}'": { "code": 5023, "category": 1 /* Error */ }, - "Expected {0} arguments to message, got {1} instead.": { "code": 5024, "category": 1 /* Error */ }, - "Expected the message '{0}' to have {1} arguments, but it had {2}": { "code": 5025, "category": 1 /* Error */ }, - "Could not delete file '{0}'": { "code": 5034, "category": 1 /* Error */ }, - "Could not create directory '{0}'": { "code": 5035, "category": 1 /* Error */ }, - "Error while executing file '{0}': ": { "code": 5036, "category": 1 /* Error */ }, - "Cannot compile external modules unless the '--module' flag is provided.": { "code": 5037, "category": 1 /* Error */ }, - "Option mapRoot cannot be specified without specifying sourcemap option.": { "code": 5038, "category": 1 /* Error */ }, - "Option sourceRoot cannot be specified without specifying sourcemap option.": { "code": 5039, "category": 1 /* Error */ }, - "Options mapRoot and sourceRoot cannot be specified without specifying sourcemap option.": { "code": 5040, "category": 1 /* Error */ }, - "Option '{0}' specified without '{1}'": { "code": 5041, "category": 1 /* Error */ }, - "'codepage' option not supported on current platform.": { "code": 5042, "category": 1 /* Error */ }, - "Concatenate and emit output to single file.": { "code": 6001, "category": 2 /* Message */ }, - "Generates corresponding {0} file.": { "code": 6002, "category": 2 /* Message */ }, - "Specifies the location where debugger should locate map files instead of generated locations.": { "code": 6003, "category": 2 /* Message */ }, - "Specifies the location where debugger should locate TypeScript files instead of source locations.": { "code": 6004, "category": 2 /* Message */ }, - "Watch input files.": { "code": 6005, "category": 2 /* Message */ }, - "Redirect output structure to the directory.": { "code": 6006, "category": 2 /* Message */ }, - "Do not emit comments to output.": { "code": 6009, "category": 2 /* Message */ }, - "Skip resolution and preprocessing.": { "code": 6010, "category": 2 /* Message */ }, - "Specify ECMAScript target version: '{0}' (default), or '{1}'": { "code": 6015, "category": 2 /* Message */ }, - "Specify module code generation: '{0}' or '{1}'": { "code": 6016, "category": 2 /* Message */ }, - "Print this message.": { "code": 6017, "category": 2 /* Message */ }, - "Print the compiler's version: {0}": { "code": 6019, "category": 2 /* Message */ }, - "Allow use of deprecated '{0}' keyword when referencing an external module.": { "code": 6021, "category": 2 /* Message */ }, - "Specify locale for errors and messages. For example '{0}' or '{1}'": { "code": 6022, "category": 2 /* Message */ }, - "Syntax: {0}": { "code": 6023, "category": 2 /* Message */ }, - "options": { "code": 6024, "category": 2 /* Message */ }, - "file1": { "code": 6025, "category": 2 /* Message */ }, - "Examples:": { "code": 6026, "category": 2 /* Message */ }, - "Options:": { "code": 6027, "category": 2 /* Message */ }, - "Insert command line options and files from a file.": { "code": 6030, "category": 2 /* Message */ }, - "Version {0}": { "code": 6029, "category": 2 /* Message */ }, - "Use the '{0}' flag to see options.": { "code": 6031, "category": 2 /* Message */ }, - "{NL}Recompiling ({0}):": { "code": 6032, "category": 2 /* Message */ }, - "STRING": { "code": 6033, "category": 2 /* Message */ }, - "KIND": { "code": 6034, "category": 2 /* Message */ }, - "file2": { "code": 6035, "category": 2 /* Message */ }, - "VERSION": { "code": 6036, "category": 2 /* Message */ }, - "LOCATION": { "code": 6037, "category": 2 /* Message */ }, - "DIRECTORY": { "code": 6038, "category": 2 /* Message */ }, - "NUMBER": { "code": 6039, "category": 2 /* Message */ }, - "Specify the codepage to use when opening source files.": { "code": 6040, "category": 2 /* Message */ }, - "Additional locations:": { "code": 6041, "category": 2 /* Message */ }, - "This version of the Javascript runtime does not support the '{0}' function.": { "code": 7000, "category": 1 /* Error */ }, - "Unknown rule.": { "code": 7002, "category": 1 /* Error */ }, - "Invalid line number ({0})": { "code": 7003, "category": 1 /* Error */ }, - "Warn on expressions and declarations with an implied 'any' type.": { "code": 7004, "category": 2 /* Message */ }, - "Variable '{0}' implicitly has an 'any' type.": { "code": 7005, "category": 1 /* Error */ }, - "Parameter '{0}' of '{1}' implicitly has an 'any' type.": { "code": 7006, "category": 1 /* Error */ }, - "Parameter '{0}' of function type implicitly has an 'any' type.": { "code": 7007, "category": 1 /* Error */ }, - "Member '{0}' of object type implicitly has an 'any' type.": { "code": 7008, "category": 1 /* Error */ }, - "'new' expression, which lacks a constructor signature, implicitly has an 'any' type.": { "code": 7009, "category": 1 /* Error */ }, - "'{0}', which lacks return-type annotation, implicitly has an 'any' return type.": { "code": 7010, "category": 1 /* Error */ }, - "Function expression, which lacks return-type annotation, implicitly has an 'any' return type.": { "code": 7011, "category": 1 /* Error */ }, - "Parameter '{0}' of lambda function implicitly has an 'any' type.": { "code": 7012, "category": 1 /* Error */ }, - "Constructor signature, which lacks return-type annotation, implicitly has an 'any' return type.": { "code": 7013, "category": 1 /* Error */ }, - "Lambda Function, which lacks return-type annotation, implicitly has an 'any' return type.": { "code": 7014, "category": 1 /* Error */ }, - "Array Literal implicitly has an 'any' type from widening.": { "code": 7015, "category": 1 /* Error */ }, - "'{0}', which lacks 'get' accessor and parameter type annotation on 'set' accessor, implicitly has an 'any' type.": { "code": 7016, "category": 1 /* Error */ }, - "Index signature of object type implicitly has an 'any' type.": { "code": 7017, "category": 1 /* Error */ }, - "Object literal's property '{0}' implicitly has an 'any' type from widening.": { "code": 7018, "category": 1 /* Error */ } - }; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var ArrayUtilities = (function () { - function ArrayUtilities() { - } - ArrayUtilities.sequenceEquals = function (array1, array2, equals) { - if (array1 === array2) { - return true; - } - if (array1 === null || array2 === null) { - return false; - } - if (array1.length !== array2.length) { - return false; - } - for (var i = 0, n = array1.length; i < n; i++) { - if (!equals(array1[i], array2[i])) { - return false; - } - } - return true; - }; - ArrayUtilities.contains = function (array, value) { - for (var i = 0; i < array.length; i++) { - if (array[i] === value) { - return true; - } - } - return false; - }; - ArrayUtilities.distinct = function (array, equalsFn) { - var result = []; - for (var i = 0, n = array.length; i < n; i++) { - var current = array[i]; - for (var j = 0; j < result.length; j++) { - if (equalsFn(result[j], current)) { - break; - } - } - if (j === result.length) { - result.push(current); - } - } - return result; - }; - ArrayUtilities.last = function (array) { - if (array.length === 0) { - throw TypeScript.Errors.argumentOutOfRange('array'); - } - return array[array.length - 1]; - }; - ArrayUtilities.lastOrDefault = function (array, predicate) { - for (var i = array.length - 1; i >= 0; i--) { - var v = array[i]; - if (predicate(v, i)) { - return v; - } - } - return null; - }; - ArrayUtilities.firstOrDefault = function (array, func) { - for (var i = 0, n = array.length; i < n; i++) { - var value = array[i]; - if (func(value, i)) { - return value; - } - } - return null; - }; - ArrayUtilities.first = function (array, func) { - for (var i = 0, n = array.length; i < n; i++) { - var value = array[i]; - if (!func || func(value, i)) { - return value; - } - } - throw TypeScript.Errors.invalidOperation(); - }; - ArrayUtilities.sum = function (array, func) { - var result = 0; - for (var i = 0, n = array.length; i < n; i++) { - result += func(array[i]); - } - return result; - }; - ArrayUtilities.select = function (values, func) { - var result = new Array(values.length); - for (var i = 0; i < values.length; i++) { - result[i] = func(values[i]); - } - return result; - }; - ArrayUtilities.where = function (values, func) { - var result = new Array(); - for (var i = 0; i < values.length; i++) { - if (func(values[i])) { - result.push(values[i]); - } - } - return result; - }; - ArrayUtilities.any = function (array, func) { - for (var i = 0, n = array.length; i < n; i++) { - if (func(array[i])) { - return true; - } - } - return false; - }; - ArrayUtilities.all = function (array, func) { - for (var i = 0, n = array.length; i < n; i++) { - if (!func(array[i])) { - return false; - } - } - return true; - }; - ArrayUtilities.binarySearch = function (array, value) { - var low = 0; - var high = array.length - 1; - while (low <= high) { - var middle = low + ((high - low) >> 1); - var midValue = array[middle]; - if (midValue === value) { - return middle; - } - else if (midValue > value) { - high = middle - 1; - } - else { - low = middle + 1; - } - } - return ~low; - }; - ArrayUtilities.createArray = function (length, defaultValue) { - var result = new Array(length); - for (var i = 0; i < length; i++) { - result[i] = defaultValue; - } - return result; - }; - ArrayUtilities.grow = function (array, length, defaultValue) { - var count = length - array.length; - for (var i = 0; i < count; i++) { - array.push(defaultValue); - } - }; - ArrayUtilities.copy = function (sourceArray, sourceIndex, destinationArray, destinationIndex, length) { - for (var i = 0; i < length; i++) { - destinationArray[destinationIndex + i] = sourceArray[sourceIndex + i]; - } - }; - ArrayUtilities.indexOf = function (array, predicate) { - for (var i = 0, n = array.length; i < n; i++) { - if (predicate(array[i])) { - return i; - } - } - return -1; - }; - return ArrayUtilities; - })(); - TypeScript.ArrayUtilities = ArrayUtilities; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (AssertionLevel) { - AssertionLevel[AssertionLevel["None"] = 0] = "None"; - AssertionLevel[AssertionLevel["Normal"] = 1] = "Normal"; - AssertionLevel[AssertionLevel["Aggressive"] = 2] = "Aggressive"; - AssertionLevel[AssertionLevel["VeryAggressive"] = 3] = "VeryAggressive"; - })(TypeScript.AssertionLevel || (TypeScript.AssertionLevel = {})); - var AssertionLevel = TypeScript.AssertionLevel; - var Debug = (function () { - function Debug() { - } - Debug.shouldAssert = function (level) { - return this.currentAssertionLevel >= level; - }; - Debug.assert = function (expression, message, verboseDebugInfo) { - if (message === void 0) { message = ""; } - if (verboseDebugInfo === void 0) { verboseDebugInfo = null; } - if (!expression) { - var verboseDebugString = ""; - if (verboseDebugInfo) { - verboseDebugString = "\r\nVerbose Debug Information:" + verboseDebugInfo(); - } - throw new Error("Debug Failure. False expression: " + message + verboseDebugString); - } - }; - Debug.fail = function (message) { - Debug.assert(false, message); - }; - Debug.currentAssertionLevel = 0 /* None */; - return Debug; - })(); - TypeScript.Debug = Debug; -})(TypeScript || (TypeScript = {})); -var __extends = this.__extends || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); -}; -var TypeScript; -(function (TypeScript) { - var Location = (function () { - function Location(fileName, lineMap, start, length) { - this._fileName = fileName; - this._lineMap = lineMap; - this._start = start; - this._length = length; - } - Location.prototype.fileName = function () { - return this._fileName; - }; - Location.prototype.lineMap = function () { - return this._lineMap; - }; - Location.prototype.line = function () { - return this._lineMap ? this._lineMap.getLineNumberFromPosition(this.start()) : 0; - }; - Location.prototype.character = function () { - return this._lineMap ? this._lineMap.getLineAndCharacterFromPosition(this.start()).character() : 0; - }; - Location.prototype.start = function () { - return this._start; - }; - Location.prototype.length = function () { - return this._length; - }; - Location.equals = function (location1, location2) { - return location1._fileName === location2._fileName && location1._start === location2._start && location1._length === location2._length; - }; - return Location; - })(); - TypeScript.Location = Location; - var Diagnostic = (function (_super) { - __extends(Diagnostic, _super); - function Diagnostic(fileName, lineMap, start, length, diagnosticKey, _arguments, additionalLocations) { - if (_arguments === void 0) { _arguments = null; } - if (additionalLocations === void 0) { additionalLocations = null; } - _super.call(this, fileName, lineMap, start, length); - this._diagnosticKey = diagnosticKey; - this._arguments = (_arguments && _arguments.length > 0) ? _arguments : null; - this._additionalLocations = (additionalLocations && additionalLocations.length > 0) ? additionalLocations : null; - } - Diagnostic.prototype.toJSON = function (key) { - var result = {}; - result.start = this.start(); - result.length = this.length(); - result.diagnosticCode = this._diagnosticKey; - var _arguments = this.arguments(); - if (_arguments && _arguments.length > 0) { - result.arguments = _arguments; - } - return result; - }; - Diagnostic.prototype.diagnosticKey = function () { - return this._diagnosticKey; - }; - Diagnostic.prototype.arguments = function () { - return this._arguments; - }; - Diagnostic.prototype.text = function () { - return TypeScript.getLocalizedText(this._diagnosticKey, this._arguments); - }; - Diagnostic.prototype.message = function () { - return TypeScript.getDiagnosticMessage(this._diagnosticKey, this._arguments); - }; - Diagnostic.prototype.additionalLocations = function () { - return this._additionalLocations || []; - }; - Diagnostic.equals = function (diagnostic1, diagnostic2) { - return Location.equals(diagnostic1, diagnostic2) && diagnostic1._diagnosticKey === diagnostic2._diagnosticKey && TypeScript.ArrayUtilities.sequenceEquals(diagnostic1._arguments, diagnostic2._arguments, function (v1, v2) { return v1 === v2; }); - }; - Diagnostic.prototype.info = function () { - return getDiagnosticInfoFromKey(this.diagnosticKey()); - }; - return Diagnostic; - })(Location); - TypeScript.Diagnostic = Diagnostic; - function newLine() { - return "\r\n"; - } - TypeScript.newLine = newLine; - function getLargestIndex(diagnostic) { - var largest = -1; - var regex = /\{(\d+)\}/g; - var match; - while (match = regex.exec(diagnostic)) { - var val = parseInt(match[1]); - if (!isNaN(val) && val > largest) { - largest = val; - } - } - return largest; - } - function getDiagnosticInfoFromKey(diagnosticKey) { - var result = TypeScript.diagnosticInformationMap[diagnosticKey]; - TypeScript.Debug.assert(result); - return result; - } - function getLocalizedText(diagnosticKey, args) { - var diagnosticMessageText = diagnosticKey; - TypeScript.Debug.assert(diagnosticMessageText !== undefined && diagnosticMessageText !== null); - var actualCount = args ? args.length : 0; - var expectedCount = 1 + getLargestIndex(diagnosticKey); - if (expectedCount !== actualCount) { - throw new Error(getLocalizedText(TypeScript.DiagnosticCode.Expected_0_arguments_to_message_got_1_instead, [expectedCount, actualCount])); - } - var valueCount = 1 + getLargestIndex(diagnosticMessageText); - if (valueCount !== expectedCount) { - throw new Error(getLocalizedText(TypeScript.DiagnosticCode.Expected_the_message_0_to_have_1_arguments_but_it_had_2, [diagnosticMessageText, expectedCount, valueCount])); - } - diagnosticMessageText = diagnosticMessageText.replace(/{(\d+)}/g, function (match, num) { - return typeof args[num] !== 'undefined' ? args[num] : match; - }); - diagnosticMessageText = diagnosticMessageText.replace(/{(NL)}/g, function (match) { - return TypeScript.newLine(); - }); - return diagnosticMessageText; - } - TypeScript.getLocalizedText = getLocalizedText; - function getDiagnosticMessage(diagnosticKey, args) { - var diagnostic = getDiagnosticInfoFromKey(diagnosticKey); - var diagnosticMessageText = getLocalizedText(diagnosticKey, args); - var message; - if (diagnostic.category === 1 /* Error */) { - message = getLocalizedText(TypeScript.DiagnosticCode.error_TS_0_1, [diagnostic.code, diagnosticMessageText]); - } - else if (diagnostic.category === 0 /* Warning */) { - message = getLocalizedText(TypeScript.DiagnosticCode.warning_TS_0_1, [diagnostic.code, diagnosticMessageText]); - } - else { - message = diagnosticMessageText; - } - return message; - } - TypeScript.getDiagnosticMessage = getDiagnosticMessage; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Errors = (function () { - function Errors() { - } - Errors.argument = function (argument, message) { - return new Error("Invalid argument: " + argument + ". " + message); - }; - Errors.argumentOutOfRange = function (argument) { - return new Error("Argument out of range: " + argument); - }; - Errors.argumentNull = function (argument) { - return new Error("Argument null: " + argument); - }; - Errors.abstract = function () { - return new Error("Operation not implemented properly by subclass."); - }; - Errors.notYetImplemented = function () { - return new Error("Not yet implemented."); - }; - Errors.invalidOperation = function (message) { - return new Error("Invalid operation: " + message); - }; - return Errors; - })(); - TypeScript.Errors = Errors; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var IntegerUtilities; - (function (IntegerUtilities) { - function integerDivide(numerator, denominator) { - return (numerator / denominator) >> 0; - } - IntegerUtilities.integerDivide = integerDivide; - function integerMultiplyLow32Bits(n1, n2) { - var n1Low16 = n1 & 0x0000ffff; - var n1High16 = n1 >>> 16; - var n2Low16 = n2 & 0x0000ffff; - var n2High16 = n2 >>> 16; - var resultLow32 = (((n1 & 0xffff0000) * n2) >>> 0) + (((n1 & 0x0000ffff) * n2) >>> 0) >>> 0; - return resultLow32; - } - IntegerUtilities.integerMultiplyLow32Bits = integerMultiplyLow32Bits; - function isInteger(text) { - return /^[0-9]+$/.test(text); - } - IntegerUtilities.isInteger = isInteger; - function isHexInteger(text) { - return /^0(x|X)[0-9a-fA-F]+$/.test(text); - } - IntegerUtilities.isHexInteger = isHexInteger; - })(IntegerUtilities = TypeScript.IntegerUtilities || (TypeScript.IntegerUtilities = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var LineMap = (function () { - function LineMap(_computeLineStarts, length) { - this._computeLineStarts = _computeLineStarts; - this.length = length; - this._lineStarts = null; - } - LineMap.prototype.toJSON = function (key) { - return { lineStarts: this.lineStarts(), length: this.length }; - }; - LineMap.prototype.equals = function (other) { - return this.length === other.length && TypeScript.ArrayUtilities.sequenceEquals(this.lineStarts(), other.lineStarts(), function (v1, v2) { return v1 === v2; }); - }; - LineMap.prototype.lineStarts = function () { - if (this._lineStarts === null) { - this._lineStarts = this._computeLineStarts(); - } - return this._lineStarts; - }; - LineMap.prototype.lineCount = function () { - return this.lineStarts().length; - }; - LineMap.prototype.getPosition = function (line, character) { - return this.lineStarts()[line] + character; - }; - LineMap.prototype.getLineNumberFromPosition = function (position) { - if (position < 0 || position > this.length) { - throw TypeScript.Errors.argumentOutOfRange("position"); - } - if (position === this.length) { - return this.lineCount() - 1; - } - var lineNumber = TypeScript.ArrayUtilities.binarySearch(this.lineStarts(), position); - if (lineNumber < 0) { - lineNumber = (~lineNumber) - 1; - } - return lineNumber; - }; - LineMap.prototype.getLineStartPosition = function (lineNumber) { - return this.lineStarts()[lineNumber]; - }; - LineMap.prototype.fillLineAndCharacterFromPosition = function (position, lineAndCharacter) { - if (position < 0 || position > this.length) { - throw TypeScript.Errors.argumentOutOfRange("position"); - } - var lineNumber = this.getLineNumberFromPosition(position); - lineAndCharacter.line = lineNumber; - lineAndCharacter.character = position - this.lineStarts()[lineNumber]; - }; - LineMap.prototype.getLineAndCharacterFromPosition = function (position) { - if (position < 0 || position > this.length) { - throw TypeScript.Errors.argumentOutOfRange("position"); - } - var lineNumber = this.getLineNumberFromPosition(position); - return new TypeScript.LineAndCharacter(lineNumber, position - this.lineStarts()[lineNumber]); - }; - LineMap.empty = new LineMap(function () { return [0]; }, 0); - return LineMap; - })(); - TypeScript.LineMap = LineMap; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var LineAndCharacter = (function () { - function LineAndCharacter(line, character) { - this._line = 0; - this._character = 0; - if (line < 0) { - throw TypeScript.Errors.argumentOutOfRange("line"); - } - if (character < 0) { - throw TypeScript.Errors.argumentOutOfRange("character"); - } - this._line = line; - this._character = character; - } - LineAndCharacter.prototype.line = function () { - return this._line; - }; - LineAndCharacter.prototype.character = function () { - return this._character; - }; - return LineAndCharacter; - })(); - TypeScript.LineAndCharacter = LineAndCharacter; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var StringUtilities = (function () { - function StringUtilities() { - } - StringUtilities.isString = function (value) { - return Object.prototype.toString.apply(value, []) === '[object String]'; - }; - StringUtilities.endsWith = function (string, value) { - return string.substring(string.length - value.length, string.length) === value; - }; - StringUtilities.startsWith = function (string, value) { - return string.substr(0, value.length) === value; - }; - StringUtilities.repeat = function (value, count) { - return Array(count + 1).join(value); - }; - return StringUtilities; - })(); - TypeScript.StringUtilities = StringUtilities; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (CharacterCodes) { - CharacterCodes[CharacterCodes["nullCharacter"] = 0] = "nullCharacter"; - CharacterCodes[CharacterCodes["maxAsciiCharacter"] = 127] = "maxAsciiCharacter"; - CharacterCodes[CharacterCodes["lineFeed"] = 10] = "lineFeed"; - CharacterCodes[CharacterCodes["carriageReturn"] = 13] = "carriageReturn"; - CharacterCodes[CharacterCodes["lineSeparator"] = 0x2028] = "lineSeparator"; - CharacterCodes[CharacterCodes["paragraphSeparator"] = 0x2029] = "paragraphSeparator"; - CharacterCodes[CharacterCodes["nextLine"] = 0x0085] = "nextLine"; - CharacterCodes[CharacterCodes["space"] = 0x0020] = "space"; - CharacterCodes[CharacterCodes["nonBreakingSpace"] = 0x00A0] = "nonBreakingSpace"; - CharacterCodes[CharacterCodes["enQuad"] = 0x2000] = "enQuad"; - CharacterCodes[CharacterCodes["emQuad"] = 0x2001] = "emQuad"; - CharacterCodes[CharacterCodes["enSpace"] = 0x2002] = "enSpace"; - CharacterCodes[CharacterCodes["emSpace"] = 0x2003] = "emSpace"; - CharacterCodes[CharacterCodes["threePerEmSpace"] = 0x2004] = "threePerEmSpace"; - CharacterCodes[CharacterCodes["fourPerEmSpace"] = 0x2005] = "fourPerEmSpace"; - CharacterCodes[CharacterCodes["sixPerEmSpace"] = 0x2006] = "sixPerEmSpace"; - CharacterCodes[CharacterCodes["figureSpace"] = 0x2007] = "figureSpace"; - CharacterCodes[CharacterCodes["punctuationSpace"] = 0x2008] = "punctuationSpace"; - CharacterCodes[CharacterCodes["thinSpace"] = 0x2009] = "thinSpace"; - CharacterCodes[CharacterCodes["hairSpace"] = 0x200A] = "hairSpace"; - CharacterCodes[CharacterCodes["zeroWidthSpace"] = 0x200B] = "zeroWidthSpace"; - CharacterCodes[CharacterCodes["narrowNoBreakSpace"] = 0x202F] = "narrowNoBreakSpace"; - CharacterCodes[CharacterCodes["ideographicSpace"] = 0x3000] = "ideographicSpace"; - CharacterCodes[CharacterCodes["_"] = 95] = "_"; - CharacterCodes[CharacterCodes["$"] = 36] = "$"; - CharacterCodes[CharacterCodes["_0"] = 48] = "_0"; - CharacterCodes[CharacterCodes["_1"] = 49] = "_1"; - CharacterCodes[CharacterCodes["_2"] = 50] = "_2"; - CharacterCodes[CharacterCodes["_3"] = 51] = "_3"; - CharacterCodes[CharacterCodes["_4"] = 52] = "_4"; - CharacterCodes[CharacterCodes["_5"] = 53] = "_5"; - CharacterCodes[CharacterCodes["_6"] = 54] = "_6"; - CharacterCodes[CharacterCodes["_7"] = 55] = "_7"; - CharacterCodes[CharacterCodes["_8"] = 56] = "_8"; - CharacterCodes[CharacterCodes["_9"] = 57] = "_9"; - CharacterCodes[CharacterCodes["a"] = 97] = "a"; - CharacterCodes[CharacterCodes["b"] = 98] = "b"; - CharacterCodes[CharacterCodes["c"] = 99] = "c"; - CharacterCodes[CharacterCodes["d"] = 100] = "d"; - CharacterCodes[CharacterCodes["e"] = 101] = "e"; - CharacterCodes[CharacterCodes["f"] = 102] = "f"; - CharacterCodes[CharacterCodes["g"] = 103] = "g"; - CharacterCodes[CharacterCodes["h"] = 104] = "h"; - CharacterCodes[CharacterCodes["i"] = 105] = "i"; - CharacterCodes[CharacterCodes["j"] = 106] = "j"; - CharacterCodes[CharacterCodes["k"] = 107] = "k"; - CharacterCodes[CharacterCodes["l"] = 108] = "l"; - CharacterCodes[CharacterCodes["m"] = 109] = "m"; - CharacterCodes[CharacterCodes["n"] = 110] = "n"; - CharacterCodes[CharacterCodes["o"] = 111] = "o"; - CharacterCodes[CharacterCodes["p"] = 112] = "p"; - CharacterCodes[CharacterCodes["q"] = 113] = "q"; - CharacterCodes[CharacterCodes["r"] = 114] = "r"; - CharacterCodes[CharacterCodes["s"] = 115] = "s"; - CharacterCodes[CharacterCodes["t"] = 116] = "t"; - CharacterCodes[CharacterCodes["u"] = 117] = "u"; - CharacterCodes[CharacterCodes["v"] = 118] = "v"; - CharacterCodes[CharacterCodes["w"] = 119] = "w"; - CharacterCodes[CharacterCodes["x"] = 120] = "x"; - CharacterCodes[CharacterCodes["y"] = 121] = "y"; - CharacterCodes[CharacterCodes["z"] = 122] = "z"; - CharacterCodes[CharacterCodes["A"] = 65] = "A"; - CharacterCodes[CharacterCodes["B"] = 66] = "B"; - CharacterCodes[CharacterCodes["C"] = 67] = "C"; - CharacterCodes[CharacterCodes["D"] = 68] = "D"; - CharacterCodes[CharacterCodes["E"] = 69] = "E"; - CharacterCodes[CharacterCodes["F"] = 70] = "F"; - CharacterCodes[CharacterCodes["G"] = 71] = "G"; - CharacterCodes[CharacterCodes["H"] = 72] = "H"; - CharacterCodes[CharacterCodes["I"] = 73] = "I"; - CharacterCodes[CharacterCodes["J"] = 74] = "J"; - CharacterCodes[CharacterCodes["K"] = 75] = "K"; - CharacterCodes[CharacterCodes["L"] = 76] = "L"; - CharacterCodes[CharacterCodes["M"] = 77] = "M"; - CharacterCodes[CharacterCodes["N"] = 78] = "N"; - CharacterCodes[CharacterCodes["O"] = 79] = "O"; - CharacterCodes[CharacterCodes["P"] = 80] = "P"; - CharacterCodes[CharacterCodes["Q"] = 81] = "Q"; - CharacterCodes[CharacterCodes["R"] = 82] = "R"; - CharacterCodes[CharacterCodes["S"] = 83] = "S"; - CharacterCodes[CharacterCodes["T"] = 84] = "T"; - CharacterCodes[CharacterCodes["U"] = 85] = "U"; - CharacterCodes[CharacterCodes["V"] = 86] = "V"; - CharacterCodes[CharacterCodes["W"] = 87] = "W"; - CharacterCodes[CharacterCodes["X"] = 88] = "X"; - CharacterCodes[CharacterCodes["Y"] = 89] = "Y"; - CharacterCodes[CharacterCodes["Z"] = 90] = "Z"; - CharacterCodes[CharacterCodes["ampersand"] = 38] = "ampersand"; - CharacterCodes[CharacterCodes["asterisk"] = 42] = "asterisk"; - CharacterCodes[CharacterCodes["at"] = 64] = "at"; - CharacterCodes[CharacterCodes["backslash"] = 92] = "backslash"; - CharacterCodes[CharacterCodes["bar"] = 124] = "bar"; - CharacterCodes[CharacterCodes["caret"] = 94] = "caret"; - CharacterCodes[CharacterCodes["closeBrace"] = 125] = "closeBrace"; - CharacterCodes[CharacterCodes["closeBracket"] = 93] = "closeBracket"; - CharacterCodes[CharacterCodes["closeParen"] = 41] = "closeParen"; - CharacterCodes[CharacterCodes["colon"] = 58] = "colon"; - CharacterCodes[CharacterCodes["comma"] = 44] = "comma"; - CharacterCodes[CharacterCodes["dot"] = 46] = "dot"; - CharacterCodes[CharacterCodes["doubleQuote"] = 34] = "doubleQuote"; - CharacterCodes[CharacterCodes["equals"] = 61] = "equals"; - CharacterCodes[CharacterCodes["exclamation"] = 33] = "exclamation"; - CharacterCodes[CharacterCodes["greaterThan"] = 62] = "greaterThan"; - CharacterCodes[CharacterCodes["lessThan"] = 60] = "lessThan"; - CharacterCodes[CharacterCodes["minus"] = 45] = "minus"; - CharacterCodes[CharacterCodes["openBrace"] = 123] = "openBrace"; - CharacterCodes[CharacterCodes["openBracket"] = 91] = "openBracket"; - CharacterCodes[CharacterCodes["openParen"] = 40] = "openParen"; - CharacterCodes[CharacterCodes["percent"] = 37] = "percent"; - CharacterCodes[CharacterCodes["plus"] = 43] = "plus"; - CharacterCodes[CharacterCodes["question"] = 63] = "question"; - CharacterCodes[CharacterCodes["semicolon"] = 59] = "semicolon"; - CharacterCodes[CharacterCodes["singleQuote"] = 39] = "singleQuote"; - CharacterCodes[CharacterCodes["slash"] = 47] = "slash"; - CharacterCodes[CharacterCodes["tilde"] = 126] = "tilde"; - CharacterCodes[CharacterCodes["backspace"] = 8] = "backspace"; - CharacterCodes[CharacterCodes["formFeed"] = 12] = "formFeed"; - CharacterCodes[CharacterCodes["byteOrderMark"] = 0xFEFF] = "byteOrderMark"; - CharacterCodes[CharacterCodes["tab"] = 9] = "tab"; - CharacterCodes[CharacterCodes["verticalTab"] = 11] = "verticalTab"; - })(TypeScript.CharacterCodes || (TypeScript.CharacterCodes = {})); - var CharacterCodes = TypeScript.CharacterCodes; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var ScriptSnapshot; - (function (ScriptSnapshot) { - var StringScriptSnapshot = (function () { - function StringScriptSnapshot(text) { - this.text = text; - this._lineStartPositions = null; - } - StringScriptSnapshot.prototype.getText = function (start, end) { - return this.text.substring(start, end); - }; - StringScriptSnapshot.prototype.getLength = function () { - return this.text.length; - }; - StringScriptSnapshot.prototype.getLineStartPositions = function () { - if (!this._lineStartPositions) { - this._lineStartPositions = TypeScript.TextUtilities.parseLineStarts(this.text); - } - return this._lineStartPositions; - }; - StringScriptSnapshot.prototype.getChangeRange = function (oldSnapshot) { - throw TypeScript.Errors.notYetImplemented(); - }; - return StringScriptSnapshot; - })(); - function fromString(text) { - return new StringScriptSnapshot(text); - } - ScriptSnapshot.fromString = fromString; - })(ScriptSnapshot = TypeScript.ScriptSnapshot || (TypeScript.ScriptSnapshot = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var LineMap1; - (function (LineMap1) { - function fromSimpleText(text) { - return new TypeScript.LineMap(function () { return TypeScript.TextUtilities.parseLineStarts({ charCodeAt: function (index) { return text.charCodeAt(index); }, length: text.length() }); }, text.length()); - } - LineMap1.fromSimpleText = fromSimpleText; - function fromScriptSnapshot(scriptSnapshot) { - return new TypeScript.LineMap(function () { return scriptSnapshot.getLineStartPositions(); }, scriptSnapshot.getLength()); - } - LineMap1.fromScriptSnapshot = fromScriptSnapshot; - function fromString(text) { - return new TypeScript.LineMap(function () { return TypeScript.TextUtilities.parseLineStarts(text); }, text.length); - } - LineMap1.fromString = fromString; - })(LineMap1 = TypeScript.LineMap1 || (TypeScript.LineMap1 = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var SimpleText; - (function (SimpleText) { - var SimpleStringText = (function () { - function SimpleStringText(value) { - this.value = value; - this._lineMap = null; - } - SimpleStringText.prototype.length = function () { - return this.value.length; - }; - SimpleStringText.prototype.substr = function (start, length) { - return this.value.substr(start, length); - }; - SimpleStringText.prototype.charCodeAt = function (index) { - return this.value.charCodeAt(index); - }; - SimpleStringText.prototype.lineMap = function () { - if (!this._lineMap) { - this._lineMap = TypeScript.LineMap1.fromString(this.value); - } - return this._lineMap; - }; - return SimpleStringText; - })(); - var SimpleScriptSnapshotText = (function () { - function SimpleScriptSnapshotText(scriptSnapshot) { - this.scriptSnapshot = scriptSnapshot; - this._lineMap = null; - } - SimpleScriptSnapshotText.prototype.charCodeAt = function (index) { - return this.scriptSnapshot.getText(index, index + 1).charCodeAt(0); - }; - SimpleScriptSnapshotText.prototype.length = function () { - return this.scriptSnapshot.getLength(); - }; - SimpleScriptSnapshotText.prototype.substr = function (start, length) { - return this.scriptSnapshot.getText(start, start + length); - }; - SimpleScriptSnapshotText.prototype.lineMap = function () { - var _this = this; - if (this._lineMap === null) { - this._lineMap = new TypeScript.LineMap(function () { return _this.scriptSnapshot.getLineStartPositions(); }, this.length()); - } - return this._lineMap; - }; - return SimpleScriptSnapshotText; - })(); - function fromString(value) { - return new SimpleStringText(value); - } - SimpleText.fromString = fromString; - function fromScriptSnapshot(scriptSnapshot) { - return new SimpleScriptSnapshotText(scriptSnapshot); - } - SimpleText.fromScriptSnapshot = fromScriptSnapshot; - })(SimpleText = TypeScript.SimpleText || (TypeScript.SimpleText = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var TextUtilities; - (function (TextUtilities) { - function parseLineStarts(text) { - var length = text.length; - if (0 === length) { - var result = new Array(); - result.push(0); - return result; - } - var position = 0; - var index = 0; - var arrayBuilder = new Array(); - var lineNumber = 0; - while (index < length) { - var c = text.charCodeAt(index); - var lineBreakLength; - if (c > 13 /* carriageReturn */ && c <= 127) { - index++; - continue; - } - else if (c === 13 /* carriageReturn */ && index + 1 < length && text.charCodeAt(index + 1) === 10 /* lineFeed */) { - lineBreakLength = 2; - } - else if (c === 10 /* lineFeed */) { - lineBreakLength = 1; - } - else { - lineBreakLength = TextUtilities.getLengthOfLineBreak(text, index); - } - if (0 === lineBreakLength) { - index++; - } - else { - arrayBuilder.push(position); - index += lineBreakLength; - position = index; - lineNumber++; - } - } - arrayBuilder.push(position); - return arrayBuilder; - } - TextUtilities.parseLineStarts = parseLineStarts; - function getLengthOfLineBreakSlow(text, index, c) { - if (c === 13 /* carriageReturn */) { - var next = index + 1; - return (next < text.length) && 10 /* lineFeed */ === text.charCodeAt(next) ? 2 : 1; - } - else if (isAnyLineBreakCharacter(c)) { - return 1; - } - else { - return 0; - } - } - TextUtilities.getLengthOfLineBreakSlow = getLengthOfLineBreakSlow; - function getLengthOfLineBreak(text, index) { - var c = text.charCodeAt(index); - if (c > 13 /* carriageReturn */ && c <= 127) { - return 0; - } - return getLengthOfLineBreakSlow(text, index, c); - } - TextUtilities.getLengthOfLineBreak = getLengthOfLineBreak; - function isAnyLineBreakCharacter(c) { - return c === 10 /* lineFeed */ || c === 13 /* carriageReturn */ || c === 133 /* nextLine */ || c === 8232 /* lineSeparator */ || c === 8233 /* paragraphSeparator */; - } - TextUtilities.isAnyLineBreakCharacter = isAnyLineBreakCharacter; - })(TextUtilities = TypeScript.TextUtilities || (TypeScript.TextUtilities = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var TextSpan = (function () { - function TextSpan(start, length) { - if (start < 0) { - TypeScript.Errors.argument("start"); - } - if (length < 0) { - TypeScript.Errors.argument("length"); - } - this._start = start; - this._length = length; - } - TextSpan.prototype.toJSON = function (key) { - return { start: this._start, length: this._length }; - }; - TextSpan.prototype.start = function () { - return this._start; - }; - TextSpan.prototype.length = function () { - return this._length; - }; - TextSpan.prototype.end = function () { - return this._start + this._length; - }; - TextSpan.prototype.isEmpty = function () { - return this._length === 0; - }; - TextSpan.prototype.containsPosition = function (position) { - return position >= this._start && position < this.end(); - }; - TextSpan.prototype.containsTextSpan = function (span) { - return span._start >= this._start && span.end() <= this.end(); - }; - TextSpan.prototype.overlapsWith = function (span) { - var overlapStart = Math.max(this._start, span._start); - var overlapEnd = Math.min(this.end(), span.end()); - return overlapStart < overlapEnd; - }; - TextSpan.prototype.overlap = function (span) { - var overlapStart = Math.max(this._start, span._start); - var overlapEnd = Math.min(this.end(), span.end()); - if (overlapStart < overlapEnd) { - return TextSpan.fromBounds(overlapStart, overlapEnd); - } - return null; - }; - TextSpan.prototype.intersectsWithTextSpan = function (span) { - return span._start <= this.end() && span.end() >= this._start; - }; - TextSpan.prototype.intersectsWith = function (start, length) { - var end = start + length; - return start <= this.end() && end >= this._start; - }; - TextSpan.prototype.intersectsWithPosition = function (position) { - return position <= this.end() && position >= this._start; - }; - TextSpan.prototype.intersection = function (span) { - var intersectStart = Math.max(this._start, span._start); - var intersectEnd = Math.min(this.end(), span.end()); - if (intersectStart <= intersectEnd) { - return TextSpan.fromBounds(intersectStart, intersectEnd); - } - return null; - }; - TextSpan.fromBounds = function (start, end) { - TypeScript.Debug.assert(start >= 0); - TypeScript.Debug.assert(end - start >= 0); - return new TextSpan(start, end - start); - }; - return TextSpan; - })(); - TypeScript.TextSpan = TextSpan; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var TextChangeRange = (function () { - function TextChangeRange(span, newLength) { - if (newLength < 0) { - throw TypeScript.Errors.argumentOutOfRange("newLength"); - } - this._span = span; - this._newLength = newLength; - } - TextChangeRange.prototype.span = function () { - return this._span; - }; - TextChangeRange.prototype.newLength = function () { - return this._newLength; - }; - TextChangeRange.prototype.newSpan = function () { - return new TypeScript.TextSpan(this.span().start(), this.newLength()); - }; - TextChangeRange.prototype.isUnchanged = function () { - return this.span().isEmpty() && this.newLength() === 0; - }; - TextChangeRange.collapseChangesAcrossMultipleVersions = function (changes) { - if (changes.length === 0) { - return TextChangeRange.unchanged; - } - if (changes.length === 1) { - return changes[0]; - } - var change0 = changes[0]; - var oldStartN = change0.span().start(); - var oldEndN = change0.span().end(); - var newEndN = oldStartN + change0.newLength(); - for (var i = 1; i < changes.length; i++) { - var nextChange = changes[i]; - var oldStart1 = oldStartN; - var oldEnd1 = oldEndN; - var newEnd1 = newEndN; - var oldStart2 = nextChange.span().start(); - var oldEnd2 = nextChange.span().end(); - var newEnd2 = oldStart2 + nextChange.newLength(); - oldStartN = Math.min(oldStart1, oldStart2); - oldEndN = Math.max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1)); - newEndN = Math.max(newEnd2, newEnd2 + (newEnd1 - oldEnd2)); - } - return new TextChangeRange(TypeScript.TextSpan.fromBounds(oldStartN, oldEndN), newEndN - oldStartN); - }; - TextChangeRange.unchanged = new TextChangeRange(new TypeScript.TextSpan(0, 0), 0); - return TextChangeRange; - })(); - TypeScript.TextChangeRange = TextChangeRange; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var CharacterInfo; - (function (CharacterInfo) { - function isDecimalDigit(c) { - return c >= 48 /* _0 */ && c <= 57 /* _9 */; - } - CharacterInfo.isDecimalDigit = isDecimalDigit; - function isOctalDigit(c) { - return c >= 48 /* _0 */ && c <= 55 /* _7 */; - } - CharacterInfo.isOctalDigit = isOctalDigit; - function isHexDigit(c) { - return CharacterInfo.isDecimalDigit(c) || (c >= 65 /* A */ && c <= 70 /* F */) || (c >= 97 /* a */ && c <= 102 /* f */); - } - CharacterInfo.isHexDigit = isHexDigit; - function hexValue(c) { - return CharacterInfo.isDecimalDigit(c) ? (c - 48 /* _0 */) : (c >= 65 /* A */ && c <= 70 /* F */) ? c - 65 /* A */ + 10 : c - 97 /* a */ + 10; - } - CharacterInfo.hexValue = hexValue; - function isWhitespace(ch) { - switch (ch) { - case 32 /* space */: - case 160 /* nonBreakingSpace */: - case 8192 /* enQuad */: - case 8193 /* emQuad */: - case 8194 /* enSpace */: - case 8195 /* emSpace */: - case 8196 /* threePerEmSpace */: - case 8197 /* fourPerEmSpace */: - case 8198 /* sixPerEmSpace */: - case 8199 /* figureSpace */: - case 8200 /* punctuationSpace */: - case 8201 /* thinSpace */: - case 8202 /* hairSpace */: - case 8203 /* zeroWidthSpace */: - case 8239 /* narrowNoBreakSpace */: - case 12288 /* ideographicSpace */: - case 9 /* tab */: - case 11 /* verticalTab */: - case 12 /* formFeed */: - case 65279 /* byteOrderMark */: - return true; - } - return false; - } - CharacterInfo.isWhitespace = isWhitespace; - function isLineTerminator(ch) { - switch (ch) { - case 13 /* carriageReturn */: - case 10 /* lineFeed */: - case 8233 /* paragraphSeparator */: - case 8232 /* lineSeparator */: - return true; - } - return false; - } - CharacterInfo.isLineTerminator = isLineTerminator; - })(CharacterInfo = TypeScript.CharacterInfo || (TypeScript.CharacterInfo = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (SyntaxConstants) { - SyntaxConstants[SyntaxConstants["None"] = 0] = "None"; - SyntaxConstants[SyntaxConstants["NodeDataComputed"] = 0x00000001] = "NodeDataComputed"; - SyntaxConstants[SyntaxConstants["NodeIncrementallyUnusableMask"] = 0x00000002] = "NodeIncrementallyUnusableMask"; - SyntaxConstants[SyntaxConstants["NodeParsedInStrictModeMask"] = 0x00000004] = "NodeParsedInStrictModeMask"; - SyntaxConstants[SyntaxConstants["NodeFullWidthShift"] = 3] = "NodeFullWidthShift"; - })(TypeScript.SyntaxConstants || (TypeScript.SyntaxConstants = {})); - var SyntaxConstants = TypeScript.SyntaxConstants; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var FormattingOptions = (function () { - function FormattingOptions(useTabs, spacesPerTab, indentSpaces, newLineCharacter) { - this.useTabs = useTabs; - this.spacesPerTab = spacesPerTab; - this.indentSpaces = indentSpaces; - this.newLineCharacter = newLineCharacter; - } - FormattingOptions.defaultOptions = new FormattingOptions(false, 4, 4, "\r\n"); - return FormattingOptions; - })(); - TypeScript.FormattingOptions = FormattingOptions; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (SyntaxKind) { - SyntaxKind[SyntaxKind["None"] = 0] = "None"; - SyntaxKind[SyntaxKind["List"] = 1] = "List"; - SyntaxKind[SyntaxKind["SeparatedList"] = 2] = "SeparatedList"; - SyntaxKind[SyntaxKind["TriviaList"] = 3] = "TriviaList"; - SyntaxKind[SyntaxKind["WhitespaceTrivia"] = 4] = "WhitespaceTrivia"; - SyntaxKind[SyntaxKind["NewLineTrivia"] = 5] = "NewLineTrivia"; - SyntaxKind[SyntaxKind["MultiLineCommentTrivia"] = 6] = "MultiLineCommentTrivia"; - SyntaxKind[SyntaxKind["SingleLineCommentTrivia"] = 7] = "SingleLineCommentTrivia"; - SyntaxKind[SyntaxKind["SkippedTokenTrivia"] = 8] = "SkippedTokenTrivia"; - SyntaxKind[SyntaxKind["ErrorToken"] = 9] = "ErrorToken"; - SyntaxKind[SyntaxKind["EndOfFileToken"] = 10] = "EndOfFileToken"; - SyntaxKind[SyntaxKind["IdentifierName"] = 11] = "IdentifierName"; - SyntaxKind[SyntaxKind["RegularExpressionLiteral"] = 12] = "RegularExpressionLiteral"; - SyntaxKind[SyntaxKind["NumericLiteral"] = 13] = "NumericLiteral"; - SyntaxKind[SyntaxKind["StringLiteral"] = 14] = "StringLiteral"; - SyntaxKind[SyntaxKind["BreakKeyword"] = 15] = "BreakKeyword"; - SyntaxKind[SyntaxKind["CaseKeyword"] = 16] = "CaseKeyword"; - SyntaxKind[SyntaxKind["CatchKeyword"] = 17] = "CatchKeyword"; - SyntaxKind[SyntaxKind["ContinueKeyword"] = 18] = "ContinueKeyword"; - SyntaxKind[SyntaxKind["DebuggerKeyword"] = 19] = "DebuggerKeyword"; - SyntaxKind[SyntaxKind["DefaultKeyword"] = 20] = "DefaultKeyword"; - SyntaxKind[SyntaxKind["DeleteKeyword"] = 21] = "DeleteKeyword"; - SyntaxKind[SyntaxKind["DoKeyword"] = 22] = "DoKeyword"; - SyntaxKind[SyntaxKind["ElseKeyword"] = 23] = "ElseKeyword"; - SyntaxKind[SyntaxKind["FalseKeyword"] = 24] = "FalseKeyword"; - SyntaxKind[SyntaxKind["FinallyKeyword"] = 25] = "FinallyKeyword"; - SyntaxKind[SyntaxKind["ForKeyword"] = 26] = "ForKeyword"; - SyntaxKind[SyntaxKind["FunctionKeyword"] = 27] = "FunctionKeyword"; - SyntaxKind[SyntaxKind["IfKeyword"] = 28] = "IfKeyword"; - SyntaxKind[SyntaxKind["InKeyword"] = 29] = "InKeyword"; - SyntaxKind[SyntaxKind["InstanceOfKeyword"] = 30] = "InstanceOfKeyword"; - SyntaxKind[SyntaxKind["NewKeyword"] = 31] = "NewKeyword"; - SyntaxKind[SyntaxKind["NullKeyword"] = 32] = "NullKeyword"; - SyntaxKind[SyntaxKind["ReturnKeyword"] = 33] = "ReturnKeyword"; - SyntaxKind[SyntaxKind["SwitchKeyword"] = 34] = "SwitchKeyword"; - SyntaxKind[SyntaxKind["ThisKeyword"] = 35] = "ThisKeyword"; - SyntaxKind[SyntaxKind["ThrowKeyword"] = 36] = "ThrowKeyword"; - SyntaxKind[SyntaxKind["TrueKeyword"] = 37] = "TrueKeyword"; - SyntaxKind[SyntaxKind["TryKeyword"] = 38] = "TryKeyword"; - SyntaxKind[SyntaxKind["TypeOfKeyword"] = 39] = "TypeOfKeyword"; - SyntaxKind[SyntaxKind["VarKeyword"] = 40] = "VarKeyword"; - SyntaxKind[SyntaxKind["VoidKeyword"] = 41] = "VoidKeyword"; - SyntaxKind[SyntaxKind["WhileKeyword"] = 42] = "WhileKeyword"; - SyntaxKind[SyntaxKind["WithKeyword"] = 43] = "WithKeyword"; - SyntaxKind[SyntaxKind["ClassKeyword"] = 44] = "ClassKeyword"; - SyntaxKind[SyntaxKind["ConstKeyword"] = 45] = "ConstKeyword"; - SyntaxKind[SyntaxKind["EnumKeyword"] = 46] = "EnumKeyword"; - SyntaxKind[SyntaxKind["ExportKeyword"] = 47] = "ExportKeyword"; - SyntaxKind[SyntaxKind["ExtendsKeyword"] = 48] = "ExtendsKeyword"; - SyntaxKind[SyntaxKind["ImportKeyword"] = 49] = "ImportKeyword"; - SyntaxKind[SyntaxKind["SuperKeyword"] = 50] = "SuperKeyword"; - SyntaxKind[SyntaxKind["ImplementsKeyword"] = 51] = "ImplementsKeyword"; - SyntaxKind[SyntaxKind["InterfaceKeyword"] = 52] = "InterfaceKeyword"; - SyntaxKind[SyntaxKind["LetKeyword"] = 53] = "LetKeyword"; - SyntaxKind[SyntaxKind["PackageKeyword"] = 54] = "PackageKeyword"; - SyntaxKind[SyntaxKind["PrivateKeyword"] = 55] = "PrivateKeyword"; - SyntaxKind[SyntaxKind["ProtectedKeyword"] = 56] = "ProtectedKeyword"; - SyntaxKind[SyntaxKind["PublicKeyword"] = 57] = "PublicKeyword"; - SyntaxKind[SyntaxKind["StaticKeyword"] = 58] = "StaticKeyword"; - SyntaxKind[SyntaxKind["YieldKeyword"] = 59] = "YieldKeyword"; - SyntaxKind[SyntaxKind["AnyKeyword"] = 60] = "AnyKeyword"; - SyntaxKind[SyntaxKind["BooleanKeyword"] = 61] = "BooleanKeyword"; - SyntaxKind[SyntaxKind["ConstructorKeyword"] = 62] = "ConstructorKeyword"; - SyntaxKind[SyntaxKind["DeclareKeyword"] = 63] = "DeclareKeyword"; - SyntaxKind[SyntaxKind["GetKeyword"] = 64] = "GetKeyword"; - SyntaxKind[SyntaxKind["ModuleKeyword"] = 65] = "ModuleKeyword"; - SyntaxKind[SyntaxKind["RequireKeyword"] = 66] = "RequireKeyword"; - SyntaxKind[SyntaxKind["NumberKeyword"] = 67] = "NumberKeyword"; - SyntaxKind[SyntaxKind["SetKeyword"] = 68] = "SetKeyword"; - SyntaxKind[SyntaxKind["StringKeyword"] = 69] = "StringKeyword"; - SyntaxKind[SyntaxKind["OpenBraceToken"] = 70] = "OpenBraceToken"; - SyntaxKind[SyntaxKind["CloseBraceToken"] = 71] = "CloseBraceToken"; - SyntaxKind[SyntaxKind["OpenParenToken"] = 72] = "OpenParenToken"; - SyntaxKind[SyntaxKind["CloseParenToken"] = 73] = "CloseParenToken"; - SyntaxKind[SyntaxKind["OpenBracketToken"] = 74] = "OpenBracketToken"; - SyntaxKind[SyntaxKind["CloseBracketToken"] = 75] = "CloseBracketToken"; - SyntaxKind[SyntaxKind["DotToken"] = 76] = "DotToken"; - SyntaxKind[SyntaxKind["DotDotDotToken"] = 77] = "DotDotDotToken"; - SyntaxKind[SyntaxKind["SemicolonToken"] = 78] = "SemicolonToken"; - SyntaxKind[SyntaxKind["CommaToken"] = 79] = "CommaToken"; - SyntaxKind[SyntaxKind["LessThanToken"] = 80] = "LessThanToken"; - SyntaxKind[SyntaxKind["GreaterThanToken"] = 81] = "GreaterThanToken"; - SyntaxKind[SyntaxKind["LessThanEqualsToken"] = 82] = "LessThanEqualsToken"; - SyntaxKind[SyntaxKind["GreaterThanEqualsToken"] = 83] = "GreaterThanEqualsToken"; - SyntaxKind[SyntaxKind["EqualsEqualsToken"] = 84] = "EqualsEqualsToken"; - SyntaxKind[SyntaxKind["EqualsGreaterThanToken"] = 85] = "EqualsGreaterThanToken"; - SyntaxKind[SyntaxKind["ExclamationEqualsToken"] = 86] = "ExclamationEqualsToken"; - SyntaxKind[SyntaxKind["EqualsEqualsEqualsToken"] = 87] = "EqualsEqualsEqualsToken"; - SyntaxKind[SyntaxKind["ExclamationEqualsEqualsToken"] = 88] = "ExclamationEqualsEqualsToken"; - SyntaxKind[SyntaxKind["PlusToken"] = 89] = "PlusToken"; - SyntaxKind[SyntaxKind["MinusToken"] = 90] = "MinusToken"; - SyntaxKind[SyntaxKind["AsteriskToken"] = 91] = "AsteriskToken"; - SyntaxKind[SyntaxKind["PercentToken"] = 92] = "PercentToken"; - SyntaxKind[SyntaxKind["PlusPlusToken"] = 93] = "PlusPlusToken"; - SyntaxKind[SyntaxKind["MinusMinusToken"] = 94] = "MinusMinusToken"; - SyntaxKind[SyntaxKind["LessThanLessThanToken"] = 95] = "LessThanLessThanToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanToken"] = 96] = "GreaterThanGreaterThanToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanToken"] = 97] = "GreaterThanGreaterThanGreaterThanToken"; - SyntaxKind[SyntaxKind["AmpersandToken"] = 98] = "AmpersandToken"; - SyntaxKind[SyntaxKind["BarToken"] = 99] = "BarToken"; - SyntaxKind[SyntaxKind["CaretToken"] = 100] = "CaretToken"; - SyntaxKind[SyntaxKind["ExclamationToken"] = 101] = "ExclamationToken"; - SyntaxKind[SyntaxKind["TildeToken"] = 102] = "TildeToken"; - SyntaxKind[SyntaxKind["AmpersandAmpersandToken"] = 103] = "AmpersandAmpersandToken"; - SyntaxKind[SyntaxKind["BarBarToken"] = 104] = "BarBarToken"; - SyntaxKind[SyntaxKind["QuestionToken"] = 105] = "QuestionToken"; - SyntaxKind[SyntaxKind["ColonToken"] = 106] = "ColonToken"; - SyntaxKind[SyntaxKind["EqualsToken"] = 107] = "EqualsToken"; - SyntaxKind[SyntaxKind["PlusEqualsToken"] = 108] = "PlusEqualsToken"; - SyntaxKind[SyntaxKind["MinusEqualsToken"] = 109] = "MinusEqualsToken"; - SyntaxKind[SyntaxKind["AsteriskEqualsToken"] = 110] = "AsteriskEqualsToken"; - SyntaxKind[SyntaxKind["PercentEqualsToken"] = 111] = "PercentEqualsToken"; - SyntaxKind[SyntaxKind["LessThanLessThanEqualsToken"] = 112] = "LessThanLessThanEqualsToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanEqualsToken"] = 113] = "GreaterThanGreaterThanEqualsToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanEqualsToken"] = 114] = "GreaterThanGreaterThanGreaterThanEqualsToken"; - SyntaxKind[SyntaxKind["AmpersandEqualsToken"] = 115] = "AmpersandEqualsToken"; - SyntaxKind[SyntaxKind["BarEqualsToken"] = 116] = "BarEqualsToken"; - SyntaxKind[SyntaxKind["CaretEqualsToken"] = 117] = "CaretEqualsToken"; - SyntaxKind[SyntaxKind["SlashToken"] = 118] = "SlashToken"; - SyntaxKind[SyntaxKind["SlashEqualsToken"] = 119] = "SlashEqualsToken"; - SyntaxKind[SyntaxKind["SourceUnit"] = 120] = "SourceUnit"; - SyntaxKind[SyntaxKind["QualifiedName"] = 121] = "QualifiedName"; - SyntaxKind[SyntaxKind["ObjectType"] = 122] = "ObjectType"; - SyntaxKind[SyntaxKind["FunctionType"] = 123] = "FunctionType"; - SyntaxKind[SyntaxKind["ArrayType"] = 124] = "ArrayType"; - SyntaxKind[SyntaxKind["ConstructorType"] = 125] = "ConstructorType"; - SyntaxKind[SyntaxKind["GenericType"] = 126] = "GenericType"; - SyntaxKind[SyntaxKind["TypeQuery"] = 127] = "TypeQuery"; - SyntaxKind[SyntaxKind["TupleType"] = 128] = "TupleType"; - SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 129] = "InterfaceDeclaration"; - SyntaxKind[SyntaxKind["FunctionDeclaration"] = 130] = "FunctionDeclaration"; - SyntaxKind[SyntaxKind["ModuleDeclaration"] = 131] = "ModuleDeclaration"; - SyntaxKind[SyntaxKind["ClassDeclaration"] = 132] = "ClassDeclaration"; - SyntaxKind[SyntaxKind["EnumDeclaration"] = 133] = "EnumDeclaration"; - SyntaxKind[SyntaxKind["ImportDeclaration"] = 134] = "ImportDeclaration"; - SyntaxKind[SyntaxKind["ExportAssignment"] = 135] = "ExportAssignment"; - SyntaxKind[SyntaxKind["MemberFunctionDeclaration"] = 136] = "MemberFunctionDeclaration"; - SyntaxKind[SyntaxKind["MemberVariableDeclaration"] = 137] = "MemberVariableDeclaration"; - SyntaxKind[SyntaxKind["ConstructorDeclaration"] = 138] = "ConstructorDeclaration"; - SyntaxKind[SyntaxKind["IndexMemberDeclaration"] = 139] = "IndexMemberDeclaration"; - SyntaxKind[SyntaxKind["GetAccessor"] = 140] = "GetAccessor"; - SyntaxKind[SyntaxKind["SetAccessor"] = 141] = "SetAccessor"; - SyntaxKind[SyntaxKind["PropertySignature"] = 142] = "PropertySignature"; - SyntaxKind[SyntaxKind["CallSignature"] = 143] = "CallSignature"; - SyntaxKind[SyntaxKind["ConstructSignature"] = 144] = "ConstructSignature"; - SyntaxKind[SyntaxKind["IndexSignature"] = 145] = "IndexSignature"; - SyntaxKind[SyntaxKind["MethodSignature"] = 146] = "MethodSignature"; - SyntaxKind[SyntaxKind["Block"] = 147] = "Block"; - SyntaxKind[SyntaxKind["IfStatement"] = 148] = "IfStatement"; - SyntaxKind[SyntaxKind["VariableStatement"] = 149] = "VariableStatement"; - SyntaxKind[SyntaxKind["ExpressionStatement"] = 150] = "ExpressionStatement"; - SyntaxKind[SyntaxKind["ReturnStatement"] = 151] = "ReturnStatement"; - SyntaxKind[SyntaxKind["SwitchStatement"] = 152] = "SwitchStatement"; - SyntaxKind[SyntaxKind["BreakStatement"] = 153] = "BreakStatement"; - SyntaxKind[SyntaxKind["ContinueStatement"] = 154] = "ContinueStatement"; - SyntaxKind[SyntaxKind["ForStatement"] = 155] = "ForStatement"; - SyntaxKind[SyntaxKind["ForInStatement"] = 156] = "ForInStatement"; - SyntaxKind[SyntaxKind["EmptyStatement"] = 157] = "EmptyStatement"; - SyntaxKind[SyntaxKind["ThrowStatement"] = 158] = "ThrowStatement"; - SyntaxKind[SyntaxKind["WhileStatement"] = 159] = "WhileStatement"; - SyntaxKind[SyntaxKind["TryStatement"] = 160] = "TryStatement"; - SyntaxKind[SyntaxKind["LabeledStatement"] = 161] = "LabeledStatement"; - SyntaxKind[SyntaxKind["DoStatement"] = 162] = "DoStatement"; - SyntaxKind[SyntaxKind["DebuggerStatement"] = 163] = "DebuggerStatement"; - SyntaxKind[SyntaxKind["WithStatement"] = 164] = "WithStatement"; - SyntaxKind[SyntaxKind["PlusExpression"] = 165] = "PlusExpression"; - SyntaxKind[SyntaxKind["NegateExpression"] = 166] = "NegateExpression"; - SyntaxKind[SyntaxKind["BitwiseNotExpression"] = 167] = "BitwiseNotExpression"; - SyntaxKind[SyntaxKind["LogicalNotExpression"] = 168] = "LogicalNotExpression"; - SyntaxKind[SyntaxKind["PreIncrementExpression"] = 169] = "PreIncrementExpression"; - SyntaxKind[SyntaxKind["PreDecrementExpression"] = 170] = "PreDecrementExpression"; - SyntaxKind[SyntaxKind["DeleteExpression"] = 171] = "DeleteExpression"; - SyntaxKind[SyntaxKind["TypeOfExpression"] = 172] = "TypeOfExpression"; - SyntaxKind[SyntaxKind["VoidExpression"] = 173] = "VoidExpression"; - SyntaxKind[SyntaxKind["CommaExpression"] = 174] = "CommaExpression"; - SyntaxKind[SyntaxKind["AssignmentExpression"] = 175] = "AssignmentExpression"; - SyntaxKind[SyntaxKind["AddAssignmentExpression"] = 176] = "AddAssignmentExpression"; - SyntaxKind[SyntaxKind["SubtractAssignmentExpression"] = 177] = "SubtractAssignmentExpression"; - SyntaxKind[SyntaxKind["MultiplyAssignmentExpression"] = 178] = "MultiplyAssignmentExpression"; - SyntaxKind[SyntaxKind["DivideAssignmentExpression"] = 179] = "DivideAssignmentExpression"; - SyntaxKind[SyntaxKind["ModuloAssignmentExpression"] = 180] = "ModuloAssignmentExpression"; - SyntaxKind[SyntaxKind["AndAssignmentExpression"] = 181] = "AndAssignmentExpression"; - SyntaxKind[SyntaxKind["ExclusiveOrAssignmentExpression"] = 182] = "ExclusiveOrAssignmentExpression"; - SyntaxKind[SyntaxKind["OrAssignmentExpression"] = 183] = "OrAssignmentExpression"; - SyntaxKind[SyntaxKind["LeftShiftAssignmentExpression"] = 184] = "LeftShiftAssignmentExpression"; - SyntaxKind[SyntaxKind["SignedRightShiftAssignmentExpression"] = 185] = "SignedRightShiftAssignmentExpression"; - SyntaxKind[SyntaxKind["UnsignedRightShiftAssignmentExpression"] = 186] = "UnsignedRightShiftAssignmentExpression"; - SyntaxKind[SyntaxKind["ConditionalExpression"] = 187] = "ConditionalExpression"; - SyntaxKind[SyntaxKind["LogicalOrExpression"] = 188] = "LogicalOrExpression"; - SyntaxKind[SyntaxKind["LogicalAndExpression"] = 189] = "LogicalAndExpression"; - SyntaxKind[SyntaxKind["BitwiseOrExpression"] = 190] = "BitwiseOrExpression"; - SyntaxKind[SyntaxKind["BitwiseExclusiveOrExpression"] = 191] = "BitwiseExclusiveOrExpression"; - SyntaxKind[SyntaxKind["BitwiseAndExpression"] = 192] = "BitwiseAndExpression"; - SyntaxKind[SyntaxKind["EqualsWithTypeConversionExpression"] = 193] = "EqualsWithTypeConversionExpression"; - SyntaxKind[SyntaxKind["NotEqualsWithTypeConversionExpression"] = 194] = "NotEqualsWithTypeConversionExpression"; - SyntaxKind[SyntaxKind["EqualsExpression"] = 195] = "EqualsExpression"; - SyntaxKind[SyntaxKind["NotEqualsExpression"] = 196] = "NotEqualsExpression"; - SyntaxKind[SyntaxKind["LessThanExpression"] = 197] = "LessThanExpression"; - SyntaxKind[SyntaxKind["GreaterThanExpression"] = 198] = "GreaterThanExpression"; - SyntaxKind[SyntaxKind["LessThanOrEqualExpression"] = 199] = "LessThanOrEqualExpression"; - SyntaxKind[SyntaxKind["GreaterThanOrEqualExpression"] = 200] = "GreaterThanOrEqualExpression"; - SyntaxKind[SyntaxKind["InstanceOfExpression"] = 201] = "InstanceOfExpression"; - SyntaxKind[SyntaxKind["InExpression"] = 202] = "InExpression"; - SyntaxKind[SyntaxKind["LeftShiftExpression"] = 203] = "LeftShiftExpression"; - SyntaxKind[SyntaxKind["SignedRightShiftExpression"] = 204] = "SignedRightShiftExpression"; - SyntaxKind[SyntaxKind["UnsignedRightShiftExpression"] = 205] = "UnsignedRightShiftExpression"; - SyntaxKind[SyntaxKind["MultiplyExpression"] = 206] = "MultiplyExpression"; - SyntaxKind[SyntaxKind["DivideExpression"] = 207] = "DivideExpression"; - SyntaxKind[SyntaxKind["ModuloExpression"] = 208] = "ModuloExpression"; - SyntaxKind[SyntaxKind["AddExpression"] = 209] = "AddExpression"; - SyntaxKind[SyntaxKind["SubtractExpression"] = 210] = "SubtractExpression"; - SyntaxKind[SyntaxKind["PostIncrementExpression"] = 211] = "PostIncrementExpression"; - SyntaxKind[SyntaxKind["PostDecrementExpression"] = 212] = "PostDecrementExpression"; - SyntaxKind[SyntaxKind["MemberAccessExpression"] = 213] = "MemberAccessExpression"; - SyntaxKind[SyntaxKind["InvocationExpression"] = 214] = "InvocationExpression"; - SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 215] = "ArrayLiteralExpression"; - SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 216] = "ObjectLiteralExpression"; - SyntaxKind[SyntaxKind["ObjectCreationExpression"] = 217] = "ObjectCreationExpression"; - SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 218] = "ParenthesizedExpression"; - SyntaxKind[SyntaxKind["ParenthesizedArrowFunctionExpression"] = 219] = "ParenthesizedArrowFunctionExpression"; - SyntaxKind[SyntaxKind["SimpleArrowFunctionExpression"] = 220] = "SimpleArrowFunctionExpression"; - SyntaxKind[SyntaxKind["CastExpression"] = 221] = "CastExpression"; - SyntaxKind[SyntaxKind["ElementAccessExpression"] = 222] = "ElementAccessExpression"; - SyntaxKind[SyntaxKind["FunctionExpression"] = 223] = "FunctionExpression"; - SyntaxKind[SyntaxKind["OmittedExpression"] = 224] = "OmittedExpression"; - SyntaxKind[SyntaxKind["VariableDeclaration"] = 225] = "VariableDeclaration"; - SyntaxKind[SyntaxKind["VariableDeclarator"] = 226] = "VariableDeclarator"; - SyntaxKind[SyntaxKind["ArgumentList"] = 227] = "ArgumentList"; - SyntaxKind[SyntaxKind["ParameterList"] = 228] = "ParameterList"; - SyntaxKind[SyntaxKind["TypeArgumentList"] = 229] = "TypeArgumentList"; - SyntaxKind[SyntaxKind["TypeParameterList"] = 230] = "TypeParameterList"; - SyntaxKind[SyntaxKind["ExtendsHeritageClause"] = 231] = "ExtendsHeritageClause"; - SyntaxKind[SyntaxKind["ImplementsHeritageClause"] = 232] = "ImplementsHeritageClause"; - SyntaxKind[SyntaxKind["EqualsValueClause"] = 233] = "EqualsValueClause"; - SyntaxKind[SyntaxKind["CaseSwitchClause"] = 234] = "CaseSwitchClause"; - SyntaxKind[SyntaxKind["DefaultSwitchClause"] = 235] = "DefaultSwitchClause"; - SyntaxKind[SyntaxKind["ElseClause"] = 236] = "ElseClause"; - SyntaxKind[SyntaxKind["CatchClause"] = 237] = "CatchClause"; - SyntaxKind[SyntaxKind["FinallyClause"] = 238] = "FinallyClause"; - SyntaxKind[SyntaxKind["TypeParameter"] = 239] = "TypeParameter"; - SyntaxKind[SyntaxKind["Constraint"] = 240] = "Constraint"; - SyntaxKind[SyntaxKind["SimplePropertyAssignment"] = 241] = "SimplePropertyAssignment"; - SyntaxKind[SyntaxKind["FunctionPropertyAssignment"] = 242] = "FunctionPropertyAssignment"; - SyntaxKind[SyntaxKind["Parameter"] = 243] = "Parameter"; - SyntaxKind[SyntaxKind["EnumElement"] = 244] = "EnumElement"; - SyntaxKind[SyntaxKind["TypeAnnotation"] = 245] = "TypeAnnotation"; - SyntaxKind[SyntaxKind["ExternalModuleReference"] = 246] = "ExternalModuleReference"; - SyntaxKind[SyntaxKind["ModuleNameModuleReference"] = 247] = "ModuleNameModuleReference"; - SyntaxKind[SyntaxKind["FirstStandardKeyword"] = SyntaxKind.BreakKeyword] = "FirstStandardKeyword"; - SyntaxKind[SyntaxKind["LastStandardKeyword"] = SyntaxKind.WithKeyword] = "LastStandardKeyword"; - SyntaxKind[SyntaxKind["FirstFutureReservedKeyword"] = SyntaxKind.ClassKeyword] = "FirstFutureReservedKeyword"; - SyntaxKind[SyntaxKind["LastFutureReservedKeyword"] = SyntaxKind.SuperKeyword] = "LastFutureReservedKeyword"; - SyntaxKind[SyntaxKind["FirstFutureReservedStrictKeyword"] = SyntaxKind.ImplementsKeyword] = "FirstFutureReservedStrictKeyword"; - SyntaxKind[SyntaxKind["LastFutureReservedStrictKeyword"] = SyntaxKind.YieldKeyword] = "LastFutureReservedStrictKeyword"; - SyntaxKind[SyntaxKind["FirstTypeScriptKeyword"] = SyntaxKind.AnyKeyword] = "FirstTypeScriptKeyword"; - SyntaxKind[SyntaxKind["LastTypeScriptKeyword"] = SyntaxKind.StringKeyword] = "LastTypeScriptKeyword"; - SyntaxKind[SyntaxKind["FirstKeyword"] = SyntaxKind.FirstStandardKeyword] = "FirstKeyword"; - SyntaxKind[SyntaxKind["LastKeyword"] = SyntaxKind.LastTypeScriptKeyword] = "LastKeyword"; - SyntaxKind[SyntaxKind["FirstToken"] = SyntaxKind.ErrorToken] = "FirstToken"; - SyntaxKind[SyntaxKind["LastToken"] = SyntaxKind.SlashEqualsToken] = "LastToken"; - SyntaxKind[SyntaxKind["FirstPunctuation"] = SyntaxKind.OpenBraceToken] = "FirstPunctuation"; - SyntaxKind[SyntaxKind["LastPunctuation"] = SyntaxKind.SlashEqualsToken] = "LastPunctuation"; - SyntaxKind[SyntaxKind["FirstFixedWidth"] = SyntaxKind.FirstKeyword] = "FirstFixedWidth"; - SyntaxKind[SyntaxKind["LastFixedWidth"] = SyntaxKind.LastPunctuation] = "LastFixedWidth"; - SyntaxKind[SyntaxKind["FirstTrivia"] = SyntaxKind.WhitespaceTrivia] = "FirstTrivia"; - SyntaxKind[SyntaxKind["LastTrivia"] = SyntaxKind.SkippedTokenTrivia] = "LastTrivia"; - SyntaxKind[SyntaxKind["FirstNode"] = SyntaxKind.SourceUnit] = "FirstNode"; - SyntaxKind[SyntaxKind["LastNode"] = SyntaxKind.ModuleNameModuleReference] = "LastNode"; - })(TypeScript.SyntaxKind || (TypeScript.SyntaxKind = {})); - var SyntaxKind = TypeScript.SyntaxKind; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var SyntaxFacts; - (function (SyntaxFacts) { - var textToKeywordKind = { - "any": 60 /* AnyKeyword */, - "boolean": 61 /* BooleanKeyword */, - "break": 15 /* BreakKeyword */, - "case": 16 /* CaseKeyword */, - "catch": 17 /* CatchKeyword */, - "class": 44 /* ClassKeyword */, - "continue": 18 /* ContinueKeyword */, - "const": 45 /* ConstKeyword */, - "constructor": 62 /* ConstructorKeyword */, - "debugger": 19 /* DebuggerKeyword */, - "declare": 63 /* DeclareKeyword */, - "default": 20 /* DefaultKeyword */, - "delete": 21 /* DeleteKeyword */, - "do": 22 /* DoKeyword */, - "else": 23 /* ElseKeyword */, - "enum": 46 /* EnumKeyword */, - "export": 47 /* ExportKeyword */, - "extends": 48 /* ExtendsKeyword */, - "false": 24 /* FalseKeyword */, - "finally": 25 /* FinallyKeyword */, - "for": 26 /* ForKeyword */, - "function": 27 /* FunctionKeyword */, - "get": 64 /* GetKeyword */, - "if": 28 /* IfKeyword */, - "implements": 51 /* ImplementsKeyword */, - "import": 49 /* ImportKeyword */, - "in": 29 /* InKeyword */, - "instanceof": 30 /* InstanceOfKeyword */, - "interface": 52 /* InterfaceKeyword */, - "let": 53 /* LetKeyword */, - "module": 65 /* ModuleKeyword */, - "new": 31 /* NewKeyword */, - "null": 32 /* NullKeyword */, - "number": 67 /* NumberKeyword */, - "package": 54 /* PackageKeyword */, - "private": 55 /* PrivateKeyword */, - "protected": 56 /* ProtectedKeyword */, - "public": 57 /* PublicKeyword */, - "require": 66 /* RequireKeyword */, - "return": 33 /* ReturnKeyword */, - "set": 68 /* SetKeyword */, - "static": 58 /* StaticKeyword */, - "string": 69 /* StringKeyword */, - "super": 50 /* SuperKeyword */, - "switch": 34 /* SwitchKeyword */, - "this": 35 /* ThisKeyword */, - "throw": 36 /* ThrowKeyword */, - "true": 37 /* TrueKeyword */, - "try": 38 /* TryKeyword */, - "typeof": 39 /* TypeOfKeyword */, - "var": 40 /* VarKeyword */, - "void": 41 /* VoidKeyword */, - "while": 42 /* WhileKeyword */, - "with": 43 /* WithKeyword */, - "yield": 59 /* YieldKeyword */, - "{": 70 /* OpenBraceToken */, - "}": 71 /* CloseBraceToken */, - "(": 72 /* OpenParenToken */, - ")": 73 /* CloseParenToken */, - "[": 74 /* OpenBracketToken */, - "]": 75 /* CloseBracketToken */, - ".": 76 /* DotToken */, - "...": 77 /* DotDotDotToken */, - ";": 78 /* SemicolonToken */, - ",": 79 /* CommaToken */, - "<": 80 /* LessThanToken */, - ">": 81 /* GreaterThanToken */, - "<=": 82 /* LessThanEqualsToken */, - ">=": 83 /* GreaterThanEqualsToken */, - "==": 84 /* EqualsEqualsToken */, - "=>": 85 /* EqualsGreaterThanToken */, - "!=": 86 /* ExclamationEqualsToken */, - "===": 87 /* EqualsEqualsEqualsToken */, - "!==": 88 /* ExclamationEqualsEqualsToken */, - "+": 89 /* PlusToken */, - "-": 90 /* MinusToken */, - "*": 91 /* AsteriskToken */, - "%": 92 /* PercentToken */, - "++": 93 /* PlusPlusToken */, - "--": 94 /* MinusMinusToken */, - "<<": 95 /* LessThanLessThanToken */, - ">>": 96 /* GreaterThanGreaterThanToken */, - ">>>": 97 /* GreaterThanGreaterThanGreaterThanToken */, - "&": 98 /* AmpersandToken */, - "|": 99 /* BarToken */, - "^": 100 /* CaretToken */, - "!": 101 /* ExclamationToken */, - "~": 102 /* TildeToken */, - "&&": 103 /* AmpersandAmpersandToken */, - "||": 104 /* BarBarToken */, - "?": 105 /* QuestionToken */, - ":": 106 /* ColonToken */, - "=": 107 /* EqualsToken */, - "+=": 108 /* PlusEqualsToken */, - "-=": 109 /* MinusEqualsToken */, - "*=": 110 /* AsteriskEqualsToken */, - "%=": 111 /* PercentEqualsToken */, - "<<=": 112 /* LessThanLessThanEqualsToken */, - ">>=": 113 /* GreaterThanGreaterThanEqualsToken */, - ">>>=": 114 /* GreaterThanGreaterThanGreaterThanEqualsToken */, - "&=": 115 /* AmpersandEqualsToken */, - "|=": 116 /* BarEqualsToken */, - "^=": 117 /* CaretEqualsToken */, - "/": 118 /* SlashToken */, - "/=": 119 /* SlashEqualsToken */ - }; - var kindToText = new Array(); - for (var name in textToKeywordKind) { - if (textToKeywordKind.hasOwnProperty(name)) { - kindToText[textToKeywordKind[name]] = name; - } - } - kindToText[62 /* ConstructorKeyword */] = "constructor"; - function getTokenKind(text) { - if (textToKeywordKind.hasOwnProperty(text)) { - return textToKeywordKind[text]; - } - return 0 /* None */; - } - SyntaxFacts.getTokenKind = getTokenKind; - function getText(kind) { - var result = kindToText[kind]; - return result !== undefined ? result : null; - } - SyntaxFacts.getText = getText; - function isAnyKeyword(kind) { - return kind >= TypeScript.SyntaxKind.FirstKeyword && kind <= TypeScript.SyntaxKind.LastKeyword; - } - SyntaxFacts.isAnyKeyword = isAnyKeyword; - function isAnyPunctuation(kind) { - return kind >= TypeScript.SyntaxKind.FirstPunctuation && kind <= TypeScript.SyntaxKind.LastPunctuation; - } - SyntaxFacts.isAnyPunctuation = isAnyPunctuation; - function isPrefixUnaryExpressionOperatorToken(tokenKind) { - return getPrefixUnaryExpressionFromOperatorToken(tokenKind) !== 0 /* None */; - } - SyntaxFacts.isPrefixUnaryExpressionOperatorToken = isPrefixUnaryExpressionOperatorToken; - function isBinaryExpressionOperatorToken(tokenKind) { - return getBinaryExpressionFromOperatorToken(tokenKind) !== 0 /* None */; - } - SyntaxFacts.isBinaryExpressionOperatorToken = isBinaryExpressionOperatorToken; - function getPrefixUnaryExpressionFromOperatorToken(tokenKind) { - switch (tokenKind) { - case 89 /* PlusToken */: - return 165 /* PlusExpression */; - case 90 /* MinusToken */: - return 166 /* NegateExpression */; - case 102 /* TildeToken */: - return 167 /* BitwiseNotExpression */; - case 101 /* ExclamationToken */: - return 168 /* LogicalNotExpression */; - case 93 /* PlusPlusToken */: - return 169 /* PreIncrementExpression */; - case 94 /* MinusMinusToken */: - return 170 /* PreDecrementExpression */; - default: - return 0 /* None */; - } - } - SyntaxFacts.getPrefixUnaryExpressionFromOperatorToken = getPrefixUnaryExpressionFromOperatorToken; - function getPostfixUnaryExpressionFromOperatorToken(tokenKind) { - switch (tokenKind) { - case 93 /* PlusPlusToken */: - return 211 /* PostIncrementExpression */; - case 94 /* MinusMinusToken */: - return 212 /* PostDecrementExpression */; - default: - return 0 /* None */; - } - } - SyntaxFacts.getPostfixUnaryExpressionFromOperatorToken = getPostfixUnaryExpressionFromOperatorToken; - function getBinaryExpressionFromOperatorToken(tokenKind) { - switch (tokenKind) { - case 91 /* AsteriskToken */: - return 206 /* MultiplyExpression */; - case 118 /* SlashToken */: - return 207 /* DivideExpression */; - case 92 /* PercentToken */: - return 208 /* ModuloExpression */; - case 89 /* PlusToken */: - return 209 /* AddExpression */; - case 90 /* MinusToken */: - return 210 /* SubtractExpression */; - case 95 /* LessThanLessThanToken */: - return 203 /* LeftShiftExpression */; - case 96 /* GreaterThanGreaterThanToken */: - return 204 /* SignedRightShiftExpression */; - case 97 /* GreaterThanGreaterThanGreaterThanToken */: - return 205 /* UnsignedRightShiftExpression */; - case 80 /* LessThanToken */: - return 197 /* LessThanExpression */; - case 81 /* GreaterThanToken */: - return 198 /* GreaterThanExpression */; - case 82 /* LessThanEqualsToken */: - return 199 /* LessThanOrEqualExpression */; - case 83 /* GreaterThanEqualsToken */: - return 200 /* GreaterThanOrEqualExpression */; - case 30 /* InstanceOfKeyword */: - return 201 /* InstanceOfExpression */; - case 29 /* InKeyword */: - return 202 /* InExpression */; - case 84 /* EqualsEqualsToken */: - return 193 /* EqualsWithTypeConversionExpression */; - case 86 /* ExclamationEqualsToken */: - return 194 /* NotEqualsWithTypeConversionExpression */; - case 87 /* EqualsEqualsEqualsToken */: - return 195 /* EqualsExpression */; - case 88 /* ExclamationEqualsEqualsToken */: - return 196 /* NotEqualsExpression */; - case 98 /* AmpersandToken */: - return 192 /* BitwiseAndExpression */; - case 100 /* CaretToken */: - return 191 /* BitwiseExclusiveOrExpression */; - case 99 /* BarToken */: - return 190 /* BitwiseOrExpression */; - case 103 /* AmpersandAmpersandToken */: - return 189 /* LogicalAndExpression */; - case 104 /* BarBarToken */: - return 188 /* LogicalOrExpression */; - case 116 /* BarEqualsToken */: - return 183 /* OrAssignmentExpression */; - case 115 /* AmpersandEqualsToken */: - return 181 /* AndAssignmentExpression */; - case 117 /* CaretEqualsToken */: - return 182 /* ExclusiveOrAssignmentExpression */; - case 112 /* LessThanLessThanEqualsToken */: - return 184 /* LeftShiftAssignmentExpression */; - case 113 /* GreaterThanGreaterThanEqualsToken */: - return 185 /* SignedRightShiftAssignmentExpression */; - case 114 /* GreaterThanGreaterThanGreaterThanEqualsToken */: - return 186 /* UnsignedRightShiftAssignmentExpression */; - case 108 /* PlusEqualsToken */: - return 176 /* AddAssignmentExpression */; - case 109 /* MinusEqualsToken */: - return 177 /* SubtractAssignmentExpression */; - case 110 /* AsteriskEqualsToken */: - return 178 /* MultiplyAssignmentExpression */; - case 119 /* SlashEqualsToken */: - return 179 /* DivideAssignmentExpression */; - case 111 /* PercentEqualsToken */: - return 180 /* ModuloAssignmentExpression */; - case 107 /* EqualsToken */: - return 175 /* AssignmentExpression */; - case 79 /* CommaToken */: - return 174 /* CommaExpression */; - default: - return 0 /* None */; - } - } - SyntaxFacts.getBinaryExpressionFromOperatorToken = getBinaryExpressionFromOperatorToken; - function getOperatorTokenFromBinaryExpression(tokenKind) { - switch (tokenKind) { - case 206 /* MultiplyExpression */: - return 91 /* AsteriskToken */; - case 207 /* DivideExpression */: - return 118 /* SlashToken */; - case 208 /* ModuloExpression */: - return 92 /* PercentToken */; - case 209 /* AddExpression */: - return 89 /* PlusToken */; - case 210 /* SubtractExpression */: - return 90 /* MinusToken */; - case 203 /* LeftShiftExpression */: - return 95 /* LessThanLessThanToken */; - case 204 /* SignedRightShiftExpression */: - return 96 /* GreaterThanGreaterThanToken */; - case 205 /* UnsignedRightShiftExpression */: - return 97 /* GreaterThanGreaterThanGreaterThanToken */; - case 197 /* LessThanExpression */: - return 80 /* LessThanToken */; - case 198 /* GreaterThanExpression */: - return 81 /* GreaterThanToken */; - case 199 /* LessThanOrEqualExpression */: - return 82 /* LessThanEqualsToken */; - case 200 /* GreaterThanOrEqualExpression */: - return 83 /* GreaterThanEqualsToken */; - case 201 /* InstanceOfExpression */: - return 30 /* InstanceOfKeyword */; - case 202 /* InExpression */: - return 29 /* InKeyword */; - case 193 /* EqualsWithTypeConversionExpression */: - return 84 /* EqualsEqualsToken */; - case 194 /* NotEqualsWithTypeConversionExpression */: - return 86 /* ExclamationEqualsToken */; - case 195 /* EqualsExpression */: - return 87 /* EqualsEqualsEqualsToken */; - case 196 /* NotEqualsExpression */: - return 88 /* ExclamationEqualsEqualsToken */; - case 192 /* BitwiseAndExpression */: - return 98 /* AmpersandToken */; - case 191 /* BitwiseExclusiveOrExpression */: - return 100 /* CaretToken */; - case 190 /* BitwiseOrExpression */: - return 99 /* BarToken */; - case 189 /* LogicalAndExpression */: - return 103 /* AmpersandAmpersandToken */; - case 188 /* LogicalOrExpression */: - return 104 /* BarBarToken */; - case 183 /* OrAssignmentExpression */: - return 116 /* BarEqualsToken */; - case 181 /* AndAssignmentExpression */: - return 115 /* AmpersandEqualsToken */; - case 182 /* ExclusiveOrAssignmentExpression */: - return 117 /* CaretEqualsToken */; - case 184 /* LeftShiftAssignmentExpression */: - return 112 /* LessThanLessThanEqualsToken */; - case 185 /* SignedRightShiftAssignmentExpression */: - return 113 /* GreaterThanGreaterThanEqualsToken */; - case 186 /* UnsignedRightShiftAssignmentExpression */: - return 114 /* GreaterThanGreaterThanGreaterThanEqualsToken */; - case 176 /* AddAssignmentExpression */: - return 108 /* PlusEqualsToken */; - case 177 /* SubtractAssignmentExpression */: - return 109 /* MinusEqualsToken */; - case 178 /* MultiplyAssignmentExpression */: - return 110 /* AsteriskEqualsToken */; - case 179 /* DivideAssignmentExpression */: - return 119 /* SlashEqualsToken */; - case 180 /* ModuloAssignmentExpression */: - return 111 /* PercentEqualsToken */; - case 175 /* AssignmentExpression */: - return 107 /* EqualsToken */; - case 174 /* CommaExpression */: - return 79 /* CommaToken */; - default: - return 0 /* None */; - } - } - SyntaxFacts.getOperatorTokenFromBinaryExpression = getOperatorTokenFromBinaryExpression; - function isAssignmentOperatorToken(tokenKind) { - switch (tokenKind) { - case 116 /* BarEqualsToken */: - case 115 /* AmpersandEqualsToken */: - case 117 /* CaretEqualsToken */: - case 112 /* LessThanLessThanEqualsToken */: - case 113 /* GreaterThanGreaterThanEqualsToken */: - case 114 /* GreaterThanGreaterThanGreaterThanEqualsToken */: - case 108 /* PlusEqualsToken */: - case 109 /* MinusEqualsToken */: - case 110 /* AsteriskEqualsToken */: - case 119 /* SlashEqualsToken */: - case 111 /* PercentEqualsToken */: - case 107 /* EqualsToken */: - return true; - default: - return false; - } - } - SyntaxFacts.isAssignmentOperatorToken = isAssignmentOperatorToken; - function isType(kind) { - switch (kind) { - case 124 /* ArrayType */: - case 60 /* AnyKeyword */: - case 67 /* NumberKeyword */: - case 61 /* BooleanKeyword */: - case 69 /* StringKeyword */: - case 41 /* VoidKeyword */: - case 123 /* FunctionType */: - case 122 /* ObjectType */: - case 125 /* ConstructorType */: - case 127 /* TypeQuery */: - case 126 /* GenericType */: - case 121 /* QualifiedName */: - case 11 /* IdentifierName */: - return true; - } - return false; - } - SyntaxFacts.isType = isType; - })(SyntaxFacts = TypeScript.SyntaxFacts || (TypeScript.SyntaxFacts = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Scanner; - (function (Scanner) { - TypeScript.Debug.assert(TypeScript.SyntaxKind.LastToken <= 127); - var ScannerConstants; - (function (ScannerConstants) { - ScannerConstants[ScannerConstants["LargeTokenFullStartShift"] = 4] = "LargeTokenFullStartShift"; - ScannerConstants[ScannerConstants["LargeTokenFullWidthShift"] = 7] = "LargeTokenFullWidthShift"; - ScannerConstants[ScannerConstants["LargeTokenLeadingTriviaBitMask"] = 0x01] = "LargeTokenLeadingTriviaBitMask"; - ScannerConstants[ScannerConstants["LargeTokenLeadingCommentBitMask"] = 0x02] = "LargeTokenLeadingCommentBitMask"; - ScannerConstants[ScannerConstants["LargeTokenTrailingTriviaBitMask"] = 0x04] = "LargeTokenTrailingTriviaBitMask"; - ScannerConstants[ScannerConstants["LargeTokenTrailingCommentBitMask"] = 0x08] = "LargeTokenTrailingCommentBitMask"; - ScannerConstants[ScannerConstants["LargeTokenTriviaBitMask"] = 0x0F] = "LargeTokenTriviaBitMask"; - ScannerConstants[ScannerConstants["FixedWidthTokenFullStartShift"] = 7] = "FixedWidthTokenFullStartShift"; - ScannerConstants[ScannerConstants["FixedWidthTokenMaxFullStart"] = 0x7FFFFF] = "FixedWidthTokenMaxFullStart"; - ScannerConstants[ScannerConstants["SmallTokenFullWidthShift"] = 7] = "SmallTokenFullWidthShift"; - ScannerConstants[ScannerConstants["SmallTokenFullStartShift"] = 12] = "SmallTokenFullStartShift"; - ScannerConstants[ScannerConstants["SmallTokenMaxFullStart"] = 0x3FFFF] = "SmallTokenMaxFullStart"; - ScannerConstants[ScannerConstants["SmallTokenMaxFullWidth"] = 0x1F] = "SmallTokenMaxFullWidth"; - ScannerConstants[ScannerConstants["SmallTokenFullWidthMask"] = 0x1F] = "SmallTokenFullWidthMask"; - ScannerConstants[ScannerConstants["KindMask"] = 0x7F] = "KindMask"; - ScannerConstants[ScannerConstants["IsVariableWidthMask"] = 0x80] = "IsVariableWidthMask"; - })(ScannerConstants || (ScannerConstants = {})); - TypeScript.Debug.assert(largeTokenUnpackFullStart(largeTokenPackFullStartAndInfo(1 << 26, 3)) === (1 << 26)); - TypeScript.Debug.assert(largeTokenUnpackFullStart(largeTokenPackFullStartAndInfo(3 << 25, 1)) === (3 << 25)); - TypeScript.Debug.assert(largeTokenUnpackFullStart(largeTokenPackFullStartAndInfo(10 << 23, 2)) === (10 << 23)); - function fixedWidthTokenPackData(fullStart, kind) { - return (fullStart << 7 /* FixedWidthTokenFullStartShift */) | kind; - } - function fixedWidthTokenUnpackFullStart(packedData) { - return packedData >> 7 /* FixedWidthTokenFullStartShift */; - } - function smallTokenPackData(fullStart, fullWidth, kind) { - return (fullStart << 12 /* SmallTokenFullStartShift */) | (fullWidth << 7 /* SmallTokenFullWidthShift */) | kind; - } - function smallTokenUnpackFullWidth(packedData) { - return (packedData >> 7 /* SmallTokenFullWidthShift */) & 31 /* SmallTokenFullWidthMask */; - } - function smallTokenUnpackFullStart(packedData) { - return packedData >> 12 /* SmallTokenFullStartShift */; - } - function largeTokenPackFullStartAndInfo(fullStart, triviaInfo) { - return (fullStart << 4 /* LargeTokenFullStartShift */) | triviaInfo; - } - function largeTokenUnpackFullWidth(packedFullWidthAndKind) { - return packedFullWidthAndKind >> 7 /* LargeTokenFullWidthShift */; - } - function largeTokenUnpackFullStart(packedFullStartAndInfo) { - return packedFullStartAndInfo >> 4 /* LargeTokenFullStartShift */; - } - function largeTokenUnpackHasLeadingTrivia(packed) { - return (packed & 1 /* LargeTokenLeadingTriviaBitMask */) !== 0; - } - function largeTokenUnpackHasTrailingTrivia(packed) { - return (packed & 4 /* LargeTokenTrailingTriviaBitMask */) !== 0; - } - function largeTokenUnpackHasLeadingComment(packed) { - return (packed & 2 /* LargeTokenLeadingCommentBitMask */) !== 0; - } - function largeTokenUnpackHasTrailingComment(packed) { - return (packed & 8 /* LargeTokenTrailingCommentBitMask */) !== 0; - } - function largeTokenUnpackTriviaInfo(packed) { - return packed & 15 /* LargeTokenTriviaBitMask */; - } - var isKeywordStartCharacter = TypeScript.ArrayUtilities.createArray(127 /* maxAsciiCharacter */, 0); - var isIdentifierStartCharacter = TypeScript.ArrayUtilities.createArray(127 /* maxAsciiCharacter */, false); - var isIdentifierPartCharacter = TypeScript.ArrayUtilities.createArray(127 /* maxAsciiCharacter */, false); - for (var character = 0; character < 127 /* maxAsciiCharacter */; character++) { - if ((character >= 97 /* a */ && character <= 122 /* z */) || (character >= 65 /* A */ && character <= 90 /* Z */) || character === 95 /* _ */ || character === 36 /* $ */) { - isIdentifierStartCharacter[character] = true; - isIdentifierPartCharacter[character] = true; - } - else if (character >= 48 /* _0 */ && character <= 57 /* _9 */) { - isIdentifierPartCharacter[character] = true; - } - } - for (var keywordKind = TypeScript.SyntaxKind.FirstKeyword; keywordKind <= TypeScript.SyntaxKind.LastKeyword; keywordKind++) { - var keyword = TypeScript.SyntaxFacts.getText(keywordKind); - isKeywordStartCharacter[keyword.charCodeAt(0)] = 1; - } - function isContextualToken(token) { - switch (token.kind()) { - case 12 /* RegularExpressionLiteral */: - case 96 /* GreaterThanGreaterThanToken */: - case 97 /* GreaterThanGreaterThanGreaterThanToken */: - case 83 /* GreaterThanEqualsToken */: - case 113 /* GreaterThanGreaterThanEqualsToken */: - case 114 /* GreaterThanGreaterThanGreaterThanEqualsToken */: - return true; - default: - return token.isKeywordConvertedToIdentifier(); - } - } - Scanner.isContextualToken = isContextualToken; - var lastTokenInfo = { leadingTriviaWidth: -1, width: -1 }; - var lastTokenInfoTokenID = -1; - var triviaScanner = createScannerInternal(1 /* ES5 */, TypeScript.SimpleText.fromString(""), function () { - }); - function fillSizeInfo(token, text) { - if (lastTokenInfoTokenID !== TypeScript.syntaxID(token)) { - triviaScanner.fillTokenInfo(token, text, lastTokenInfo); - lastTokenInfoTokenID = TypeScript.syntaxID(token); - } - } - function fullText(token, text) { - return text.substr(token.fullStart(), token.fullWidth()); - } - function leadingTrivia(token, text) { - if (!token.hasLeadingTrivia()) { - return TypeScript.Syntax.emptyTriviaList; - } - return triviaScanner.scanTrivia(token, text, false); - } - function trailingTrivia(token, text) { - if (!token.hasTrailingTrivia()) { - return TypeScript.Syntax.emptyTriviaList; - } - return triviaScanner.scanTrivia(token, text, true); - } - function leadingTriviaWidth(token, text) { - if (!token.hasLeadingTrivia()) { - return 0; - } - fillSizeInfo(token, text); - return lastTokenInfo.leadingTriviaWidth; - } - function trailingTriviaWidth(token, text) { - if (!token.hasTrailingTrivia()) { - return 0; - } - fillSizeInfo(token, text); - return token.fullWidth() - lastTokenInfo.leadingTriviaWidth - lastTokenInfo.width; - } - function tokenIsIncrementallyUnusable(token) { - return false; - } - var FixedWidthTokenWithNoTrivia = (function () { - function FixedWidthTokenWithNoTrivia(_packedData) { - this._packedData = _packedData; - } - FixedWidthTokenWithNoTrivia.prototype.setFullStart = function (fullStart) { - this._packedData = fixedWidthTokenPackData(fullStart, this.kind()); - }; - FixedWidthTokenWithNoTrivia.prototype.isIncrementallyUnusable = function () { - return false; - }; - FixedWidthTokenWithNoTrivia.prototype.isKeywordConvertedToIdentifier = function () { - return false; - }; - FixedWidthTokenWithNoTrivia.prototype.hasSkippedToken = function () { - return false; - }; - FixedWidthTokenWithNoTrivia.prototype.fullText = function () { - return TypeScript.SyntaxFacts.getText(this.kind()); - }; - FixedWidthTokenWithNoTrivia.prototype.text = function () { - return this.fullText(); - }; - FixedWidthTokenWithNoTrivia.prototype.leadingTrivia = function () { - return TypeScript.Syntax.emptyTriviaList; - }; - FixedWidthTokenWithNoTrivia.prototype.trailingTrivia = function () { - return TypeScript.Syntax.emptyTriviaList; - }; - FixedWidthTokenWithNoTrivia.prototype.leadingTriviaWidth = function () { - return 0; - }; - FixedWidthTokenWithNoTrivia.prototype.trailingTriviaWidth = function () { - return 0; - }; - FixedWidthTokenWithNoTrivia.prototype.kind = function () { - return this._packedData & 127 /* KindMask */; - }; - FixedWidthTokenWithNoTrivia.prototype.fullWidth = function () { - return this.fullText().length; - }; - FixedWidthTokenWithNoTrivia.prototype.fullStart = function () { - return fixedWidthTokenUnpackFullStart(this._packedData); - }; - FixedWidthTokenWithNoTrivia.prototype.hasLeadingTrivia = function () { - return false; - }; - FixedWidthTokenWithNoTrivia.prototype.hasTrailingTrivia = function () { - return false; - }; - FixedWidthTokenWithNoTrivia.prototype.hasLeadingComment = function () { - return false; - }; - FixedWidthTokenWithNoTrivia.prototype.hasTrailingComment = function () { - return false; - }; - FixedWidthTokenWithNoTrivia.prototype.clone = function () { - return new FixedWidthTokenWithNoTrivia(this._packedData); - }; - return FixedWidthTokenWithNoTrivia; - })(); - var LargeScannerToken = (function () { - function LargeScannerToken(_packedFullStartAndInfo, _packedFullWidthAndKind, cachedText) { - this._packedFullStartAndInfo = _packedFullStartAndInfo; - this._packedFullWidthAndKind = _packedFullWidthAndKind; - if (cachedText !== undefined) { - this.cachedText = cachedText; - } - } - LargeScannerToken.prototype.setFullStart = function (fullStart) { - this._packedFullStartAndInfo = largeTokenPackFullStartAndInfo(fullStart, largeTokenUnpackTriviaInfo(this._packedFullStartAndInfo)); - }; - LargeScannerToken.prototype.syntaxTreeText = function (text) { - var result = text || TypeScript.syntaxTree(this).text; - TypeScript.Debug.assert(result); - return result; - }; - LargeScannerToken.prototype.isIncrementallyUnusable = function () { - return tokenIsIncrementallyUnusable(this); - }; - LargeScannerToken.prototype.isKeywordConvertedToIdentifier = function () { - return false; - }; - LargeScannerToken.prototype.hasSkippedToken = function () { - return false; - }; - LargeScannerToken.prototype.fullText = function (text) { - return fullText(this, this.syntaxTreeText(text)); - }; - LargeScannerToken.prototype.text = function () { - var cachedText = this.cachedText; - return cachedText !== undefined ? cachedText : TypeScript.SyntaxFacts.getText(this.kind()); - }; - LargeScannerToken.prototype.leadingTrivia = function (text) { - return leadingTrivia(this, this.syntaxTreeText(text)); - }; - LargeScannerToken.prototype.trailingTrivia = function (text) { - return trailingTrivia(this, this.syntaxTreeText(text)); - }; - LargeScannerToken.prototype.leadingTriviaWidth = function (text) { - return leadingTriviaWidth(this, this.syntaxTreeText(text)); - }; - LargeScannerToken.prototype.trailingTriviaWidth = function (text) { - return trailingTriviaWidth(this, this.syntaxTreeText(text)); - }; - LargeScannerToken.prototype.kind = function () { - return this._packedFullWidthAndKind & 127 /* KindMask */; - }; - LargeScannerToken.prototype.fullWidth = function () { - return largeTokenUnpackFullWidth(this._packedFullWidthAndKind); - }; - LargeScannerToken.prototype.fullStart = function () { - return largeTokenUnpackFullStart(this._packedFullStartAndInfo); - }; - LargeScannerToken.prototype.hasLeadingTrivia = function () { - return largeTokenUnpackHasLeadingTrivia(this._packedFullStartAndInfo); - }; - LargeScannerToken.prototype.hasTrailingTrivia = function () { - return largeTokenUnpackHasTrailingTrivia(this._packedFullStartAndInfo); - }; - LargeScannerToken.prototype.hasLeadingComment = function () { - return largeTokenUnpackHasLeadingComment(this._packedFullStartAndInfo); - }; - LargeScannerToken.prototype.hasTrailingComment = function () { - return largeTokenUnpackHasTrailingComment(this._packedFullStartAndInfo); - }; - LargeScannerToken.prototype.clone = function () { - return new LargeScannerToken(this._packedFullStartAndInfo, this._packedFullWidthAndKind, this.cachedText); - }; - return LargeScannerToken; - })(); - function createScanner(languageVersion, text, reportDiagnostic) { - var scanner = createScannerInternal(languageVersion, text, reportDiagnostic); - return { - setIndex: scanner.setIndex, - scan: scanner.scan - }; - } - Scanner.createScanner = createScanner; - function createScannerInternal(languageVersion, text, reportDiagnostic) { - var str; - var index; - var start; - var end; - function setIndex(_index) { - index = _index; - } - function reset(_text, _start, _end) { - TypeScript.Debug.assert(_start <= _text.length(), "Token's start was not within the bounds of text: " + _start + " - [0, " + _text.length() + ")"); - TypeScript.Debug.assert(_end <= _text.length(), "Token's end was not within the bounds of text: " + _end + " - [0, " + _text.length() + ")"); - if (!str || text !== _text) { - text = _text; - str = _text.substr(0, _text.length()); - } - start = _start; - end = _end; - index = _start; - } - function scan(allowContextualToken) { - var fullStart = index; - var leadingTriviaInfo = scanTriviaInfo(false); - var start = index; - var kindAndIsVariableWidth = scanSyntaxKind(allowContextualToken); - var end = index; - var trailingTriviaInfo = scanTriviaInfo(true); - var fullWidth = index - fullStart; - var kind = kindAndIsVariableWidth & 127 /* KindMask */; - var isFixedWidth = kind >= TypeScript.SyntaxKind.FirstFixedWidth && kind <= TypeScript.SyntaxKind.LastFixedWidth && ((kindAndIsVariableWidth & 128 /* IsVariableWidthMask */) === 0); - if (isFixedWidth && leadingTriviaInfo === 0 && trailingTriviaInfo === 0 && fullStart <= 8388607 /* FixedWidthTokenMaxFullStart */ && (kindAndIsVariableWidth & 128 /* IsVariableWidthMask */) === 0) { - return new FixedWidthTokenWithNoTrivia((fullStart << 7 /* FixedWidthTokenFullStartShift */) | kind); - } - else { - var packedFullStartAndTriviaInfo = (fullStart << 4 /* LargeTokenFullStartShift */) | leadingTriviaInfo | (trailingTriviaInfo << 2); - var packedFullWidthAndKind = (fullWidth << 7 /* LargeTokenFullWidthShift */) | kind; - var cachedText = isFixedWidth ? undefined : text.substr(start, end - start); - return new LargeScannerToken(packedFullStartAndTriviaInfo, packedFullWidthAndKind, cachedText); - } - } - function scanTrivia(parent, text, isTrailing) { - var tokenFullStart = parent.fullStart(); - var tokenStart = tokenFullStart + leadingTriviaWidth(parent, text); - if (isTrailing) { - reset(text, tokenStart + parent.text().length, tokenFullStart + parent.fullWidth()); - } - else { - reset(text, tokenFullStart, tokenStart); - } - var trivia = []; - while (true) { - if (index < end) { - var ch = str.charCodeAt(index); - switch (ch) { - case 32 /* space */: - case 160 /* nonBreakingSpace */: - case 8192 /* enQuad */: - case 8193 /* emQuad */: - case 8194 /* enSpace */: - case 8195 /* emSpace */: - case 8196 /* threePerEmSpace */: - case 8197 /* fourPerEmSpace */: - case 8198 /* sixPerEmSpace */: - case 8199 /* figureSpace */: - case 8200 /* punctuationSpace */: - case 8201 /* thinSpace */: - case 8202 /* hairSpace */: - case 8203 /* zeroWidthSpace */: - case 8239 /* narrowNoBreakSpace */: - case 12288 /* ideographicSpace */: - case 9 /* tab */: - case 11 /* verticalTab */: - case 12 /* formFeed */: - case 65279 /* byteOrderMark */: - trivia.push(scanWhitespaceTrivia()); - continue; - case 47 /* slash */: - var ch2 = str.charCodeAt(index + 1); - if (ch2 === 47 /* slash */) { - trivia.push(scanSingleLineCommentTrivia()); - continue; - } - if (ch2 === 42 /* asterisk */) { - trivia.push(scanMultiLineCommentTrivia()); - continue; - } - throw TypeScript.Errors.invalidOperation(); - case 13 /* carriageReturn */: - case 10 /* lineFeed */: - case 8233 /* paragraphSeparator */: - case 8232 /* lineSeparator */: - trivia.push(scanLineTerminatorSequenceTrivia(ch)); - if (!isTrailing) { - continue; - } - break; - default: - throw TypeScript.Errors.invalidOperation(); - } - } - var triviaList = TypeScript.Syntax.triviaList(trivia); - triviaList.parent = parent; - return triviaList; - } - } - function scanTriviaInfo(isTrailing) { - var result = 0; - var _end = end; - while (index < _end) { - var ch = str.charCodeAt(index); - switch (ch) { - case 9 /* tab */: - case 32 /* space */: - case 11 /* verticalTab */: - case 12 /* formFeed */: - index++; - result |= 1; - continue; - case 13 /* carriageReturn */: - if ((index + 1) < end && str.charCodeAt(index + 1) === 10 /* lineFeed */) { - index++; - } - case 10 /* lineFeed */: - index++; - result |= 1; - if (isTrailing) { - return result; - } - continue; - case 47 /* slash */: - if ((index + 1) < _end) { - var ch2 = str.charCodeAt(index + 1); - if (ch2 === 47 /* slash */) { - result |= 3; - skipSingleLineCommentTrivia(); - continue; - } - if (ch2 === 42 /* asterisk */) { - result |= 3; - skipMultiLineCommentTrivia(); - continue; - } - } - return result; - default: - if (ch > 127 /* maxAsciiCharacter */ && slowScanTriviaInfo(ch)) { - result |= 1; - continue; - } - return result; - } - } - return result; - } - function slowScanTriviaInfo(ch) { - switch (ch) { - case 160 /* nonBreakingSpace */: - case 8192 /* enQuad */: - case 8193 /* emQuad */: - case 8194 /* enSpace */: - case 8195 /* emSpace */: - case 8196 /* threePerEmSpace */: - case 8197 /* fourPerEmSpace */: - case 8198 /* sixPerEmSpace */: - case 8199 /* figureSpace */: - case 8200 /* punctuationSpace */: - case 8201 /* thinSpace */: - case 8202 /* hairSpace */: - case 8203 /* zeroWidthSpace */: - case 8239 /* narrowNoBreakSpace */: - case 12288 /* ideographicSpace */: - case 65279 /* byteOrderMark */: - case 8233 /* paragraphSeparator */: - case 8232 /* lineSeparator */: - index++; - return true; - default: - return false; - } - } - function isNewLineCharacter(ch) { - switch (ch) { - case 13 /* carriageReturn */: - case 10 /* lineFeed */: - case 8233 /* paragraphSeparator */: - case 8232 /* lineSeparator */: - return true; - default: - return false; - } - } - function scanWhitespaceTrivia() { - var absoluteStartIndex = index; - while (true) { - var ch = str.charCodeAt(index); - switch (ch) { - case 32 /* space */: - case 160 /* nonBreakingSpace */: - case 8192 /* enQuad */: - case 8193 /* emQuad */: - case 8194 /* enSpace */: - case 8195 /* emSpace */: - case 8196 /* threePerEmSpace */: - case 8197 /* fourPerEmSpace */: - case 8198 /* sixPerEmSpace */: - case 8199 /* figureSpace */: - case 8200 /* punctuationSpace */: - case 8201 /* thinSpace */: - case 8202 /* hairSpace */: - case 8203 /* zeroWidthSpace */: - case 8239 /* narrowNoBreakSpace */: - case 12288 /* ideographicSpace */: - case 9 /* tab */: - case 11 /* verticalTab */: - case 12 /* formFeed */: - case 65279 /* byteOrderMark */: - index++; - continue; - } - break; - } - return createTrivia(4 /* WhitespaceTrivia */, absoluteStartIndex); - } - function createTrivia(kind, absoluteStartIndex) { - var fullWidth = index - absoluteStartIndex; - return TypeScript.Syntax.deferredTrivia(kind, text, absoluteStartIndex, fullWidth); - } - function scanSingleLineCommentTrivia() { - var absoluteStartIndex = index; - skipSingleLineCommentTrivia(); - return createTrivia(7 /* SingleLineCommentTrivia */, absoluteStartIndex); - } - function skipSingleLineCommentTrivia() { - index += 2; - while (index < end) { - if (isNewLineCharacter(str.charCodeAt(index))) { - return; - } - index++; - } - } - function scanMultiLineCommentTrivia() { - var absoluteStartIndex = index; - skipMultiLineCommentTrivia(); - return createTrivia(6 /* MultiLineCommentTrivia */, absoluteStartIndex); - } - function skipMultiLineCommentTrivia() { - index += 2; - while (true) { - if (index === end) { - reportDiagnostic(end, 0, TypeScript.DiagnosticCode.AsteriskSlash_expected, null); - return; - } - if ((index + 1) < end && str.charCodeAt(index) === 42 /* asterisk */ && str.charCodeAt(index + 1) === 47 /* slash */) { - index += 2; - return; - } - index++; - } - } - function scanLineTerminatorSequenceTrivia(ch) { - var absoluteStartIndex = index; - skipLineTerminatorSequence(ch); - return createTrivia(5 /* NewLineTrivia */, absoluteStartIndex); - } - function skipLineTerminatorSequence(ch) { - index++; - if (ch === 13 /* carriageReturn */ && str.charCodeAt(index) === 10 /* lineFeed */) { - index++; - } - } - function scanSyntaxKind(allowContextualToken) { - if (index >= end) { - return 10 /* EndOfFileToken */; - } - var character = str.charCodeAt(index); - index++; - switch (character) { - case 33 /* exclamation */: - return scanExclamationToken(); - case 34 /* doubleQuote */: - return scanStringLiteral(character); - case 37 /* percent */: - return scanPercentToken(); - case 38 /* ampersand */: - return scanAmpersandToken(); - case 39 /* singleQuote */: - return scanStringLiteral(character); - case 40 /* openParen */: - return 72 /* OpenParenToken */; - case 41 /* closeParen */: - return 73 /* CloseParenToken */; - case 42 /* asterisk */: - return scanAsteriskToken(); - case 43 /* plus */: - return scanPlusToken(); - case 44 /* comma */: - return 79 /* CommaToken */; - case 45 /* minus */: - return scanMinusToken(); - case 46 /* dot */: - return scanDotToken(); - case 47 /* slash */: - return scanSlashToken(allowContextualToken); - case 48 /* _0 */: - case 49 /* _1 */: - case 50 /* _2 */: - case 51 /* _3 */: - case 52 /* _4 */: - case 53 /* _5 */: - case 54 /* _6 */: - case 55 /* _7 */: - case 56 /* _8 */: - case 57 /* _9 */: - return scanNumericLiteral(character); - case 58 /* colon */: - return 106 /* ColonToken */; - case 59 /* semicolon */: - return 78 /* SemicolonToken */; - case 60 /* lessThan */: - return scanLessThanToken(); - case 61 /* equals */: - return scanEqualsToken(); - case 62 /* greaterThan */: - return scanGreaterThanToken(allowContextualToken); - case 63 /* question */: - return 105 /* QuestionToken */; - case 91 /* openBracket */: - return 74 /* OpenBracketToken */; - case 93 /* closeBracket */: - return 75 /* CloseBracketToken */; - case 94 /* caret */: - return scanCaretToken(); - case 123 /* openBrace */: - return 70 /* OpenBraceToken */; - case 124 /* bar */: - return scanBarToken(); - case 125 /* closeBrace */: - return 71 /* CloseBraceToken */; - case 126 /* tilde */: - return 102 /* TildeToken */; - } - if (isIdentifierStartCharacter[character]) { - var result = tryFastScanIdentifierOrKeyword(character); - if (result !== 0 /* None */) { - return result; - } - } - index--; - if (isIdentifierStart(peekCharOrUnicodeEscape())) { - return slowScanIdentifierOrKeyword(); - } - var text = String.fromCharCode(character); - var messageText = getErrorMessageText(text); - reportDiagnostic(index, 1, TypeScript.DiagnosticCode.Unexpected_character_0, [messageText]); - index++; - return 9 /* ErrorToken */; - } - function isIdentifierStart(interpretedChar) { - if (isIdentifierStartCharacter[interpretedChar]) { - return true; - } - return interpretedChar > 127 /* maxAsciiCharacter */ && TypeScript.Unicode.isIdentifierStart(interpretedChar, languageVersion); - } - function isIdentifierPart(interpretedChar) { - if (isIdentifierPartCharacter[interpretedChar]) { - return true; - } - return interpretedChar > 127 /* maxAsciiCharacter */ && TypeScript.Unicode.isIdentifierPart(interpretedChar, languageVersion); - } - function tryFastScanIdentifierOrKeyword(firstCharacter) { - var startIndex = index; - var character = firstCharacter; - while (index < end) { - character = str.charCodeAt(index); - if (!isIdentifierPartCharacter[character]) { - break; - } - index++; - } - if (index < end && (character === 92 /* backslash */ || character > 127 /* maxAsciiCharacter */)) { - index = startIndex; - return 0 /* None */; - } - else { - if (isKeywordStartCharacter[firstCharacter]) { - return TypeScript.ScannerUtilities.identifierKind(str, startIndex - 1, index - startIndex + 1); - } - else { - return 11 /* IdentifierName */; - } - } - } - function slowScanIdentifierOrKeyword() { - var startIndex = index; - do { - scanCharOrUnicodeEscape(); - } while (isIdentifierPart(peekCharOrUnicodeEscape())); - var length = index - startIndex; - var text = str.substr(startIndex, length); - var valueText = TypeScript.massageEscapes(text); - var keywordKind = TypeScript.SyntaxFacts.getTokenKind(valueText); - if (keywordKind >= TypeScript.SyntaxKind.FirstKeyword && keywordKind <= TypeScript.SyntaxKind.LastKeyword) { - return keywordKind | 128 /* IsVariableWidthMask */; - } - return 11 /* IdentifierName */; - } - function scanNumericLiteral(ch) { - if (isHexNumericLiteral(ch)) { - scanHexNumericLiteral(); - } - else if (isOctalNumericLiteral(ch)) { - scanOctalNumericLiteral(); - } - else { - scanDecimalNumericLiteral(); - } - return 13 /* NumericLiteral */; - } - function isOctalNumericLiteral(ch) { - return ch === 48 /* _0 */ && TypeScript.CharacterInfo.isOctalDigit(str.charCodeAt(index)); - } - function scanOctalNumericLiteral() { - var start = index - 1; - while (TypeScript.CharacterInfo.isOctalDigit(str.charCodeAt(index))) { - index++; - } - if (languageVersion >= 1 /* ES5 */) { - reportDiagnostic(start, index - start, TypeScript.DiagnosticCode.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher, null); - } - } - function scanDecimalDigits() { - while (TypeScript.CharacterInfo.isDecimalDigit(str.charCodeAt(index))) { - index++; - } - } - function scanDecimalNumericLiteral() { - scanDecimalDigits(); - if (str.charCodeAt(index) === 46 /* dot */) { - index++; - } - scanDecimalNumericLiteralAfterDot(); - } - function scanDecimalNumericLiteralAfterDot() { - scanDecimalDigits(); - var ch = str.charCodeAt(index); - if (ch === 101 /* e */ || ch === 69 /* E */) { - var nextChar1 = str.charCodeAt(index + 1); - if (TypeScript.CharacterInfo.isDecimalDigit(nextChar1)) { - index++; - scanDecimalDigits(); - } - else if (nextChar1 === 45 /* minus */ || nextChar1 === 43 /* plus */) { - var nextChar2 = str.charCodeAt(index + 2); - if (TypeScript.CharacterInfo.isDecimalDigit(nextChar2)) { - index += 2; - scanDecimalDigits(); - } - } - } - } - function scanHexNumericLiteral() { - index++; - while (TypeScript.CharacterInfo.isHexDigit(str.charCodeAt(index))) { - index++; - } - } - function isHexNumericLiteral(ch) { - if (ch === 48 /* _0 */) { - var ch = str.charCodeAt(index); - if (ch === 120 /* x */ || ch === 88 /* X */) { - return TypeScript.CharacterInfo.isHexDigit(str.charCodeAt(index + 1)); - } - } - return false; - } - function scanLessThanToken() { - var ch0 = str.charCodeAt(index); - if (ch0 === 61 /* equals */) { - index++; - return 82 /* LessThanEqualsToken */; - } - else if (ch0 === 60 /* lessThan */) { - index++; - if (str.charCodeAt(index) === 61 /* equals */) { - index++; - return 112 /* LessThanLessThanEqualsToken */; - } - else { - return 95 /* LessThanLessThanToken */; - } - } - else { - return 80 /* LessThanToken */; - } - } - function scanGreaterThanToken(allowContextualToken) { - if (allowContextualToken) { - var ch0 = str.charCodeAt(index); - if (ch0 === 62 /* greaterThan */) { - index++; - var ch1 = str.charCodeAt(index); - if (ch1 === 62 /* greaterThan */) { - index++; - var ch2 = str.charCodeAt(index); - if (ch2 === 61 /* equals */) { - index++; - return 114 /* GreaterThanGreaterThanGreaterThanEqualsToken */; - } - else { - return 97 /* GreaterThanGreaterThanGreaterThanToken */; - } - } - else if (ch1 === 61 /* equals */) { - index++; - return 113 /* GreaterThanGreaterThanEqualsToken */; - } - else { - return 96 /* GreaterThanGreaterThanToken */; - } - } - else if (ch0 === 61 /* equals */) { - index++; - return 83 /* GreaterThanEqualsToken */; - } - } - return 81 /* GreaterThanToken */; - } - function scanBarToken() { - var ch = str.charCodeAt(index); - if (ch === 61 /* equals */) { - index++; - return 116 /* BarEqualsToken */; - } - else if (ch === 124 /* bar */) { - index++; - return 104 /* BarBarToken */; - } - else { - return 99 /* BarToken */; - } - } - function scanCaretToken() { - if (str.charCodeAt(index) === 61 /* equals */) { - index++; - return 117 /* CaretEqualsToken */; - } - else { - return 100 /* CaretToken */; - } - } - function scanAmpersandToken() { - var character = str.charCodeAt(index); - if (character === 61 /* equals */) { - index++; - return 115 /* AmpersandEqualsToken */; - } - else if (character === 38 /* ampersand */) { - index++; - return 103 /* AmpersandAmpersandToken */; - } - else { - return 98 /* AmpersandToken */; - } - } - function scanPercentToken() { - if (str.charCodeAt(index) === 61 /* equals */) { - index++; - return 111 /* PercentEqualsToken */; - } - else { - return 92 /* PercentToken */; - } - } - function scanMinusToken() { - var character = str.charCodeAt(index); - if (character === 61 /* equals */) { - index++; - return 109 /* MinusEqualsToken */; - } - else if (character === 45 /* minus */) { - index++; - return 94 /* MinusMinusToken */; - } - else { - return 90 /* MinusToken */; - } - } - function scanPlusToken() { - var character = str.charCodeAt(index); - if (character === 61 /* equals */) { - index++; - return 108 /* PlusEqualsToken */; - } - else if (character === 43 /* plus */) { - index++; - return 93 /* PlusPlusToken */; - } - else { - return 89 /* PlusToken */; - } - } - function scanAsteriskToken() { - if (str.charCodeAt(index) === 61 /* equals */) { - index++; - return 110 /* AsteriskEqualsToken */; - } - else { - return 91 /* AsteriskToken */; - } - } - function scanEqualsToken() { - var character = str.charCodeAt(index); - if (character === 61 /* equals */) { - index++; - if (str.charCodeAt(index) === 61 /* equals */) { - index++; - return 87 /* EqualsEqualsEqualsToken */; - } - else { - return 84 /* EqualsEqualsToken */; - } - } - else if (character === 62 /* greaterThan */) { - index++; - return 85 /* EqualsGreaterThanToken */; - } - else { - return 107 /* EqualsToken */; - } - } - function scanDotToken() { - var nextChar = str.charCodeAt(index); - if (TypeScript.CharacterInfo.isDecimalDigit(nextChar)) { - scanDecimalNumericLiteralAfterDot(); - return 13 /* NumericLiteral */; - } - if (nextChar === 46 /* dot */ && str.charCodeAt(index + 1) === 46 /* dot */) { - index += 2; - return 77 /* DotDotDotToken */; - } - else { - return 76 /* DotToken */; - } - } - function scanSlashToken(allowContextualToken) { - if (allowContextualToken) { - var result = tryScanRegularExpressionToken(); - if (result !== 0 /* None */) { - return result; - } - } - if (str.charCodeAt(index) === 61 /* equals */) { - index++; - return 119 /* SlashEqualsToken */; - } - else { - return 118 /* SlashToken */; - } - } - function tryScanRegularExpressionToken() { - var startIndex = index; - var inEscape = false; - var inCharacterClass = false; - while (true) { - var ch = str.charCodeAt(index); - if (isNaN(ch) || isNewLineCharacter(ch)) { - index = startIndex; - return 0 /* None */; - } - index++; - if (inEscape) { - inEscape = false; - continue; - } - switch (ch) { - case 92 /* backslash */: - inEscape = true; - continue; - case 91 /* openBracket */: - inCharacterClass = true; - continue; - case 93 /* closeBracket */: - inCharacterClass = false; - continue; - case 47 /* slash */: - if (inCharacterClass) { - continue; - } - break; - default: - continue; - } - break; - } - while (isIdentifierPartCharacter[str.charCodeAt(index)]) { - index++; - } - return 12 /* RegularExpressionLiteral */; - } - function scanExclamationToken() { - if (str.charCodeAt(index) === 61 /* equals */) { - index++; - if (str.charCodeAt(index) === 61 /* equals */) { - index++; - return 88 /* ExclamationEqualsEqualsToken */; - } - else { - return 86 /* ExclamationEqualsToken */; - } - } - else { - return 101 /* ExclamationToken */; - } - } - function getErrorMessageText(text) { - if (text === "\\") { - return '"\\"'; - } - return JSON.stringify(text); - } - function skipEscapeSequence() { - var rewindPoint = index; - index++; - var ch = str.charCodeAt(index); - if (isNaN(ch)) { - return; - } - index++; - switch (ch) { - case 120 /* x */: - case 117 /* u */: - index = rewindPoint; - var value = scanUnicodeOrHexEscape(true); - break; - case 13 /* carriageReturn */: - if (str.charCodeAt(index) === 10 /* lineFeed */) { - index++; - } - break; - default: - break; - } - } - function scanStringLiteral(quoteCharacter) { - while (true) { - var ch = str.charCodeAt(index); - if (ch === 92 /* backslash */) { - skipEscapeSequence(); - } - else if (ch === quoteCharacter) { - index++; - break; - } - else if (isNaN(ch) || isNewLineCharacter(ch)) { - reportDiagnostic(Math.min(index, end), 1, TypeScript.DiagnosticCode.Missing_close_quote_character, null); - break; - } - else { - index++; - } - } - return 14 /* StringLiteral */; - } - function isUnicodeEscape(character) { - return character === 92 /* backslash */ && str.charCodeAt(index + 1) === 117 /* u */; - } - function peekCharOrUnicodeEscape() { - var character = str.charCodeAt(index); - if (isUnicodeEscape(character)) { - return peekUnicodeOrHexEscape(); - } - else { - return character; - } - } - function peekUnicodeOrHexEscape() { - var startIndex = index; - var ch = scanUnicodeOrHexEscape(false); - index = startIndex; - return ch; - } - function scanCharOrUnicodeEscape() { - if (str.charCodeAt(index) === 92 /* backslash */ && str.charCodeAt(index + 1) === 117 /* u */) { - scanUnicodeOrHexEscape(true); - } - else { - index++; - } - } - function scanUnicodeOrHexEscape(report) { - var start = index; - var character = str.charCodeAt(index); - index++; - character = str.charCodeAt(index); - var intChar = 0; - index++; - var count = character === 117 /* u */ ? 4 : 2; - for (var i = 0; i < count; i++) { - var ch2 = str.charCodeAt(index); - if (!TypeScript.CharacterInfo.isHexDigit(ch2)) { - if (report) { - reportDiagnostic(start, index - start, TypeScript.DiagnosticCode.Unrecognized_escape_sequence, null); - } - break; - } - intChar = (intChar << 4) + TypeScript.CharacterInfo.hexValue(ch2); - index++; - } - return intChar; - } - function fillTokenInfo(token, text, tokenInfo) { - var fullStart = token.fullStart(); - var fullEnd = fullStart + token.fullWidth(); - reset(text, fullStart, fullEnd); - scanTriviaInfo(false); - var start = index; - scanSyntaxKind(isContextualToken(token)); - var end = index; - tokenInfo.leadingTriviaWidth = start - fullStart; - tokenInfo.width = end - start; - } - reset(text, 0, text.length()); - return { - setIndex: setIndex, - scan: scan, - fillTokenInfo: fillTokenInfo, - scanTrivia: scanTrivia - }; - } - function isValidIdentifier(text, languageVersion) { - var hadError = false; - var scanner = createScanner(languageVersion, text, function () { return hadError = true; }); - var token = scanner.scan(false); - return !hadError && TypeScript.SyntaxFacts.isIdentifierNameOrAnyKeyword(token) && TypeScript.width(token) === text.length(); - } - Scanner.isValidIdentifier = isValidIdentifier; - function createParserSource(fileName, text, languageVersion) { - var _absolutePosition = 0; - var _tokenDiagnostics = []; - var rewindPointPool = []; - var rewindPointPoolCount = 0; - var lastDiagnostic = null; - var reportDiagnostic = function (position, fullWidth, diagnosticKey, args) { - lastDiagnostic = new TypeScript.Diagnostic(fileName, text.lineMap(), position, fullWidth, diagnosticKey, args); - }; - var slidingWindow = new TypeScript.SlidingWindow(fetchNextItem, TypeScript.ArrayUtilities.createArray(1024, null), null); - var scanner = createScanner(languageVersion, text, reportDiagnostic); - function release() { - slidingWindow = null; - scanner = null; - _tokenDiagnostics = []; - rewindPointPool = []; - lastDiagnostic = null; - reportDiagnostic = null; - } - function currentNode() { - return null; - } - function consumeNode(node) { - throw TypeScript.Errors.invalidOperation(); - } - function absolutePosition() { - return _absolutePosition; - } - function tokenDiagnostics() { - return _tokenDiagnostics; - } - function getOrCreateRewindPoint() { - if (rewindPointPoolCount === 0) { - return {}; - } - rewindPointPoolCount--; - var result = rewindPointPool[rewindPointPoolCount]; - rewindPointPool[rewindPointPoolCount] = null; - return result; - } - function getRewindPoint() { - var slidingWindowIndex = slidingWindow.getAndPinAbsoluteIndex(); - var rewindPoint = getOrCreateRewindPoint(); - rewindPoint.slidingWindowIndex = slidingWindowIndex; - rewindPoint.absolutePosition = _absolutePosition; - return rewindPoint; - } - function rewind(rewindPoint) { - slidingWindow.rewindToPinnedIndex(rewindPoint.slidingWindowIndex); - _absolutePosition = rewindPoint.absolutePosition; - } - function releaseRewindPoint(rewindPoint) { - slidingWindow.releaseAndUnpinAbsoluteIndex(rewindPoint.absoluteIndex); - rewindPointPool[rewindPointPoolCount] = rewindPoint; - rewindPointPoolCount++; - } - function fetchNextItem(allowContextualToken) { - var token = scanner.scan(allowContextualToken); - if (lastDiagnostic === null) { - return token; - } - _tokenDiagnostics.push(lastDiagnostic); - lastDiagnostic = null; - return TypeScript.Syntax.realizeToken(token, text); - } - function peekToken(n) { - return slidingWindow.peekItemN(n); - } - function consumeToken(token) { - _absolutePosition += token.fullWidth(); - slidingWindow.moveToNextItem(); - } - function currentToken() { - return slidingWindow.currentItem(false); - } - function removeDiagnosticsOnOrAfterPosition(position) { - var tokenDiagnosticsLength = _tokenDiagnostics.length; - while (tokenDiagnosticsLength > 0) { - var diagnostic = _tokenDiagnostics[tokenDiagnosticsLength - 1]; - if (diagnostic.start() >= position) { - tokenDiagnosticsLength--; - } - else { - break; - } - } - _tokenDiagnostics.length = tokenDiagnosticsLength; - } - function resetToPosition(absolutePosition) { - TypeScript.Debug.assert(absolutePosition <= text.length(), "Trying to set the position outside the bounds of the text!"); - _absolutePosition = absolutePosition; - removeDiagnosticsOnOrAfterPosition(absolutePosition); - slidingWindow.disgardAllItemsFromCurrentIndexOnwards(); - scanner.setIndex(absolutePosition); - } - function currentContextualToken() { - resetToPosition(_absolutePosition); - var token = slidingWindow.currentItem(true); - return token; - } - return { - text: text, - fileName: fileName, - languageVersion: languageVersion, - currentNode: currentNode, - currentToken: currentToken, - currentContextualToken: currentContextualToken, - peekToken: peekToken, - consumeNode: consumeNode, - consumeToken: consumeToken, - getRewindPoint: getRewindPoint, - rewind: rewind, - releaseRewindPoint: releaseRewindPoint, - tokenDiagnostics: tokenDiagnostics, - release: release, - absolutePosition: absolutePosition, - resetToPosition: resetToPosition - }; - } - Scanner.createParserSource = createParserSource; - })(Scanner = TypeScript.Scanner || (TypeScript.Scanner = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var ScannerUtilities = (function () { - function ScannerUtilities() { - } - ScannerUtilities.identifierKind = function (str, start, length) { - switch (length) { - case 2: - switch (str.charCodeAt(start)) { - case 100 /* d */: - return (str.charCodeAt(start + 1) === 111 /* o */) ? 22 /* DoKeyword */ : 11 /* IdentifierName */; - case 105 /* i */: - switch (str.charCodeAt(start + 1)) { - case 102 /* f */: - return 28 /* IfKeyword */; - case 110 /* n */: - return 29 /* InKeyword */; - default: - return 11 /* IdentifierName */; - } - default: - return 11 /* IdentifierName */; - } - case 3: - switch (str.charCodeAt(start)) { - case 97 /* a */: - return (str.charCodeAt(start + 1) === 110 /* n */ && str.charCodeAt(start + 2) === 121 /* y */) ? 60 /* AnyKeyword */ : 11 /* IdentifierName */; - case 102 /* f */: - return (str.charCodeAt(start + 1) === 111 /* o */ && str.charCodeAt(start + 2) === 114 /* r */) ? 26 /* ForKeyword */ : 11 /* IdentifierName */; - case 103 /* g */: - return (str.charCodeAt(start + 1) === 101 /* e */ && str.charCodeAt(start + 2) === 116 /* t */) ? 64 /* GetKeyword */ : 11 /* IdentifierName */; - case 108 /* l */: - return (str.charCodeAt(start + 1) === 101 /* e */ && str.charCodeAt(start + 2) === 116 /* t */) ? 53 /* LetKeyword */ : 11 /* IdentifierName */; - case 110 /* n */: - return (str.charCodeAt(start + 1) === 101 /* e */ && str.charCodeAt(start + 2) === 119 /* w */) ? 31 /* NewKeyword */ : 11 /* IdentifierName */; - case 115 /* s */: - return (str.charCodeAt(start + 1) === 101 /* e */ && str.charCodeAt(start + 2) === 116 /* t */) ? 68 /* SetKeyword */ : 11 /* IdentifierName */; - case 116 /* t */: - return (str.charCodeAt(start + 1) === 114 /* r */ && str.charCodeAt(start + 2) === 121 /* y */) ? 38 /* TryKeyword */ : 11 /* IdentifierName */; - case 118 /* v */: - return (str.charCodeAt(start + 1) === 97 /* a */ && str.charCodeAt(start + 2) === 114 /* r */) ? 40 /* VarKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - case 4: - switch (str.charCodeAt(start)) { - case 99 /* c */: - return (str.charCodeAt(start + 1) === 97 /* a */ && str.charCodeAt(start + 2) === 115 /* s */ && str.charCodeAt(start + 3) === 101 /* e */) ? 16 /* CaseKeyword */ : 11 /* IdentifierName */; - case 101 /* e */: - switch (str.charCodeAt(start + 1)) { - case 108 /* l */: - return (str.charCodeAt(start + 2) === 115 /* s */ && str.charCodeAt(start + 3) === 101 /* e */) ? 23 /* ElseKeyword */ : 11 /* IdentifierName */; - case 110 /* n */: - return (str.charCodeAt(start + 2) === 117 /* u */ && str.charCodeAt(start + 3) === 109 /* m */) ? 46 /* EnumKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - case 110 /* n */: - return (str.charCodeAt(start + 1) === 117 /* u */ && str.charCodeAt(start + 2) === 108 /* l */ && str.charCodeAt(start + 3) === 108 /* l */) ? 32 /* NullKeyword */ : 11 /* IdentifierName */; - case 116 /* t */: - switch (str.charCodeAt(start + 1)) { - case 104 /* h */: - return (str.charCodeAt(start + 2) === 105 /* i */ && str.charCodeAt(start + 3) === 115 /* s */) ? 35 /* ThisKeyword */ : 11 /* IdentifierName */; - case 114 /* r */: - return (str.charCodeAt(start + 2) === 117 /* u */ && str.charCodeAt(start + 3) === 101 /* e */) ? 37 /* TrueKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - case 118 /* v */: - return (str.charCodeAt(start + 1) === 111 /* o */ && str.charCodeAt(start + 2) === 105 /* i */ && str.charCodeAt(start + 3) === 100 /* d */) ? 41 /* VoidKeyword */ : 11 /* IdentifierName */; - case 119 /* w */: - return (str.charCodeAt(start + 1) === 105 /* i */ && str.charCodeAt(start + 2) === 116 /* t */ && str.charCodeAt(start + 3) === 104 /* h */) ? 43 /* WithKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - case 5: - switch (str.charCodeAt(start)) { - case 98 /* b */: - return (str.charCodeAt(start + 1) === 114 /* r */ && str.charCodeAt(start + 2) === 101 /* e */ && str.charCodeAt(start + 3) === 97 /* a */ && str.charCodeAt(start + 4) === 107 /* k */) ? 15 /* BreakKeyword */ : 11 /* IdentifierName */; - case 99 /* c */: - switch (str.charCodeAt(start + 1)) { - case 97 /* a */: - return (str.charCodeAt(start + 2) === 116 /* t */ && str.charCodeAt(start + 3) === 99 /* c */ && str.charCodeAt(start + 4) === 104 /* h */) ? 17 /* CatchKeyword */ : 11 /* IdentifierName */; - case 108 /* l */: - return (str.charCodeAt(start + 2) === 97 /* a */ && str.charCodeAt(start + 3) === 115 /* s */ && str.charCodeAt(start + 4) === 115 /* s */) ? 44 /* ClassKeyword */ : 11 /* IdentifierName */; - case 111 /* o */: - return (str.charCodeAt(start + 2) === 110 /* n */ && str.charCodeAt(start + 3) === 115 /* s */ && str.charCodeAt(start + 4) === 116 /* t */) ? 45 /* ConstKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - case 102 /* f */: - return (str.charCodeAt(start + 1) === 97 /* a */ && str.charCodeAt(start + 2) === 108 /* l */ && str.charCodeAt(start + 3) === 115 /* s */ && str.charCodeAt(start + 4) === 101 /* e */) ? 24 /* FalseKeyword */ : 11 /* IdentifierName */; - case 115 /* s */: - return (str.charCodeAt(start + 1) === 117 /* u */ && str.charCodeAt(start + 2) === 112 /* p */ && str.charCodeAt(start + 3) === 101 /* e */ && str.charCodeAt(start + 4) === 114 /* r */) ? 50 /* SuperKeyword */ : 11 /* IdentifierName */; - case 116 /* t */: - return (str.charCodeAt(start + 1) === 104 /* h */ && str.charCodeAt(start + 2) === 114 /* r */ && str.charCodeAt(start + 3) === 111 /* o */ && str.charCodeAt(start + 4) === 119 /* w */) ? 36 /* ThrowKeyword */ : 11 /* IdentifierName */; - case 119 /* w */: - return (str.charCodeAt(start + 1) === 104 /* h */ && str.charCodeAt(start + 2) === 105 /* i */ && str.charCodeAt(start + 3) === 108 /* l */ && str.charCodeAt(start + 4) === 101 /* e */) ? 42 /* WhileKeyword */ : 11 /* IdentifierName */; - case 121 /* y */: - return (str.charCodeAt(start + 1) === 105 /* i */ && str.charCodeAt(start + 2) === 101 /* e */ && str.charCodeAt(start + 3) === 108 /* l */ && str.charCodeAt(start + 4) === 100 /* d */) ? 59 /* YieldKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - case 6: - switch (str.charCodeAt(start)) { - case 100 /* d */: - return (str.charCodeAt(start + 1) === 101 /* e */ && str.charCodeAt(start + 2) === 108 /* l */ && str.charCodeAt(start + 3) === 101 /* e */ && str.charCodeAt(start + 4) === 116 /* t */ && str.charCodeAt(start + 5) === 101 /* e */) ? 21 /* DeleteKeyword */ : 11 /* IdentifierName */; - case 101 /* e */: - return (str.charCodeAt(start + 1) === 120 /* x */ && str.charCodeAt(start + 2) === 112 /* p */ && str.charCodeAt(start + 3) === 111 /* o */ && str.charCodeAt(start + 4) === 114 /* r */ && str.charCodeAt(start + 5) === 116 /* t */) ? 47 /* ExportKeyword */ : 11 /* IdentifierName */; - case 105 /* i */: - return (str.charCodeAt(start + 1) === 109 /* m */ && str.charCodeAt(start + 2) === 112 /* p */ && str.charCodeAt(start + 3) === 111 /* o */ && str.charCodeAt(start + 4) === 114 /* r */ && str.charCodeAt(start + 5) === 116 /* t */) ? 49 /* ImportKeyword */ : 11 /* IdentifierName */; - case 109 /* m */: - return (str.charCodeAt(start + 1) === 111 /* o */ && str.charCodeAt(start + 2) === 100 /* d */ && str.charCodeAt(start + 3) === 117 /* u */ && str.charCodeAt(start + 4) === 108 /* l */ && str.charCodeAt(start + 5) === 101 /* e */) ? 65 /* ModuleKeyword */ : 11 /* IdentifierName */; - case 110 /* n */: - return (str.charCodeAt(start + 1) === 117 /* u */ && str.charCodeAt(start + 2) === 109 /* m */ && str.charCodeAt(start + 3) === 98 /* b */ && str.charCodeAt(start + 4) === 101 /* e */ && str.charCodeAt(start + 5) === 114 /* r */) ? 67 /* NumberKeyword */ : 11 /* IdentifierName */; - case 112 /* p */: - return (str.charCodeAt(start + 1) === 117 /* u */ && str.charCodeAt(start + 2) === 98 /* b */ && str.charCodeAt(start + 3) === 108 /* l */ && str.charCodeAt(start + 4) === 105 /* i */ && str.charCodeAt(start + 5) === 99 /* c */) ? 57 /* PublicKeyword */ : 11 /* IdentifierName */; - case 114 /* r */: - return (str.charCodeAt(start + 1) === 101 /* e */ && str.charCodeAt(start + 2) === 116 /* t */ && str.charCodeAt(start + 3) === 117 /* u */ && str.charCodeAt(start + 4) === 114 /* r */ && str.charCodeAt(start + 5) === 110 /* n */) ? 33 /* ReturnKeyword */ : 11 /* IdentifierName */; - case 115 /* s */: - switch (str.charCodeAt(start + 1)) { - case 116 /* t */: - switch (str.charCodeAt(start + 2)) { - case 97 /* a */: - return (str.charCodeAt(start + 3) === 116 /* t */ && str.charCodeAt(start + 4) === 105 /* i */ && str.charCodeAt(start + 5) === 99 /* c */) ? 58 /* StaticKeyword */ : 11 /* IdentifierName */; - case 114 /* r */: - return (str.charCodeAt(start + 3) === 105 /* i */ && str.charCodeAt(start + 4) === 110 /* n */ && str.charCodeAt(start + 5) === 103 /* g */) ? 69 /* StringKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - case 119 /* w */: - return (str.charCodeAt(start + 2) === 105 /* i */ && str.charCodeAt(start + 3) === 116 /* t */ && str.charCodeAt(start + 4) === 99 /* c */ && str.charCodeAt(start + 5) === 104 /* h */) ? 34 /* SwitchKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - case 116 /* t */: - return (str.charCodeAt(start + 1) === 121 /* y */ && str.charCodeAt(start + 2) === 112 /* p */ && str.charCodeAt(start + 3) === 101 /* e */ && str.charCodeAt(start + 4) === 111 /* o */ && str.charCodeAt(start + 5) === 102 /* f */) ? 39 /* TypeOfKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - case 7: - switch (str.charCodeAt(start)) { - case 98 /* b */: - return (str.charCodeAt(start + 1) === 111 /* o */ && str.charCodeAt(start + 2) === 111 /* o */ && str.charCodeAt(start + 3) === 108 /* l */ && str.charCodeAt(start + 4) === 101 /* e */ && str.charCodeAt(start + 5) === 97 /* a */ && str.charCodeAt(start + 6) === 110 /* n */) ? 61 /* BooleanKeyword */ : 11 /* IdentifierName */; - case 100 /* d */: - switch (str.charCodeAt(start + 1)) { - case 101 /* e */: - switch (str.charCodeAt(start + 2)) { - case 99 /* c */: - return (str.charCodeAt(start + 3) === 108 /* l */ && str.charCodeAt(start + 4) === 97 /* a */ && str.charCodeAt(start + 5) === 114 /* r */ && str.charCodeAt(start + 6) === 101 /* e */) ? 63 /* DeclareKeyword */ : 11 /* IdentifierName */; - case 102 /* f */: - return (str.charCodeAt(start + 3) === 97 /* a */ && str.charCodeAt(start + 4) === 117 /* u */ && str.charCodeAt(start + 5) === 108 /* l */ && str.charCodeAt(start + 6) === 116 /* t */) ? 20 /* DefaultKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - default: - return 11 /* IdentifierName */; - } - case 101 /* e */: - return (str.charCodeAt(start + 1) === 120 /* x */ && str.charCodeAt(start + 2) === 116 /* t */ && str.charCodeAt(start + 3) === 101 /* e */ && str.charCodeAt(start + 4) === 110 /* n */ && str.charCodeAt(start + 5) === 100 /* d */ && str.charCodeAt(start + 6) === 115 /* s */) ? 48 /* ExtendsKeyword */ : 11 /* IdentifierName */; - case 102 /* f */: - return (str.charCodeAt(start + 1) === 105 /* i */ && str.charCodeAt(start + 2) === 110 /* n */ && str.charCodeAt(start + 3) === 97 /* a */ && str.charCodeAt(start + 4) === 108 /* l */ && str.charCodeAt(start + 5) === 108 /* l */ && str.charCodeAt(start + 6) === 121 /* y */) ? 25 /* FinallyKeyword */ : 11 /* IdentifierName */; - case 112 /* p */: - switch (str.charCodeAt(start + 1)) { - case 97 /* a */: - return (str.charCodeAt(start + 2) === 99 /* c */ && str.charCodeAt(start + 3) === 107 /* k */ && str.charCodeAt(start + 4) === 97 /* a */ && str.charCodeAt(start + 5) === 103 /* g */ && str.charCodeAt(start + 6) === 101 /* e */) ? 54 /* PackageKeyword */ : 11 /* IdentifierName */; - case 114 /* r */: - return (str.charCodeAt(start + 2) === 105 /* i */ && str.charCodeAt(start + 3) === 118 /* v */ && str.charCodeAt(start + 4) === 97 /* a */ && str.charCodeAt(start + 5) === 116 /* t */ && str.charCodeAt(start + 6) === 101 /* e */) ? 55 /* PrivateKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - case 114 /* r */: - return (str.charCodeAt(start + 1) === 101 /* e */ && str.charCodeAt(start + 2) === 113 /* q */ && str.charCodeAt(start + 3) === 117 /* u */ && str.charCodeAt(start + 4) === 105 /* i */ && str.charCodeAt(start + 5) === 114 /* r */ && str.charCodeAt(start + 6) === 101 /* e */) ? 66 /* RequireKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - case 8: - switch (str.charCodeAt(start)) { - case 99 /* c */: - return (str.charCodeAt(start + 1) === 111 /* o */ && str.charCodeAt(start + 2) === 110 /* n */ && str.charCodeAt(start + 3) === 116 /* t */ && str.charCodeAt(start + 4) === 105 /* i */ && str.charCodeAt(start + 5) === 110 /* n */ && str.charCodeAt(start + 6) === 117 /* u */ && str.charCodeAt(start + 7) === 101 /* e */) ? 18 /* ContinueKeyword */ : 11 /* IdentifierName */; - case 100 /* d */: - return (str.charCodeAt(start + 1) === 101 /* e */ && str.charCodeAt(start + 2) === 98 /* b */ && str.charCodeAt(start + 3) === 117 /* u */ && str.charCodeAt(start + 4) === 103 /* g */ && str.charCodeAt(start + 5) === 103 /* g */ && str.charCodeAt(start + 6) === 101 /* e */ && str.charCodeAt(start + 7) === 114 /* r */) ? 19 /* DebuggerKeyword */ : 11 /* IdentifierName */; - case 102 /* f */: - return (str.charCodeAt(start + 1) === 117 /* u */ && str.charCodeAt(start + 2) === 110 /* n */ && str.charCodeAt(start + 3) === 99 /* c */ && str.charCodeAt(start + 4) === 116 /* t */ && str.charCodeAt(start + 5) === 105 /* i */ && str.charCodeAt(start + 6) === 111 /* o */ && str.charCodeAt(start + 7) === 110 /* n */) ? 27 /* FunctionKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - case 9: - switch (str.charCodeAt(start)) { - case 105 /* i */: - return (str.charCodeAt(start + 1) === 110 /* n */ && str.charCodeAt(start + 2) === 116 /* t */ && str.charCodeAt(start + 3) === 101 /* e */ && str.charCodeAt(start + 4) === 114 /* r */ && str.charCodeAt(start + 5) === 102 /* f */ && str.charCodeAt(start + 6) === 97 /* a */ && str.charCodeAt(start + 7) === 99 /* c */ && str.charCodeAt(start + 8) === 101 /* e */) ? 52 /* InterfaceKeyword */ : 11 /* IdentifierName */; - case 112 /* p */: - return (str.charCodeAt(start + 1) === 114 /* r */ && str.charCodeAt(start + 2) === 111 /* o */ && str.charCodeAt(start + 3) === 116 /* t */ && str.charCodeAt(start + 4) === 101 /* e */ && str.charCodeAt(start + 5) === 99 /* c */ && str.charCodeAt(start + 6) === 116 /* t */ && str.charCodeAt(start + 7) === 101 /* e */ && str.charCodeAt(start + 8) === 100 /* d */) ? 56 /* ProtectedKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - case 10: - switch (str.charCodeAt(start)) { - case 105 /* i */: - switch (str.charCodeAt(start + 1)) { - case 109 /* m */: - return (str.charCodeAt(start + 2) === 112 /* p */ && str.charCodeAt(start + 3) === 108 /* l */ && str.charCodeAt(start + 4) === 101 /* e */ && str.charCodeAt(start + 5) === 109 /* m */ && str.charCodeAt(start + 6) === 101 /* e */ && str.charCodeAt(start + 7) === 110 /* n */ && str.charCodeAt(start + 8) === 116 /* t */ && str.charCodeAt(start + 9) === 115 /* s */) ? 51 /* ImplementsKeyword */ : 11 /* IdentifierName */; - case 110 /* n */: - return (str.charCodeAt(start + 2) === 115 /* s */ && str.charCodeAt(start + 3) === 116 /* t */ && str.charCodeAt(start + 4) === 97 /* a */ && str.charCodeAt(start + 5) === 110 /* n */ && str.charCodeAt(start + 6) === 99 /* c */ && str.charCodeAt(start + 7) === 101 /* e */ && str.charCodeAt(start + 8) === 111 /* o */ && str.charCodeAt(start + 9) === 102 /* f */) ? 30 /* InstanceOfKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - default: - return 11 /* IdentifierName */; - } - case 11: - return (str.charCodeAt(start) === 99 /* c */ && str.charCodeAt(start + 1) === 111 /* o */ && str.charCodeAt(start + 2) === 110 /* n */ && str.charCodeAt(start + 3) === 115 /* s */ && str.charCodeAt(start + 4) === 116 /* t */ && str.charCodeAt(start + 5) === 114 /* r */ && str.charCodeAt(start + 6) === 117 /* u */ && str.charCodeAt(start + 7) === 99 /* c */ && str.charCodeAt(start + 8) === 116 /* t */ && str.charCodeAt(start + 9) === 111 /* o */ && str.charCodeAt(start + 10) === 114 /* r */) ? 62 /* ConstructorKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - }; - return ScannerUtilities; - })(); - TypeScript.ScannerUtilities = ScannerUtilities; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var SlidingWindow = (function () { - function SlidingWindow(fetchNextItem, window, defaultValue, sourceLength) { - if (sourceLength === void 0) { sourceLength = -1; } - this.fetchNextItem = fetchNextItem; - this.window = window; - this.defaultValue = defaultValue; - this.sourceLength = sourceLength; - this.windowCount = 0; - this.windowAbsoluteStartIndex = 0; - this.currentRelativeItemIndex = 0; - this._pinCount = 0; - this.firstPinnedAbsoluteIndex = -1; - } - SlidingWindow.prototype.addMoreItemsToWindow = function (argument) { - var sourceLength = this.sourceLength; - if (sourceLength >= 0 && this.absoluteIndex() >= sourceLength) { - return false; - } - if (this.windowCount >= this.window.length) { - this.tryShiftOrGrowWindow(); - } - var item = this.fetchNextItem(argument); - this.window[this.windowCount] = item; - this.windowCount++; - return true; - }; - SlidingWindow.prototype.tryShiftOrGrowWindow = function () { - var currentIndexIsPastWindowHalfwayPoint = this.currentRelativeItemIndex > (this.window.length >>> 1); - var isAllowedToShift = this.firstPinnedAbsoluteIndex === -1 || this.firstPinnedAbsoluteIndex > this.windowAbsoluteStartIndex; - if (currentIndexIsPastWindowHalfwayPoint && isAllowedToShift) { - var shiftStartIndex = this.firstPinnedAbsoluteIndex === -1 ? this.currentRelativeItemIndex : this.firstPinnedAbsoluteIndex - this.windowAbsoluteStartIndex; - var shiftCount = this.windowCount - shiftStartIndex; - if (shiftCount > 0) { - TypeScript.ArrayUtilities.copy(this.window, shiftStartIndex, this.window, 0, shiftCount); - } - this.windowAbsoluteStartIndex += shiftStartIndex; - this.windowCount -= shiftStartIndex; - this.currentRelativeItemIndex -= shiftStartIndex; - } - else { - TypeScript.ArrayUtilities.grow(this.window, this.window.length * 2, this.defaultValue); - } - }; - SlidingWindow.prototype.absoluteIndex = function () { - return this.windowAbsoluteStartIndex + this.currentRelativeItemIndex; - }; - SlidingWindow.prototype.isAtEndOfSource = function () { - return this.absoluteIndex() >= this.sourceLength; - }; - SlidingWindow.prototype.getAndPinAbsoluteIndex = function () { - var absoluteIndex = this.absoluteIndex(); - var pinCount = this._pinCount++; - if (pinCount === 0) { - this.firstPinnedAbsoluteIndex = absoluteIndex; - } - return absoluteIndex; - }; - SlidingWindow.prototype.releaseAndUnpinAbsoluteIndex = function (absoluteIndex) { - this._pinCount--; - if (this._pinCount === 0) { - this.firstPinnedAbsoluteIndex = -1; - } - }; - SlidingWindow.prototype.rewindToPinnedIndex = function (absoluteIndex) { - var relativeIndex = absoluteIndex - this.windowAbsoluteStartIndex; - this.currentRelativeItemIndex = relativeIndex; - }; - SlidingWindow.prototype.currentItem = function (argument) { - if (this.currentRelativeItemIndex >= this.windowCount) { - if (!this.addMoreItemsToWindow(argument)) { - return this.defaultValue; - } - } - return this.window[this.currentRelativeItemIndex]; - }; - SlidingWindow.prototype.peekItemN = function (n) { - while (this.currentRelativeItemIndex + n >= this.windowCount) { - if (!this.addMoreItemsToWindow(null)) { - return this.defaultValue; - } - } - return this.window[this.currentRelativeItemIndex + n]; - }; - SlidingWindow.prototype.moveToNextItem = function () { - this.currentRelativeItemIndex++; - }; - SlidingWindow.prototype.disgardAllItemsFromCurrentIndexOnwards = function () { - this.windowCount = this.currentRelativeItemIndex; - }; - return SlidingWindow; - })(); - TypeScript.SlidingWindow = SlidingWindow; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Syntax; - (function (Syntax) { - Syntax._nextSyntaxID = 1; - function childIndex(parent, child) { - for (var i = 0, n = TypeScript.childCount(parent); i < n; i++) { - var current = TypeScript.childAt(parent, i); - if (current === child) { - return i; - } - } - throw TypeScript.Errors.invalidOperation(); - } - Syntax.childIndex = childIndex; - function nodeHasSkippedOrMissingTokens(node) { - for (var i = 0; i < TypeScript.childCount(node); i++) { - var child = TypeScript.childAt(node, i); - if (TypeScript.isToken(child)) { - var token = child; - if (token.hasSkippedToken() || (TypeScript.width(token) === 0 && token.kind() !== 10 /* EndOfFileToken */)) { - return true; - } - } - } - return false; - } - Syntax.nodeHasSkippedOrMissingTokens = nodeHasSkippedOrMissingTokens; - function isUnterminatedStringLiteral(token) { - if (token && token.kind() === 14 /* StringLiteral */) { - var text = token.text(); - return text.length < 2 || text.charCodeAt(text.length - 1) !== text.charCodeAt(0); - } - return false; - } - Syntax.isUnterminatedStringLiteral = isUnterminatedStringLiteral; - function isUnterminatedMultilineCommentTrivia(trivia) { - if (trivia && trivia.kind() === 6 /* MultiLineCommentTrivia */) { - var text = trivia.fullText(); - return text.length < 4 || text.substring(text.length - 2) !== "*/"; - } - return false; - } - Syntax.isUnterminatedMultilineCommentTrivia = isUnterminatedMultilineCommentTrivia; - function isEntirelyInsideCommentTrivia(trivia, fullStart, position) { - if (trivia && trivia.isComment() && position > fullStart) { - var end = fullStart + trivia.fullWidth(); - if (position < end) { - return true; - } - else if (position === end) { - return trivia.kind() === 7 /* SingleLineCommentTrivia */ || isUnterminatedMultilineCommentTrivia(trivia); - } - } - return false; - } - Syntax.isEntirelyInsideCommentTrivia = isEntirelyInsideCommentTrivia; - function isEntirelyInsideComment(sourceUnit, position) { - var positionedToken = TypeScript.findToken(sourceUnit, position); - var fullStart = positionedToken.fullStart(); - var triviaList = null; - var lastTriviaBeforeToken = null; - if (positionedToken.kind() === 10 /* EndOfFileToken */) { - if (positionedToken.hasLeadingTrivia()) { - triviaList = positionedToken.leadingTrivia(); - } - else { - positionedToken = TypeScript.previousToken(positionedToken); - if (positionedToken) { - if (positionedToken && positionedToken.hasTrailingTrivia()) { - triviaList = positionedToken.trailingTrivia(); - fullStart = TypeScript.end(positionedToken); - } - } - } - } - else { - if (position <= (fullStart + positionedToken.leadingTriviaWidth())) { - triviaList = positionedToken.leadingTrivia(); - } - else if (position >= (fullStart + TypeScript.width(positionedToken))) { - triviaList = positionedToken.trailingTrivia(); - fullStart = TypeScript.end(positionedToken); - } - } - if (triviaList) { - for (var i = 0, n = triviaList.count(); i < n; i++) { - var trivia = triviaList.syntaxTriviaAt(i); - if (position <= fullStart) { - break; - } - else if (position <= fullStart + trivia.fullWidth() && trivia.isComment()) { - lastTriviaBeforeToken = trivia; - break; - } - fullStart += trivia.fullWidth(); - } - } - return lastTriviaBeforeToken && isEntirelyInsideCommentTrivia(lastTriviaBeforeToken, fullStart, position); - } - Syntax.isEntirelyInsideComment = isEntirelyInsideComment; - function isEntirelyInStringOrRegularExpressionLiteral(sourceUnit, position) { - var positionedToken = TypeScript.findToken(sourceUnit, position); - if (positionedToken) { - if (positionedToken.kind() === 10 /* EndOfFileToken */) { - positionedToken = TypeScript.previousToken(positionedToken); - return positionedToken && positionedToken.trailingTriviaWidth() === 0 && isUnterminatedStringLiteral(positionedToken); - } - else if (position > TypeScript.start(positionedToken)) { - return (position < TypeScript.end(positionedToken) && (positionedToken.kind() === 14 /* StringLiteral */ || positionedToken.kind() === 12 /* RegularExpressionLiteral */)) || (position <= TypeScript.end(positionedToken) && isUnterminatedStringLiteral(positionedToken)); - } - } - return false; - } - Syntax.isEntirelyInStringOrRegularExpressionLiteral = isEntirelyInStringOrRegularExpressionLiteral; - function findSkippedTokenOnLeftInTriviaList(positionedToken, position, lookInLeadingTriviaList) { - var triviaList = null; - var fullEnd; - if (lookInLeadingTriviaList) { - triviaList = positionedToken.leadingTrivia(); - fullEnd = positionedToken.fullStart() + triviaList.fullWidth(); - } - else { - triviaList = positionedToken.trailingTrivia(); - fullEnd = TypeScript.fullEnd(positionedToken); - } - if (triviaList && triviaList.hasSkippedToken()) { - for (var i = triviaList.count() - 1; i >= 0; i--) { - var trivia = triviaList.syntaxTriviaAt(i); - var triviaWidth = trivia.fullWidth(); - if (trivia.isSkippedToken() && position >= fullEnd) { - return trivia.skippedToken(); - } - fullEnd -= triviaWidth; - } - } - return null; - } - function findSkippedTokenOnLeft(positionedToken, position) { - var positionInLeadingTriviaList = (position < TypeScript.start(positionedToken)); - return findSkippedTokenOnLeftInTriviaList(positionedToken, position, positionInLeadingTriviaList); - } - Syntax.findSkippedTokenOnLeft = findSkippedTokenOnLeft; - function getAncestorOfKind(positionedToken, kind) { - while (positionedToken && positionedToken.parent) { - if (positionedToken.parent.kind() === kind) { - return positionedToken.parent; - } - positionedToken = positionedToken.parent; - } - return null; - } - Syntax.getAncestorOfKind = getAncestorOfKind; - function hasAncestorOfKind(positionedToken, kind) { - return getAncestorOfKind(positionedToken, kind) !== null; - } - Syntax.hasAncestorOfKind = hasAncestorOfKind; - function isIntegerLiteral(expression) { - if (expression) { - switch (expression.kind()) { - case 165 /* PlusExpression */: - case 166 /* NegateExpression */: - expression = expression.operand; - return TypeScript.isToken(expression) && TypeScript.IntegerUtilities.isInteger(expression.text()); - case 13 /* NumericLiteral */: - var text = expression.text(); - return TypeScript.IntegerUtilities.isInteger(text) || TypeScript.IntegerUtilities.isHexInteger(text); - } - } - return false; - } - Syntax.isIntegerLiteral = isIntegerLiteral; - function containingNode(element) { - var current = element.parent; - while (current !== null && !TypeScript.isNode(current)) { - current = current.parent; - } - return current; - } - Syntax.containingNode = containingNode; - function findTokenOnLeft(element, position, includeSkippedTokens) { - if (includeSkippedTokens === void 0) { includeSkippedTokens = false; } - var positionedToken = TypeScript.findToken(element, position, false); - var _start = TypeScript.start(positionedToken); - if (includeSkippedTokens) { - positionedToken = findSkippedTokenOnLeft(positionedToken, position) || positionedToken; - } - if (position > _start) { - return positionedToken; - } - if (positionedToken.fullStart() === 0) { - return null; - } - return TypeScript.previousToken(positionedToken, includeSkippedTokens); - } - Syntax.findTokenOnLeft = findTokenOnLeft; - function findCompleteTokenOnLeft(element, position, includeSkippedTokens) { - if (includeSkippedTokens === void 0) { includeSkippedTokens = false; } - var positionedToken = TypeScript.findToken(element, position, false); - if (includeSkippedTokens) { - positionedToken = findSkippedTokenOnLeft(positionedToken, position) || positionedToken; - } - if (TypeScript.width(positionedToken) > 0 && position >= TypeScript.end(positionedToken)) { - return positionedToken; - } - return TypeScript.previousToken(positionedToken, includeSkippedTokens); - } - Syntax.findCompleteTokenOnLeft = findCompleteTokenOnLeft; - function firstTokenInLineContainingPosition(syntaxTree, position) { - var current = TypeScript.findToken(syntaxTree.sourceUnit(), position); - while (true) { - if (isFirstTokenInLine(current, syntaxTree.lineMap())) { - break; - } - current = TypeScript.previousToken(current); - } - return current; - } - Syntax.firstTokenInLineContainingPosition = firstTokenInLineContainingPosition; - function isFirstTokenInLine(token, lineMap) { - var _previousToken = TypeScript.previousToken(token); - if (_previousToken === null) { - return true; - } - return lineMap.getLineNumberFromPosition(TypeScript.end(_previousToken)) !== lineMap.getLineNumberFromPosition(TypeScript.start(token)); - } - })(Syntax = TypeScript.Syntax || (TypeScript.Syntax = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - function isShared(element) { - var kind = element.kind(); - return (kind === 1 /* List */ || kind === 2 /* SeparatedList */) && element.length === 0; - } - TypeScript.isShared = isShared; - function childCount(element) { - var kind = element.kind(); - if (kind === 1 /* List */) { - return element.length; - } - else if (kind === 2 /* SeparatedList */) { - return element.length + element.separators.length; - } - else if (kind >= TypeScript.SyntaxKind.FirstToken && kind <= TypeScript.SyntaxKind.LastToken) { - return 0; - } - else { - return TypeScript.nodeMetadata[kind].length; - } - } - TypeScript.childCount = childCount; - function childAt(element, index) { - var kind = element.kind(); - if (kind === 1 /* List */) { - return element[index]; - } - else if (kind === 2 /* SeparatedList */) { - return (index % 2 === 0) ? element[index / 2] : element.separators[(index - 1) / 2]; - } - else { - return element[TypeScript.nodeMetadata[element.kind()][index]]; - } - } - TypeScript.childAt = childAt; - function syntaxTree(element) { - if (element) { - TypeScript.Debug.assert(!isShared(element)); - while (element) { - if (element.kind() === 120 /* SourceUnit */) { - return element.syntaxTree; - } - element = element.parent; - } - } - return null; - } - TypeScript.syntaxTree = syntaxTree; - function parsedInStrictMode(node) { - var info = node.data; - if (info === undefined) { - return false; - } - return (info & 4 /* NodeParsedInStrictModeMask */) !== 0; - } - TypeScript.parsedInStrictMode = parsedInStrictMode; - function previousToken(token, includeSkippedTokens) { - if (includeSkippedTokens === void 0) { includeSkippedTokens = false; } - if (includeSkippedTokens) { - var triviaList = token.leadingTrivia(); - if (triviaList && triviaList.hasSkippedToken()) { - var currentTriviaEndPosition = TypeScript.start(token); - for (var i = triviaList.count() - 1; i >= 0; i--) { - var trivia = triviaList.syntaxTriviaAt(i); - if (trivia.isSkippedToken()) { - return trivia.skippedToken(); - } - currentTriviaEndPosition -= trivia.fullWidth(); - } - } - } - var start = token.fullStart(); - if (start === 0) { - return null; - } - return findToken(syntaxTree(token).sourceUnit(), start - 1, includeSkippedTokens); - } - TypeScript.previousToken = previousToken; - function findToken(element, position, includeSkippedTokens) { - if (includeSkippedTokens === void 0) { includeSkippedTokens = false; } - var endOfFileToken = tryGetEndOfFileAt(element, position); - if (endOfFileToken !== null) { - return endOfFileToken; - } - if (position < 0 || position >= fullWidth(element)) { - throw TypeScript.Errors.argumentOutOfRange("position"); - } - var positionedToken = findTokenWorker(element, position); - if (includeSkippedTokens) { - return findSkippedTokenInPositionedToken(positionedToken, position) || positionedToken; - } - return positionedToken; - } - TypeScript.findToken = findToken; - function findSkippedTokenInPositionedToken(positionedToken, position) { - var positionInLeadingTriviaList = (position < start(positionedToken)); - return findSkippedTokenInTriviaList(positionedToken, position, positionInLeadingTriviaList); - } - TypeScript.findSkippedTokenInPositionedToken = findSkippedTokenInPositionedToken; - function findSkippedTokenInLeadingTriviaList(positionedToken, position) { - return findSkippedTokenInTriviaList(positionedToken, position, true); - } - TypeScript.findSkippedTokenInLeadingTriviaList = findSkippedTokenInLeadingTriviaList; - function findSkippedTokenInTrailingTriviaList(positionedToken, position) { - return findSkippedTokenInTriviaList(positionedToken, position, false); - } - TypeScript.findSkippedTokenInTrailingTriviaList = findSkippedTokenInTrailingTriviaList; - function findSkippedTokenInTriviaList(positionedToken, position, lookInLeadingTriviaList) { - var triviaList = null; - var fullStart; - if (lookInLeadingTriviaList) { - triviaList = positionedToken.leadingTrivia(); - fullStart = positionedToken.fullStart(); - } - else { - triviaList = positionedToken.trailingTrivia(); - fullStart = end(positionedToken); - } - if (triviaList && triviaList.hasSkippedToken()) { - for (var i = 0, n = triviaList.count(); i < n; i++) { - var trivia = triviaList.syntaxTriviaAt(i); - var triviaWidth = trivia.fullWidth(); - if (trivia.isSkippedToken() && position >= fullStart && position <= fullStart + triviaWidth) { - return trivia.skippedToken(); - } - fullStart += triviaWidth; - } - } - return null; - } - function findTokenWorker(element, position) { - if (isToken(element)) { - TypeScript.Debug.assert(fullWidth(element) > 0); - return element; - } - if (isShared(element)) { - throw TypeScript.Errors.invalidOperation(); - } - for (var i = 0, n = childCount(element); i < n; i++) { - var child = childAt(element, i); - if (child !== null) { - var childFullWidth = fullWidth(child); - if (childFullWidth > 0) { - var childFullStart = fullStart(child); - if (position >= childFullStart) { - var childFullEnd = childFullStart + childFullWidth; - if (position < childFullEnd) { - return findTokenWorker(child, position); - } - } - } - } - } - throw TypeScript.Errors.invalidOperation(); - } - function tryGetEndOfFileAt(element, position) { - if (element.kind() === 120 /* SourceUnit */ && position === fullWidth(element)) { - var sourceUnit = element; - return sourceUnit.endOfFileToken; - } - return null; - } - function nextToken(token, text, includeSkippedTokens) { - if (includeSkippedTokens === void 0) { includeSkippedTokens = false; } - if (token.kind() === 10 /* EndOfFileToken */) { - return null; - } - if (includeSkippedTokens) { - var triviaList = token.trailingTrivia(text); - if (triviaList && triviaList.hasSkippedToken()) { - for (var i = 0, n = triviaList.count(); i < n; i++) { - var trivia = triviaList.syntaxTriviaAt(i); - if (trivia.isSkippedToken()) { - return trivia.skippedToken(); - } - } - } - } - return findToken(syntaxTree(token).sourceUnit(), fullEnd(token), includeSkippedTokens); - } - TypeScript.nextToken = nextToken; - function isNode(element) { - if (element !== null) { - var kind = element.kind(); - return kind >= TypeScript.SyntaxKind.FirstNode && kind <= TypeScript.SyntaxKind.LastNode; - } - return false; - } - TypeScript.isNode = isNode; - function isTokenKind(kind) { - return kind >= TypeScript.SyntaxKind.FirstToken && kind <= TypeScript.SyntaxKind.LastToken; - } - function isToken(element) { - if (element !== null) { - return isTokenKind(element.kind()); - } - return false; - } - TypeScript.isToken = isToken; - function isList(element) { - return element !== null && element.kind() === 1 /* List */; - } - TypeScript.isList = isList; - function isSeparatedList(element) { - return element !== null && element.kind() === 2 /* SeparatedList */; - } - TypeScript.isSeparatedList = isSeparatedList; - function syntaxID(element) { - if (isShared(element)) { - throw TypeScript.Errors.invalidOperation("Should not use shared syntax element as a key."); - } - var obj = element; - if (obj._syntaxID === undefined) { - obj._syntaxID = TypeScript.Syntax._nextSyntaxID++; - } - return obj._syntaxID; - } - TypeScript.syntaxID = syntaxID; - function collectTextElements(element, elements, text) { - if (element) { - if (isToken(element)) { - elements.push(element.fullText(text)); - } - else { - for (var i = 0, n = childCount(element); i < n; i++) { - collectTextElements(childAt(element, i), elements, text); - } - } - } - } - function fullText(element, text) { - if (isToken(element)) { - return element.fullText(text); - } - var elements = []; - collectTextElements(element, elements, text); - return elements.join(""); - } - TypeScript.fullText = fullText; - function leadingTriviaWidth(element, text) { - var token = firstToken(element); - return token ? token.leadingTriviaWidth(text) : 0; - } - TypeScript.leadingTriviaWidth = leadingTriviaWidth; - function trailingTriviaWidth(element, text) { - var token = lastToken(element); - return token ? token.trailingTriviaWidth(text) : 0; - } - TypeScript.trailingTriviaWidth = trailingTriviaWidth; - function firstToken(element) { - if (element) { - var kind = element.kind(); - if (isTokenKind(kind)) { - return fullWidth(element) > 0 || element.kind() === 10 /* EndOfFileToken */ ? element : null; - } - if (kind === 1 /* List */) { - var array = element; - for (var i = 0, n = array.length; i < n; i++) { - var token = firstToken(array[i]); - if (token) { - return token; - } - } - } - else if (kind === 2 /* SeparatedList */) { - var array = element; - var separators = array.separators; - for (var i = 0, n = array.length + separators.length; i < n; i++) { - var token = firstToken(i % 2 === 0 ? array[i / 2] : separators[(i - 1) / 2]); - if (token) { - return token; - } - } - } - else { - var metadata = TypeScript.nodeMetadata[kind]; - for (var i = 0, n = metadata.length; i < n; i++) { - var child = element[metadata[i]]; - var token = firstToken(child); - if (token) { - return token; - } - } - if (element.kind() === 120 /* SourceUnit */) { - return element.endOfFileToken; - } - } - } - return null; - } - TypeScript.firstToken = firstToken; - function lastToken(element) { - if (isToken(element)) { - return fullWidth(element) > 0 || element.kind() === 10 /* EndOfFileToken */ ? element : null; - } - if (element.kind() === 120 /* SourceUnit */) { - return element.endOfFileToken; - } - for (var i = childCount(element) - 1; i >= 0; i--) { - var child = childAt(element, i); - if (child !== null) { - var token = lastToken(child); - if (token) { - return token; - } - } - } - return null; - } - TypeScript.lastToken = lastToken; - function fullStart(element) { - TypeScript.Debug.assert(!isShared(element)); - var token = isToken(element) ? element : firstToken(element); - return token ? token.fullStart() : -1; - } - TypeScript.fullStart = fullStart; - function fullWidth(element) { - if (isToken(element)) { - return element.fullWidth(); - } - if (isShared(element)) { - return 0; - } - var info = data(element); - return info >>> 3 /* NodeFullWidthShift */; - } - TypeScript.fullWidth = fullWidth; - function isIncrementallyUnusable(element) { - if (isToken(element)) { - return element.isIncrementallyUnusable(); - } - if (isShared(element)) { - return false; - } - return (data(element) & 2 /* NodeIncrementallyUnusableMask */) !== 0; - } - TypeScript.isIncrementallyUnusable = isIncrementallyUnusable; - function data(element) { - TypeScript.Debug.assert(isNode(element) || isList(element) || isSeparatedList(element)); - var dataElement = element; - var info = dataElement.data; - if (info === undefined) { - info = 0; - } - if ((info & 1 /* NodeDataComputed */) === 0) { - info |= computeData(element); - dataElement.data = info; - } - return info; - } - function computeData(element) { - var slotCount = childCount(element); - var fullWidth = 0; - var isIncrementallyUnusable = slotCount === 0; - for (var i = 0, n = slotCount; i < n; i++) { - var child = childAt(element, i); - if (child) { - fullWidth += TypeScript.fullWidth(child); - isIncrementallyUnusable = isIncrementallyUnusable || TypeScript.isIncrementallyUnusable(child); - } - } - return (fullWidth << 3 /* NodeFullWidthShift */) | (isIncrementallyUnusable ? 2 /* NodeIncrementallyUnusableMask */ : 0) | 1 /* NodeDataComputed */; - } - function start(element, text) { - var token = isToken(element) ? element : firstToken(element); - return token ? token.fullStart() + token.leadingTriviaWidth(text) : -1; - } - TypeScript.start = start; - function end(element, text) { - var token = isToken(element) ? element : lastToken(element); - return token ? fullEnd(token) - token.trailingTriviaWidth(text) : -1; - } - TypeScript.end = end; - function width(element, text) { - if (isToken(element)) { - return element.text().length; - } - return fullWidth(element) - leadingTriviaWidth(element, text) - trailingTriviaWidth(element, text); - } - TypeScript.width = width; - function fullEnd(element) { - return fullStart(element) + fullWidth(element); - } - TypeScript.fullEnd = fullEnd; - function existsNewLineBetweenTokens(token1, token2, text) { - if (token1 === token2) { - return false; - } - if (token1 === null || token2 === null) { - return true; - } - var lineMap = text.lineMap(); - return lineMap.getLineNumberFromPosition(end(token1, text)) !== lineMap.getLineNumberFromPosition(start(token2, text)); - } - TypeScript.existsNewLineBetweenTokens = existsNewLineBetweenTokens; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var SyntaxFacts; - (function (SyntaxFacts) { - function isDirectivePrologueElement(node) { - if (node.kind() === 150 /* ExpressionStatement */) { - var expressionStatement = node; - var expression = expressionStatement.expression; - if (expression.kind() === 14 /* StringLiteral */) { - return true; - } - } - return false; - } - SyntaxFacts.isDirectivePrologueElement = isDirectivePrologueElement; - function isUseStrictDirective(node) { - var expressionStatement = node; - var stringLiteral = expressionStatement.expression; - var text = stringLiteral.text(); - return text === '"use strict"' || text === "'use strict'"; - } - SyntaxFacts.isUseStrictDirective = isUseStrictDirective; - function isIdentifierNameOrAnyKeyword(token) { - var tokenKind = token.kind(); - return tokenKind === 11 /* IdentifierName */ || SyntaxFacts.isAnyKeyword(tokenKind); - } - SyntaxFacts.isIdentifierNameOrAnyKeyword = isIdentifierNameOrAnyKeyword; - function isAccessibilityModifier(kind) { - switch (kind) { - case 57 /* PublicKeyword */: - case 55 /* PrivateKeyword */: - case 56 /* ProtectedKeyword */: - return true; - } - return false; - } - SyntaxFacts.isAccessibilityModifier = isAccessibilityModifier; - })(SyntaxFacts = TypeScript.SyntaxFacts || (TypeScript.SyntaxFacts = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Syntax; - (function (Syntax) { - var _emptyList = []; - var _emptySeparatedList = []; - var _emptySeparators = []; - _emptySeparatedList.separators = _emptySeparators; - function assertEmptyLists() { - } - Array.prototype.kind = function () { - return this.separators === undefined ? 1 /* List */ : 2 /* SeparatedList */; - }; - Array.prototype.separatorCount = function () { - assertEmptyLists(); - return this.separators.length; - }; - Array.prototype.separatorAt = function (index) { - assertEmptyLists(); - return this.separators[index]; - }; - function emptyList() { - return _emptyList; - } - Syntax.emptyList = emptyList; - function emptySeparatedList() { - return _emptySeparatedList; - } - Syntax.emptySeparatedList = emptySeparatedList; - function list(nodes) { - if (nodes === undefined || nodes === null || nodes.length === 0) { - return emptyList(); - } - for (var i = 0, n = nodes.length; i < n; i++) { - nodes[i].parent = nodes; - } - return nodes; - } - Syntax.list = list; - function separatedList(nodes, separators) { - if (nodes === undefined || nodes === null || nodes.length === 0) { - return emptySeparatedList(); - } - for (var i = 0, n = nodes.length; i < n; i++) { - nodes[i].parent = nodes; - } - for (var i = 0, n = separators.length; i < n; i++) { - separators[i].parent = nodes; - } - nodes.separators = separators.length === 0 ? _emptySeparators : separators; - return nodes; - } - Syntax.separatedList = separatedList; - function nonSeparatorIndexOf(list, ast) { - for (var i = 0, n = list.length; i < n; i++) { - if (list[i] === ast) { - return i; - } - } - return -1; - } - Syntax.nonSeparatorIndexOf = nonSeparatorIndexOf; - })(Syntax = TypeScript.Syntax || (TypeScript.Syntax = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var SyntaxNode = (function () { - function SyntaxNode(data) { - if (data) { - this.data = data; - } - } - SyntaxNode.prototype.kind = function () { - return this.__kind; - }; - return SyntaxNode; - })(); - TypeScript.SyntaxNode = SyntaxNode; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - TypeScript.nodeMetadata = [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], ["moduleElements", "endOfFileToken"], ["left", "dotToken", "right"], ["openBraceToken", "typeMembers", "closeBraceToken"], ["typeParameterList", "parameterList", "equalsGreaterThanToken", "type"], ["type", "openBracketToken", "closeBracketToken"], ["newKeyword", "typeParameterList", "parameterList", "equalsGreaterThanToken", "type"], ["name", "typeArgumentList"], ["typeOfKeyword", "name"], ["openBracketToken", "types", "closeBracketToken"], ["modifiers", "interfaceKeyword", "identifier", "typeParameterList", "heritageClauses", "body"], ["modifiers", "functionKeyword", "identifier", "callSignature", "block", "semicolonToken"], ["modifiers", "moduleKeyword", "name", "stringLiteral", "openBraceToken", "moduleElements", "closeBraceToken"], ["modifiers", "classKeyword", "identifier", "typeParameterList", "heritageClauses", "openBraceToken", "classElements", "closeBraceToken"], ["modifiers", "enumKeyword", "identifier", "openBraceToken", "enumElements", "closeBraceToken"], ["modifiers", "importKeyword", "identifier", "equalsToken", "moduleReference", "semicolonToken"], ["exportKeyword", "equalsToken", "identifier", "semicolonToken"], ["modifiers", "propertyName", "callSignature", "block", "semicolonToken"], ["modifiers", "variableDeclarator", "semicolonToken"], ["modifiers", "constructorKeyword", "callSignature", "block", "semicolonToken"], ["modifiers", "indexSignature", "semicolonToken"], ["modifiers", "getKeyword", "propertyName", "callSignature", "block"], ["modifiers", "setKeyword", "propertyName", "callSignature", "block"], ["propertyName", "questionToken", "typeAnnotation"], ["typeParameterList", "parameterList", "typeAnnotation"], ["newKeyword", "callSignature"], ["openBracketToken", "parameters", "closeBracketToken", "typeAnnotation"], ["propertyName", "questionToken", "callSignature"], ["openBraceToken", "statements", "closeBraceToken"], ["ifKeyword", "openParenToken", "condition", "closeParenToken", "statement", "elseClause"], ["modifiers", "variableDeclaration", "semicolonToken"], ["expression", "semicolonToken"], ["returnKeyword", "expression", "semicolonToken"], ["switchKeyword", "openParenToken", "expression", "closeParenToken", "openBraceToken", "switchClauses", "closeBraceToken"], ["breakKeyword", "identifier", "semicolonToken"], ["continueKeyword", "identifier", "semicolonToken"], ["forKeyword", "openParenToken", "variableDeclaration", "initializer", "firstSemicolonToken", "condition", "secondSemicolonToken", "incrementor", "closeParenToken", "statement"], ["forKeyword", "openParenToken", "variableDeclaration", "left", "inKeyword", "expression", "closeParenToken", "statement"], ["semicolonToken"], ["throwKeyword", "expression", "semicolonToken"], ["whileKeyword", "openParenToken", "condition", "closeParenToken", "statement"], ["tryKeyword", "block", "catchClause", "finallyClause"], ["identifier", "colonToken", "statement"], ["doKeyword", "statement", "whileKeyword", "openParenToken", "condition", "closeParenToken", "semicolonToken"], ["debuggerKeyword", "semicolonToken"], ["withKeyword", "openParenToken", "condition", "closeParenToken", "statement"], ["operatorToken", "operand"], ["operatorToken", "operand"], ["operatorToken", "operand"], ["operatorToken", "operand"], ["operatorToken", "operand"], ["operatorToken", "operand"], ["deleteKeyword", "expression"], ["typeOfKeyword", "expression"], ["voidKeyword", "expression"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["condition", "questionToken", "whenTrue", "colonToken", "whenFalse"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["left", "operatorToken", "right"], ["operand", "operatorToken"], ["operand", "operatorToken"], ["expression", "dotToken", "name"], ["expression", "argumentList"], ["openBracketToken", "expressions", "closeBracketToken"], ["openBraceToken", "propertyAssignments", "closeBraceToken"], ["newKeyword", "expression", "argumentList"], ["openParenToken", "expression", "closeParenToken"], ["callSignature", "equalsGreaterThanToken", "block", "expression"], ["parameter", "equalsGreaterThanToken", "block", "expression"], ["lessThanToken", "type", "greaterThanToken", "expression"], ["expression", "openBracketToken", "argumentExpression", "closeBracketToken"], ["functionKeyword", "identifier", "callSignature", "block"], [], ["varKeyword", "variableDeclarators"], ["propertyName", "typeAnnotation", "equalsValueClause"], ["typeArgumentList", "openParenToken", "arguments", "closeParenToken"], ["openParenToken", "parameters", "closeParenToken"], ["lessThanToken", "typeArguments", "greaterThanToken"], ["lessThanToken", "typeParameters", "greaterThanToken"], ["extendsOrImplementsKeyword", "typeNames"], ["extendsOrImplementsKeyword", "typeNames"], ["equalsToken", "value"], ["caseKeyword", "expression", "colonToken", "statements"], ["defaultKeyword", "colonToken", "statements"], ["elseKeyword", "statement"], ["catchKeyword", "openParenToken", "identifier", "typeAnnotation", "closeParenToken", "block"], ["finallyKeyword", "block"], ["identifier", "constraint"], ["extendsKeyword", "typeOrExpression"], ["propertyName", "colonToken", "expression"], ["propertyName", "callSignature", "block"], ["dotDotDotToken", "modifiers", "identifier", "questionToken", "typeAnnotation", "equalsValueClause"], ["propertyName", "equalsValueClause"], ["colonToken", "type"], ["requireKeyword", "openParenToken", "stringLiteral", "closeParenToken"], ["moduleName"],]; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - function tokenValue(token) { - if (token.fullWidth() === 0) { - return null; - } - var kind = token.kind(); - var text = token.text(); - if (kind === 11 /* IdentifierName */) { - return massageEscapes(text); - } - switch (kind) { - case 37 /* TrueKeyword */: - return true; - case 24 /* FalseKeyword */: - return false; - case 32 /* NullKeyword */: - return null; - } - if (TypeScript.SyntaxFacts.isAnyKeyword(kind) || TypeScript.SyntaxFacts.isAnyPunctuation(kind)) { - return TypeScript.SyntaxFacts.getText(kind); - } - if (kind === 13 /* NumericLiteral */) { - return TypeScript.IntegerUtilities.isHexInteger(text) ? parseInt(text, 16) : parseFloat(text); - } - else if (kind === 14 /* StringLiteral */) { - if (text.length > 1 && text.charCodeAt(text.length - 1) === text.charCodeAt(0)) { - return massageEscapes(text.substr(1, text.length - 2)); - } - else { - return massageEscapes(text.substr(1)); - } - } - else if (kind === 12 /* RegularExpressionLiteral */) { - return regularExpressionValue(text); - } - else if (kind === 10 /* EndOfFileToken */ || kind === 9 /* ErrorToken */) { - return null; - } - else { - throw TypeScript.Errors.invalidOperation(); - } - } - TypeScript.tokenValue = tokenValue; - function tokenValueText(token) { - var value = tokenValue(token); - return value === null ? "" : massageDisallowedIdentifiers(value.toString()); - } - TypeScript.tokenValueText = tokenValueText; - function massageEscapes(text) { - return text.indexOf("\\") >= 0 ? convertEscapes(text) : text; - } - TypeScript.massageEscapes = massageEscapes; - function regularExpressionValue(text) { - try { - var lastSlash = text.lastIndexOf("/"); - var body = text.substring(1, lastSlash); - var flags = text.substring(lastSlash + 1); - return new RegExp(body, flags); - } - catch (e) { - return null; - } - } - function massageDisallowedIdentifiers(text) { - if (text.charCodeAt(0) === 95 /* _ */ && text.charCodeAt(1) === 95 /* _ */) { - return "_" + text; - } - return text; - } - var characterArray = []; - function convertEscapes(text) { - characterArray.length = 0; - var result = ""; - for (var i = 0, n = text.length; i < n; i++) { - var ch = text.charCodeAt(i); - if (ch === 92 /* backslash */) { - i++; - if (i < n) { - ch = text.charCodeAt(i); - switch (ch) { - case 48 /* _0 */: - characterArray.push(0 /* nullCharacter */); - continue; - case 98 /* b */: - characterArray.push(8 /* backspace */); - continue; - case 102 /* f */: - characterArray.push(12 /* formFeed */); - continue; - case 110 /* n */: - characterArray.push(10 /* lineFeed */); - continue; - case 114 /* r */: - characterArray.push(13 /* carriageReturn */); - continue; - case 116 /* t */: - characterArray.push(9 /* tab */); - continue; - case 118 /* v */: - characterArray.push(11 /* verticalTab */); - continue; - case 120 /* x */: - characterArray.push(hexValue(text, i + 1, 2)); - i += 2; - continue; - case 117 /* u */: - characterArray.push(hexValue(text, i + 1, 4)); - i += 4; - continue; - case 13 /* carriageReturn */: - var nextIndex = i + 1; - if (nextIndex < text.length && text.charCodeAt(nextIndex) === 10 /* lineFeed */) { - i++; - } - continue; - case 10 /* lineFeed */: - case 8233 /* paragraphSeparator */: - case 8232 /* lineSeparator */: - continue; - default: - } - } - } - characterArray.push(ch); - if (i && !(i % 1024)) { - result = result.concat(String.fromCharCode.apply(null, characterArray)); - characterArray.length = 0; - } - } - if (characterArray.length) { - result = result.concat(String.fromCharCode.apply(null, characterArray)); - } - return result; - } - function hexValue(text, start, length) { - var intChar = 0; - for (var i = 0; i < length; i++) { - var ch2 = text.charCodeAt(start + i); - if (!TypeScript.CharacterInfo.isHexDigit(ch2)) { - break; - } - intChar = (intChar << 4) + TypeScript.CharacterInfo.hexValue(ch2); - } - return intChar; - } -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Syntax; - (function (Syntax) { - function realizeToken(token, text) { - return new RealizedToken(token.fullStart(), token.kind(), token.isKeywordConvertedToIdentifier(), token.leadingTrivia(text), token.text(), token.trailingTrivia(text)); - } - Syntax.realizeToken = realizeToken; - function convertKeywordToIdentifier(token) { - return new ConvertedKeywordToken(token); - } - Syntax.convertKeywordToIdentifier = convertKeywordToIdentifier; - function withLeadingTrivia(token, leadingTrivia, text) { - return new RealizedToken(token.fullStart(), token.kind(), token.isKeywordConvertedToIdentifier(), leadingTrivia, token.text(), token.trailingTrivia(text)); - } - Syntax.withLeadingTrivia = withLeadingTrivia; - function withTrailingTrivia(token, trailingTrivia, text) { - return new RealizedToken(token.fullStart(), token.kind(), token.isKeywordConvertedToIdentifier(), token.leadingTrivia(text), token.text(), trailingTrivia); - } - Syntax.withTrailingTrivia = withTrailingTrivia; - function emptyToken(kind) { - return new EmptyToken(kind); - } - Syntax.emptyToken = emptyToken; - var EmptyToken = (function () { - function EmptyToken(_kind) { - this._kind = _kind; - } - EmptyToken.prototype.setFullStart = function (fullStart) { - }; - EmptyToken.prototype.kind = function () { - return this._kind; - }; - EmptyToken.prototype.clone = function () { - return new EmptyToken(this.kind()); - }; - EmptyToken.prototype.isIncrementallyUnusable = function () { - return true; - }; - EmptyToken.prototype.isKeywordConvertedToIdentifier = function () { - return false; - }; - EmptyToken.prototype.fullWidth = function () { - return 0; - }; - EmptyToken.prototype.position = function () { - var previousElement = this.previousNonZeroWidthElement(); - return previousElement === null ? 0 : TypeScript.fullStart(previousElement) + TypeScript.fullWidth(previousElement); - }; - EmptyToken.prototype.previousNonZeroWidthElement = function () { - var current = this; - while (true) { - var parent = current.parent; - if (parent === null) { - TypeScript.Debug.assert(current.kind() === 120 /* SourceUnit */, "We had a node without a parent that was not the root node!"); - return null; - } - for (var i = 0, n = TypeScript.childCount(parent); i < n; i++) { - if (TypeScript.childAt(parent, i) === current) { - break; - } - } - TypeScript.Debug.assert(i !== n, "Could not find current element in parent's child list!"); - for (var j = i - 1; j >= 0; j--) { - var sibling = TypeScript.childAt(parent, j); - if (sibling && TypeScript.fullWidth(sibling) > 0) { - return sibling; - } - } - current = current.parent; - } - }; - EmptyToken.prototype.fullStart = function () { - return this.position(); - }; - EmptyToken.prototype.text = function () { - return ""; - }; - EmptyToken.prototype.fullText = function () { - return ""; - }; - EmptyToken.prototype.hasLeadingTrivia = function () { - return false; - }; - EmptyToken.prototype.hasTrailingTrivia = function () { - return false; - }; - EmptyToken.prototype.hasLeadingComment = function () { - return false; - }; - EmptyToken.prototype.hasTrailingComment = function () { - return false; - }; - EmptyToken.prototype.hasSkippedToken = function () { - return false; - }; - EmptyToken.prototype.leadingTriviaWidth = function () { - return 0; - }; - EmptyToken.prototype.trailingTriviaWidth = function () { - return 0; - }; - EmptyToken.prototype.leadingTrivia = function () { - return Syntax.emptyTriviaList; - }; - EmptyToken.prototype.trailingTrivia = function () { - return Syntax.emptyTriviaList; - }; - return EmptyToken; - })(); - var RealizedToken = (function () { - function RealizedToken(fullStart, kind, isKeywordConvertedToIdentifier, leadingTrivia, text, trailingTrivia) { - this._fullStart = fullStart; - this._kind = kind; - this._isKeywordConvertedToIdentifier = isKeywordConvertedToIdentifier; - this._text = text; - this._leadingTrivia = leadingTrivia.clone(); - this._trailingTrivia = trailingTrivia.clone(); - if (!this._leadingTrivia.isShared()) { - this._leadingTrivia.parent = this; - } - if (!this._trailingTrivia.isShared()) { - this._trailingTrivia.parent = this; - } - } - RealizedToken.prototype.setFullStart = function (fullStart) { - this._fullStart = fullStart; - }; - RealizedToken.prototype.kind = function () { - return this._kind; - }; - RealizedToken.prototype.clone = function () { - return new RealizedToken(this._fullStart, this.kind(), this._isKeywordConvertedToIdentifier, this._leadingTrivia, this._text, this._trailingTrivia); - }; - RealizedToken.prototype.isIncrementallyUnusable = function () { - return true; - }; - RealizedToken.prototype.isKeywordConvertedToIdentifier = function () { - return this._isKeywordConvertedToIdentifier; - }; - RealizedToken.prototype.fullStart = function () { - return this._fullStart; - }; - RealizedToken.prototype.fullWidth = function () { - return this._leadingTrivia.fullWidth() + this._text.length + this._trailingTrivia.fullWidth(); - }; - RealizedToken.prototype.text = function () { - return this._text; - }; - RealizedToken.prototype.fullText = function () { - return this._leadingTrivia.fullText() + this.text() + this._trailingTrivia.fullText(); - }; - RealizedToken.prototype.hasLeadingTrivia = function () { - return this._leadingTrivia.count() > 0; - }; - RealizedToken.prototype.hasTrailingTrivia = function () { - return this._trailingTrivia.count() > 0; - }; - RealizedToken.prototype.hasLeadingComment = function () { - return this._leadingTrivia.hasComment(); - }; - RealizedToken.prototype.hasTrailingComment = function () { - return this._trailingTrivia.hasComment(); - }; - RealizedToken.prototype.leadingTriviaWidth = function () { - return this._leadingTrivia.fullWidth(); - }; - RealizedToken.prototype.trailingTriviaWidth = function () { - return this._trailingTrivia.fullWidth(); - }; - RealizedToken.prototype.hasSkippedToken = function () { - return this._leadingTrivia.hasSkippedToken() || this._trailingTrivia.hasSkippedToken(); - }; - RealizedToken.prototype.leadingTrivia = function () { - return this._leadingTrivia; - }; - RealizedToken.prototype.trailingTrivia = function () { - return this._trailingTrivia; - }; - return RealizedToken; - })(); - var ConvertedKeywordToken = (function () { - function ConvertedKeywordToken(underlyingToken) { - this.underlyingToken = underlyingToken; - } - ConvertedKeywordToken.prototype.kind = function () { - return 11 /* IdentifierName */; - }; - ConvertedKeywordToken.prototype.setFullStart = function (fullStart) { - this.underlyingToken.setFullStart(fullStart); - }; - ConvertedKeywordToken.prototype.fullStart = function () { - return this.underlyingToken.fullStart(); - }; - ConvertedKeywordToken.prototype.fullWidth = function () { - return this.underlyingToken.fullWidth(); - }; - ConvertedKeywordToken.prototype.text = function () { - return this.underlyingToken.text(); - }; - ConvertedKeywordToken.prototype.syntaxTreeText = function (text) { - var result = text || TypeScript.syntaxTree(this).text; - TypeScript.Debug.assert(result); - return result; - }; - ConvertedKeywordToken.prototype.fullText = function (text) { - return this.underlyingToken.fullText(this.syntaxTreeText(text)); - }; - ConvertedKeywordToken.prototype.hasLeadingTrivia = function () { - return this.underlyingToken.hasLeadingTrivia(); - }; - ConvertedKeywordToken.prototype.hasTrailingTrivia = function () { - return this.underlyingToken.hasTrailingTrivia(); - }; - ConvertedKeywordToken.prototype.hasLeadingComment = function () { - return this.underlyingToken.hasLeadingComment(); - }; - ConvertedKeywordToken.prototype.hasTrailingComment = function () { - return this.underlyingToken.hasTrailingComment(); - }; - ConvertedKeywordToken.prototype.hasSkippedToken = function () { - return this.underlyingToken.hasSkippedToken(); - }; - ConvertedKeywordToken.prototype.leadingTrivia = function (text) { - var result = this.underlyingToken.leadingTrivia(this.syntaxTreeText(text)); - result.parent = this; - return result; - }; - ConvertedKeywordToken.prototype.trailingTrivia = function (text) { - var result = this.underlyingToken.trailingTrivia(this.syntaxTreeText(text)); - result.parent = this; - return result; - }; - ConvertedKeywordToken.prototype.leadingTriviaWidth = function (text) { - return this.underlyingToken.leadingTriviaWidth(this.syntaxTreeText(text)); - }; - ConvertedKeywordToken.prototype.trailingTriviaWidth = function (text) { - return this.underlyingToken.trailingTriviaWidth(this.syntaxTreeText(text)); - }; - ConvertedKeywordToken.prototype.isKeywordConvertedToIdentifier = function () { - return true; - }; - ConvertedKeywordToken.prototype.isIncrementallyUnusable = function () { - return this.underlyingToken.isIncrementallyUnusable(); - }; - ConvertedKeywordToken.prototype.clone = function () { - return new ConvertedKeywordToken(this.underlyingToken); - }; - return ConvertedKeywordToken; - })(); - })(Syntax = TypeScript.Syntax || (TypeScript.Syntax = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Syntax; - (function (Syntax) { - var AbstractTrivia = (function () { - function AbstractTrivia(_kind) { - this._kind = _kind; - } - AbstractTrivia.prototype.kind = function () { - return this._kind; - }; - AbstractTrivia.prototype.clone = function () { - throw TypeScript.Errors.abstract(); - }; - AbstractTrivia.prototype.fullStart = function () { - throw TypeScript.Errors.abstract(); - }; - AbstractTrivia.prototype.fullWidth = function () { - throw TypeScript.Errors.abstract(); - }; - AbstractTrivia.prototype.fullText = function () { - throw TypeScript.Errors.abstract(); - }; - AbstractTrivia.prototype.skippedToken = function () { - throw TypeScript.Errors.abstract(); - }; - AbstractTrivia.prototype.isWhitespace = function () { - return this.kind() === 4 /* WhitespaceTrivia */; - }; - AbstractTrivia.prototype.isComment = function () { - return this.kind() === 7 /* SingleLineCommentTrivia */ || this.kind() === 6 /* MultiLineCommentTrivia */; - }; - AbstractTrivia.prototype.isNewLine = function () { - return this.kind() === 5 /* NewLineTrivia */; - }; - AbstractTrivia.prototype.isSkippedToken = function () { - return this.kind() === 8 /* SkippedTokenTrivia */; - }; - return AbstractTrivia; - })(); - var SkippedTokenTrivia = (function (_super) { - __extends(SkippedTokenTrivia, _super); - function SkippedTokenTrivia(_skippedToken, _fullText) { - _super.call(this, 8 /* SkippedTokenTrivia */); - this._skippedToken = _skippedToken; - this._fullText = _fullText; - _skippedToken.parent = this; - } - SkippedTokenTrivia.prototype.clone = function () { - return new SkippedTokenTrivia(this._skippedToken.clone(), this._fullText); - }; - SkippedTokenTrivia.prototype.fullStart = function () { - return this._skippedToken.fullStart(); - }; - SkippedTokenTrivia.prototype.fullWidth = function () { - return this.fullText().length; - }; - SkippedTokenTrivia.prototype.fullText = function () { - return this._fullText; - }; - SkippedTokenTrivia.prototype.skippedToken = function () { - return this._skippedToken; - }; - return SkippedTokenTrivia; - })(AbstractTrivia); - var DeferredTrivia = (function (_super) { - __extends(DeferredTrivia, _super); - function DeferredTrivia(kind, _text, _fullStart, _fullWidth) { - _super.call(this, kind); - this._text = _text; - this._fullStart = _fullStart; - this._fullWidth = _fullWidth; - } - DeferredTrivia.prototype.clone = function () { - return new DeferredTrivia(this.kind(), this._text, this._fullStart, this._fullWidth); - }; - DeferredTrivia.prototype.fullStart = function () { - return this._fullStart; - }; - DeferredTrivia.prototype.fullWidth = function () { - return this._fullWidth; - }; - DeferredTrivia.prototype.fullText = function () { - return this._text.substr(this._fullStart, this._fullWidth); - }; - DeferredTrivia.prototype.skippedToken = function () { - throw TypeScript.Errors.invalidOperation(); - }; - return DeferredTrivia; - })(AbstractTrivia); - function deferredTrivia(kind, text, fullStart, fullWidth) { - return new DeferredTrivia(kind, text, fullStart, fullWidth); - } - Syntax.deferredTrivia = deferredTrivia; - function skippedTokenTrivia(token, text) { - TypeScript.Debug.assert(!token.hasLeadingTrivia()); - TypeScript.Debug.assert(!token.hasTrailingTrivia()); - TypeScript.Debug.assert(token.fullWidth() > 0); - return new SkippedTokenTrivia(token, token.fullText(text)); - } - Syntax.skippedTokenTrivia = skippedTokenTrivia; - function splitMultiLineCommentTriviaIntoMultipleLines(trivia) { - var result = []; - var triviaText = trivia.fullText(); - var currentIndex = 0; - for (var i = 0; i < triviaText.length; i++) { - var ch = triviaText.charCodeAt(i); - switch (ch) { - case 13 /* carriageReturn */: - if (i < triviaText.length - 1 && triviaText.charCodeAt(i + 1) === 10 /* lineFeed */) { - i++; - } - case 10 /* lineFeed */: - case 8233 /* paragraphSeparator */: - case 8232 /* lineSeparator */: - result.push(triviaText.substring(currentIndex, i + 1)); - currentIndex = i + 1; - continue; - } - } - result.push(triviaText.substring(currentIndex)); - return result; - } - Syntax.splitMultiLineCommentTriviaIntoMultipleLines = splitMultiLineCommentTriviaIntoMultipleLines; - })(Syntax = TypeScript.Syntax || (TypeScript.Syntax = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Syntax; - (function (Syntax) { - var EmptyTriviaList = (function () { - function EmptyTriviaList() { - } - EmptyTriviaList.prototype.kind = function () { - return 3 /* TriviaList */; - }; - EmptyTriviaList.prototype.isShared = function () { - return true; - }; - EmptyTriviaList.prototype.count = function () { - return 0; - }; - EmptyTriviaList.prototype.syntaxTriviaAt = function (index) { - throw TypeScript.Errors.argumentOutOfRange("index"); - }; - EmptyTriviaList.prototype.last = function () { - throw TypeScript.Errors.argumentOutOfRange("index"); - }; - EmptyTriviaList.prototype.fullWidth = function () { - return 0; - }; - EmptyTriviaList.prototype.fullText = function () { - return ""; - }; - EmptyTriviaList.prototype.hasComment = function () { - return false; - }; - EmptyTriviaList.prototype.hasNewLine = function () { - return false; - }; - EmptyTriviaList.prototype.hasSkippedToken = function () { - return false; - }; - EmptyTriviaList.prototype.toArray = function () { - return []; - }; - EmptyTriviaList.prototype.clone = function () { - return this; - }; - return EmptyTriviaList; - })(); - ; - Syntax.emptyTriviaList = new EmptyTriviaList(); - function isComment(trivia) { - return trivia.kind() === 6 /* MultiLineCommentTrivia */ || trivia.kind() === 7 /* SingleLineCommentTrivia */; - } - var SingletonSyntaxTriviaList = (function () { - function SingletonSyntaxTriviaList(item) { - this.item = item.clone(); - this.item.parent = this; - } - SingletonSyntaxTriviaList.prototype.kind = function () { - return 3 /* TriviaList */; - }; - SingletonSyntaxTriviaList.prototype.isShared = function () { - return false; - }; - SingletonSyntaxTriviaList.prototype.count = function () { - return 1; - }; - SingletonSyntaxTriviaList.prototype.syntaxTriviaAt = function (index) { - if (index !== 0) { - throw TypeScript.Errors.argumentOutOfRange("index"); - } - return this.item; - }; - SingletonSyntaxTriviaList.prototype.last = function () { - return this.item; - }; - SingletonSyntaxTriviaList.prototype.fullWidth = function () { - return this.item.fullWidth(); - }; - SingletonSyntaxTriviaList.prototype.fullText = function () { - return this.item.fullText(); - }; - SingletonSyntaxTriviaList.prototype.hasComment = function () { - return isComment(this.item); - }; - SingletonSyntaxTriviaList.prototype.hasNewLine = function () { - return this.item.kind() === 5 /* NewLineTrivia */; - }; - SingletonSyntaxTriviaList.prototype.hasSkippedToken = function () { - return this.item.kind() === 8 /* SkippedTokenTrivia */; - }; - SingletonSyntaxTriviaList.prototype.toArray = function () { - return [this.item]; - }; - SingletonSyntaxTriviaList.prototype.clone = function () { - return new SingletonSyntaxTriviaList(this.item.clone()); - }; - return SingletonSyntaxTriviaList; - })(); - var NormalSyntaxTriviaList = (function () { - function NormalSyntaxTriviaList(trivia) { - var _this = this; - this.trivia = trivia.map(function (t) { - var cloned = t.clone(); - cloned.parent = _this; - return cloned; - }); - } - NormalSyntaxTriviaList.prototype.kind = function () { - return 3 /* TriviaList */; - }; - NormalSyntaxTriviaList.prototype.isShared = function () { - return false; - }; - NormalSyntaxTriviaList.prototype.count = function () { - return this.trivia.length; - }; - NormalSyntaxTriviaList.prototype.syntaxTriviaAt = function (index) { - if (index < 0 || index >= this.trivia.length) { - throw TypeScript.Errors.argumentOutOfRange("index"); - } - return this.trivia[index]; - }; - NormalSyntaxTriviaList.prototype.last = function () { - return this.trivia[this.trivia.length - 1]; - }; - NormalSyntaxTriviaList.prototype.fullWidth = function () { - return TypeScript.ArrayUtilities.sum(this.trivia, function (t) { return t.fullWidth(); }); - }; - NormalSyntaxTriviaList.prototype.fullText = function () { - var result = []; - for (var i = 0, n = this.trivia.length; i < n; i++) { - result.push(this.trivia[i].fullText()); - } - return result.join(""); - }; - NormalSyntaxTriviaList.prototype.hasComment = function () { - for (var i = 0; i < this.trivia.length; i++) { - if (isComment(this.trivia[i])) { - return true; - } - } - return false; - }; - NormalSyntaxTriviaList.prototype.hasNewLine = function () { - for (var i = 0; i < this.trivia.length; i++) { - if (this.trivia[i].kind() === 5 /* NewLineTrivia */) { - return true; - } - } - return false; - }; - NormalSyntaxTriviaList.prototype.hasSkippedToken = function () { - for (var i = 0; i < this.trivia.length; i++) { - if (this.trivia[i].kind() === 8 /* SkippedTokenTrivia */) { - return true; - } - } - return false; - }; - NormalSyntaxTriviaList.prototype.toArray = function () { - return this.trivia.slice(0); - }; - NormalSyntaxTriviaList.prototype.clone = function () { - return new NormalSyntaxTriviaList(this.trivia.map(function (t) { return t.clone(); })); - }; - return NormalSyntaxTriviaList; - })(); - function triviaList(trivia) { - if (trivia === undefined || trivia === null || trivia.length === 0) { - return Syntax.emptyTriviaList; - } - if (trivia.length === 1) { - return new SingletonSyntaxTriviaList(trivia[0]); - } - return new NormalSyntaxTriviaList(trivia); - } - Syntax.triviaList = triviaList; - })(Syntax = TypeScript.Syntax || (TypeScript.Syntax = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var SyntaxUtilities = (function () { - function SyntaxUtilities() { - } - SyntaxUtilities.isAnyFunctionExpressionOrDeclaration = function (ast) { - switch (ast.kind()) { - case 220 /* SimpleArrowFunctionExpression */: - case 219 /* ParenthesizedArrowFunctionExpression */: - case 223 /* FunctionExpression */: - case 130 /* FunctionDeclaration */: - case 136 /* MemberFunctionDeclaration */: - case 242 /* FunctionPropertyAssignment */: - case 138 /* ConstructorDeclaration */: - case 140 /* GetAccessor */: - case 141 /* SetAccessor */: - return true; - } - return false; - }; - SyntaxUtilities.isLastTokenOnLine = function (token, text) { - var _nextToken = TypeScript.nextToken(token, text); - if (_nextToken === null) { - return true; - } - var lineMap = text.lineMap(); - var tokenLine = lineMap.getLineNumberFromPosition(TypeScript.end(token, text)); - var nextTokenLine = lineMap.getLineNumberFromPosition(TypeScript.start(_nextToken, text)); - return tokenLine !== nextTokenLine; - }; - SyntaxUtilities.isLeftHandSizeExpression = function (element) { - if (element) { - switch (element.kind()) { - case 213 /* MemberAccessExpression */: - case 222 /* ElementAccessExpression */: - case 217 /* ObjectCreationExpression */: - case 214 /* InvocationExpression */: - case 215 /* ArrayLiteralExpression */: - case 218 /* ParenthesizedExpression */: - case 216 /* ObjectLiteralExpression */: - case 223 /* FunctionExpression */: - case 11 /* IdentifierName */: - case 12 /* RegularExpressionLiteral */: - case 13 /* NumericLiteral */: - case 14 /* StringLiteral */: - case 24 /* FalseKeyword */: - case 32 /* NullKeyword */: - case 35 /* ThisKeyword */: - case 37 /* TrueKeyword */: - case 50 /* SuperKeyword */: - return true; - } - } - return false; - }; - SyntaxUtilities.isExpression = function (element) { - if (element) { - switch (element.kind()) { - case 11 /* IdentifierName */: - case 12 /* RegularExpressionLiteral */: - case 13 /* NumericLiteral */: - case 14 /* StringLiteral */: - case 24 /* FalseKeyword */: - case 32 /* NullKeyword */: - case 35 /* ThisKeyword */: - case 37 /* TrueKeyword */: - case 50 /* SuperKeyword */: - case 165 /* PlusExpression */: - case 166 /* NegateExpression */: - case 167 /* BitwiseNotExpression */: - case 168 /* LogicalNotExpression */: - case 169 /* PreIncrementExpression */: - case 170 /* PreDecrementExpression */: - case 171 /* DeleteExpression */: - case 172 /* TypeOfExpression */: - case 173 /* VoidExpression */: - case 174 /* CommaExpression */: - case 175 /* AssignmentExpression */: - case 176 /* AddAssignmentExpression */: - case 177 /* SubtractAssignmentExpression */: - case 178 /* MultiplyAssignmentExpression */: - case 179 /* DivideAssignmentExpression */: - case 180 /* ModuloAssignmentExpression */: - case 181 /* AndAssignmentExpression */: - case 182 /* ExclusiveOrAssignmentExpression */: - case 183 /* OrAssignmentExpression */: - case 184 /* LeftShiftAssignmentExpression */: - case 185 /* SignedRightShiftAssignmentExpression */: - case 186 /* UnsignedRightShiftAssignmentExpression */: - case 187 /* ConditionalExpression */: - case 188 /* LogicalOrExpression */: - case 189 /* LogicalAndExpression */: - case 190 /* BitwiseOrExpression */: - case 191 /* BitwiseExclusiveOrExpression */: - case 192 /* BitwiseAndExpression */: - case 193 /* EqualsWithTypeConversionExpression */: - case 194 /* NotEqualsWithTypeConversionExpression */: - case 195 /* EqualsExpression */: - case 196 /* NotEqualsExpression */: - case 197 /* LessThanExpression */: - case 198 /* GreaterThanExpression */: - case 199 /* LessThanOrEqualExpression */: - case 200 /* GreaterThanOrEqualExpression */: - case 201 /* InstanceOfExpression */: - case 202 /* InExpression */: - case 203 /* LeftShiftExpression */: - case 204 /* SignedRightShiftExpression */: - case 205 /* UnsignedRightShiftExpression */: - case 206 /* MultiplyExpression */: - case 207 /* DivideExpression */: - case 208 /* ModuloExpression */: - case 209 /* AddExpression */: - case 210 /* SubtractExpression */: - case 211 /* PostIncrementExpression */: - case 212 /* PostDecrementExpression */: - case 213 /* MemberAccessExpression */: - case 214 /* InvocationExpression */: - case 215 /* ArrayLiteralExpression */: - case 216 /* ObjectLiteralExpression */: - case 217 /* ObjectCreationExpression */: - case 218 /* ParenthesizedExpression */: - case 219 /* ParenthesizedArrowFunctionExpression */: - case 220 /* SimpleArrowFunctionExpression */: - case 221 /* CastExpression */: - case 222 /* ElementAccessExpression */: - case 223 /* FunctionExpression */: - case 224 /* OmittedExpression */: - return true; - } - } - return false; - }; - SyntaxUtilities.isSwitchClause = function (element) { - if (element) { - switch (element.kind()) { - case 234 /* CaseSwitchClause */: - case 235 /* DefaultSwitchClause */: - return true; - } - } - return false; - }; - SyntaxUtilities.isTypeMember = function (element) { - if (element) { - switch (element.kind()) { - case 144 /* ConstructSignature */: - case 146 /* MethodSignature */: - case 145 /* IndexSignature */: - case 142 /* PropertySignature */: - case 143 /* CallSignature */: - return true; - } - } - return false; - }; - SyntaxUtilities.isClassElement = function (element) { - if (element) { - switch (element.kind()) { - case 138 /* ConstructorDeclaration */: - case 139 /* IndexMemberDeclaration */: - case 136 /* MemberFunctionDeclaration */: - case 140 /* GetAccessor */: - case 141 /* SetAccessor */: - case 136 /* MemberFunctionDeclaration */: - case 137 /* MemberVariableDeclaration */: - return true; - } - } - return false; - }; - SyntaxUtilities.isModuleElement = function (element) { - if (element) { - switch (element.kind()) { - case 134 /* ImportDeclaration */: - case 135 /* ExportAssignment */: - case 132 /* ClassDeclaration */: - case 129 /* InterfaceDeclaration */: - case 131 /* ModuleDeclaration */: - case 133 /* EnumDeclaration */: - case 130 /* FunctionDeclaration */: - case 149 /* VariableStatement */: - case 147 /* Block */: - case 148 /* IfStatement */: - case 150 /* ExpressionStatement */: - case 158 /* ThrowStatement */: - case 151 /* ReturnStatement */: - case 152 /* SwitchStatement */: - case 153 /* BreakStatement */: - case 154 /* ContinueStatement */: - case 156 /* ForInStatement */: - case 155 /* ForStatement */: - case 159 /* WhileStatement */: - case 164 /* WithStatement */: - case 157 /* EmptyStatement */: - case 160 /* TryStatement */: - case 161 /* LabeledStatement */: - case 162 /* DoStatement */: - case 163 /* DebuggerStatement */: - return true; - } - } - return false; - }; - SyntaxUtilities.isStatement = function (element) { - if (element) { - switch (element.kind()) { - case 130 /* FunctionDeclaration */: - case 149 /* VariableStatement */: - case 147 /* Block */: - case 148 /* IfStatement */: - case 150 /* ExpressionStatement */: - case 158 /* ThrowStatement */: - case 151 /* ReturnStatement */: - case 152 /* SwitchStatement */: - case 153 /* BreakStatement */: - case 154 /* ContinueStatement */: - case 156 /* ForInStatement */: - case 155 /* ForStatement */: - case 159 /* WhileStatement */: - case 164 /* WithStatement */: - case 157 /* EmptyStatement */: - case 160 /* TryStatement */: - case 161 /* LabeledStatement */: - case 162 /* DoStatement */: - case 163 /* DebuggerStatement */: - return true; - } - } - return false; - }; - SyntaxUtilities.isAngleBracket = function (positionedElement) { - var element = positionedElement; - var parent = positionedElement.parent; - if (parent !== null && (element.kind() === 80 /* LessThanToken */ || element.kind() === 81 /* GreaterThanToken */)) { - switch (parent.kind()) { - case 229 /* TypeArgumentList */: - case 230 /* TypeParameterList */: - case 221 /* CastExpression */: - return true; - } - } - return false; - }; - SyntaxUtilities.getToken = function (list, kind) { - for (var i = 0, n = list.length; i < n; i++) { - var token = list[i]; - if (token.kind() === kind) { - return token; - } - } - return null; - }; - SyntaxUtilities.containsToken = function (list, kind) { - return SyntaxUtilities.getToken(list, kind) !== null; - }; - SyntaxUtilities.hasExportKeyword = function (moduleElement) { - return SyntaxUtilities.getExportKeyword(moduleElement) !== null; - }; - SyntaxUtilities.getExportKeyword = function (moduleElement) { - switch (moduleElement.kind()) { - case 131 /* ModuleDeclaration */: - case 132 /* ClassDeclaration */: - case 130 /* FunctionDeclaration */: - case 149 /* VariableStatement */: - case 133 /* EnumDeclaration */: - case 129 /* InterfaceDeclaration */: - case 134 /* ImportDeclaration */: - return SyntaxUtilities.getToken(moduleElement.modifiers, 47 /* ExportKeyword */); - default: - return null; - } - }; - SyntaxUtilities.isAmbientDeclarationSyntax = function (positionNode) { - if (!positionNode) { - return false; - } - var node = positionNode; - switch (node.kind()) { - case 131 /* ModuleDeclaration */: - case 132 /* ClassDeclaration */: - case 130 /* FunctionDeclaration */: - case 149 /* VariableStatement */: - case 133 /* EnumDeclaration */: - if (SyntaxUtilities.containsToken(node.modifiers, 63 /* DeclareKeyword */)) { - return true; - } - case 134 /* ImportDeclaration */: - case 138 /* ConstructorDeclaration */: - case 136 /* MemberFunctionDeclaration */: - case 140 /* GetAccessor */: - case 141 /* SetAccessor */: - case 137 /* MemberVariableDeclaration */: - if (SyntaxUtilities.isClassElement(node) || SyntaxUtilities.isModuleElement(node)) { - return SyntaxUtilities.isAmbientDeclarationSyntax(TypeScript.Syntax.containingNode(positionNode)); - } - case 244 /* EnumElement */: - return SyntaxUtilities.isAmbientDeclarationSyntax(TypeScript.Syntax.containingNode(TypeScript.Syntax.containingNode(positionNode))); - default: - return SyntaxUtilities.isAmbientDeclarationSyntax(TypeScript.Syntax.containingNode(positionNode)); - } - }; - return SyntaxUtilities; - })(); - TypeScript.SyntaxUtilities = SyntaxUtilities; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - function visitNodeOrToken(visitor, element) { - if (element === null) { - return null; - } - if (TypeScript.isToken(element)) { - return visitor.visitToken(element); - } - switch (element.kind()) { - case 120 /* SourceUnit */: - return visitor.visitSourceUnit(element); - case 121 /* QualifiedName */: - return visitor.visitQualifiedName(element); - case 122 /* ObjectType */: - return visitor.visitObjectType(element); - case 123 /* FunctionType */: - return visitor.visitFunctionType(element); - case 124 /* ArrayType */: - return visitor.visitArrayType(element); - case 125 /* ConstructorType */: - return visitor.visitConstructorType(element); - case 126 /* GenericType */: - return visitor.visitGenericType(element); - case 127 /* TypeQuery */: - return visitor.visitTypeQuery(element); - case 128 /* TupleType */: - return visitor.visitTupleType(element); - case 129 /* InterfaceDeclaration */: - return visitor.visitInterfaceDeclaration(element); - case 130 /* FunctionDeclaration */: - return visitor.visitFunctionDeclaration(element); - case 131 /* ModuleDeclaration */: - return visitor.visitModuleDeclaration(element); - case 132 /* ClassDeclaration */: - return visitor.visitClassDeclaration(element); - case 133 /* EnumDeclaration */: - return visitor.visitEnumDeclaration(element); - case 134 /* ImportDeclaration */: - return visitor.visitImportDeclaration(element); - case 135 /* ExportAssignment */: - return visitor.visitExportAssignment(element); - case 136 /* MemberFunctionDeclaration */: - return visitor.visitMemberFunctionDeclaration(element); - case 137 /* MemberVariableDeclaration */: - return visitor.visitMemberVariableDeclaration(element); - case 138 /* ConstructorDeclaration */: - return visitor.visitConstructorDeclaration(element); - case 139 /* IndexMemberDeclaration */: - return visitor.visitIndexMemberDeclaration(element); - case 140 /* GetAccessor */: - return visitor.visitGetAccessor(element); - case 141 /* SetAccessor */: - return visitor.visitSetAccessor(element); - case 142 /* PropertySignature */: - return visitor.visitPropertySignature(element); - case 143 /* CallSignature */: - return visitor.visitCallSignature(element); - case 144 /* ConstructSignature */: - return visitor.visitConstructSignature(element); - case 145 /* IndexSignature */: - return visitor.visitIndexSignature(element); - case 146 /* MethodSignature */: - return visitor.visitMethodSignature(element); - case 147 /* Block */: - return visitor.visitBlock(element); - case 148 /* IfStatement */: - return visitor.visitIfStatement(element); - case 149 /* VariableStatement */: - return visitor.visitVariableStatement(element); - case 150 /* ExpressionStatement */: - return visitor.visitExpressionStatement(element); - case 151 /* ReturnStatement */: - return visitor.visitReturnStatement(element); - case 152 /* SwitchStatement */: - return visitor.visitSwitchStatement(element); - case 153 /* BreakStatement */: - return visitor.visitBreakStatement(element); - case 154 /* ContinueStatement */: - return visitor.visitContinueStatement(element); - case 155 /* ForStatement */: - return visitor.visitForStatement(element); - case 156 /* ForInStatement */: - return visitor.visitForInStatement(element); - case 157 /* EmptyStatement */: - return visitor.visitEmptyStatement(element); - case 158 /* ThrowStatement */: - return visitor.visitThrowStatement(element); - case 159 /* WhileStatement */: - return visitor.visitWhileStatement(element); - case 160 /* TryStatement */: - return visitor.visitTryStatement(element); - case 161 /* LabeledStatement */: - return visitor.visitLabeledStatement(element); - case 162 /* DoStatement */: - return visitor.visitDoStatement(element); - case 163 /* DebuggerStatement */: - return visitor.visitDebuggerStatement(element); - case 164 /* WithStatement */: - return visitor.visitWithStatement(element); - case 169 /* PreIncrementExpression */: - case 170 /* PreDecrementExpression */: - case 165 /* PlusExpression */: - case 166 /* NegateExpression */: - case 167 /* BitwiseNotExpression */: - case 168 /* LogicalNotExpression */: - return visitor.visitPrefixUnaryExpression(element); - case 171 /* DeleteExpression */: - return visitor.visitDeleteExpression(element); - case 172 /* TypeOfExpression */: - return visitor.visitTypeOfExpression(element); - case 173 /* VoidExpression */: - return visitor.visitVoidExpression(element); - case 187 /* ConditionalExpression */: - return visitor.visitConditionalExpression(element); - case 206 /* MultiplyExpression */: - case 207 /* DivideExpression */: - case 208 /* ModuloExpression */: - case 209 /* AddExpression */: - case 210 /* SubtractExpression */: - case 203 /* LeftShiftExpression */: - case 204 /* SignedRightShiftExpression */: - case 205 /* UnsignedRightShiftExpression */: - case 197 /* LessThanExpression */: - case 198 /* GreaterThanExpression */: - case 199 /* LessThanOrEqualExpression */: - case 200 /* GreaterThanOrEqualExpression */: - case 201 /* InstanceOfExpression */: - case 202 /* InExpression */: - case 193 /* EqualsWithTypeConversionExpression */: - case 194 /* NotEqualsWithTypeConversionExpression */: - case 195 /* EqualsExpression */: - case 196 /* NotEqualsExpression */: - case 192 /* BitwiseAndExpression */: - case 191 /* BitwiseExclusiveOrExpression */: - case 190 /* BitwiseOrExpression */: - case 189 /* LogicalAndExpression */: - case 188 /* LogicalOrExpression */: - case 183 /* OrAssignmentExpression */: - case 181 /* AndAssignmentExpression */: - case 182 /* ExclusiveOrAssignmentExpression */: - case 184 /* LeftShiftAssignmentExpression */: - case 185 /* SignedRightShiftAssignmentExpression */: - case 186 /* UnsignedRightShiftAssignmentExpression */: - case 176 /* AddAssignmentExpression */: - case 177 /* SubtractAssignmentExpression */: - case 178 /* MultiplyAssignmentExpression */: - case 179 /* DivideAssignmentExpression */: - case 180 /* ModuloAssignmentExpression */: - case 175 /* AssignmentExpression */: - case 174 /* CommaExpression */: - return visitor.visitBinaryExpression(element); - case 211 /* PostIncrementExpression */: - case 212 /* PostDecrementExpression */: - return visitor.visitPostfixUnaryExpression(element); - case 213 /* MemberAccessExpression */: - return visitor.visitMemberAccessExpression(element); - case 214 /* InvocationExpression */: - return visitor.visitInvocationExpression(element); - case 215 /* ArrayLiteralExpression */: - return visitor.visitArrayLiteralExpression(element); - case 216 /* ObjectLiteralExpression */: - return visitor.visitObjectLiteralExpression(element); - case 217 /* ObjectCreationExpression */: - return visitor.visitObjectCreationExpression(element); - case 218 /* ParenthesizedExpression */: - return visitor.visitParenthesizedExpression(element); - case 219 /* ParenthesizedArrowFunctionExpression */: - return visitor.visitParenthesizedArrowFunctionExpression(element); - case 220 /* SimpleArrowFunctionExpression */: - return visitor.visitSimpleArrowFunctionExpression(element); - case 221 /* CastExpression */: - return visitor.visitCastExpression(element); - case 222 /* ElementAccessExpression */: - return visitor.visitElementAccessExpression(element); - case 223 /* FunctionExpression */: - return visitor.visitFunctionExpression(element); - case 224 /* OmittedExpression */: - return visitor.visitOmittedExpression(element); - case 225 /* VariableDeclaration */: - return visitor.visitVariableDeclaration(element); - case 226 /* VariableDeclarator */: - return visitor.visitVariableDeclarator(element); - case 227 /* ArgumentList */: - return visitor.visitArgumentList(element); - case 228 /* ParameterList */: - return visitor.visitParameterList(element); - case 229 /* TypeArgumentList */: - return visitor.visitTypeArgumentList(element); - case 230 /* TypeParameterList */: - return visitor.visitTypeParameterList(element); - case 231 /* ExtendsHeritageClause */: - case 232 /* ImplementsHeritageClause */: - return visitor.visitHeritageClause(element); - case 233 /* EqualsValueClause */: - return visitor.visitEqualsValueClause(element); - case 234 /* CaseSwitchClause */: - return visitor.visitCaseSwitchClause(element); - case 235 /* DefaultSwitchClause */: - return visitor.visitDefaultSwitchClause(element); - case 236 /* ElseClause */: - return visitor.visitElseClause(element); - case 237 /* CatchClause */: - return visitor.visitCatchClause(element); - case 238 /* FinallyClause */: - return visitor.visitFinallyClause(element); - case 239 /* TypeParameter */: - return visitor.visitTypeParameter(element); - case 240 /* Constraint */: - return visitor.visitConstraint(element); - case 241 /* SimplePropertyAssignment */: - return visitor.visitSimplePropertyAssignment(element); - case 242 /* FunctionPropertyAssignment */: - return visitor.visitFunctionPropertyAssignment(element); - case 243 /* Parameter */: - return visitor.visitParameter(element); - case 244 /* EnumElement */: - return visitor.visitEnumElement(element); - case 245 /* TypeAnnotation */: - return visitor.visitTypeAnnotation(element); - case 246 /* ExternalModuleReference */: - return visitor.visitExternalModuleReference(element); - case 247 /* ModuleNameModuleReference */: - return visitor.visitModuleNameModuleReference(element); - } - throw TypeScript.Errors.invalidOperation(); - } - TypeScript.visitNodeOrToken = visitNodeOrToken; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var SyntaxWalker = (function () { - function SyntaxWalker() { - } - SyntaxWalker.prototype.visitToken = function (token) { - }; - SyntaxWalker.prototype.visitNode = function (node) { - TypeScript.visitNodeOrToken(this, node); - }; - SyntaxWalker.prototype.visitNodeOrToken = function (nodeOrToken) { - if (TypeScript.isToken(nodeOrToken)) { - this.visitToken(nodeOrToken); - } - else { - this.visitNode(nodeOrToken); - } - }; - SyntaxWalker.prototype.visitOptionalToken = function (token) { - if (token === null) { - return; - } - this.visitToken(token); - }; - SyntaxWalker.prototype.visitOptionalNode = function (node) { - if (node === null) { - return; - } - this.visitNode(node); - }; - SyntaxWalker.prototype.visitOptionalNodeOrToken = function (nodeOrToken) { - if (nodeOrToken === null) { - return; - } - this.visitNodeOrToken(nodeOrToken); - }; - SyntaxWalker.prototype.visitList = function (list) { - for (var i = 0, n = list.length; i < n; i++) { - this.visitNodeOrToken(list[i]); - } - }; - SyntaxWalker.prototype.visitSeparatedList = function (list) { - for (var i = 0, n = TypeScript.childCount(list); i < n; i++) { - var item = TypeScript.childAt(list, i); - this.visitNodeOrToken(item); - } - }; - SyntaxWalker.prototype.visitSourceUnit = function (node) { - this.visitList(node.moduleElements); - this.visitToken(node.endOfFileToken); - }; - SyntaxWalker.prototype.visitQualifiedName = function (node) { - this.visitNodeOrToken(node.left); - this.visitToken(node.dotToken); - this.visitToken(node.right); - }; - SyntaxWalker.prototype.visitObjectType = function (node) { - this.visitToken(node.openBraceToken); - this.visitSeparatedList(node.typeMembers); - this.visitToken(node.closeBraceToken); - }; - SyntaxWalker.prototype.visitFunctionType = function (node) { - this.visitOptionalNode(node.typeParameterList); - this.visitNode(node.parameterList); - this.visitToken(node.equalsGreaterThanToken); - this.visitNodeOrToken(node.type); - }; - SyntaxWalker.prototype.visitArrayType = function (node) { - this.visitNodeOrToken(node.type); - this.visitToken(node.openBracketToken); - this.visitToken(node.closeBracketToken); - }; - SyntaxWalker.prototype.visitConstructorType = function (node) { - this.visitToken(node.newKeyword); - this.visitOptionalNode(node.typeParameterList); - this.visitNode(node.parameterList); - this.visitToken(node.equalsGreaterThanToken); - this.visitNodeOrToken(node.type); - }; - SyntaxWalker.prototype.visitGenericType = function (node) { - this.visitNodeOrToken(node.name); - this.visitNode(node.typeArgumentList); - }; - SyntaxWalker.prototype.visitTypeQuery = function (node) { - this.visitToken(node.typeOfKeyword); - this.visitNodeOrToken(node.name); - }; - SyntaxWalker.prototype.visitTupleType = function (node) { - this.visitToken(node.openBracketToken); - this.visitSeparatedList(node.types); - this.visitToken(node.closeBracketToken); - }; - SyntaxWalker.prototype.visitInterfaceDeclaration = function (node) { - this.visitList(node.modifiers); - this.visitToken(node.interfaceKeyword); - this.visitToken(node.identifier); - this.visitOptionalNode(node.typeParameterList); - this.visitList(node.heritageClauses); - this.visitNode(node.body); - }; - SyntaxWalker.prototype.visitFunctionDeclaration = function (node) { - this.visitList(node.modifiers); - this.visitToken(node.functionKeyword); - this.visitToken(node.identifier); - this.visitNode(node.callSignature); - this.visitOptionalNode(node.block); - this.visitOptionalToken(node.semicolonToken); - }; - SyntaxWalker.prototype.visitModuleDeclaration = function (node) { - this.visitList(node.modifiers); - this.visitToken(node.moduleKeyword); - this.visitOptionalNodeOrToken(node.name); - this.visitOptionalToken(node.stringLiteral); - this.visitToken(node.openBraceToken); - this.visitList(node.moduleElements); - this.visitToken(node.closeBraceToken); - }; - SyntaxWalker.prototype.visitClassDeclaration = function (node) { - this.visitList(node.modifiers); - this.visitToken(node.classKeyword); - this.visitToken(node.identifier); - this.visitOptionalNode(node.typeParameterList); - this.visitList(node.heritageClauses); - this.visitToken(node.openBraceToken); - this.visitList(node.classElements); - this.visitToken(node.closeBraceToken); - }; - SyntaxWalker.prototype.visitEnumDeclaration = function (node) { - this.visitList(node.modifiers); - this.visitToken(node.enumKeyword); - this.visitToken(node.identifier); - this.visitToken(node.openBraceToken); - this.visitSeparatedList(node.enumElements); - this.visitToken(node.closeBraceToken); - }; - SyntaxWalker.prototype.visitImportDeclaration = function (node) { - this.visitList(node.modifiers); - this.visitToken(node.importKeyword); - this.visitToken(node.identifier); - this.visitToken(node.equalsToken); - this.visitNodeOrToken(node.moduleReference); - this.visitOptionalToken(node.semicolonToken); - }; - SyntaxWalker.prototype.visitExportAssignment = function (node) { - this.visitToken(node.exportKeyword); - this.visitToken(node.equalsToken); - this.visitToken(node.identifier); - this.visitOptionalToken(node.semicolonToken); - }; - SyntaxWalker.prototype.visitMemberFunctionDeclaration = function (node) { - this.visitList(node.modifiers); - this.visitToken(node.propertyName); - this.visitNode(node.callSignature); - this.visitOptionalNode(node.block); - this.visitOptionalToken(node.semicolonToken); - }; - SyntaxWalker.prototype.visitMemberVariableDeclaration = function (node) { - this.visitList(node.modifiers); - this.visitNode(node.variableDeclarator); - this.visitOptionalToken(node.semicolonToken); - }; - SyntaxWalker.prototype.visitConstructorDeclaration = function (node) { - this.visitList(node.modifiers); - this.visitToken(node.constructorKeyword); - this.visitNode(node.callSignature); - this.visitOptionalNode(node.block); - this.visitOptionalToken(node.semicolonToken); - }; - SyntaxWalker.prototype.visitIndexMemberDeclaration = function (node) { - this.visitList(node.modifiers); - this.visitNode(node.indexSignature); - this.visitOptionalToken(node.semicolonToken); - }; - SyntaxWalker.prototype.visitGetAccessor = function (node) { - this.visitList(node.modifiers); - this.visitToken(node.getKeyword); - this.visitToken(node.propertyName); - this.visitNode(node.callSignature); - this.visitNode(node.block); - }; - SyntaxWalker.prototype.visitSetAccessor = function (node) { - this.visitList(node.modifiers); - this.visitToken(node.setKeyword); - this.visitToken(node.propertyName); - this.visitNode(node.callSignature); - this.visitNode(node.block); - }; - SyntaxWalker.prototype.visitPropertySignature = function (node) { - this.visitToken(node.propertyName); - this.visitOptionalToken(node.questionToken); - this.visitOptionalNode(node.typeAnnotation); - }; - SyntaxWalker.prototype.visitCallSignature = function (node) { - this.visitOptionalNode(node.typeParameterList); - this.visitNode(node.parameterList); - this.visitOptionalNode(node.typeAnnotation); - }; - SyntaxWalker.prototype.visitConstructSignature = function (node) { - this.visitToken(node.newKeyword); - this.visitNode(node.callSignature); - }; - SyntaxWalker.prototype.visitIndexSignature = function (node) { - this.visitToken(node.openBracketToken); - this.visitSeparatedList(node.parameters); - this.visitToken(node.closeBracketToken); - this.visitOptionalNode(node.typeAnnotation); - }; - SyntaxWalker.prototype.visitMethodSignature = function (node) { - this.visitToken(node.propertyName); - this.visitOptionalToken(node.questionToken); - this.visitNode(node.callSignature); - }; - SyntaxWalker.prototype.visitBlock = function (node) { - this.visitToken(node.openBraceToken); - this.visitList(node.statements); - this.visitToken(node.closeBraceToken); - }; - SyntaxWalker.prototype.visitIfStatement = function (node) { - this.visitToken(node.ifKeyword); - this.visitToken(node.openParenToken); - this.visitNodeOrToken(node.condition); - this.visitToken(node.closeParenToken); - this.visitNodeOrToken(node.statement); - this.visitOptionalNode(node.elseClause); - }; - SyntaxWalker.prototype.visitVariableStatement = function (node) { - this.visitList(node.modifiers); - this.visitNode(node.variableDeclaration); - this.visitOptionalToken(node.semicolonToken); - }; - SyntaxWalker.prototype.visitExpressionStatement = function (node) { - this.visitNodeOrToken(node.expression); - this.visitOptionalToken(node.semicolonToken); - }; - SyntaxWalker.prototype.visitReturnStatement = function (node) { - this.visitToken(node.returnKeyword); - this.visitOptionalNodeOrToken(node.expression); - this.visitOptionalToken(node.semicolonToken); - }; - SyntaxWalker.prototype.visitSwitchStatement = function (node) { - this.visitToken(node.switchKeyword); - this.visitToken(node.openParenToken); - this.visitNodeOrToken(node.expression); - this.visitToken(node.closeParenToken); - this.visitToken(node.openBraceToken); - this.visitList(node.switchClauses); - this.visitToken(node.closeBraceToken); - }; - SyntaxWalker.prototype.visitBreakStatement = function (node) { - this.visitToken(node.breakKeyword); - this.visitOptionalToken(node.identifier); - this.visitOptionalToken(node.semicolonToken); - }; - SyntaxWalker.prototype.visitContinueStatement = function (node) { - this.visitToken(node.continueKeyword); - this.visitOptionalToken(node.identifier); - this.visitOptionalToken(node.semicolonToken); - }; - SyntaxWalker.prototype.visitForStatement = function (node) { - this.visitToken(node.forKeyword); - this.visitToken(node.openParenToken); - this.visitOptionalNode(node.variableDeclaration); - this.visitOptionalNodeOrToken(node.initializer); - this.visitToken(node.firstSemicolonToken); - this.visitOptionalNodeOrToken(node.condition); - this.visitToken(node.secondSemicolonToken); - this.visitOptionalNodeOrToken(node.incrementor); - this.visitToken(node.closeParenToken); - this.visitNodeOrToken(node.statement); - }; - SyntaxWalker.prototype.visitForInStatement = function (node) { - this.visitToken(node.forKeyword); - this.visitToken(node.openParenToken); - this.visitOptionalNode(node.variableDeclaration); - this.visitOptionalNodeOrToken(node.left); - this.visitToken(node.inKeyword); - this.visitNodeOrToken(node.expression); - this.visitToken(node.closeParenToken); - this.visitNodeOrToken(node.statement); - }; - SyntaxWalker.prototype.visitEmptyStatement = function (node) { - this.visitToken(node.semicolonToken); - }; - SyntaxWalker.prototype.visitThrowStatement = function (node) { - this.visitToken(node.throwKeyword); - this.visitNodeOrToken(node.expression); - this.visitOptionalToken(node.semicolonToken); - }; - SyntaxWalker.prototype.visitWhileStatement = function (node) { - this.visitToken(node.whileKeyword); - this.visitToken(node.openParenToken); - this.visitNodeOrToken(node.condition); - this.visitToken(node.closeParenToken); - this.visitNodeOrToken(node.statement); - }; - SyntaxWalker.prototype.visitTryStatement = function (node) { - this.visitToken(node.tryKeyword); - this.visitNode(node.block); - this.visitOptionalNode(node.catchClause); - this.visitOptionalNode(node.finallyClause); - }; - SyntaxWalker.prototype.visitLabeledStatement = function (node) { - this.visitToken(node.identifier); - this.visitToken(node.colonToken); - this.visitNodeOrToken(node.statement); - }; - SyntaxWalker.prototype.visitDoStatement = function (node) { - this.visitToken(node.doKeyword); - this.visitNodeOrToken(node.statement); - this.visitToken(node.whileKeyword); - this.visitToken(node.openParenToken); - this.visitNodeOrToken(node.condition); - this.visitToken(node.closeParenToken); - this.visitOptionalToken(node.semicolonToken); - }; - SyntaxWalker.prototype.visitDebuggerStatement = function (node) { - this.visitToken(node.debuggerKeyword); - this.visitOptionalToken(node.semicolonToken); - }; - SyntaxWalker.prototype.visitWithStatement = function (node) { - this.visitToken(node.withKeyword); - this.visitToken(node.openParenToken); - this.visitNodeOrToken(node.condition); - this.visitToken(node.closeParenToken); - this.visitNodeOrToken(node.statement); - }; - SyntaxWalker.prototype.visitPrefixUnaryExpression = function (node) { - this.visitToken(node.operatorToken); - this.visitNodeOrToken(node.operand); - }; - SyntaxWalker.prototype.visitDeleteExpression = function (node) { - this.visitToken(node.deleteKeyword); - this.visitNodeOrToken(node.expression); - }; - SyntaxWalker.prototype.visitTypeOfExpression = function (node) { - this.visitToken(node.typeOfKeyword); - this.visitNodeOrToken(node.expression); - }; - SyntaxWalker.prototype.visitVoidExpression = function (node) { - this.visitToken(node.voidKeyword); - this.visitNodeOrToken(node.expression); - }; - SyntaxWalker.prototype.visitConditionalExpression = function (node) { - this.visitNodeOrToken(node.condition); - this.visitToken(node.questionToken); - this.visitNodeOrToken(node.whenTrue); - this.visitToken(node.colonToken); - this.visitNodeOrToken(node.whenFalse); - }; - SyntaxWalker.prototype.visitBinaryExpression = function (node) { - this.visitNodeOrToken(node.left); - this.visitToken(node.operatorToken); - this.visitNodeOrToken(node.right); - }; - SyntaxWalker.prototype.visitPostfixUnaryExpression = function (node) { - this.visitNodeOrToken(node.operand); - this.visitToken(node.operatorToken); - }; - SyntaxWalker.prototype.visitMemberAccessExpression = function (node) { - this.visitNodeOrToken(node.expression); - this.visitToken(node.dotToken); - this.visitToken(node.name); - }; - SyntaxWalker.prototype.visitInvocationExpression = function (node) { - this.visitNodeOrToken(node.expression); - this.visitNode(node.argumentList); - }; - SyntaxWalker.prototype.visitArrayLiteralExpression = function (node) { - this.visitToken(node.openBracketToken); - this.visitSeparatedList(node.expressions); - this.visitToken(node.closeBracketToken); - }; - SyntaxWalker.prototype.visitObjectLiteralExpression = function (node) { - this.visitToken(node.openBraceToken); - this.visitSeparatedList(node.propertyAssignments); - this.visitToken(node.closeBraceToken); - }; - SyntaxWalker.prototype.visitObjectCreationExpression = function (node) { - this.visitToken(node.newKeyword); - this.visitNodeOrToken(node.expression); - this.visitOptionalNode(node.argumentList); - }; - SyntaxWalker.prototype.visitParenthesizedExpression = function (node) { - this.visitToken(node.openParenToken); - this.visitNodeOrToken(node.expression); - this.visitToken(node.closeParenToken); - }; - SyntaxWalker.prototype.visitParenthesizedArrowFunctionExpression = function (node) { - this.visitNode(node.callSignature); - this.visitToken(node.equalsGreaterThanToken); - this.visitOptionalNode(node.block); - this.visitOptionalNodeOrToken(node.expression); - }; - SyntaxWalker.prototype.visitSimpleArrowFunctionExpression = function (node) { - this.visitNode(node.parameter); - this.visitToken(node.equalsGreaterThanToken); - this.visitOptionalNode(node.block); - this.visitOptionalNodeOrToken(node.expression); - }; - SyntaxWalker.prototype.visitCastExpression = function (node) { - this.visitToken(node.lessThanToken); - this.visitNodeOrToken(node.type); - this.visitToken(node.greaterThanToken); - this.visitNodeOrToken(node.expression); - }; - SyntaxWalker.prototype.visitElementAccessExpression = function (node) { - this.visitNodeOrToken(node.expression); - this.visitToken(node.openBracketToken); - this.visitNodeOrToken(node.argumentExpression); - this.visitToken(node.closeBracketToken); - }; - SyntaxWalker.prototype.visitFunctionExpression = function (node) { - this.visitToken(node.functionKeyword); - this.visitOptionalToken(node.identifier); - this.visitNode(node.callSignature); - this.visitNode(node.block); - }; - SyntaxWalker.prototype.visitOmittedExpression = function (node) { - }; - SyntaxWalker.prototype.visitVariableDeclaration = function (node) { - this.visitToken(node.varKeyword); - this.visitSeparatedList(node.variableDeclarators); - }; - SyntaxWalker.prototype.visitVariableDeclarator = function (node) { - this.visitToken(node.propertyName); - this.visitOptionalNode(node.typeAnnotation); - this.visitOptionalNode(node.equalsValueClause); - }; - SyntaxWalker.prototype.visitArgumentList = function (node) { - this.visitOptionalNode(node.typeArgumentList); - this.visitToken(node.openParenToken); - this.visitSeparatedList(node.arguments); - this.visitToken(node.closeParenToken); - }; - SyntaxWalker.prototype.visitParameterList = function (node) { - this.visitToken(node.openParenToken); - this.visitSeparatedList(node.parameters); - this.visitToken(node.closeParenToken); - }; - SyntaxWalker.prototype.visitTypeArgumentList = function (node) { - this.visitToken(node.lessThanToken); - this.visitSeparatedList(node.typeArguments); - this.visitToken(node.greaterThanToken); - }; - SyntaxWalker.prototype.visitTypeParameterList = function (node) { - this.visitToken(node.lessThanToken); - this.visitSeparatedList(node.typeParameters); - this.visitToken(node.greaterThanToken); - }; - SyntaxWalker.prototype.visitHeritageClause = function (node) { - this.visitToken(node.extendsOrImplementsKeyword); - this.visitSeparatedList(node.typeNames); - }; - SyntaxWalker.prototype.visitEqualsValueClause = function (node) { - this.visitToken(node.equalsToken); - this.visitNodeOrToken(node.value); - }; - SyntaxWalker.prototype.visitCaseSwitchClause = function (node) { - this.visitToken(node.caseKeyword); - this.visitNodeOrToken(node.expression); - this.visitToken(node.colonToken); - this.visitList(node.statements); - }; - SyntaxWalker.prototype.visitDefaultSwitchClause = function (node) { - this.visitToken(node.defaultKeyword); - this.visitToken(node.colonToken); - this.visitList(node.statements); - }; - SyntaxWalker.prototype.visitElseClause = function (node) { - this.visitToken(node.elseKeyword); - this.visitNodeOrToken(node.statement); - }; - SyntaxWalker.prototype.visitCatchClause = function (node) { - this.visitToken(node.catchKeyword); - this.visitToken(node.openParenToken); - this.visitToken(node.identifier); - this.visitOptionalNode(node.typeAnnotation); - this.visitToken(node.closeParenToken); - this.visitNode(node.block); - }; - SyntaxWalker.prototype.visitFinallyClause = function (node) { - this.visitToken(node.finallyKeyword); - this.visitNode(node.block); - }; - SyntaxWalker.prototype.visitTypeParameter = function (node) { - this.visitToken(node.identifier); - this.visitOptionalNode(node.constraint); - }; - SyntaxWalker.prototype.visitConstraint = function (node) { - this.visitToken(node.extendsKeyword); - this.visitNodeOrToken(node.typeOrExpression); - }; - SyntaxWalker.prototype.visitSimplePropertyAssignment = function (node) { - this.visitToken(node.propertyName); - this.visitToken(node.colonToken); - this.visitNodeOrToken(node.expression); - }; - SyntaxWalker.prototype.visitFunctionPropertyAssignment = function (node) { - this.visitToken(node.propertyName); - this.visitNode(node.callSignature); - this.visitNode(node.block); - }; - SyntaxWalker.prototype.visitParameter = function (node) { - this.visitOptionalToken(node.dotDotDotToken); - this.visitList(node.modifiers); - this.visitToken(node.identifier); - this.visitOptionalToken(node.questionToken); - this.visitOptionalNode(node.typeAnnotation); - this.visitOptionalNode(node.equalsValueClause); - }; - SyntaxWalker.prototype.visitEnumElement = function (node) { - this.visitToken(node.propertyName); - this.visitOptionalNode(node.equalsValueClause); - }; - SyntaxWalker.prototype.visitTypeAnnotation = function (node) { - this.visitToken(node.colonToken); - this.visitNodeOrToken(node.type); - }; - SyntaxWalker.prototype.visitExternalModuleReference = function (node) { - this.visitToken(node.requireKeyword); - this.visitToken(node.openParenToken); - this.visitToken(node.stringLiteral); - this.visitToken(node.closeParenToken); - }; - SyntaxWalker.prototype.visitModuleNameModuleReference = function (node) { - this.visitNodeOrToken(node.moduleName); - }; - return SyntaxWalker; - })(); - TypeScript.SyntaxWalker = SyntaxWalker; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var DepthLimitedWalker = (function (_super) { - __extends(DepthLimitedWalker, _super); - function DepthLimitedWalker(maximumDepth) { - _super.call(this); - this._depth = 0; - this._maximumDepth = 0; - this._maximumDepth = maximumDepth; - } - DepthLimitedWalker.prototype.visitNode = function (node) { - if (this._depth < this._maximumDepth) { - this._depth++; - _super.prototype.visitNode.call(this, node); - this._depth--; - } - }; - return DepthLimitedWalker; - })(TypeScript.SyntaxWalker); - TypeScript.DepthLimitedWalker = DepthLimitedWalker; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Parser; - (function (Parser) { - Parser.syntaxFactory; - var arrayPool = []; - var arrayPoolCount = 0; - function getArray() { - if (arrayPoolCount === 0) { - return []; - } - arrayPoolCount--; - var result = arrayPool[arrayPoolCount]; - arrayPool[arrayPoolCount] = null; - return result; - } - function returnZeroLengthArray(array) { - if (array.length === 0) { - returnArray(array); - } - } - function returnArray(array) { - array.length = 0; - arrayPool[arrayPoolCount] = array; - arrayPoolCount++; - } - function createParseSyntaxTree() { - var fileName; - var source; - var languageVersion; - var listParsingState = 0; - var isInStrictMode = false; - var diagnostics = []; - var parseNodeData = 0; - function parseSyntaxTree(_source, isDeclaration) { - fileName = _source.fileName; - source = _source; - languageVersion = source.languageVersion; - var result = parseSyntaxTreeWorker(isDeclaration); - diagnostics = []; - parseNodeData = 0 /* None */; - fileName = null; - source.release(); - source = null; - _source = null; - return result; - } - function parseSyntaxTreeWorker(isDeclaration) { - var sourceUnit = parseSourceUnit(); - var allDiagnostics = source.tokenDiagnostics().concat(diagnostics); - allDiagnostics.sort(function (a, b) { return a.start() - b.start(); }); - return new TypeScript.SyntaxTree(Parser.syntaxFactory.isConcrete, sourceUnit, isDeclaration, allDiagnostics, fileName, source.text, languageVersion); - } - function getRewindPoint() { - var rewindPoint = source.getRewindPoint(); - rewindPoint.diagnosticsCount = diagnostics.length; - rewindPoint.isInStrictMode = isInStrictMode; - rewindPoint.listParsingState = listParsingState; - return rewindPoint; - } - function rewind(rewindPoint) { - source.rewind(rewindPoint); - diagnostics.length = rewindPoint.diagnosticsCount; - } - function releaseRewindPoint(rewindPoint) { - source.releaseRewindPoint(rewindPoint); - } - function currentNode() { - var node = source.currentNode(); - if (node === null || TypeScript.parsedInStrictMode(node) !== isInStrictMode) { - return null; - } - return node; - } - function currentToken() { - return source.currentToken(); - } - function currentContextualToken() { - return source.currentContextualToken(); - } - function peekToken(n) { - return source.peekToken(n); - } - function consumeToken(token) { - source.consumeToken(token); - return token; - } - function consumeNode(node) { - source.consumeNode(node); - } - function eatToken(kind) { - var token = currentToken(); - if (token.kind() === kind) { - return consumeToken(token); - } - return createMissingToken(kind, token); - } - function tryEatToken(kind) { - var _currentToken = currentToken(); - if (_currentToken.kind() === kind) { - return consumeToken(_currentToken); - } - return null; - } - function isIdentifier(token) { - var tokenKind = token.kind(); - if (tokenKind === 11 /* IdentifierName */) { - return true; - } - if (tokenKind >= TypeScript.SyntaxKind.FirstFutureReservedStrictKeyword) { - if (tokenKind <= TypeScript.SyntaxKind.LastFutureReservedStrictKeyword) { - return !isInStrictMode; - } - return tokenKind <= TypeScript.SyntaxKind.LastTypeScriptKeyword; - } - return false; - } - function eatIdentifierNameToken() { - var token = currentToken(); - var tokenKind = token.kind(); - if (tokenKind === 11 /* IdentifierName */) { - return consumeToken(token); - } - if (TypeScript.SyntaxFacts.isAnyKeyword(tokenKind)) { - return TypeScript.Syntax.convertKeywordToIdentifier(consumeToken(token)); - } - return createMissingToken(11 /* IdentifierName */, token); - } - function eatOptionalIdentifierToken() { - return isIdentifier(currentToken()) ? eatIdentifierToken() : null; - } - function eatIdentifierToken(diagnosticCode) { - var token = currentToken(); - if (isIdentifier(token)) { - consumeToken(token); - if (token.kind() === 11 /* IdentifierName */) { - return token; - } - return TypeScript.Syntax.convertKeywordToIdentifier(token); - } - return createMissingToken(11 /* IdentifierName */, token, diagnosticCode); - } - function previousTokenHasTrailingNewLine(token) { - var tokenFullStart = token.fullStart(); - if (tokenFullStart === 0) { - return false; - } - var lineNumber = source.text.lineMap().getLineNumberFromPosition(tokenFullStart); - var lineStart = source.text.lineMap().getLineStartPosition(lineNumber); - return lineStart == tokenFullStart; - } - function canEatAutomaticSemicolon(allowWithoutNewLine) { - var token = currentToken(); - var tokenKind = token.kind(); - if (tokenKind === 10 /* EndOfFileToken */) { - return true; - } - if (tokenKind === 71 /* CloseBraceToken */) { - return true; - } - if (allowWithoutNewLine) { - return true; - } - if (previousTokenHasTrailingNewLine(token)) { - return true; - } - return false; - } - function canEatExplicitOrAutomaticSemicolon(allowWithoutNewline) { - var token = currentToken(); - if (token.kind() === 78 /* SemicolonToken */) { - return true; - } - return canEatAutomaticSemicolon(allowWithoutNewline); - } - function eatExplicitOrAutomaticSemicolon(allowWithoutNewline) { - var token = currentToken(); - if (token.kind() === 78 /* SemicolonToken */) { - return consumeToken(token); - } - if (canEatAutomaticSemicolon(allowWithoutNewline)) { - return null; - } - return eatToken(78 /* SemicolonToken */); - } - function createMissingToken(expectedKind, actual, diagnosticCode) { - var diagnostic = getExpectedTokenDiagnostic(expectedKind, actual, diagnosticCode); - addDiagnostic(diagnostic); - return TypeScript.Syntax.emptyToken(expectedKind); - } - function getExpectedTokenDiagnostic(expectedKind, actual, diagnosticCode) { - var token = currentToken(); - var args = null; - if (!diagnosticCode) { - if (TypeScript.SyntaxFacts.isAnyKeyword(expectedKind) || TypeScript.SyntaxFacts.isAnyPunctuation(expectedKind)) { - diagnosticCode = TypeScript.DiagnosticCode._0_expected; - args = [TypeScript.SyntaxFacts.getText(expectedKind)]; - } - else { - if (actual !== null && TypeScript.SyntaxFacts.isAnyKeyword(actual.kind())) { - diagnosticCode = TypeScript.DiagnosticCode.Identifier_expected_0_is_a_keyword; - args = [TypeScript.SyntaxFacts.getText(actual.kind())]; - } - else { - diagnosticCode = TypeScript.DiagnosticCode.Identifier_expected; - } - } - } - return new TypeScript.Diagnostic(fileName, source.text.lineMap(), TypeScript.start(token, source.text), TypeScript.width(token), diagnosticCode, args); - } - function getBinaryExpressionPrecedence(tokenKind) { - switch (tokenKind) { - case 104 /* BarBarToken */: - return 2 /* LogicalOrExpressionPrecedence */; - case 103 /* AmpersandAmpersandToken */: - return 3 /* LogicalAndExpressionPrecedence */; - case 99 /* BarToken */: - return 4 /* BitwiseOrExpressionPrecedence */; - case 100 /* CaretToken */: - return 5 /* BitwiseExclusiveOrExpressionPrecedence */; - case 98 /* AmpersandToken */: - return 6 /* BitwiseAndExpressionPrecedence */; - case 84 /* EqualsEqualsToken */: - case 86 /* ExclamationEqualsToken */: - case 87 /* EqualsEqualsEqualsToken */: - case 88 /* ExclamationEqualsEqualsToken */: - return 7 /* EqualityExpressionPrecedence */; - case 80 /* LessThanToken */: - case 81 /* GreaterThanToken */: - case 82 /* LessThanEqualsToken */: - case 83 /* GreaterThanEqualsToken */: - case 30 /* InstanceOfKeyword */: - case 29 /* InKeyword */: - return 8 /* RelationalExpressionPrecedence */; - case 95 /* LessThanLessThanToken */: - case 96 /* GreaterThanGreaterThanToken */: - case 97 /* GreaterThanGreaterThanGreaterThanToken */: - return 9 /* ShiftExpressionPrecdence */; - case 89 /* PlusToken */: - case 90 /* MinusToken */: - return 10 /* AdditiveExpressionPrecedence */; - case 91 /* AsteriskToken */: - case 118 /* SlashToken */: - case 92 /* PercentToken */: - return 11 /* MultiplicativeExpressionPrecedence */; - } - throw TypeScript.Errors.invalidOperation(); - } - function addSkippedTokenAfterNodeOrToken(nodeOrToken, skippedToken) { - if (TypeScript.isToken(nodeOrToken)) { - return addSkippedTokenAfterToken(nodeOrToken, skippedToken); - } - else if (TypeScript.isNode(nodeOrToken)) { - return addSkippedTokenAfterNode(nodeOrToken, skippedToken); - } - else { - throw TypeScript.Errors.invalidOperation(); - } - } - function replaceTokenInParent(node, oldToken, newToken) { - replaceTokenInParentWorker(oldToken, newToken); - var parent = oldToken.parent; - newToken.parent = parent; - while (true) { - TypeScript.Debug.assert(TypeScript.isNode(parent) || TypeScript.isList(parent) || TypeScript.isSeparatedList(parent)); - var dataElement = parent; - if (dataElement.data) { - dataElement.data &= 4 /* NodeParsedInStrictModeMask */; - } - if (parent === node) { - break; - } - parent = parent.parent; - } - } - function replaceTokenInParentWorker(oldToken, newToken) { - var parent = oldToken.parent; - if (TypeScript.isNode(parent)) { - var node = parent; - for (var key in node) { - if (node[key] === oldToken) { - node[key] = newToken; - return; - } - } - } - else if (TypeScript.isList(parent)) { - var list1 = parent; - for (var i = 0, n = list1.length; i < n; i++) { - if (list1[i] === oldToken) { - list1[i] = newToken; - return; - } - } - } - else if (TypeScript.isSeparatedList(parent)) { - var list2 = parent; - for (var i = 0, n = TypeScript.childCount(list2); i < n; i++) { - if (TypeScript.childAt(list2, i) === oldToken) { - if (i % 2 === 0) { - list2[i / 2] = newToken; - } - else { - list2.separators[(i - 1) / 2] = newToken; - } - return; - } - } - } - throw TypeScript.Errors.invalidOperation(); - } - function addSkippedTokenAfterNode(node, skippedToken) { - var oldToken = TypeScript.lastToken(node); - var newToken = addSkippedTokenAfterToken(oldToken, skippedToken); - replaceTokenInParent(node, oldToken, newToken); - return node; - } - function addSkippedTokensBeforeNode(node, skippedTokens) { - if (skippedTokens.length > 0) { - var oldToken = TypeScript.firstToken(node); - var newToken = addSkippedTokensBeforeToken(oldToken, skippedTokens); - replaceTokenInParent(node, oldToken, newToken); - } - return node; - } - function addSkippedTokensBeforeToken(token, skippedTokens) { - var leadingTrivia = []; - for (var i = 0, n = skippedTokens.length; i < n; i++) { - var skippedToken = skippedTokens[i]; - addSkippedTokenToTriviaArray(leadingTrivia, skippedToken); - } - addTriviaTo(token.leadingTrivia(source.text), leadingTrivia); - var updatedToken = TypeScript.Syntax.withLeadingTrivia(token, TypeScript.Syntax.triviaList(leadingTrivia), source.text); - updatedToken.setFullStart(skippedTokens[0].fullStart()); - returnArray(skippedTokens); - return updatedToken; - } - function addSkippedTokensAfterToken(token, skippedTokens) { - if (skippedTokens.length === 0) { - returnArray(skippedTokens); - return token; - } - var trailingTrivia = token.trailingTrivia(source.text).toArray(); - for (var i = 0, n = skippedTokens.length; i < n; i++) { - addSkippedTokenToTriviaArray(trailingTrivia, skippedTokens[i]); - } - returnArray(skippedTokens); - return TypeScript.Syntax.withTrailingTrivia(token, TypeScript.Syntax.triviaList(trailingTrivia), source.text); - } - function addSkippedTokenAfterToken(token, skippedToken) { - var trailingTrivia = token.trailingTrivia(source.text).toArray(); - addSkippedTokenToTriviaArray(trailingTrivia, skippedToken); - return TypeScript.Syntax.withTrailingTrivia(token, TypeScript.Syntax.triviaList(trailingTrivia), source.text); - } - function addSkippedTokenToTriviaArray(array, skippedToken) { - addTriviaTo(skippedToken.leadingTrivia(source.text), array); - var trimmedToken = TypeScript.Syntax.withTrailingTrivia(TypeScript.Syntax.withLeadingTrivia(skippedToken, TypeScript.Syntax.emptyTriviaList, source.text), TypeScript.Syntax.emptyTriviaList, source.text); - trimmedToken.setFullStart(TypeScript.start(skippedToken, source.text)); - array.push(TypeScript.Syntax.skippedTokenTrivia(trimmedToken, source.text)); - addTriviaTo(skippedToken.trailingTrivia(source.text), array); - } - function addTriviaTo(list, array) { - for (var i = 0, n = list.count(); i < n; i++) { - array.push(list.syntaxTriviaAt(i)); - } - } - function setStrictMode(_isInStrictMode) { - isInStrictMode = _isInStrictMode; - parseNodeData = _isInStrictMode ? 4 /* NodeParsedInStrictModeMask */ : 0; - } - function parseSourceUnit() { - var savedIsInStrictMode = isInStrictMode; - var skippedTokens = getArray(); - var moduleElements = parseSyntaxList(0 /* SourceUnit_ModuleElements */, skippedTokens, updateStrictModeState); - setStrictMode(savedIsInStrictMode); - var sourceUnit = new Parser.syntaxFactory.SourceUnitSyntax(parseNodeData, moduleElements, currentToken()); - sourceUnit = addSkippedTokensBeforeNode(sourceUnit, skippedTokens); - if (TypeScript.Debug.shouldAssert(2 /* Aggressive */)) { - TypeScript.Debug.assert(TypeScript.fullWidth(sourceUnit) === source.text.length()); - if (TypeScript.Debug.shouldAssert(3 /* VeryAggressive */)) { - TypeScript.Debug.assert(TypeScript.fullText(sourceUnit) === source.text.substr(0, source.text.length())); - } - } - return sourceUnit; - } - function updateStrictModeState(items) { - if (!isInStrictMode) { - for (var i = 0; i < items.length; i++) { - var item = items[i]; - if (!TypeScript.SyntaxFacts.isDirectivePrologueElement(item)) { - return; - } - } - setStrictMode(TypeScript.SyntaxFacts.isUseStrictDirective(items[items.length - 1])); - } - } - function isModuleElement(inErrorRecovery) { - if (TypeScript.SyntaxUtilities.isModuleElement(currentNode())) { - return true; - } - var _modifierCount = modifierCount(); - return isInterfaceEnumClassModuleImportOrExport(_modifierCount) || isStatement(_modifierCount, inErrorRecovery); - } - function tryParseModuleElement(inErrorRecovery) { - var node = currentNode(); - if (TypeScript.SyntaxUtilities.isModuleElement(node)) { - consumeNode(node); - return node; - } - var _currentToken = currentToken(); - var _modifierCount = modifierCount(); - if (_modifierCount) { - switch (peekToken(_modifierCount).kind()) { - case 49 /* ImportKeyword */: - return parseImportDeclaration(); - case 65 /* ModuleKeyword */: - return parseModuleDeclaration(); - case 52 /* InterfaceKeyword */: - return parseInterfaceDeclaration(); - case 44 /* ClassKeyword */: - return parseClassDeclaration(); - case 46 /* EnumKeyword */: - return parseEnumDeclaration(); - } - } - var nextToken = peekToken(1); - var currentTokenKind = _currentToken.kind(); - switch (currentTokenKind) { - case 65 /* ModuleKeyword */: - if (isIdentifier(nextToken) || nextToken.kind() === 14 /* StringLiteral */) { - return parseModuleDeclaration(); - } - break; - case 49 /* ImportKeyword */: - if (isIdentifier(nextToken)) { - return parseImportDeclaration(); - } - break; - case 44 /* ClassKeyword */: - if (isIdentifier(nextToken)) { - return parseClassDeclaration(); - } - break; - case 46 /* EnumKeyword */: - if (isIdentifier(nextToken)) { - return parseEnumDeclaration(); - } - break; - case 52 /* InterfaceKeyword */: - if (isIdentifier(nextToken)) { - return parseInterfaceDeclaration(); - } - break; - case 47 /* ExportKeyword */: - if (nextToken.kind() === 107 /* EqualsToken */) { - return parseExportAssignment(); - } - break; - } - return tryParseStatementWorker(_currentToken, currentTokenKind, _modifierCount, inErrorRecovery); - } - function parseImportDeclaration() { - return new Parser.syntaxFactory.ImportDeclarationSyntax(parseNodeData, parseModifiers(), eatToken(49 /* ImportKeyword */), eatIdentifierToken(), eatToken(107 /* EqualsToken */), parseModuleReference(), eatExplicitOrAutomaticSemicolon(false)); - } - function parseExportAssignment() { - return new Parser.syntaxFactory.ExportAssignmentSyntax(parseNodeData, eatToken(47 /* ExportKeyword */), eatToken(107 /* EqualsToken */), eatIdentifierToken(), eatExplicitOrAutomaticSemicolon(false)); - } - function parseModuleReference() { - return isExternalModuleReference() ? parseExternalModuleReference() : parseModuleNameModuleReference(); - } - function isExternalModuleReference() { - return currentToken().kind() === 66 /* RequireKeyword */ && peekToken(1).kind() === 72 /* OpenParenToken */; - } - function parseExternalModuleReference() { - return new Parser.syntaxFactory.ExternalModuleReferenceSyntax(parseNodeData, eatToken(66 /* RequireKeyword */), eatToken(72 /* OpenParenToken */), eatToken(14 /* StringLiteral */), eatToken(73 /* CloseParenToken */)); - } - function parseModuleNameModuleReference() { - return new Parser.syntaxFactory.ModuleNameModuleReferenceSyntax(parseNodeData, parseName(false)); - } - function tryParseTypeArgumentList(inExpression) { - var _currentToken = currentToken(); - if (_currentToken.kind() !== 80 /* LessThanToken */) { - return null; - } - if (!inExpression) { - var lessThanToken = consumeToken(_currentToken); - var skippedTokens = getArray(); - var typeArguments = parseSeparatedSyntaxList(19 /* TypeArgumentList_Types */, skippedTokens); - lessThanToken = addSkippedTokensAfterToken(lessThanToken, skippedTokens); - return new Parser.syntaxFactory.TypeArgumentListSyntax(parseNodeData, lessThanToken, typeArguments, eatToken(81 /* GreaterThanToken */)); - } - var rewindPoint = getRewindPoint(); - var lessThanToken = consumeToken(_currentToken); - var skippedTokens = getArray(); - var typeArguments = parseSeparatedSyntaxList(19 /* TypeArgumentList_Types */, skippedTokens); - var lessThanToken = addSkippedTokensAfterToken(lessThanToken, skippedTokens); - var greaterThanToken = eatToken(81 /* GreaterThanToken */); - if (greaterThanToken.fullWidth() === 0 || !canFollowTypeArgumentListInExpression(currentToken().kind())) { - rewind(rewindPoint); - releaseRewindPoint(rewindPoint); - return null; - } - else { - releaseRewindPoint(rewindPoint); - return new Parser.syntaxFactory.TypeArgumentListSyntax(parseNodeData, lessThanToken, typeArguments, greaterThanToken); - } - } - function canFollowTypeArgumentListInExpression(kind) { - switch (kind) { - case 72 /* OpenParenToken */: - case 76 /* DotToken */: - case 73 /* CloseParenToken */: - case 75 /* CloseBracketToken */: - case 106 /* ColonToken */: - case 78 /* SemicolonToken */: - case 79 /* CommaToken */: - case 105 /* QuestionToken */: - case 84 /* EqualsEqualsToken */: - case 87 /* EqualsEqualsEqualsToken */: - case 86 /* ExclamationEqualsToken */: - case 88 /* ExclamationEqualsEqualsToken */: - case 103 /* AmpersandAmpersandToken */: - case 104 /* BarBarToken */: - case 100 /* CaretToken */: - case 98 /* AmpersandToken */: - case 99 /* BarToken */: - case 71 /* CloseBraceToken */: - case 10 /* EndOfFileToken */: - return true; - default: - return false; - } - } - function parseName(allowIdentifierName) { - return tryParseName(allowIdentifierName) || eatIdentifierToken(); - } - function eatRightSideOfName(allowIdentifierNames) { - var _currentToken = currentToken(); - if (TypeScript.SyntaxFacts.isAnyKeyword(_currentToken.kind()) && previousTokenHasTrailingNewLine(_currentToken)) { - var token1 = peekToken(1); - if (!TypeScript.existsNewLineBetweenTokens(_currentToken, token1, source.text) && TypeScript.SyntaxFacts.isIdentifierNameOrAnyKeyword(token1)) { - return createMissingToken(11 /* IdentifierName */, _currentToken); - } - } - return allowIdentifierNames ? eatIdentifierNameToken() : eatIdentifierToken(); - } - function tryParseName(allowIdentifierNames) { - var token0 = currentToken(); - var shouldContinue = isIdentifier(token0); - if (!shouldContinue) { - return null; - } - var current = eatIdentifierToken(); - while (shouldContinue && currentToken().kind() === 76 /* DotToken */) { - var dotToken = consumeToken(currentToken()); - var identifierName = eatRightSideOfName(allowIdentifierNames); - current = new Parser.syntaxFactory.QualifiedNameSyntax(parseNodeData, current, dotToken, identifierName); - shouldContinue = identifierName.fullWidth() > 0; - } - return current; - } - function parseEnumDeclaration() { - var modifiers = parseModifiers(); - var enumKeyword = eatToken(46 /* EnumKeyword */); - var identifier = eatIdentifierToken(); - var openBraceToken = eatToken(70 /* OpenBraceToken */); - var enumElements = TypeScript.Syntax.emptySeparatedList(); - if (openBraceToken.fullWidth() > 0) { - var skippedTokens = getArray(); - enumElements = parseSeparatedSyntaxList(8 /* EnumDeclaration_EnumElements */, skippedTokens); - openBraceToken = addSkippedTokensAfterToken(openBraceToken, skippedTokens); - } - return new Parser.syntaxFactory.EnumDeclarationSyntax(parseNodeData, modifiers, enumKeyword, identifier, openBraceToken, enumElements, eatToken(71 /* CloseBraceToken */)); - } - function isEnumElement(inErrorRecovery) { - var node = currentNode(); - if (node !== null && node.kind() === 244 /* EnumElement */) { - return true; - } - return isPropertyName(currentToken(), inErrorRecovery); - } - function tryParseEnumElementEqualsValueClause() { - return isEqualsValueClause(false) ? parseEqualsValueClause(true) : null; - } - function tryParseEnumElement(inErrorRecovery) { - var node = currentNode(); - if (node !== null && node.kind() === 244 /* EnumElement */) { - consumeNode(node); - return node; - } - if (!isPropertyName(currentToken(), inErrorRecovery)) { - return null; - } - return new Parser.syntaxFactory.EnumElementSyntax(parseNodeData, eatPropertyName(), tryParseEnumElementEqualsValueClause()); - } - function isModifierKind(kind) { - switch (kind) { - case 47 /* ExportKeyword */: - case 57 /* PublicKeyword */: - case 55 /* PrivateKeyword */: - case 56 /* ProtectedKeyword */: - case 58 /* StaticKeyword */: - case 63 /* DeclareKeyword */: - return true; - } - return false; - } - function isModifier(token, index) { - if (isModifierKind(token.kind())) { - var nextToken = peekToken(index + 1); - var nextTokenKind = nextToken.kind(); - switch (nextTokenKind) { - case 11 /* IdentifierName */: - case 74 /* OpenBracketToken */: - case 13 /* NumericLiteral */: - case 14 /* StringLiteral */: - return true; - default: - return TypeScript.SyntaxFacts.isAnyKeyword(nextTokenKind); - } - } - return false; - } - function modifierCount() { - var modifierCount = 0; - while (isModifier(peekToken(modifierCount), modifierCount)) { - modifierCount++; - } - return modifierCount; - } - function parseModifiers() { - var tokens = getArray(); - while (true) { - var token = currentToken(); - if (isModifier(token, 0)) { - tokens.push(consumeToken(token)); - continue; - } - break; - } - var result = TypeScript.Syntax.list(tokens); - returnZeroLengthArray(tokens); - return result; - } - function parseHeritageClauses() { - var heritageClauses = TypeScript.Syntax.emptyList(); - if (isHeritageClause()) { - heritageClauses = parseSyntaxList(10 /* ClassOrInterfaceDeclaration_HeritageClauses */, null); - } - return heritageClauses; - } - function tryParseHeritageClauseTypeName() { - return isHeritageClauseTypeName() ? tryParseNameOrGenericType() : null; - } - function parseClassDeclaration() { - var modifiers = parseModifiers(); - var classKeyword = eatToken(44 /* ClassKeyword */); - var identifier = eatIdentifierToken(); - var typeParameterList = tryParseTypeParameterList(false); - var heritageClauses = parseHeritageClauses(); - var openBraceToken = eatToken(70 /* OpenBraceToken */); - var classElements = TypeScript.Syntax.emptyList(); - if (openBraceToken.fullWidth() > 0) { - var skippedTokens = getArray(); - classElements = parseSyntaxList(1 /* ClassDeclaration_ClassElements */, skippedTokens); - openBraceToken = addSkippedTokensAfterToken(openBraceToken, skippedTokens); - } - ; - return new Parser.syntaxFactory.ClassDeclarationSyntax(parseNodeData, modifiers, classKeyword, identifier, typeParameterList, heritageClauses, openBraceToken, classElements, eatToken(71 /* CloseBraceToken */)); - } - function isAccessor(modifierCount, inErrorRecovery) { - var tokenKind = peekToken(modifierCount).kind(); - if (tokenKind !== 64 /* GetKeyword */ && tokenKind !== 68 /* SetKeyword */) { - return false; - } - return isPropertyName(peekToken(modifierCount + 1), inErrorRecovery); - } - function parseAccessor(checkForStrictMode) { - var modifiers = parseModifiers(); - var _currenToken = currentToken(); - var tokenKind = _currenToken.kind(); - if (tokenKind === 64 /* GetKeyword */) { - return parseGetMemberAccessorDeclaration(modifiers, _currenToken, checkForStrictMode); - } - else if (tokenKind === 68 /* SetKeyword */) { - return parseSetMemberAccessorDeclaration(modifiers, _currenToken, checkForStrictMode); - } - else { - throw TypeScript.Errors.invalidOperation(); - } - } - function parseGetMemberAccessorDeclaration(modifiers, getKeyword, checkForStrictMode) { - return new Parser.syntaxFactory.GetAccessorSyntax(parseNodeData, modifiers, consumeToken(getKeyword), eatPropertyName(), parseCallSignature(false), parseBlock(false, checkForStrictMode)); - } - function parseSetMemberAccessorDeclaration(modifiers, setKeyword, checkForStrictMode) { - return new Parser.syntaxFactory.SetAccessorSyntax(parseNodeData, modifiers, consumeToken(setKeyword), eatPropertyName(), parseCallSignature(false), parseBlock(false, checkForStrictMode)); - } - function isClassElement(inErrorRecovery) { - if (TypeScript.SyntaxUtilities.isClassElement(currentNode())) { - return true; - } - var _modifierCount = modifierCount(); - return isConstructorDeclaration(_modifierCount) || isMemberFunctionDeclaration(_modifierCount, inErrorRecovery) || isAccessor(_modifierCount, inErrorRecovery) || isMemberVariableDeclaration(_modifierCount, inErrorRecovery) || isIndexMemberDeclaration(_modifierCount); - } - function tryParseClassElement(inErrorRecovery) { - var node = currentNode(); - if (TypeScript.SyntaxUtilities.isClassElement(node)) { - consumeNode(node); - return node; - } - var _modifierCount = modifierCount(); - if (isConstructorDeclaration(_modifierCount)) { - return parseConstructorDeclaration(); - } - else if (isMemberFunctionDeclaration(_modifierCount, inErrorRecovery)) { - return parseMemberFunctionDeclaration(); - } - else if (isAccessor(_modifierCount, inErrorRecovery)) { - return parseAccessor(false); - } - else if (isMemberVariableDeclaration(_modifierCount, inErrorRecovery)) { - return parseMemberVariableDeclaration(); - } - else if (isIndexMemberDeclaration(_modifierCount)) { - return parseIndexMemberDeclaration(); - } - else { - return null; - } - } - function isConstructorDeclaration(modifierCount) { - return peekToken(modifierCount).kind() === 62 /* ConstructorKeyword */; - } - function parseConstructorDeclaration() { - var modifiers = parseModifiers(); - var constructorKeyword = eatToken(62 /* ConstructorKeyword */); - var callSignature = parseCallSignature(false); - var semicolonToken = null; - var block = null; - if (isBlock()) { - block = parseBlock(false, true); - } - else { - semicolonToken = eatExplicitOrAutomaticSemicolon(false); - } - return new Parser.syntaxFactory.ConstructorDeclarationSyntax(parseNodeData, modifiers, constructorKeyword, callSignature, block, semicolonToken); - } - function isMemberFunctionDeclaration(modifierCount, inErrorRecovery) { - return isPropertyName(peekToken(modifierCount), inErrorRecovery) && isCallSignature(modifierCount + 1); - } - function parseMemberFunctionDeclaration() { - var modifiers = parseModifiers(); - var propertyName = eatPropertyName(); - var callSignature = parseCallSignature(false); - var parseBlockEvenWithNoOpenBrace = tryAddUnexpectedEqualsGreaterThanToken(callSignature); - var block = null; - var semicolon = null; - if (parseBlockEvenWithNoOpenBrace || isBlock()) { - block = parseBlock(parseBlockEvenWithNoOpenBrace, true); - } - else { - semicolon = eatExplicitOrAutomaticSemicolon(false); - } - return new Parser.syntaxFactory.MemberFunctionDeclarationSyntax(parseNodeData, modifiers, propertyName, callSignature, block, semicolon); - } - function isDefinitelyMemberVariablePropertyName(index) { - if (TypeScript.SyntaxFacts.isAnyKeyword(peekToken(index).kind())) { - var nextToken = peekToken(index + 1); - switch (nextToken.kind()) { - case 78 /* SemicolonToken */: - case 107 /* EqualsToken */: - case 106 /* ColonToken */: - case 71 /* CloseBraceToken */: - case 10 /* EndOfFileToken */: - return true; - default: - return previousTokenHasTrailingNewLine(nextToken); - } - } - else { - return true; - } - } - function isMemberVariableDeclaration(modifierCount, inErrorRecover) { - return isPropertyName(peekToken(modifierCount), inErrorRecover) && isDefinitelyMemberVariablePropertyName(modifierCount); - } - function parseMemberVariableDeclaration() { - return new Parser.syntaxFactory.MemberVariableDeclarationSyntax(parseNodeData, parseModifiers(), tryParseVariableDeclarator(true, true), eatExplicitOrAutomaticSemicolon(false)); - } - function isIndexMemberDeclaration(modifierCount) { - return isIndexSignature(modifierCount); - } - function parseIndexMemberDeclaration() { - return new Parser.syntaxFactory.IndexMemberDeclarationSyntax(parseNodeData, parseModifiers(), parseIndexSignature(), eatExplicitOrAutomaticSemicolon(false)); - } - function tryAddUnexpectedEqualsGreaterThanToken(callSignature) { - var token0 = currentToken(); - var hasEqualsGreaterThanToken = token0.kind() === 85 /* EqualsGreaterThanToken */; - if (hasEqualsGreaterThanToken) { - var _lastToken = TypeScript.lastToken(callSignature); - if (_lastToken && _lastToken.fullWidth() > 0) { - var diagnostic = new TypeScript.Diagnostic(fileName, source.text.lineMap(), TypeScript.start(token0, source.text), TypeScript.width(token0), TypeScript.DiagnosticCode.Unexpected_token_0_expected, [TypeScript.SyntaxFacts.getText(70 /* OpenBraceToken */)]); - addDiagnostic(diagnostic); - consumeToken(token0); - if (Parser.syntaxFactory.isConcrete) { - addSkippedTokenAfterNode(callSignature, token0); - } - return true; - } - } - return false; - } - function isFunctionDeclaration(modifierCount) { - return peekToken(modifierCount).kind() === 27 /* FunctionKeyword */; - } - function parseFunctionDeclaration() { - var modifiers = parseModifiers(); - var functionKeyword = eatToken(27 /* FunctionKeyword */); - var identifier = eatIdentifierToken(); - var callSignature = parseCallSignature(false); - var parseBlockEvenWithNoOpenBrace = tryAddUnexpectedEqualsGreaterThanToken(callSignature); - var semicolonToken = null; - var block = null; - if (parseBlockEvenWithNoOpenBrace || isBlock()) { - block = parseBlock(parseBlockEvenWithNoOpenBrace, true); - } - else { - semicolonToken = eatExplicitOrAutomaticSemicolon(false); - } - return new Parser.syntaxFactory.FunctionDeclarationSyntax(parseNodeData, modifiers, functionKeyword, identifier, callSignature, block, semicolonToken); - } - function parseModuleDeclaration() { - var modifiers = parseModifiers(); - var moduleKeyword = eatToken(65 /* ModuleKeyword */); - var moduleName = null; - var stringLiteral = null; - if (currentToken().kind() === 14 /* StringLiteral */) { - stringLiteral = eatToken(14 /* StringLiteral */); - } - else { - moduleName = parseName(false); - } - var openBraceToken = eatToken(70 /* OpenBraceToken */); - var moduleElements = TypeScript.Syntax.emptyList(); - if (openBraceToken.fullWidth() > 0) { - var skippedTokens = getArray(); - moduleElements = parseSyntaxList(2 /* ModuleDeclaration_ModuleElements */, skippedTokens); - openBraceToken = addSkippedTokensAfterToken(openBraceToken, skippedTokens); - } - return new Parser.syntaxFactory.ModuleDeclarationSyntax(parseNodeData, modifiers, moduleKeyword, moduleName, stringLiteral, openBraceToken, moduleElements, eatToken(71 /* CloseBraceToken */)); - } - function parseInterfaceDeclaration() { - return new Parser.syntaxFactory.InterfaceDeclarationSyntax(parseNodeData, parseModifiers(), eatToken(52 /* InterfaceKeyword */), eatIdentifierToken(), tryParseTypeParameterList(false), parseHeritageClauses(), parseObjectType()); - } - function parseObjectType() { - var openBraceToken = eatToken(70 /* OpenBraceToken */); - var typeMembers = TypeScript.Syntax.emptySeparatedList(); - if (openBraceToken.fullWidth() > 0) { - var skippedTokens = getArray(); - typeMembers = parseSeparatedSyntaxList(9 /* ObjectType_TypeMembers */, skippedTokens); - openBraceToken = addSkippedTokensAfterToken(openBraceToken, skippedTokens); - } - return new Parser.syntaxFactory.ObjectTypeSyntax(parseNodeData, openBraceToken, typeMembers, eatToken(71 /* CloseBraceToken */)); - } - function parseTupleType(currentToken) { - var openBracket = consumeToken(currentToken); - var types = TypeScript.Syntax.emptySeparatedList(); - if (openBracket.fullWidth() > 0) { - var skippedTokens = getArray(); - types = parseSeparatedSyntaxList(21 /* TupleType_Types */, skippedTokens); - openBracket = addSkippedTokensAfterToken(openBracket, skippedTokens); - } - return new Parser.syntaxFactory.TupleTypeSyntax(parseNodeData, openBracket, types, eatToken(75 /* CloseBracketToken */)); - } - function isTypeMember(inErrorRecovery) { - if (TypeScript.SyntaxUtilities.isTypeMember(currentNode())) { - return true; - } - return isCallSignature(0) || isConstructSignature() || isIndexSignature(0) || isMethodSignature(inErrorRecovery) || isPropertySignature(inErrorRecovery); - } - function tryParseTypeMember(inErrorRecovery) { - var node = currentNode(); - if (TypeScript.SyntaxUtilities.isTypeMember(node)) { - consumeNode(node); - return node; - } - if (isCallSignature(0)) { - return parseCallSignature(false); - } - else if (isConstructSignature()) { - return parseConstructSignature(); - } - else if (isIndexSignature(0)) { - return parseIndexSignature(); - } - else if (isMethodSignature(inErrorRecovery)) { - return parseMethodSignature(); - } - else if (isPropertySignature(inErrorRecovery)) { - return parsePropertySignature(); - } - else { - return null; - } - } - function parseConstructSignature() { - return new Parser.syntaxFactory.ConstructSignatureSyntax(parseNodeData, eatToken(31 /* NewKeyword */), parseCallSignature(false)); - } - function parseIndexSignature() { - var openBracketToken = eatToken(74 /* OpenBracketToken */); - var skippedTokens = getArray(); - var parameters = parseSeparatedSyntaxList(18 /* IndexSignature_Parameters */, skippedTokens); - openBracketToken = addSkippedTokensAfterToken(openBracketToken, skippedTokens); - return new Parser.syntaxFactory.IndexSignatureSyntax(parseNodeData, openBracketToken, parameters, eatToken(75 /* CloseBracketToken */), parseOptionalTypeAnnotation(false)); - } - function parseMethodSignature() { - return new Parser.syntaxFactory.MethodSignatureSyntax(parseNodeData, eatPropertyName(), tryEatToken(105 /* QuestionToken */), parseCallSignature(false)); - } - function parsePropertySignature() { - return new Parser.syntaxFactory.PropertySignatureSyntax(parseNodeData, eatPropertyName(), tryEatToken(105 /* QuestionToken */), parseOptionalTypeAnnotation(false)); - } - function isCallSignature(peekIndex) { - var tokenKind = peekToken(peekIndex).kind(); - return tokenKind === 72 /* OpenParenToken */ || tokenKind === 80 /* LessThanToken */; - } - function isConstructSignature() { - if (currentToken().kind() !== 31 /* NewKeyword */) { - return false; - } - return isCallSignature(1); - } - function isIndexSignature(peekIndex) { - return peekToken(peekIndex).kind() === 74 /* OpenBracketToken */; - } - function isMethodSignature(inErrorRecovery) { - if (isPropertyName(currentToken(), inErrorRecovery)) { - if (isCallSignature(1)) { - return true; - } - if (peekToken(1).kind() === 105 /* QuestionToken */ && isCallSignature(2)) { - return true; - } - } - return false; - } - function isPropertySignature(inErrorRecovery) { - var _currentToken = currentToken(); - if (isModifier(_currentToken, 0)) { - if (!TypeScript.existsNewLineBetweenTokens(_currentToken, peekToken(1), source.text) && isPropertyName(peekToken(1), inErrorRecovery)) { - return false; - } - } - return isPropertyName(_currentToken, inErrorRecovery); - } - function isHeritageClause() { - var tokenKind = currentToken().kind(); - return tokenKind === 48 /* ExtendsKeyword */ || tokenKind === 51 /* ImplementsKeyword */; - } - function isNotHeritageClauseTypeName() { - var tokenKind = currentToken().kind(); - if (tokenKind === 51 /* ImplementsKeyword */ || tokenKind === 48 /* ExtendsKeyword */) { - return isIdentifier(peekToken(1)); - } - return false; - } - function isHeritageClauseTypeName() { - if (isIdentifier(currentToken())) { - return !isNotHeritageClauseTypeName(); - } - return false; - } - function tryParseHeritageClause() { - var extendsOrImplementsKeyword = currentToken(); - var tokenKind = extendsOrImplementsKeyword.kind(); - if (tokenKind !== 48 /* ExtendsKeyword */ && tokenKind !== 51 /* ImplementsKeyword */) { - return null; - } - consumeToken(extendsOrImplementsKeyword); - var skippedTokens = getArray(); - var typeNames = parseSeparatedSyntaxList(11 /* HeritageClause_TypeNameList */, skippedTokens); - extendsOrImplementsKeyword = addSkippedTokensAfterToken(extendsOrImplementsKeyword, skippedTokens); - return new Parser.syntaxFactory.HeritageClauseSyntax(parseNodeData, extendsOrImplementsKeyword, typeNames); - } - function isInterfaceEnumClassModuleImportOrExport(modifierCount) { - var _currentToken = currentToken(); - if (modifierCount) { - switch (peekToken(modifierCount).kind()) { - case 49 /* ImportKeyword */: - case 65 /* ModuleKeyword */: - case 52 /* InterfaceKeyword */: - case 44 /* ClassKeyword */: - case 46 /* EnumKeyword */: - return true; - } - } - var nextToken = peekToken(1); - switch (_currentToken.kind()) { - case 65 /* ModuleKeyword */: - if (isIdentifier(nextToken) || nextToken.kind() === 14 /* StringLiteral */) { - return true; - } - break; - case 49 /* ImportKeyword */: - case 44 /* ClassKeyword */: - case 46 /* EnumKeyword */: - case 52 /* InterfaceKeyword */: - if (isIdentifier(nextToken)) { - return true; - } - break; - case 47 /* ExportKeyword */: - if (nextToken.kind() === 107 /* EqualsToken */) { - return true; - } - break; - } - return false; - } - function isStatement(modifierCount, inErrorRecovery) { - if (TypeScript.SyntaxUtilities.isStatement(currentNode())) { - return true; - } - var _currentToken = currentToken(); - var currentTokenKind = _currentToken.kind(); - switch (currentTokenKind) { - case 57 /* PublicKeyword */: - case 55 /* PrivateKeyword */: - case 56 /* ProtectedKeyword */: - case 58 /* StaticKeyword */: - var token1 = peekToken(1); - if (TypeScript.SyntaxFacts.isIdentifierNameOrAnyKeyword(token1)) { - return false; - } - break; - case 28 /* IfKeyword */: - case 70 /* OpenBraceToken */: - case 33 /* ReturnKeyword */: - case 34 /* SwitchKeyword */: - case 36 /* ThrowKeyword */: - case 15 /* BreakKeyword */: - case 18 /* ContinueKeyword */: - case 26 /* ForKeyword */: - case 42 /* WhileKeyword */: - case 43 /* WithKeyword */: - case 22 /* DoKeyword */: - case 38 /* TryKeyword */: - case 19 /* DebuggerKeyword */: - return true; - } - if (isInterfaceEnumClassModuleImportOrExport(modifierCount)) { - return false; - } - return isLabeledStatement(_currentToken) || isVariableStatement(modifierCount) || isFunctionDeclaration(modifierCount) || isEmptyStatement(_currentToken, inErrorRecovery) || isExpressionStatement(_currentToken); - } - function parseStatement(inErrorRecovery) { - return tryParseStatement(inErrorRecovery) || parseExpressionStatement(); - } - function tryParseStatement(inErrorRecovery) { - var node = currentNode(); - if (TypeScript.SyntaxUtilities.isStatement(node)) { - consumeNode(node); - return node; - } - var _currentToken = currentToken(); - var currentTokenKind = _currentToken.kind(); - return tryParseStatementWorker(_currentToken, currentTokenKind, modifierCount(), inErrorRecovery); - } - function tryParseStatementWorker(_currentToken, currentTokenKind, modifierCount, inErrorRecovery) { - switch (currentTokenKind) { - case 57 /* PublicKeyword */: - case 55 /* PrivateKeyword */: - case 56 /* ProtectedKeyword */: - case 58 /* StaticKeyword */: - if (TypeScript.SyntaxFacts.isIdentifierNameOrAnyKeyword(peekToken(1))) { - return null; - } - else { - break; - } - case 28 /* IfKeyword */: - return parseIfStatement(_currentToken); - case 70 /* OpenBraceToken */: - return parseBlock(false, false); - case 33 /* ReturnKeyword */: - return parseReturnStatement(_currentToken); - case 34 /* SwitchKeyword */: - return parseSwitchStatement(_currentToken); - case 36 /* ThrowKeyword */: - return parseThrowStatement(_currentToken); - case 15 /* BreakKeyword */: - return parseBreakStatement(_currentToken); - case 18 /* ContinueKeyword */: - return parseContinueStatement(_currentToken); - case 26 /* ForKeyword */: - return parseForOrForInStatement(_currentToken); - case 42 /* WhileKeyword */: - return parseWhileStatement(_currentToken); - case 43 /* WithKeyword */: - return parseWithStatement(_currentToken); - case 22 /* DoKeyword */: - return parseDoStatement(_currentToken); - case 38 /* TryKeyword */: - return parseTryStatement(_currentToken); - case 19 /* DebuggerKeyword */: - return parseDebuggerStatement(_currentToken); - } - if (isInterfaceEnumClassModuleImportOrExport(modifierCount)) { - return null; - } - else if (isVariableStatement(modifierCount)) { - return parseVariableStatement(); - } - else if (isLabeledStatement(_currentToken)) { - return parseLabeledStatement(_currentToken); - } - else if (isFunctionDeclaration(modifierCount)) { - return parseFunctionDeclaration(); - } - else if (isEmptyStatement(_currentToken, inErrorRecovery)) { - return parseEmptyStatement(_currentToken); - } - else if (isExpressionStatement(_currentToken)) { - return parseExpressionStatement(); - } - else { - return null; - } - } - function parseDebuggerStatement(debuggerKeyword) { - return new Parser.syntaxFactory.DebuggerStatementSyntax(parseNodeData, consumeToken(debuggerKeyword), eatExplicitOrAutomaticSemicolon(false)); - } - function parseDoStatement(doKeyword) { - return new Parser.syntaxFactory.DoStatementSyntax(parseNodeData, consumeToken(doKeyword), parseStatement(false), eatToken(42 /* WhileKeyword */), eatToken(72 /* OpenParenToken */), parseExpression(true), eatToken(73 /* CloseParenToken */), eatExplicitOrAutomaticSemicolon(true)); - } - function isLabeledStatement(currentToken) { - return isIdentifier(currentToken) && peekToken(1).kind() === 106 /* ColonToken */; - } - function parseLabeledStatement(identifierToken) { - return new Parser.syntaxFactory.LabeledStatementSyntax(parseNodeData, consumeToken(identifierToken), eatToken(106 /* ColonToken */), parseStatement(false)); - } - function parseTryStatement(tryKeyword) { - var tryKeyword = consumeToken(tryKeyword); - var savedListParsingState = listParsingState; - listParsingState |= (1 << 6 /* TryBlock_Statements */); - var block = parseBlock(false, false); - listParsingState = savedListParsingState; - var catchClause = null; - if (currentToken().kind() === 17 /* CatchKeyword */) { - catchClause = parseCatchClause(); - } - var finallyClause = null; - if (catchClause === null || currentToken().kind() === 25 /* FinallyKeyword */) { - finallyClause = parseFinallyClause(); - } - return new Parser.syntaxFactory.TryStatementSyntax(parseNodeData, tryKeyword, block, catchClause, finallyClause); - } - function parseCatchClauseBlock() { - var savedListParsingState = listParsingState; - listParsingState |= (1 << 7 /* CatchBlock_Statements */); - var block = parseBlock(false, false); - listParsingState = savedListParsingState; - return block; - } - function parseCatchClause() { - return new Parser.syntaxFactory.CatchClauseSyntax(parseNodeData, eatToken(17 /* CatchKeyword */), eatToken(72 /* OpenParenToken */), eatIdentifierToken(), parseOptionalTypeAnnotation(false), eatToken(73 /* CloseParenToken */), parseCatchClauseBlock()); - } - function parseFinallyClause() { - return new Parser.syntaxFactory.FinallyClauseSyntax(parseNodeData, eatToken(25 /* FinallyKeyword */), parseBlock(false, false)); - } - function parseWithStatement(withKeyword) { - return new Parser.syntaxFactory.WithStatementSyntax(parseNodeData, consumeToken(withKeyword), eatToken(72 /* OpenParenToken */), parseExpression(true), eatToken(73 /* CloseParenToken */), parseStatement(false)); - } - function parseWhileStatement(whileKeyword) { - return new Parser.syntaxFactory.WhileStatementSyntax(parseNodeData, consumeToken(whileKeyword), eatToken(72 /* OpenParenToken */), parseExpression(true), eatToken(73 /* CloseParenToken */), parseStatement(false)); - } - function isEmptyStatement(currentToken, inErrorRecovery) { - if (inErrorRecovery) { - return false; - } - return currentToken.kind() === 78 /* SemicolonToken */; - } - function parseEmptyStatement(semicolonToken) { - return new Parser.syntaxFactory.EmptyStatementSyntax(parseNodeData, consumeToken(semicolonToken)); - } - function parseForOrForInStatement(forKeyword) { - consumeToken(forKeyword); - var openParenToken = eatToken(72 /* OpenParenToken */); - var _currentToken = currentToken(); - var tokenKind = _currentToken.kind(); - if (tokenKind === 40 /* VarKeyword */) { - return parseForOrForInStatementWithVariableDeclaration(forKeyword, openParenToken); - } - else if (tokenKind === 78 /* SemicolonToken */) { - return parseForStatementWithNoVariableDeclarationOrInitializer(forKeyword, openParenToken); - } - else { - return parseForOrForInStatementWithInitializer(forKeyword, openParenToken); - } - } - function parseForOrForInStatementWithVariableDeclaration(forKeyword, openParenToken) { - var variableDeclaration = parseVariableDeclaration(false); - return currentToken().kind() === 29 /* InKeyword */ ? parseForInStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, variableDeclaration, null) : parseForStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, variableDeclaration, null); - } - function parseForInStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, variableDeclaration, initializer) { - return new Parser.syntaxFactory.ForInStatementSyntax(parseNodeData, forKeyword, openParenToken, variableDeclaration, initializer, eatToken(29 /* InKeyword */), parseExpression(true), eatToken(73 /* CloseParenToken */), parseStatement(false)); - } - function parseForOrForInStatementWithInitializer(forKeyword, openParenToken) { - var initializer = parseExpression(false); - return currentToken().kind() === 29 /* InKeyword */ ? parseForInStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, null, initializer) : parseForStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, null, initializer); - } - function parseForStatementWithNoVariableDeclarationOrInitializer(forKeyword, openParenToken) { - return parseForStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, null, null); - } - function tryParseForStatementCondition() { - var tokenKind = currentToken().kind(); - if (tokenKind !== 78 /* SemicolonToken */ && tokenKind !== 73 /* CloseParenToken */ && tokenKind !== 10 /* EndOfFileToken */) { - return parseExpression(true); - } - return null; - } - function tryParseForStatementIncrementor() { - var tokenKind = currentToken().kind(); - if (tokenKind !== 73 /* CloseParenToken */ && tokenKind !== 10 /* EndOfFileToken */) { - return parseExpression(true); - } - return null; - } - function parseForStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, variableDeclaration, initializer) { - return new Parser.syntaxFactory.ForStatementSyntax(parseNodeData, forKeyword, openParenToken, variableDeclaration, initializer, eatToken(78 /* SemicolonToken */), tryParseForStatementCondition(), eatToken(78 /* SemicolonToken */), tryParseForStatementIncrementor(), eatToken(73 /* CloseParenToken */), parseStatement(false)); - } - function tryEatBreakOrContinueLabel() { - var identifier = null; - if (!canEatExplicitOrAutomaticSemicolon(false)) { - if (isIdentifier(currentToken())) { - return eatIdentifierToken(); - } - } - return null; - } - function parseBreakStatement(breakKeyword) { - return new Parser.syntaxFactory.BreakStatementSyntax(parseNodeData, consumeToken(breakKeyword), tryEatBreakOrContinueLabel(), eatExplicitOrAutomaticSemicolon(false)); - } - function parseContinueStatement(continueKeyword) { - return new Parser.syntaxFactory.ContinueStatementSyntax(parseNodeData, consumeToken(continueKeyword), tryEatBreakOrContinueLabel(), eatExplicitOrAutomaticSemicolon(false)); - } - function parseSwitchStatement(switchKeyword) { - consumeToken(switchKeyword); - var openParenToken = eatToken(72 /* OpenParenToken */); - var expression = parseExpression(true); - var closeParenToken = eatToken(73 /* CloseParenToken */); - var openBraceToken = eatToken(70 /* OpenBraceToken */); - var switchClauses = TypeScript.Syntax.emptyList(); - if (openBraceToken.fullWidth() > 0) { - var skippedTokens = getArray(); - switchClauses = parseSyntaxList(3 /* SwitchStatement_SwitchClauses */, skippedTokens); - openBraceToken = addSkippedTokensAfterToken(openBraceToken, skippedTokens); - } - return new Parser.syntaxFactory.SwitchStatementSyntax(parseNodeData, switchKeyword, openParenToken, expression, closeParenToken, openBraceToken, switchClauses, eatToken(71 /* CloseBraceToken */)); - } - function isSwitchClause() { - if (TypeScript.SyntaxUtilities.isSwitchClause(currentNode())) { - return true; - } - var currentTokenKind = currentToken().kind(); - return currentTokenKind === 16 /* CaseKeyword */ || currentTokenKind === 20 /* DefaultKeyword */; - } - function tryParseSwitchClause() { - var node = currentNode(); - if (TypeScript.SyntaxUtilities.isSwitchClause(node)) { - consumeNode(node); - return node; - } - var _currentToken = currentToken(); - var kind = _currentToken.kind(); - if (kind === 16 /* CaseKeyword */) { - return parseCaseSwitchClause(_currentToken); - } - else if (kind === 20 /* DefaultKeyword */) { - return parseDefaultSwitchClause(_currentToken); - } - else { - return null; - } - } - function parseCaseSwitchClause(caseKeyword) { - consumeToken(caseKeyword); - var expression = parseExpression(true); - var colonToken = eatToken(106 /* ColonToken */); - var statements = TypeScript.Syntax.emptyList(); - if (colonToken.fullWidth() > 0) { - var skippedTokens = getArray(); - statements = parseSyntaxList(4 /* SwitchClause_Statements */, skippedTokens); - colonToken = addSkippedTokensAfterToken(colonToken, skippedTokens); - } - return new Parser.syntaxFactory.CaseSwitchClauseSyntax(parseNodeData, caseKeyword, expression, colonToken, statements); - } - function parseDefaultSwitchClause(defaultKeyword) { - consumeToken(defaultKeyword); - var colonToken = eatToken(106 /* ColonToken */); - var statements = TypeScript.Syntax.emptyList(); - if (colonToken.fullWidth() > 0) { - var skippedTokens = getArray(); - statements = parseSyntaxList(4 /* SwitchClause_Statements */, skippedTokens); - colonToken = addSkippedTokensAfterToken(colonToken, skippedTokens); - } - return new Parser.syntaxFactory.DefaultSwitchClauseSyntax(parseNodeData, defaultKeyword, colonToken, statements); - } - function parseThrowStatementExpression() { - return canEatExplicitOrAutomaticSemicolon(false) ? createMissingToken(11 /* IdentifierName */, null) : parseExpression(true); - } - function parseThrowStatement(throwKeyword) { - return new Parser.syntaxFactory.ThrowStatementSyntax(parseNodeData, consumeToken(throwKeyword), parseThrowStatementExpression(), eatExplicitOrAutomaticSemicolon(false)); - } - function tryParseReturnStatementExpression() { - return !canEatExplicitOrAutomaticSemicolon(false) ? parseExpression(true) : null; - } - function parseReturnStatement(returnKeyword) { - return new Parser.syntaxFactory.ReturnStatementSyntax(parseNodeData, consumeToken(returnKeyword), tryParseReturnStatementExpression(), eatExplicitOrAutomaticSemicolon(false)); - } - function isExpressionStatement(currentToken) { - var tokenKind = currentToken.kind(); - return tokenKind !== 70 /* OpenBraceToken */ && tokenKind !== 27 /* FunctionKeyword */ && isExpression(currentToken); - } - function isAssignmentOrOmittedExpression() { - var _currentToken = currentToken(); - return _currentToken.kind() === 79 /* CommaToken */ || isExpression(_currentToken); - } - function tryParseAssignmentOrOmittedExpression() { - if (currentToken().kind() === 79 /* CommaToken */) { - return new Parser.syntaxFactory.OmittedExpressionSyntax(parseNodeData); - } - return tryParseAssignmentExpressionOrHigher(false, true); - } - function isExpression(currentToken) { - switch (currentToken.kind()) { - case 13 /* NumericLiteral */: - case 14 /* StringLiteral */: - case 12 /* RegularExpressionLiteral */: - case 74 /* OpenBracketToken */: - case 72 /* OpenParenToken */: - case 80 /* LessThanToken */: - case 93 /* PlusPlusToken */: - case 94 /* MinusMinusToken */: - case 89 /* PlusToken */: - case 90 /* MinusToken */: - case 102 /* TildeToken */: - case 101 /* ExclamationToken */: - case 70 /* OpenBraceToken */: - case 85 /* EqualsGreaterThanToken */: - case 118 /* SlashToken */: - case 119 /* SlashEqualsToken */: - case 50 /* SuperKeyword */: - case 35 /* ThisKeyword */: - case 37 /* TrueKeyword */: - case 24 /* FalseKeyword */: - case 32 /* NullKeyword */: - case 31 /* NewKeyword */: - case 21 /* DeleteKeyword */: - case 41 /* VoidKeyword */: - case 39 /* TypeOfKeyword */: - case 27 /* FunctionKeyword */: - return true; - } - return isIdentifier(currentToken); - } - function parseExpressionStatement() { - return new Parser.syntaxFactory.ExpressionStatementSyntax(parseNodeData, parseExpression(true), eatExplicitOrAutomaticSemicolon(false)); - } - function parseIfStatement(ifKeyword) { - return new Parser.syntaxFactory.IfStatementSyntax(parseNodeData, consumeToken(ifKeyword), eatToken(72 /* OpenParenToken */), parseExpression(true), eatToken(73 /* CloseParenToken */), parseStatement(false), parseOptionalElseClause()); - } - function parseOptionalElseClause() { - return currentToken().kind() === 23 /* ElseKeyword */ ? parseElseClause() : null; - } - function parseElseClause() { - return new Parser.syntaxFactory.ElseClauseSyntax(parseNodeData, eatToken(23 /* ElseKeyword */), parseStatement(false)); - } - function isVariableStatement(modifierCount) { - return peekToken(modifierCount).kind() === 40 /* VarKeyword */; - } - function parseVariableStatement() { - return new Parser.syntaxFactory.VariableStatementSyntax(parseNodeData, parseModifiers(), parseVariableDeclaration(true), eatExplicitOrAutomaticSemicolon(false)); - } - function parseVariableDeclaration(allowIn) { - var varKeyword = eatToken(40 /* VarKeyword */); - var listParsingState = allowIn ? 12 /* VariableDeclaration_VariableDeclarators_AllowIn */ : 13 /* VariableDeclaration_VariableDeclarators_DisallowIn */; - var skippedTokens = getArray(); - var variableDeclarators = parseSeparatedSyntaxList(listParsingState, skippedTokens); - varKeyword = addSkippedTokensAfterToken(varKeyword, skippedTokens); - return new Parser.syntaxFactory.VariableDeclarationSyntax(parseNodeData, varKeyword, variableDeclarators); - } - function isVariableDeclarator() { - var node = currentNode(); - if (node !== null && node.kind() === 226 /* VariableDeclarator */) { - return true; - } - return isIdentifier(currentToken()); - } - function canReuseVariableDeclaratorNode(node) { - if (node === null || node.kind() !== 226 /* VariableDeclarator */) { - return false; - } - var variableDeclarator = node; - return variableDeclarator.equalsValueClause === null; - } - function tryParseVariableDeclarator(allowIn, allowPropertyName) { - var node = currentNode(); - if (canReuseVariableDeclaratorNode(node)) { - consumeNode(node); - return node; - } - if (allowPropertyName) { - } - if (!allowPropertyName && !isIdentifier(currentToken())) { - return null; - } - var propertyName = allowPropertyName ? eatPropertyName() : eatIdentifierToken(); - var equalsValueClause = null; - var typeAnnotation = null; - if (propertyName.fullWidth() > 0) { - typeAnnotation = parseOptionalTypeAnnotation(false); - if (isEqualsValueClause(false)) { - equalsValueClause = parseEqualsValueClause(allowIn); - } - } - return new Parser.syntaxFactory.VariableDeclaratorSyntax(parseNodeData, propertyName, typeAnnotation, equalsValueClause); - } - function isEqualsValueClause(inParameter) { - var token0 = currentToken(); - if (token0.kind() === 107 /* EqualsToken */) { - return true; - } - if (!previousTokenHasTrailingNewLine(token0)) { - var tokenKind = token0.kind(); - if (tokenKind === 85 /* EqualsGreaterThanToken */) { - return false; - } - if (tokenKind === 70 /* OpenBraceToken */ && inParameter) { - return false; - } - return isExpression(token0); - } - return false; - } - function parseEqualsValueClause(allowIn) { - return new Parser.syntaxFactory.EqualsValueClauseSyntax(parseNodeData, eatToken(107 /* EqualsToken */), tryParseAssignmentExpressionOrHigher(true, allowIn)); - } - function parseExpression(allowIn) { - var leftOperand = tryParseAssignmentExpressionOrHigher(true, allowIn); - while (true) { - var _currentToken = currentToken(); - if (_currentToken.kind() !== 79 /* CommaToken */) { - break; - } - leftOperand = new Parser.syntaxFactory.BinaryExpressionSyntax(parseNodeData, leftOperand, consumeToken(_currentToken), tryParseAssignmentExpressionOrHigher(true, allowIn)); - } - return leftOperand; - } - function tryParseAssignmentExpressionOrHigher(force, allowIn) { - var _currentToken = currentToken(); - var arrowFunction = tryParseAnyArrowFunctionExpression(_currentToken); - if (arrowFunction !== null) { - return arrowFunction; - } - var leftOperand = tryParseBinaryExpressionOrHigher(_currentToken, force, 1 /* Lowest */, allowIn); - if (leftOperand === null) { - return null; - } - if (TypeScript.SyntaxUtilities.isLeftHandSizeExpression(leftOperand)) { - var operatorToken = currentOperatorToken(); - if (TypeScript.SyntaxFacts.isAssignmentOperatorToken(operatorToken.kind())) { - return new Parser.syntaxFactory.BinaryExpressionSyntax(parseNodeData, leftOperand, consumeToken(operatorToken), tryParseAssignmentExpressionOrHigher(true, allowIn)); - } - } - return parseConditionalExpressionRest(allowIn, leftOperand); - } - function tryParseAnyArrowFunctionExpression(_currentToken) { - return isSimpleArrowFunctionExpression(_currentToken) ? parseSimpleArrowFunctionExpression() : tryParseParenthesizedArrowFunctionExpression(); - } - function tryParseUnaryExpressionOrHigher(_currentToken, force) { - var currentTokenKind = _currentToken.kind(); - switch (currentTokenKind) { - case 89 /* PlusToken */: - case 90 /* MinusToken */: - case 102 /* TildeToken */: - case 101 /* ExclamationToken */: - case 93 /* PlusPlusToken */: - case 94 /* MinusMinusToken */: - return new Parser.syntaxFactory.PrefixUnaryExpressionSyntax(parseNodeData, consumeToken(_currentToken), tryParseUnaryExpressionOrHigher(currentToken(), true)); - case 39 /* TypeOfKeyword */: - return parseTypeOfExpression(_currentToken); - case 41 /* VoidKeyword */: - return parseVoidExpression(_currentToken); - case 21 /* DeleteKeyword */: - return parseDeleteExpression(_currentToken); - case 80 /* LessThanToken */: - return parseCastExpression(_currentToken); - default: - return tryParsePostfixExpressionOrHigher(_currentToken, force); - } - } - function tryParseBinaryExpressionOrHigher(_currentToken, force, precedence, allowIn) { - var leftOperand = tryParseUnaryExpressionOrHigher(_currentToken, force); - if (leftOperand === null) { - return null; - } - return parseBinaryExpressionRest(precedence, allowIn, leftOperand); - } - function parseConditionalExpressionRest(allowIn, leftOperand) { - var _currentToken = currentToken(); - if (_currentToken.kind() !== 105 /* QuestionToken */) { - return leftOperand; - } - return new Parser.syntaxFactory.ConditionalExpressionSyntax(parseNodeData, leftOperand, consumeToken(_currentToken), tryParseAssignmentExpressionOrHigher(true, true), eatToken(106 /* ColonToken */), tryParseAssignmentExpressionOrHigher(true, allowIn)); - } - function parseBinaryExpressionRest(precedence, allowIn, leftOperand) { - while (true) { - var operatorToken = currentOperatorToken(); - var tokenKind = operatorToken.kind(); - if (!TypeScript.SyntaxFacts.isBinaryExpressionOperatorToken(tokenKind) || tokenKind === 79 /* CommaToken */ || TypeScript.SyntaxFacts.isAssignmentOperatorToken(tokenKind)) { - break; - } - if (tokenKind === 29 /* InKeyword */ && !allowIn) { - break; - } - var newPrecedence = getBinaryExpressionPrecedence(tokenKind); - if (newPrecedence <= precedence) { - break; - } - leftOperand = new Parser.syntaxFactory.BinaryExpressionSyntax(parseNodeData, leftOperand, consumeToken(operatorToken), tryParseBinaryExpressionOrHigher(currentToken(), true, newPrecedence, allowIn)); - } - return leftOperand; - } - function currentOperatorToken() { - var token0 = currentToken(); - if (token0.kind() === 81 /* GreaterThanToken */) { - return currentContextualToken(); - } - return token0; - } - function tryParseMemberExpressionOrHigher(_currentToken, force, inObjectCreation) { - var expression = tryParsePrimaryExpression(_currentToken, force); - if (expression === null) { - return null; - } - return parseMemberExpressionRest(expression, inObjectCreation); - } - function parseCallExpressionRest(expression) { - while (true) { - var _currentToken = currentToken(); - var currentTokenKind = _currentToken.kind(); - switch (currentTokenKind) { - case 72 /* OpenParenToken */: - expression = new Parser.syntaxFactory.InvocationExpressionSyntax(parseNodeData, expression, parseArgumentList(null)); - continue; - case 80 /* LessThanToken */: - var argumentList = tryParseArgumentList(); - if (argumentList === null) { - break; - } - expression = new Parser.syntaxFactory.InvocationExpressionSyntax(parseNodeData, expression, argumentList); - continue; - case 74 /* OpenBracketToken */: - expression = parseElementAccessExpression(expression, _currentToken, false); - continue; - case 76 /* DotToken */: - expression = new Parser.syntaxFactory.MemberAccessExpressionSyntax(parseNodeData, expression, consumeToken(_currentToken), eatIdentifierNameToken()); - continue; - } - return expression; - } - } - function parseMemberExpressionRest(expression, inObjectCreation) { - while (true) { - var _currentToken = currentToken(); - var currentTokenKind = _currentToken.kind(); - switch (currentTokenKind) { - case 74 /* OpenBracketToken */: - expression = parseElementAccessExpression(expression, _currentToken, inObjectCreation); - continue; - case 76 /* DotToken */: - expression = new Parser.syntaxFactory.MemberAccessExpressionSyntax(parseNodeData, expression, consumeToken(_currentToken), eatIdentifierNameToken()); - continue; - } - return expression; - } - } - function tryParseLeftHandSideExpressionOrHigher(_currentToken, force) { - var expression = null; - if (_currentToken.kind() === 50 /* SuperKeyword */) { - expression = parseSuperExpression(_currentToken); - } - else { - expression = tryParseMemberExpressionOrHigher(_currentToken, force, false); - if (expression === null) { - return null; - } - } - return parseCallExpressionRest(expression); - } - function parseSuperExpression(superToken) { - var expression = consumeToken(superToken); - var currentTokenKind = currentToken().kind(); - return currentTokenKind === 72 /* OpenParenToken */ || currentTokenKind === 76 /* DotToken */ ? expression : new Parser.syntaxFactory.MemberAccessExpressionSyntax(parseNodeData, expression, eatToken(76 /* DotToken */), eatIdentifierNameToken()); - } - function tryParsePostfixExpressionOrHigher(_currentToken, force) { - var expression = tryParseLeftHandSideExpressionOrHigher(_currentToken, force); - if (expression === null) { - return null; - } - var _currentToken = currentToken(); - var currentTokenKind = _currentToken.kind(); - switch (currentTokenKind) { - case 93 /* PlusPlusToken */: - case 94 /* MinusMinusToken */: - if (previousTokenHasTrailingNewLine(_currentToken)) { - break; - } - return new Parser.syntaxFactory.PostfixUnaryExpressionSyntax(parseNodeData, expression, consumeToken(_currentToken)); - } - return expression; - } - function tryParseGenericArgumentList() { - var rewindPoint = getRewindPoint(); - var typeArgumentList = tryParseTypeArgumentList(true); - var token0 = currentToken(); - var tokenKind = token0.kind(); - var isOpenParen = tokenKind === 72 /* OpenParenToken */; - var isDot = tokenKind === 76 /* DotToken */; - var isOpenParenOrDot = isOpenParen || isDot; - var argumentList = null; - if (typeArgumentList === null || !isOpenParenOrDot) { - rewind(rewindPoint); - releaseRewindPoint(rewindPoint); - return null; - } - else { - releaseRewindPoint(rewindPoint); - if (isDot) { - var diagnostic = new TypeScript.Diagnostic(fileName, source.text.lineMap(), TypeScript.start(token0, source.text), TypeScript.width(token0), TypeScript.DiagnosticCode.A_parameter_list_must_follow_a_generic_type_argument_list_expected, null); - addDiagnostic(diagnostic); - return new Parser.syntaxFactory.ArgumentListSyntax(parseNodeData, typeArgumentList, TypeScript.Syntax.emptyToken(72 /* OpenParenToken */), TypeScript.Syntax.emptySeparatedList(), TypeScript.Syntax.emptyToken(73 /* CloseParenToken */)); - } - else { - return parseArgumentList(typeArgumentList); - } - } - } - function tryParseArgumentList() { - var tokenKind = currentToken().kind(); - if (tokenKind === 80 /* LessThanToken */) { - return tryParseGenericArgumentList(); - } - if (tokenKind === 72 /* OpenParenToken */) { - return parseArgumentList(null); - } - return null; - } - function parseArgumentList(typeArgumentList) { - var openParenToken = eatToken(72 /* OpenParenToken */); - var _arguments = TypeScript.Syntax.emptySeparatedList(); - if (openParenToken.fullWidth() > 0) { - var skippedTokens = getArray(); - _arguments = parseSeparatedSyntaxList(14 /* ArgumentList_AssignmentExpressions */, skippedTokens); - openParenToken = addSkippedTokensAfterToken(openParenToken, skippedTokens); - } - return new Parser.syntaxFactory.ArgumentListSyntax(parseNodeData, typeArgumentList, openParenToken, _arguments, eatToken(73 /* CloseParenToken */)); - } - function tryParseArgumentListExpression() { - var force = currentToken().kind() === 79 /* CommaToken */; - return tryParseAssignmentExpressionOrHigher(force, true); - } - function parseElementAccessArgumentExpression(openBracketToken, inObjectCreation) { - if (inObjectCreation && currentToken().kind() === 75 /* CloseBracketToken */) { - var errorStart = TypeScript.start(openBracketToken, source.text); - var errorEnd = TypeScript.end(currentToken(), source.text); - var diagnostic = new TypeScript.Diagnostic(fileName, source.text.lineMap(), errorStart, errorEnd - errorStart, TypeScript.DiagnosticCode.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead, null); - addDiagnostic(diagnostic); - return TypeScript.Syntax.emptyToken(11 /* IdentifierName */); - } - else { - return parseExpression(true); - } - } - function parseElementAccessExpression(expression, openBracketToken, inObjectCreation) { - return new Parser.syntaxFactory.ElementAccessExpressionSyntax(parseNodeData, expression, consumeToken(openBracketToken), parseElementAccessArgumentExpression(openBracketToken, inObjectCreation), eatToken(75 /* CloseBracketToken */)); - } - function tryParsePrimaryExpression(_currentToken, force) { - if (isIdentifier(_currentToken)) { - return eatIdentifierToken(); - } - var currentTokenKind = _currentToken.kind(); - switch (currentTokenKind) { - case 35 /* ThisKeyword */: - case 37 /* TrueKeyword */: - case 24 /* FalseKeyword */: - case 32 /* NullKeyword */: - case 13 /* NumericLiteral */: - case 12 /* RegularExpressionLiteral */: - case 14 /* StringLiteral */: - return consumeToken(_currentToken); - case 27 /* FunctionKeyword */: - return parseFunctionExpression(_currentToken); - case 74 /* OpenBracketToken */: - return parseArrayLiteralExpression(_currentToken); - case 70 /* OpenBraceToken */: - return parseObjectLiteralExpression(_currentToken); - case 72 /* OpenParenToken */: - return parseParenthesizedExpression(_currentToken); - case 31 /* NewKeyword */: - return parseObjectCreationExpression(_currentToken); - case 118 /* SlashToken */: - case 119 /* SlashEqualsToken */: - var result = tryReparseDivideAsRegularExpression(); - return result || eatIdentifierToken(TypeScript.DiagnosticCode.Expression_expected); - } - if (!force) { - return null; - } - return eatIdentifierToken(TypeScript.DiagnosticCode.Expression_expected); - } - function tryReparseDivideAsRegularExpression() { - var currentToken = currentContextualToken(); - var tokenKind = currentToken.kind(); - if (tokenKind === 118 /* SlashToken */ || tokenKind === 119 /* SlashEqualsToken */) { - return null; - } - else if (tokenKind === 12 /* RegularExpressionLiteral */) { - return consumeToken(currentToken); - } - else { - throw TypeScript.Errors.invalidOperation(); - } - } - function parseTypeOfExpression(typeOfKeyword) { - return new Parser.syntaxFactory.TypeOfExpressionSyntax(parseNodeData, consumeToken(typeOfKeyword), tryParseUnaryExpressionOrHigher(currentToken(), true)); - } - function parseDeleteExpression(deleteKeyword) { - return new Parser.syntaxFactory.DeleteExpressionSyntax(parseNodeData, consumeToken(deleteKeyword), tryParseUnaryExpressionOrHigher(currentToken(), true)); - } - function parseVoidExpression(voidKeyword) { - return new Parser.syntaxFactory.VoidExpressionSyntax(parseNodeData, consumeToken(voidKeyword), tryParseUnaryExpressionOrHigher(currentToken(), true)); - } - function parseFunctionExpression(functionKeyword) { - return new Parser.syntaxFactory.FunctionExpressionSyntax(parseNodeData, consumeToken(functionKeyword), eatOptionalIdentifierToken(), parseCallSignature(false), parseBlock(false, true)); - } - function parseObjectCreationExpression(newKeyword) { - return new Parser.syntaxFactory.ObjectCreationExpressionSyntax(parseNodeData, consumeToken(newKeyword), tryParseMemberExpressionOrHigher(currentToken(), true, true), tryParseArgumentList()); - } - function parseCastExpression(lessThanToken) { - return new Parser.syntaxFactory.CastExpressionSyntax(parseNodeData, consumeToken(lessThanToken), parseType(), eatToken(81 /* GreaterThanToken */), tryParseUnaryExpressionOrHigher(currentToken(), true)); - } - function parseParenthesizedExpression(openParenToken) { - return new Parser.syntaxFactory.ParenthesizedExpressionSyntax(parseNodeData, consumeToken(openParenToken), parseExpression(true), eatToken(73 /* CloseParenToken */)); - } - function tryParseParenthesizedArrowFunctionExpression() { - var tokenKind = currentToken().kind(); - if (tokenKind !== 72 /* OpenParenToken */ && tokenKind !== 80 /* LessThanToken */) { - return null; - } - if (isDefinitelyArrowFunctionExpression()) { - return tryParseParenthesizedArrowFunctionExpressionWorker(false); - } - if (!isPossiblyArrowFunctionExpression()) { - return null; - } - var rewindPoint = getRewindPoint(); - var arrowFunction = tryParseParenthesizedArrowFunctionExpressionWorker(true); - if (arrowFunction === null) { - rewind(rewindPoint); - } - releaseRewindPoint(rewindPoint); - return arrowFunction; - } - function tryParseParenthesizedArrowFunctionExpressionWorker(requireArrow) { - var _currentToken = currentToken(); - var callSignature = parseCallSignature(true); - if (requireArrow && currentToken().kind() !== 85 /* EqualsGreaterThanToken */) { - return null; - } - var equalsGreaterThanToken = eatToken(85 /* EqualsGreaterThanToken */); - var block = tryParseArrowFunctionBlock(); - var expression = null; - if (block === null) { - expression = tryParseAssignmentExpressionOrHigher(true, true); - } - return new Parser.syntaxFactory.ParenthesizedArrowFunctionExpressionSyntax(parseNodeData, callSignature, equalsGreaterThanToken, block, expression); - } - function tryParseArrowFunctionBlock() { - if (isBlock()) { - return parseBlock(false, false); - } - else { - var _modifierCount = modifierCount(); - if (isStatement(_modifierCount, false) && !isExpressionStatement(currentToken()) && !isFunctionDeclaration(_modifierCount)) { - return parseBlock(true, false); - } - else { - return null; - } - } - } - function isSimpleArrowFunctionExpression(_currentToken) { - if (_currentToken.kind() === 85 /* EqualsGreaterThanToken */) { - return true; - } - return isIdentifier(_currentToken) && peekToken(1).kind() === 85 /* EqualsGreaterThanToken */; - } - function parseSimpleArrowFunctionExpression() { - var parameter = eatSimpleParameter(); - var equalsGreaterThanToken = eatToken(85 /* EqualsGreaterThanToken */); - var block = tryParseArrowFunctionBlock(); - var expression = null; - if (block === null) { - expression = tryParseAssignmentExpressionOrHigher(true, true); - } - return new Parser.syntaxFactory.SimpleArrowFunctionExpressionSyntax(parseNodeData, parameter, equalsGreaterThanToken, block, expression); - } - function isBlock() { - return currentToken().kind() === 70 /* OpenBraceToken */; - } - function isDefinitelyArrowFunctionExpression() { - var token0 = currentToken(); - if (token0.kind() !== 72 /* OpenParenToken */) { - return false; - } - var token1 = peekToken(1); - var token1Kind = token1.kind(); - var token2; - if (token1Kind === 73 /* CloseParenToken */) { - token2 = peekToken(2); - var token2Kind = token2.kind(); - return token2Kind === 106 /* ColonToken */ || token2Kind === 85 /* EqualsGreaterThanToken */ || token2Kind === 70 /* OpenBraceToken */; - } - if (token1Kind === 77 /* DotDotDotToken */) { - return true; - } - token2 = peekToken(2); - token2Kind = token2.kind(); - if (TypeScript.SyntaxFacts.isAccessibilityModifier(token1Kind)) { - if (isIdentifier(token2)) { - return true; - } - } - if (!isIdentifier(token1)) { - return false; - } - if (token2Kind === 106 /* ColonToken */) { - return true; - } - var token3 = peekToken(3); - var token3Kind = token3.kind(); - if (token2Kind === 105 /* QuestionToken */) { - if (token3Kind === 106 /* ColonToken */ || token3Kind === 73 /* CloseParenToken */ || token3Kind === 79 /* CommaToken */) { - return true; - } - } - if (token2Kind === 73 /* CloseParenToken */) { - if (token3Kind === 85 /* EqualsGreaterThanToken */) { - return true; - } - } - return false; - } - function isPossiblyArrowFunctionExpression() { - var token0 = currentToken(); - if (token0.kind() !== 72 /* OpenParenToken */) { - return true; - } - var token1 = peekToken(1); - if (!isIdentifier(token1)) { - return false; - } - var token2 = peekToken(2); - var token2Kind = token2.kind(); - if (token2Kind === 107 /* EqualsToken */) { - return true; - } - if (token2Kind === 79 /* CommaToken */) { - return true; - } - if (token2Kind === 73 /* CloseParenToken */) { - var token3 = peekToken(3); - if (token3.kind() === 106 /* ColonToken */) { - return true; - } - } - return false; - } - function parseObjectLiteralExpression(openBraceToken) { - consumeToken(openBraceToken); - var skippedTokens = getArray(); - var propertyAssignments = parseSeparatedSyntaxList(15 /* ObjectLiteralExpression_PropertyAssignments */, skippedTokens); - openBraceToken = addSkippedTokensAfterToken(openBraceToken, skippedTokens); - return new Parser.syntaxFactory.ObjectLiteralExpressionSyntax(parseNodeData, openBraceToken, propertyAssignments, eatToken(71 /* CloseBraceToken */)); - } - function tryParsePropertyAssignment(inErrorRecovery) { - if (isAccessor(modifierCount(), inErrorRecovery)) { - return parseAccessor(true); - } - else if (isFunctionPropertyAssignment(inErrorRecovery)) { - return parseFunctionPropertyAssignment(); - } - else if (isSimplePropertyAssignment(inErrorRecovery)) { - return parseSimplePropertyAssignment(); - } - else { - return null; - } - } - function isPropertyAssignment(inErrorRecovery) { - return isAccessor(modifierCount(), inErrorRecovery) || isFunctionPropertyAssignment(inErrorRecovery) || isSimplePropertyAssignment(inErrorRecovery); - } - function eatPropertyName() { - var _currentToken = currentToken(); - return TypeScript.SyntaxFacts.isIdentifierNameOrAnyKeyword(_currentToken) ? eatIdentifierNameToken() : consumeToken(_currentToken); - } - function isFunctionPropertyAssignment(inErrorRecovery) { - return isPropertyName(currentToken(), inErrorRecovery) && isCallSignature(1); - } - function parseFunctionPropertyAssignment() { - return new Parser.syntaxFactory.FunctionPropertyAssignmentSyntax(parseNodeData, eatPropertyName(), parseCallSignature(false), parseBlock(false, true)); - } - function isSimplePropertyAssignment(inErrorRecovery) { - return isPropertyName(currentToken(), inErrorRecovery); - } - function parseSimplePropertyAssignment() { - return new Parser.syntaxFactory.SimplePropertyAssignmentSyntax(parseNodeData, eatPropertyName(), eatToken(106 /* ColonToken */), tryParseAssignmentExpressionOrHigher(true, true)); - } - function isPropertyName(token, inErrorRecovery) { - if (TypeScript.SyntaxFacts.isIdentifierNameOrAnyKeyword(token)) { - if (inErrorRecovery) { - return isIdentifier(token); - } - else { - return true; - } - } - var kind = token.kind(); - return kind === 14 /* StringLiteral */ || kind === 13 /* NumericLiteral */; - } - function parseArrayLiteralExpression(openBracketToken) { - consumeToken(openBracketToken); - var skippedTokens = getArray(); - var expressions = parseSeparatedSyntaxList(16 /* ArrayLiteralExpression_AssignmentExpressions */, skippedTokens); - openBracketToken = addSkippedTokensAfterToken(openBracketToken, skippedTokens); - return new Parser.syntaxFactory.ArrayLiteralExpressionSyntax(parseNodeData, openBracketToken, expressions, eatToken(75 /* CloseBracketToken */)); - } - function parseBlock(parseBlockEvenWithNoOpenBrace, checkForStrictMode) { - var openBraceToken = eatToken(70 /* OpenBraceToken */); - var statements = TypeScript.Syntax.emptyList(); - if (parseBlockEvenWithNoOpenBrace || openBraceToken.fullWidth() > 0) { - var savedIsInStrictMode = isInStrictMode; - var processItems = checkForStrictMode ? updateStrictModeState : null; - var skippedTokens = getArray(); - var statements = parseSyntaxList(5 /* Block_Statements */, skippedTokens, processItems); - openBraceToken = addSkippedTokensAfterToken(openBraceToken, skippedTokens); - setStrictMode(savedIsInStrictMode); - } - return new Parser.syntaxFactory.BlockSyntax(parseNodeData, openBraceToken, statements, eatToken(71 /* CloseBraceToken */)); - } - function parseCallSignature(requireCompleteTypeParameterList) { - return new Parser.syntaxFactory.CallSignatureSyntax(parseNodeData, tryParseTypeParameterList(requireCompleteTypeParameterList), parseParameterList(), parseOptionalTypeAnnotation(false)); - } - function tryParseTypeParameterList(requireCompleteTypeParameterList) { - var _currentToken = currentToken(); - if (_currentToken.kind() !== 80 /* LessThanToken */) { - return null; - } - var rewindPoint = getRewindPoint(); - var lessThanToken = consumeToken(_currentToken); - var skippedTokens = getArray(); - var typeParameters = parseSeparatedSyntaxList(20 /* TypeParameterList_TypeParameters */, skippedTokens); - lessThanToken = addSkippedTokensAfterToken(lessThanToken, skippedTokens); - var greaterThanToken = eatToken(81 /* GreaterThanToken */); - if (requireCompleteTypeParameterList && greaterThanToken.fullWidth() === 0) { - rewind(rewindPoint); - releaseRewindPoint(rewindPoint); - return null; - } - else { - releaseRewindPoint(rewindPoint); - return new Parser.syntaxFactory.TypeParameterListSyntax(parseNodeData, lessThanToken, typeParameters, greaterThanToken); - } - } - function isTypeParameter() { - return isIdentifier(currentToken()); - } - function tryParseTypeParameter() { - if (!isIdentifier(currentToken())) { - return null; - } - return new Parser.syntaxFactory.TypeParameterSyntax(parseNodeData, eatIdentifierToken(), tryParseConstraint()); - } - function tryParseConstraint() { - if (currentToken().kind() !== 48 /* ExtendsKeyword */) { - return null; - } - return new Parser.syntaxFactory.ConstraintSyntax(parseNodeData, eatToken(48 /* ExtendsKeyword */), parseTypeOrExpression()); - } - function tryParseParameterList() { - if (currentToken().kind() === 72 /* OpenParenToken */) { - var token1 = peekToken(1); - if (token1.kind() === 73 /* CloseParenToken */ || isParameterHelper(token1)) { - return parseParameterList(); - } - } - return null; - } - function parseParameterList() { - var openParenToken = eatToken(72 /* OpenParenToken */); - var parameters = TypeScript.Syntax.emptySeparatedList(); - if (openParenToken.fullWidth() > 0) { - var skippedTokens = getArray(); - parameters = parseSeparatedSyntaxList(17 /* ParameterList_Parameters */, skippedTokens); - openParenToken = addSkippedTokensAfterToken(openParenToken, skippedTokens); - } - return new Parser.syntaxFactory.ParameterListSyntax(parseNodeData, openParenToken, parameters, eatToken(73 /* CloseParenToken */)); - } - function parseOptionalTypeAnnotation(allowStringLiteral) { - return currentToken().kind() === 106 /* ColonToken */ ? parseTypeAnnotation(allowStringLiteral) : null; - } - function parseTypeAnnotationType(allowStringLiteral) { - if (allowStringLiteral) { - var _currentToken = currentToken(); - if (_currentToken.kind() === 14 /* StringLiteral */) { - return consumeToken(_currentToken); - } - } - return parseType(); - } - function parseTypeAnnotation(allowStringLiteral) { - return new Parser.syntaxFactory.TypeAnnotationSyntax(parseNodeData, consumeToken(currentToken()), parseTypeAnnotationType(allowStringLiteral)); - } - function isType() { - var _currentToken = currentToken(); - switch (_currentToken.kind()) { - case 39 /* TypeOfKeyword */: - case 60 /* AnyKeyword */: - case 67 /* NumberKeyword */: - case 61 /* BooleanKeyword */: - case 69 /* StringKeyword */: - case 41 /* VoidKeyword */: - case 70 /* OpenBraceToken */: - case 72 /* OpenParenToken */: - case 80 /* LessThanToken */: - case 31 /* NewKeyword */: - return true; - default: - return isIdentifier(_currentToken); - } - } - function parseTypeOrExpression() { - var result = tryParseType(); - if (result) { - return result; - } - var _currentToken = currentToken(); - if (isExpression(_currentToken)) { - return tryParseUnaryExpressionOrHigher(_currentToken, true); - } - return eatIdentifierToken(TypeScript.DiagnosticCode.Type_expected); - } - function parseType() { - return tryParseType() || eatIdentifierToken(TypeScript.DiagnosticCode.Type_expected); - } - function tryParseType() { - var type = tryParseNonArrayType(); - while (type) { - var _currentToken = currentToken(); - if (previousTokenHasTrailingNewLine(_currentToken) || _currentToken.kind() !== 74 /* OpenBracketToken */) { - break; - } - type = new Parser.syntaxFactory.ArrayTypeSyntax(parseNodeData, type, consumeToken(_currentToken), eatToken(75 /* CloseBracketToken */)); - } - return type; - } - function parseTypeQuery(typeOfKeyword) { - return new Parser.syntaxFactory.TypeQuerySyntax(parseNodeData, consumeToken(typeOfKeyword), parseName(true)); - } - function tryParseNonArrayType() { - var _currentToken = currentToken(); - switch (_currentToken.kind()) { - case 60 /* AnyKeyword */: - case 67 /* NumberKeyword */: - case 61 /* BooleanKeyword */: - case 69 /* StringKeyword */: - if (peekToken(1).kind() === 76 /* DotToken */) { - break; - } - return consumeToken(_currentToken); - case 72 /* OpenParenToken */: - case 80 /* LessThanToken */: - return tryParseFunctionType(); - case 41 /* VoidKeyword */: - return consumeToken(_currentToken); - case 70 /* OpenBraceToken */: - return parseObjectType(); - case 31 /* NewKeyword */: - return parseConstructorType(); - case 39 /* TypeOfKeyword */: - return parseTypeQuery(_currentToken); - case 74 /* OpenBracketToken */: - return parseTupleType(_currentToken); - } - return tryParseNameOrGenericType(); - } - function tryParseNameOrGenericType() { - var name = tryParseName(false); - if (name === null) { - return null; - } - if (previousTokenHasTrailingNewLine(currentToken())) { - return name; - } - var typeArgumentList = tryParseTypeArgumentList(false); - return typeArgumentList === null ? name : new Parser.syntaxFactory.GenericTypeSyntax(parseNodeData, name, typeArgumentList); - } - function tryParseFunctionType() { - var typeParameterList = tryParseTypeParameterList(false); - var parameterList = null; - if (typeParameterList === null) { - parameterList = tryParseParameterList(); - if (parameterList === null) { - return null; - } - } - else { - parameterList = parseParameterList(); - } - return new Parser.syntaxFactory.FunctionTypeSyntax(parseNodeData, typeParameterList, parameterList, eatToken(85 /* EqualsGreaterThanToken */), parseType()); - } - function parseConstructorType() { - return new Parser.syntaxFactory.ConstructorTypeSyntax(parseNodeData, eatToken(31 /* NewKeyword */), tryParseTypeParameterList(false), parseParameterList(), eatToken(85 /* EqualsGreaterThanToken */), parseType()); - } - function isParameter() { - if (currentNode() !== null && currentNode().kind() === 243 /* Parameter */) { - return true; - } - return isParameterHelper(currentToken()); - } - function isParameterHelper(token) { - var tokenKind = token.kind(); - return tokenKind === 77 /* DotDotDotToken */ || isModifierKind(tokenKind) || isIdentifier(token); - } - function eatSimpleParameter() { - return new Parser.syntaxFactory.ParameterSyntax(parseNodeData, null, TypeScript.Syntax.emptyList(), eatIdentifierToken(), null, null, null); - } - function tryParseParameter() { - var node = currentNode(); - if (node !== null && node.kind() === 243 /* Parameter */) { - consumeNode(node); - return node; - } - var dotDotDotToken = tryEatToken(77 /* DotDotDotToken */); - var modifiers = parseModifiers(); - var _currentToken = currentToken(); - if (!isIdentifier(_currentToken) && dotDotDotToken === null && modifiers.length === 0) { - if (isModifierKind(_currentToken.kind())) { - modifiers = TypeScript.Syntax.list([consumeToken(_currentToken)]); - } - else { - return null; - } - } - var identifier = eatIdentifierToken(); - var questionToken = tryEatToken(105 /* QuestionToken */); - var typeAnnotation = parseOptionalTypeAnnotation(true); - var equalsValueClause = null; - if (isEqualsValueClause(true)) { - equalsValueClause = parseEqualsValueClause(true); - } - return new Parser.syntaxFactory.ParameterSyntax(parseNodeData, dotDotDotToken, modifiers, identifier, questionToken, typeAnnotation, equalsValueClause); - } - function parseSyntaxList(currentListType, skippedTokens, processItems) { - if (processItems === void 0) { processItems = null; } - var savedListParsingState = listParsingState; - listParsingState |= (1 << currentListType); - var result = parseSyntaxListWorker(currentListType, skippedTokens, processItems); - listParsingState = savedListParsingState; - return result; - } - function parseSeparatedSyntaxList(currentListType, skippedTokens) { - var savedListParsingState = listParsingState; - listParsingState |= (1 << currentListType); - var result = parseSeparatedSyntaxListWorker(currentListType, skippedTokens); - listParsingState = savedListParsingState; - return result; - } - function abortParsingListOrMoveToNextToken(currentListType, nodes, separators, skippedTokens) { - reportUnexpectedTokenDiagnostic(currentListType); - for (var state = ListParsingState.LastListParsingState; state >= ListParsingState.FirstListParsingState; state--) { - if ((listParsingState & (1 << state)) !== 0) { - if (isExpectedListTerminator(state) || isExpectedListItem(state, true)) { - return true; - } - } - } - addSkippedTokenToList(nodes, separators, skippedTokens, consumeToken(currentToken())); - return false; - } - function addSkippedTokenToList(nodes, separators, skippedTokens, skippedToken) { - if (Parser.syntaxFactory.isConcrete) { - var length = nodes.length + (separators ? separators.length : 0); - for (var i = length - 1; i >= 0; i--) { - var array = separators && (i % 2 === 1) ? separators : nodes; - var arrayIndex = separators ? TypeScript.IntegerUtilities.integerDivide(i, 2) : i; - var item = array[arrayIndex]; - var _lastToken = TypeScript.lastToken(item); - if (_lastToken && _lastToken.fullWidth() > 0) { - array[arrayIndex] = addSkippedTokenAfterNodeOrToken(item, skippedToken); - return; - } - } - skippedTokens.push(skippedToken); - } - } - function tryParseExpectedListItem(currentListType, inErrorRecovery, items, processItems) { - var item = tryParseExpectedListItemWorker(currentListType, inErrorRecovery); - if (item === null) { - return false; - } - items.push(item); - if (processItems !== null) { - processItems(items); - } - return true; - } - function listIsTerminated(currentListType) { - return isExpectedListTerminator(currentListType) || currentToken().kind() === 10 /* EndOfFileToken */; - } - function parseSyntaxListWorker(currentListType, skippedTokens, processItems) { - var items = getArray(); - while (true) { - var succeeded = tryParseExpectedListItem(currentListType, false, items, processItems); - if (!succeeded) { - if (listIsTerminated(currentListType)) { - break; - } - var abort = abortParsingListOrMoveToNextToken(currentListType, items, null, skippedTokens); - if (abort) { - break; - } - } - } - var result = TypeScript.Syntax.list(items); - returnZeroLengthArray(items); - return result; - } - function parseSeparatedSyntaxListWorker(currentListType, skippedTokens) { - var nodes = getArray(); - var separators = getArray(); - var _separatorKind = currentListType === 9 /* ObjectType_TypeMembers */ ? 78 /* SemicolonToken */ : 79 /* CommaToken */; - var allowAutomaticSemicolonInsertion = _separatorKind === 78 /* SemicolonToken */; - var inErrorRecovery = false; - while (true) { - var succeeded = tryParseExpectedListItem(currentListType, inErrorRecovery, nodes, null); - if (!succeeded) { - if (listIsTerminated(currentListType)) { - break; - } - var abort = abortParsingListOrMoveToNextToken(currentListType, nodes, separators, skippedTokens); - if (abort) { - break; - } - else { - inErrorRecovery = true; - continue; - } - } - inErrorRecovery = false; - var _currentToken = currentToken(); - var tokenKind = _currentToken.kind(); - if (tokenKind === _separatorKind || tokenKind === 79 /* CommaToken */) { - separators.push(consumeToken(_currentToken)); - continue; - } - if (listIsTerminated(currentListType)) { - break; - } - if (allowAutomaticSemicolonInsertion && canEatAutomaticSemicolon(false)) { - var semicolonToken = eatExplicitOrAutomaticSemicolon(false) || TypeScript.Syntax.emptyToken(78 /* SemicolonToken */); - separators.push(semicolonToken); - continue; - } - separators.push(eatToken(_separatorKind)); - inErrorRecovery = true; - } - var result = TypeScript.Syntax.separatedList(nodes, separators); - returnZeroLengthArray(nodes); - returnZeroLengthArray(separators); - return result; - } - function reportUnexpectedTokenDiagnostic(listType) { - var token = currentToken(); - var diagnostic = new TypeScript.Diagnostic(fileName, source.text.lineMap(), TypeScript.start(token, source.text), TypeScript.width(token), TypeScript.DiagnosticCode.Unexpected_token_0_expected, [getExpectedListElementType(listType)]); - addDiagnostic(diagnostic); - } - function addDiagnostic(diagnostic) { - if (diagnostics.length > 0 && diagnostics[diagnostics.length - 1].start() === diagnostic.start()) { - return; - } - diagnostics.push(diagnostic); - } - function isExpectedListTerminator(currentListType) { - switch (currentListType) { - case 0 /* SourceUnit_ModuleElements */: - return isExpectedSourceUnit_ModuleElementsTerminator(); - case 1 /* ClassDeclaration_ClassElements */: - return isExpectedClassDeclaration_ClassElementsTerminator(); - case 2 /* ModuleDeclaration_ModuleElements */: - return isExpectedModuleDeclaration_ModuleElementsTerminator(); - case 3 /* SwitchStatement_SwitchClauses */: - return isExpectedSwitchStatement_SwitchClausesTerminator(); - case 4 /* SwitchClause_Statements */: - return isExpectedSwitchClause_StatementsTerminator(); - case 5 /* Block_Statements */: - return isExpectedBlock_StatementsTerminator(); - case 6 /* TryBlock_Statements */: - return isExpectedTryBlock_StatementsTerminator(); - case 7 /* CatchBlock_Statements */: - return isExpectedCatchBlock_StatementsTerminator(); - case 8 /* EnumDeclaration_EnumElements */: - return isExpectedEnumDeclaration_EnumElementsTerminator(); - case 9 /* ObjectType_TypeMembers */: - return isExpectedObjectType_TypeMembersTerminator(); - case 10 /* ClassOrInterfaceDeclaration_HeritageClauses */: - return isExpectedClassOrInterfaceDeclaration_HeritageClausesTerminator(); - case 11 /* HeritageClause_TypeNameList */: - return isExpectedHeritageClause_TypeNameListTerminator(); - case 12 /* VariableDeclaration_VariableDeclarators_AllowIn */: - return isExpectedVariableDeclaration_VariableDeclarators_AllowInTerminator(); - case 13 /* VariableDeclaration_VariableDeclarators_DisallowIn */: - return isExpectedVariableDeclaration_VariableDeclarators_DisallowInTerminator(); - case 14 /* ArgumentList_AssignmentExpressions */: - return isExpectedArgumentList_AssignmentExpressionsTerminator(); - case 15 /* ObjectLiteralExpression_PropertyAssignments */: - return isExpectedObjectLiteralExpression_PropertyAssignmentsTerminator(); - case 16 /* ArrayLiteralExpression_AssignmentExpressions */: - return isExpectedLiteralExpression_AssignmentExpressionsTerminator(); - case 17 /* ParameterList_Parameters */: - return isExpectedParameterList_ParametersTerminator(); - case 18 /* IndexSignature_Parameters */: - return isExpectedIndexSignature_ParametersTerminator(); - case 19 /* TypeArgumentList_Types */: - return isExpectedTypeArgumentList_TypesTerminator(); - case 20 /* TypeParameterList_TypeParameters */: - return isExpectedTypeParameterList_TypeParametersTerminator(); - case 21 /* TupleType_Types */: - return isExpectedTupleType_TypesTerminator(); - default: - throw TypeScript.Errors.invalidOperation(); - } - } - function isExpectedSourceUnit_ModuleElementsTerminator() { - return currentToken().kind() === 10 /* EndOfFileToken */; - } - function isExpectedEnumDeclaration_EnumElementsTerminator() { - return currentToken().kind() === 71 /* CloseBraceToken */; - } - function isExpectedModuleDeclaration_ModuleElementsTerminator() { - return currentToken().kind() === 71 /* CloseBraceToken */; - } - function isExpectedObjectType_TypeMembersTerminator() { - return currentToken().kind() === 71 /* CloseBraceToken */; - } - function isExpectedObjectLiteralExpression_PropertyAssignmentsTerminator() { - return currentToken().kind() === 71 /* CloseBraceToken */; - } - function isExpectedLiteralExpression_AssignmentExpressionsTerminator() { - return currentToken().kind() === 75 /* CloseBracketToken */; - } - function isExpectedTypeArgumentList_TypesTerminator() { - var token = currentToken(); - var tokenKind = token.kind(); - if (tokenKind === 81 /* GreaterThanToken */) { - return true; - } - if (canFollowTypeArgumentListInExpression(tokenKind)) { - return true; - } - return false; - } - function isExpectedTupleType_TypesTerminator() { - var token = currentToken(); - var tokenKind = token.kind(); - if (tokenKind === 75 /* CloseBracketToken */) { - return true; - } - return false; - } - function isExpectedTypeParameterList_TypeParametersTerminator() { - var tokenKind = currentToken().kind(); - if (tokenKind === 81 /* GreaterThanToken */) { - return true; - } - if (tokenKind === 72 /* OpenParenToken */ || tokenKind === 70 /* OpenBraceToken */ || tokenKind === 48 /* ExtendsKeyword */ || tokenKind === 51 /* ImplementsKeyword */) { - return true; - } - return false; - } - function isExpectedParameterList_ParametersTerminator() { - var tokenKind = currentToken().kind(); - if (tokenKind === 73 /* CloseParenToken */) { - return true; - } - if (tokenKind === 70 /* OpenBraceToken */) { - return true; - } - if (tokenKind === 85 /* EqualsGreaterThanToken */) { - return true; - } - return false; - } - function isExpectedIndexSignature_ParametersTerminator() { - var tokenKind = currentToken().kind(); - if (tokenKind === 75 /* CloseBracketToken */) { - return true; - } - if (tokenKind === 70 /* OpenBraceToken */) { - return true; - } - return false; - } - function isExpectedVariableDeclaration_VariableDeclarators_DisallowInTerminator() { - var tokenKind = currentToken().kind(); - if (tokenKind === 78 /* SemicolonToken */ || tokenKind === 73 /* CloseParenToken */) { - return true; - } - if (tokenKind === 29 /* InKeyword */) { - return true; - } - return false; - } - function isExpectedVariableDeclaration_VariableDeclarators_AllowInTerminator() { - if (currentToken().kind() === 85 /* EqualsGreaterThanToken */) { - return true; - } - return canEatExplicitOrAutomaticSemicolon(false); - } - function isExpectedClassOrInterfaceDeclaration_HeritageClausesTerminator() { - var tokenKind = currentToken().kind(); - if (tokenKind === 70 /* OpenBraceToken */ || tokenKind === 71 /* CloseBraceToken */) { - return true; - } - return false; - } - function isExpectedHeritageClause_TypeNameListTerminator() { - var tokenKind = currentToken().kind(); - if (tokenKind === 48 /* ExtendsKeyword */ || tokenKind === 51 /* ImplementsKeyword */) { - return true; - } - if (isExpectedClassOrInterfaceDeclaration_HeritageClausesTerminator()) { - return true; - } - return false; - } - function isExpectedArgumentList_AssignmentExpressionsTerminator() { - var token0 = currentToken(); - var tokenKind = token0.kind(); - return tokenKind === 73 /* CloseParenToken */ || tokenKind === 78 /* SemicolonToken */; - } - function isExpectedClassDeclaration_ClassElementsTerminator() { - return currentToken().kind() === 71 /* CloseBraceToken */; - } - function isExpectedSwitchStatement_SwitchClausesTerminator() { - return currentToken().kind() === 71 /* CloseBraceToken */; - } - function isExpectedSwitchClause_StatementsTerminator() { - return currentToken().kind() === 71 /* CloseBraceToken */ || isSwitchClause(); - } - function isExpectedBlock_StatementsTerminator() { - return currentToken().kind() === 71 /* CloseBraceToken */; - } - function isExpectedTryBlock_StatementsTerminator() { - var tokenKind = currentToken().kind(); - return tokenKind === 17 /* CatchKeyword */ || tokenKind === 25 /* FinallyKeyword */; - } - function isExpectedCatchBlock_StatementsTerminator() { - return currentToken().kind() === 25 /* FinallyKeyword */; - } - function isExpectedListItem(currentListType, inErrorRecovery) { - switch (currentListType) { - case 0 /* SourceUnit_ModuleElements */: - return isModuleElement(inErrorRecovery); - case 1 /* ClassDeclaration_ClassElements */: - return isClassElement(inErrorRecovery); - case 2 /* ModuleDeclaration_ModuleElements */: - return isModuleElement(inErrorRecovery); - case 3 /* SwitchStatement_SwitchClauses */: - return isSwitchClause(); - case 4 /* SwitchClause_Statements */: - return isStatement(modifierCount(), inErrorRecovery); - case 5 /* Block_Statements */: - return isStatement(modifierCount(), inErrorRecovery); - case 6 /* TryBlock_Statements */: - return false; - case 7 /* CatchBlock_Statements */: - return false; - case 8 /* EnumDeclaration_EnumElements */: - return isEnumElement(inErrorRecovery); - case 9 /* ObjectType_TypeMembers */: - return isTypeMember(inErrorRecovery); - case 10 /* ClassOrInterfaceDeclaration_HeritageClauses */: - return isHeritageClause(); - case 11 /* HeritageClause_TypeNameList */: - return isHeritageClauseTypeName(); - case 12 /* VariableDeclaration_VariableDeclarators_AllowIn */: - return isVariableDeclarator(); - case 13 /* VariableDeclaration_VariableDeclarators_DisallowIn */: - return isVariableDeclarator(); - case 14 /* ArgumentList_AssignmentExpressions */: - return isExpectedArgumentList_AssignmentExpression(); - case 15 /* ObjectLiteralExpression_PropertyAssignments */: - return isPropertyAssignment(inErrorRecovery); - case 16 /* ArrayLiteralExpression_AssignmentExpressions */: - return isAssignmentOrOmittedExpression(); - case 17 /* ParameterList_Parameters */: - return isParameter(); - case 18 /* IndexSignature_Parameters */: - return isParameter(); - case 19 /* TypeArgumentList_Types */: - return isType(); - case 20 /* TypeParameterList_TypeParameters */: - return isTypeParameter(); - case 21 /* TupleType_Types */: - return isType(); - default: - throw TypeScript.Errors.invalidOperation(); - } - } - function isExpectedArgumentList_AssignmentExpression() { - var _currentToken = currentToken(); - if (isExpression(_currentToken)) { - return true; - } - if (_currentToken.kind() === 79 /* CommaToken */) { - return true; - } - return false; - } - function tryParseExpectedListItemWorker(currentListType, inErrorRecovery) { - switch (currentListType) { - case 0 /* SourceUnit_ModuleElements */: - return tryParseModuleElement(inErrorRecovery); - case 1 /* ClassDeclaration_ClassElements */: - return tryParseClassElement(inErrorRecovery); - case 2 /* ModuleDeclaration_ModuleElements */: - return tryParseModuleElement(inErrorRecovery); - case 3 /* SwitchStatement_SwitchClauses */: - return tryParseSwitchClause(); - case 4 /* SwitchClause_Statements */: - return tryParseStatement(inErrorRecovery); - case 5 /* Block_Statements */: - return tryParseStatement(inErrorRecovery); - case 6 /* TryBlock_Statements */: - return tryParseStatement(inErrorRecovery); - case 7 /* CatchBlock_Statements */: - return tryParseStatement(inErrorRecovery); - case 8 /* EnumDeclaration_EnumElements */: - return tryParseEnumElement(inErrorRecovery); - case 9 /* ObjectType_TypeMembers */: - return tryParseTypeMember(inErrorRecovery); - case 10 /* ClassOrInterfaceDeclaration_HeritageClauses */: - return tryParseHeritageClause(); - case 11 /* HeritageClause_TypeNameList */: - return tryParseHeritageClauseTypeName(); - case 12 /* VariableDeclaration_VariableDeclarators_AllowIn */: - return tryParseVariableDeclarator(true, false); - case 13 /* VariableDeclaration_VariableDeclarators_DisallowIn */: - return tryParseVariableDeclarator(false, false); - case 14 /* ArgumentList_AssignmentExpressions */: - return tryParseArgumentListExpression(); - case 15 /* ObjectLiteralExpression_PropertyAssignments */: - return tryParsePropertyAssignment(inErrorRecovery); - case 16 /* ArrayLiteralExpression_AssignmentExpressions */: - return tryParseAssignmentOrOmittedExpression(); - case 17 /* ParameterList_Parameters */: - return tryParseParameter(); - case 18 /* IndexSignature_Parameters */: - return tryParseParameter(); - case 19 /* TypeArgumentList_Types */: - return tryParseType(); - case 20 /* TypeParameterList_TypeParameters */: - return tryParseTypeParameter(); - case 21 /* TupleType_Types */: - return tryParseType(); - default: - throw TypeScript.Errors.invalidOperation(); - } - } - function getExpectedListElementType(currentListType) { - switch (currentListType) { - case 0 /* SourceUnit_ModuleElements */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.module_class_interface_enum_import_or_statement, null); - case 10 /* ClassOrInterfaceDeclaration_HeritageClauses */: - return '{'; - case 1 /* ClassDeclaration_ClassElements */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.constructor_function_accessor_or_variable, null); - case 2 /* ModuleDeclaration_ModuleElements */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.module_class_interface_enum_import_or_statement, null); - case 3 /* SwitchStatement_SwitchClauses */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.case_or_default_clause, null); - case 4 /* SwitchClause_Statements */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.statement, null); - case 5 /* Block_Statements */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.statement, null); - case 12 /* VariableDeclaration_VariableDeclarators_AllowIn */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.identifier, null); - case 13 /* VariableDeclaration_VariableDeclarators_DisallowIn */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.identifier, null); - case 8 /* EnumDeclaration_EnumElements */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.identifier, null); - case 9 /* ObjectType_TypeMembers */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.call_construct_index_property_or_function_signature, null); - case 14 /* ArgumentList_AssignmentExpressions */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.expression, null); - case 11 /* HeritageClause_TypeNameList */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.type_name, null); - case 15 /* ObjectLiteralExpression_PropertyAssignments */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.property_or_accessor, null); - case 17 /* ParameterList_Parameters */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.parameter, null); - case 18 /* IndexSignature_Parameters */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.parameter, null); - case 19 /* TypeArgumentList_Types */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.type, null); - case 20 /* TypeParameterList_TypeParameters */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.type_parameter, null); - case 21 /* TupleType_Types */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.type, null); - case 16 /* ArrayLiteralExpression_AssignmentExpressions */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.expression, null); - default: - throw TypeScript.Errors.invalidOperation(); - } - } - return parseSyntaxTree; - } - var BinaryExpressionPrecedence; - (function (BinaryExpressionPrecedence) { - BinaryExpressionPrecedence[BinaryExpressionPrecedence["Lowest"] = 1] = "Lowest"; - BinaryExpressionPrecedence[BinaryExpressionPrecedence["LogicalOrExpressionPrecedence"] = 2] = "LogicalOrExpressionPrecedence"; - BinaryExpressionPrecedence[BinaryExpressionPrecedence["LogicalAndExpressionPrecedence"] = 3] = "LogicalAndExpressionPrecedence"; - BinaryExpressionPrecedence[BinaryExpressionPrecedence["BitwiseOrExpressionPrecedence"] = 4] = "BitwiseOrExpressionPrecedence"; - BinaryExpressionPrecedence[BinaryExpressionPrecedence["BitwiseExclusiveOrExpressionPrecedence"] = 5] = "BitwiseExclusiveOrExpressionPrecedence"; - BinaryExpressionPrecedence[BinaryExpressionPrecedence["BitwiseAndExpressionPrecedence"] = 6] = "BitwiseAndExpressionPrecedence"; - BinaryExpressionPrecedence[BinaryExpressionPrecedence["EqualityExpressionPrecedence"] = 7] = "EqualityExpressionPrecedence"; - BinaryExpressionPrecedence[BinaryExpressionPrecedence["RelationalExpressionPrecedence"] = 8] = "RelationalExpressionPrecedence"; - BinaryExpressionPrecedence[BinaryExpressionPrecedence["ShiftExpressionPrecdence"] = 9] = "ShiftExpressionPrecdence"; - BinaryExpressionPrecedence[BinaryExpressionPrecedence["AdditiveExpressionPrecedence"] = 10] = "AdditiveExpressionPrecedence"; - BinaryExpressionPrecedence[BinaryExpressionPrecedence["MultiplicativeExpressionPrecedence"] = 11] = "MultiplicativeExpressionPrecedence"; - })(BinaryExpressionPrecedence || (BinaryExpressionPrecedence = {})); - var ListParsingState; - (function (ListParsingState) { - ListParsingState[ListParsingState["SourceUnit_ModuleElements"] = 0] = "SourceUnit_ModuleElements"; - ListParsingState[ListParsingState["ClassDeclaration_ClassElements"] = 1] = "ClassDeclaration_ClassElements"; - ListParsingState[ListParsingState["ModuleDeclaration_ModuleElements"] = 2] = "ModuleDeclaration_ModuleElements"; - ListParsingState[ListParsingState["SwitchStatement_SwitchClauses"] = 3] = "SwitchStatement_SwitchClauses"; - ListParsingState[ListParsingState["SwitchClause_Statements"] = 4] = "SwitchClause_Statements"; - ListParsingState[ListParsingState["Block_Statements"] = 5] = "Block_Statements"; - ListParsingState[ListParsingState["TryBlock_Statements"] = 6] = "TryBlock_Statements"; - ListParsingState[ListParsingState["CatchBlock_Statements"] = 7] = "CatchBlock_Statements"; - ListParsingState[ListParsingState["EnumDeclaration_EnumElements"] = 8] = "EnumDeclaration_EnumElements"; - ListParsingState[ListParsingState["ObjectType_TypeMembers"] = 9] = "ObjectType_TypeMembers"; - ListParsingState[ListParsingState["ClassOrInterfaceDeclaration_HeritageClauses"] = 10] = "ClassOrInterfaceDeclaration_HeritageClauses"; - ListParsingState[ListParsingState["HeritageClause_TypeNameList"] = 11] = "HeritageClause_TypeNameList"; - ListParsingState[ListParsingState["VariableDeclaration_VariableDeclarators_AllowIn"] = 12] = "VariableDeclaration_VariableDeclarators_AllowIn"; - ListParsingState[ListParsingState["VariableDeclaration_VariableDeclarators_DisallowIn"] = 13] = "VariableDeclaration_VariableDeclarators_DisallowIn"; - ListParsingState[ListParsingState["ArgumentList_AssignmentExpressions"] = 14] = "ArgumentList_AssignmentExpressions"; - ListParsingState[ListParsingState["ObjectLiteralExpression_PropertyAssignments"] = 15] = "ObjectLiteralExpression_PropertyAssignments"; - ListParsingState[ListParsingState["ArrayLiteralExpression_AssignmentExpressions"] = 16] = "ArrayLiteralExpression_AssignmentExpressions"; - ListParsingState[ListParsingState["ParameterList_Parameters"] = 17] = "ParameterList_Parameters"; - ListParsingState[ListParsingState["IndexSignature_Parameters"] = 18] = "IndexSignature_Parameters"; - ListParsingState[ListParsingState["TypeArgumentList_Types"] = 19] = "TypeArgumentList_Types"; - ListParsingState[ListParsingState["TypeParameterList_TypeParameters"] = 20] = "TypeParameterList_TypeParameters"; - ListParsingState[ListParsingState["TupleType_Types"] = 21] = "TupleType_Types"; - ListParsingState[ListParsingState["FirstListParsingState"] = ListParsingState.SourceUnit_ModuleElements] = "FirstListParsingState"; - ListParsingState[ListParsingState["LastListParsingState"] = ListParsingState.TupleType_Types] = "LastListParsingState"; - })(ListParsingState || (ListParsingState = {})); - var parseSyntaxTree = createParseSyntaxTree(); - function parse(fileName, text, languageVersion, isDeclaration) { - return parseSource(TypeScript.Scanner.createParserSource(fileName, text, languageVersion), isDeclaration); - } - Parser.parse = parse; - function parseSource(source, isDeclaration) { - return parseSyntaxTree(source, isDeclaration); - } - Parser.parseSource = parseSource; - })(Parser = TypeScript.Parser || (TypeScript.Parser = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Syntax; - (function (Syntax) { - var Concrete; - (function (Concrete) { - TypeScript.Parser.syntaxFactory = Concrete; - Concrete.isConcrete = true; - var SourceUnitSyntax = (function (_super) { - __extends(SourceUnitSyntax, _super); - function SourceUnitSyntax(data, moduleElements, endOfFileToken) { - _super.call(this, data); - this.syntaxTree = null; - this.parent = null, this.moduleElements = moduleElements, this.endOfFileToken = endOfFileToken, !TypeScript.isShared(moduleElements) && (moduleElements.parent = this), endOfFileToken.parent = this; - } - return SourceUnitSyntax; - })(TypeScript.SyntaxNode); - Concrete.SourceUnitSyntax = SourceUnitSyntax; - var QualifiedNameSyntax = (function (_super) { - __extends(QualifiedNameSyntax, _super); - function QualifiedNameSyntax(data, left, dotToken, right) { - _super.call(this, data); - this.left = left, this.dotToken = dotToken, this.right = right, left.parent = this, dotToken.parent = this, right.parent = this; - } - return QualifiedNameSyntax; - })(TypeScript.SyntaxNode); - Concrete.QualifiedNameSyntax = QualifiedNameSyntax; - var ObjectTypeSyntax = (function (_super) { - __extends(ObjectTypeSyntax, _super); - function ObjectTypeSyntax(data, openBraceToken, typeMembers, closeBraceToken) { - _super.call(this, data); - this.openBraceToken = openBraceToken, this.typeMembers = typeMembers, this.closeBraceToken = closeBraceToken, openBraceToken.parent = this, !TypeScript.isShared(typeMembers) && (typeMembers.parent = this), closeBraceToken.parent = this; - } - return ObjectTypeSyntax; - })(TypeScript.SyntaxNode); - Concrete.ObjectTypeSyntax = ObjectTypeSyntax; - var FunctionTypeSyntax = (function (_super) { - __extends(FunctionTypeSyntax, _super); - function FunctionTypeSyntax(data, typeParameterList, parameterList, equalsGreaterThanToken, type) { - _super.call(this, data); - this.typeParameterList = typeParameterList, this.parameterList = parameterList, this.equalsGreaterThanToken = equalsGreaterThanToken, this.type = type, typeParameterList && (typeParameterList.parent = this), parameterList.parent = this, equalsGreaterThanToken.parent = this, type.parent = this; - } - return FunctionTypeSyntax; - })(TypeScript.SyntaxNode); - Concrete.FunctionTypeSyntax = FunctionTypeSyntax; - var ArrayTypeSyntax = (function (_super) { - __extends(ArrayTypeSyntax, _super); - function ArrayTypeSyntax(data, type, openBracketToken, closeBracketToken) { - _super.call(this, data); - this.type = type, this.openBracketToken = openBracketToken, this.closeBracketToken = closeBracketToken, type.parent = this, openBracketToken.parent = this, closeBracketToken.parent = this; - } - return ArrayTypeSyntax; - })(TypeScript.SyntaxNode); - Concrete.ArrayTypeSyntax = ArrayTypeSyntax; - var ConstructorTypeSyntax = (function (_super) { - __extends(ConstructorTypeSyntax, _super); - function ConstructorTypeSyntax(data, newKeyword, typeParameterList, parameterList, equalsGreaterThanToken, type) { - _super.call(this, data); - this.newKeyword = newKeyword, this.typeParameterList = typeParameterList, this.parameterList = parameterList, this.equalsGreaterThanToken = equalsGreaterThanToken, this.type = type, newKeyword.parent = this, typeParameterList && (typeParameterList.parent = this), parameterList.parent = this, equalsGreaterThanToken.parent = this, type.parent = this; - } - return ConstructorTypeSyntax; - })(TypeScript.SyntaxNode); - Concrete.ConstructorTypeSyntax = ConstructorTypeSyntax; - var GenericTypeSyntax = (function (_super) { - __extends(GenericTypeSyntax, _super); - function GenericTypeSyntax(data, name, typeArgumentList) { - _super.call(this, data); - this.name = name, this.typeArgumentList = typeArgumentList, name.parent = this, typeArgumentList.parent = this; - } - return GenericTypeSyntax; - })(TypeScript.SyntaxNode); - Concrete.GenericTypeSyntax = GenericTypeSyntax; - var TypeQuerySyntax = (function (_super) { - __extends(TypeQuerySyntax, _super); - function TypeQuerySyntax(data, typeOfKeyword, name) { - _super.call(this, data); - this.typeOfKeyword = typeOfKeyword, this.name = name, typeOfKeyword.parent = this, name.parent = this; - } - return TypeQuerySyntax; - })(TypeScript.SyntaxNode); - Concrete.TypeQuerySyntax = TypeQuerySyntax; - var TupleTypeSyntax = (function (_super) { - __extends(TupleTypeSyntax, _super); - function TupleTypeSyntax(data, openBracketToken, types, closeBracketToken) { - _super.call(this, data); - this.openBracketToken = openBracketToken, this.types = types, this.closeBracketToken = closeBracketToken, openBracketToken.parent = this, !TypeScript.isShared(types) && (types.parent = this), closeBracketToken.parent = this; - } - return TupleTypeSyntax; - })(TypeScript.SyntaxNode); - Concrete.TupleTypeSyntax = TupleTypeSyntax; - var InterfaceDeclarationSyntax = (function (_super) { - __extends(InterfaceDeclarationSyntax, _super); - function InterfaceDeclarationSyntax(data, modifiers, interfaceKeyword, identifier, typeParameterList, heritageClauses, body) { - _super.call(this, data); - this.modifiers = modifiers, this.interfaceKeyword = interfaceKeyword, this.identifier = identifier, this.typeParameterList = typeParameterList, this.heritageClauses = heritageClauses, this.body = body, !TypeScript.isShared(modifiers) && (modifiers.parent = this), interfaceKeyword.parent = this, identifier.parent = this, typeParameterList && (typeParameterList.parent = this), !TypeScript.isShared(heritageClauses) && (heritageClauses.parent = this), body.parent = this; - } - return InterfaceDeclarationSyntax; - })(TypeScript.SyntaxNode); - Concrete.InterfaceDeclarationSyntax = InterfaceDeclarationSyntax; - var FunctionDeclarationSyntax = (function (_super) { - __extends(FunctionDeclarationSyntax, _super); - function FunctionDeclarationSyntax(data, modifiers, functionKeyword, identifier, callSignature, block, semicolonToken) { - _super.call(this, data); - this.modifiers = modifiers, this.functionKeyword = functionKeyword, this.identifier = identifier, this.callSignature = callSignature, this.block = block, this.semicolonToken = semicolonToken, !TypeScript.isShared(modifiers) && (modifiers.parent = this), functionKeyword.parent = this, identifier.parent = this, callSignature.parent = this, block && (block.parent = this), semicolonToken && (semicolonToken.parent = this); - } - return FunctionDeclarationSyntax; - })(TypeScript.SyntaxNode); - Concrete.FunctionDeclarationSyntax = FunctionDeclarationSyntax; - var ModuleDeclarationSyntax = (function (_super) { - __extends(ModuleDeclarationSyntax, _super); - function ModuleDeclarationSyntax(data, modifiers, moduleKeyword, name, stringLiteral, openBraceToken, moduleElements, closeBraceToken) { - _super.call(this, data); - this.modifiers = modifiers, this.moduleKeyword = moduleKeyword, this.name = name, this.stringLiteral = stringLiteral, this.openBraceToken = openBraceToken, this.moduleElements = moduleElements, this.closeBraceToken = closeBraceToken, !TypeScript.isShared(modifiers) && (modifiers.parent = this), moduleKeyword.parent = this, name && (name.parent = this), stringLiteral && (stringLiteral.parent = this), openBraceToken.parent = this, !TypeScript.isShared(moduleElements) && (moduleElements.parent = this), closeBraceToken.parent = this; - } - return ModuleDeclarationSyntax; - })(TypeScript.SyntaxNode); - Concrete.ModuleDeclarationSyntax = ModuleDeclarationSyntax; - var ClassDeclarationSyntax = (function (_super) { - __extends(ClassDeclarationSyntax, _super); - function ClassDeclarationSyntax(data, modifiers, classKeyword, identifier, typeParameterList, heritageClauses, openBraceToken, classElements, closeBraceToken) { - _super.call(this, data); - this.modifiers = modifiers, this.classKeyword = classKeyword, this.identifier = identifier, this.typeParameterList = typeParameterList, this.heritageClauses = heritageClauses, this.openBraceToken = openBraceToken, this.classElements = classElements, this.closeBraceToken = closeBraceToken, !TypeScript.isShared(modifiers) && (modifiers.parent = this), classKeyword.parent = this, identifier.parent = this, typeParameterList && (typeParameterList.parent = this), !TypeScript.isShared(heritageClauses) && (heritageClauses.parent = this), openBraceToken.parent = this, !TypeScript.isShared(classElements) && (classElements.parent = this), closeBraceToken.parent = this; - } - return ClassDeclarationSyntax; - })(TypeScript.SyntaxNode); - Concrete.ClassDeclarationSyntax = ClassDeclarationSyntax; - var EnumDeclarationSyntax = (function (_super) { - __extends(EnumDeclarationSyntax, _super); - function EnumDeclarationSyntax(data, modifiers, enumKeyword, identifier, openBraceToken, enumElements, closeBraceToken) { - _super.call(this, data); - this.modifiers = modifiers, this.enumKeyword = enumKeyword, this.identifier = identifier, this.openBraceToken = openBraceToken, this.enumElements = enumElements, this.closeBraceToken = closeBraceToken, !TypeScript.isShared(modifiers) && (modifiers.parent = this), enumKeyword.parent = this, identifier.parent = this, openBraceToken.parent = this, !TypeScript.isShared(enumElements) && (enumElements.parent = this), closeBraceToken.parent = this; - } - return EnumDeclarationSyntax; - })(TypeScript.SyntaxNode); - Concrete.EnumDeclarationSyntax = EnumDeclarationSyntax; - var ImportDeclarationSyntax = (function (_super) { - __extends(ImportDeclarationSyntax, _super); - function ImportDeclarationSyntax(data, modifiers, importKeyword, identifier, equalsToken, moduleReference, semicolonToken) { - _super.call(this, data); - this.modifiers = modifiers, this.importKeyword = importKeyword, this.identifier = identifier, this.equalsToken = equalsToken, this.moduleReference = moduleReference, this.semicolonToken = semicolonToken, !TypeScript.isShared(modifiers) && (modifiers.parent = this), importKeyword.parent = this, identifier.parent = this, equalsToken.parent = this, moduleReference.parent = this, semicolonToken && (semicolonToken.parent = this); - } - return ImportDeclarationSyntax; - })(TypeScript.SyntaxNode); - Concrete.ImportDeclarationSyntax = ImportDeclarationSyntax; - var ExportAssignmentSyntax = (function (_super) { - __extends(ExportAssignmentSyntax, _super); - function ExportAssignmentSyntax(data, exportKeyword, equalsToken, identifier, semicolonToken) { - _super.call(this, data); - this.exportKeyword = exportKeyword, this.equalsToken = equalsToken, this.identifier = identifier, this.semicolonToken = semicolonToken, exportKeyword.parent = this, equalsToken.parent = this, identifier.parent = this, semicolonToken && (semicolonToken.parent = this); - } - return ExportAssignmentSyntax; - })(TypeScript.SyntaxNode); - Concrete.ExportAssignmentSyntax = ExportAssignmentSyntax; - var MemberFunctionDeclarationSyntax = (function (_super) { - __extends(MemberFunctionDeclarationSyntax, _super); - function MemberFunctionDeclarationSyntax(data, modifiers, propertyName, callSignature, block, semicolonToken) { - _super.call(this, data); - this.modifiers = modifiers, this.propertyName = propertyName, this.callSignature = callSignature, this.block = block, this.semicolonToken = semicolonToken, !TypeScript.isShared(modifiers) && (modifiers.parent = this), propertyName.parent = this, callSignature.parent = this, block && (block.parent = this), semicolonToken && (semicolonToken.parent = this); - } - return MemberFunctionDeclarationSyntax; - })(TypeScript.SyntaxNode); - Concrete.MemberFunctionDeclarationSyntax = MemberFunctionDeclarationSyntax; - var MemberVariableDeclarationSyntax = (function (_super) { - __extends(MemberVariableDeclarationSyntax, _super); - function MemberVariableDeclarationSyntax(data, modifiers, variableDeclarator, semicolonToken) { - _super.call(this, data); - this.modifiers = modifiers, this.variableDeclarator = variableDeclarator, this.semicolonToken = semicolonToken, !TypeScript.isShared(modifiers) && (modifiers.parent = this), variableDeclarator.parent = this, semicolonToken && (semicolonToken.parent = this); - } - return MemberVariableDeclarationSyntax; - })(TypeScript.SyntaxNode); - Concrete.MemberVariableDeclarationSyntax = MemberVariableDeclarationSyntax; - var ConstructorDeclarationSyntax = (function (_super) { - __extends(ConstructorDeclarationSyntax, _super); - function ConstructorDeclarationSyntax(data, modifiers, constructorKeyword, callSignature, block, semicolonToken) { - _super.call(this, data); - this.modifiers = modifiers, this.constructorKeyword = constructorKeyword, this.callSignature = callSignature, this.block = block, this.semicolonToken = semicolonToken, !TypeScript.isShared(modifiers) && (modifiers.parent = this), constructorKeyword.parent = this, callSignature.parent = this, block && (block.parent = this), semicolonToken && (semicolonToken.parent = this); - } - return ConstructorDeclarationSyntax; - })(TypeScript.SyntaxNode); - Concrete.ConstructorDeclarationSyntax = ConstructorDeclarationSyntax; - var IndexMemberDeclarationSyntax = (function (_super) { - __extends(IndexMemberDeclarationSyntax, _super); - function IndexMemberDeclarationSyntax(data, modifiers, indexSignature, semicolonToken) { - _super.call(this, data); - this.modifiers = modifiers, this.indexSignature = indexSignature, this.semicolonToken = semicolonToken, !TypeScript.isShared(modifiers) && (modifiers.parent = this), indexSignature.parent = this, semicolonToken && (semicolonToken.parent = this); - } - return IndexMemberDeclarationSyntax; - })(TypeScript.SyntaxNode); - Concrete.IndexMemberDeclarationSyntax = IndexMemberDeclarationSyntax; - var GetAccessorSyntax = (function (_super) { - __extends(GetAccessorSyntax, _super); - function GetAccessorSyntax(data, modifiers, getKeyword, propertyName, callSignature, block) { - _super.call(this, data); - this.modifiers = modifiers, this.getKeyword = getKeyword, this.propertyName = propertyName, this.callSignature = callSignature, this.block = block, !TypeScript.isShared(modifiers) && (modifiers.parent = this), getKeyword.parent = this, propertyName.parent = this, callSignature.parent = this, block.parent = this; - } - return GetAccessorSyntax; - })(TypeScript.SyntaxNode); - Concrete.GetAccessorSyntax = GetAccessorSyntax; - var SetAccessorSyntax = (function (_super) { - __extends(SetAccessorSyntax, _super); - function SetAccessorSyntax(data, modifiers, setKeyword, propertyName, callSignature, block) { - _super.call(this, data); - this.modifiers = modifiers, this.setKeyword = setKeyword, this.propertyName = propertyName, this.callSignature = callSignature, this.block = block, !TypeScript.isShared(modifiers) && (modifiers.parent = this), setKeyword.parent = this, propertyName.parent = this, callSignature.parent = this, block.parent = this; - } - return SetAccessorSyntax; - })(TypeScript.SyntaxNode); - Concrete.SetAccessorSyntax = SetAccessorSyntax; - var PropertySignatureSyntax = (function (_super) { - __extends(PropertySignatureSyntax, _super); - function PropertySignatureSyntax(data, propertyName, questionToken, typeAnnotation) { - _super.call(this, data); - this.propertyName = propertyName, this.questionToken = questionToken, this.typeAnnotation = typeAnnotation, propertyName.parent = this, questionToken && (questionToken.parent = this), typeAnnotation && (typeAnnotation.parent = this); - } - return PropertySignatureSyntax; - })(TypeScript.SyntaxNode); - Concrete.PropertySignatureSyntax = PropertySignatureSyntax; - var CallSignatureSyntax = (function (_super) { - __extends(CallSignatureSyntax, _super); - function CallSignatureSyntax(data, typeParameterList, parameterList, typeAnnotation) { - _super.call(this, data); - this.typeParameterList = typeParameterList, this.parameterList = parameterList, this.typeAnnotation = typeAnnotation, typeParameterList && (typeParameterList.parent = this), parameterList.parent = this, typeAnnotation && (typeAnnotation.parent = this); - } - return CallSignatureSyntax; - })(TypeScript.SyntaxNode); - Concrete.CallSignatureSyntax = CallSignatureSyntax; - var ConstructSignatureSyntax = (function (_super) { - __extends(ConstructSignatureSyntax, _super); - function ConstructSignatureSyntax(data, newKeyword, callSignature) { - _super.call(this, data); - this.newKeyword = newKeyword, this.callSignature = callSignature, newKeyword.parent = this, callSignature.parent = this; - } - return ConstructSignatureSyntax; - })(TypeScript.SyntaxNode); - Concrete.ConstructSignatureSyntax = ConstructSignatureSyntax; - var IndexSignatureSyntax = (function (_super) { - __extends(IndexSignatureSyntax, _super); - function IndexSignatureSyntax(data, openBracketToken, parameters, closeBracketToken, typeAnnotation) { - _super.call(this, data); - this.openBracketToken = openBracketToken, this.parameters = parameters, this.closeBracketToken = closeBracketToken, this.typeAnnotation = typeAnnotation, openBracketToken.parent = this, !TypeScript.isShared(parameters) && (parameters.parent = this), closeBracketToken.parent = this, typeAnnotation && (typeAnnotation.parent = this); - } - return IndexSignatureSyntax; - })(TypeScript.SyntaxNode); - Concrete.IndexSignatureSyntax = IndexSignatureSyntax; - var MethodSignatureSyntax = (function (_super) { - __extends(MethodSignatureSyntax, _super); - function MethodSignatureSyntax(data, propertyName, questionToken, callSignature) { - _super.call(this, data); - this.propertyName = propertyName, this.questionToken = questionToken, this.callSignature = callSignature, propertyName.parent = this, questionToken && (questionToken.parent = this), callSignature.parent = this; - } - return MethodSignatureSyntax; - })(TypeScript.SyntaxNode); - Concrete.MethodSignatureSyntax = MethodSignatureSyntax; - var BlockSyntax = (function (_super) { - __extends(BlockSyntax, _super); - function BlockSyntax(data, openBraceToken, statements, closeBraceToken) { - _super.call(this, data); - this.openBraceToken = openBraceToken, this.statements = statements, this.closeBraceToken = closeBraceToken, openBraceToken.parent = this, !TypeScript.isShared(statements) && (statements.parent = this), closeBraceToken.parent = this; - } - return BlockSyntax; - })(TypeScript.SyntaxNode); - Concrete.BlockSyntax = BlockSyntax; - var IfStatementSyntax = (function (_super) { - __extends(IfStatementSyntax, _super); - function IfStatementSyntax(data, ifKeyword, openParenToken, condition, closeParenToken, statement, elseClause) { - _super.call(this, data); - this.ifKeyword = ifKeyword, this.openParenToken = openParenToken, this.condition = condition, this.closeParenToken = closeParenToken, this.statement = statement, this.elseClause = elseClause, ifKeyword.parent = this, openParenToken.parent = this, condition.parent = this, closeParenToken.parent = this, statement.parent = this, elseClause && (elseClause.parent = this); - } - return IfStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.IfStatementSyntax = IfStatementSyntax; - var VariableStatementSyntax = (function (_super) { - __extends(VariableStatementSyntax, _super); - function VariableStatementSyntax(data, modifiers, variableDeclaration, semicolonToken) { - _super.call(this, data); - this.modifiers = modifiers, this.variableDeclaration = variableDeclaration, this.semicolonToken = semicolonToken, !TypeScript.isShared(modifiers) && (modifiers.parent = this), variableDeclaration.parent = this, semicolonToken && (semicolonToken.parent = this); - } - return VariableStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.VariableStatementSyntax = VariableStatementSyntax; - var ExpressionStatementSyntax = (function (_super) { - __extends(ExpressionStatementSyntax, _super); - function ExpressionStatementSyntax(data, expression, semicolonToken) { - _super.call(this, data); - this.expression = expression, this.semicolonToken = semicolonToken, expression.parent = this, semicolonToken && (semicolonToken.parent = this); - } - return ExpressionStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.ExpressionStatementSyntax = ExpressionStatementSyntax; - var ReturnStatementSyntax = (function (_super) { - __extends(ReturnStatementSyntax, _super); - function ReturnStatementSyntax(data, returnKeyword, expression, semicolonToken) { - _super.call(this, data); - this.returnKeyword = returnKeyword, this.expression = expression, this.semicolonToken = semicolonToken, returnKeyword.parent = this, expression && (expression.parent = this), semicolonToken && (semicolonToken.parent = this); - } - return ReturnStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.ReturnStatementSyntax = ReturnStatementSyntax; - var SwitchStatementSyntax = (function (_super) { - __extends(SwitchStatementSyntax, _super); - function SwitchStatementSyntax(data, switchKeyword, openParenToken, expression, closeParenToken, openBraceToken, switchClauses, closeBraceToken) { - _super.call(this, data); - this.switchKeyword = switchKeyword, this.openParenToken = openParenToken, this.expression = expression, this.closeParenToken = closeParenToken, this.openBraceToken = openBraceToken, this.switchClauses = switchClauses, this.closeBraceToken = closeBraceToken, switchKeyword.parent = this, openParenToken.parent = this, expression.parent = this, closeParenToken.parent = this, openBraceToken.parent = this, !TypeScript.isShared(switchClauses) && (switchClauses.parent = this), closeBraceToken.parent = this; - } - return SwitchStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.SwitchStatementSyntax = SwitchStatementSyntax; - var BreakStatementSyntax = (function (_super) { - __extends(BreakStatementSyntax, _super); - function BreakStatementSyntax(data, breakKeyword, identifier, semicolonToken) { - _super.call(this, data); - this.breakKeyword = breakKeyword, this.identifier = identifier, this.semicolonToken = semicolonToken, breakKeyword.parent = this, identifier && (identifier.parent = this), semicolonToken && (semicolonToken.parent = this); - } - return BreakStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.BreakStatementSyntax = BreakStatementSyntax; - var ContinueStatementSyntax = (function (_super) { - __extends(ContinueStatementSyntax, _super); - function ContinueStatementSyntax(data, continueKeyword, identifier, semicolonToken) { - _super.call(this, data); - this.continueKeyword = continueKeyword, this.identifier = identifier, this.semicolonToken = semicolonToken, continueKeyword.parent = this, identifier && (identifier.parent = this), semicolonToken && (semicolonToken.parent = this); - } - return ContinueStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.ContinueStatementSyntax = ContinueStatementSyntax; - var ForStatementSyntax = (function (_super) { - __extends(ForStatementSyntax, _super); - function ForStatementSyntax(data, forKeyword, openParenToken, variableDeclaration, initializer, firstSemicolonToken, condition, secondSemicolonToken, incrementor, closeParenToken, statement) { - _super.call(this, data); - this.forKeyword = forKeyword, this.openParenToken = openParenToken, this.variableDeclaration = variableDeclaration, this.initializer = initializer, this.firstSemicolonToken = firstSemicolonToken, this.condition = condition, this.secondSemicolonToken = secondSemicolonToken, this.incrementor = incrementor, this.closeParenToken = closeParenToken, this.statement = statement, forKeyword.parent = this, openParenToken.parent = this, variableDeclaration && (variableDeclaration.parent = this), initializer && (initializer.parent = this), firstSemicolonToken.parent = this, condition && (condition.parent = this), secondSemicolonToken.parent = this, incrementor && (incrementor.parent = this), closeParenToken.parent = this, statement.parent = this; - } - return ForStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.ForStatementSyntax = ForStatementSyntax; - var ForInStatementSyntax = (function (_super) { - __extends(ForInStatementSyntax, _super); - function ForInStatementSyntax(data, forKeyword, openParenToken, variableDeclaration, left, inKeyword, expression, closeParenToken, statement) { - _super.call(this, data); - this.forKeyword = forKeyword, this.openParenToken = openParenToken, this.variableDeclaration = variableDeclaration, this.left = left, this.inKeyword = inKeyword, this.expression = expression, this.closeParenToken = closeParenToken, this.statement = statement, forKeyword.parent = this, openParenToken.parent = this, variableDeclaration && (variableDeclaration.parent = this), left && (left.parent = this), inKeyword.parent = this, expression.parent = this, closeParenToken.parent = this, statement.parent = this; - } - return ForInStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.ForInStatementSyntax = ForInStatementSyntax; - var EmptyStatementSyntax = (function (_super) { - __extends(EmptyStatementSyntax, _super); - function EmptyStatementSyntax(data, semicolonToken) { - _super.call(this, data); - this.semicolonToken = semicolonToken, semicolonToken.parent = this; - } - return EmptyStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.EmptyStatementSyntax = EmptyStatementSyntax; - var ThrowStatementSyntax = (function (_super) { - __extends(ThrowStatementSyntax, _super); - function ThrowStatementSyntax(data, throwKeyword, expression, semicolonToken) { - _super.call(this, data); - this.throwKeyword = throwKeyword, this.expression = expression, this.semicolonToken = semicolonToken, throwKeyword.parent = this, expression.parent = this, semicolonToken && (semicolonToken.parent = this); - } - return ThrowStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.ThrowStatementSyntax = ThrowStatementSyntax; - var WhileStatementSyntax = (function (_super) { - __extends(WhileStatementSyntax, _super); - function WhileStatementSyntax(data, whileKeyword, openParenToken, condition, closeParenToken, statement) { - _super.call(this, data); - this.whileKeyword = whileKeyword, this.openParenToken = openParenToken, this.condition = condition, this.closeParenToken = closeParenToken, this.statement = statement, whileKeyword.parent = this, openParenToken.parent = this, condition.parent = this, closeParenToken.parent = this, statement.parent = this; - } - return WhileStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.WhileStatementSyntax = WhileStatementSyntax; - var TryStatementSyntax = (function (_super) { - __extends(TryStatementSyntax, _super); - function TryStatementSyntax(data, tryKeyword, block, catchClause, finallyClause) { - _super.call(this, data); - this.tryKeyword = tryKeyword, this.block = block, this.catchClause = catchClause, this.finallyClause = finallyClause, tryKeyword.parent = this, block.parent = this, catchClause && (catchClause.parent = this), finallyClause && (finallyClause.parent = this); - } - return TryStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.TryStatementSyntax = TryStatementSyntax; - var LabeledStatementSyntax = (function (_super) { - __extends(LabeledStatementSyntax, _super); - function LabeledStatementSyntax(data, identifier, colonToken, statement) { - _super.call(this, data); - this.identifier = identifier, this.colonToken = colonToken, this.statement = statement, identifier.parent = this, colonToken.parent = this, statement.parent = this; - } - return LabeledStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.LabeledStatementSyntax = LabeledStatementSyntax; - var DoStatementSyntax = (function (_super) { - __extends(DoStatementSyntax, _super); - function DoStatementSyntax(data, doKeyword, statement, whileKeyword, openParenToken, condition, closeParenToken, semicolonToken) { - _super.call(this, data); - this.doKeyword = doKeyword, this.statement = statement, this.whileKeyword = whileKeyword, this.openParenToken = openParenToken, this.condition = condition, this.closeParenToken = closeParenToken, this.semicolonToken = semicolonToken, doKeyword.parent = this, statement.parent = this, whileKeyword.parent = this, openParenToken.parent = this, condition.parent = this, closeParenToken.parent = this, semicolonToken && (semicolonToken.parent = this); - } - return DoStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.DoStatementSyntax = DoStatementSyntax; - var DebuggerStatementSyntax = (function (_super) { - __extends(DebuggerStatementSyntax, _super); - function DebuggerStatementSyntax(data, debuggerKeyword, semicolonToken) { - _super.call(this, data); - this.debuggerKeyword = debuggerKeyword, this.semicolonToken = semicolonToken, debuggerKeyword.parent = this, semicolonToken && (semicolonToken.parent = this); - } - return DebuggerStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.DebuggerStatementSyntax = DebuggerStatementSyntax; - var WithStatementSyntax = (function (_super) { - __extends(WithStatementSyntax, _super); - function WithStatementSyntax(data, withKeyword, openParenToken, condition, closeParenToken, statement) { - _super.call(this, data); - this.withKeyword = withKeyword, this.openParenToken = openParenToken, this.condition = condition, this.closeParenToken = closeParenToken, this.statement = statement, withKeyword.parent = this, openParenToken.parent = this, condition.parent = this, closeParenToken.parent = this, statement.parent = this; - } - return WithStatementSyntax; - })(TypeScript.SyntaxNode); - Concrete.WithStatementSyntax = WithStatementSyntax; - var PrefixUnaryExpressionSyntax = (function (_super) { - __extends(PrefixUnaryExpressionSyntax, _super); - function PrefixUnaryExpressionSyntax(data, operatorToken, operand) { - _super.call(this, data); - this.operatorToken = operatorToken, this.operand = operand, operatorToken.parent = this, operand.parent = this; - } - PrefixUnaryExpressionSyntax.prototype.kind = function () { - return TypeScript.SyntaxFacts.getPrefixUnaryExpressionFromOperatorToken(this.operatorToken.kind()); - }; - return PrefixUnaryExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.PrefixUnaryExpressionSyntax = PrefixUnaryExpressionSyntax; - var DeleteExpressionSyntax = (function (_super) { - __extends(DeleteExpressionSyntax, _super); - function DeleteExpressionSyntax(data, deleteKeyword, expression) { - _super.call(this, data); - this.deleteKeyword = deleteKeyword, this.expression = expression, deleteKeyword.parent = this, expression.parent = this; - } - return DeleteExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.DeleteExpressionSyntax = DeleteExpressionSyntax; - var TypeOfExpressionSyntax = (function (_super) { - __extends(TypeOfExpressionSyntax, _super); - function TypeOfExpressionSyntax(data, typeOfKeyword, expression) { - _super.call(this, data); - this.typeOfKeyword = typeOfKeyword, this.expression = expression, typeOfKeyword.parent = this, expression.parent = this; - } - return TypeOfExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.TypeOfExpressionSyntax = TypeOfExpressionSyntax; - var VoidExpressionSyntax = (function (_super) { - __extends(VoidExpressionSyntax, _super); - function VoidExpressionSyntax(data, voidKeyword, expression) { - _super.call(this, data); - this.voidKeyword = voidKeyword, this.expression = expression, voidKeyword.parent = this, expression.parent = this; - } - return VoidExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.VoidExpressionSyntax = VoidExpressionSyntax; - var ConditionalExpressionSyntax = (function (_super) { - __extends(ConditionalExpressionSyntax, _super); - function ConditionalExpressionSyntax(data, condition, questionToken, whenTrue, colonToken, whenFalse) { - _super.call(this, data); - this.condition = condition, this.questionToken = questionToken, this.whenTrue = whenTrue, this.colonToken = colonToken, this.whenFalse = whenFalse, condition.parent = this, questionToken.parent = this, whenTrue.parent = this, colonToken.parent = this, whenFalse.parent = this; - } - return ConditionalExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.ConditionalExpressionSyntax = ConditionalExpressionSyntax; - var BinaryExpressionSyntax = (function (_super) { - __extends(BinaryExpressionSyntax, _super); - function BinaryExpressionSyntax(data, left, operatorToken, right) { - _super.call(this, data); - this.left = left, this.operatorToken = operatorToken, this.right = right, left.parent = this, operatorToken.parent = this, right.parent = this; - } - BinaryExpressionSyntax.prototype.kind = function () { - return TypeScript.SyntaxFacts.getBinaryExpressionFromOperatorToken(this.operatorToken.kind()); - }; - return BinaryExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.BinaryExpressionSyntax = BinaryExpressionSyntax; - var PostfixUnaryExpressionSyntax = (function (_super) { - __extends(PostfixUnaryExpressionSyntax, _super); - function PostfixUnaryExpressionSyntax(data, operand, operatorToken) { - _super.call(this, data); - this.operand = operand, this.operatorToken = operatorToken, operand.parent = this, operatorToken.parent = this; - } - PostfixUnaryExpressionSyntax.prototype.kind = function () { - return TypeScript.SyntaxFacts.getPostfixUnaryExpressionFromOperatorToken(this.operatorToken.kind()); - }; - return PostfixUnaryExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.PostfixUnaryExpressionSyntax = PostfixUnaryExpressionSyntax; - var MemberAccessExpressionSyntax = (function (_super) { - __extends(MemberAccessExpressionSyntax, _super); - function MemberAccessExpressionSyntax(data, expression, dotToken, name) { - _super.call(this, data); - this.expression = expression, this.dotToken = dotToken, this.name = name, expression.parent = this, dotToken.parent = this, name.parent = this; - } - return MemberAccessExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.MemberAccessExpressionSyntax = MemberAccessExpressionSyntax; - var InvocationExpressionSyntax = (function (_super) { - __extends(InvocationExpressionSyntax, _super); - function InvocationExpressionSyntax(data, expression, argumentList) { - _super.call(this, data); - this.expression = expression, this.argumentList = argumentList, expression.parent = this, argumentList.parent = this; - } - return InvocationExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.InvocationExpressionSyntax = InvocationExpressionSyntax; - var ArrayLiteralExpressionSyntax = (function (_super) { - __extends(ArrayLiteralExpressionSyntax, _super); - function ArrayLiteralExpressionSyntax(data, openBracketToken, expressions, closeBracketToken) { - _super.call(this, data); - this.openBracketToken = openBracketToken, this.expressions = expressions, this.closeBracketToken = closeBracketToken, openBracketToken.parent = this, !TypeScript.isShared(expressions) && (expressions.parent = this), closeBracketToken.parent = this; - } - return ArrayLiteralExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.ArrayLiteralExpressionSyntax = ArrayLiteralExpressionSyntax; - var ObjectLiteralExpressionSyntax = (function (_super) { - __extends(ObjectLiteralExpressionSyntax, _super); - function ObjectLiteralExpressionSyntax(data, openBraceToken, propertyAssignments, closeBraceToken) { - _super.call(this, data); - this.openBraceToken = openBraceToken, this.propertyAssignments = propertyAssignments, this.closeBraceToken = closeBraceToken, openBraceToken.parent = this, !TypeScript.isShared(propertyAssignments) && (propertyAssignments.parent = this), closeBraceToken.parent = this; - } - return ObjectLiteralExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.ObjectLiteralExpressionSyntax = ObjectLiteralExpressionSyntax; - var ObjectCreationExpressionSyntax = (function (_super) { - __extends(ObjectCreationExpressionSyntax, _super); - function ObjectCreationExpressionSyntax(data, newKeyword, expression, argumentList) { - _super.call(this, data); - this.newKeyword = newKeyword, this.expression = expression, this.argumentList = argumentList, newKeyword.parent = this, expression.parent = this, argumentList && (argumentList.parent = this); - } - return ObjectCreationExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.ObjectCreationExpressionSyntax = ObjectCreationExpressionSyntax; - var ParenthesizedExpressionSyntax = (function (_super) { - __extends(ParenthesizedExpressionSyntax, _super); - function ParenthesizedExpressionSyntax(data, openParenToken, expression, closeParenToken) { - _super.call(this, data); - this.openParenToken = openParenToken, this.expression = expression, this.closeParenToken = closeParenToken, openParenToken.parent = this, expression.parent = this, closeParenToken.parent = this; - } - return ParenthesizedExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.ParenthesizedExpressionSyntax = ParenthesizedExpressionSyntax; - var ParenthesizedArrowFunctionExpressionSyntax = (function (_super) { - __extends(ParenthesizedArrowFunctionExpressionSyntax, _super); - function ParenthesizedArrowFunctionExpressionSyntax(data, callSignature, equalsGreaterThanToken, block, expression) { - _super.call(this, data); - this.callSignature = callSignature, this.equalsGreaterThanToken = equalsGreaterThanToken, this.block = block, this.expression = expression, callSignature.parent = this, equalsGreaterThanToken.parent = this, block && (block.parent = this), expression && (expression.parent = this); - } - return ParenthesizedArrowFunctionExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.ParenthesizedArrowFunctionExpressionSyntax = ParenthesizedArrowFunctionExpressionSyntax; - var SimpleArrowFunctionExpressionSyntax = (function (_super) { - __extends(SimpleArrowFunctionExpressionSyntax, _super); - function SimpleArrowFunctionExpressionSyntax(data, parameter, equalsGreaterThanToken, block, expression) { - _super.call(this, data); - this.parameter = parameter, this.equalsGreaterThanToken = equalsGreaterThanToken, this.block = block, this.expression = expression, parameter.parent = this, equalsGreaterThanToken.parent = this, block && (block.parent = this), expression && (expression.parent = this); - } - return SimpleArrowFunctionExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.SimpleArrowFunctionExpressionSyntax = SimpleArrowFunctionExpressionSyntax; - var CastExpressionSyntax = (function (_super) { - __extends(CastExpressionSyntax, _super); - function CastExpressionSyntax(data, lessThanToken, type, greaterThanToken, expression) { - _super.call(this, data); - this.lessThanToken = lessThanToken, this.type = type, this.greaterThanToken = greaterThanToken, this.expression = expression, lessThanToken.parent = this, type.parent = this, greaterThanToken.parent = this, expression.parent = this; - } - return CastExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.CastExpressionSyntax = CastExpressionSyntax; - var ElementAccessExpressionSyntax = (function (_super) { - __extends(ElementAccessExpressionSyntax, _super); - function ElementAccessExpressionSyntax(data, expression, openBracketToken, argumentExpression, closeBracketToken) { - _super.call(this, data); - this.expression = expression, this.openBracketToken = openBracketToken, this.argumentExpression = argumentExpression, this.closeBracketToken = closeBracketToken, expression.parent = this, openBracketToken.parent = this, argumentExpression.parent = this, closeBracketToken.parent = this; - } - return ElementAccessExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.ElementAccessExpressionSyntax = ElementAccessExpressionSyntax; - var FunctionExpressionSyntax = (function (_super) { - __extends(FunctionExpressionSyntax, _super); - function FunctionExpressionSyntax(data, functionKeyword, identifier, callSignature, block) { - _super.call(this, data); - this.functionKeyword = functionKeyword, this.identifier = identifier, this.callSignature = callSignature, this.block = block, functionKeyword.parent = this, identifier && (identifier.parent = this), callSignature.parent = this, block.parent = this; - } - return FunctionExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.FunctionExpressionSyntax = FunctionExpressionSyntax; - var OmittedExpressionSyntax = (function (_super) { - __extends(OmittedExpressionSyntax, _super); - function OmittedExpressionSyntax(data) { - _super.call(this, data); - } - return OmittedExpressionSyntax; - })(TypeScript.SyntaxNode); - Concrete.OmittedExpressionSyntax = OmittedExpressionSyntax; - var VariableDeclarationSyntax = (function (_super) { - __extends(VariableDeclarationSyntax, _super); - function VariableDeclarationSyntax(data, varKeyword, variableDeclarators) { - _super.call(this, data); - this.varKeyword = varKeyword, this.variableDeclarators = variableDeclarators, varKeyword.parent = this, !TypeScript.isShared(variableDeclarators) && (variableDeclarators.parent = this); - } - return VariableDeclarationSyntax; - })(TypeScript.SyntaxNode); - Concrete.VariableDeclarationSyntax = VariableDeclarationSyntax; - var VariableDeclaratorSyntax = (function (_super) { - __extends(VariableDeclaratorSyntax, _super); - function VariableDeclaratorSyntax(data, propertyName, typeAnnotation, equalsValueClause) { - _super.call(this, data); - this.propertyName = propertyName, this.typeAnnotation = typeAnnotation, this.equalsValueClause = equalsValueClause, propertyName.parent = this, typeAnnotation && (typeAnnotation.parent = this), equalsValueClause && (equalsValueClause.parent = this); - } - return VariableDeclaratorSyntax; - })(TypeScript.SyntaxNode); - Concrete.VariableDeclaratorSyntax = VariableDeclaratorSyntax; - var ArgumentListSyntax = (function (_super) { - __extends(ArgumentListSyntax, _super); - function ArgumentListSyntax(data, typeArgumentList, openParenToken, _arguments, closeParenToken) { - _super.call(this, data); - this.typeArgumentList = typeArgumentList, this.openParenToken = openParenToken, this.arguments = _arguments, this.closeParenToken = closeParenToken, typeArgumentList && (typeArgumentList.parent = this), openParenToken.parent = this, !TypeScript.isShared(_arguments) && (_arguments.parent = this), closeParenToken.parent = this; - } - return ArgumentListSyntax; - })(TypeScript.SyntaxNode); - Concrete.ArgumentListSyntax = ArgumentListSyntax; - var ParameterListSyntax = (function (_super) { - __extends(ParameterListSyntax, _super); - function ParameterListSyntax(data, openParenToken, parameters, closeParenToken) { - _super.call(this, data); - this.openParenToken = openParenToken, this.parameters = parameters, this.closeParenToken = closeParenToken, openParenToken.parent = this, !TypeScript.isShared(parameters) && (parameters.parent = this), closeParenToken.parent = this; - } - return ParameterListSyntax; - })(TypeScript.SyntaxNode); - Concrete.ParameterListSyntax = ParameterListSyntax; - var TypeArgumentListSyntax = (function (_super) { - __extends(TypeArgumentListSyntax, _super); - function TypeArgumentListSyntax(data, lessThanToken, typeArguments, greaterThanToken) { - _super.call(this, data); - this.lessThanToken = lessThanToken, this.typeArguments = typeArguments, this.greaterThanToken = greaterThanToken, lessThanToken.parent = this, !TypeScript.isShared(typeArguments) && (typeArguments.parent = this), greaterThanToken.parent = this; - } - return TypeArgumentListSyntax; - })(TypeScript.SyntaxNode); - Concrete.TypeArgumentListSyntax = TypeArgumentListSyntax; - var TypeParameterListSyntax = (function (_super) { - __extends(TypeParameterListSyntax, _super); - function TypeParameterListSyntax(data, lessThanToken, typeParameters, greaterThanToken) { - _super.call(this, data); - this.lessThanToken = lessThanToken, this.typeParameters = typeParameters, this.greaterThanToken = greaterThanToken, lessThanToken.parent = this, !TypeScript.isShared(typeParameters) && (typeParameters.parent = this), greaterThanToken.parent = this; - } - return TypeParameterListSyntax; - })(TypeScript.SyntaxNode); - Concrete.TypeParameterListSyntax = TypeParameterListSyntax; - var HeritageClauseSyntax = (function (_super) { - __extends(HeritageClauseSyntax, _super); - function HeritageClauseSyntax(data, extendsOrImplementsKeyword, typeNames) { - _super.call(this, data); - this.extendsOrImplementsKeyword = extendsOrImplementsKeyword, this.typeNames = typeNames, extendsOrImplementsKeyword.parent = this, !TypeScript.isShared(typeNames) && (typeNames.parent = this); - } - HeritageClauseSyntax.prototype.kind = function () { - return this.extendsOrImplementsKeyword.kind() === 48 /* ExtendsKeyword */ ? 231 /* ExtendsHeritageClause */ : 232 /* ImplementsHeritageClause */; - }; - return HeritageClauseSyntax; - })(TypeScript.SyntaxNode); - Concrete.HeritageClauseSyntax = HeritageClauseSyntax; - var EqualsValueClauseSyntax = (function (_super) { - __extends(EqualsValueClauseSyntax, _super); - function EqualsValueClauseSyntax(data, equalsToken, value) { - _super.call(this, data); - this.equalsToken = equalsToken, this.value = value, equalsToken.parent = this, value.parent = this; - } - return EqualsValueClauseSyntax; - })(TypeScript.SyntaxNode); - Concrete.EqualsValueClauseSyntax = EqualsValueClauseSyntax; - var CaseSwitchClauseSyntax = (function (_super) { - __extends(CaseSwitchClauseSyntax, _super); - function CaseSwitchClauseSyntax(data, caseKeyword, expression, colonToken, statements) { - _super.call(this, data); - this.caseKeyword = caseKeyword, this.expression = expression, this.colonToken = colonToken, this.statements = statements, caseKeyword.parent = this, expression.parent = this, colonToken.parent = this, !TypeScript.isShared(statements) && (statements.parent = this); - } - return CaseSwitchClauseSyntax; - })(TypeScript.SyntaxNode); - Concrete.CaseSwitchClauseSyntax = CaseSwitchClauseSyntax; - var DefaultSwitchClauseSyntax = (function (_super) { - __extends(DefaultSwitchClauseSyntax, _super); - function DefaultSwitchClauseSyntax(data, defaultKeyword, colonToken, statements) { - _super.call(this, data); - this.defaultKeyword = defaultKeyword, this.colonToken = colonToken, this.statements = statements, defaultKeyword.parent = this, colonToken.parent = this, !TypeScript.isShared(statements) && (statements.parent = this); - } - return DefaultSwitchClauseSyntax; - })(TypeScript.SyntaxNode); - Concrete.DefaultSwitchClauseSyntax = DefaultSwitchClauseSyntax; - var ElseClauseSyntax = (function (_super) { - __extends(ElseClauseSyntax, _super); - function ElseClauseSyntax(data, elseKeyword, statement) { - _super.call(this, data); - this.elseKeyword = elseKeyword, this.statement = statement, elseKeyword.parent = this, statement.parent = this; - } - return ElseClauseSyntax; - })(TypeScript.SyntaxNode); - Concrete.ElseClauseSyntax = ElseClauseSyntax; - var CatchClauseSyntax = (function (_super) { - __extends(CatchClauseSyntax, _super); - function CatchClauseSyntax(data, catchKeyword, openParenToken, identifier, typeAnnotation, closeParenToken, block) { - _super.call(this, data); - this.catchKeyword = catchKeyword, this.openParenToken = openParenToken, this.identifier = identifier, this.typeAnnotation = typeAnnotation, this.closeParenToken = closeParenToken, this.block = block, catchKeyword.parent = this, openParenToken.parent = this, identifier.parent = this, typeAnnotation && (typeAnnotation.parent = this), closeParenToken.parent = this, block.parent = this; - } - return CatchClauseSyntax; - })(TypeScript.SyntaxNode); - Concrete.CatchClauseSyntax = CatchClauseSyntax; - var FinallyClauseSyntax = (function (_super) { - __extends(FinallyClauseSyntax, _super); - function FinallyClauseSyntax(data, finallyKeyword, block) { - _super.call(this, data); - this.finallyKeyword = finallyKeyword, this.block = block, finallyKeyword.parent = this, block.parent = this; - } - return FinallyClauseSyntax; - })(TypeScript.SyntaxNode); - Concrete.FinallyClauseSyntax = FinallyClauseSyntax; - var TypeParameterSyntax = (function (_super) { - __extends(TypeParameterSyntax, _super); - function TypeParameterSyntax(data, identifier, constraint) { - _super.call(this, data); - this.identifier = identifier, this.constraint = constraint, identifier.parent = this, constraint && (constraint.parent = this); - } - return TypeParameterSyntax; - })(TypeScript.SyntaxNode); - Concrete.TypeParameterSyntax = TypeParameterSyntax; - var ConstraintSyntax = (function (_super) { - __extends(ConstraintSyntax, _super); - function ConstraintSyntax(data, extendsKeyword, typeOrExpression) { - _super.call(this, data); - this.extendsKeyword = extendsKeyword, this.typeOrExpression = typeOrExpression, extendsKeyword.parent = this, typeOrExpression.parent = this; - } - return ConstraintSyntax; - })(TypeScript.SyntaxNode); - Concrete.ConstraintSyntax = ConstraintSyntax; - var SimplePropertyAssignmentSyntax = (function (_super) { - __extends(SimplePropertyAssignmentSyntax, _super); - function SimplePropertyAssignmentSyntax(data, propertyName, colonToken, expression) { - _super.call(this, data); - this.propertyName = propertyName, this.colonToken = colonToken, this.expression = expression, propertyName.parent = this, colonToken.parent = this, expression.parent = this; - } - return SimplePropertyAssignmentSyntax; - })(TypeScript.SyntaxNode); - Concrete.SimplePropertyAssignmentSyntax = SimplePropertyAssignmentSyntax; - var FunctionPropertyAssignmentSyntax = (function (_super) { - __extends(FunctionPropertyAssignmentSyntax, _super); - function FunctionPropertyAssignmentSyntax(data, propertyName, callSignature, block) { - _super.call(this, data); - this.propertyName = propertyName, this.callSignature = callSignature, this.block = block, propertyName.parent = this, callSignature.parent = this, block.parent = this; - } - return FunctionPropertyAssignmentSyntax; - })(TypeScript.SyntaxNode); - Concrete.FunctionPropertyAssignmentSyntax = FunctionPropertyAssignmentSyntax; - var ParameterSyntax = (function (_super) { - __extends(ParameterSyntax, _super); - function ParameterSyntax(data, dotDotDotToken, modifiers, identifier, questionToken, typeAnnotation, equalsValueClause) { - _super.call(this, data); - this.dotDotDotToken = dotDotDotToken, this.modifiers = modifiers, this.identifier = identifier, this.questionToken = questionToken, this.typeAnnotation = typeAnnotation, this.equalsValueClause = equalsValueClause, dotDotDotToken && (dotDotDotToken.parent = this), !TypeScript.isShared(modifiers) && (modifiers.parent = this), identifier.parent = this, questionToken && (questionToken.parent = this), typeAnnotation && (typeAnnotation.parent = this), equalsValueClause && (equalsValueClause.parent = this); - } - return ParameterSyntax; - })(TypeScript.SyntaxNode); - Concrete.ParameterSyntax = ParameterSyntax; - var EnumElementSyntax = (function (_super) { - __extends(EnumElementSyntax, _super); - function EnumElementSyntax(data, propertyName, equalsValueClause) { - _super.call(this, data); - this.propertyName = propertyName, this.equalsValueClause = equalsValueClause, propertyName.parent = this, equalsValueClause && (equalsValueClause.parent = this); - } - return EnumElementSyntax; - })(TypeScript.SyntaxNode); - Concrete.EnumElementSyntax = EnumElementSyntax; - var TypeAnnotationSyntax = (function (_super) { - __extends(TypeAnnotationSyntax, _super); - function TypeAnnotationSyntax(data, colonToken, type) { - _super.call(this, data); - this.colonToken = colonToken, this.type = type, colonToken.parent = this, type.parent = this; - } - return TypeAnnotationSyntax; - })(TypeScript.SyntaxNode); - Concrete.TypeAnnotationSyntax = TypeAnnotationSyntax; - var ExternalModuleReferenceSyntax = (function (_super) { - __extends(ExternalModuleReferenceSyntax, _super); - function ExternalModuleReferenceSyntax(data, requireKeyword, openParenToken, stringLiteral, closeParenToken) { - _super.call(this, data); - this.requireKeyword = requireKeyword, this.openParenToken = openParenToken, this.stringLiteral = stringLiteral, this.closeParenToken = closeParenToken, requireKeyword.parent = this, openParenToken.parent = this, stringLiteral.parent = this, closeParenToken.parent = this; - } - return ExternalModuleReferenceSyntax; - })(TypeScript.SyntaxNode); - Concrete.ExternalModuleReferenceSyntax = ExternalModuleReferenceSyntax; - var ModuleNameModuleReferenceSyntax = (function (_super) { - __extends(ModuleNameModuleReferenceSyntax, _super); - function ModuleNameModuleReferenceSyntax(data, moduleName) { - _super.call(this, data); - this.moduleName = moduleName, moduleName.parent = this; - } - return ModuleNameModuleReferenceSyntax; - })(TypeScript.SyntaxNode); - Concrete.ModuleNameModuleReferenceSyntax = ModuleNameModuleReferenceSyntax; - SourceUnitSyntax.prototype.__kind = 120 /* SourceUnit */, QualifiedNameSyntax.prototype.__kind = 121 /* QualifiedName */, ObjectTypeSyntax.prototype.__kind = 122 /* ObjectType */, FunctionTypeSyntax.prototype.__kind = 123 /* FunctionType */, ArrayTypeSyntax.prototype.__kind = 124 /* ArrayType */, ConstructorTypeSyntax.prototype.__kind = 125 /* ConstructorType */, GenericTypeSyntax.prototype.__kind = 126 /* GenericType */, TypeQuerySyntax.prototype.__kind = 127 /* TypeQuery */, TupleTypeSyntax.prototype.__kind = 128 /* TupleType */, InterfaceDeclarationSyntax.prototype.__kind = 129 /* InterfaceDeclaration */, FunctionDeclarationSyntax.prototype.__kind = 130 /* FunctionDeclaration */, ModuleDeclarationSyntax.prototype.__kind = 131 /* ModuleDeclaration */, ClassDeclarationSyntax.prototype.__kind = 132 /* ClassDeclaration */, EnumDeclarationSyntax.prototype.__kind = 133 /* EnumDeclaration */, ImportDeclarationSyntax.prototype.__kind = 134 /* ImportDeclaration */, ExportAssignmentSyntax.prototype.__kind = 135 /* ExportAssignment */, MemberFunctionDeclarationSyntax.prototype.__kind = 136 /* MemberFunctionDeclaration */, MemberVariableDeclarationSyntax.prototype.__kind = 137 /* MemberVariableDeclaration */, ConstructorDeclarationSyntax.prototype.__kind = 138 /* ConstructorDeclaration */, IndexMemberDeclarationSyntax.prototype.__kind = 139 /* IndexMemberDeclaration */, GetAccessorSyntax.prototype.__kind = 140 /* GetAccessor */, SetAccessorSyntax.prototype.__kind = 141 /* SetAccessor */, PropertySignatureSyntax.prototype.__kind = 142 /* PropertySignature */, CallSignatureSyntax.prototype.__kind = 143 /* CallSignature */, ConstructSignatureSyntax.prototype.__kind = 144 /* ConstructSignature */, IndexSignatureSyntax.prototype.__kind = 145 /* IndexSignature */, MethodSignatureSyntax.prototype.__kind = 146 /* MethodSignature */, BlockSyntax.prototype.__kind = 147 /* Block */, IfStatementSyntax.prototype.__kind = 148 /* IfStatement */, VariableStatementSyntax.prototype.__kind = 149 /* VariableStatement */, ExpressionStatementSyntax.prototype.__kind = 150 /* ExpressionStatement */, ReturnStatementSyntax.prototype.__kind = 151 /* ReturnStatement */, SwitchStatementSyntax.prototype.__kind = 152 /* SwitchStatement */, BreakStatementSyntax.prototype.__kind = 153 /* BreakStatement */, ContinueStatementSyntax.prototype.__kind = 154 /* ContinueStatement */, ForStatementSyntax.prototype.__kind = 155 /* ForStatement */, ForInStatementSyntax.prototype.__kind = 156 /* ForInStatement */, EmptyStatementSyntax.prototype.__kind = 157 /* EmptyStatement */, ThrowStatementSyntax.prototype.__kind = 158 /* ThrowStatement */, WhileStatementSyntax.prototype.__kind = 159 /* WhileStatement */, TryStatementSyntax.prototype.__kind = 160 /* TryStatement */, LabeledStatementSyntax.prototype.__kind = 161 /* LabeledStatement */, DoStatementSyntax.prototype.__kind = 162 /* DoStatement */, DebuggerStatementSyntax.prototype.__kind = 163 /* DebuggerStatement */, WithStatementSyntax.prototype.__kind = 164 /* WithStatement */, DeleteExpressionSyntax.prototype.__kind = 171 /* DeleteExpression */, TypeOfExpressionSyntax.prototype.__kind = 172 /* TypeOfExpression */, VoidExpressionSyntax.prototype.__kind = 173 /* VoidExpression */, ConditionalExpressionSyntax.prototype.__kind = 187 /* ConditionalExpression */, MemberAccessExpressionSyntax.prototype.__kind = 213 /* MemberAccessExpression */, InvocationExpressionSyntax.prototype.__kind = 214 /* InvocationExpression */, ArrayLiteralExpressionSyntax.prototype.__kind = 215 /* ArrayLiteralExpression */, ObjectLiteralExpressionSyntax.prototype.__kind = 216 /* ObjectLiteralExpression */, ObjectCreationExpressionSyntax.prototype.__kind = 217 /* ObjectCreationExpression */, ParenthesizedExpressionSyntax.prototype.__kind = 218 /* ParenthesizedExpression */, ParenthesizedArrowFunctionExpressionSyntax.prototype.__kind = 219 /* ParenthesizedArrowFunctionExpression */, SimpleArrowFunctionExpressionSyntax.prototype.__kind = 220 /* SimpleArrowFunctionExpression */, CastExpressionSyntax.prototype.__kind = 221 /* CastExpression */, ElementAccessExpressionSyntax.prototype.__kind = 222 /* ElementAccessExpression */, FunctionExpressionSyntax.prototype.__kind = 223 /* FunctionExpression */, OmittedExpressionSyntax.prototype.__kind = 224 /* OmittedExpression */, VariableDeclarationSyntax.prototype.__kind = 225 /* VariableDeclaration */, VariableDeclaratorSyntax.prototype.__kind = 226 /* VariableDeclarator */, ArgumentListSyntax.prototype.__kind = 227 /* ArgumentList */, ParameterListSyntax.prototype.__kind = 228 /* ParameterList */, TypeArgumentListSyntax.prototype.__kind = 229 /* TypeArgumentList */, TypeParameterListSyntax.prototype.__kind = 230 /* TypeParameterList */, EqualsValueClauseSyntax.prototype.__kind = 233 /* EqualsValueClause */, CaseSwitchClauseSyntax.prototype.__kind = 234 /* CaseSwitchClause */, DefaultSwitchClauseSyntax.prototype.__kind = 235 /* DefaultSwitchClause */, ElseClauseSyntax.prototype.__kind = 236 /* ElseClause */, CatchClauseSyntax.prototype.__kind = 237 /* CatchClause */, FinallyClauseSyntax.prototype.__kind = 238 /* FinallyClause */, TypeParameterSyntax.prototype.__kind = 239 /* TypeParameter */, ConstraintSyntax.prototype.__kind = 240 /* Constraint */, SimplePropertyAssignmentSyntax.prototype.__kind = 241 /* SimplePropertyAssignment */, FunctionPropertyAssignmentSyntax.prototype.__kind = 242 /* FunctionPropertyAssignment */, ParameterSyntax.prototype.__kind = 243 /* Parameter */, EnumElementSyntax.prototype.__kind = 244 /* EnumElement */, TypeAnnotationSyntax.prototype.__kind = 245 /* TypeAnnotation */, ExternalModuleReferenceSyntax.prototype.__kind = 246 /* ExternalModuleReference */, ModuleNameModuleReferenceSyntax.prototype.__kind = 247 /* ModuleNameModuleReference */; - })(Concrete = Syntax.Concrete || (Syntax.Concrete = {})); - })(Syntax = TypeScript.Syntax || (TypeScript.Syntax = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - TypeScript.syntaxDiagnosticsTime = 0; - var SyntaxTree = (function () { - function SyntaxTree(isConcrete, sourceUnit, isDeclaration, diagnostics, fileName, text, languageVersion) { - this.text = text; - this._allDiagnostics = null; - this._isConcrete = isConcrete; - this._sourceUnit = sourceUnit; - this._isDeclaration = isDeclaration; - this._parserDiagnostics = diagnostics; - this._fileName = fileName; - this._lineMap = text.lineMap(); - this._languageVersion = languageVersion; - sourceUnit.syntaxTree = this; - } - SyntaxTree.prototype.isConcrete = function () { - return this._isConcrete; - }; - SyntaxTree.prototype.sourceUnit = function () { - return this._sourceUnit; - }; - SyntaxTree.prototype.isDeclaration = function () { - return this._isDeclaration; - }; - SyntaxTree.prototype.computeDiagnostics = function () { - if (this._parserDiagnostics.length > 0) { - return this._parserDiagnostics; - } - var diagnostics = []; - TypeScript.visitNodeOrToken(new GrammarCheckerWalker(this, diagnostics), this.sourceUnit()); - return diagnostics; - }; - SyntaxTree.prototype.diagnostics = function () { - if (this._allDiagnostics === null) { - var start = new Date().getTime(); - this._allDiagnostics = this.computeDiagnostics(); - TypeScript.syntaxDiagnosticsTime += new Date().getTime() - start; - } - return this._allDiagnostics; - }; - SyntaxTree.prototype.fileName = function () { - return this._fileName; - }; - SyntaxTree.prototype.lineMap = function () { - return this._lineMap; - }; - SyntaxTree.prototype.languageVersion = function () { - return this._languageVersion; - }; - SyntaxTree.prototype.cacheSyntaxTreeInfo = function () { - var sourceUnit = this.sourceUnit(); - var firstToken = firstSyntaxTreeToken(this); - var leadingTrivia = firstToken.leadingTrivia(this.text); - this._isExternalModule = externalModuleIndicatorSpanWorker(this, firstToken) !== null; - var amdDependencies = []; - for (var i = 0, n = leadingTrivia.count(); i < n; i++) { - var trivia = leadingTrivia.syntaxTriviaAt(i); - if (trivia.isComment()) { - var amdDependency = this.getAmdDependency(trivia.fullText()); - if (amdDependency) { - amdDependencies.push(amdDependency); - } - } - } - this._amdDependencies = amdDependencies; - }; - SyntaxTree.prototype.getAmdDependency = function (comment) { - var amdDependencyRegEx = /^\/\/\/\s* 0) { - var modifiers = parameter.modifiers; - for (var i = 0, n = modifiers.length; i < n; i++) { - var modifier = modifiers[i]; - if (this.checkParameterAccessibilityModifier(parameterList, modifier, i)) { - return true; - } - } - } - return false; - }; - GrammarCheckerWalker.prototype.checkParameterAccessibilityModifier = function (parameterList, modifier, modifierIndex) { - if (!TypeScript.SyntaxFacts.isAccessibilityModifier(modifier.kind())) { - this.pushDiagnostic(modifier, TypeScript.DiagnosticCode._0_modifier_cannot_appear_on_a_parameter, [modifier.text()]); - return true; - } - else { - if (modifierIndex > 0) { - this.pushDiagnostic(modifier, TypeScript.DiagnosticCode.Accessibility_modifier_already_seen); - return true; - } - } - return false; - }; - GrammarCheckerWalker.prototype.checkForTrailingComma = function (list) { - if (TypeScript.childCount(list) === 0 || TypeScript.childCount(list) % 2 === 1) { - return false; - } - var child = TypeScript.childAt(list, TypeScript.childCount(list) - 1); - this.pushDiagnostic(child, TypeScript.DiagnosticCode.Trailing_comma_not_allowed); - return true; - }; - GrammarCheckerWalker.prototype.checkForAtLeastOneElement = function (parent, list, reportToken, listKind) { - if (TypeScript.childCount(list) > 0) { - return false; - } - this.pushDiagnostic(reportToken, TypeScript.DiagnosticCode._0_list_cannot_be_empty, [listKind]); - return true; - }; - GrammarCheckerWalker.prototype.visitParameterList = function (node) { - if (this.checkParameterListAcessibilityModifiers(node) || this.checkParameterListOrder(node) || this.checkForTrailingComma(node.parameters)) { - return; - } - _super.prototype.visitParameterList.call(this, node); - }; - GrammarCheckerWalker.prototype.visitHeritageClause = function (node) { - if (this.checkForTrailingComma(node.typeNames) || this.checkForAtLeastOneElement(node, node.typeNames, node.extendsOrImplementsKeyword, TypeScript.SyntaxFacts.getText(node.extendsOrImplementsKeyword.kind()))) { - return; - } - _super.prototype.visitHeritageClause.call(this, node); - }; - GrammarCheckerWalker.prototype.visitArgumentList = function (node) { - if (this.checkForTrailingComma(node.arguments)) { - return; - } - _super.prototype.visitArgumentList.call(this, node); - }; - GrammarCheckerWalker.prototype.visitVariableDeclaration = function (node) { - if (this.checkForAtLeastOneElement(node, node.variableDeclarators, node.varKeyword, TypeScript.getLocalizedText(TypeScript.DiagnosticCode.variable_declaration, null)) || this.checkForTrailingComma(node.variableDeclarators)) { - return; - } - _super.prototype.visitVariableDeclaration.call(this, node); - }; - GrammarCheckerWalker.prototype.visitTypeArgumentList = function (node) { - if (this.checkForTrailingComma(node.typeArguments) || this.checkForAtLeastOneElement(node, node.typeArguments, node.lessThanToken, TypeScript.getLocalizedText(TypeScript.DiagnosticCode.type_argument, null))) { - return; - } - _super.prototype.visitTypeArgumentList.call(this, node); - }; - GrammarCheckerWalker.prototype.visitTupleType = function (node) { - if (this.checkForTrailingComma(node.types) || this.checkForAtLeastOneElement(node, node.types, node.openBracketToken, TypeScript.getLocalizedText(TypeScript.DiagnosticCode.type, null))) { - return; - } - _super.prototype.visitTupleType.call(this, node); - }; - GrammarCheckerWalker.prototype.visitTypeParameterList = function (node) { - if (this.checkForTrailingComma(node.typeParameters) || this.checkForAtLeastOneElement(node, node.typeParameters, node.lessThanToken, TypeScript.getLocalizedText(TypeScript.DiagnosticCode.type_parameter, null))) { - return; - } - _super.prototype.visitTypeParameterList.call(this, node); - }; - GrammarCheckerWalker.prototype.checkIndexSignatureParameter = function (node) { - if (node.parameters.length !== 1) { - this.pushDiagnostic(node.openBracketToken, TypeScript.DiagnosticCode.Index_signature_must_have_exactly_one_parameter); - return true; - } - var parameter = node.parameters[0]; - if (parameter.dotDotDotToken) { - this.pushDiagnostic(parameter, TypeScript.DiagnosticCode.Index_signatures_cannot_have_rest_parameters); - return true; - } - else if (parameter.modifiers.length > 0) { - this.pushDiagnostic(parameter, TypeScript.DiagnosticCode.Index_signature_parameter_cannot_have_accessibility_modifiers); - return true; - } - else if (parameter.questionToken) { - this.pushDiagnostic(parameter, TypeScript.DiagnosticCode.Index_signature_parameter_cannot_have_a_question_mark); - return true; - } - else if (parameter.equalsValueClause) { - this.pushDiagnostic(parameter, TypeScript.DiagnosticCode.Index_signature_parameter_cannot_have_an_initializer); - return true; - } - else if (!parameter.typeAnnotation) { - this.pushDiagnostic(parameter, TypeScript.DiagnosticCode.Index_signature_parameter_must_have_a_type_annotation); - return true; - } - else if (parameter.typeAnnotation.type.kind() !== 69 /* StringKeyword */ && parameter.typeAnnotation.type.kind() !== 67 /* NumberKeyword */) { - this.pushDiagnostic(parameter, TypeScript.DiagnosticCode.Index_signature_parameter_type_must_be_string_or_number); - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.visitIndexSignature = function (node) { - if (this.checkIndexSignatureParameter(node)) { - return; - } - if (!node.typeAnnotation) { - this.pushDiagnostic(node, TypeScript.DiagnosticCode.Index_signature_must_have_a_type_annotation); - return; - } - _super.prototype.visitIndexSignature.call(this, node); - }; - GrammarCheckerWalker.prototype.checkClassDeclarationHeritageClauses = function (node) { - var seenExtendsClause = false; - var seenImplementsClause = false; - for (var i = 0, n = node.heritageClauses.length; i < n; i++) { - TypeScript.Debug.assert(i <= 2); - var heritageClause = node.heritageClauses[i]; - if (heritageClause.extendsOrImplementsKeyword.kind() === 48 /* ExtendsKeyword */) { - if (seenExtendsClause) { - this.pushDiagnostic(heritageClause, TypeScript.DiagnosticCode.extends_clause_already_seen); - return true; - } - if (seenImplementsClause) { - this.pushDiagnostic(heritageClause, TypeScript.DiagnosticCode.extends_clause_must_precede_implements_clause); - return true; - } - if (heritageClause.typeNames.length > 1) { - this.pushDiagnostic(heritageClause, TypeScript.DiagnosticCode.Classes_can_only_extend_a_single_class); - return true; - } - seenExtendsClause = true; - } - else { - TypeScript.Debug.assert(heritageClause.extendsOrImplementsKeyword.kind() === 51 /* ImplementsKeyword */); - if (seenImplementsClause) { - this.pushDiagnostic(heritageClause, TypeScript.DiagnosticCode.implements_clause_already_seen); - return true; - } - seenImplementsClause = true; - } - } - return false; - }; - GrammarCheckerWalker.prototype.checkForDisallowedDeclareModifier = function (modifiers) { - if (this.inAmbientDeclaration) { - var declareToken = TypeScript.SyntaxUtilities.getToken(modifiers, 63 /* DeclareKeyword */); - if (declareToken) { - this.pushDiagnostic(declareToken, TypeScript.DiagnosticCode.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); - return true; - } - } - return false; - }; - GrammarCheckerWalker.prototype.checkForRequiredDeclareModifier = function (moduleElement, reportToken, modifiers) { - if (!this.inAmbientDeclaration && this.syntaxTree.isDeclaration()) { - if (!TypeScript.SyntaxUtilities.containsToken(modifiers, 63 /* DeclareKeyword */)) { - this.pushDiagnostic(reportToken, TypeScript.DiagnosticCode.A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file); - return true; - } - } - }; - GrammarCheckerWalker.prototype.visitClassDeclaration = function (node) { - if (this.checkForDisallowedDeclareModifier(node.modifiers) || this.checkForRequiredDeclareModifier(node, node.identifier, node.modifiers) || this.checkModuleElementModifiers(node.modifiers) || this.checkClassDeclarationHeritageClauses(node)) { - return; - } - var savedInAmbientDeclaration = this.inAmbientDeclaration; - this.inAmbientDeclaration = this.inAmbientDeclaration || this.syntaxTree.isDeclaration() || TypeScript.SyntaxUtilities.containsToken(node.modifiers, 63 /* DeclareKeyword */); - _super.prototype.visitClassDeclaration.call(this, node); - this.inAmbientDeclaration = savedInAmbientDeclaration; - }; - GrammarCheckerWalker.prototype.checkInterfaceDeclarationHeritageClauses = function (node) { - var seenExtendsClause = false; - for (var i = 0, n = node.heritageClauses.length; i < n; i++) { - TypeScript.Debug.assert(i <= 1); - var heritageClause = node.heritageClauses[i]; - if (heritageClause.extendsOrImplementsKeyword.kind() === 48 /* ExtendsKeyword */) { - if (seenExtendsClause) { - this.pushDiagnostic(heritageClause, TypeScript.DiagnosticCode.extends_clause_already_seen); - return true; - } - seenExtendsClause = true; - } - else { - TypeScript.Debug.assert(heritageClause.extendsOrImplementsKeyword.kind() === 51 /* ImplementsKeyword */); - this.pushDiagnostic(heritageClause, TypeScript.DiagnosticCode.Interface_declaration_cannot_have_implements_clause); - return true; - } - } - return false; - }; - GrammarCheckerWalker.prototype.checkInterfaceModifiers = function (modifiers) { - for (var i = 0, n = modifiers.length; i < n; i++) { - var modifier = modifiers[i]; - if (modifier.kind() === 63 /* DeclareKeyword */) { - this.pushDiagnostic(modifier, TypeScript.DiagnosticCode.A_declare_modifier_cannot_be_used_with_an_interface_declaration); - return true; - } - } - return false; - }; - GrammarCheckerWalker.prototype.visitInterfaceDeclaration = function (node) { - if (this.checkInterfaceModifiers(node.modifiers) || this.checkModuleElementModifiers(node.modifiers) || this.checkInterfaceDeclarationHeritageClauses(node)) { - return; - } - _super.prototype.visitInterfaceDeclaration.call(this, node); - }; - GrammarCheckerWalker.prototype.checkClassElementModifiers = function (list) { - var seenAccessibilityModifier = false; - var seenStaticModifier = false; - for (var i = 0, n = list.length; i < n; i++) { - var modifier = list[i]; - if (TypeScript.SyntaxFacts.isAccessibilityModifier(modifier.kind())) { - if (seenAccessibilityModifier) { - this.pushDiagnostic(modifier, TypeScript.DiagnosticCode.Accessibility_modifier_already_seen); - return true; - } - if (seenStaticModifier) { - var previousToken = list[i - 1]; - this.pushDiagnostic(modifier, TypeScript.DiagnosticCode._0_modifier_must_precede_1_modifier, [modifier.text(), previousToken.text()]); - return true; - } - seenAccessibilityModifier = true; - } - else if (modifier.kind() === 58 /* StaticKeyword */) { - if (seenStaticModifier) { - this.pushDiagnostic(modifier, TypeScript.DiagnosticCode._0_modifier_already_seen, [modifier.text()]); - return true; - } - seenStaticModifier = true; - } - else { - this.pushDiagnostic(modifier, TypeScript.DiagnosticCode._0_modifier_cannot_appear_on_a_class_element, [modifier.text()]); - return true; - } - } - return false; - }; - GrammarCheckerWalker.prototype.visitMemberVariableDeclaration = function (node) { - if (this.checkClassElementModifiers(node.modifiers)) { - return; - } - _super.prototype.visitMemberVariableDeclaration.call(this, node); - }; - GrammarCheckerWalker.prototype.visitMemberFunctionDeclaration = function (node) { - if (this.checkClassElementModifiers(node.modifiers)) { - return; - } - _super.prototype.visitMemberFunctionDeclaration.call(this, node); - }; - GrammarCheckerWalker.prototype.checkGetAccessorParameter = function (node) { - if (node.callSignature.parameterList.parameters.length !== 0) { - this.pushDiagnostic(node.propertyName, TypeScript.DiagnosticCode.get_accessor_cannot_have_parameters); - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.visitIndexMemberDeclaration = function (node) { - if (this.checkIndexMemberModifiers(node)) { - return; - } - _super.prototype.visitIndexMemberDeclaration.call(this, node); - }; - GrammarCheckerWalker.prototype.checkIndexMemberModifiers = function (node) { - if (node.modifiers.length > 0) { - this.pushDiagnostic(TypeScript.childAt(node.modifiers, 0), TypeScript.DiagnosticCode.Modifiers_cannot_appear_here); - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.checkEcmaScriptVersionIsAtLeast = function (parent, reportToken, languageVersion, diagnosticKey) { - if (this.syntaxTree.languageVersion() < languageVersion) { - this.pushDiagnostic(reportToken, diagnosticKey); - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.visitObjectLiteralExpression = function (node) { - var savedInObjectLiteralExpression = this.inObjectLiteralExpression; - this.inObjectLiteralExpression = true; - _super.prototype.visitObjectLiteralExpression.call(this, node); - this.inObjectLiteralExpression = savedInObjectLiteralExpression; - }; - GrammarCheckerWalker.prototype.visitGetAccessor = function (node) { - if (this.checkForAccessorDeclarationInAmbientContext(node) || this.checkEcmaScriptVersionIsAtLeast(node, node.propertyName, 1 /* ES5 */, TypeScript.DiagnosticCode.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher) || this.checkForDisallowedModifiers(node, node.modifiers) || this.checkClassElementModifiers(node.modifiers) || this.checkForDisallowedAccessorTypeParameters(node.callSignature) || this.checkGetAccessorParameter(node)) { - return; - } - _super.prototype.visitGetAccessor.call(this, node); - }; - GrammarCheckerWalker.prototype.checkForDisallowedSetAccessorTypeAnnotation = function (accessor) { - if (accessor.callSignature.typeAnnotation) { - this.pushDiagnostic(accessor.callSignature.typeAnnotation, TypeScript.DiagnosticCode.Type_annotation_cannot_appear_on_a_set_accessor); - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.checkForDisallowedAccessorTypeParameters = function (callSignature) { - if (callSignature.typeParameterList !== null) { - this.pushDiagnostic(callSignature.typeParameterList, TypeScript.DiagnosticCode.Type_parameters_cannot_appear_on_an_accessor); - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.checkForAccessorDeclarationInAmbientContext = function (accessor) { - if (this.inAmbientDeclaration) { - this.pushDiagnostic(accessor, TypeScript.DiagnosticCode.Accessors_are_not_allowed_in_ambient_contexts); - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.checkSetAccessorParameter = function (node) { - var parameters = node.callSignature.parameterList.parameters; - if (TypeScript.childCount(parameters) !== 1) { - this.pushDiagnostic(node.propertyName, TypeScript.DiagnosticCode.set_accessor_must_have_exactly_one_parameter); - return true; - } - var parameter = parameters[0]; - if (parameter.questionToken) { - this.pushDiagnostic(parameter, TypeScript.DiagnosticCode.set_accessor_parameter_cannot_be_optional); - return true; - } - if (parameter.equalsValueClause) { - this.pushDiagnostic(parameter, TypeScript.DiagnosticCode.set_accessor_parameter_cannot_have_an_initializer); - return true; - } - if (parameter.dotDotDotToken) { - this.pushDiagnostic(parameter, TypeScript.DiagnosticCode.set_accessor_cannot_have_rest_parameter); - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.visitSetAccessor = function (node) { - if (this.checkForAccessorDeclarationInAmbientContext(node) || this.checkEcmaScriptVersionIsAtLeast(node, node.propertyName, 1 /* ES5 */, TypeScript.DiagnosticCode.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher) || this.checkForDisallowedModifiers(node, node.modifiers) || this.checkClassElementModifiers(node.modifiers) || this.checkForDisallowedAccessorTypeParameters(node.callSignature) || this.checkForDisallowedSetAccessorTypeAnnotation(node) || this.checkSetAccessorParameter(node)) { - return; - } - _super.prototype.visitSetAccessor.call(this, node); - }; - GrammarCheckerWalker.prototype.visitEnumDeclaration = function (node) { - if (this.checkForDisallowedDeclareModifier(node.modifiers) || this.checkForRequiredDeclareModifier(node, node.identifier, node.modifiers) || this.checkModuleElementModifiers(node.modifiers), this.checkEnumElements(node)) { - return; - } - var savedInAmbientDeclaration = this.inAmbientDeclaration; - this.inAmbientDeclaration = this.inAmbientDeclaration || this.syntaxTree.isDeclaration() || TypeScript.SyntaxUtilities.containsToken(node.modifiers, 63 /* DeclareKeyword */); - _super.prototype.visitEnumDeclaration.call(this, node); - this.inAmbientDeclaration = savedInAmbientDeclaration; - }; - GrammarCheckerWalker.prototype.checkEnumElements = function (node) { - var previousValueWasComputed = false; - for (var i = 0, n = TypeScript.childCount(node.enumElements); i < n; i++) { - var child = TypeScript.childAt(node.enumElements, i); - if (i % 2 === 0) { - var enumElement = child; - if (!enumElement.equalsValueClause && previousValueWasComputed) { - this.pushDiagnostic(enumElement, TypeScript.DiagnosticCode.Enum_member_must_have_initializer); - return true; - } - if (enumElement.equalsValueClause) { - var value = enumElement.equalsValueClause.value; - previousValueWasComputed = !TypeScript.Syntax.isIntegerLiteral(value); - } - } - } - return false; - }; - GrammarCheckerWalker.prototype.visitEnumElement = function (node) { - if (this.inAmbientDeclaration && node.equalsValueClause) { - var expression = node.equalsValueClause.value; - if (!TypeScript.Syntax.isIntegerLiteral(expression)) { - this.pushDiagnostic(node.equalsValueClause.value, TypeScript.DiagnosticCode.Ambient_enum_elements_can_only_have_integer_literal_initializers); - return; - } - } - _super.prototype.visitEnumElement.call(this, node); - }; - GrammarCheckerWalker.prototype.visitInvocationExpression = function (node) { - if (node.expression.kind() === 50 /* SuperKeyword */ && node.argumentList.typeArgumentList !== null) { - this.pushDiagnostic(node, TypeScript.DiagnosticCode.super_invocation_cannot_have_type_arguments); - } - _super.prototype.visitInvocationExpression.call(this, node); - }; - GrammarCheckerWalker.prototype.checkModuleElementModifiers = function (modifiers) { - var seenExportModifier = false; - var seenDeclareModifier = false; - for (var i = 0, n = modifiers.length; i < n; i++) { - var modifier = modifiers[i]; - if (TypeScript.SyntaxFacts.isAccessibilityModifier(modifier.kind()) || modifier.kind() === 58 /* StaticKeyword */) { - this.pushDiagnostic(modifier, TypeScript.DiagnosticCode._0_modifier_cannot_appear_on_a_module_element, [modifier.text()]); - return true; - } - if (modifier.kind() === 63 /* DeclareKeyword */) { - if (seenDeclareModifier) { - this.pushDiagnostic(modifier, TypeScript.DiagnosticCode.Accessibility_modifier_already_seen); - return; - } - seenDeclareModifier = true; - } - else if (modifier.kind() === 47 /* ExportKeyword */) { - if (seenExportModifier) { - this.pushDiagnostic(modifier, TypeScript.DiagnosticCode._0_modifier_already_seen, [modifier.text()]); - return; - } - if (seenDeclareModifier) { - this.pushDiagnostic(modifier, TypeScript.DiagnosticCode._0_modifier_must_precede_1_modifier, [TypeScript.SyntaxFacts.getText(47 /* ExportKeyword */), TypeScript.SyntaxFacts.getText(63 /* DeclareKeyword */)]); - return; - } - seenExportModifier = true; - } - } - return false; - }; - GrammarCheckerWalker.prototype.checkForDisallowedImportDeclaration = function (node) { - if (!node.stringLiteral) { - for (var i = 0, n = node.moduleElements.length; i < n; i++) { - var child = node.moduleElements[i]; - if (child.kind() === 134 /* ImportDeclaration */) { - var importDeclaration = child; - if (importDeclaration.moduleReference.kind() === 246 /* ExternalModuleReference */) { - this.pushDiagnostic(importDeclaration, TypeScript.DiagnosticCode.Import_declarations_in_an_internal_module_cannot_reference_an_external_module); - } - } - } - } - return false; - }; - GrammarCheckerWalker.prototype.checkForDisallowedDeclareModifierOnImportDeclaration = function (modifiers) { - var declareToken = TypeScript.SyntaxUtilities.getToken(modifiers, 63 /* DeclareKeyword */); - if (declareToken) { - this.pushDiagnostic(declareToken, TypeScript.DiagnosticCode.A_declare_modifier_cannot_be_used_with_an_import_declaration); - return true; - } - }; - GrammarCheckerWalker.prototype.visitImportDeclaration = function (node) { - if (this.checkForDisallowedDeclareModifierOnImportDeclaration(node.modifiers) || this.checkModuleElementModifiers(node.modifiers)) { - return; - } - _super.prototype.visitImportDeclaration.call(this, node); - }; - GrammarCheckerWalker.prototype.visitModuleDeclaration = function (node) { - if (this.checkForDisallowedDeclareModifier(node.modifiers) || this.checkForRequiredDeclareModifier(node, node.stringLiteral ? node.stringLiteral : TypeScript.firstToken(node.name), node.modifiers) || this.checkModuleElementModifiers(node.modifiers) || this.checkForDisallowedImportDeclaration(node)) { - return; - } - if (node.stringLiteral) { - if (!this.inAmbientDeclaration && !TypeScript.SyntaxUtilities.containsToken(node.modifiers, 63 /* DeclareKeyword */)) { - this.pushDiagnostic(node.stringLiteral, TypeScript.DiagnosticCode.Only_ambient_modules_can_use_quoted_names); - return; - } - } - if (!node.stringLiteral && this.checkForDisallowedExportAssignment(node)) { - return; - } - var savedInAmbientDeclaration = this.inAmbientDeclaration; - this.inAmbientDeclaration = this.inAmbientDeclaration || this.syntaxTree.isDeclaration() || TypeScript.SyntaxUtilities.containsToken(node.modifiers, 63 /* DeclareKeyword */); - _super.prototype.visitModuleDeclaration.call(this, node); - this.inAmbientDeclaration = savedInAmbientDeclaration; - }; - GrammarCheckerWalker.prototype.checkForDisallowedExportAssignment = function (node) { - for (var i = 0, n = node.moduleElements.length; i < n; i++) { - var child = node.moduleElements[i]; - if (child.kind() === 135 /* ExportAssignment */) { - this.pushDiagnostic(child, TypeScript.DiagnosticCode.Export_assignment_cannot_be_used_in_internal_modules); - return true; - } - } - return false; - }; - GrammarCheckerWalker.prototype.visitBlock = function (node) { - if (this.checkForBlockInAmbientContext(node)) { - return; - } - var savedInBlock = this.inBlock; - this.inBlock = true; - _super.prototype.visitBlock.call(this, node); - this.inBlock = savedInBlock; - }; - GrammarCheckerWalker.prototype.checkForBlockInAmbientContext = function (node) { - if (this.inAmbientDeclaration || this.syntaxTree.isDeclaration()) { - if (node.parent.kind() === 1 /* List */) { - this.pushDiagnostic(TypeScript.firstToken(node), TypeScript.DiagnosticCode.Statements_are_not_allowed_in_ambient_contexts); - } - else { - this.pushDiagnostic(TypeScript.firstToken(node), TypeScript.DiagnosticCode.A_function_implementation_cannot_be_declared_in_an_ambient_context); - } - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.checkForStatementInAmbientContxt = function (node) { - if (this.inAmbientDeclaration || this.syntaxTree.isDeclaration()) { - this.pushDiagnostic(TypeScript.firstToken(node), TypeScript.DiagnosticCode.Statements_are_not_allowed_in_ambient_contexts); - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.visitBreakStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node) || this.checkBreakStatementTarget(node)) { - return; - } - _super.prototype.visitBreakStatement.call(this, node); - }; - GrammarCheckerWalker.prototype.visitContinueStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node) || this.checkContinueStatementTarget(node)) { - return; - } - _super.prototype.visitContinueStatement.call(this, node); - }; - GrammarCheckerWalker.prototype.checkBreakStatementTarget = function (node) { - if (node.identifier) { - var breakableLabels = this.getEnclosingLabels(node, true, false); - if (!TypeScript.ArrayUtilities.any(breakableLabels, function (s) { return TypeScript.tokenValueText(s.identifier) === TypeScript.tokenValueText(node.identifier); })) { - var breakableLabels = this.getEnclosingLabels(node, true, true); - if (TypeScript.ArrayUtilities.any(breakableLabels, function (s) { return TypeScript.tokenValueText(s.identifier) === TypeScript.tokenValueText(node.identifier); })) { - this.pushDiagnostic(node, TypeScript.DiagnosticCode.Jump_target_cannot_cross_function_boundary); - } - else { - this.pushDiagnostic(node, TypeScript.DiagnosticCode.Jump_target_not_found); - } - return true; - } - } - else if (!this.inIterationStatement(node, false) && !this.inSwitchStatement(node)) { - if (this.inIterationStatement(node, true)) { - this.pushDiagnostic(node, TypeScript.DiagnosticCode.Jump_target_cannot_cross_function_boundary); - } - else { - this.pushDiagnostic(node, TypeScript.DiagnosticCode.break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement); - } - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.inSwitchStatement = function (ast) { - while (ast) { - if (ast.kind() === 152 /* SwitchStatement */) { - return true; - } - if (TypeScript.SyntaxUtilities.isAnyFunctionExpressionOrDeclaration(ast)) { - return false; - } - ast = ast.parent; - } - return false; - }; - GrammarCheckerWalker.prototype.isIterationStatement = function (ast) { - switch (ast.kind()) { - case 155 /* ForStatement */: - case 156 /* ForInStatement */: - case 159 /* WhileStatement */: - case 162 /* DoStatement */: - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.inIterationStatement = function (element, crossFunctions) { - while (element) { - if (this.isIterationStatement(element)) { - return true; - } - if (!crossFunctions && TypeScript.SyntaxUtilities.isAnyFunctionExpressionOrDeclaration(element)) { - return false; - } - element = element.parent; - } - return false; - }; - GrammarCheckerWalker.prototype.getEnclosingLabels = function (element, breakable, crossFunctions) { - var result = []; - element = element.parent; - while (element) { - if (element.kind() === 161 /* LabeledStatement */) { - var labeledStatement = element; - if (breakable) { - result.push(labeledStatement); - } - else { - if (this.labelIsOnContinuableConstruct(labeledStatement.statement)) { - result.push(labeledStatement); - } - } - } - if (!crossFunctions && TypeScript.SyntaxUtilities.isAnyFunctionExpressionOrDeclaration(element)) { - break; - } - element = element.parent; - } - return result; - }; - GrammarCheckerWalker.prototype.labelIsOnContinuableConstruct = function (statement) { - switch (statement.kind()) { - case 161 /* LabeledStatement */: - return this.labelIsOnContinuableConstruct(statement.statement); - case 159 /* WhileStatement */: - case 155 /* ForStatement */: - case 156 /* ForInStatement */: - case 162 /* DoStatement */: - return true; - default: - return false; - } - }; - GrammarCheckerWalker.prototype.checkContinueStatementTarget = function (node) { - if (!this.inIterationStatement(node, false)) { - if (this.inIterationStatement(node, true)) { - this.pushDiagnostic(node, TypeScript.DiagnosticCode.Jump_target_cannot_cross_function_boundary); - } - else { - this.pushDiagnostic(node, TypeScript.DiagnosticCode.continue_statement_can_only_be_used_within_an_enclosing_iteration_statement); - } - return true; - } - else if (node.identifier) { - var continuableLabels = this.getEnclosingLabels(node, false, false); - if (!TypeScript.ArrayUtilities.any(continuableLabels, function (s) { return TypeScript.tokenValueText(s.identifier) === TypeScript.tokenValueText(node.identifier); })) { - var continuableLabels = this.getEnclosingLabels(node, false, true); - if (TypeScript.ArrayUtilities.any(continuableLabels, function (s) { return TypeScript.tokenValueText(s.identifier) === TypeScript.tokenValueText(node.identifier); })) { - this.pushDiagnostic(node, TypeScript.DiagnosticCode.Jump_target_cannot_cross_function_boundary); - } - else { - this.pushDiagnostic(node, TypeScript.DiagnosticCode.Jump_target_not_found); - } - return true; - } - } - return false; - }; - GrammarCheckerWalker.prototype.visitDebuggerStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - return; - } - _super.prototype.visitDebuggerStatement.call(this, node); - }; - GrammarCheckerWalker.prototype.visitDoStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - return; - } - _super.prototype.visitDoStatement.call(this, node); - }; - GrammarCheckerWalker.prototype.visitEmptyStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - return; - } - _super.prototype.visitEmptyStatement.call(this, node); - }; - GrammarCheckerWalker.prototype.visitExpressionStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - return; - } - _super.prototype.visitExpressionStatement.call(this, node); - }; - GrammarCheckerWalker.prototype.visitForInStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node) || this.checkForInStatementVariableDeclaration(node) || this.checkForInLeftHandSideExpression(node)) { - return; - } - _super.prototype.visitForInStatement.call(this, node); - }; - GrammarCheckerWalker.prototype.checkForInLeftHandSideExpression = function (node) { - if (node.left && !TypeScript.SyntaxUtilities.isLeftHandSizeExpression(node.left)) { - this.pushDiagnostic(node.left, TypeScript.DiagnosticCode.Invalid_left_hand_side_in_for_in_statement); - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.checkForInStatementVariableDeclaration = function (node) { - if (node.variableDeclaration && node.variableDeclaration.variableDeclarators.length > 1) { - this.pushDiagnostic(node.variableDeclaration, TypeScript.DiagnosticCode.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement); - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.visitForStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - return; - } - _super.prototype.visitForStatement.call(this, node); - }; - GrammarCheckerWalker.prototype.visitIfStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - return; - } - _super.prototype.visitIfStatement.call(this, node); - }; - GrammarCheckerWalker.prototype.visitLabeledStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node) || this.checkForInvalidLabelIdentifier(node)) { - return; - } - _super.prototype.visitLabeledStatement.call(this, node); - }; - GrammarCheckerWalker.prototype.checkForInvalidLabelIdentifier = function (node) { - var labelIdentifier = TypeScript.tokenValueText(node.identifier); - var breakableLabels = this.getEnclosingLabels(node, true, false); - var matchingLabel = TypeScript.ArrayUtilities.firstOrDefault(breakableLabels, function (s) { return TypeScript.tokenValueText(s.identifier) === labelIdentifier; }); - if (matchingLabel) { - this.pushDiagnostic(node.identifier, TypeScript.DiagnosticCode.Duplicate_identifier_0, [labelIdentifier]); - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.visitReturnStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node) || this.checkForReturnStatementNotInFunctionBody(node)) { - return; - } - _super.prototype.visitReturnStatement.call(this, node); - }; - GrammarCheckerWalker.prototype.checkForReturnStatementNotInFunctionBody = function (node) { - for (var element = node; element; element = element.parent) { - if (TypeScript.SyntaxUtilities.isAnyFunctionExpressionOrDeclaration(element)) { - return false; - } - } - this.pushDiagnostic(TypeScript.firstToken(node), TypeScript.DiagnosticCode.return_statement_must_be_contained_within_a_function_body); - return true; - }; - GrammarCheckerWalker.prototype.visitSwitchStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - return; - } - _super.prototype.visitSwitchStatement.call(this, node); - }; - GrammarCheckerWalker.prototype.visitThrowStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - return; - } - _super.prototype.visitThrowStatement.call(this, node); - }; - GrammarCheckerWalker.prototype.visitTryStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - return; - } - _super.prototype.visitTryStatement.call(this, node); - }; - GrammarCheckerWalker.prototype.visitWhileStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - return; - } - _super.prototype.visitWhileStatement.call(this, node); - }; - GrammarCheckerWalker.prototype.visitWithStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node) || this.checkForWithInStrictMode(node)) { - return; - } - _super.prototype.visitWithStatement.call(this, node); - }; - GrammarCheckerWalker.prototype.checkForWithInStrictMode = function (node) { - if (TypeScript.parsedInStrictMode(node)) { - this.pushDiagnostic(TypeScript.firstToken(node), TypeScript.DiagnosticCode.with_statements_are_not_allowed_in_strict_mode); - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.checkForDisallowedModifiers = function (parent, modifiers) { - if (this.inBlock || this.inObjectLiteralExpression) { - if (modifiers.length > 0) { - this.pushDiagnostic(TypeScript.childAt(modifiers, 0), TypeScript.DiagnosticCode.Modifiers_cannot_appear_here); - return true; - } - } - return false; - }; - GrammarCheckerWalker.prototype.visitFunctionDeclaration = function (node) { - if (this.checkForDisallowedDeclareModifier(node.modifiers) || this.checkForDisallowedModifiers(node, node.modifiers) || this.checkForRequiredDeclareModifier(node, node.identifier, node.modifiers) || this.checkModuleElementModifiers(node.modifiers) || this.checkForDisallowedEvalOrArguments(node, node.identifier)) { - return; - } - var savedInAmbientDeclaration = this.inAmbientDeclaration; - this.inAmbientDeclaration = this.inAmbientDeclaration || this.syntaxTree.isDeclaration() || TypeScript.SyntaxUtilities.containsToken(node.modifiers, 63 /* DeclareKeyword */); - _super.prototype.visitFunctionDeclaration.call(this, node); - this.inAmbientDeclaration = savedInAmbientDeclaration; - }; - GrammarCheckerWalker.prototype.visitFunctionExpression = function (node) { - if (this.checkForDisallowedEvalOrArguments(node, node.identifier)) { - return; - } - _super.prototype.visitFunctionExpression.call(this, node); - }; - GrammarCheckerWalker.prototype.visitVariableStatement = function (node) { - if (this.checkForDisallowedDeclareModifier(node.modifiers) || this.checkForDisallowedModifiers(node, node.modifiers) || this.checkForRequiredDeclareModifier(node, node.variableDeclaration.varKeyword, node.modifiers) || this.checkModuleElementModifiers(node.modifiers)) { - return; - } - var savedInAmbientDeclaration = this.inAmbientDeclaration; - this.inAmbientDeclaration = this.inAmbientDeclaration || this.syntaxTree.isDeclaration() || TypeScript.SyntaxUtilities.containsToken(node.modifiers, 63 /* DeclareKeyword */); - _super.prototype.visitVariableStatement.call(this, node); - this.inAmbientDeclaration = savedInAmbientDeclaration; - }; - GrammarCheckerWalker.prototype.checkListSeparators = function (parent, list, kind) { - for (var i = 0, n = TypeScript.childCount(list); i < n; i++) { - var child = TypeScript.childAt(list, i); - if (i % 2 === 1 && child.kind() !== kind) { - this.pushDiagnostic(child, TypeScript.DiagnosticCode._0_expected, [TypeScript.SyntaxFacts.getText(kind)]); - } - } - return false; - }; - GrammarCheckerWalker.prototype.visitObjectType = function (node) { - if (this.checkListSeparators(node, node.typeMembers, 78 /* SemicolonToken */)) { - return; - } - var savedInAmbientDeclaration = this.inAmbientDeclaration; - this.inAmbientDeclaration = true; - _super.prototype.visitObjectType.call(this, node); - this.inAmbientDeclaration = savedInAmbientDeclaration; - }; - GrammarCheckerWalker.prototype.visitArrayType = function (node) { - var savedInAmbientDeclaration = this.inAmbientDeclaration; - this.inAmbientDeclaration = true; - _super.prototype.visitArrayType.call(this, node); - this.inAmbientDeclaration = savedInAmbientDeclaration; - }; - GrammarCheckerWalker.prototype.visitFunctionType = function (node) { - var savedInAmbientDeclaration = this.inAmbientDeclaration; - this.inAmbientDeclaration = true; - _super.prototype.visitFunctionType.call(this, node); - this.inAmbientDeclaration = savedInAmbientDeclaration; - }; - GrammarCheckerWalker.prototype.visitConstructorType = function (node) { - var savedInAmbientDeclaration = this.inAmbientDeclaration; - this.inAmbientDeclaration = true; - _super.prototype.visitConstructorType.call(this, node); - this.inAmbientDeclaration = savedInAmbientDeclaration; - }; - GrammarCheckerWalker.prototype.visitVariableDeclarator = function (node) { - if (this.checkVariableDeclaratorInitializer(node) || this.checkVariableDeclaratorIdentifier(node)) { - return; - } - _super.prototype.visitVariableDeclarator.call(this, node); - }; - GrammarCheckerWalker.prototype.checkVariableDeclaratorIdentifier = function (node) { - if (node.parent.kind() !== 137 /* MemberVariableDeclaration */) { - if (this.checkForDisallowedEvalOrArguments(node, node.propertyName)) { - return true; - } - } - return false; - }; - GrammarCheckerWalker.prototype.checkVariableDeclaratorInitializer = function (node) { - if (this.inAmbientDeclaration && node.equalsValueClause) { - this.pushDiagnostic(TypeScript.firstToken(node.equalsValueClause.value), TypeScript.DiagnosticCode.Initializers_are_not_allowed_in_ambient_contexts); - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.visitConstructorDeclaration = function (node) { - if (this.checkClassElementModifiers(node.modifiers) || this.checkConstructorModifiers(node.modifiers) || this.checkConstructorTypeParameterList(node) || this.checkConstructorTypeAnnotation(node)) { - return; - } - _super.prototype.visitConstructorDeclaration.call(this, node); - }; - GrammarCheckerWalker.prototype.checkConstructorModifiers = function (modifiers) { - for (var i = 0, n = modifiers.length; i < n; i++) { - var child = modifiers[i]; - if (child.kind() !== 57 /* PublicKeyword */) { - this.pushDiagnostic(child, TypeScript.DiagnosticCode._0_modifier_cannot_appear_on_a_constructor_declaration, [TypeScript.SyntaxFacts.getText(child.kind())]); - return true; - } - } - return false; - }; - GrammarCheckerWalker.prototype.checkConstructorTypeParameterList = function (node) { - if (node.callSignature.typeParameterList) { - this.pushDiagnostic(node.callSignature.typeParameterList, TypeScript.DiagnosticCode.Type_parameters_cannot_appear_on_a_constructor_declaration); - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.checkConstructorTypeAnnotation = function (node) { - if (node.callSignature.typeAnnotation) { - this.pushDiagnostic(node.callSignature.typeAnnotation, TypeScript.DiagnosticCode.Type_annotation_cannot_appear_on_a_constructor_declaration); - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.visitBinaryExpression = function (node) { - if (this.checkIllegalAssignment(node)) { - return; - } - _super.prototype.visitBinaryExpression.call(this, node); - }; - GrammarCheckerWalker.prototype.visitPrefixUnaryExpression = function (node) { - if (TypeScript.parsedInStrictMode(node) && this.isPreIncrementOrDecrementExpression(node) && this.isEvalOrArguments(node.operand)) { - this.pushDiagnostic(node.operatorToken, TypeScript.DiagnosticCode.Invalid_use_of_0_in_strict_mode, [this.getEvalOrArguments(node.operand)]); - } - _super.prototype.visitPrefixUnaryExpression.call(this, node); - }; - GrammarCheckerWalker.prototype.visitPostfixUnaryExpression = function (node) { - if (TypeScript.parsedInStrictMode(node) && this.isEvalOrArguments(node.operand)) { - this.pushDiagnostic(node.operatorToken, TypeScript.DiagnosticCode.Invalid_use_of_0_in_strict_mode, [this.getEvalOrArguments(node.operand)]); - } - _super.prototype.visitPostfixUnaryExpression.call(this, node); - }; - GrammarCheckerWalker.prototype.visitParameter = function (node) { - if (this.checkForDisallowedEvalOrArguments(node, node.identifier)) { - return; - } - _super.prototype.visitParameter.call(this, node); - }; - GrammarCheckerWalker.prototype.checkForDisallowedEvalOrArguments = function (node, token) { - if (token) { - if (TypeScript.parsedInStrictMode(node) && this.isEvalOrArguments(token)) { - this.pushDiagnostic(token, TypeScript.DiagnosticCode.Invalid_use_of_0_in_strict_mode, [this.getEvalOrArguments(token)]); - return true; - } - } - return false; - }; - GrammarCheckerWalker.prototype.isPreIncrementOrDecrementExpression = function (node) { - switch (node.kind()) { - case 170 /* PreDecrementExpression */: - case 169 /* PreIncrementExpression */: - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.visitDeleteExpression = function (node) { - if (TypeScript.parsedInStrictMode(node) && node.expression.kind() === 11 /* IdentifierName */) { - this.pushDiagnostic(TypeScript.firstToken(node), TypeScript.DiagnosticCode.delete_cannot_be_called_on_an_identifier_in_strict_mode); - return; - } - _super.prototype.visitDeleteExpression.call(this, node); - }; - GrammarCheckerWalker.prototype.checkIllegalAssignment = function (node) { - if (TypeScript.parsedInStrictMode(node) && TypeScript.SyntaxFacts.isAssignmentOperatorToken(node.operatorToken.kind()) && this.isEvalOrArguments(node.left)) { - this.pushDiagnostic(node.operatorToken, TypeScript.DiagnosticCode.Invalid_use_of_0_in_strict_mode, [this.getEvalOrArguments(node.left)]); - return true; - } - return false; - }; - GrammarCheckerWalker.prototype.getEvalOrArguments = function (expr) { - if (expr.kind() === 11 /* IdentifierName */) { - var text = TypeScript.tokenValueText(expr); - if (text === "eval" || text === "arguments") { - return text; - } - } - return null; - }; - GrammarCheckerWalker.prototype.isEvalOrArguments = function (expr) { - return this.getEvalOrArguments(expr) !== null; - }; - GrammarCheckerWalker.prototype.visitConstraint = function (node) { - if (this.checkConstraintType(node)) { - return; - } - _super.prototype.visitConstraint.call(this, node); - }; - GrammarCheckerWalker.prototype.checkConstraintType = function (node) { - if (!TypeScript.SyntaxFacts.isType(node.typeOrExpression.kind())) { - this.pushDiagnostic(node.typeOrExpression, TypeScript.DiagnosticCode.Type_expected); - return true; - } - return false; - }; - return GrammarCheckerWalker; - })(TypeScript.SyntaxWalker); - function firstSyntaxTreeToken(syntaxTree) { - var scanner = TypeScript.Scanner.createScanner(syntaxTree.languageVersion(), syntaxTree.text, function () { - }); - return scanner.scan(false); - } - function externalModuleIndicatorSpan(syntaxTree) { - var firstToken = firstSyntaxTreeToken(syntaxTree); - return externalModuleIndicatorSpanWorker(syntaxTree, firstToken); - } - TypeScript.externalModuleIndicatorSpan = externalModuleIndicatorSpan; - function externalModuleIndicatorSpanWorker(syntaxTree, firstToken) { - var leadingTrivia = firstToken.leadingTrivia(syntaxTree.text); - return implicitImportSpan(leadingTrivia) || topLevelImportOrExportSpan(syntaxTree.sourceUnit()); - } - TypeScript.externalModuleIndicatorSpanWorker = externalModuleIndicatorSpanWorker; - function implicitImportSpan(sourceUnitLeadingTrivia) { - for (var i = 0, n = sourceUnitLeadingTrivia.count(); i < n; i++) { - var trivia = sourceUnitLeadingTrivia.syntaxTriviaAt(i); - if (trivia.isComment()) { - var span = implicitImportSpanWorker(trivia); - if (span) { - return span; - } - } - } - return null; - } - function implicitImportSpanWorker(trivia) { - var implicitImportRegEx = /^(\/\/\/\s*/gim; - var match = implicitImportRegEx.exec(trivia.fullText()); - if (match) { - return new TypeScript.TextSpan(trivia.fullStart(), trivia.fullWidth()); - } - return null; - } - function topLevelImportOrExportSpan(node) { - for (var i = 0, n = node.moduleElements.length; i < n; i++) { - var moduleElement = node.moduleElements[i]; - var _firstToken = TypeScript.firstToken(moduleElement); - if (_firstToken !== null && _firstToken.kind() === 47 /* ExportKeyword */) { - return new TypeScript.TextSpan(TypeScript.start(_firstToken), TypeScript.width(_firstToken)); - } - if (moduleElement.kind() === 134 /* ImportDeclaration */) { - var importDecl = moduleElement; - if (importDecl.moduleReference.kind() === 246 /* ExternalModuleReference */) { - var literal = importDecl.moduleReference.stringLiteral; - return new TypeScript.TextSpan(TypeScript.start(literal), TypeScript.width(literal)); - } - } - } - return null; - } -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Unicode = (function () { - function Unicode() { - } - Unicode.lookupInUnicodeMap = function (code, map) { - if (code < map[0]) { - return false; - } - var lo = 0; - var hi = map.length; - var mid; - while (lo + 1 < hi) { - mid = lo + (hi - lo) / 2; - mid -= mid % 2; - if (map[mid] <= code && code <= map[mid + 1]) { - return true; - } - if (code < map[mid]) { - hi = mid; - } - else { - lo = mid + 2; - } - } - return false; - }; - Unicode.isIdentifierStart = function (code, languageVersion) { - if (languageVersion === 0 /* ES3 */) { - return Unicode.lookupInUnicodeMap(code, Unicode.unicodeES3IdentifierStart); - } - else if (languageVersion === 1 /* ES5 */) { - return Unicode.lookupInUnicodeMap(code, Unicode.unicodeES5IdentifierStart); - } - else { - throw TypeScript.Errors.argumentOutOfRange("languageVersion"); - } - }; - Unicode.isIdentifierPart = function (code, languageVersion) { - if (languageVersion === 0 /* ES3 */) { - return Unicode.lookupInUnicodeMap(code, Unicode.unicodeES3IdentifierPart); - } - else if (languageVersion === 1 /* ES5 */) { - return Unicode.lookupInUnicodeMap(code, Unicode.unicodeES5IdentifierPart); - } - else { - throw TypeScript.Errors.argumentOutOfRange("languageVersion"); - } - }; - Unicode.unicodeES3IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1610, 1649, 1747, 1749, 1749, 1765, 1766, 1786, 1788, 1808, 1808, 1810, 1836, 1920, 1957, 2309, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2784, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3294, 3294, 3296, 3297, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3424, 3425, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3805, 3840, 3840, 3904, 3911, 3913, 3946, 3976, 3979, 4096, 4129, 4131, 4135, 4137, 4138, 4176, 4181, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6067, 6176, 6263, 6272, 6312, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8319, 8319, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12346, 12353, 12436, 12445, 12446, 12449, 12538, 12540, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65138, 65140, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; - Unicode.unicodeES3IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 768, 846, 864, 866, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1155, 1158, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1441, 1443, 1465, 1467, 1469, 1471, 1471, 1473, 1474, 1476, 1476, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1621, 1632, 1641, 1648, 1747, 1749, 1756, 1759, 1768, 1770, 1773, 1776, 1788, 1808, 1836, 1840, 1866, 1920, 1968, 2305, 2307, 2309, 2361, 2364, 2381, 2384, 2388, 2392, 2403, 2406, 2415, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2492, 2494, 2500, 2503, 2504, 2507, 2509, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2562, 2562, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2649, 2652, 2654, 2654, 2662, 2676, 2689, 2691, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2784, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2876, 2883, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2913, 2918, 2927, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3031, 3031, 3047, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3134, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3168, 3169, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3262, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3297, 3302, 3311, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3390, 3395, 3398, 3400, 3402, 3405, 3415, 3415, 3424, 3425, 3430, 3439, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3805, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3946, 3953, 3972, 3974, 3979, 3984, 3991, 3993, 4028, 4038, 4038, 4096, 4129, 4131, 4135, 4137, 4138, 4140, 4146, 4150, 4153, 4160, 4169, 4176, 4185, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 4969, 4977, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6099, 6112, 6121, 6160, 6169, 6176, 6263, 6272, 6313, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8319, 8319, 8400, 8412, 8417, 8417, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12346, 12353, 12436, 12441, 12442, 12445, 12446, 12449, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65056, 65059, 65075, 65076, 65101, 65103, 65136, 65138, 65140, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65381, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; - Unicode.unicodeES5IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2208, 2208, 2210, 2220, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2423, 2425, 2431, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6000, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6428, 6480, 6509, 6512, 6516, 6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409, 7413, 7414, 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43648, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; - Unicode.unicodeES5IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1520, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2048, 2093, 2112, 2139, 2208, 2208, 2210, 2220, 2276, 2302, 2304, 2403, 2406, 2415, 2417, 2423, 2425, 2431, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3161, 3168, 3171, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3396, 3398, 3400, 3402, 3406, 3415, 3415, 3424, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6000, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6263, 6272, 6314, 6320, 6389, 6400, 6428, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6617, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7376, 7378, 7380, 7414, 7424, 7654, 7676, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8204, 8205, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 11823, 11823, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12442, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42647, 42655, 42737, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43047, 43072, 43123, 43136, 43204, 43216, 43225, 43232, 43255, 43259, 43259, 43264, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43643, 43648, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65062, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; - return Unicode; - })(); - TypeScript.Unicode = Unicode; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var IncrementalParser; - (function (IncrementalParser) { - function createParserSource(oldSyntaxTree, textChangeRange, text) { - var fileName = oldSyntaxTree.fileName(); - var languageVersion = oldSyntaxTree.languageVersion(); - var _scannerParserSource; - var _changeRange; - var _changeRangeNewSpan; - var _changeDelta = 0; - var _oldSourceUnitCursor = getSyntaxCursor(); - var oldSourceUnit = oldSyntaxTree.sourceUnit(); - var _outstandingRewindPointCount = 0; - if (oldSourceUnit.moduleElements.length > 0) { - _oldSourceUnitCursor.pushElement(TypeScript.childAt(oldSourceUnit.moduleElements, 0), 0); - } - _changeRange = extendToAffectedRange(textChangeRange, oldSourceUnit); - _changeRangeNewSpan = _changeRange.newSpan(); - if (TypeScript.Debug.shouldAssert(2 /* Aggressive */)) { - TypeScript.Debug.assert((TypeScript.fullWidth(oldSourceUnit) - _changeRange.span().length() + _changeRange.newLength()) === text.length()); - } - _scannerParserSource = TypeScript.Scanner.createParserSource(oldSyntaxTree.fileName(), text, oldSyntaxTree.languageVersion()); - function release() { - _scannerParserSource.release(); - _scannerParserSource = null; - _oldSourceUnitCursor = null; - _outstandingRewindPointCount = 0; - } - function extendToAffectedRange(changeRange, sourceUnit) { - var maxLookahead = 1; - var start = changeRange.span().start(); - for (var i = 0; start > 0 && i <= maxLookahead; i++) { - var token = TypeScript.findToken(sourceUnit, start); - var position = token.fullStart(); - start = Math.max(0, position - 1); - } - var finalSpan = TypeScript.TextSpan.fromBounds(start, changeRange.span().end()); - var finalLength = changeRange.newLength() + (changeRange.span().start() - start); - return new TypeScript.TextChangeRange(finalSpan, finalLength); - } - function absolutePosition() { - return _scannerParserSource.absolutePosition(); - } - function tokenDiagnostics() { - return _scannerParserSource.tokenDiagnostics(); - } - function getRewindPoint() { - var rewindPoint = _scannerParserSource.getRewindPoint(); - var oldSourceUnitCursorClone = cloneSyntaxCursor(_oldSourceUnitCursor); - rewindPoint.changeDelta = _changeDelta; - rewindPoint.changeRange = _changeRange; - rewindPoint.oldSourceUnitCursor = _oldSourceUnitCursor; - _oldSourceUnitCursor = oldSourceUnitCursorClone; - _outstandingRewindPointCount++; - return rewindPoint; - } - function rewind(rewindPoint) { - _changeRange = rewindPoint.changeRange; - _changeDelta = rewindPoint.changeDelta; - returnSyntaxCursor(_oldSourceUnitCursor); - _oldSourceUnitCursor = rewindPoint.oldSourceUnitCursor; - rewindPoint.oldSourceUnitCursor = null; - _scannerParserSource.rewind(rewindPoint); - } - function releaseRewindPoint(rewindPoint) { - if (rewindPoint.oldSourceUnitCursor !== null) { - returnSyntaxCursor(rewindPoint.oldSourceUnitCursor); - } - _scannerParserSource.releaseRewindPoint(rewindPoint); - _outstandingRewindPointCount--; - TypeScript.Debug.assert(_outstandingRewindPointCount >= 0); - } - function isPinned() { - return _outstandingRewindPointCount > 0; - } - function canReadFromOldSourceUnit() { - if (isPinned()) { - return false; - } - if (_changeRange !== null && _changeRangeNewSpan.intersectsWithPosition(absolutePosition())) { - return false; - } - syncCursorToNewTextIfBehind(); - return _changeDelta === 0 && !_oldSourceUnitCursor.isFinished(); - } - function updateTokens(nodeOrToken) { - var position = absolutePosition(); - var tokenWasMoved = isPastChangeRange() && TypeScript.fullStart(nodeOrToken) !== position; - if (tokenWasMoved) { - setTokenFullStartWalker.position = position; - TypeScript.visitNodeOrToken(setTokenFullStartWalker, nodeOrToken); - } - } - function currentNode() { - if (canReadFromOldSourceUnit()) { - var node = tryGetNodeFromOldSourceUnit(); - if (node !== null) { - updateTokens(node); - return node; - } - } - return null; - } - function currentToken() { - if (canReadFromOldSourceUnit()) { - var token = tryGetTokenFromOldSourceUnit(); - if (token !== null) { - updateTokens(token); - return token; - } - } - return _scannerParserSource.currentToken(); - } - function currentContextualToken() { - return _scannerParserSource.currentContextualToken(); - } - function syncCursorToNewTextIfBehind() { - while (true) { - if (_oldSourceUnitCursor.isFinished()) { - break; - } - if (_changeDelta >= 0) { - break; - } - var currentNodeOrToken = _oldSourceUnitCursor.currentNodeOrToken(); - if (TypeScript.isNode(currentNodeOrToken) && (TypeScript.fullWidth(currentNodeOrToken) > Math.abs(_changeDelta))) { - _oldSourceUnitCursor.moveToFirstChild(); - } - else { - _oldSourceUnitCursor.moveToNextSibling(); - _changeDelta += TypeScript.fullWidth(currentNodeOrToken); - } - } - } - function intersectsWithChangeRangeSpanInOriginalText(start, length) { - return !isPastChangeRange() && _changeRange.span().intersectsWith(start, length); - } - function tryGetNodeFromOldSourceUnit() { - while (true) { - var node = _oldSourceUnitCursor.currentNode(); - if (node === null) { - return null; - } - if (!intersectsWithChangeRangeSpanInOriginalText(absolutePosition(), TypeScript.fullWidth(node))) { - var isIncrementallyUnusuable = TypeScript.isIncrementallyUnusable(node); - if (!isIncrementallyUnusuable) { - return node; - } - } - _oldSourceUnitCursor.moveToFirstChild(); - } - } - function canReuseTokenFromOldSourceUnit(position, token) { - if (token !== null) { - if (!intersectsWithChangeRangeSpanInOriginalText(position, token.fullWidth())) { - if (!token.isIncrementallyUnusable() && !TypeScript.Scanner.isContextualToken(token)) { - return true; - } - } - } - return false; - } - function tryGetTokenFromOldSourceUnit() { - var token = _oldSourceUnitCursor.currentToken(); - return canReuseTokenFromOldSourceUnit(absolutePosition(), token) ? token : null; - } - function peekToken(n) { - if (canReadFromOldSourceUnit()) { - var token = tryPeekTokenFromOldSourceUnit(n); - if (token !== null) { - return token; - } - } - return _scannerParserSource.peekToken(n); - } - function tryPeekTokenFromOldSourceUnit(n) { - var cursorClone = cloneSyntaxCursor(_oldSourceUnitCursor); - var token = tryPeekTokenFromOldSourceUnitWorker(n); - returnSyntaxCursor(_oldSourceUnitCursor); - _oldSourceUnitCursor = cursorClone; - return token; - } - function tryPeekTokenFromOldSourceUnitWorker(n) { - var currentPosition = absolutePosition(); - _oldSourceUnitCursor.moveToFirstToken(); - for (var i = 0; i < n; i++) { - var interimToken = _oldSourceUnitCursor.currentToken(); - if (!canReuseTokenFromOldSourceUnit(currentPosition, interimToken)) { - return null; - } - currentPosition += interimToken.fullWidth(); - _oldSourceUnitCursor.moveToNextSibling(); - } - var token = _oldSourceUnitCursor.currentToken(); - return canReuseTokenFromOldSourceUnit(currentPosition, token) ? token : null; - } - function consumeNode(node) { - _oldSourceUnitCursor.moveToNextSibling(); - var _absolutePosition = absolutePosition() + TypeScript.fullWidth(node); - _scannerParserSource.resetToPosition(_absolutePosition); - } - function consumeToken(currentToken) { - if (_oldSourceUnitCursor.currentToken() === currentToken) { - _oldSourceUnitCursor.moveToNextSibling(); - var _absolutePosition = absolutePosition() + currentToken.fullWidth(); - _scannerParserSource.resetToPosition(_absolutePosition); - } - else { - _changeDelta -= currentToken.fullWidth(); - _scannerParserSource.consumeToken(currentToken); - if (!isPastChangeRange()) { - if (absolutePosition() >= _changeRangeNewSpan.end()) { - _changeDelta += _changeRange.newLength() - _changeRange.span().length(); - _changeRange = null; - } - } - } - } - function isPastChangeRange() { - return _changeRange === null; - } - return { - text: text, - fileName: fileName, - languageVersion: languageVersion, - currentNode: currentNode, - currentToken: currentToken, - currentContextualToken: currentContextualToken, - peekToken: peekToken, - consumeNode: consumeNode, - consumeToken: consumeToken, - getRewindPoint: getRewindPoint, - rewind: rewind, - releaseRewindPoint: releaseRewindPoint, - tokenDiagnostics: tokenDiagnostics, - release: release - }; - } - function createSyntaxCursorPiece(element, indexInParent) { - return { element: element, indexInParent: indexInParent }; - } - var syntaxCursorPool = []; - var syntaxCursorPoolCount = 0; - function returnSyntaxCursor(cursor) { - cursor.clean(); - syntaxCursorPool[syntaxCursorPoolCount] = cursor; - syntaxCursorPoolCount++; - } - function getSyntaxCursor() { - var cursor = syntaxCursorPoolCount > 0 ? syntaxCursorPool[syntaxCursorPoolCount - 1] : createSyntaxCursor(); - if (syntaxCursorPoolCount > 0) { - syntaxCursorPoolCount--; - syntaxCursorPool[syntaxCursorPoolCount] = null; - } - return cursor; - } - function cloneSyntaxCursor(cursor) { - var newCursor = getSyntaxCursor(); - newCursor.deepCopyFrom(cursor); - return newCursor; - } - function createSyntaxCursor() { - var pieces = []; - var currentPieceIndex = -1; - function clean() { - for (var i = 0, n = pieces.length; i < n; i++) { - var piece = pieces[i]; - if (piece.element === null) { - break; - } - piece.element = null; - piece.indexInParent = -1; - } - currentPieceIndex = -1; - } - function deepCopyFrom(other) { - for (var i = 0, n = other.pieces.length; i < n; i++) { - var piece = other.pieces[i]; - if (piece.element === null) { - break; - } - pushElement(piece.element, piece.indexInParent); - } - } - function isFinished() { - return currentPieceIndex < 0; - } - function currentNodeOrToken() { - if (isFinished()) { - return null; - } - var result = pieces[currentPieceIndex].element; - return result; - } - function currentNode() { - var element = currentNodeOrToken(); - return TypeScript.isNode(element) ? element : null; - } - function moveToFirstChild() { - var nodeOrToken = currentNodeOrToken(); - if (nodeOrToken === null) { - return; - } - if (TypeScript.isToken(nodeOrToken)) { - return; - } - for (var i = 0, n = TypeScript.childCount(nodeOrToken); i < n; i++) { - var child = TypeScript.childAt(nodeOrToken, i); - if (child !== null && !TypeScript.isShared(child)) { - pushElement(child, i); - moveToFirstChildIfList(); - return; - } - } - moveToNextSibling(); - } - function moveToNextSibling() { - while (!isFinished()) { - var currentPiece = pieces[currentPieceIndex]; - var parent = currentPiece.element.parent; - for (var i = currentPiece.indexInParent + 1, n = TypeScript.childCount(parent); i < n; i++) { - var sibling = TypeScript.childAt(parent, i); - if (sibling !== null && !TypeScript.isShared(sibling)) { - currentPiece.element = sibling; - currentPiece.indexInParent = i; - moveToFirstChildIfList(); - return; - } - } - currentPiece.element = null; - currentPiece.indexInParent = -1; - currentPieceIndex--; - } - } - function moveToFirstChildIfList() { - var element = pieces[currentPieceIndex].element; - if (TypeScript.isList(element) || TypeScript.isSeparatedList(element)) { - pushElement(TypeScript.childAt(element, 0), 0); - } - } - function pushElement(element, indexInParent) { - currentPieceIndex++; - if (currentPieceIndex === pieces.length) { - pieces.push(createSyntaxCursorPiece(element, indexInParent)); - } - else { - var piece = pieces[currentPieceIndex]; - piece.element = element; - piece.indexInParent = indexInParent; - } - } - function moveToFirstToken() { - while (!isFinished()) { - var element = pieces[currentPieceIndex].element; - if (TypeScript.isNode(element)) { - moveToFirstChild(); - continue; - } - return; - } - } - function currentToken() { - moveToFirstToken(); - var element = currentNodeOrToken(); - return element === null ? null : element; - } - return { - pieces: pieces, - clean: clean, - isFinished: isFinished, - moveToFirstChild: moveToFirstChild, - moveToFirstToken: moveToFirstToken, - moveToNextSibling: moveToNextSibling, - currentNodeOrToken: currentNodeOrToken, - currentNode: currentNode, - currentToken: currentToken, - pushElement: pushElement, - deepCopyFrom: deepCopyFrom - }; - } - var SetTokenFullStartWalker = (function (_super) { - __extends(SetTokenFullStartWalker, _super); - function SetTokenFullStartWalker() { - _super.apply(this, arguments); - } - SetTokenFullStartWalker.prototype.visitToken = function (token) { - var position = this.position; - token.setFullStart(position); - this.position = position + token.fullWidth(); - }; - return SetTokenFullStartWalker; - })(TypeScript.SyntaxWalker); - var setTokenFullStartWalker = new SetTokenFullStartWalker(); - function parse(oldSyntaxTree, textChangeRange, newText) { - TypeScript.Debug.assert(oldSyntaxTree.isConcrete(), "Can only incrementally parse a concrete syntax tree."); - if (textChangeRange.isUnchanged()) { - return oldSyntaxTree; - } - return TypeScript.Parser.parseSource(createParserSource(oldSyntaxTree, textChangeRange, newText), oldSyntaxTree.isDeclaration()); - } - IncrementalParser.parse = parse; - })(IncrementalParser = TypeScript.IncrementalParser || (TypeScript.IncrementalParser = {})); -})(TypeScript || (TypeScript = {})); -var ts; -(function (ts) { - var OutliningElementsCollector; - (function (OutliningElementsCollector) { - function collectElements(sourceFile) { - var elements = []; - var collapseText = "..."; - function addOutliningSpan(hintSpanNode, startElement, endElement, autoCollapse) { - if (hintSpanNode && startElement && endElement) { - var span = { - textSpan: TypeScript.TextSpan.fromBounds(startElement.pos, endElement.end), - hintSpan: TypeScript.TextSpan.fromBounds(hintSpanNode.getStart(), hintSpanNode.end), - bannerText: collapseText, - autoCollapse: autoCollapse - }; - elements.push(span); - } - } - function autoCollapse(node) { - switch (node.kind) { - case 178 /* ModuleBlock */: - case 174 /* ClassDeclaration */: - case 175 /* InterfaceDeclaration */: - case 176 /* EnumDeclaration */: - return false; - } - return true; - } - var depth = 0; - var maxDepth = 20; - function walk(n) { - if (depth > maxDepth) { - return; - } - switch (n.kind) { - case 148 /* Block */: - var parent = n.parent; - var openBrace = ts.findChildOfKind(n, 9 /* OpenBraceToken */, sourceFile); - var closeBrace = ts.findChildOfKind(n, 10 /* CloseBraceToken */, sourceFile); - if (parent.kind === 153 /* DoStatement */ || parent.kind === 156 /* ForInStatement */ || parent.kind === 155 /* ForStatement */ || parent.kind === 152 /* IfStatement */ || parent.kind === 154 /* WhileStatement */ || parent.kind === 160 /* WithStatement */) { - addOutliningSpan(parent, openBrace, closeBrace, autoCollapse(n)); - } - else { - var span = TypeScript.TextSpan.fromBounds(n.getStart(), n.end); - elements.push({ - textSpan: span, - hintSpan: span, - bannerText: collapseText, - autoCollapse: autoCollapse(n) - }); - } - break; - case 173 /* FunctionBlock */: - case 178 /* ModuleBlock */: - case 167 /* TryBlock */: - case 168 /* CatchBlock */: - case 169 /* FinallyBlock */: - var openBrace = ts.findChildOfKind(n, 9 /* OpenBraceToken */, sourceFile); - var closeBrace = ts.findChildOfKind(n, 10 /* CloseBraceToken */, sourceFile); - addOutliningSpan(n.parent, openBrace, closeBrace, autoCollapse(n)); - break; - case 174 /* ClassDeclaration */: - case 175 /* InterfaceDeclaration */: - case 176 /* EnumDeclaration */: - case 133 /* ObjectLiteral */: - case 161 /* SwitchStatement */: - var openBrace = ts.findChildOfKind(n, 9 /* OpenBraceToken */, sourceFile); - var closeBrace = ts.findChildOfKind(n, 10 /* CloseBraceToken */, sourceFile); - addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n)); - break; - case 132 /* ArrayLiteral */: - var openBracket = ts.findChildOfKind(n, 13 /* OpenBracketToken */, sourceFile); - var closeBracket = ts.findChildOfKind(n, 14 /* CloseBracketToken */, sourceFile); - addOutliningSpan(n, openBracket, closeBracket, autoCollapse(n)); - break; - } - depth++; - ts.forEachChild(n, walk); - depth--; - } - walk(sourceFile); - return elements; - } - OutliningElementsCollector.collectElements = collectElements; - })(OutliningElementsCollector = ts.OutliningElementsCollector || (ts.OutliningElementsCollector = {})); -})(ts || (ts = {})); -var ts; -(function (ts) { - var NavigationBar; - (function (NavigationBar) { - function getNavigationBarItems(sourceFile) { - var hasGlobalNode = false; - return getItemsWorker(getTopLevelNodes(sourceFile), createTopLevelItem); - function getIndent(node) { - var indent = hasGlobalNode ? 1 : 0; - var current = node.parent; - while (current) { - switch (current.kind) { - case 177 /* ModuleDeclaration */: - do { - current = current.parent; - } while (current.kind === 177 /* ModuleDeclaration */); - case 174 /* ClassDeclaration */: - case 176 /* EnumDeclaration */: - case 175 /* InterfaceDeclaration */: - case 172 /* FunctionDeclaration */: - indent++; - } - current = current.parent; - } - return indent; - } - function getChildNodes(nodes) { - var childNodes = []; - for (var i = 0, n = nodes.length; i < n; i++) { - var node = nodes[i]; - if (node.kind === 174 /* ClassDeclaration */ || node.kind === 176 /* EnumDeclaration */ || node.kind === 175 /* InterfaceDeclaration */ || node.kind === 177 /* ModuleDeclaration */ || node.kind === 172 /* FunctionDeclaration */) { - childNodes.push(node); - } - else if (node.kind === 149 /* VariableStatement */) { - childNodes.push.apply(childNodes, node.declarations); - } - } - return sortNodes(childNodes); - } - function getTopLevelNodes(node) { - var topLevelNodes = []; - topLevelNodes.push(node); - addTopLevelNodes(node.statements, topLevelNodes); - return topLevelNodes; - } - function sortNodes(nodes) { - return nodes.slice(0).sort(function (n1, n2) { - if (n1.name && n2.name) { - return n1.name.text.localeCompare(n2.name.text); - } - else if (n1.name) { - return 1; - } - else if (n2.name) { - -1; - } - else { - return n1.kind - n2.kind; - } - }); - } - function addTopLevelNodes(nodes, topLevelNodes) { - nodes = sortNodes(nodes); - for (var i = 0, n = nodes.length; i < n; i++) { - var node = nodes[i]; - switch (node.kind) { - case 174 /* ClassDeclaration */: - case 176 /* EnumDeclaration */: - case 175 /* InterfaceDeclaration */: - topLevelNodes.push(node); - break; - case 177 /* ModuleDeclaration */: - var moduleDeclaration = node; - topLevelNodes.push(node); - addTopLevelNodes(getInnermostModule(moduleDeclaration).body.statements, topLevelNodes); - break; - case 172 /* FunctionDeclaration */: - var functionDeclaration = node; - if (isTopLevelFunctionDeclaration(functionDeclaration)) { - topLevelNodes.push(node); - addTopLevelNodes(functionDeclaration.body.statements, topLevelNodes); - } - break; - } - } - } - function isTopLevelFunctionDeclaration(functionDeclaration) { - if (functionDeclaration.kind === 172 /* FunctionDeclaration */) { - if (functionDeclaration.body && functionDeclaration.body.kind === 173 /* FunctionBlock */) { - if (ts.forEach(functionDeclaration.body.statements, function (s) { return s.kind === 172 /* FunctionDeclaration */ && !isEmpty(s.name.text); })) { - return true; - } - if (functionDeclaration.parent.kind !== 173 /* FunctionBlock */) { - return true; - } - } - } - return false; - } - function getItemsWorker(nodes, createItem) { - var items = []; - var keyToItem = {}; - for (var i = 0, n = nodes.length; i < n; i++) { - var child = nodes[i]; - var item = createItem(child); - if (item !== undefined) { - if (item.text.length > 0) { - var key = item.text + "-" + item.kind + "-" + item.indent; - var itemWithSameName = keyToItem[key]; - if (itemWithSameName) { - merge(itemWithSameName, item); - } - else { - keyToItem[key] = item; - items.push(item); - } - } - } - } - return items; - } - function merge(target, source) { - target.spans.push.apply(target.spans, source.spans); - if (source.childItems) { - if (!target.childItems) { - target.childItems = []; - } - outer: for (var i = 0, n = source.childItems.length; i < n; i++) { - var sourceChild = source.childItems[i]; - for (var j = 0, m = target.childItems.length; j < m; j++) { - var targetChild = target.childItems[j]; - if (targetChild.text === sourceChild.text && targetChild.kind === sourceChild.kind) { - merge(targetChild, sourceChild); - continue outer; - } - } - target.childItems.push(sourceChild); - } - } - } - function createChildItem(node) { - switch (node.kind) { - case 118 /* Parameter */: - if ((node.flags & ts.NodeFlags.Modifier) === 0) { - return undefined; - } - return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); - case 120 /* Method */: - return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberFunctionElement); - case 122 /* GetAccessor */: - return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberGetAccessorElement); - case 123 /* SetAccessor */: - return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberSetAccessorElement); - case 126 /* IndexSignature */: - return createItem(node, "[]", ts.ScriptElementKind.indexSignatureElement); - case 181 /* EnumMember */: - return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); - case 124 /* CallSignature */: - return createItem(node, "()", ts.ScriptElementKind.callSignatureElement); - case 125 /* ConstructSignature */: - return createItem(node, "new()", ts.ScriptElementKind.constructSignatureElement); - case 119 /* Property */: - return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); - case 172 /* FunctionDeclaration */: - return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.functionElement); - case 171 /* VariableDeclaration */: - return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.variableElement); - case 121 /* Constructor */: - return createItem(node, "constructor", ts.ScriptElementKind.constructorImplementationElement); - } - return undefined; - function createItem(node, name, scriptElementKind) { - return getNavigationBarItem(name, scriptElementKind, ts.getNodeModifiers(node), [getNodeSpan(node)]); - } - } - function isEmpty(text) { - return !text || text.trim() === ""; - } - function getNavigationBarItem(text, kind, kindModifiers, spans, childItems, indent) { - if (childItems === void 0) { childItems = []; } - if (indent === void 0) { indent = 0; } - if (isEmpty(text)) { - return undefined; - } - return { - text: text, - kind: kind, - kindModifiers: kindModifiers, - spans: spans, - childItems: childItems, - indent: indent, - bolded: false, - grayed: false - }; - } - function createTopLevelItem(node) { - switch (node.kind) { - case 182 /* SourceFile */: - return createSourceFileItem(node); - case 174 /* ClassDeclaration */: - return createClassItem(node); - case 176 /* EnumDeclaration */: - return createEnumItem(node); - case 175 /* InterfaceDeclaration */: - return createIterfaceItem(node); - case 177 /* ModuleDeclaration */: - return createModuleItem(node); - case 172 /* FunctionDeclaration */: - return createFunctionItem(node); - } - return undefined; - function getModuleName(moduleDeclaration) { - if (moduleDeclaration.name.kind === 7 /* StringLiteral */) { - return getTextOfNode(moduleDeclaration.name); - } - var result = []; - result.push(moduleDeclaration.name.text); - while (moduleDeclaration.body && moduleDeclaration.body.kind === 177 /* ModuleDeclaration */) { - moduleDeclaration = moduleDeclaration.body; - result.push(moduleDeclaration.name.text); - } - return result.join("."); - } - function createModuleItem(node) { - var moduleName = getModuleName(node); - var childItems = getItemsWorker(getChildNodes(getInnermostModule(node).body.statements), createChildItem); - return getNavigationBarItem(moduleName, ts.ScriptElementKind.moduleElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); - } - function createFunctionItem(node) { - if (node.name && node.body && node.body.kind === 173 /* FunctionBlock */) { - var childItems = getItemsWorker(sortNodes(node.body.statements), createChildItem); - return getNavigationBarItem(node.name.text, ts.ScriptElementKind.functionElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); - } - return undefined; - } - function createSourceFileItem(node) { - var childItems = getItemsWorker(getChildNodes(node.statements), createChildItem); - if (childItems === undefined || childItems.length === 0) { - return undefined; - } - hasGlobalNode = true; - var rootName = ts.isExternalModule(node) ? "\"" + ts.escapeString(ts.getBaseFilename(ts.removeFileExtension(ts.normalizePath(node.filename)))) + "\"" : ""; - return getNavigationBarItem(rootName, ts.ScriptElementKind.moduleElement, ts.ScriptElementKindModifier.none, [getNodeSpan(node)], childItems); - } - function createClassItem(node) { - var childItems; - if (node.members) { - var constructor = ts.forEach(node.members, function (member) { - return member.kind === 121 /* Constructor */ && member; - }); - var nodes = constructor ? constructor.parameters.concat(node.members) : node.members; - var childItems = getItemsWorker(sortNodes(nodes), createChildItem); - } - return getNavigationBarItem(node.name.text, ts.ScriptElementKind.classElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); - } - function createEnumItem(node) { - var childItems = getItemsWorker(sortNodes(node.members), createChildItem); - return getNavigationBarItem(node.name.text, ts.ScriptElementKind.enumElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); - } - function createIterfaceItem(node) { - var childItems = getItemsWorker(sortNodes(node.members), createChildItem); - return getNavigationBarItem(node.name.text, ts.ScriptElementKind.interfaceElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); - } - } - function getInnermostModule(node) { - while (node.body.kind === 177 /* ModuleDeclaration */) { - node = node.body; - } - return node; - } - function getNodeSpan(node) { - return node.kind === 182 /* SourceFile */ ? TypeScript.TextSpan.fromBounds(node.getFullStart(), node.getEnd()) : TypeScript.TextSpan.fromBounds(node.getStart(), node.getEnd()); - } - function getTextOfNode(node) { - return ts.getTextOfNodeFromSourceText(sourceFile.text, node); - } - } - NavigationBar.getNavigationBarItems = getNavigationBarItems; - })(NavigationBar = ts.NavigationBar || (ts.NavigationBar = {})); -})(ts || (ts = {})); -var TypeScript; -(function (TypeScript) { - var Services; - (function (Services) { - var Breakpoints; - (function (Breakpoints) { - function createBreakpointSpanInfo(parentElement) { - var childElements = []; - for (var _i = 1; _i < arguments.length; _i++) { - childElements[_i - 1] = arguments[_i]; - } - if (!parentElement) { - return null; - } - if (childElements.length == 0) { - return TypeScript.TextSpan.fromBounds(TypeScript.start(parentElement), TypeScript.end(parentElement)); - } - var start; - var end; - for (var i = 0; i < childElements.length; i++) { - var element = childElements[i]; - if (element && !TypeScript.isShared(element)) { - if (start == undefined) { - start = TypeScript.start(element); - } - end = TypeScript.end(element); - } - } - return TypeScript.TextSpan.fromBounds(start, end); - } - function createBreakpointSpanInfoWithLimChar(startElement, limChar) { - return TypeScript.TextSpan.fromBounds(TypeScript.start(startElement), limChar); - } - var BreakpointResolver = (function () { - function BreakpointResolver(posLine, lineMap) { - this.posLine = posLine; - this.lineMap = lineMap; - } - BreakpointResolver.prototype.breakpointSpanOfToken = function (positionedToken) { - switch (positionedToken.kind()) { - case 70 /* OpenBraceToken */: - return this.breakpointSpanOfOpenBrace(positionedToken); - case 71 /* CloseBraceToken */: - return this.breakpointSpanOfCloseBrace(positionedToken); - case 79 /* CommaToken */: - return this.breakpointSpanOfComma(positionedToken); - case 78 /* SemicolonToken */: - case 10 /* EndOfFileToken */: - return this.breakpointSpanIfStartsOnSameLine(TypeScript.previousToken(positionedToken)); - case 73 /* CloseParenToken */: - return this.breakpointSpanOfCloseParen(positionedToken); - case 22 /* DoKeyword */: - var parentElement = positionedToken.parent; - if (parentElement && parentElement.kind() == 162 /* DoStatement */) { - return this.breakpointSpanIfStartsOnSameLine(TypeScript.nextToken(positionedToken)); - } - break; - } - return this.breakpointSpanOfContainingNode(positionedToken); - }; - BreakpointResolver.prototype.breakpointSpanOfOpenBrace = function (openBraceToken) { - var container = TypeScript.Syntax.containingNode(openBraceToken); - if (container) { - var originalContainer = container; - if (container && container.kind() == 147 /* Block */) { - container = TypeScript.Syntax.containingNode(container); - if (!container) { - container = originalContainer; - } - } - switch (container.kind()) { - case 147 /* Block */: - if (!this.canHaveBreakpointInBlock(container)) { - return null; - } - return this.breakpointSpanOfFirstStatementInBlock(container); - break; - case 131 /* ModuleDeclaration */: - case 132 /* ClassDeclaration */: - case 130 /* FunctionDeclaration */: - case 138 /* ConstructorDeclaration */: - case 136 /* MemberFunctionDeclaration */: - case 140 /* GetAccessor */: - case 141 /* SetAccessor */: - case 223 /* FunctionExpression */: - case 219 /* ParenthesizedArrowFunctionExpression */: - case 220 /* SimpleArrowFunctionExpression */: - if (!this.canHaveBreakpointInDeclaration(container)) { - return null; - } - if (this.posLine != this.lineMap.getLineNumberFromPosition(TypeScript.start(container))) { - return this.breakpointSpanOfFirstChildOfSyntaxList(this.getSyntaxListOfDeclarationWithElements(container)); - } - else { - return this.breakpointSpanOf(container); - } - case 133 /* EnumDeclaration */: - if (!this.canHaveBreakpointInDeclaration(container)) { - return null; - } - if (this.posLine != this.lineMap.getLineNumberFromPosition(TypeScript.start(container))) { - return this.breakpointSpanOfFirstEnumElement(container); - } - else { - return this.breakpointSpanOf(container); - } - case 148 /* IfStatement */: - case 156 /* ForInStatement */: - case 159 /* WhileStatement */: - case 237 /* CatchClause */: - if (this.posLine != this.lineMap.getLineNumberFromPosition(TypeScript.start(container))) { - return this.breakpointSpanOfFirstStatementInBlock(originalContainer); - } - else { - return this.breakpointSpanOf(container); - } - case 162 /* DoStatement */: - return this.breakpointSpanOfFirstStatementInBlock(originalContainer); - case 155 /* ForStatement */: - if (this.posLine != this.lineMap.getLineNumberFromPosition(TypeScript.start(container))) { - return this.breakpointSpanOfFirstStatementInBlock(originalContainer); - } - else { - return this.breakpointSpanOf(TypeScript.previousToken(openBraceToken)); - } - case 236 /* ElseClause */: - case 234 /* CaseSwitchClause */: - case 235 /* DefaultSwitchClause */: - case 164 /* WithStatement */: - case 160 /* TryStatement */: - case 238 /* FinallyClause */: - return this.breakpointSpanOfFirstStatementInBlock(originalContainer); - case 152 /* SwitchStatement */: - if (this.posLine != this.lineMap.getLineNumberFromPosition(TypeScript.start(container))) { - return this.breakpointSpanOfFirstStatementOfFirstCaseClause(container); - } - else { - return this.breakpointSpanOf(container); - } - } - } - return null; - }; - BreakpointResolver.prototype.breakpointSpanOfCloseBrace = function (closeBraceToken) { - var container = TypeScript.Syntax.containingNode(closeBraceToken); - if (container) { - var originalContainer = container; - if (container.kind() == 147 /* Block */) { - container = TypeScript.Syntax.containingNode(container); - if (!container) { - container = originalContainer; - } - } - switch (container.kind()) { - case 147 /* Block */: - if (!this.canHaveBreakpointInBlock(container)) { - return null; - } - return this.breakpointSpanOfLastStatementInBlock(container); - break; - case 131 /* ModuleDeclaration */: - if (!this.canHaveBreakpointInDeclaration(container)) { - return null; - } - var moduleSyntax = container; - if (moduleSyntax.moduleElements && moduleSyntax.moduleElements.length > 0) { - return createBreakpointSpanInfo(closeBraceToken); - } - else { - return null; - } - case 132 /* ClassDeclaration */: - case 130 /* FunctionDeclaration */: - case 138 /* ConstructorDeclaration */: - case 136 /* MemberFunctionDeclaration */: - case 140 /* GetAccessor */: - case 141 /* SetAccessor */: - case 223 /* FunctionExpression */: - if (!this.canHaveBreakpointInDeclaration(container)) { - return null; - } - return createBreakpointSpanInfo(closeBraceToken); - case 133 /* EnumDeclaration */: - if (!this.canHaveBreakpointInDeclaration(container)) { - return null; - } - return createBreakpointSpanInfo(closeBraceToken); - case 148 /* IfStatement */: - case 236 /* ElseClause */: - case 156 /* ForInStatement */: - case 155 /* ForStatement */: - case 159 /* WhileStatement */: - case 162 /* DoStatement */: - case 234 /* CaseSwitchClause */: - case 235 /* DefaultSwitchClause */: - case 164 /* WithStatement */: - case 160 /* TryStatement */: - case 237 /* CatchClause */: - case 238 /* FinallyClause */: - case 219 /* ParenthesizedArrowFunctionExpression */: - case 220 /* SimpleArrowFunctionExpression */: - return this.breakpointSpanOfLastStatementInBlock(originalContainer); - case 152 /* SwitchStatement */: - return this.breakpointSpanOfLastStatementOfLastCaseClause(container); - } - } - return null; - }; - BreakpointResolver.prototype.breakpointSpanOfComma = function (commaToken) { - var commaParent = commaToken.parent; - if (TypeScript.isSeparatedList(commaParent)) { - var grandParent = commaParent.parent; - if (grandParent) { - switch (grandParent.kind()) { - case 225 /* VariableDeclaration */: - case 133 /* EnumDeclaration */: - case 228 /* ParameterList */: - var index = TypeScript.Syntax.childIndex(commaParent, commaToken); - if (index > 0) { - var child = TypeScript.childAt(commaParent, index - 1); - return this.breakpointSpanOf(child); - } - if (grandParent.kind() == 133 /* EnumDeclaration */) { - return null; - } - break; - } - } - } - return this.breakpointSpanOfContainingNode(commaToken); - }; - BreakpointResolver.prototype.breakpointSpanOfCloseParen = function (closeParenToken) { - var closeParenParent = closeParenToken.parent; - if (closeParenParent) { - switch (closeParenParent.kind()) { - case 155 /* ForStatement */: - case 228 /* ParameterList */: - return this.breakpointSpanOf(TypeScript.previousToken(closeParenToken)); - } - } - return this.breakpointSpanOfContainingNode(closeParenToken); - }; - BreakpointResolver.prototype.canHaveBreakpointInBlock = function (blockNode) { - if (!blockNode || TypeScript.SyntaxUtilities.isAmbientDeclarationSyntax(blockNode)) { - return false; - } - var blockSyntax = blockNode; - return blockSyntax.statements && blockSyntax.statements.length != 0; - }; - BreakpointResolver.prototype.breakpointSpanOfFirstStatementInBlock = function (blockNode) { - if (!blockNode) { - return null; - } - var blockSyntax = blockNode; - var statementsNode = blockSyntax.statements; - if (!statementsNode || statementsNode.length == 0) { - return null; - } - var firstStatement = TypeScript.childAt(statementsNode, 0); - if (firstStatement && firstStatement.kind() == 147 /* Block */) { - if (this.canHaveBreakpointInBlock(firstStatement)) { - return this.breakpointSpanOfFirstStatementInBlock(firstStatement); - } - return null; - } - else { - return this.breakpointSpanOf(firstStatement); - } - }; - BreakpointResolver.prototype.breakpointSpanOfLastStatementInBlock = function (blockNode) { - if (!blockNode) { - return null; - } - var blockSyntax = blockNode; - var statementsNode = blockSyntax.statements; - if (!statementsNode || statementsNode.length == 0) { - return null; - } - var lastStatement = TypeScript.childAt(statementsNode, statementsNode.length - 1); - if (lastStatement && lastStatement.kind() == 147 /* Block */) { - if (this.canHaveBreakpointInBlock(lastStatement)) { - return this.breakpointSpanOfLastStatementInBlock(lastStatement); - } - return null; - } - else { - return this.breakpointSpanOf(lastStatement); - } - }; - BreakpointResolver.prototype.breakpointSpanOfFirstChildOfSyntaxList = function (positionedList) { - if (!positionedList) { - return null; - } - var listSyntax = positionedList; - if (listSyntax.length == 0) { - return null; - } - var firstStatement = TypeScript.childAt(positionedList, 0); - if (firstStatement && firstStatement.kind() == 147 /* Block */) { - if (this.canHaveBreakpointInBlock(firstStatement)) { - return this.breakpointSpanOfFirstStatementInBlock(firstStatement); - } - return null; - } - else { - return this.breakpointSpanOf(firstStatement); - } - }; - BreakpointResolver.prototype.breakpointSpanOfLastChildOfSyntaxList = function (positionedList) { - if (!positionedList) { - return null; - } - var listSyntax = positionedList; - if (listSyntax.length == 0) { - return null; - } - var lastStatement = TypeScript.childAt(positionedList, 0); - if (lastStatement && lastStatement.kind() == 147 /* Block */) { - if (this.canHaveBreakpointInBlock(lastStatement)) { - return this.breakpointSpanOfLastStatementInBlock(lastStatement); - } - return null; - } - else { - return this.breakpointSpanOf(lastStatement); - } - }; - BreakpointResolver.prototype.breakpointSpanOfNode = function (positionedNode) { - var node = positionedNode; - switch (node.kind()) { - case 131 /* ModuleDeclaration */: - case 132 /* ClassDeclaration */: - case 130 /* FunctionDeclaration */: - case 138 /* ConstructorDeclaration */: - case 136 /* MemberFunctionDeclaration */: - case 140 /* GetAccessor */: - case 141 /* SetAccessor */: - case 223 /* FunctionExpression */: - return this.breakpointSpanOfDeclarationWithElements(positionedNode); - case 226 /* VariableDeclarator */: - return this.breakpointSpanOfVariableDeclarator(positionedNode); - case 225 /* VariableDeclaration */: - return this.breakpointSpanOfVariableDeclaration(positionedNode); - case 149 /* VariableStatement */: - return this.breakpointSpanOfVariableStatement(positionedNode); - case 243 /* Parameter */: - return this.breakpointSpanOfParameter(positionedNode); - case 137 /* MemberVariableDeclaration */: - return this.breakpointSpanOfMemberVariableDeclaration(positionedNode); - case 134 /* ImportDeclaration */: - return this.breakpointSpanOfImportDeclaration(positionedNode); - case 133 /* EnumDeclaration */: - return this.breakpointSpanOfEnumDeclaration(positionedNode); - case 244 /* EnumElement */: - return this.breakpointSpanOfEnumElement(positionedNode); - case 148 /* IfStatement */: - return this.breakpointSpanOfIfStatement(positionedNode); - case 236 /* ElseClause */: - return this.breakpointSpanOfElseClause(positionedNode); - case 156 /* ForInStatement */: - return this.breakpointSpanOfForInStatement(positionedNode); - case 155 /* ForStatement */: - return this.breakpointSpanOfForStatement(positionedNode); - case 159 /* WhileStatement */: - return this.breakpointSpanOfWhileStatement(positionedNode); - case 162 /* DoStatement */: - return this.breakpointSpanOfDoStatement(positionedNode); - case 152 /* SwitchStatement */: - return this.breakpointSpanOfSwitchStatement(positionedNode); - case 234 /* CaseSwitchClause */: - return this.breakpointSpanOfCaseSwitchClause(positionedNode); - case 235 /* DefaultSwitchClause */: - return this.breakpointSpanOfDefaultSwitchClause(positionedNode); - case 164 /* WithStatement */: - return this.breakpointSpanOfWithStatement(positionedNode); - case 160 /* TryStatement */: - return this.breakpointSpanOfTryStatement(positionedNode); - case 237 /* CatchClause */: - return this.breakpointSpanOfCatchClause(positionedNode); - case 238 /* FinallyClause */: - return this.breakpointSpanOfFinallyClause(positionedNode); - case 219 /* ParenthesizedArrowFunctionExpression */: - return this.breakpointSpanOfParenthesizedArrowFunctionExpression(positionedNode); - case 220 /* SimpleArrowFunctionExpression */: - return this.breakpointSpanOfSimpleArrowFunctionExpression(positionedNode); - default: - if (TypeScript.SyntaxUtilities.isStatement(node)) { - return this.breakpointSpanOfStatement(positionedNode); - } - else { - return this.breakpointOfExpression(positionedNode); - } - } - }; - BreakpointResolver.prototype.isExpressionOfArrowExpressions = function (expression) { - if (!expression) { - return false; - } - var expressionParent = expression.parent; - if (expressionParent) { - if (expressionParent.kind() == 219 /* ParenthesizedArrowFunctionExpression */) { - var parenthesizedArrowExpression = expressionParent; - var expressionOfParenthesizedArrowExpression = parenthesizedArrowExpression.expression; - return expressionOfParenthesizedArrowExpression == expression; - } - else if (expressionParent.kind() == 220 /* SimpleArrowFunctionExpression */) { - var simpleArrowExpression = expressionParent; - var expressionOfSimpleArrowExpression = simpleArrowExpression.expression; - return expressionOfSimpleArrowExpression == expression; - } - else if (expressionParent.kind() == 174 /* CommaExpression */) { - return this.isExpressionOfArrowExpressions(expressionParent); - } - } - return false; - }; - BreakpointResolver.prototype.isInitializerOfForStatement = function (expressionNode) { - if (!expressionNode) { - return false; - } - var expressionParent = expressionNode.parent; - if (expressionParent && expressionParent.kind() == 155 /* ForStatement */) { - var expression = expressionNode; - var forStatement = expressionParent; - var initializer = forStatement.initializer; - return initializer === expression; - } - else if (expressionParent && expressionParent.kind() == 174 /* CommaExpression */) { - return this.isInitializerOfForStatement(expressionParent); - } - return false; - }; - BreakpointResolver.prototype.isConditionOfForStatement = function (expressionNode) { - if (!expressionNode) { - return false; - } - var expressionParent = expressionNode.parent; - if (expressionParent && expressionParent.kind() == 155 /* ForStatement */) { - var expression = expressionNode; - var forStatement = expressionParent; - var condition = forStatement.condition; - return condition === expression; - } - else if (expressionParent && expressionParent.kind() == 174 /* CommaExpression */) { - return this.isConditionOfForStatement(expressionParent); - } - return false; - }; - BreakpointResolver.prototype.isIncrememtorOfForStatement = function (expressionNode) { - if (!expressionNode) { - return false; - } - var expressionParent = expressionNode.parent; - if (expressionParent && expressionParent.kind() == 155 /* ForStatement */) { - var expression = expressionNode; - var forStatement = expressionParent; - var incrementor = forStatement.incrementor; - return incrementor === expression; - } - else if (expressionParent && expressionParent.kind() == 174 /* CommaExpression */) { - return this.isIncrememtorOfForStatement(expressionParent); - } - return false; - }; - BreakpointResolver.prototype.breakpointOfLeftOfCommaExpression = function (commaExpressionNode) { - var commaExpression = commaExpressionNode; - return this.breakpointSpanOf(commaExpression.left); - }; - BreakpointResolver.prototype.breakpointOfExpression = function (expressionNode) { - if (this.isInitializerOfForStatement(expressionNode) || this.isConditionOfForStatement(expressionNode) || this.isIncrememtorOfForStatement(expressionNode)) { - if (expressionNode.kind() == 174 /* CommaExpression */) { - return this.breakpointOfLeftOfCommaExpression(expressionNode); - } - return createBreakpointSpanInfo(expressionNode); - } - if (this.isExpressionOfArrowExpressions(expressionNode)) { - if (expressionNode.kind() == 174 /* CommaExpression */) { - return this.breakpointOfLeftOfCommaExpression(expressionNode); - } - return createBreakpointSpanInfo(expressionNode); - } - if (expressionNode.kind() == 135 /* ExportAssignment */) { - var exportAssignmentSyntax = expressionNode; - return createBreakpointSpanInfo(expressionNode, exportAssignmentSyntax.exportKeyword, exportAssignmentSyntax.equalsToken, exportAssignmentSyntax.identifier); - } - return this.breakpointSpanOfContainingNode(expressionNode); - }; - BreakpointResolver.prototype.breakpointSpanOfStatement = function (statementNode) { - var statement = statementNode; - if (statement.kind() == 157 /* EmptyStatement */) { - return null; - } - var containingNode = TypeScript.Syntax.containingNode(statementNode); - if (TypeScript.SyntaxUtilities.isStatement(containingNode)) { - var useNodeForBreakpoint = false; - switch (containingNode.kind()) { - case 131 /* ModuleDeclaration */: - case 132 /* ClassDeclaration */: - case 130 /* FunctionDeclaration */: - case 138 /* ConstructorDeclaration */: - case 136 /* MemberFunctionDeclaration */: - case 140 /* GetAccessor */: - case 141 /* SetAccessor */: - case 147 /* Block */: - case 148 /* IfStatement */: - case 236 /* ElseClause */: - case 156 /* ForInStatement */: - case 155 /* ForStatement */: - case 159 /* WhileStatement */: - case 162 /* DoStatement */: - case 152 /* SwitchStatement */: - case 234 /* CaseSwitchClause */: - case 235 /* DefaultSwitchClause */: - case 164 /* WithStatement */: - case 160 /* TryStatement */: - case 237 /* CatchClause */: - case 238 /* FinallyClause */: - case 147 /* Block */: - useNodeForBreakpoint = true; - } - if (!useNodeForBreakpoint) { - return this.breakpointSpanOfContainingNode(statementNode); - } - } - switch (statement.kind()) { - case 150 /* ExpressionStatement */: - var expressionSyntax = statement; - return createBreakpointSpanInfo(expressionSyntax.expression); - case 151 /* ReturnStatement */: - var returnStatementSyntax = statement; - return createBreakpointSpanInfo(statementNode, returnStatementSyntax.returnKeyword, returnStatementSyntax.expression); - case 158 /* ThrowStatement */: - var throwStatementSyntax = statement; - return createBreakpointSpanInfo(statementNode, throwStatementSyntax.throwKeyword, throwStatementSyntax.expression); - case 153 /* BreakStatement */: - var breakStatementSyntax = statement; - return createBreakpointSpanInfo(statementNode, breakStatementSyntax.breakKeyword, breakStatementSyntax.identifier); - case 154 /* ContinueStatement */: - var continueStatementSyntax = statement; - return createBreakpointSpanInfo(statementNode, continueStatementSyntax.continueKeyword, continueStatementSyntax.identifier); - case 163 /* DebuggerStatement */: - var debuggerStatementSyntax = statement; - return createBreakpointSpanInfo(debuggerStatementSyntax.debuggerKeyword); - case 161 /* LabeledStatement */: - var labeledStatementSyntax = statement; - return this.breakpointSpanOf(labeledStatementSyntax.statement); - } - return null; - }; - BreakpointResolver.prototype.getSyntaxListOfDeclarationWithElements = function (positionedNode) { - var node = positionedNode; - var elementsList; - var block; - switch (node.kind()) { - case 131 /* ModuleDeclaration */: - elementsList = node.moduleElements; - break; - case 132 /* ClassDeclaration */: - elementsList = node.classElements; - break; - case 130 /* FunctionDeclaration */: - block = node.block; - break; - case 138 /* ConstructorDeclaration */: - block = node.block; - break; - case 136 /* MemberFunctionDeclaration */: - block = node.block; - break; - case 140 /* GetAccessor */: - block = node.block; - break; - case 141 /* SetAccessor */: - block = node.block; - break; - case 223 /* FunctionExpression */: - block = node.block; - break; - case 219 /* ParenthesizedArrowFunctionExpression */: - block = node.block; - break; - case 220 /* SimpleArrowFunctionExpression */: - block = node.block; - break; - default: - throw TypeScript.Errors.argument('positionNode', 'unknown node kind in getSyntaxListOfDeclarationWithElements'); - } - var parentElement = positionedNode; - if (block) { - parentElement = block; - elementsList = block.statements; - } - return elementsList; - }; - BreakpointResolver.prototype.canHaveBreakpointInDeclaration = function (positionedNode) { - return positionedNode && !TypeScript.SyntaxUtilities.isAmbientDeclarationSyntax(positionedNode); - }; - BreakpointResolver.prototype.breakpointSpanOfDeclarationWithElements = function (positionedNode) { - if (!this.canHaveBreakpointInDeclaration(positionedNode)) { - return null; - } - var node = positionedNode; - var moduleSyntax = positionedNode; - if ((TypeScript.SyntaxUtilities.isModuleElement(node) && TypeScript.Syntax.containingNode(positionedNode).kind() != 120 /* SourceUnit */) || TypeScript.SyntaxUtilities.isClassElement(node) || (moduleSyntax.kind() == 131 /* ModuleDeclaration */ && moduleSyntax.name && moduleSyntax.name.kind() == 121 /* QualifiedName */)) { - return createBreakpointSpanInfo(positionedNode); - } - else { - return this.breakpointSpanOfFirstChildOfSyntaxList(this.getSyntaxListOfDeclarationWithElements(positionedNode)); - } - }; - BreakpointResolver.prototype.canHaveBreakpointInVariableDeclarator = function (varDeclaratorNode) { - if (!varDeclaratorNode || TypeScript.SyntaxUtilities.isAmbientDeclarationSyntax(varDeclaratorNode)) { - return false; - } - var varDeclaratorSyntax = varDeclaratorNode; - return !!varDeclaratorSyntax.equalsValueClause; - }; - BreakpointResolver.prototype.breakpointSpanOfVariableDeclarator = function (varDeclaratorNode) { - if (!this.canHaveBreakpointInVariableDeclarator(varDeclaratorNode)) { - return null; - } - var container = TypeScript.Syntax.containingNode(varDeclaratorNode); - if (container && container.kind() == 225 /* VariableDeclaration */) { - var parentDeclaratorsList = varDeclaratorNode.parent; - if (parentDeclaratorsList && TypeScript.childAt(parentDeclaratorsList, 0) == varDeclaratorNode) { - return this.breakpointSpanOfVariableDeclaration(container); - } - if (this.canHaveBreakpointInVariableDeclarator(varDeclaratorNode)) { - return createBreakpointSpanInfo(varDeclaratorNode); - } - else { - return null; - } - } - else if (container) { - return this.breakpointSpanOfMemberVariableDeclaration(container); - } - return null; - }; - BreakpointResolver.prototype.canHaveBreakpointInVariableDeclaration = function (varDeclarationNode) { - if (!varDeclarationNode || TypeScript.SyntaxUtilities.isAmbientDeclarationSyntax(varDeclarationNode)) { - return false; - } - var varDeclarationSyntax = varDeclarationNode; - var containerChildren = varDeclarationSyntax.variableDeclarators; - if (!containerChildren || TypeScript.childCount(containerChildren) == 0) { - return false; - } - var child = TypeScript.childAt(containerChildren, 0); - if (TypeScript.isNode(child)) { - return this.canHaveBreakpointInVariableDeclarator(child); - } - return false; - }; - BreakpointResolver.prototype.breakpointSpanOfVariableDeclaration = function (varDeclarationNode) { - if (!this.canHaveBreakpointInDeclaration(varDeclarationNode)) { - return null; - } - var container = TypeScript.Syntax.containingNode(varDeclarationNode); - var varDeclarationSyntax = varDeclarationNode; - var varDeclarators = varDeclarationSyntax.variableDeclarators; - if (container && container.kind() == 149 /* VariableStatement */) { - return this.breakpointSpanOfVariableStatement(container); - } - if (this.canHaveBreakpointInVariableDeclaration(varDeclarationNode)) { - return createBreakpointSpanInfoWithLimChar(varDeclarationNode, TypeScript.end(TypeScript.childAt(varDeclarators, 0))); - } - else { - return null; - } - }; - BreakpointResolver.prototype.canHaveBreakpointInVariableStatement = function (varStatementNode) { - if (!varStatementNode || TypeScript.SyntaxUtilities.isAmbientDeclarationSyntax(varStatementNode)) { - return false; - } - var variableStatement = varStatementNode; - return this.canHaveBreakpointInVariableDeclaration(variableStatement.variableDeclaration); - }; - BreakpointResolver.prototype.breakpointSpanOfVariableStatement = function (varStatementNode) { - if (!this.canHaveBreakpointInVariableStatement(varStatementNode)) { - return null; - } - var variableStatement = varStatementNode; - var variableDeclaration = variableStatement.variableDeclaration; - var varDeclarationSyntax = variableDeclaration; - var varDeclarators = varDeclarationSyntax.variableDeclarators; - return createBreakpointSpanInfoWithLimChar(varStatementNode, TypeScript.end(TypeScript.childAt(varDeclarators, 0))); - }; - BreakpointResolver.prototype.breakpointSpanOfParameter = function (parameterNode) { - if (parameterNode.parent.kind() === 220 /* SimpleArrowFunctionExpression */) { - return this.breakpointSpanOfNode(parameterNode.parent); - } - if (TypeScript.SyntaxUtilities.isAmbientDeclarationSyntax(parameterNode)) { - return null; - } - var parameterSyntax = parameterNode; - if (parameterSyntax.dotDotDotToken || parameterSyntax.equalsValueClause || parameterSyntax.modifiers.length > 0) { - return createBreakpointSpanInfo(parameterNode); - } - else { - return null; - } - }; - BreakpointResolver.prototype.breakpointSpanOfMemberVariableDeclaration = function (memberVarDeclarationNode) { - if (TypeScript.SyntaxUtilities.isAmbientDeclarationSyntax(memberVarDeclarationNode)) { - return null; - } - var memberVariableDeclaration = memberVarDeclarationNode; - if (this.canHaveBreakpointInVariableDeclarator(memberVariableDeclaration.variableDeclarator)) { - return createBreakpointSpanInfo(memberVarDeclarationNode, memberVariableDeclaration.modifiers, memberVariableDeclaration.variableDeclarator); - } - else { - return null; - } - }; - BreakpointResolver.prototype.breakpointSpanOfImportDeclaration = function (importDeclarationNode) { - if (TypeScript.SyntaxUtilities.isAmbientDeclarationSyntax(importDeclarationNode)) { - return null; - } - var importSyntax = importDeclarationNode; - return createBreakpointSpanInfo(importDeclarationNode, importSyntax.modifiers, importSyntax.importKeyword, importSyntax.identifier, importSyntax.equalsToken, importSyntax.moduleReference); - }; - BreakpointResolver.prototype.breakpointSpanOfEnumDeclaration = function (enumDeclarationNode) { - if (!this.canHaveBreakpointInDeclaration(enumDeclarationNode)) { - return null; - } - return createBreakpointSpanInfo(enumDeclarationNode); - }; - BreakpointResolver.prototype.breakpointSpanOfFirstEnumElement = function (enumDeclarationNode) { - var enumDeclarationSyntax = enumDeclarationNode; - var enumElements = enumDeclarationSyntax.enumElements; - if (enumElements && TypeScript.childCount(enumElements)) { - return this.breakpointSpanOf(TypeScript.childAt(enumElements, 0)); - } - return null; - }; - BreakpointResolver.prototype.breakpointSpanOfEnumElement = function (enumElementNode) { - if (TypeScript.SyntaxUtilities.isAmbientDeclarationSyntax(enumElementNode)) { - return null; - } - return createBreakpointSpanInfo(enumElementNode); - }; - BreakpointResolver.prototype.breakpointSpanOfIfStatement = function (ifStatementNode) { - var ifStatement = ifStatementNode; - return createBreakpointSpanInfo(ifStatementNode, ifStatement.ifKeyword, ifStatement.openParenToken, ifStatement.condition, ifStatement.closeParenToken); - }; - BreakpointResolver.prototype.breakpointSpanOfElseClause = function (elseClauseNode) { - var elseClause = elseClauseNode; - return this.breakpointSpanOf(elseClause.statement); - }; - BreakpointResolver.prototype.breakpointSpanOfForInStatement = function (forInStatementNode) { - var forInStatement = forInStatementNode; - return createBreakpointSpanInfo(forInStatementNode, forInStatement.forKeyword, forInStatement.openParenToken, forInStatement.variableDeclaration, forInStatement.left, forInStatement.inKeyword, forInStatement.expression, forInStatement.closeParenToken); - }; - BreakpointResolver.prototype.breakpointSpanOfForStatement = function (forStatementNode) { - var forStatement = forStatementNode; - return this.breakpointSpanOf(forStatement.variableDeclaration ? forStatement.variableDeclaration : forStatement.initializer); - }; - BreakpointResolver.prototype.breakpointSpanOfWhileStatement = function (whileStatementNode) { - var whileStatement = whileStatementNode; - return createBreakpointSpanInfo(whileStatementNode, whileStatement.whileKeyword, whileStatement.openParenToken, whileStatement.condition, whileStatement.closeParenToken); - }; - BreakpointResolver.prototype.breakpointSpanOfDoStatement = function (doStatementNode) { - var doStatement = doStatementNode; - return createBreakpointSpanInfo(doStatementNode, doStatement.whileKeyword, doStatement.openParenToken, doStatement.condition, doStatement.closeParenToken); - }; - BreakpointResolver.prototype.breakpointSpanOfSwitchStatement = function (switchStatementNode) { - var switchStatement = switchStatementNode; - return createBreakpointSpanInfo(switchStatementNode, switchStatement.switchKeyword, switchStatement.openParenToken, switchStatement.expression, switchStatement.closeParenToken); - }; - BreakpointResolver.prototype.breakpointSpanOfFirstStatementOfFirstCaseClause = function (switchStatementNode) { - var switchStatement = switchStatementNode; - if (switchStatement.switchClauses && switchStatement.switchClauses.length == 0) { - return null; - } - var switchClauses = switchStatement.switchClauses; - if (switchClauses.length == 0) { - return null; - } - var firstCaseClause = switchClauses[0]; - var statements = firstCaseClause.statements; - return this.breakpointSpanOfFirstChildOfSyntaxList(statements); - }; - BreakpointResolver.prototype.breakpointSpanOfLastStatementOfLastCaseClause = function (switchStatementNode) { - var switchStatement = switchStatementNode; - if (switchStatement.switchClauses && switchStatement.switchClauses.length == 0) { - return null; - } - var switchClauses = switchStatement.switchClauses; - if (switchClauses.length == 0) { - return null; - } - var lastClauseNode = switchClauses[switchClauses.length - 1]; - var statements = lastClauseNode.statements; - return this.breakpointSpanOfLastChildOfSyntaxList(statements); - }; - BreakpointResolver.prototype.breakpointSpanOfCaseSwitchClause = function (caseClauseNode) { - var caseSwitchClause = caseClauseNode; - return this.breakpointSpanOfFirstChildOfSyntaxList(caseSwitchClause.statements); - }; - BreakpointResolver.prototype.breakpointSpanOfDefaultSwitchClause = function (defaultSwithClauseNode) { - var defaultSwitchClause = defaultSwithClauseNode; - return this.breakpointSpanOfFirstChildOfSyntaxList(defaultSwitchClause.statements); - }; - BreakpointResolver.prototype.breakpointSpanOfWithStatement = function (withStatementNode) { - var withStatement = withStatementNode; - return this.breakpointSpanOf(withStatement.statement); - }; - BreakpointResolver.prototype.breakpointSpanOfTryStatement = function (tryStatementNode) { - var tryStatement = tryStatementNode; - return this.breakpointSpanOfFirstStatementInBlock(tryStatement.block); - }; - BreakpointResolver.prototype.breakpointSpanOfCatchClause = function (catchClauseNode) { - var catchClause = catchClauseNode; - return createBreakpointSpanInfo(catchClauseNode, catchClause.catchKeyword, catchClause.openParenToken, catchClause.identifier, catchClause.typeAnnotation, catchClause.closeParenToken); - }; - BreakpointResolver.prototype.breakpointSpanOfFinallyClause = function (finallyClauseNode) { - var finallyClause = finallyClauseNode; - return this.breakpointSpanOfFirstStatementInBlock(finallyClause.block); - }; - BreakpointResolver.prototype.breakpointSpanOfParenthesizedArrowFunctionExpression = function (arrowFunctionExpression) { - if (arrowFunctionExpression.block) { - return this.breakpointSpanOfFirstStatementInBlock(arrowFunctionExpression.block); - } - else { - return this.breakpointSpanOf(arrowFunctionExpression.expression); - } - }; - BreakpointResolver.prototype.breakpointSpanOfSimpleArrowFunctionExpression = function (arrowFunctionExpression) { - if (arrowFunctionExpression.block) { - return this.breakpointSpanOfFirstStatementInBlock(arrowFunctionExpression.block); - } - else { - return this.breakpointSpanOf(arrowFunctionExpression.expression); - } - }; - BreakpointResolver.prototype.breakpointSpanOfContainingNode = function (positionedElement) { - var current = positionedElement.parent; - while (!TypeScript.isNode(current)) { - current = current.parent; - } - return this.breakpointSpanOf(current); - }; - BreakpointResolver.prototype.breakpointSpanIfStartsOnSameLine = function (positionedElement) { - if (positionedElement && this.posLine == this.lineMap.getLineNumberFromPosition(TypeScript.start(positionedElement))) { - return this.breakpointSpanOf(positionedElement); - } - return null; - }; - BreakpointResolver.prototype.breakpointSpanOf = function (positionedElement) { - if (!positionedElement) { - return null; - } - for (var containingNode = TypeScript.Syntax.containingNode(positionedElement); containingNode != null; containingNode = TypeScript.Syntax.containingNode(containingNode)) { - if (containingNode.kind() == 245 /* TypeAnnotation */) { - return this.breakpointSpanIfStartsOnSameLine(containingNode); - } - } - var element = positionedElement; - if (TypeScript.isNode(element)) { - return this.breakpointSpanOfNode(positionedElement); - } - if (TypeScript.isToken(element)) { - return this.breakpointSpanOfToken(positionedElement); - } - return this.breakpointSpanOfContainingNode(positionedElement); - }; - return BreakpointResolver; - })(); - function getBreakpointLocation(syntaxTree, askedPos) { - if (TypeScript.isDTSFile(syntaxTree.fileName())) { - return null; - } - var sourceUnit = syntaxTree.sourceUnit(); - var positionedToken = TypeScript.findToken(sourceUnit, askedPos); - var lineMap = syntaxTree.lineMap(); - var posLine = lineMap.getLineNumberFromPosition(askedPos); - var tokenStartLine = lineMap.getLineNumberFromPosition(TypeScript.start(positionedToken)); - if (posLine < tokenStartLine) { - return null; - } - var breakpointResolver = new BreakpointResolver(posLine, lineMap); - return breakpointResolver.breakpointSpanOf(positionedToken); - } - Breakpoints.getBreakpointLocation = getBreakpointLocation; - })(Breakpoints = Services.Breakpoints || (Services.Breakpoints = {})); - })(Services = TypeScript.Services || (TypeScript.Services = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Indentation; - (function (Indentation) { - function columnForEndOfTokenAtPosition(syntaxTree, position, options) { - var token = TypeScript.findToken(syntaxTree.sourceUnit(), position); - return columnForStartOfTokenAtPosition(syntaxTree, position, options) + TypeScript.width(token); - } - Indentation.columnForEndOfTokenAtPosition = columnForEndOfTokenAtPosition; - function columnForStartOfTokenAtPosition(syntaxTree, position, options) { - var token = TypeScript.findToken(syntaxTree.sourceUnit(), position); - var firstTokenInLine = TypeScript.Syntax.firstTokenInLineContainingPosition(syntaxTree, token.fullStart()); - var leadingTextInReverse = []; - var current = token; - while (current !== firstTokenInLine) { - current = TypeScript.previousToken(current); - if (current === firstTokenInLine) { - leadingTextInReverse.push(current.trailingTrivia().fullText()); - leadingTextInReverse.push(current.text()); - } - else { - leadingTextInReverse.push(current.fullText()); - } - } - collectLeadingTriviaTextToStartOfLine(firstTokenInLine, leadingTextInReverse); - return columnForLeadingTextInReverse(leadingTextInReverse, options); - } - Indentation.columnForStartOfTokenAtPosition = columnForStartOfTokenAtPosition; - function columnForStartOfFirstTokenInLineContainingPosition(syntaxTree, position, options) { - var firstTokenInLine = TypeScript.Syntax.firstTokenInLineContainingPosition(syntaxTree, position); - var leadingTextInReverse = []; - collectLeadingTriviaTextToStartOfLine(firstTokenInLine, leadingTextInReverse); - return columnForLeadingTextInReverse(leadingTextInReverse, options); - } - Indentation.columnForStartOfFirstTokenInLineContainingPosition = columnForStartOfFirstTokenInLineContainingPosition; - function collectLeadingTriviaTextToStartOfLine(firstTokenInLine, leadingTextInReverse) { - var leadingTrivia = firstTokenInLine.leadingTrivia(); - for (var i = leadingTrivia.count() - 1; i >= 0; i--) { - var trivia = leadingTrivia.syntaxTriviaAt(i); - if (trivia.kind() === 5 /* NewLineTrivia */) { - break; - } - if (trivia.kind() === 6 /* MultiLineCommentTrivia */) { - var lineSegments = TypeScript.Syntax.splitMultiLineCommentTriviaIntoMultipleLines(trivia); - leadingTextInReverse.push(TypeScript.ArrayUtilities.last(lineSegments)); - if (lineSegments.length > 0) { - break; - } - } - leadingTextInReverse.push(trivia.fullText()); - } - } - function columnForLeadingTextInReverse(leadingTextInReverse, options) { - var column = 0; - for (var i = leadingTextInReverse.length - 1; i >= 0; i--) { - var text = leadingTextInReverse[i]; - column = columnForPositionInStringWorker(text, text.length, column, options); - } - return column; - } - function columnForPositionInString(input, position, options) { - return columnForPositionInStringWorker(input, position, 0, options); - } - Indentation.columnForPositionInString = columnForPositionInString; - function columnForPositionInStringWorker(input, position, startColumn, options) { - var column = startColumn; - var spacesPerTab = options.spacesPerTab; - for (var j = 0; j < position; j++) { - var ch = input.charCodeAt(j); - if (ch === 9 /* tab */) { - column += spacesPerTab - column % spacesPerTab; - } - else { - column++; - } - } - return column; - } - function indentationString(column, options) { - var numberOfTabs = 0; - var numberOfSpaces = Math.max(0, column); - if (options.useTabs) { - numberOfTabs = Math.floor(column / options.spacesPerTab); - numberOfSpaces -= numberOfTabs * options.spacesPerTab; - } - return TypeScript.StringUtilities.repeat('\t', numberOfTabs) + TypeScript.StringUtilities.repeat(' ', numberOfSpaces); - } - Indentation.indentationString = indentationString; - function firstNonWhitespacePosition(value) { - for (var i = 0; i < value.length; i++) { - var ch = value.charCodeAt(i); - if (!TypeScript.CharacterInfo.isWhitespace(ch)) { - return i; - } - } - return value.length; - } - Indentation.firstNonWhitespacePosition = firstNonWhitespacePosition; - })(Indentation = TypeScript.Indentation || (TypeScript.Indentation = {})); -})(TypeScript || (TypeScript = {})); -var ts; -(function (ts) { - var SignatureHelp; - (function (SignatureHelp) { - var emptyArray = []; - function getSignatureHelpItems(sourceFile, position, typeInfoResolver, cancellationToken) { - var startingToken = ts.findTokenOnLeftOfPosition(sourceFile, position); - if (!startingToken) { - return undefined; - } - var argumentInfo = getContainingArgumentInfo(startingToken); - cancellationToken.throwIfCancellationRequested(); - if (!argumentInfo) { - return undefined; - } - var call = argumentInfo.list.parent; - var candidates = []; - var resolvedSignature = typeInfoResolver.getResolvedSignature(call, candidates); - cancellationToken.throwIfCancellationRequested(); - if (!candidates.length) { - return undefined; - } - return createSignatureHelpItems(candidates, resolvedSignature, argumentInfo); - function getImmediatelyContainingArgumentInfo(node) { - if (node.parent.kind !== 137 /* CallExpression */ && node.parent.kind !== 138 /* NewExpression */) { - return undefined; - } - var parent = node.parent; - if (node.kind === 19 /* LessThanToken */ || node.kind === 11 /* OpenParenToken */) { - var list = getChildListThatStartsWithOpenerToken(parent, node, sourceFile); - ts.Debug.assert(list); - return { - list: list, - listItemIndex: 0 - }; - } - return ts.findListItemInfo(node); - } - function getContainingArgumentInfo(node) { - for (var n = node; n.kind !== 182 /* SourceFile */; n = n.parent) { - if (n.kind === 173 /* FunctionBlock */) { - return undefined; - } - if (n.pos < n.parent.pos || n.end > n.parent.end) { - ts.Debug.fail("Node of kind " + ts.SyntaxKind[n.kind] + " is not a subspan of its parent of kind " + ts.SyntaxKind[n.parent.kind]); - } - var argumentInfo = getImmediatelyContainingArgumentInfo(n); - if (argumentInfo) { - return argumentInfo; - } - } - return undefined; - } - function selectBestInvalidOverloadIndex(candidates, argumentCount) { - var maxParamsSignatureIndex = -1; - var maxParams = -1; - for (var i = 0; i < candidates.length; i++) { - var candidate = candidates[i]; - if (candidate.hasRestParameter || candidate.parameters.length >= argumentCount) { - return i; - } - if (candidate.parameters.length > maxParams) { - maxParams = candidate.parameters.length; - maxParamsSignatureIndex = i; - } - } - return maxParamsSignatureIndex; - } - function createSignatureHelpItems(candidates, bestSignature, argumentInfoOrTypeArgumentInfo) { - var argumentListOrTypeArgumentList = argumentInfoOrTypeArgumentInfo.list; - var items = ts.map(candidates, function (candidateSignature) { - var parameters = candidateSignature.parameters; - var parameterHelpItems = parameters.length === 0 ? emptyArray : ts.map(parameters, function (p) { - var displayParts = []; - if (candidateSignature.hasRestParameter && parameters[parameters.length - 1] === p) { - displayParts.push(ts.punctuationPart(16 /* DotDotDotToken */)); - } - displayParts.push(ts.symbolPart(p.name, p)); - var isOptional = !!(p.valueDeclaration.flags & 4 /* QuestionMark */); - if (isOptional) { - displayParts.push(ts.punctuationPart(45 /* QuestionToken */)); - } - displayParts.push(ts.punctuationPart(46 /* ColonToken */)); - displayParts.push(ts.spacePart()); - var typeParts = ts.typeToDisplayParts(typeInfoResolver, typeInfoResolver.getTypeOfSymbol(p), argumentListOrTypeArgumentList); - displayParts.push.apply(displayParts, typeParts); - return { - name: p.name, - documentation: p.getDocumentationComment(), - displayParts: displayParts, - isOptional: isOptional - }; - }); - var callTargetNode = argumentListOrTypeArgumentList.parent.func; - var callTargetSymbol = typeInfoResolver.getSymbolInfo(callTargetNode); - var prefixParts = callTargetSymbol ? ts.symbolToDisplayParts(typeInfoResolver, callTargetSymbol, undefined, undefined) : []; - var separatorParts = [ts.punctuationPart(18 /* CommaToken */), ts.spacePart()]; - if (candidateSignature.typeParameters && candidateSignature.typeParameters.length) { - prefixParts.push(ts.punctuationPart(19 /* LessThanToken */)); - for (var i = 0, n = candidateSignature.typeParameters.length; i < n; i++) { - if (i) { - prefixParts.push.apply(prefixParts, separatorParts); - } - var tp = candidateSignature.typeParameters[i].symbol; - prefixParts.push(ts.symbolPart(tp.name, tp)); - } - prefixParts.push(ts.punctuationPart(20 /* GreaterThanToken */)); - } - prefixParts.push(ts.punctuationPart(11 /* OpenParenToken */)); - var suffixParts = [ts.punctuationPart(12 /* CloseParenToken */)]; - suffixParts.push(ts.punctuationPart(46 /* ColonToken */)); - suffixParts.push(ts.spacePart()); - var typeParts = ts.typeToDisplayParts(typeInfoResolver, candidateSignature.getReturnType(), argumentListOrTypeArgumentList); - suffixParts.push.apply(suffixParts, typeParts); - return { - isVariadic: candidateSignature.hasRestParameter, - prefixDisplayParts: prefixParts, - suffixDisplayParts: suffixParts, - separatorDisplayParts: separatorParts, - parameters: parameterHelpItems, - documentation: candidateSignature.getDocumentationComment() - }; - }); - var applicableSpanStart = argumentListOrTypeArgumentList.getFullStart(); - var applicableSpanEnd = ts.skipTrivia(sourceFile.text, argumentListOrTypeArgumentList.end, false); - var applicableSpan = new TypeScript.TextSpan(applicableSpanStart, applicableSpanEnd - applicableSpanStart); - var argumentIndex = (argumentInfoOrTypeArgumentInfo.listItemIndex + 1) >> 1; - var argumentCount = argumentListOrTypeArgumentList.getChildCount() === 0 ? 0 : 1 + ts.countWhere(argumentListOrTypeArgumentList.getChildren(), function (arg) { return arg.kind === 18 /* CommaToken */; }); - var selectedItemIndex = candidates.indexOf(bestSignature); - if (selectedItemIndex < 0) { - selectedItemIndex = selectBestInvalidOverloadIndex(candidates, argumentCount); - } - return { - items: items, - applicableSpan: applicableSpan, - selectedItemIndex: selectedItemIndex, - argumentIndex: argumentIndex, - argumentCount: argumentCount - }; - } - } - SignatureHelp.getSignatureHelpItems = getSignatureHelpItems; - function getChildListThatStartsWithOpenerToken(parent, openerToken, sourceFile) { - var children = parent.getChildren(sourceFile); - var indexOfOpenerToken = children.indexOf(openerToken); - return children[indexOfOpenerToken + 1]; - } - })(SignatureHelp = ts.SignatureHelp || (ts.SignatureHelp = {})); -})(ts || (ts = {})); -var ts; -(function (ts) { - function findListItemInfo(node) { - var syntaxList = findContainingList(node); - if (!syntaxList) { - return undefined; - } - var children = syntaxList.getChildren(); - var index = ts.indexOf(children, node); - return { - listItemIndex: index, - list: syntaxList - }; - } - ts.findListItemInfo = findListItemInfo; - function findChildOfKind(n, kind, sourceFile) { - return ts.forEach(n.getChildren(sourceFile), function (c) { return c.kind === kind && c; }); - } - ts.findChildOfKind = findChildOfKind; - function findContainingList(node) { - var syntaxList = ts.forEach(node.parent.getChildren(), function (c) { - if (c.kind === 184 /* SyntaxList */ && c.pos <= node.pos && c.end >= node.end) { - return c; - } - }); - return syntaxList; - } - ts.findContainingList = findContainingList; - function findListItemIndexContainingPosition(list, position) { - ts.Debug.assert(list.kind === 184 /* SyntaxList */); - var children = list.getChildren(); - for (var i = 0; i < children.length; i++) { - if (children[i].pos <= position && children[i].end > position) { - return i; - } - } - return -1; - } - ts.findListItemIndexContainingPosition = findListItemIndexContainingPosition; - function getTouchingWord(sourceFile, position) { - return getTouchingToken(sourceFile, position, isWord); - } - ts.getTouchingWord = getTouchingWord; - function getTouchingPropertyName(sourceFile, position) { - return getTouchingToken(sourceFile, position, isPropertyName); - } - ts.getTouchingPropertyName = getTouchingPropertyName; - function getTouchingToken(sourceFile, position, includeItemAtEndPosition) { - return getTokenAtPositionWorker(sourceFile, position, false, includeItemAtEndPosition); - } - ts.getTouchingToken = getTouchingToken; - function getTokenAtPosition(sourceFile, position) { - return getTokenAtPositionWorker(sourceFile, position, true, undefined); - } - ts.getTokenAtPosition = getTokenAtPosition; - function getTokenAtPositionWorker(sourceFile, position, allowPositionInLeadingTrivia, includeItemAtEndPosition) { - var current = sourceFile; - outer: while (true) { - if (isToken(current)) { - return current; - } - for (var i = 0, n = current.getChildCount(sourceFile); i < n; i++) { - var child = current.getChildAt(i); - var start = allowPositionInLeadingTrivia ? child.getFullStart() : child.getStart(sourceFile); - if (start <= position) { - if (position < child.getEnd()) { - current = child; - continue outer; - } - else if (includeItemAtEndPosition && child.getEnd() === position) { - var previousToken = findPrecedingToken(position, sourceFile, child); - if (previousToken && includeItemAtEndPosition(previousToken)) { - return previousToken; - } - } - } - } - return current; - } - } - function findTokenOnLeftOfPosition(file, position) { - var tokenAtPosition = getTokenAtPosition(file, position); - if (isToken(tokenAtPosition) && position > tokenAtPosition.getStart(file) && position < tokenAtPosition.getEnd()) { - return tokenAtPosition; - } - return findPrecedingToken(position, file); - } - ts.findTokenOnLeftOfPosition = findTokenOnLeftOfPosition; - function findNextToken(previousToken, parent) { - return find(parent); - function find(n) { - if (isToken(n) && n.pos === previousToken.end) { - return n; - } - var children = n.getChildren(); - for (var i = 0, len = children.length; i < len; ++i) { - var child = children[i]; - var shouldDiveInChildNode = (child.pos <= previousToken.pos && child.end > previousToken.end) || (child.pos === previousToken.end); - if (shouldDiveInChildNode && nodeHasTokens(child)) { - return find(child); - } - } - return undefined; - } - } - ts.findNextToken = findNextToken; - function findPrecedingToken(position, sourceFile, startNode) { - return find(startNode || sourceFile); - function findRightmostToken(n) { - if (isToken(n)) { - return n; - } - var children = n.getChildren(); - var candidate = findRightmostChildNodeWithTokens(children, children.length); - return candidate && findRightmostToken(candidate); - } - function find(n) { - if (isToken(n)) { - return n; - } - var children = n.getChildren(); - for (var i = 0, len = children.length; i < len; ++i) { - var child = children[i]; - if (nodeHasTokens(child)) { - if (position < child.end) { - if (child.getStart(sourceFile) >= position) { - var candidate = findRightmostChildNodeWithTokens(children, i); - return candidate && findRightmostToken(candidate); - } - else { - return find(child); - } - } - } - } - ts.Debug.assert(startNode || n.kind === 182 /* SourceFile */); - if (children.length) { - var candidate = findRightmostChildNodeWithTokens(children, children.length); - return candidate && findRightmostToken(candidate); - } - } - function findRightmostChildNodeWithTokens(children, exclusiveStartPosition) { - for (var i = exclusiveStartPosition - 1; i >= 0; --i) { - if (nodeHasTokens(children[i])) { - return children[i]; - } - } - } - } - ts.findPrecedingToken = findPrecedingToken; - function nodeHasTokens(n) { - if (n.kind === 151 /* ExpressionStatement */) { - return nodeHasTokens(n.expression); - } - if (n.kind === 1 /* EndOfFileToken */ || n.kind === 147 /* OmittedExpression */ || n.kind === 115 /* Missing */) { - return false; - } - return n.kind !== 184 /* SyntaxList */ || n.getChildCount() !== 0; - } - function isToken(n) { - return n.kind >= ts.SyntaxKind.FirstToken && n.kind <= ts.SyntaxKind.LastToken; - } - ts.isToken = isToken; - function isKeyword(n) { - return n.kind >= ts.SyntaxKind.FirstKeyword && n.kind <= ts.SyntaxKind.LastKeyword; - } - function isWord(n) { - return n.kind === 59 /* Identifier */ || isKeyword(n); - } - function isPropertyName(n) { - return n.kind === 7 /* StringLiteral */ || n.kind === 6 /* NumericLiteral */ || isWord(n); - } -})(ts || (ts = {})); -var TypeScript; -(function (TypeScript) { - var Services; - (function (Services) { - var Formatting; - (function (Formatting) { - var TextSnapshot = (function () { - function TextSnapshot(snapshot) { - this.snapshot = snapshot; - this.lines = []; - } - TextSnapshot.prototype.getLength = function () { - return this.snapshot.length(); - }; - TextSnapshot.prototype.getText = function (span) { - return this.snapshot.substr(span.start(), span.length()); - }; - TextSnapshot.prototype.getLineNumberFromPosition = function (position) { - return this.snapshot.lineMap().getLineNumberFromPosition(position); - }; - TextSnapshot.prototype.getLineFromPosition = function (position) { - var lineNumber = this.getLineNumberFromPosition(position); - return this.getLineFromLineNumber(lineNumber); - }; - TextSnapshot.prototype.getLineFromLineNumber = function (lineNumber) { - var line = this.lines[lineNumber]; - if (line === undefined) { - line = this.getLineFromLineNumberWorker(lineNumber); - this.lines[lineNumber] = line; - } - return line; - }; - TextSnapshot.prototype.getLineFromLineNumberWorker = function (lineNumber) { - var lineMap = this.snapshot.lineMap().lineStarts(); - var lineMapIndex = lineNumber; - if (lineMapIndex < 0 || lineMapIndex >= lineMap.length) - throw new Error(TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Invalid_line_number_0, [lineMapIndex])); - var start = lineMap[lineMapIndex]; - var end; - var endIncludingLineBreak; - var lineBreak = ""; - if (lineMapIndex == lineMap.length) { - end = endIncludingLineBreak = this.snapshot.length(); - } - else { - endIncludingLineBreak = (lineMapIndex >= lineMap.length - 1 ? this.snapshot.length() : lineMap[lineMapIndex + 1]); - for (var p = endIncludingLineBreak - 1; p >= start; p--) { - var c = this.snapshot.substr(p, 1); - if (c != "\r" && c != "\n") { - break; - } - } - end = p + 1; - lineBreak = this.snapshot.substr(end, endIncludingLineBreak - end); - } - var result = new Formatting.TextSnapshotLine(this, lineNumber, start, end, lineBreak); - return result; - }; - return TextSnapshot; - })(); - Formatting.TextSnapshot = TextSnapshot; - })(Formatting = Services.Formatting || (Services.Formatting = {})); - })(Services = TypeScript.Services || (TypeScript.Services = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Services; - (function (Services) { - var Formatting; - (function (Formatting) { - var TextSnapshotLine = (function () { - function TextSnapshotLine(_snapshot, _lineNumber, _start, _end, _lineBreak) { - this._snapshot = _snapshot; - this._lineNumber = _lineNumber; - this._start = _start; - this._end = _end; - this._lineBreak = _lineBreak; - } - TextSnapshotLine.prototype.snapshot = function () { - return this._snapshot; - }; - TextSnapshotLine.prototype.start = function () { - return new Formatting.SnapshotPoint(this._snapshot, this._start); - }; - TextSnapshotLine.prototype.startPosition = function () { - return this._start; - }; - TextSnapshotLine.prototype.end = function () { - return new Formatting.SnapshotPoint(this._snapshot, this._end); - }; - TextSnapshotLine.prototype.endPosition = function () { - return this._end; - }; - TextSnapshotLine.prototype.endIncludingLineBreak = function () { - return new Formatting.SnapshotPoint(this._snapshot, this._end + this._lineBreak.length); - }; - TextSnapshotLine.prototype.endIncludingLineBreakPosition = function () { - return this._end + this._lineBreak.length; - }; - TextSnapshotLine.prototype.length = function () { - return this._end - this._start; - }; - TextSnapshotLine.prototype.lineNumber = function () { - return this._lineNumber; - }; - TextSnapshotLine.prototype.getText = function () { - return this._snapshot.getText(TypeScript.TextSpan.fromBounds(this._start, this._end)); - }; - return TextSnapshotLine; - })(); - Formatting.TextSnapshotLine = TextSnapshotLine; - })(Formatting = Services.Formatting || (Services.Formatting = {})); - })(Services = TypeScript.Services || (TypeScript.Services = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Services; - (function (Services) { - var Formatting; - (function (Formatting) { - var SnapshotPoint = (function () { - function SnapshotPoint(snapshot, position) { - this.snapshot = snapshot; - this.position = position; - } - SnapshotPoint.prototype.getContainingLine = function () { - return this.snapshot.getLineFromPosition(this.position); - }; - SnapshotPoint.prototype.add = function (offset) { - return new SnapshotPoint(this.snapshot, this.position + offset); - }; - return SnapshotPoint; - })(); - Formatting.SnapshotPoint = SnapshotPoint; - })(Formatting = Services.Formatting || (Services.Formatting = {})); - })(Services = TypeScript.Services || (TypeScript.Services = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Services; - (function (Services) { - var Formatting; - (function (Formatting) { - var FormattingContext = (function () { - function FormattingContext(snapshot, formattingRequestKind) { - this.snapshot = snapshot; - this.formattingRequestKind = formattingRequestKind; - this.currentTokenSpan = null; - this.nextTokenSpan = null; - this.contextNode = null; - this.currentTokenParent = null; - this.nextTokenParent = null; - this.contextNodeAllOnSameLine = null; - this.nextNodeAllOnSameLine = null; - this.tokensAreOnSameLine = null; - this.contextNodeBlockIsOnOneLine = null; - this.nextNodeBlockIsOnOneLine = null; - TypeScript.Debug.assert(this.snapshot != null, "snapshot is null"); - } - FormattingContext.prototype.updateContext = function (currentTokenSpan, currentTokenParent, nextTokenSpan, nextTokenParent, commonParent) { - TypeScript.Debug.assert(currentTokenSpan != null, "currentTokenSpan is null"); - TypeScript.Debug.assert(currentTokenParent != null, "currentTokenParent is null"); - TypeScript.Debug.assert(nextTokenSpan != null, "nextTokenSpan is null"); - TypeScript.Debug.assert(nextTokenParent != null, "nextTokenParent is null"); - TypeScript.Debug.assert(commonParent != null, "commonParent is null"); - this.currentTokenSpan = currentTokenSpan; - this.currentTokenParent = currentTokenParent; - this.nextTokenSpan = nextTokenSpan; - this.nextTokenParent = nextTokenParent; - this.contextNode = commonParent; - this.contextNodeAllOnSameLine = null; - this.nextNodeAllOnSameLine = null; - this.tokensAreOnSameLine = null; - this.contextNodeBlockIsOnOneLine = null; - this.nextNodeBlockIsOnOneLine = null; - }; - FormattingContext.prototype.ContextNodeAllOnSameLine = function () { - if (this.contextNodeAllOnSameLine === null) { - this.contextNodeAllOnSameLine = this.NodeIsOnOneLine(this.contextNode); - } - return this.contextNodeAllOnSameLine; - }; - FormattingContext.prototype.NextNodeAllOnSameLine = function () { - if (this.nextNodeAllOnSameLine === null) { - this.nextNodeAllOnSameLine = this.NodeIsOnOneLine(this.nextTokenParent); - } - return this.nextNodeAllOnSameLine; - }; - FormattingContext.prototype.TokensAreOnSameLine = function () { - if (this.tokensAreOnSameLine === null) { - var startLine = this.snapshot.getLineNumberFromPosition(this.currentTokenSpan.start()); - var endLine = this.snapshot.getLineNumberFromPosition(this.nextTokenSpan.start()); - this.tokensAreOnSameLine = (startLine == endLine); - } - return this.tokensAreOnSameLine; - }; - FormattingContext.prototype.ContextNodeBlockIsOnOneLine = function () { - if (this.contextNodeBlockIsOnOneLine === null) { - this.contextNodeBlockIsOnOneLine = this.BlockIsOnOneLine(this.contextNode); - } - return this.contextNodeBlockIsOnOneLine; - }; - FormattingContext.prototype.NextNodeBlockIsOnOneLine = function () { - if (this.nextNodeBlockIsOnOneLine === null) { - this.nextNodeBlockIsOnOneLine = this.BlockIsOnOneLine(this.nextTokenParent); - } - return this.nextNodeBlockIsOnOneLine; - }; - FormattingContext.prototype.NodeIsOnOneLine = function (node) { - var startLine = this.snapshot.getLineNumberFromPosition(node.start()); - var endLine = this.snapshot.getLineNumberFromPosition(node.end()); - return startLine == endLine; - }; - FormattingContext.prototype.BlockIsOnOneLine = function (node) { - var block = node.node(); - return this.snapshot.getLineNumberFromPosition(TypeScript.end(block.openBraceToken)) === this.snapshot.getLineNumberFromPosition(TypeScript.start(block.closeBraceToken)); - }; - return FormattingContext; - })(); - Formatting.FormattingContext = FormattingContext; - })(Formatting = Services.Formatting || (Services.Formatting = {})); - })(Services = TypeScript.Services || (TypeScript.Services = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Services; - (function (Services) { - var Formatting; - (function (Formatting) { - var FormattingManager = (function () { - function FormattingManager(syntaxTree, snapshot, rulesProvider, editorOptions) { - this.syntaxTree = syntaxTree; - this.snapshot = snapshot; - this.rulesProvider = rulesProvider; - this.options = new TypeScript.FormattingOptions(!editorOptions.ConvertTabsToSpaces, editorOptions.TabSize, editorOptions.IndentSize, editorOptions.NewLineCharacter); - } - FormattingManager.prototype.formatSelection = function (minChar, limChar) { - var span = TypeScript.TextSpan.fromBounds(minChar, limChar); - return this.formatSpan(span, 1 /* FormatSelection */); - }; - FormattingManager.prototype.formatDocument = function () { - var span = TypeScript.TextSpan.fromBounds(0, this.snapshot.getLength()); - return this.formatSpan(span, 0 /* FormatDocument */); - }; - FormattingManager.prototype.formatOnSemicolon = function (caretPosition) { - var sourceUnit = this.syntaxTree.sourceUnit(); - var semicolonPositionedToken = TypeScript.findToken(sourceUnit, caretPosition - 1); - if (semicolonPositionedToken.kind() === 78 /* SemicolonToken */) { - var current = semicolonPositionedToken; - while (current.parent !== null && TypeScript.end(current.parent) === TypeScript.end(semicolonPositionedToken) && current.parent.kind() !== 1 /* List */) { - current = current.parent; - } - var span = new TypeScript.TextSpan(TypeScript.fullStart(current), TypeScript.fullWidth(current)); - return this.formatSpan(span, 3 /* FormatOnSemicolon */); - } - return []; - }; - FormattingManager.prototype.formatOnClosingCurlyBrace = function (caretPosition) { - var sourceUnit = this.syntaxTree.sourceUnit(); - var closeBracePositionedToken = TypeScript.findToken(sourceUnit, caretPosition - 1); - if (closeBracePositionedToken.kind() === 71 /* CloseBraceToken */) { - var current = closeBracePositionedToken; - while (current.parent !== null && TypeScript.end(current.parent) === TypeScript.end(closeBracePositionedToken) && current.parent.kind() !== 1 /* List */) { - current = current.parent; - } - var span = new TypeScript.TextSpan(TypeScript.fullStart(current), TypeScript.fullWidth(current)); - return this.formatSpan(span, 4 /* FormatOnClosingCurlyBrace */); - } - return []; - }; - FormattingManager.prototype.formatOnEnter = function (caretPosition) { - var lineNumber = this.snapshot.getLineNumberFromPosition(caretPosition); - if (lineNumber > 0) { - var prevLine = this.snapshot.getLineFromLineNumber(lineNumber - 1); - var currentLine = this.snapshot.getLineFromLineNumber(lineNumber); - var span = TypeScript.TextSpan.fromBounds(prevLine.startPosition(), currentLine.endPosition()); - return this.formatSpan(span, 2 /* FormatOnEnter */); - } - return []; - }; - FormattingManager.prototype.formatSpan = function (span, formattingRequestKind) { - var startLine = this.snapshot.getLineFromPosition(span.start()); - span = TypeScript.TextSpan.fromBounds(startLine.startPosition(), span.end()); - var result = []; - var formattingEdits = Formatting.Formatter.getEdits(span, this.syntaxTree.sourceUnit(), this.options, true, this.snapshot, this.rulesProvider, formattingRequestKind); - formattingEdits.forEach(function (item) { - result.push({ - span: new TypeScript.TextSpan(item.position, item.length), - newText: item.replaceWith - }); - }); - return result; - }; - return FormattingManager; - })(); - Formatting.FormattingManager = FormattingManager; - })(Formatting = Services.Formatting || (Services.Formatting = {})); - })(Services = TypeScript.Services || (TypeScript.Services = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Services; - (function (Services) { - var Formatting; - (function (Formatting) { - (function (FormattingRequestKind) { - FormattingRequestKind[FormattingRequestKind["FormatDocument"] = 0] = "FormatDocument"; - FormattingRequestKind[FormattingRequestKind["FormatSelection"] = 1] = "FormatSelection"; - FormattingRequestKind[FormattingRequestKind["FormatOnEnter"] = 2] = "FormatOnEnter"; - FormattingRequestKind[FormattingRequestKind["FormatOnSemicolon"] = 3] = "FormatOnSemicolon"; - FormattingRequestKind[FormattingRequestKind["FormatOnClosingCurlyBrace"] = 4] = "FormatOnClosingCurlyBrace"; - FormattingRequestKind[FormattingRequestKind["FormatOnPaste"] = 5] = "FormatOnPaste"; - })(Formatting.FormattingRequestKind || (Formatting.FormattingRequestKind = {})); - var FormattingRequestKind = Formatting.FormattingRequestKind; - })(Formatting = Services.Formatting || (Services.Formatting = {})); - })(Services = TypeScript.Services || (TypeScript.Services = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Services; - (function (Services) { - var Formatting; - (function (Formatting) { - var Rule = (function () { - function Rule(Descriptor, Operation, Flag) { - if (Flag === void 0) { Flag = 0 /* None */; } - this.Descriptor = Descriptor; - this.Operation = Operation; - this.Flag = Flag; - } - Rule.prototype.toString = function () { - return "[desc=" + this.Descriptor + "," + "operation=" + this.Operation + "," + "flag=" + this.Flag + "]"; - }; - return Rule; - })(); - Formatting.Rule = Rule; - })(Formatting = Services.Formatting || (Services.Formatting = {})); - })(Services = TypeScript.Services || (TypeScript.Services = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Services; - (function (Services) { - var Formatting; - (function (Formatting) { - (function (RuleAction) { - RuleAction[RuleAction["Ignore"] = 0] = "Ignore"; - RuleAction[RuleAction["Space"] = 1] = "Space"; - RuleAction[RuleAction["NewLine"] = 2] = "NewLine"; - RuleAction[RuleAction["Delete"] = 3] = "Delete"; - })(Formatting.RuleAction || (Formatting.RuleAction = {})); - var RuleAction = Formatting.RuleAction; - })(Formatting = Services.Formatting || (Services.Formatting = {})); - })(Services = TypeScript.Services || (TypeScript.Services = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Services; - (function (Services) { - var Formatting; - (function (Formatting) { - var RuleDescriptor = (function () { - function RuleDescriptor(LeftTokenRange, RightTokenRange) { - this.LeftTokenRange = LeftTokenRange; - this.RightTokenRange = RightTokenRange; - } - RuleDescriptor.prototype.toString = function () { - return "[leftRange=" + this.LeftTokenRange + "," + "rightRange=" + this.RightTokenRange + "]"; - }; - RuleDescriptor.create1 = function (left, right) { - return RuleDescriptor.create4(Formatting.Shared.TokenRange.FromToken(left), Formatting.Shared.TokenRange.FromToken(right)); - }; - RuleDescriptor.create2 = function (left, right) { - return RuleDescriptor.create4(left, Formatting.Shared.TokenRange.FromToken(right)); - }; - RuleDescriptor.create3 = function (left, right) { - return RuleDescriptor.create4(Formatting.Shared.TokenRange.FromToken(left), right); - }; - RuleDescriptor.create4 = function (left, right) { - return new RuleDescriptor(left, right); - }; - return RuleDescriptor; - })(); - Formatting.RuleDescriptor = RuleDescriptor; - })(Formatting = Services.Formatting || (Services.Formatting = {})); - })(Services = TypeScript.Services || (TypeScript.Services = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Services; - (function (Services) { - var Formatting; - (function (Formatting) { - (function (RuleFlags) { - RuleFlags[RuleFlags["None"] = 0] = "None"; - RuleFlags[RuleFlags["CanDeleteNewLines"] = 1] = "CanDeleteNewLines"; - })(Formatting.RuleFlags || (Formatting.RuleFlags = {})); - var RuleFlags = Formatting.RuleFlags; - })(Formatting = Services.Formatting || (Services.Formatting = {})); - })(Services = TypeScript.Services || (TypeScript.Services = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Services; - (function (Services) { - var Formatting; - (function (Formatting) { - var RuleOperation = (function () { - function RuleOperation() { - this.Context = null; - this.Action = null; - } - RuleOperation.prototype.toString = function () { - return "[context=" + this.Context + "," + "action=" + this.Action + "]"; - }; - RuleOperation.create1 = function (action) { - return RuleOperation.create2(Formatting.RuleOperationContext.Any, action); - }; - RuleOperation.create2 = function (context, action) { - var result = new RuleOperation(); - result.Context = context; - result.Action = action; - return result; - }; - return RuleOperation; - })(); - Formatting.RuleOperation = RuleOperation; - })(Formatting = Services.Formatting || (Services.Formatting = {})); - })(Services = TypeScript.Services || (TypeScript.Services = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Services; - (function (Services) { - var Formatting; - (function (Formatting) { - var RuleOperationContext = (function () { - function RuleOperationContext() { - var funcs = []; - for (var _i = 0; _i < arguments.length; _i++) { - funcs[_i - 0] = arguments[_i]; - } - this.customContextChecks = funcs; - } - RuleOperationContext.prototype.IsAny = function () { - return this == RuleOperationContext.Any; - }; - RuleOperationContext.prototype.InContext = function (context) { - if (this.IsAny()) { - return true; - } - for (var i = 0, len = this.customContextChecks.length; i < len; i++) { - if (!this.customContextChecks[i](context)) { - return false; - } - } - return true; - }; - RuleOperationContext.Any = new RuleOperationContext(); - return RuleOperationContext; - })(); - Formatting.RuleOperationContext = RuleOperationContext; - })(Formatting = Services.Formatting || (Services.Formatting = {})); - })(Services = TypeScript.Services || (TypeScript.Services = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Services; - (function (Services) { - var Formatting; - (function (Formatting) { - var Rules = (function () { - function Rules() { - this.IgnoreBeforeComment = new Formatting.Rule(Formatting.RuleDescriptor.create4(Formatting.Shared.TokenRange.Any, Formatting.Shared.TokenRange.Comments), Formatting.RuleOperation.create1(0 /* Ignore */)); - this.IgnoreAfterLineComment = new Formatting.Rule(Formatting.RuleDescriptor.create3(7 /* SingleLineCommentTrivia */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create1(0 /* Ignore */)); - this.NoSpaceBeforeSemicolon = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 78 /* SemicolonToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceBeforeColon = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 106 /* ColonToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 3 /* Delete */)); - this.NoSpaceBeforeQMark = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 105 /* QuestionToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 3 /* Delete */)); - this.SpaceAfterColon = new Formatting.Rule(Formatting.RuleDescriptor.create3(106 /* ColonToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 1 /* Space */)); - this.SpaceAfterQMark = new Formatting.Rule(Formatting.RuleDescriptor.create3(105 /* QuestionToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 1 /* Space */)); - this.SpaceAfterSemicolon = new Formatting.Rule(Formatting.RuleDescriptor.create3(78 /* SemicolonToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); - this.SpaceAfterCloseBrace = new Formatting.Rule(Formatting.RuleDescriptor.create3(71 /* CloseBraceToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsAfterCodeBlockContext), 1 /* Space */)); - this.SpaceBetweenCloseBraceAndElse = new Formatting.Rule(Formatting.RuleDescriptor.create1(71 /* CloseBraceToken */, 23 /* ElseKeyword */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); - this.SpaceBetweenCloseBraceAndWhile = new Formatting.Rule(Formatting.RuleDescriptor.create1(71 /* CloseBraceToken */, 42 /* WhileKeyword */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); - this.NoSpaceAfterCloseBrace = new Formatting.Rule(Formatting.RuleDescriptor.create3(71 /* CloseBraceToken */, Formatting.Shared.TokenRange.FromTokens([73 /* CloseParenToken */, 75 /* CloseBracketToken */, 79 /* CommaToken */, 78 /* SemicolonToken */])), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceBeforeDot = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 76 /* DotToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceAfterDot = new Formatting.Rule(Formatting.RuleDescriptor.create3(76 /* DotToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceBeforeOpenBracket = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 74 /* OpenBracketToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceAfterOpenBracket = new Formatting.Rule(Formatting.RuleDescriptor.create3(74 /* OpenBracketToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceBeforeCloseBracket = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 75 /* CloseBracketToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceAfterCloseBracket = new Formatting.Rule(Formatting.RuleDescriptor.create3(75 /* CloseBracketToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.FunctionOpenBraceLeftTokenRange = Formatting.Shared.TokenRange.AnyIncludingMultilineComments; - this.SpaceBeforeOpenBraceInFunction = new Formatting.Rule(Formatting.RuleDescriptor.create2(this.FunctionOpenBraceLeftTokenRange, 70 /* OpenBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsFunctionDeclContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 1 /* Space */), 1 /* CanDeleteNewLines */); - this.TypeScriptOpenBraceLeftTokenRange = Formatting.Shared.TokenRange.FromTokens([11 /* IdentifierName */, 6 /* MultiLineCommentTrivia */]); - this.SpaceBeforeOpenBraceInTypeScriptDeclWithBlock = new Formatting.Rule(Formatting.RuleDescriptor.create2(this.TypeScriptOpenBraceLeftTokenRange, 70 /* OpenBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsTypeScriptDeclWithBlockContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 1 /* Space */), 1 /* CanDeleteNewLines */); - this.ControlOpenBraceLeftTokenRange = Formatting.Shared.TokenRange.FromTokens([73 /* CloseParenToken */, 6 /* MultiLineCommentTrivia */, 22 /* DoKeyword */, 38 /* TryKeyword */, 25 /* FinallyKeyword */, 23 /* ElseKeyword */]); - this.SpaceBeforeOpenBraceInControl = new Formatting.Rule(Formatting.RuleDescriptor.create2(this.ControlOpenBraceLeftTokenRange, 70 /* OpenBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsControlDeclContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 1 /* Space */), 1 /* CanDeleteNewLines */); - this.SpaceAfterOpenBrace = new Formatting.Rule(Formatting.RuleDescriptor.create3(70 /* OpenBraceToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 1 /* Space */)); - this.SpaceBeforeCloseBrace = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 71 /* CloseBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 1 /* Space */)); - this.NoSpaceBetweenEmptyBraceBrackets = new Formatting.Rule(Formatting.RuleDescriptor.create1(70 /* OpenBraceToken */, 71 /* CloseBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsObjectContext), 3 /* Delete */)); - this.NewLineAfterOpenBraceInBlockContext = new Formatting.Rule(Formatting.RuleDescriptor.create3(70 /* OpenBraceToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsMultilineBlockContext), 2 /* NewLine */)); - this.NewLineBeforeCloseBraceInBlockContext = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.AnyIncludingMultilineComments, 71 /* CloseBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsMultilineBlockContext), 2 /* NewLine */)); - this.NoSpaceAfterUnaryPrefixOperator = new Formatting.Rule(Formatting.RuleDescriptor.create4(Formatting.Shared.TokenRange.UnaryPrefixOperators, Formatting.Shared.TokenRange.UnaryPrefixExpressions), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 3 /* Delete */)); - this.NoSpaceAfterUnaryPreincrementOperator = new Formatting.Rule(Formatting.RuleDescriptor.create3(93 /* PlusPlusToken */, Formatting.Shared.TokenRange.UnaryPreincrementExpressions), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceAfterUnaryPredecrementOperator = new Formatting.Rule(Formatting.RuleDescriptor.create3(94 /* MinusMinusToken */, Formatting.Shared.TokenRange.UnaryPredecrementExpressions), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceBeforeUnaryPostincrementOperator = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.UnaryPostincrementExpressions, 93 /* PlusPlusToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceBeforeUnaryPostdecrementOperator = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.UnaryPostdecrementExpressions, 94 /* MinusMinusToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.SpaceAfterPostincrementWhenFollowedByAdd = new Formatting.Rule(Formatting.RuleDescriptor.create1(93 /* PlusPlusToken */, 89 /* PlusToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 1 /* Space */)); - this.SpaceAfterAddWhenFollowedByUnaryPlus = new Formatting.Rule(Formatting.RuleDescriptor.create1(89 /* PlusToken */, 89 /* PlusToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 1 /* Space */)); - this.SpaceAfterAddWhenFollowedByPreincrement = new Formatting.Rule(Formatting.RuleDescriptor.create1(89 /* PlusToken */, 93 /* PlusPlusToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 1 /* Space */)); - this.SpaceAfterPostdecrementWhenFollowedBySubtract = new Formatting.Rule(Formatting.RuleDescriptor.create1(94 /* MinusMinusToken */, 90 /* MinusToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 1 /* Space */)); - this.SpaceAfterSubtractWhenFollowedByUnaryMinus = new Formatting.Rule(Formatting.RuleDescriptor.create1(90 /* MinusToken */, 90 /* MinusToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 1 /* Space */)); - this.SpaceAfterSubtractWhenFollowedByPredecrement = new Formatting.Rule(Formatting.RuleDescriptor.create1(90 /* MinusToken */, 94 /* MinusMinusToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 1 /* Space */)); - this.NoSpaceBeforeComma = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 79 /* CommaToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.SpaceAfterCertainKeywords = new Formatting.Rule(Formatting.RuleDescriptor.create4(Formatting.Shared.TokenRange.FromTokens([40 /* VarKeyword */, 36 /* ThrowKeyword */, 31 /* NewKeyword */, 21 /* DeleteKeyword */, 33 /* ReturnKeyword */, 39 /* TypeOfKeyword */]), Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); - this.NoSpaceBeforeOpenParenInFuncCall = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 72 /* OpenParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsFunctionCallOrNewContext), 3 /* Delete */)); - this.SpaceAfterFunctionInFuncDecl = new Formatting.Rule(Formatting.RuleDescriptor.create3(27 /* FunctionKeyword */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 1 /* Space */)); - this.NoSpaceBeforeOpenParenInFuncDecl = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 72 /* OpenParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsFunctionDeclContext), 3 /* Delete */)); - this.SpaceAfterVoidOperator = new Formatting.Rule(Formatting.RuleDescriptor.create3(41 /* VoidKeyword */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsVoidOpContext), 1 /* Space */)); - this.NoSpaceBetweenReturnAndSemicolon = new Formatting.Rule(Formatting.RuleDescriptor.create1(33 /* ReturnKeyword */, 78 /* SemicolonToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.SpaceBetweenStatements = new Formatting.Rule(Formatting.RuleDescriptor.create4(Formatting.Shared.TokenRange.FromTokens([73 /* CloseParenToken */, 22 /* DoKeyword */, 23 /* ElseKeyword */, 16 /* CaseKeyword */]), Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotForContext), 1 /* Space */)); - this.SpaceAfterTryFinally = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.FromTokens([38 /* TryKeyword */, 25 /* FinallyKeyword */]), 70 /* OpenBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); - this.SpaceAfterGetSetInMember = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.FromTokens([64 /* GetKeyword */, 68 /* SetKeyword */]), 11 /* IdentifierName */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 1 /* Space */)); - this.SpaceBeforeBinaryKeywordOperator = new Formatting.Rule(Formatting.RuleDescriptor.create4(Formatting.Shared.TokenRange.Any, Formatting.Shared.TokenRange.BinaryKeywordOperators), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 1 /* Space */)); - this.SpaceAfterBinaryKeywordOperator = new Formatting.Rule(Formatting.RuleDescriptor.create4(Formatting.Shared.TokenRange.BinaryKeywordOperators, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 1 /* Space */)); - this.NoSpaceAfterConstructor = new Formatting.Rule(Formatting.RuleDescriptor.create1(62 /* ConstructorKeyword */, 72 /* OpenParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceAfterModuleImport = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.FromTokens([65 /* ModuleKeyword */, 66 /* RequireKeyword */]), 72 /* OpenParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.SpaceAfterCertainTypeScriptKeywords = new Formatting.Rule(Formatting.RuleDescriptor.create4(Formatting.Shared.TokenRange.FromTokens([44 /* ClassKeyword */, 63 /* DeclareKeyword */, 46 /* EnumKeyword */, 47 /* ExportKeyword */, 48 /* ExtendsKeyword */, 64 /* GetKeyword */, 51 /* ImplementsKeyword */, 49 /* ImportKeyword */, 52 /* InterfaceKeyword */, 65 /* ModuleKeyword */, 55 /* PrivateKeyword */, 57 /* PublicKeyword */, 68 /* SetKeyword */, 58 /* StaticKeyword */]), Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); - this.SpaceBeforeCertainTypeScriptKeywords = new Formatting.Rule(Formatting.RuleDescriptor.create4(Formatting.Shared.TokenRange.Any, Formatting.Shared.TokenRange.FromTokens([48 /* ExtendsKeyword */, 51 /* ImplementsKeyword */])), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); - this.SpaceAfterModuleName = new Formatting.Rule(Formatting.RuleDescriptor.create1(14 /* StringLiteral */, 70 /* OpenBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsModuleDeclContext), 1 /* Space */)); - this.SpaceAfterArrow = new Formatting.Rule(Formatting.RuleDescriptor.create3(85 /* EqualsGreaterThanToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); - this.NoSpaceAfterEllipsis = new Formatting.Rule(Formatting.RuleDescriptor.create1(77 /* DotDotDotToken */, 11 /* IdentifierName */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceAfterOptionalParameters = new Formatting.Rule(Formatting.RuleDescriptor.create3(105 /* QuestionToken */, Formatting.Shared.TokenRange.FromTokens([73 /* CloseParenToken */, 79 /* CommaToken */])), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 3 /* Delete */)); - this.NoSpaceBeforeOpenAngularBracket = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.TypeNames, 80 /* LessThanToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 3 /* Delete */)); - this.NoSpaceBetweenCloseParenAndAngularBracket = new Formatting.Rule(Formatting.RuleDescriptor.create1(73 /* CloseParenToken */, 80 /* LessThanToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 3 /* Delete */)); - this.NoSpaceAfterOpenAngularBracket = new Formatting.Rule(Formatting.RuleDescriptor.create3(80 /* LessThanToken */, Formatting.Shared.TokenRange.TypeNames), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 3 /* Delete */)); - this.NoSpaceBeforeCloseAngularBracket = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 81 /* GreaterThanToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 3 /* Delete */)); - this.NoSpaceAfterCloseAngularBracket = new Formatting.Rule(Formatting.RuleDescriptor.create3(81 /* GreaterThanToken */, Formatting.Shared.TokenRange.FromTokens([72 /* OpenParenToken */, 74 /* OpenBracketToken */, 81 /* GreaterThanToken */, 79 /* CommaToken */])), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 3 /* Delete */)); - this.NoSpaceBetweenEmptyInterfaceBraceBrackets = new Formatting.Rule(Formatting.RuleDescriptor.create1(70 /* OpenBraceToken */, 71 /* CloseBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsObjectTypeContext), 3 /* Delete */)); - this.HighPriorityCommonRules = [ - this.IgnoreBeforeComment, - this.IgnoreAfterLineComment, - this.NoSpaceBeforeColon, - this.SpaceAfterColon, - this.NoSpaceBeforeQMark, - this.SpaceAfterQMark, - this.NoSpaceBeforeDot, - this.NoSpaceAfterDot, - this.NoSpaceAfterUnaryPrefixOperator, - this.NoSpaceAfterUnaryPreincrementOperator, - this.NoSpaceAfterUnaryPredecrementOperator, - this.NoSpaceBeforeUnaryPostincrementOperator, - this.NoSpaceBeforeUnaryPostdecrementOperator, - this.SpaceAfterPostincrementWhenFollowedByAdd, - this.SpaceAfterAddWhenFollowedByUnaryPlus, - this.SpaceAfterAddWhenFollowedByPreincrement, - this.SpaceAfterPostdecrementWhenFollowedBySubtract, - this.SpaceAfterSubtractWhenFollowedByUnaryMinus, - this.SpaceAfterSubtractWhenFollowedByPredecrement, - this.NoSpaceAfterCloseBrace, - this.SpaceAfterOpenBrace, - this.SpaceBeforeCloseBrace, - this.NewLineBeforeCloseBraceInBlockContext, - this.SpaceAfterCloseBrace, - this.SpaceBetweenCloseBraceAndElse, - this.SpaceBetweenCloseBraceAndWhile, - this.NoSpaceBetweenEmptyBraceBrackets, - this.SpaceAfterFunctionInFuncDecl, - this.NewLineAfterOpenBraceInBlockContext, - this.SpaceAfterGetSetInMember, - this.NoSpaceBetweenReturnAndSemicolon, - this.SpaceAfterCertainKeywords, - this.NoSpaceBeforeOpenParenInFuncCall, - this.SpaceBeforeBinaryKeywordOperator, - this.SpaceAfterBinaryKeywordOperator, - this.SpaceAfterVoidOperator, - this.NoSpaceAfterConstructor, - this.NoSpaceAfterModuleImport, - this.SpaceAfterCertainTypeScriptKeywords, - this.SpaceBeforeCertainTypeScriptKeywords, - this.SpaceAfterModuleName, - this.SpaceAfterArrow, - this.NoSpaceAfterEllipsis, - this.NoSpaceAfterOptionalParameters, - this.NoSpaceBetweenEmptyInterfaceBraceBrackets, - this.NoSpaceBeforeOpenAngularBracket, - this.NoSpaceBetweenCloseParenAndAngularBracket, - this.NoSpaceAfterOpenAngularBracket, - this.NoSpaceBeforeCloseAngularBracket, - this.NoSpaceAfterCloseAngularBracket - ]; - this.LowPriorityCommonRules = [ - this.NoSpaceBeforeSemicolon, - this.SpaceBeforeOpenBraceInControl, - this.SpaceBeforeOpenBraceInFunction, - this.SpaceBeforeOpenBraceInTypeScriptDeclWithBlock, - this.NoSpaceBeforeComma, - this.NoSpaceBeforeOpenBracket, - this.NoSpaceAfterOpenBracket, - this.NoSpaceBeforeCloseBracket, - this.NoSpaceAfterCloseBracket, - this.SpaceAfterSemicolon, - this.NoSpaceBeforeOpenParenInFuncDecl, - this.SpaceBetweenStatements, - this.SpaceAfterTryFinally - ]; - this.SpaceAfterComma = new Formatting.Rule(Formatting.RuleDescriptor.create3(79 /* CommaToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); - this.NoSpaceAfterComma = new Formatting.Rule(Formatting.RuleDescriptor.create3(79 /* CommaToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.SpaceBeforeBinaryOperator = new Formatting.Rule(Formatting.RuleDescriptor.create4(Formatting.Shared.TokenRange.Any, Formatting.Shared.TokenRange.BinaryOperators), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 1 /* Space */)); - this.SpaceAfterBinaryOperator = new Formatting.Rule(Formatting.RuleDescriptor.create4(Formatting.Shared.TokenRange.BinaryOperators, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 1 /* Space */)); - this.NoSpaceBeforeBinaryOperator = new Formatting.Rule(Formatting.RuleDescriptor.create4(Formatting.Shared.TokenRange.Any, Formatting.Shared.TokenRange.BinaryOperators), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 3 /* Delete */)); - this.NoSpaceAfterBinaryOperator = new Formatting.Rule(Formatting.RuleDescriptor.create4(Formatting.Shared.TokenRange.BinaryOperators, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 3 /* Delete */)); - this.SpaceAfterKeywordInControl = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Keywords, 72 /* OpenParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsControlDeclContext), 1 /* Space */)); - this.NoSpaceAfterKeywordInControl = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Keywords, 72 /* OpenParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsControlDeclContext), 3 /* Delete */)); - this.NewLineBeforeOpenBraceInFunction = new Formatting.Rule(Formatting.RuleDescriptor.create2(this.FunctionOpenBraceLeftTokenRange, 70 /* OpenBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsFunctionDeclContext, Rules.IsBeforeMultilineBlockContext), 2 /* NewLine */), 1 /* CanDeleteNewLines */); - this.NewLineBeforeOpenBraceInTypeScriptDeclWithBlock = new Formatting.Rule(Formatting.RuleDescriptor.create2(this.TypeScriptOpenBraceLeftTokenRange, 70 /* OpenBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsTypeScriptDeclWithBlockContext, Rules.IsBeforeMultilineBlockContext), 2 /* NewLine */), 1 /* CanDeleteNewLines */); - this.NewLineBeforeOpenBraceInControl = new Formatting.Rule(Formatting.RuleDescriptor.create2(this.ControlOpenBraceLeftTokenRange, 70 /* OpenBraceToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsControlDeclContext, Rules.IsBeforeMultilineBlockContext), 2 /* NewLine */), 1 /* CanDeleteNewLines */); - this.SpaceAfterSemicolonInFor = new Formatting.Rule(Formatting.RuleDescriptor.create3(78 /* SemicolonToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsForContext), 1 /* Space */)); - this.NoSpaceAfterSemicolonInFor = new Formatting.Rule(Formatting.RuleDescriptor.create3(78 /* SemicolonToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsForContext), 3 /* Delete */)); - this.SpaceAfterOpenParen = new Formatting.Rule(Formatting.RuleDescriptor.create3(72 /* OpenParenToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); - this.SpaceBeforeCloseParen = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 73 /* CloseParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 1 /* Space */)); - this.NoSpaceBetweenParens = new Formatting.Rule(Formatting.RuleDescriptor.create1(72 /* OpenParenToken */, 73 /* CloseParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceAfterOpenParen = new Formatting.Rule(Formatting.RuleDescriptor.create3(72 /* OpenParenToken */, Formatting.Shared.TokenRange.Any), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.NoSpaceBeforeCloseParen = new Formatting.Rule(Formatting.RuleDescriptor.create2(Formatting.Shared.TokenRange.Any, 73 /* CloseParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 3 /* Delete */)); - this.SpaceAfterAnonymousFunctionKeyword = new Formatting.Rule(Formatting.RuleDescriptor.create1(27 /* FunctionKeyword */, 72 /* OpenParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 1 /* Space */)); - this.NoSpaceAfterAnonymousFunctionKeyword = new Formatting.Rule(Formatting.RuleDescriptor.create1(27 /* FunctionKeyword */, 72 /* OpenParenToken */), Formatting.RuleOperation.create2(new Formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 3 /* Delete */)); - } - Rules.prototype.getRuleName = function (rule) { - var o = this; - for (var name in o) { - if (o[name] === rule) { - return name; - } - } - throw new Error(TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Unknown_rule, null)); - }; - Rules.IsForContext = function (context) { - return context.contextNode.kind() === 155 /* ForStatement */; - }; - Rules.IsNotForContext = function (context) { - return !Rules.IsForContext(context); - }; - Rules.IsBinaryOpContext = function (context) { - switch (context.contextNode.kind()) { - case 175 /* AssignmentExpression */: - case 176 /* AddAssignmentExpression */: - case 177 /* SubtractAssignmentExpression */: - case 178 /* MultiplyAssignmentExpression */: - case 179 /* DivideAssignmentExpression */: - case 180 /* ModuloAssignmentExpression */: - case 181 /* AndAssignmentExpression */: - case 182 /* ExclusiveOrAssignmentExpression */: - case 183 /* OrAssignmentExpression */: - case 184 /* LeftShiftAssignmentExpression */: - case 185 /* SignedRightShiftAssignmentExpression */: - case 186 /* UnsignedRightShiftAssignmentExpression */: - case 187 /* ConditionalExpression */: - case 188 /* LogicalOrExpression */: - case 189 /* LogicalAndExpression */: - case 190 /* BitwiseOrExpression */: - case 191 /* BitwiseExclusiveOrExpression */: - case 192 /* BitwiseAndExpression */: - case 193 /* EqualsWithTypeConversionExpression */: - case 194 /* NotEqualsWithTypeConversionExpression */: - case 195 /* EqualsExpression */: - case 196 /* NotEqualsExpression */: - case 197 /* LessThanExpression */: - case 198 /* GreaterThanExpression */: - case 199 /* LessThanOrEqualExpression */: - case 200 /* GreaterThanOrEqualExpression */: - case 201 /* InstanceOfExpression */: - case 202 /* InExpression */: - case 203 /* LeftShiftExpression */: - case 204 /* SignedRightShiftExpression */: - case 205 /* UnsignedRightShiftExpression */: - case 206 /* MultiplyExpression */: - case 207 /* DivideExpression */: - case 208 /* ModuloExpression */: - case 209 /* AddExpression */: - case 210 /* SubtractExpression */: - return true; - case 134 /* ImportDeclaration */: - case 226 /* VariableDeclarator */: - case 233 /* EqualsValueClause */: - return context.currentTokenSpan.kind === 107 /* EqualsToken */ || context.nextTokenSpan.kind === 107 /* EqualsToken */; - case 156 /* ForInStatement */: - return context.currentTokenSpan.kind === 29 /* InKeyword */ || context.nextTokenSpan.kind === 29 /* InKeyword */; - } - return false; - }; - Rules.IsNotBinaryOpContext = function (context) { - return !Rules.IsBinaryOpContext(context); - }; - Rules.IsSameLineTokenOrBeforeMultilineBlockContext = function (context) { - return context.TokensAreOnSameLine() || Rules.IsBeforeMultilineBlockContext(context); - }; - Rules.IsBeforeMultilineBlockContext = function (context) { - return Rules.IsBeforeBlockContext(context) && !(context.NextNodeAllOnSameLine() || context.NextNodeBlockIsOnOneLine()); - }; - Rules.IsMultilineBlockContext = function (context) { - return Rules.IsBlockContext(context) && !(context.ContextNodeAllOnSameLine() || context.ContextNodeBlockIsOnOneLine()); - }; - Rules.IsSingleLineBlockContext = function (context) { - return Rules.IsBlockContext(context) && (context.ContextNodeAllOnSameLine() || context.ContextNodeBlockIsOnOneLine()); - }; - Rules.IsBlockContext = function (context) { - return Rules.NodeIsBlockContext(context.contextNode); - }; - Rules.IsBeforeBlockContext = function (context) { - return Rules.NodeIsBlockContext(context.nextTokenParent); - }; - Rules.NodeIsBlockContext = function (node) { - if (Rules.NodeIsTypeScriptDeclWithBlockContext(node)) { - return true; - } - switch (node.kind()) { - case 147 /* Block */: - case 152 /* SwitchStatement */: - case 216 /* ObjectLiteralExpression */: - return true; - } - return false; - }; - Rules.IsFunctionDeclContext = function (context) { - switch (context.contextNode.kind()) { - case 130 /* FunctionDeclaration */: - case 136 /* MemberFunctionDeclaration */: - case 140 /* GetAccessor */: - case 141 /* SetAccessor */: - case 146 /* MethodSignature */: - case 143 /* CallSignature */: - case 223 /* FunctionExpression */: - case 138 /* ConstructorDeclaration */: - case 220 /* SimpleArrowFunctionExpression */: - case 219 /* ParenthesizedArrowFunctionExpression */: - case 129 /* InterfaceDeclaration */: - return true; - } - return false; - }; - Rules.IsTypeScriptDeclWithBlockContext = function (context) { - return Rules.NodeIsTypeScriptDeclWithBlockContext(context.contextNode); - }; - Rules.NodeIsTypeScriptDeclWithBlockContext = function (node) { - switch (node.kind()) { - case 132 /* ClassDeclaration */: - case 133 /* EnumDeclaration */: - case 122 /* ObjectType */: - case 131 /* ModuleDeclaration */: - return true; - } - return false; - }; - Rules.IsAfterCodeBlockContext = function (context) { - switch (context.currentTokenParent.kind()) { - case 132 /* ClassDeclaration */: - case 131 /* ModuleDeclaration */: - case 133 /* EnumDeclaration */: - case 147 /* Block */: - case 152 /* SwitchStatement */: - return true; - } - return false; - }; - Rules.IsControlDeclContext = function (context) { - switch (context.contextNode.kind()) { - case 148 /* IfStatement */: - case 152 /* SwitchStatement */: - case 155 /* ForStatement */: - case 156 /* ForInStatement */: - case 159 /* WhileStatement */: - case 160 /* TryStatement */: - case 162 /* DoStatement */: - case 164 /* WithStatement */: - case 236 /* ElseClause */: - case 237 /* CatchClause */: - case 238 /* FinallyClause */: - return true; - default: - return false; - } - }; - Rules.IsObjectContext = function (context) { - return context.contextNode.kind() === 216 /* ObjectLiteralExpression */; - }; - Rules.IsFunctionCallContext = function (context) { - return context.contextNode.kind() === 214 /* InvocationExpression */; - }; - Rules.IsNewContext = function (context) { - return context.contextNode.kind() === 217 /* ObjectCreationExpression */; - }; - Rules.IsFunctionCallOrNewContext = function (context) { - return Rules.IsFunctionCallContext(context) || Rules.IsNewContext(context); - }; - Rules.IsSameLineTokenContext = function (context) { - return context.TokensAreOnSameLine(); - }; - Rules.IsNotFormatOnEnter = function (context) { - return context.formattingRequestKind != 2 /* FormatOnEnter */; - }; - Rules.IsModuleDeclContext = function (context) { - return context.contextNode.kind() === 131 /* ModuleDeclaration */; - }; - Rules.IsObjectTypeContext = function (context) { - return context.contextNode.kind() === 122 /* ObjectType */ && context.contextNode.parent().kind() !== 129 /* InterfaceDeclaration */; - }; - Rules.IsTypeArgumentOrParameter = function (tokenKind, parentKind) { - return ((tokenKind === 80 /* LessThanToken */ || tokenKind === 81 /* GreaterThanToken */) && (parentKind === 230 /* TypeParameterList */ || parentKind === 229 /* TypeArgumentList */)); - }; - Rules.IsTypeArgumentOrParameterContext = function (context) { - return Rules.IsTypeArgumentOrParameter(context.currentTokenSpan.kind, context.currentTokenParent.kind()) || Rules.IsTypeArgumentOrParameter(context.nextTokenSpan.kind, context.nextTokenParent.kind()); - }; - Rules.IsVoidOpContext = function (context) { - return context.currentTokenSpan.kind === 41 /* VoidKeyword */ && context.currentTokenParent.kind() === 173 /* VoidExpression */; - }; - return Rules; - })(); - Formatting.Rules = Rules; - })(Formatting = Services.Formatting || (Services.Formatting = {})); - })(Services = TypeScript.Services || (TypeScript.Services = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Services; - (function (Services) { - var Formatting; - (function (Formatting) { - var RulesMap = (function () { - function RulesMap() { - this.map = []; - this.mapRowLength = 0; - } - RulesMap.create = function (rules) { - var result = new RulesMap(); - result.Initialize(rules); - return result; - }; - RulesMap.prototype.Initialize = function (rules) { - this.mapRowLength = TypeScript.SyntaxKind.LastToken + 1; - this.map = new Array(this.mapRowLength * this.mapRowLength); - var rulesBucketConstructionStateList = new Array(this.map.length); - this.FillRules(rules, rulesBucketConstructionStateList); - return this.map; - }; - RulesMap.prototype.FillRules = function (rules, rulesBucketConstructionStateList) { - var _this = this; - rules.forEach(function (rule) { - _this.FillRule(rule, rulesBucketConstructionStateList); - }); - }; - RulesMap.prototype.GetRuleBucketIndex = function (row, column) { - var rulesBucketIndex = (row * this.mapRowLength) + column; - return rulesBucketIndex; - }; - RulesMap.prototype.FillRule = function (rule, rulesBucketConstructionStateList) { - var _this = this; - var specificRule = rule.Descriptor.LeftTokenRange != Formatting.Shared.TokenRange.Any && rule.Descriptor.RightTokenRange != Formatting.Shared.TokenRange.Any; - rule.Descriptor.LeftTokenRange.GetTokens().forEach(function (left) { - rule.Descriptor.RightTokenRange.GetTokens().forEach(function (right) { - var rulesBucketIndex = _this.GetRuleBucketIndex(left, right); - var rulesBucket = _this.map[rulesBucketIndex]; - if (rulesBucket == undefined) { - rulesBucket = _this.map[rulesBucketIndex] = new RulesBucket(); - } - rulesBucket.AddRule(rule, specificRule, rulesBucketConstructionStateList, rulesBucketIndex); - }); - }); - }; - RulesMap.prototype.GetRule = function (context) { - var bucketIndex = this.GetRuleBucketIndex(context.currentTokenSpan.kind, context.nextTokenSpan.kind); - var bucket = this.map[bucketIndex]; - if (bucket != null) { - for (var i = 0, len = bucket.Rules().length; i < len; i++) { - var rule = bucket.Rules()[i]; - if (rule.Operation.Context.InContext(context)) - return rule; - } - } - return null; - }; - return RulesMap; - })(); - Formatting.RulesMap = RulesMap; - var MaskBitSize = 5; - var Mask = 0x1f; - (function (RulesPosition) { - RulesPosition[RulesPosition["IgnoreRulesSpecific"] = 0] = "IgnoreRulesSpecific"; - RulesPosition[RulesPosition["IgnoreRulesAny"] = MaskBitSize * 1] = "IgnoreRulesAny"; - RulesPosition[RulesPosition["ContextRulesSpecific"] = MaskBitSize * 2] = "ContextRulesSpecific"; - RulesPosition[RulesPosition["ContextRulesAny"] = MaskBitSize * 3] = "ContextRulesAny"; - RulesPosition[RulesPosition["NoContextRulesSpecific"] = MaskBitSize * 4] = "NoContextRulesSpecific"; - RulesPosition[RulesPosition["NoContextRulesAny"] = MaskBitSize * 5] = "NoContextRulesAny"; - })(Formatting.RulesPosition || (Formatting.RulesPosition = {})); - var RulesPosition = Formatting.RulesPosition; - var RulesBucketConstructionState = (function () { - function RulesBucketConstructionState() { - this.rulesInsertionIndexBitmap = 0; - } - RulesBucketConstructionState.prototype.GetInsertionIndex = function (maskPosition) { - var index = 0; - var pos = 0; - var indexBitmap = this.rulesInsertionIndexBitmap; - while (pos <= maskPosition) { - index += (indexBitmap & Mask); - indexBitmap >>= MaskBitSize; - pos += MaskBitSize; - } - return index; - }; - RulesBucketConstructionState.prototype.IncreaseInsertionIndex = function (maskPosition) { - var value = (this.rulesInsertionIndexBitmap >> maskPosition) & Mask; - value++; - TypeScript.Debug.assert((value & Mask) == value, "Adding more rules into the sub-bucket than allowed. Maximum allowed is 32 rules."); - var temp = this.rulesInsertionIndexBitmap & ~(Mask << maskPosition); - temp |= value << maskPosition; - this.rulesInsertionIndexBitmap = temp; - }; - return RulesBucketConstructionState; - })(); - Formatting.RulesBucketConstructionState = RulesBucketConstructionState; - var RulesBucket = (function () { - function RulesBucket() { - this.rules = []; - } - RulesBucket.prototype.Rules = function () { - return this.rules; - }; - RulesBucket.prototype.AddRule = function (rule, specificTokens, constructionState, rulesBucketIndex) { - var position; - if (rule.Operation.Action == 0 /* Ignore */) { - position = specificTokens ? 0 /* IgnoreRulesSpecific */ : RulesPosition.IgnoreRulesAny; - } - else if (!rule.Operation.Context.IsAny()) { - position = specificTokens ? RulesPosition.ContextRulesSpecific : RulesPosition.ContextRulesAny; - } - else { - position = specificTokens ? RulesPosition.NoContextRulesSpecific : RulesPosition.NoContextRulesAny; - } - var state = constructionState[rulesBucketIndex]; - if (state === undefined) { - state = constructionState[rulesBucketIndex] = new RulesBucketConstructionState(); - } - var index = state.GetInsertionIndex(position); - this.rules.splice(index, 0, rule); - state.IncreaseInsertionIndex(position); - }; - return RulesBucket; - })(); - Formatting.RulesBucket = RulesBucket; - })(Formatting = Services.Formatting || (Services.Formatting = {})); - })(Services = TypeScript.Services || (TypeScript.Services = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Services; - (function (Services) { - var Formatting; - (function (Formatting) { - var RulesProvider = (function () { - function RulesProvider(logger) { - this.logger = logger; - this.globalRules = new Formatting.Rules(); - } - RulesProvider.prototype.getRuleName = function (rule) { - return this.globalRules.getRuleName(rule); - }; - RulesProvider.prototype.getRuleByName = function (name) { - return this.globalRules[name]; - }; - RulesProvider.prototype.getRulesMap = function () { - return this.rulesMap; - }; - RulesProvider.prototype.ensureUpToDate = function (options) { - if (this.options == null || !ts.compareDataObjects(this.options, options)) { - var activeRules = this.createActiveRules(options); - var rulesMap = Formatting.RulesMap.create(activeRules); - this.activeRules = activeRules; - this.rulesMap = rulesMap; - this.options = ts.clone(options); - } - }; - RulesProvider.prototype.createActiveRules = function (options) { - var rules = this.globalRules.HighPriorityCommonRules.slice(0); - if (options.InsertSpaceAfterCommaDelimiter) { - rules.push(this.globalRules.SpaceAfterComma); - } - else { - rules.push(this.globalRules.NoSpaceAfterComma); - } - if (options.InsertSpaceAfterFunctionKeywordForAnonymousFunctions) { - rules.push(this.globalRules.SpaceAfterAnonymousFunctionKeyword); - } - else { - rules.push(this.globalRules.NoSpaceAfterAnonymousFunctionKeyword); - } - if (options.InsertSpaceAfterKeywordsInControlFlowStatements) { - rules.push(this.globalRules.SpaceAfterKeywordInControl); - } - else { - rules.push(this.globalRules.NoSpaceAfterKeywordInControl); - } - if (options.InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis) { - rules.push(this.globalRules.SpaceAfterOpenParen); - rules.push(this.globalRules.SpaceBeforeCloseParen); - rules.push(this.globalRules.NoSpaceBetweenParens); - } - else { - rules.push(this.globalRules.NoSpaceAfterOpenParen); - rules.push(this.globalRules.NoSpaceBeforeCloseParen); - rules.push(this.globalRules.NoSpaceBetweenParens); - } - if (options.InsertSpaceAfterSemicolonInForStatements) { - rules.push(this.globalRules.SpaceAfterSemicolonInFor); - } - else { - rules.push(this.globalRules.NoSpaceAfterSemicolonInFor); - } - if (options.InsertSpaceBeforeAndAfterBinaryOperators) { - rules.push(this.globalRules.SpaceBeforeBinaryOperator); - rules.push(this.globalRules.SpaceAfterBinaryOperator); - } - else { - rules.push(this.globalRules.NoSpaceBeforeBinaryOperator); - rules.push(this.globalRules.NoSpaceAfterBinaryOperator); - } - if (options.PlaceOpenBraceOnNewLineForControlBlocks) { - rules.push(this.globalRules.NewLineBeforeOpenBraceInControl); - } - if (options.PlaceOpenBraceOnNewLineForFunctions) { - rules.push(this.globalRules.NewLineBeforeOpenBraceInFunction); - rules.push(this.globalRules.NewLineBeforeOpenBraceInTypeScriptDeclWithBlock); - } - rules = rules.concat(this.globalRules.LowPriorityCommonRules); - return rules; - }; - return RulesProvider; - })(); - Formatting.RulesProvider = RulesProvider; - })(Formatting = Services.Formatting || (Services.Formatting = {})); - })(Services = TypeScript.Services || (TypeScript.Services = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Services; - (function (Services) { - var Formatting; - (function (Formatting) { - var TextEditInfo = (function () { - function TextEditInfo(position, length, replaceWith) { - this.position = position; - this.length = length; - this.replaceWith = replaceWith; - } - TextEditInfo.prototype.toString = function () { - return "[ position: " + this.position + ", length: " + this.length + ", replaceWith: '" + this.replaceWith + "' ]"; - }; - return TextEditInfo; - })(); - Formatting.TextEditInfo = TextEditInfo; - })(Formatting = Services.Formatting || (Services.Formatting = {})); - })(Services = TypeScript.Services || (TypeScript.Services = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Services; - (function (Services) { - var Formatting; - (function (Formatting) { - var Shared; - (function (Shared) { - var TokenRangeAccess = (function () { - function TokenRangeAccess(from, to, except) { - this.tokens = []; - for (var token = from; token <= to; token++) { - if (except.indexOf(token) < 0) { - this.tokens.push(token); - } - } - } - TokenRangeAccess.prototype.GetTokens = function () { - return this.tokens; - }; - TokenRangeAccess.prototype.Contains = function (token) { - return this.tokens.indexOf(token) >= 0; - }; - TokenRangeAccess.prototype.toString = function () { - return "[tokenRangeStart=" + TypeScript.SyntaxKind[this.tokens[0]] + "," + "tokenRangeEnd=" + TypeScript.SyntaxKind[this.tokens[this.tokens.length - 1]] + "]"; - }; - return TokenRangeAccess; - })(); - Shared.TokenRangeAccess = TokenRangeAccess; - var TokenValuesAccess = (function () { - function TokenValuesAccess(tks) { - this.tokens = tks && tks.length ? tks : []; - } - TokenValuesAccess.prototype.GetTokens = function () { - return this.tokens; - }; - TokenValuesAccess.prototype.Contains = function (token) { - return this.tokens.indexOf(token) >= 0; - }; - return TokenValuesAccess; - })(); - Shared.TokenValuesAccess = TokenValuesAccess; - var TokenSingleValueAccess = (function () { - function TokenSingleValueAccess(token) { - this.token = token; - } - TokenSingleValueAccess.prototype.GetTokens = function () { - return [this.token]; - }; - TokenSingleValueAccess.prototype.Contains = function (tokenValue) { - return tokenValue == this.token; - }; - TokenSingleValueAccess.prototype.toString = function () { - return "[singleTokenKind=" + TypeScript.SyntaxKind[this.token] + "]"; - }; - return TokenSingleValueAccess; - })(); - Shared.TokenSingleValueAccess = TokenSingleValueAccess; - var TokenAllAccess = (function () { - function TokenAllAccess() { - } - TokenAllAccess.prototype.GetTokens = function () { - var result = []; - for (var token = TypeScript.SyntaxKind.FirstToken; token <= TypeScript.SyntaxKind.LastToken; token++) { - result.push(token); - } - return result; - }; - TokenAllAccess.prototype.Contains = function (tokenValue) { - return true; - }; - TokenAllAccess.prototype.toString = function () { - return "[allTokens]"; - }; - return TokenAllAccess; - })(); - Shared.TokenAllAccess = TokenAllAccess; - var TokenRange = (function () { - function TokenRange(tokenAccess) { - this.tokenAccess = tokenAccess; - } - TokenRange.FromToken = function (token) { - return new TokenRange(new TokenSingleValueAccess(token)); - }; - TokenRange.FromTokens = function (tokens) { - return new TokenRange(new TokenValuesAccess(tokens)); - }; - TokenRange.FromRange = function (f, to, except) { - if (except === void 0) { except = []; } - return new TokenRange(new TokenRangeAccess(f, to, except)); - }; - TokenRange.AllTokens = function () { - return new TokenRange(new TokenAllAccess()); - }; - TokenRange.prototype.GetTokens = function () { - return this.tokenAccess.GetTokens(); - }; - TokenRange.prototype.Contains = function (token) { - return this.tokenAccess.Contains(token); - }; - TokenRange.prototype.toString = function () { - return this.tokenAccess.toString(); - }; - TokenRange.Any = TokenRange.AllTokens(); - TokenRange.AnyIncludingMultilineComments = TokenRange.FromTokens(TokenRange.Any.GetTokens().concat([6 /* MultiLineCommentTrivia */])); - TokenRange.Keywords = TokenRange.FromRange(TypeScript.SyntaxKind.FirstKeyword, TypeScript.SyntaxKind.LastKeyword); - TokenRange.Operators = TokenRange.FromRange(78 /* SemicolonToken */, 119 /* SlashEqualsToken */); - TokenRange.BinaryOperators = TokenRange.FromRange(80 /* LessThanToken */, 119 /* SlashEqualsToken */); - TokenRange.BinaryKeywordOperators = TokenRange.FromTokens([29 /* InKeyword */, 30 /* InstanceOfKeyword */]); - TokenRange.ReservedKeywords = TokenRange.FromRange(TypeScript.SyntaxKind.FirstFutureReservedStrictKeyword, TypeScript.SyntaxKind.LastFutureReservedStrictKeyword); - TokenRange.UnaryPrefixOperators = TokenRange.FromTokens([93 /* PlusPlusToken */, 94 /* MinusMinusToken */, 102 /* TildeToken */, 101 /* ExclamationToken */]); - TokenRange.UnaryPrefixExpressions = TokenRange.FromTokens([13 /* NumericLiteral */, 11 /* IdentifierName */, 72 /* OpenParenToken */, 74 /* OpenBracketToken */, 70 /* OpenBraceToken */, 35 /* ThisKeyword */, 31 /* NewKeyword */]); - TokenRange.UnaryPreincrementExpressions = TokenRange.FromTokens([11 /* IdentifierName */, 72 /* OpenParenToken */, 35 /* ThisKeyword */, 31 /* NewKeyword */]); - TokenRange.UnaryPostincrementExpressions = TokenRange.FromTokens([11 /* IdentifierName */, 73 /* CloseParenToken */, 75 /* CloseBracketToken */, 31 /* NewKeyword */]); - TokenRange.UnaryPredecrementExpressions = TokenRange.FromTokens([11 /* IdentifierName */, 72 /* OpenParenToken */, 35 /* ThisKeyword */, 31 /* NewKeyword */]); - TokenRange.UnaryPostdecrementExpressions = TokenRange.FromTokens([11 /* IdentifierName */, 73 /* CloseParenToken */, 75 /* CloseBracketToken */, 31 /* NewKeyword */]); - TokenRange.Comments = TokenRange.FromTokens([7 /* SingleLineCommentTrivia */, 6 /* MultiLineCommentTrivia */]); - TokenRange.TypeNames = TokenRange.FromTokens([11 /* IdentifierName */, 67 /* NumberKeyword */, 69 /* StringKeyword */, 61 /* BooleanKeyword */, 41 /* VoidKeyword */, 60 /* AnyKeyword */]); - return TokenRange; - })(); - Shared.TokenRange = TokenRange; - })(Shared = Formatting.Shared || (Formatting.Shared = {})); - })(Formatting = Services.Formatting || (Services.Formatting = {})); - })(Services = TypeScript.Services || (TypeScript.Services = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Services; - (function (Services) { - var Formatting; - (function (Formatting) { - var TokenSpan = (function (_super) { - __extends(TokenSpan, _super); - function TokenSpan(kind, start, length) { - _super.call(this, start, length); - this.kind = kind; - } - return TokenSpan; - })(TypeScript.TextSpan); - Formatting.TokenSpan = TokenSpan; - })(Formatting = Services.Formatting || (Services.Formatting = {})); - })(Services = TypeScript.Services || (TypeScript.Services = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Services; - (function (Services) { - var Formatting; - (function (Formatting) { - var IndentationNodeContext = (function () { - function IndentationNodeContext(parent, node, fullStart, indentationAmount, childIndentationAmountDelta) { - this.update(parent, node, fullStart, indentationAmount, childIndentationAmountDelta); - } - IndentationNodeContext.prototype.parent = function () { - return this._parent; - }; - IndentationNodeContext.prototype.node = function () { - return this._node; - }; - IndentationNodeContext.prototype.fullStart = function () { - return this._fullStart; - }; - IndentationNodeContext.prototype.fullWidth = function () { - return TypeScript.fullWidth(this._node); - }; - IndentationNodeContext.prototype.start = function () { - return this._fullStart + TypeScript.leadingTriviaWidth(this._node); - }; - IndentationNodeContext.prototype.end = function () { - return this._fullStart + TypeScript.leadingTriviaWidth(this._node) + TypeScript.width(this._node); - }; - IndentationNodeContext.prototype.indentationAmount = function () { - return this._indentationAmount; - }; - IndentationNodeContext.prototype.childIndentationAmountDelta = function () { - return this._childIndentationAmountDelta; - }; - IndentationNodeContext.prototype.depth = function () { - return this._depth; - }; - IndentationNodeContext.prototype.kind = function () { - return this._node.kind(); - }; - IndentationNodeContext.prototype.hasSkippedOrMissingTokenChild = function () { - if (this._hasSkippedOrMissingTokenChild === null) { - this._hasSkippedOrMissingTokenChild = TypeScript.Syntax.nodeHasSkippedOrMissingTokens(this._node); - } - return this._hasSkippedOrMissingTokenChild; - }; - IndentationNodeContext.prototype.clone = function (pool) { - var parent = null; - if (this._parent) { - parent = this._parent.clone(pool); - } - return pool.getNode(parent, this._node, this._fullStart, this._indentationAmount, this._childIndentationAmountDelta); - }; - IndentationNodeContext.prototype.update = function (parent, node, fullStart, indentationAmount, childIndentationAmountDelta) { - this._parent = parent; - this._node = node; - this._fullStart = fullStart; - this._indentationAmount = indentationAmount; - this._childIndentationAmountDelta = childIndentationAmountDelta; - this._hasSkippedOrMissingTokenChild = null; - if (parent) { - this._depth = parent.depth() + 1; - } - else { - this._depth = 0; - } - }; - return IndentationNodeContext; - })(); - Formatting.IndentationNodeContext = IndentationNodeContext; - })(Formatting = Services.Formatting || (Services.Formatting = {})); - })(Services = TypeScript.Services || (TypeScript.Services = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Services; - (function (Services) { - var Formatting; - (function (Formatting) { - var IndentationNodeContextPool = (function () { - function IndentationNodeContextPool() { - this.nodes = []; - } - IndentationNodeContextPool.prototype.getNode = function (parent, node, fullStart, indentationLevel, childIndentationLevelDelta) { - if (this.nodes.length > 0) { - var cachedNode = this.nodes.pop(); - cachedNode.update(parent, node, fullStart, indentationLevel, childIndentationLevelDelta); - return cachedNode; - } - return new Formatting.IndentationNodeContext(parent, node, fullStart, indentationLevel, childIndentationLevelDelta); - }; - IndentationNodeContextPool.prototype.releaseNode = function (node, recursive) { - if (recursive === void 0) { recursive = false; } - this.nodes.push(node); - if (recursive) { - var parent = node.parent(); - if (parent) { - this.releaseNode(parent, recursive); - } - } - }; - return IndentationNodeContextPool; - })(); - Formatting.IndentationNodeContextPool = IndentationNodeContextPool; - })(Formatting = Services.Formatting || (Services.Formatting = {})); - })(Services = TypeScript.Services || (TypeScript.Services = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Services; - (function (Services) { - var Formatting; - (function (Formatting) { - var IndentationTrackingWalker = (function (_super) { - __extends(IndentationTrackingWalker, _super); - function IndentationTrackingWalker(textSpan, sourceUnit, snapshot, indentFirstToken, options) { - _super.call(this); - this.options = options; - this._position = 0; - this._parent = null; - this._indentationNodeContextPool = new Formatting.IndentationNodeContextPool(); - this._textSpan = textSpan; - this._text = sourceUnit.syntaxTree.text; - this._snapshot = snapshot; - this._parent = this._indentationNodeContextPool.getNode(null, sourceUnit, 0, 0, 0); - this._lastTriviaWasNewLine = indentFirstToken; - } - IndentationTrackingWalker.prototype.position = function () { - return this._position; - }; - IndentationTrackingWalker.prototype.parent = function () { - return this._parent; - }; - IndentationTrackingWalker.prototype.textSpan = function () { - return this._textSpan; - }; - IndentationTrackingWalker.prototype.snapshot = function () { - return this._snapshot; - }; - IndentationTrackingWalker.prototype.indentationNodeContextPool = function () { - return this._indentationNodeContextPool; - }; - IndentationTrackingWalker.prototype.forceIndentNextToken = function (tokenStart) { - this._lastTriviaWasNewLine = true; - this.forceRecomputeIndentationOfParent(tokenStart, true); - }; - IndentationTrackingWalker.prototype.forceSkipIndentingNextToken = function (tokenStart) { - this._lastTriviaWasNewLine = false; - this.forceRecomputeIndentationOfParent(tokenStart, false); - }; - IndentationTrackingWalker.prototype.indentToken = function (token, indentationAmount, commentIndentationAmount) { - throw TypeScript.Errors.abstract(); - }; - IndentationTrackingWalker.prototype.visitTokenInSpan = function (token) { - if (this._lastTriviaWasNewLine) { - var indentationAmount = this.getTokenIndentationAmount(token); - var commentIndentationAmount = this.getCommentIndentationAmount(token); - this.indentToken(token, indentationAmount, commentIndentationAmount); - } - }; - IndentationTrackingWalker.prototype.visitToken = function (token) { - var tokenSpan = new TypeScript.TextSpan(this._position, token.fullWidth()); - if (tokenSpan.intersectsWithTextSpan(this._textSpan)) { - this.visitTokenInSpan(token); - var trivia = token.trailingTrivia(); - this._lastTriviaWasNewLine = trivia.hasNewLine() && trivia.syntaxTriviaAt(trivia.count() - 1).kind() == 5 /* NewLineTrivia */; - } - this._position += token.fullWidth(); - }; - IndentationTrackingWalker.prototype.visitNode = function (node) { - var nodeSpan = new TypeScript.TextSpan(this._position, TypeScript.fullWidth(node)); - if (nodeSpan.intersectsWithTextSpan(this._textSpan)) { - var indentation = this.getNodeIndentation(node); - var currentParent = this._parent; - this._parent = this._indentationNodeContextPool.getNode(currentParent, node, this._position, indentation.indentationAmount, indentation.indentationAmountDelta); - TypeScript.visitNodeOrToken(this, node); - this._indentationNodeContextPool.releaseNode(this._parent); - this._parent = currentParent; - } - else { - this._position += TypeScript.fullWidth(node); - } - }; - IndentationTrackingWalker.prototype.getTokenIndentationAmount = function (token) { - if (TypeScript.firstToken(this._parent.node()) === token || token.kind() === 70 /* OpenBraceToken */ || token.kind() === 71 /* CloseBraceToken */ || token.kind() === 74 /* OpenBracketToken */ || token.kind() === 75 /* CloseBracketToken */ || (token.kind() === 42 /* WhileKeyword */ && this._parent.node().kind() == 162 /* DoStatement */)) { - return this._parent.indentationAmount(); - } - return (this._parent.indentationAmount() + this._parent.childIndentationAmountDelta()); - }; - IndentationTrackingWalker.prototype.getCommentIndentationAmount = function (token) { - if (token.kind() === 71 /* CloseBraceToken */ || token.kind() === 75 /* CloseBracketToken */) { - return (this._parent.indentationAmount() + this._parent.childIndentationAmountDelta()); - } - return this._parent.indentationAmount(); - }; - IndentationTrackingWalker.prototype.getNodeIndentation = function (node, newLineInsertedByFormatting) { - var parent = this._parent; - var parentIndentationAmount; - if (this._textSpan.containsPosition(parent.start())) { - parentIndentationAmount = parent.indentationAmount(); - } - else { - if (parent.kind() === 147 /* Block */ && !this.shouldIndentBlockInParent(this._parent.parent())) { - parent = this._parent.parent(); - } - var line = this._snapshot.getLineFromPosition(parent.start()).getText(); - var firstNonWhiteSpacePosition = TypeScript.Indentation.firstNonWhitespacePosition(line); - parentIndentationAmount = TypeScript.Indentation.columnForPositionInString(line, firstNonWhiteSpacePosition, this.options); - } - var parentIndentationAmountDelta = parent.childIndentationAmountDelta(); - var indentationAmount; - var indentationAmountDelta; - var parentNode = parent.node(); - switch (node.kind()) { - default: - indentationAmount = (parentIndentationAmount + parentIndentationAmountDelta); - indentationAmountDelta = 0; - break; - case 132 /* ClassDeclaration */: - case 131 /* ModuleDeclaration */: - case 122 /* ObjectType */: - case 133 /* EnumDeclaration */: - case 152 /* SwitchStatement */: - case 216 /* ObjectLiteralExpression */: - case 138 /* ConstructorDeclaration */: - case 130 /* FunctionDeclaration */: - case 223 /* FunctionExpression */: - case 136 /* MemberFunctionDeclaration */: - case 140 /* GetAccessor */: - case 141 /* SetAccessor */: - case 139 /* IndexMemberDeclaration */: - case 237 /* CatchClause */: - case 215 /* ArrayLiteralExpression */: - case 124 /* ArrayType */: - case 222 /* ElementAccessExpression */: - case 145 /* IndexSignature */: - case 155 /* ForStatement */: - case 156 /* ForInStatement */: - case 159 /* WhileStatement */: - case 162 /* DoStatement */: - case 164 /* WithStatement */: - case 234 /* CaseSwitchClause */: - case 235 /* DefaultSwitchClause */: - case 151 /* ReturnStatement */: - case 158 /* ThrowStatement */: - case 220 /* SimpleArrowFunctionExpression */: - case 219 /* ParenthesizedArrowFunctionExpression */: - case 225 /* VariableDeclaration */: - case 135 /* ExportAssignment */: - case 214 /* InvocationExpression */: - case 217 /* ObjectCreationExpression */: - case 143 /* CallSignature */: - case 144 /* ConstructSignature */: - indentationAmount = (parentIndentationAmount + parentIndentationAmountDelta); - indentationAmountDelta = this.options.indentSpaces; - break; - case 148 /* IfStatement */: - if (parent.kind() === 236 /* ElseClause */ && !TypeScript.SyntaxUtilities.isLastTokenOnLine(parentNode.elseKeyword, this._text)) { - indentationAmount = parentIndentationAmount; - } - else { - indentationAmount = (parentIndentationAmount + parentIndentationAmountDelta); - } - indentationAmountDelta = this.options.indentSpaces; - break; - case 236 /* ElseClause */: - indentationAmount = parentIndentationAmount; - indentationAmountDelta = this.options.indentSpaces; - break; - case 147 /* Block */: - if (this.shouldIndentBlockInParent(parent)) { - indentationAmount = parentIndentationAmount + parentIndentationAmountDelta; - } - else { - indentationAmount = parentIndentationAmount; - } - indentationAmountDelta = this.options.indentSpaces; - break; - } - if (parentNode) { - if (!newLineInsertedByFormatting) { - var parentStartLine = this._snapshot.getLineNumberFromPosition(parent.start()); - var currentNodeStartLine = this._snapshot.getLineNumberFromPosition(this._position + TypeScript.leadingTriviaWidth(node)); - if (parentStartLine === currentNodeStartLine || newLineInsertedByFormatting === false) { - indentationAmount = parentIndentationAmount; - indentationAmountDelta = Math.min(this.options.indentSpaces, parentIndentationAmountDelta + indentationAmountDelta); - } - } - } - return { - indentationAmount: indentationAmount, - indentationAmountDelta: indentationAmountDelta - }; - }; - IndentationTrackingWalker.prototype.shouldIndentBlockInParent = function (parent) { - switch (parent.kind()) { - case 120 /* SourceUnit */: - case 131 /* ModuleDeclaration */: - case 147 /* Block */: - case 234 /* CaseSwitchClause */: - case 235 /* DefaultSwitchClause */: - return true; - default: - return false; - } - }; - IndentationTrackingWalker.prototype.forceRecomputeIndentationOfParent = function (tokenStart, newLineAdded) { - var parent = this._parent; - if (parent.fullStart() === tokenStart) { - this._parent = parent.parent(); - var indentation = this.getNodeIndentation(parent.node(), newLineAdded); - parent.update(parent.parent(), parent.node(), parent.fullStart(), indentation.indentationAmount, indentation.indentationAmountDelta); - this._parent = parent; - } - }; - return IndentationTrackingWalker; - })(TypeScript.SyntaxWalker); - Formatting.IndentationTrackingWalker = IndentationTrackingWalker; - })(Formatting = Services.Formatting || (Services.Formatting = {})); - })(Services = TypeScript.Services || (TypeScript.Services = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Services; - (function (Services) { - var Formatting; - (function (Formatting) { - var MultipleTokenIndenter = (function (_super) { - __extends(MultipleTokenIndenter, _super); - function MultipleTokenIndenter(textSpan, sourceUnit, snapshot, indentFirstToken, options) { - _super.call(this, textSpan, sourceUnit, snapshot, indentFirstToken, options); - this._edits = []; - } - MultipleTokenIndenter.prototype.indentToken = function (token, indentationAmount, commentIndentationAmount) { - if (token.fullWidth() === 0) { - return; - } - if (this.parent().hasSkippedOrMissingTokenChild()) { - return; - } - var tokenSpan = new TypeScript.TextSpan(this.position() + token.leadingTriviaWidth(), TypeScript.width(token)); - if (!this.textSpan().containsTextSpan(tokenSpan)) { - return; - } - var indentationString = TypeScript.Indentation.indentationString(indentationAmount, this.options); - var commentIndentationString = TypeScript.Indentation.indentationString(commentIndentationAmount, this.options); - this.recordIndentationEditsForToken(token, indentationString, commentIndentationString); - }; - MultipleTokenIndenter.prototype.edits = function () { - return this._edits; - }; - MultipleTokenIndenter.prototype.recordEdit = function (position, length, replaceWith) { - this._edits.push(new Formatting.TextEditInfo(position, length, replaceWith)); - }; - MultipleTokenIndenter.prototype.recordIndentationEditsForToken = function (token, indentationString, commentIndentationString) { - var position = this.position(); - var indentNextTokenOrTrivia = true; - var leadingWhiteSpace = ""; - var triviaList = token.leadingTrivia(); - if (triviaList) { - for (var i = 0, length = triviaList.count(); i < length; i++, position += trivia.fullWidth()) { - var trivia = triviaList.syntaxTriviaAt(i); - if (!this.textSpan().containsTextSpan(new TypeScript.TextSpan(position, trivia.fullWidth()))) { - continue; - } - switch (trivia.kind()) { - case 6 /* MultiLineCommentTrivia */: - this.recordIndentationEditsForMultiLineComment(trivia, position, commentIndentationString, leadingWhiteSpace, !indentNextTokenOrTrivia); - indentNextTokenOrTrivia = false; - leadingWhiteSpace = ""; - break; - case 7 /* SingleLineCommentTrivia */: - case 8 /* SkippedTokenTrivia */: - if (indentNextTokenOrTrivia) { - this.recordIndentationEditsForSingleLineOrSkippedText(trivia, position, commentIndentationString); - indentNextTokenOrTrivia = false; - } - break; - case 4 /* WhitespaceTrivia */: - var nextTrivia = length > i + 1 && triviaList.syntaxTriviaAt(i + 1); - var whiteSpaceIndentationString = nextTrivia && nextTrivia.isComment() ? commentIndentationString : indentationString; - if (indentNextTokenOrTrivia) { - if (!(nextTrivia && nextTrivia.isNewLine())) { - this.recordIndentationEditsForWhitespace(trivia, position, whiteSpaceIndentationString); - } - indentNextTokenOrTrivia = false; - } - leadingWhiteSpace += trivia.fullText(); - break; - case 5 /* NewLineTrivia */: - indentNextTokenOrTrivia = true; - leadingWhiteSpace = ""; - break; - default: - throw TypeScript.Errors.invalidOperation(); - } - } - } - if (token.kind() !== 10 /* EndOfFileToken */ && indentNextTokenOrTrivia) { - if (indentationString.length > 0) { - this.recordEdit(position, 0, indentationString); - } - } - }; - MultipleTokenIndenter.prototype.recordIndentationEditsForSingleLineOrSkippedText = function (trivia, fullStart, indentationString) { - if (indentationString.length > 0) { - this.recordEdit(fullStart, 0, indentationString); - } - }; - MultipleTokenIndenter.prototype.recordIndentationEditsForWhitespace = function (trivia, fullStart, indentationString) { - var text = trivia.fullText(); - if (indentationString === text) { - return; - } - this.recordEdit(fullStart, text.length, indentationString); - }; - MultipleTokenIndenter.prototype.recordIndentationEditsForMultiLineComment = function (trivia, fullStart, indentationString, leadingWhiteSpace, firstLineAlreadyIndented) { - var position = fullStart; - var segments = TypeScript.Syntax.splitMultiLineCommentTriviaIntoMultipleLines(trivia); - if (segments.length <= 1) { - if (!firstLineAlreadyIndented) { - this.recordIndentationEditsForSingleLineOrSkippedText(trivia, fullStart, indentationString); - } - return; - } - var whiteSpaceColumnsInFirstSegment = TypeScript.Indentation.columnForPositionInString(leadingWhiteSpace, leadingWhiteSpace.length, this.options); - var indentationColumns = TypeScript.Indentation.columnForPositionInString(indentationString, indentationString.length, this.options); - var startIndex = 0; - if (firstLineAlreadyIndented) { - startIndex = 1; - position += segments[0].length; - } - for (var i = startIndex; i < segments.length; i++) { - var segment = segments[i]; - this.recordIndentationEditsForSegment(segment, position, indentationColumns, whiteSpaceColumnsInFirstSegment); - position += segment.length; - } - }; - MultipleTokenIndenter.prototype.recordIndentationEditsForSegment = function (segment, fullStart, indentationColumns, whiteSpaceColumnsInFirstSegment) { - var firstNonWhitespacePosition = TypeScript.Indentation.firstNonWhitespacePosition(segment); - var leadingWhiteSpaceColumns = TypeScript.Indentation.columnForPositionInString(segment, firstNonWhitespacePosition, this.options); - var deltaFromFirstSegment = leadingWhiteSpaceColumns - whiteSpaceColumnsInFirstSegment; - var finalColumns = indentationColumns + deltaFromFirstSegment; - if (finalColumns < 0) { - finalColumns = 0; - } - var indentationString = TypeScript.Indentation.indentationString(finalColumns, this.options); - if (firstNonWhitespacePosition < segment.length && TypeScript.CharacterInfo.isLineTerminator(segment.charCodeAt(firstNonWhitespacePosition))) { - return; - } - if (indentationString === segment.substring(0, firstNonWhitespacePosition)) { - return; - } - this.recordEdit(fullStart, firstNonWhitespacePosition, indentationString); - }; - return MultipleTokenIndenter; - })(Formatting.IndentationTrackingWalker); - Formatting.MultipleTokenIndenter = MultipleTokenIndenter; - })(Formatting = Services.Formatting || (Services.Formatting = {})); - })(Services = TypeScript.Services || (TypeScript.Services = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Services; - (function (Services) { - var Formatting; - (function (Formatting) { - var Formatter = (function (_super) { - __extends(Formatter, _super); - function Formatter(textSpan, sourceUnit, indentFirstToken, options, snapshot, rulesProvider, formattingRequestKind) { - _super.call(this, textSpan, sourceUnit, snapshot, indentFirstToken, options); - this.previousTokenSpan = null; - this.previousTokenParent = null; - this.scriptHasErrors = false; - this.previousTokenParent = this.parent().clone(this.indentationNodeContextPool()); - this.rulesProvider = rulesProvider; - this.formattingRequestKind = formattingRequestKind; - this.formattingContext = new Formatting.FormattingContext(this.snapshot(), this.formattingRequestKind); - } - Formatter.getEdits = function (textSpan, sourceUnit, options, indentFirstToken, snapshot, rulesProvider, formattingRequestKind) { - var walker = new Formatter(textSpan, sourceUnit, indentFirstToken, options, snapshot, rulesProvider, formattingRequestKind); - TypeScript.visitNodeOrToken(walker, sourceUnit); - return walker.edits(); - }; - Formatter.prototype.visitTokenInSpan = function (token) { - if (token.fullWidth() !== 0) { - var tokenSpan = new TypeScript.TextSpan(this.position() + token.leadingTriviaWidth(), TypeScript.width(token)); - if (this.textSpan().containsTextSpan(tokenSpan)) { - this.processToken(token); - } - } - _super.prototype.visitTokenInSpan.call(this, token); - }; - Formatter.prototype.processToken = function (token) { - var position = this.position(); - if (token.leadingTriviaWidth() !== 0) { - this.processTrivia(token.leadingTrivia(), position); - position += token.leadingTriviaWidth(); - } - var currentTokenSpan = new Formatting.TokenSpan(token.kind(), position, TypeScript.width(token)); - if (!this.parent().hasSkippedOrMissingTokenChild()) { - if (this.previousTokenSpan) { - this.formatPair(this.previousTokenSpan, this.previousTokenParent, currentTokenSpan, this.parent()); - } - else { - this.trimWhitespaceInLineRange(this.getLineNumber(this.textSpan()), this.getLineNumber(currentTokenSpan)); - } - } - this.previousTokenSpan = currentTokenSpan; - if (this.previousTokenParent) { - this.indentationNodeContextPool().releaseNode(this.previousTokenParent, true); - } - this.previousTokenParent = this.parent().clone(this.indentationNodeContextPool()); - position += TypeScript.width(token); - if (token.trailingTriviaWidth() !== 0) { - this.processTrivia(token.trailingTrivia(), position); - } - }; - Formatter.prototype.processTrivia = function (triviaList, fullStart) { - var position = fullStart; - for (var i = 0, n = triviaList.count(); i < n; i++) { - var trivia = triviaList.syntaxTriviaAt(i); - if (trivia.isComment() || trivia.isSkippedToken()) { - var currentTokenSpan = new Formatting.TokenSpan(trivia.kind(), position, trivia.fullWidth()); - if (this.textSpan().containsTextSpan(currentTokenSpan)) { - if (trivia.isComment() && this.previousTokenSpan) { - this.formatPair(this.previousTokenSpan, this.previousTokenParent, currentTokenSpan, this.parent()); - } - else { - var startLine = this.getLineNumber(this.previousTokenSpan || this.textSpan()); - this.trimWhitespaceInLineRange(startLine, this.getLineNumber(currentTokenSpan)); - } - this.previousTokenSpan = currentTokenSpan; - if (this.previousTokenParent) { - this.indentationNodeContextPool().releaseNode(this.previousTokenParent, true); - } - this.previousTokenParent = this.parent().clone(this.indentationNodeContextPool()); - } - } - position += trivia.fullWidth(); - } - }; - Formatter.prototype.findCommonParents = function (parent1, parent2) { - var shallowParent; - var shallowParentDepth; - var deepParent; - var deepParentDepth; - if (parent1.depth() < parent2.depth()) { - shallowParent = parent1; - shallowParentDepth = parent1.depth(); - deepParent = parent2; - deepParentDepth = parent2.depth(); - } - else { - shallowParent = parent2; - shallowParentDepth = parent2.depth(); - deepParent = parent1; - deepParentDepth = parent1.depth(); - } - TypeScript.Debug.assert(shallowParentDepth >= 0, "Expected shallowParentDepth >= 0"); - TypeScript.Debug.assert(deepParentDepth >= 0, "Expected deepParentDepth >= 0"); - TypeScript.Debug.assert(deepParentDepth >= shallowParentDepth, "Expected deepParentDepth >= shallowParentDepth"); - while (deepParentDepth > shallowParentDepth) { - deepParent = deepParent.parent(); - deepParentDepth--; - } - TypeScript.Debug.assert(deepParentDepth === shallowParentDepth, "Expected deepParentDepth === shallowParentDepth"); - while (deepParent.node() && shallowParent.node()) { - if (deepParent.node() === shallowParent.node()) { - return deepParent; - } - deepParent = deepParent.parent(); - shallowParent = shallowParent.parent(); - } - throw TypeScript.Errors.invalidOperation(); - }; - Formatter.prototype.formatPair = function (t1, t1Parent, t2, t2Parent) { - var token1Line = this.getLineNumber(t1); - var token2Line = this.getLineNumber(t2); - var commonParent = this.findCommonParents(t1Parent, t2Parent); - this.formattingContext.updateContext(t1, t1Parent, t2, t2Parent, commonParent); - var rule = this.rulesProvider.getRulesMap().GetRule(this.formattingContext); - if (rule != null) { - this.RecordRuleEdits(rule, t1, t2); - if ((rule.Operation.Action == 1 /* Space */ || rule.Operation.Action == 3 /* Delete */) && token1Line != token2Line) { - this.forceSkipIndentingNextToken(t2.start()); - } - if (rule.Operation.Action == 2 /* NewLine */ && token1Line == token2Line) { - this.forceIndentNextToken(t2.start()); - } - } - if (token1Line != token2Line && (!rule || (rule.Operation.Action != 3 /* Delete */ && rule.Flag != 1 /* CanDeleteNewLines */))) { - this.trimWhitespaceInLineRange(token1Line, token2Line, t1); - } - }; - Formatter.prototype.getLineNumber = function (span) { - return this.snapshot().getLineNumberFromPosition(span.start()); - }; - Formatter.prototype.trimWhitespaceInLineRange = function (startLine, endLine, token) { - for (var lineNumber = startLine; lineNumber < endLine; ++lineNumber) { - var line = this.snapshot().getLineFromLineNumber(lineNumber); - this.trimWhitespace(line, token); - } - }; - Formatter.prototype.trimWhitespace = function (line, token) { - if (token && (token.kind == 6 /* MultiLineCommentTrivia */ || token.kind == 7 /* SingleLineCommentTrivia */) && token.start() <= line.endPosition() && token.end() >= line.endPosition()) - return; - var text = line.getText(); - var index = 0; - for (index = text.length - 1; index >= 0; --index) { - if (!TypeScript.CharacterInfo.isWhitespace(text.charCodeAt(index))) { - break; - } - } - ++index; - if (index < text.length) { - this.recordEdit(line.startPosition() + index, line.length() - index, ""); - } - }; - Formatter.prototype.RecordRuleEdits = function (rule, t1, t2) { - if (rule.Operation.Action == 0 /* Ignore */) { - return; - } - var betweenSpan; - switch (rule.Operation.Action) { - case 3 /* Delete */: - { - betweenSpan = new TypeScript.TextSpan(t1.end(), t2.start() - t1.end()); - if (betweenSpan.length() > 0) { - this.recordEdit(betweenSpan.start(), betweenSpan.length(), ""); - return; - } - } - break; - case 2 /* NewLine */: - { - if (!(rule.Flag == 1 /* CanDeleteNewLines */ || this.getLineNumber(t1) == this.getLineNumber(t2))) { - return; - } - betweenSpan = new TypeScript.TextSpan(t1.end(), t2.start() - t1.end()); - var doEdit = false; - var betweenText = this.snapshot().getText(betweenSpan); - var lineFeedLoc = betweenText.indexOf(this.options.newLineCharacter); - if (lineFeedLoc < 0) { - doEdit = true; - } - else { - lineFeedLoc = betweenText.indexOf(this.options.newLineCharacter, lineFeedLoc + 1); - if (lineFeedLoc >= 0) { - doEdit = true; - } - } - if (doEdit) { - this.recordEdit(betweenSpan.start(), betweenSpan.length(), this.options.newLineCharacter); - return; - } - } - break; - case 1 /* Space */: - { - if (!(rule.Flag == 1 /* CanDeleteNewLines */ || this.getLineNumber(t1) == this.getLineNumber(t2))) { - return; - } - betweenSpan = new TypeScript.TextSpan(t1.end(), t2.start() - t1.end()); - if (betweenSpan.length() > 1 || this.snapshot().getText(betweenSpan) != " ") { - this.recordEdit(betweenSpan.start(), betweenSpan.length(), " "); - return; - } - } - break; - } - }; - return Formatter; - })(Formatting.MultipleTokenIndenter); - Formatting.Formatter = Formatter; - })(Formatting = Services.Formatting || (Services.Formatting = {})); - })(Services = TypeScript.Services || (TypeScript.Services = {})); -})(TypeScript || (TypeScript = {})); -var ts; -(function (ts) { - var formatting; - (function (formatting) { - var SmartIndenter; - (function (SmartIndenter) { - function getIndentation(position, sourceFile, options) { - if (position > sourceFile.text.length) { - return 0; - } - var precedingToken = ts.findPrecedingToken(position, sourceFile); - if (!precedingToken) { - return 0; - } - if ((precedingToken.kind === 7 /* StringLiteral */ || precedingToken.kind === 8 /* RegularExpressionLiteral */) && precedingToken.getStart(sourceFile) <= position && precedingToken.end > position) { - return 0; - } - var lineAtPosition = sourceFile.getLineAndCharacterFromPosition(position).line; - if (precedingToken.kind === 18 /* CommaToken */ && precedingToken.parent.kind !== 145 /* BinaryExpression */) { - var actualIndentation = getActualIndentationForListItemBeforeComma(precedingToken, sourceFile, options); - if (actualIndentation !== -1) { - return actualIndentation; - } - } - var previous; - var current = precedingToken; - var currentStart; - var indentationDelta; - while (current) { - if (positionBelongsToNode(current, position, sourceFile) && nodeContentIsIndented(current, previous)) { - currentStart = getStartLineAndCharacterForNode(current, sourceFile); - if (nextTokenIsCurlyBraceOnSameLineAsCursor(precedingToken, current, lineAtPosition, sourceFile)) { - indentationDelta = 0; - } - else { - indentationDelta = lineAtPosition !== currentStart.line ? options.indentSpaces : 0; - } - break; - } - var actualIndentation = getActualIndentationForListItem(current, sourceFile, options); - if (actualIndentation !== -1) { - return actualIndentation; - } - previous = current; - current = current.parent; - } - if (!current) { - return 0; - } - var parent = current.parent; - var parentStart; - while (parent) { - var actualIndentation = getActualIndentationForListItem(current, sourceFile, options); - if (actualIndentation !== -1) { - return actualIndentation + indentationDelta; - } - parentStart = sourceFile.getLineAndCharacterFromPosition(parent.getStart(sourceFile)); - var parentAndChildShareLine = parentStart.line === currentStart.line || childStartsOnTheSameLineWithElseInIfStatement(parent, current, currentStart.line, sourceFile); - var actualIndentation = getActualIndentationForNode(current, parent, currentStart, parentAndChildShareLine, sourceFile, options); - if (actualIndentation !== -1) { - return actualIndentation + indentationDelta; - } - if (nodeContentIsIndented(parent, current) && !parentAndChildShareLine) { - indentationDelta += options.indentSpaces; - } - current = parent; - currentStart = parentStart; - parent = current.parent; - } - return indentationDelta; - } - SmartIndenter.getIndentation = getIndentation; - function getActualIndentationForListItemBeforeComma(commaToken, sourceFile, options) { - var commaItemInfo = ts.findListItemInfo(commaToken); - ts.Debug.assert(commaItemInfo && commaItemInfo.listItemIndex > 0); - return deriveActualIndentationFromList(commaItemInfo.list.getChildren(), commaItemInfo.listItemIndex - 1, sourceFile, options); - } - function getActualIndentationForNode(current, parent, currentLineAndChar, parentAndChildShareLine, sourceFile, options) { - var useActualIndentation = (ts.isDeclaration(current) || ts.isStatement(current)) && (parent.kind === 182 /* SourceFile */ || !parentAndChildShareLine); - if (!useActualIndentation) { - return -1; - } - return findColumnForFirstNonWhitespaceCharacterInLine(currentLineAndChar, sourceFile, options); - } - function nextTokenIsCurlyBraceOnSameLineAsCursor(precedingToken, current, lineAtPosition, sourceFile) { - var nextToken = ts.findNextToken(precedingToken, current); - if (!nextToken) { - return false; - } - if (nextToken.kind === 9 /* OpenBraceToken */) { - return true; - } - else if (nextToken.kind === 10 /* CloseBraceToken */) { - var nextTokenStartLine = getStartLineAndCharacterForNode(nextToken, sourceFile).line; - return lineAtPosition === nextTokenStartLine; - } - return false; - } - function getStartLineAndCharacterForNode(n, sourceFile) { - return sourceFile.getLineAndCharacterFromPosition(n.getStart(sourceFile)); - } - function positionBelongsToNode(candidate, position, sourceFile) { - return candidate.end > position || !isCompletedNode(candidate, sourceFile); - } - function childStartsOnTheSameLineWithElseInIfStatement(parent, child, childStartLine, sourceFile) { - if (parent.kind === 152 /* IfStatement */ && parent.elseStatement === child) { - var elseKeyword = ts.findChildOfKind(parent, 70 /* ElseKeyword */, sourceFile); - ts.Debug.assert(elseKeyword); - var elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line; - return elseKeywordStartLine === childStartLine; - } - } - function getActualIndentationForListItem(node, sourceFile, options) { - if (node.parent) { - switch (node.parent.kind) { - case 127 /* TypeReference */: - if (node.parent.typeArguments) { - return getActualIndentationFromList(node.parent.typeArguments); - } - break; - case 133 /* ObjectLiteral */: - return getActualIndentationFromList(node.parent.properties); - case 129 /* TypeLiteral */: - return getActualIndentationFromList(node.parent.members); - case 132 /* ArrayLiteral */: - return getActualIndentationFromList(node.parent.elements); - case 172 /* FunctionDeclaration */: - case 141 /* FunctionExpression */: - case 142 /* ArrowFunction */: - case 120 /* Method */: - case 124 /* CallSignature */: - case 125 /* ConstructSignature */: - if (node.parent.typeParameters && node.end < node.parent.typeParameters.end) { - return getActualIndentationFromList(node.parent.typeParameters); - } - return getActualIndentationFromList(node.parent.parameters); - case 138 /* NewExpression */: - case 137 /* CallExpression */: - if (node.parent.typeArguments && node.end < node.parent.typeArguments.end) { - return getActualIndentationFromList(node.parent.typeArguments); - } - return getActualIndentationFromList(node.parent.arguments); - } - } - return -1; - function getActualIndentationFromList(list) { - var index = ts.indexOf(list, node); - return index !== -1 ? deriveActualIndentationFromList(list, index, sourceFile, options) : -1; - } - } - function deriveActualIndentationFromList(list, index, sourceFile, options) { - ts.Debug.assert(index >= 0 && index < list.length); - var node = list[index]; - var lineAndCharacter = getStartLineAndCharacterForNode(node, sourceFile); - for (var i = index - 1; i >= 0; --i) { - if (list[i].kind === 18 /* CommaToken */) { - continue; - } - var prevEndLine = sourceFile.getLineAndCharacterFromPosition(list[i].end).line; - if (prevEndLine !== lineAndCharacter.line) { - return findColumnForFirstNonWhitespaceCharacterInLine(lineAndCharacter, sourceFile, options); - } - lineAndCharacter = getStartLineAndCharacterForNode(list[i], sourceFile); - } - return -1; - } - function findColumnForFirstNonWhitespaceCharacterInLine(lineAndCharacter, sourceFile, options) { - var lineStart = sourceFile.getPositionFromLineAndCharacter(lineAndCharacter.line, 1); - var column = 0; - for (var i = 0; i < lineAndCharacter.character; ++i) { - var charCode = sourceFile.text.charCodeAt(lineStart + i); - if (!ts.isWhiteSpace(charCode)) { - return column; - } - if (charCode === 9 /* tab */) { - column += options.spacesPerTab; - } - else { - column++; - } - } - return column; - } - function nodeContentIsIndented(parent, child) { - switch (parent.kind) { - case 174 /* ClassDeclaration */: - case 175 /* InterfaceDeclaration */: - case 176 /* EnumDeclaration */: - return true; - case 177 /* ModuleDeclaration */: - return false; - case 172 /* FunctionDeclaration */: - case 120 /* Method */: - case 141 /* FunctionExpression */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 121 /* Constructor */: - return false; - case 153 /* DoStatement */: - case 154 /* WhileStatement */: - case 156 /* ForInStatement */: - case 155 /* ForStatement */: - return child && child.kind !== 148 /* Block */; - case 152 /* IfStatement */: - return child && child.kind !== 148 /* Block */; - case 166 /* TryStatement */: - return false; - case 132 /* ArrayLiteral */: - case 148 /* Block */: - case 173 /* FunctionBlock */: - case 167 /* TryBlock */: - case 168 /* CatchBlock */: - case 169 /* FinallyBlock */: - case 178 /* ModuleBlock */: - case 133 /* ObjectLiteral */: - case 129 /* TypeLiteral */: - case 161 /* SwitchStatement */: - case 163 /* DefaultClause */: - case 162 /* CaseClause */: - case 140 /* ParenExpression */: - case 137 /* CallExpression */: - case 138 /* NewExpression */: - case 149 /* VariableStatement */: - case 171 /* VariableDeclaration */: - return true; - default: - return false; - } - } - function nodeEndsWith(n, expectedLastToken, sourceFile) { - var children = n.getChildren(sourceFile); - if (children.length) { - var last = children[children.length - 1]; - if (last.kind === expectedLastToken) { - return true; - } - else if (last.kind === 17 /* SemicolonToken */ && children.length !== 1) { - return children[children.length - 2].kind === expectedLastToken; - } - } - return false; - } - function isCompletedNode(n, sourceFile) { - switch (n.kind) { - case 174 /* ClassDeclaration */: - case 175 /* InterfaceDeclaration */: - case 176 /* EnumDeclaration */: - case 133 /* ObjectLiteral */: - case 148 /* Block */: - case 168 /* CatchBlock */: - case 169 /* FinallyBlock */: - case 173 /* FunctionBlock */: - case 178 /* ModuleBlock */: - case 161 /* SwitchStatement */: - return nodeEndsWith(n, 10 /* CloseBraceToken */, sourceFile); - case 140 /* ParenExpression */: - case 124 /* CallSignature */: - case 137 /* CallExpression */: - case 125 /* ConstructSignature */: - return nodeEndsWith(n, 12 /* CloseParenToken */, sourceFile); - case 172 /* FunctionDeclaration */: - case 141 /* FunctionExpression */: - case 120 /* Method */: - case 142 /* ArrowFunction */: - return !n.body || isCompletedNode(n.body, sourceFile); - case 177 /* ModuleDeclaration */: - return n.body && isCompletedNode(n.body, sourceFile); - case 152 /* IfStatement */: - if (n.elseStatement) { - return isCompletedNode(n.elseStatement, sourceFile); - } - return isCompletedNode(n.thenStatement, sourceFile); - case 151 /* ExpressionStatement */: - return isCompletedNode(n.expression, sourceFile); - case 132 /* ArrayLiteral */: - return nodeEndsWith(n, 14 /* CloseBracketToken */, sourceFile); - case 115 /* Missing */: - return false; - case 162 /* CaseClause */: - case 163 /* DefaultClause */: - return false; - case 154 /* WhileStatement */: - return isCompletedNode(n.statement, sourceFile); - case 153 /* DoStatement */: - var hasWhileKeyword = ts.findChildOfKind(n, 94 /* WhileKeyword */, sourceFile); - if (hasWhileKeyword) { - return nodeEndsWith(n, 12 /* CloseParenToken */, sourceFile); - } - return isCompletedNode(n.statement, sourceFile); - default: - return true; - } - } - })(SmartIndenter = formatting.SmartIndenter || (formatting.SmartIndenter = {})); - })(formatting = ts.formatting || (ts.formatting = {})); -})(ts || (ts = {})); -var TypeScript; -(function (TypeScript) { - var NullLogger = (function () { - function NullLogger() { - } - NullLogger.prototype.log = function (s) { - }; - return NullLogger; - })(); - TypeScript.NullLogger = NullLogger; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var proto = "__proto__"; - var BlockIntrinsics = (function () { - function BlockIntrinsics() { - this.prototype = undefined; - this.toString = undefined; - this.toLocaleString = undefined; - this.valueOf = undefined; - this.hasOwnProperty = undefined; - this.propertyIsEnumerable = undefined; - this.isPrototypeOf = undefined; - this["constructor"] = undefined; - this[proto] = null; - this[proto] = undefined; - } - return BlockIntrinsics; - })(); - function createIntrinsicsObject() { - return new BlockIntrinsics(); - } - TypeScript.createIntrinsicsObject = createIntrinsicsObject; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Comment = (function () { - function Comment(_trivia, endsLine, _start, _end) { - this._trivia = _trivia; - this.endsLine = endsLine; - this._start = _start; - this._end = _end; - } - Comment.prototype.start = function () { - return this._start; - }; - Comment.prototype.end = function () { - return this._end; - }; - Comment.prototype.fullText = function () { - return this._trivia.fullText(); - }; - Comment.prototype.kind = function () { - return this._trivia.kind(); - }; - Comment.prototype.structuralEquals = function (ast, includingPosition) { - if (includingPosition) { - if (this.start() !== ast.start() || this.end() !== ast.end()) { - return false; - } - } - return this._trivia.fullText() === ast._trivia.fullText() && this.endsLine === ast.endsLine; - }; - return Comment; - })(); - TypeScript.Comment = Comment; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - function walkListChildren(preAst, walker) { - for (var i = 0, n = preAst.length; i < n; i++) { - walker.walk(preAst[i]); - } - } - function walkThrowStatementChildren(preAst, walker) { - walker.walk(preAst.expression); - } - function walkPrefixUnaryExpressionChildren(preAst, walker) { - walker.walk(preAst.operand); - } - function walkPostfixUnaryExpressionChildren(preAst, walker) { - walker.walk(preAst.operand); - } - function walkDeleteExpressionChildren(preAst, walker) { - walker.walk(preAst.expression); - } - function walkTypeArgumentListChildren(preAst, walker) { - walker.walk(preAst.typeArguments); - } - function walkTupleTypeChildren(preAst, walker) { - walker.walk(preAst.types); - } - function walkTypeOfExpressionChildren(preAst, walker) { - walker.walk(preAst.expression); - } - function walkVoidExpressionChildren(preAst, walker) { - walker.walk(preAst.expression); - } - function walkArgumentListChildren(preAst, walker) { - walker.walk(preAst.typeArgumentList); - walker.walk(preAst.arguments); - } - function walkArrayLiteralExpressionChildren(preAst, walker) { - walker.walk(preAst.expressions); - } - function walkSimplePropertyAssignmentChildren(preAst, walker) { - walker.walk(preAst.propertyName); - walker.walk(preAst.expression); - } - function walkFunctionPropertyAssignmentChildren(preAst, walker) { - walker.walk(preAst.propertyName); - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - } - function walkGetAccessorChildren(preAst, walker) { - walker.walk(preAst.propertyName); - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - } - function walkSeparatedListChildren(preAst, walker) { - for (var i = 0, n = preAst.length; i < n; i++) { - walker.walk(preAst[i]); - } - } - function walkSetAccessorChildren(preAst, walker) { - walker.walk(preAst.propertyName); - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - } - function walkObjectLiteralExpressionChildren(preAst, walker) { - walker.walk(preAst.propertyAssignments); - } - function walkCastExpressionChildren(preAst, walker) { - walker.walk(preAst.type); - walker.walk(preAst.expression); - } - function walkParenthesizedExpressionChildren(preAst, walker) { - walker.walk(preAst.expression); - } - function walkElementAccessExpressionChildren(preAst, walker) { - walker.walk(preAst.expression); - walker.walk(preAst.argumentExpression); - } - function walkMemberAccessExpressionChildren(preAst, walker) { - walker.walk(preAst.expression); - walker.walk(preAst.name); - } - function walkQualifiedNameChildren(preAst, walker) { - walker.walk(preAst.left); - walker.walk(preAst.right); - } - function walkBinaryExpressionChildren(preAst, walker) { - walker.walk(preAst.left); - walker.walk(preAst.right); - } - function walkEqualsValueClauseChildren(preAst, walker) { - walker.walk(preAst.value); - } - function walkTypeParameterChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.constraint); - } - function walkTypeParameterListChildren(preAst, walker) { - walker.walk(preAst.typeParameters); - } - function walkGenericTypeChildren(preAst, walker) { - walker.walk(preAst.name); - walker.walk(preAst.typeArgumentList); - } - function walkTypeAnnotationChildren(preAst, walker) { - walker.walk(preAst.type); - } - function walkTypeQueryChildren(preAst, walker) { - walker.walk(preAst.name); - } - function walkInvocationExpressionChildren(preAst, walker) { - walker.walk(preAst.expression); - walker.walk(preAst.argumentList); - } - function walkObjectCreationExpressionChildren(preAst, walker) { - walker.walk(preAst.expression); - walker.walk(preAst.argumentList); - } - function walkTrinaryExpressionChildren(preAst, walker) { - walker.walk(preAst.condition); - walker.walk(preAst.whenTrue); - walker.walk(preAst.whenFalse); - } - function walkFunctionExpressionChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - } - function walkFunctionTypeChildren(preAst, walker) { - walker.walk(preAst.typeParameterList); - walker.walk(preAst.parameterList); - walker.walk(preAst.type); - } - function walkParenthesizedArrowFunctionExpressionChildren(preAst, walker) { - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - walker.walk(preAst.expression); - } - function walkSimpleArrowFunctionExpressionChildren(preAst, walker) { - walker.walk(preAst.parameter); - walker.walk(preAst.block); - walker.walk(preAst.expression); - } - function walkMemberFunctionDeclarationChildren(preAst, walker) { - walker.walk(preAst.propertyName); - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - } - function walkFuncDeclChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - } - function walkIndexMemberDeclarationChildren(preAst, walker) { - walker.walk(preAst.indexSignature); - } - function walkIndexSignatureChildren(preAst, walker) { - walker.walk(preAst.parameters); - walker.walk(preAst.typeAnnotation); - } - function walkCallSignatureChildren(preAst, walker) { - walker.walk(preAst.typeParameterList); - walker.walk(preAst.parameterList); - walker.walk(preAst.typeAnnotation); - } - function walkConstraintChildren(preAst, walker) { - walker.walk(preAst.typeOrExpression); - } - function walkConstructorDeclarationChildren(preAst, walker) { - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - } - function walkConstructorTypeChildren(preAst, walker) { - walker.walk(preAst.typeParameterList); - walker.walk(preAst.parameterList); - walker.walk(preAst.type); - } - function walkConstructSignatureChildren(preAst, walker) { - walker.walk(preAst.callSignature); - } - function walkParameterChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.typeAnnotation); - walker.walk(preAst.equalsValueClause); - } - function walkParameterListChildren(preAst, walker) { - walker.walk(preAst.parameters); - } - function walkPropertySignatureChildren(preAst, walker) { - walker.walk(preAst.propertyName); - walker.walk(preAst.typeAnnotation); - } - function walkVariableDeclaratorChildren(preAst, walker) { - walker.walk(preAst.propertyName); - walker.walk(preAst.typeAnnotation); - walker.walk(preAst.equalsValueClause); - } - function walkMemberVariableDeclarationChildren(preAst, walker) { - walker.walk(preAst.variableDeclarator); - } - function walkMethodSignatureChildren(preAst, walker) { - walker.walk(preAst.propertyName); - walker.walk(preAst.callSignature); - } - function walkReturnStatementChildren(preAst, walker) { - walker.walk(preAst.expression); - } - function walkForStatementChildren(preAst, walker) { - walker.walk(preAst.variableDeclaration); - walker.walk(preAst.initializer); - walker.walk(preAst.condition); - walker.walk(preAst.incrementor); - walker.walk(preAst.statement); - } - function walkForInStatementChildren(preAst, walker) { - walker.walk(preAst.variableDeclaration); - walker.walk(preAst.left); - walker.walk(preAst.expression); - walker.walk(preAst.statement); - } - function walkIfStatementChildren(preAst, walker) { - walker.walk(preAst.condition); - walker.walk(preAst.statement); - walker.walk(preAst.elseClause); - } - function walkElseClauseChildren(preAst, walker) { - walker.walk(preAst.statement); - } - function walkWhileStatementChildren(preAst, walker) { - walker.walk(preAst.condition); - walker.walk(preAst.statement); - } - function walkDoStatementChildren(preAst, walker) { - walker.walk(preAst.condition); - walker.walk(preAst.statement); - } - function walkBlockChildren(preAst, walker) { - walker.walk(preAst.statements); - } - function walkVariableDeclarationChildren(preAst, walker) { - walker.walk(preAst.variableDeclarators); - } - function walkCaseSwitchClauseChildren(preAst, walker) { - walker.walk(preAst.expression); - walker.walk(preAst.statements); - } - function walkDefaultSwitchClauseChildren(preAst, walker) { - walker.walk(preAst.statements); - } - function walkSwitchStatementChildren(preAst, walker) { - walker.walk(preAst.expression); - walker.walk(preAst.switchClauses); - } - function walkTryStatementChildren(preAst, walker) { - walker.walk(preAst.block); - walker.walk(preAst.catchClause); - walker.walk(preAst.finallyClause); - } - function walkCatchClauseChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.typeAnnotation); - walker.walk(preAst.block); - } - function walkExternalModuleReferenceChildren(preAst, walker) { - walker.walk(preAst.stringLiteral); - } - function walkFinallyClauseChildren(preAst, walker) { - walker.walk(preAst.block); - } - function walkClassDeclChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.typeParameterList); - walker.walk(preAst.heritageClauses); - walker.walk(preAst.classElements); - } - function walkScriptChildren(preAst, walker) { - walker.walk(preAst.moduleElements); - } - function walkHeritageClauseChildren(preAst, walker) { - walker.walk(preAst.typeNames); - } - function walkInterfaceDeclerationChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.typeParameterList); - walker.walk(preAst.heritageClauses); - walker.walk(preAst.body); - } - function walkObjectTypeChildren(preAst, walker) { - walker.walk(preAst.typeMembers); - } - function walkArrayTypeChildren(preAst, walker) { - walker.walk(preAst.type); - } - function walkModuleDeclarationChildren(preAst, walker) { - walker.walk(preAst.name); - walker.walk(preAst.stringLiteral); - walker.walk(preAst.moduleElements); - } - function walkModuleNameModuleReferenceChildren(preAst, walker) { - walker.walk(preAst.moduleName); - } - function walkEnumDeclarationChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.enumElements); - } - function walkEnumElementChildren(preAst, walker) { - walker.walk(preAst.propertyName); - walker.walk(preAst.equalsValueClause); - } - function walkImportDeclarationChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.moduleReference); - } - function walkExportAssignmentChildren(preAst, walker) { - walker.walk(preAst.identifier); - } - function walkWithStatementChildren(preAst, walker) { - walker.walk(preAst.condition); - walker.walk(preAst.statement); - } - function walkExpressionStatementChildren(preAst, walker) { - walker.walk(preAst.expression); - } - function walkLabeledStatementChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.statement); - } - function walkVariableStatementChildren(preAst, walker) { - walker.walk(preAst.variableDeclaration); - } - var childrenWalkers = new Array(TypeScript.SyntaxKind.LastNode + 1); - for (var i = TypeScript.SyntaxKind.FirstToken, n = TypeScript.SyntaxKind.LastToken; i <= n; i++) { - childrenWalkers[i] = null; - } - for (var i = TypeScript.SyntaxKind.FirstTrivia, n = TypeScript.SyntaxKind.LastTrivia; i <= n; i++) { - childrenWalkers[i] = null; - } - childrenWalkers[176 /* AddAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[209 /* AddExpression */] = walkBinaryExpressionChildren; - childrenWalkers[181 /* AndAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[60 /* AnyKeyword */] = null; - childrenWalkers[227 /* ArgumentList */] = walkArgumentListChildren; - childrenWalkers[215 /* ArrayLiteralExpression */] = walkArrayLiteralExpressionChildren; - childrenWalkers[124 /* ArrayType */] = walkArrayTypeChildren; - childrenWalkers[220 /* SimpleArrowFunctionExpression */] = walkSimpleArrowFunctionExpressionChildren; - childrenWalkers[219 /* ParenthesizedArrowFunctionExpression */] = walkParenthesizedArrowFunctionExpressionChildren; - childrenWalkers[175 /* AssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[192 /* BitwiseAndExpression */] = walkBinaryExpressionChildren; - childrenWalkers[191 /* BitwiseExclusiveOrExpression */] = walkBinaryExpressionChildren; - childrenWalkers[167 /* BitwiseNotExpression */] = walkPrefixUnaryExpressionChildren; - childrenWalkers[190 /* BitwiseOrExpression */] = walkBinaryExpressionChildren; - childrenWalkers[147 /* Block */] = walkBlockChildren; - childrenWalkers[61 /* BooleanKeyword */] = null; - childrenWalkers[153 /* BreakStatement */] = null; - childrenWalkers[143 /* CallSignature */] = walkCallSignatureChildren; - childrenWalkers[234 /* CaseSwitchClause */] = walkCaseSwitchClauseChildren; - childrenWalkers[221 /* CastExpression */] = walkCastExpressionChildren; - childrenWalkers[237 /* CatchClause */] = walkCatchClauseChildren; - childrenWalkers[132 /* ClassDeclaration */] = walkClassDeclChildren; - childrenWalkers[174 /* CommaExpression */] = walkBinaryExpressionChildren; - childrenWalkers[187 /* ConditionalExpression */] = walkTrinaryExpressionChildren; - childrenWalkers[240 /* Constraint */] = walkConstraintChildren; - childrenWalkers[138 /* ConstructorDeclaration */] = walkConstructorDeclarationChildren; - childrenWalkers[144 /* ConstructSignature */] = walkConstructSignatureChildren; - childrenWalkers[154 /* ContinueStatement */] = null; - childrenWalkers[125 /* ConstructorType */] = walkConstructorTypeChildren; - childrenWalkers[163 /* DebuggerStatement */] = null; - childrenWalkers[235 /* DefaultSwitchClause */] = walkDefaultSwitchClauseChildren; - childrenWalkers[171 /* DeleteExpression */] = walkDeleteExpressionChildren; - childrenWalkers[179 /* DivideAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[207 /* DivideExpression */] = walkBinaryExpressionChildren; - childrenWalkers[162 /* DoStatement */] = walkDoStatementChildren; - childrenWalkers[222 /* ElementAccessExpression */] = walkElementAccessExpressionChildren; - childrenWalkers[236 /* ElseClause */] = walkElseClauseChildren; - childrenWalkers[157 /* EmptyStatement */] = null; - childrenWalkers[133 /* EnumDeclaration */] = walkEnumDeclarationChildren; - childrenWalkers[244 /* EnumElement */] = walkEnumElementChildren; - childrenWalkers[195 /* EqualsExpression */] = walkBinaryExpressionChildren; - childrenWalkers[233 /* EqualsValueClause */] = walkEqualsValueClauseChildren; - childrenWalkers[193 /* EqualsWithTypeConversionExpression */] = walkBinaryExpressionChildren; - childrenWalkers[182 /* ExclusiveOrAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[135 /* ExportAssignment */] = walkExportAssignmentChildren; - childrenWalkers[150 /* ExpressionStatement */] = walkExpressionStatementChildren; - childrenWalkers[231 /* ExtendsHeritageClause */] = walkHeritageClauseChildren; - childrenWalkers[246 /* ExternalModuleReference */] = walkExternalModuleReferenceChildren; - childrenWalkers[24 /* FalseKeyword */] = null; - childrenWalkers[238 /* FinallyClause */] = walkFinallyClauseChildren; - childrenWalkers[156 /* ForInStatement */] = walkForInStatementChildren; - childrenWalkers[155 /* ForStatement */] = walkForStatementChildren; - childrenWalkers[130 /* FunctionDeclaration */] = walkFuncDeclChildren; - childrenWalkers[223 /* FunctionExpression */] = walkFunctionExpressionChildren; - childrenWalkers[242 /* FunctionPropertyAssignment */] = walkFunctionPropertyAssignmentChildren; - childrenWalkers[123 /* FunctionType */] = walkFunctionTypeChildren; - childrenWalkers[126 /* GenericType */] = walkGenericTypeChildren; - childrenWalkers[140 /* GetAccessor */] = walkGetAccessorChildren; - childrenWalkers[198 /* GreaterThanExpression */] = walkBinaryExpressionChildren; - childrenWalkers[200 /* GreaterThanOrEqualExpression */] = walkBinaryExpressionChildren; - childrenWalkers[148 /* IfStatement */] = walkIfStatementChildren; - childrenWalkers[232 /* ImplementsHeritageClause */] = walkHeritageClauseChildren; - childrenWalkers[134 /* ImportDeclaration */] = walkImportDeclarationChildren; - childrenWalkers[139 /* IndexMemberDeclaration */] = walkIndexMemberDeclarationChildren; - childrenWalkers[145 /* IndexSignature */] = walkIndexSignatureChildren; - childrenWalkers[202 /* InExpression */] = walkBinaryExpressionChildren; - childrenWalkers[201 /* InstanceOfExpression */] = walkBinaryExpressionChildren; - childrenWalkers[129 /* InterfaceDeclaration */] = walkInterfaceDeclerationChildren; - childrenWalkers[214 /* InvocationExpression */] = walkInvocationExpressionChildren; - childrenWalkers[161 /* LabeledStatement */] = walkLabeledStatementChildren; - childrenWalkers[184 /* LeftShiftAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[203 /* LeftShiftExpression */] = walkBinaryExpressionChildren; - childrenWalkers[197 /* LessThanExpression */] = walkBinaryExpressionChildren; - childrenWalkers[199 /* LessThanOrEqualExpression */] = walkBinaryExpressionChildren; - childrenWalkers[1 /* List */] = walkListChildren; - childrenWalkers[189 /* LogicalAndExpression */] = walkBinaryExpressionChildren; - childrenWalkers[168 /* LogicalNotExpression */] = walkPrefixUnaryExpressionChildren; - childrenWalkers[188 /* LogicalOrExpression */] = walkBinaryExpressionChildren; - childrenWalkers[213 /* MemberAccessExpression */] = walkMemberAccessExpressionChildren; - childrenWalkers[136 /* MemberFunctionDeclaration */] = walkMemberFunctionDeclarationChildren; - childrenWalkers[137 /* MemberVariableDeclaration */] = walkMemberVariableDeclarationChildren; - childrenWalkers[146 /* MethodSignature */] = walkMethodSignatureChildren; - childrenWalkers[131 /* ModuleDeclaration */] = walkModuleDeclarationChildren; - childrenWalkers[247 /* ModuleNameModuleReference */] = walkModuleNameModuleReferenceChildren; - childrenWalkers[180 /* ModuloAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[208 /* ModuloExpression */] = walkBinaryExpressionChildren; - childrenWalkers[178 /* MultiplyAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[206 /* MultiplyExpression */] = walkBinaryExpressionChildren; - childrenWalkers[11 /* IdentifierName */] = null; - childrenWalkers[166 /* NegateExpression */] = walkPrefixUnaryExpressionChildren; - childrenWalkers[0 /* None */] = null; - childrenWalkers[196 /* NotEqualsExpression */] = walkBinaryExpressionChildren; - childrenWalkers[194 /* NotEqualsWithTypeConversionExpression */] = walkBinaryExpressionChildren; - childrenWalkers[32 /* NullKeyword */] = null; - childrenWalkers[67 /* NumberKeyword */] = null; - childrenWalkers[13 /* NumericLiteral */] = null; - childrenWalkers[217 /* ObjectCreationExpression */] = walkObjectCreationExpressionChildren; - childrenWalkers[216 /* ObjectLiteralExpression */] = walkObjectLiteralExpressionChildren; - childrenWalkers[122 /* ObjectType */] = walkObjectTypeChildren; - childrenWalkers[224 /* OmittedExpression */] = null; - childrenWalkers[183 /* OrAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[243 /* Parameter */] = walkParameterChildren; - childrenWalkers[228 /* ParameterList */] = walkParameterListChildren; - childrenWalkers[218 /* ParenthesizedExpression */] = walkParenthesizedExpressionChildren; - childrenWalkers[165 /* PlusExpression */] = walkPrefixUnaryExpressionChildren; - childrenWalkers[212 /* PostDecrementExpression */] = walkPostfixUnaryExpressionChildren; - childrenWalkers[211 /* PostIncrementExpression */] = walkPostfixUnaryExpressionChildren; - childrenWalkers[170 /* PreDecrementExpression */] = walkPrefixUnaryExpressionChildren; - childrenWalkers[169 /* PreIncrementExpression */] = walkPrefixUnaryExpressionChildren; - childrenWalkers[142 /* PropertySignature */] = walkPropertySignatureChildren; - childrenWalkers[121 /* QualifiedName */] = walkQualifiedNameChildren; - childrenWalkers[12 /* RegularExpressionLiteral */] = null; - childrenWalkers[151 /* ReturnStatement */] = walkReturnStatementChildren; - childrenWalkers[120 /* SourceUnit */] = walkScriptChildren; - childrenWalkers[2 /* SeparatedList */] = walkSeparatedListChildren; - childrenWalkers[141 /* SetAccessor */] = walkSetAccessorChildren; - childrenWalkers[185 /* SignedRightShiftAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[204 /* SignedRightShiftExpression */] = walkBinaryExpressionChildren; - childrenWalkers[241 /* SimplePropertyAssignment */] = walkSimplePropertyAssignmentChildren; - childrenWalkers[14 /* StringLiteral */] = null; - childrenWalkers[69 /* StringKeyword */] = null; - childrenWalkers[177 /* SubtractAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[210 /* SubtractExpression */] = walkBinaryExpressionChildren; - childrenWalkers[50 /* SuperKeyword */] = null; - childrenWalkers[152 /* SwitchStatement */] = walkSwitchStatementChildren; - childrenWalkers[35 /* ThisKeyword */] = null; - childrenWalkers[158 /* ThrowStatement */] = walkThrowStatementChildren; - childrenWalkers[3 /* TriviaList */] = null; - childrenWalkers[37 /* TrueKeyword */] = null; - childrenWalkers[160 /* TryStatement */] = walkTryStatementChildren; - childrenWalkers[128 /* TupleType */] = walkTupleTypeChildren; - childrenWalkers[245 /* TypeAnnotation */] = walkTypeAnnotationChildren; - childrenWalkers[229 /* TypeArgumentList */] = walkTypeArgumentListChildren; - childrenWalkers[172 /* TypeOfExpression */] = walkTypeOfExpressionChildren; - childrenWalkers[239 /* TypeParameter */] = walkTypeParameterChildren; - childrenWalkers[230 /* TypeParameterList */] = walkTypeParameterListChildren; - childrenWalkers[127 /* TypeQuery */] = walkTypeQueryChildren; - childrenWalkers[186 /* UnsignedRightShiftAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[205 /* UnsignedRightShiftExpression */] = walkBinaryExpressionChildren; - childrenWalkers[225 /* VariableDeclaration */] = walkVariableDeclarationChildren; - childrenWalkers[226 /* VariableDeclarator */] = walkVariableDeclaratorChildren; - childrenWalkers[149 /* VariableStatement */] = walkVariableStatementChildren; - childrenWalkers[173 /* VoidExpression */] = walkVoidExpressionChildren; - childrenWalkers[41 /* VoidKeyword */] = null; - childrenWalkers[159 /* WhileStatement */] = walkWhileStatementChildren; - childrenWalkers[164 /* WithStatement */] = walkWithStatementChildren; - for (var e in TypeScript.SyntaxKind) { - if (TypeScript.SyntaxKind.hasOwnProperty(e) && TypeScript.StringUtilities.isString(TypeScript.SyntaxKind[e])) { - TypeScript.Debug.assert(childrenWalkers[e] !== undefined, "Fix initWalkers: " + TypeScript.SyntaxKind[e]); - } - } - var AstWalkOptions = (function () { - function AstWalkOptions() { - this.goChildren = true; - this.stopWalking = false; - } - return AstWalkOptions; - })(); - TypeScript.AstWalkOptions = AstWalkOptions; - var SimplePreAstWalker = (function () { - function SimplePreAstWalker(pre, state) { - this.pre = pre; - this.state = state; - this.options = new AstWalkOptions(); - } - SimplePreAstWalker.prototype.walk = function (ast) { - if (!ast) { - return; - } - this.pre(ast, this.state); - var walker = childrenWalkers[ast.kind()]; - if (walker) { - walker(ast, this); - } - }; - return SimplePreAstWalker; - })(); - var SimplePrePostAstWalker = (function () { - function SimplePrePostAstWalker(pre, post, state) { - this.pre = pre; - this.post = post; - this.state = state; - this.options = new AstWalkOptions(); - } - SimplePrePostAstWalker.prototype.walk = function (ast) { - if (!ast) { - return; - } - this.pre(ast, this.state); - var walker = childrenWalkers[ast.kind()]; - if (walker) { - walker(ast, this); - } - this.post(ast, this.state); - }; - return SimplePrePostAstWalker; - })(); - var NormalAstWalker = (function () { - function NormalAstWalker(pre, post, state) { - this.pre = pre; - this.post = post; - this.state = state; - this.options = new AstWalkOptions(); - } - NormalAstWalker.prototype.walk = function (ast) { - if (!ast) { - return; - } - if (this.options.stopWalking) { - return; - } - this.pre(ast, this); - if (this.options.stopWalking) { - return; - } - if (this.options.goChildren) { - var walker = childrenWalkers[ast.kind()]; - if (walker) { - walker(ast, this); - } - } - else { - this.options.goChildren = true; - } - if (this.post) { - this.post(ast, this); - } - }; - return NormalAstWalker; - })(); - var AstWalkerFactory = (function () { - function AstWalkerFactory() { - } - AstWalkerFactory.prototype.walk = function (ast, pre, post, state) { - new NormalAstWalker(pre, post, state).walk(ast); - }; - AstWalkerFactory.prototype.simpleWalk = function (ast, pre, post, state) { - if (post) { - new SimplePrePostAstWalker(pre, post, state).walk(ast); - } - else { - new SimplePreAstWalker(pre, state).walk(ast); - } - }; - return AstWalkerFactory; - })(); - TypeScript.AstWalkerFactory = AstWalkerFactory; - var globalAstWalkerFactory = new AstWalkerFactory(); - function getAstWalkerFactory() { - return globalAstWalkerFactory; - } - TypeScript.getAstWalkerFactory = getAstWalkerFactory; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var ASTHelpers; - (function (ASTHelpers) { - var sentinelEmptyArray = []; - function isValidAstNode(ast) { - return ast && !TypeScript.isShared(ast) && TypeScript.start(ast) !== -1 && TypeScript.end(ast) !== -1; - } - ASTHelpers.isValidAstNode = isValidAstNode; - function isValidSpan(ast) { - if (!ast) - return false; - if (ast.start() === -1 || ast.end() === -1) - return false; - return true; - } - ASTHelpers.isValidSpan = isValidSpan; - function getAstAtPosition(script, pos, useTrailingTriviaAsLimChar, forceInclusive) { - if (useTrailingTriviaAsLimChar === void 0) { useTrailingTriviaAsLimChar = true; } - if (forceInclusive === void 0) { forceInclusive = false; } - var top = null; - var pre = function (cur, walker) { - if (!TypeScript.isShared(cur) && isValidAstNode(cur)) { - var isInvalid1 = cur.kind() === 150 /* ExpressionStatement */ && TypeScript.width(cur) === 0; - if (isInvalid1) { - walker.options.goChildren = false; - } - else { - var inclusive = forceInclusive || cur.kind() === 11 /* IdentifierName */ || cur.kind() === 213 /* MemberAccessExpression */ || cur.kind() === 121 /* QualifiedName */ || cur.kind() === 225 /* VariableDeclaration */ || cur.kind() === 226 /* VariableDeclarator */ || cur.kind() === 214 /* InvocationExpression */ || pos === TypeScript.end(script) + TypeScript.lastToken(script).trailingTriviaWidth(); - var minChar = TypeScript.start(cur); - var limChar = TypeScript.end(cur) + (useTrailingTriviaAsLimChar ? TypeScript.trailingTriviaWidth(cur) : 0) + (inclusive ? 1 : 0); - if (pos >= minChar && pos < limChar) { - if ((cur.kind() !== 1 /* List */ && cur.kind() !== 2 /* SeparatedList */) || TypeScript.end(cur) > TypeScript.start(cur)) { - if (top === null) { - top = cur; - } - else if (TypeScript.start(cur) >= TypeScript.start(top) && (TypeScript.end(cur) + (useTrailingTriviaAsLimChar ? TypeScript.trailingTriviaWidth(cur) : 0)) <= (TypeScript.end(top) + (useTrailingTriviaAsLimChar ? TypeScript.trailingTriviaWidth(top) : 0))) { - if (TypeScript.width(top) !== 0 || TypeScript.width(cur) !== 0) { - top = cur; - } - } - } - } - walker.options.goChildren = (minChar <= pos && pos <= limChar); - } - } - }; - TypeScript.getAstWalkerFactory().walk(script, pre); - return top; - } - ASTHelpers.getAstAtPosition = getAstAtPosition; - function getExtendsHeritageClause(clauses) { - return getHeritageClause(clauses, 231 /* ExtendsHeritageClause */); - } - ASTHelpers.getExtendsHeritageClause = getExtendsHeritageClause; - function getImplementsHeritageClause(clauses) { - return getHeritageClause(clauses, 232 /* ImplementsHeritageClause */); - } - ASTHelpers.getImplementsHeritageClause = getImplementsHeritageClause; - function getHeritageClause(clauses, kind) { - if (clauses) { - for (var i = 0, n = clauses.length; i < n; i++) { - var child = clauses[i]; - if (child.typeNames.length > 0 && child.kind() === kind) { - return child; - } - } - } - return null; - } - function isCallExpression(ast) { - return (ast && ast.kind() === 214 /* InvocationExpression */) || (ast && ast.kind() === 217 /* ObjectCreationExpression */); - } - ASTHelpers.isCallExpression = isCallExpression; - function isCallExpressionTarget(ast) { - return !!getCallExpressionTarget(ast); - } - ASTHelpers.isCallExpressionTarget = isCallExpressionTarget; - function getCallExpressionTarget(ast) { - if (!ast) { - return null; - } - var current = ast; - while (current && current.parent) { - if (current.parent.kind() === 213 /* MemberAccessExpression */ && current.parent.name === current) { - current = current.parent; - continue; - } - break; - } - if (current && current.parent) { - if (current.parent.kind() === 214 /* InvocationExpression */ || current.parent.kind() === 217 /* ObjectCreationExpression */) { - return current === current.parent.expression ? current : null; - } - } - return null; - } - ASTHelpers.getCallExpressionTarget = getCallExpressionTarget; - function isNameOfSomeDeclaration(ast) { - if (ast === null || ast.parent === null) { - return false; - } - if (ast.kind() !== 11 /* IdentifierName */) { - return false; - } - switch (ast.parent.kind()) { - case 132 /* ClassDeclaration */: - return ast.parent.identifier === ast; - case 129 /* InterfaceDeclaration */: - return ast.parent.identifier === ast; - case 133 /* EnumDeclaration */: - return ast.parent.identifier === ast; - case 131 /* ModuleDeclaration */: - return ast.parent.name === ast || ast.parent.stringLiteral === ast; - case 226 /* VariableDeclarator */: - return ast.parent.propertyName === ast; - case 130 /* FunctionDeclaration */: - return ast.parent.identifier === ast; - case 136 /* MemberFunctionDeclaration */: - return ast.parent.propertyName === ast; - case 243 /* Parameter */: - return ast.parent.identifier === ast; - case 239 /* TypeParameter */: - return ast.parent.identifier === ast; - case 241 /* SimplePropertyAssignment */: - return ast.parent.propertyName === ast; - case 242 /* FunctionPropertyAssignment */: - return ast.parent.propertyName === ast; - case 244 /* EnumElement */: - return ast.parent.propertyName === ast; - case 134 /* ImportDeclaration */: - return ast.parent.identifier === ast; - case 146 /* MethodSignature */: - return ast.parent.propertyName === ast; - case 142 /* PropertySignature */: - return ast.parent.propertyName === ast; - } - return false; - } - function isDeclarationASTOrDeclarationNameAST(ast) { - return isNameOfSomeDeclaration(ast) || ASTHelpers.isDeclarationAST(ast); - } - ASTHelpers.isDeclarationASTOrDeclarationNameAST = isDeclarationASTOrDeclarationNameAST; - function getEnclosingParameterForInitializer(ast) { - var current = ast; - while (current) { - switch (current.kind()) { - case 233 /* EqualsValueClause */: - if (current.parent && current.parent.kind() === 243 /* Parameter */) { - return current.parent; - } - break; - case 132 /* ClassDeclaration */: - case 129 /* InterfaceDeclaration */: - case 131 /* ModuleDeclaration */: - return null; - } - current = current.parent; - } - return null; - } - ASTHelpers.getEnclosingParameterForInitializer = getEnclosingParameterForInitializer; - function getEnclosingMemberDeclaration(ast) { - var current = ast; - while (current) { - switch (current.kind()) { - case 137 /* MemberVariableDeclaration */: - case 146 /* MethodSignature */: - case 136 /* MemberFunctionDeclaration */: - case 140 /* GetAccessor */: - case 141 /* SetAccessor */: - return current; - case 132 /* ClassDeclaration */: - case 129 /* InterfaceDeclaration */: - case 131 /* ModuleDeclaration */: - return null; - } - current = current.parent; - } - return null; - } - ASTHelpers.getEnclosingMemberDeclaration = getEnclosingMemberDeclaration; - function isNameOfFunction(ast) { - return ast && ast.parent && ast.kind() === 11 /* IdentifierName */ && ast.parent.kind() === 130 /* FunctionDeclaration */ && ast.parent.identifier === ast; - } - ASTHelpers.isNameOfFunction = isNameOfFunction; - function isNameOfMemberFunction(ast) { - return ast && ast.parent && ast.kind() === 11 /* IdentifierName */ && ast.parent.kind() === 136 /* MemberFunctionDeclaration */ && ast.parent.propertyName === ast; - } - ASTHelpers.isNameOfMemberFunction = isNameOfMemberFunction; - function isNameOfMemberAccessExpression(ast) { - if (ast && ast.parent && ast.parent.kind() === 213 /* MemberAccessExpression */ && ast.parent.name === ast) { - return true; - } - return false; - } - ASTHelpers.isNameOfMemberAccessExpression = isNameOfMemberAccessExpression; - function isRightSideOfQualifiedName(ast) { - if (ast && ast.parent && ast.parent.kind() === 121 /* QualifiedName */ && ast.parent.right === ast) { - return true; - } - return false; - } - ASTHelpers.isRightSideOfQualifiedName = isRightSideOfQualifiedName; - function parentIsModuleDeclaration(ast) { - return ast.parent && ast.parent.kind() === 131 /* ModuleDeclaration */; - } - ASTHelpers.parentIsModuleDeclaration = parentIsModuleDeclaration; - function isDeclarationAST(ast) { - switch (ast.kind()) { - case 226 /* VariableDeclarator */: - return getVariableStatement(ast) !== null; - case 134 /* ImportDeclaration */: - case 132 /* ClassDeclaration */: - case 129 /* InterfaceDeclaration */: - case 243 /* Parameter */: - case 220 /* SimpleArrowFunctionExpression */: - case 219 /* ParenthesizedArrowFunctionExpression */: - case 145 /* IndexSignature */: - case 130 /* FunctionDeclaration */: - case 131 /* ModuleDeclaration */: - case 124 /* ArrayType */: - case 122 /* ObjectType */: - case 239 /* TypeParameter */: - case 138 /* ConstructorDeclaration */: - case 136 /* MemberFunctionDeclaration */: - case 140 /* GetAccessor */: - case 141 /* SetAccessor */: - case 137 /* MemberVariableDeclaration */: - case 139 /* IndexMemberDeclaration */: - case 133 /* EnumDeclaration */: - case 244 /* EnumElement */: - case 241 /* SimplePropertyAssignment */: - case 242 /* FunctionPropertyAssignment */: - case 223 /* FunctionExpression */: - case 143 /* CallSignature */: - case 144 /* ConstructSignature */: - case 146 /* MethodSignature */: - case 142 /* PropertySignature */: - return true; - default: - return false; - } - } - ASTHelpers.isDeclarationAST = isDeclarationAST; - function preComments(element, text) { - if (element) { - switch (element.kind()) { - case 149 /* VariableStatement */: - case 150 /* ExpressionStatement */: - case 132 /* ClassDeclaration */: - case 134 /* ImportDeclaration */: - case 130 /* FunctionDeclaration */: - case 131 /* ModuleDeclaration */: - case 133 /* EnumDeclaration */: - case 148 /* IfStatement */: - case 241 /* SimplePropertyAssignment */: - case 136 /* MemberFunctionDeclaration */: - case 129 /* InterfaceDeclaration */: - case 140 /* GetAccessor */: - case 141 /* SetAccessor */: - case 151 /* ReturnStatement */: - case 138 /* ConstructorDeclaration */: - case 137 /* MemberVariableDeclaration */: - case 244 /* EnumElement */: - case 143 /* CallSignature */: - case 144 /* ConstructSignature */: - case 145 /* IndexSignature */: - case 142 /* PropertySignature */: - case 146 /* MethodSignature */: - case 242 /* FunctionPropertyAssignment */: - case 243 /* Parameter */: - return convertNodeLeadingComments(element, text); - } - } - return null; - } - ASTHelpers.preComments = preComments; - function postComments(element, text) { - if (element) { - switch (element.kind()) { - case 150 /* ExpressionStatement */: - return convertNodeTrailingComments(element, text, true); - case 149 /* VariableStatement */: - case 132 /* ClassDeclaration */: - case 134 /* ImportDeclaration */: - case 130 /* FunctionDeclaration */: - case 131 /* ModuleDeclaration */: - case 133 /* EnumDeclaration */: - case 148 /* IfStatement */: - case 241 /* SimplePropertyAssignment */: - case 136 /* MemberFunctionDeclaration */: - case 129 /* InterfaceDeclaration */: - case 140 /* GetAccessor */: - case 141 /* SetAccessor */: - case 151 /* ReturnStatement */: - case 138 /* ConstructorDeclaration */: - case 137 /* MemberVariableDeclaration */: - case 244 /* EnumElement */: - case 143 /* CallSignature */: - case 144 /* ConstructSignature */: - case 145 /* IndexSignature */: - case 142 /* PropertySignature */: - case 146 /* MethodSignature */: - case 242 /* FunctionPropertyAssignment */: - case 243 /* Parameter */: - return convertNodeTrailingComments(element, text); - } - } - return null; - } - ASTHelpers.postComments = postComments; - function convertNodeTrailingComments(node, text, allowWithNewLine) { - if (allowWithNewLine === void 0) { allowWithNewLine = false; } - var _lastToken = TypeScript.lastToken(node); - if (_lastToken === null || !_lastToken.hasTrailingTrivia()) { - return null; - } - if (!allowWithNewLine && TypeScript.SyntaxUtilities.isLastTokenOnLine(_lastToken, text)) { - return null; - } - return convertComments(_lastToken.trailingTrivia(text), TypeScript.fullStart(node) + TypeScript.fullWidth(node) - _lastToken.trailingTriviaWidth(text)); - } - function convertNodeLeadingComments(element, text) { - if (element) { - return convertTokenLeadingComments(TypeScript.firstToken(element), text); - } - return null; - } - function convertTokenLeadingComments(token, text) { - if (token === null) { - return null; - } - return token.hasLeadingTrivia() ? convertComments(token.leadingTrivia(text), token.fullStart()) : null; - } - ASTHelpers.convertTokenLeadingComments = convertTokenLeadingComments; - function convertTokenTrailingComments(token, text) { - if (token === null) { - return null; - } - return token.hasTrailingTrivia() ? convertComments(token.trailingTrivia(text), TypeScript.fullEnd(token) - token.trailingTriviaWidth(text)) : null; - } - ASTHelpers.convertTokenTrailingComments = convertTokenTrailingComments; - function convertComments(triviaList, commentStartPosition) { - var result = null; - for (var i = 0, n = triviaList.count(); i < n; i++) { - var trivia = triviaList.syntaxTriviaAt(i); - if (trivia.isComment()) { - var hasTrailingNewLine = ((i + 1) < n) && triviaList.syntaxTriviaAt(i + 1).isNewLine(); - result = result || []; - result.push(convertComment(trivia, commentStartPosition, hasTrailingNewLine)); - } - commentStartPosition += trivia.fullWidth(); - } - return result; - } - function convertComment(trivia, commentStartPosition, hasTrailingNewLine) { - var comment = new TypeScript.Comment(trivia, hasTrailingNewLine, commentStartPosition, commentStartPosition + trivia.fullWidth()); - return comment; - } - function docComments(ast, text) { - if (isDeclarationAST(ast)) { - var comments = null; - if (ast.kind() === 226 /* VariableDeclarator */) { - comments = TypeScript.ASTHelpers.preComments(getVariableStatement(ast), text); - } - else if (ast.kind() === 243 /* Parameter */) { - comments = TypeScript.ASTHelpers.preComments(ast, text); - if (!comments) { - var previousToken = TypeScript.findToken(TypeScript.syntaxTree(ast).sourceUnit(), TypeScript.firstToken(ast).fullStart() - 1); - if (previousToken && (previousToken.kind() === 72 /* OpenParenToken */ || previousToken.kind() === 79 /* CommaToken */)) { - comments = convertTokenTrailingComments(previousToken, text); - } - } - } - else { - comments = TypeScript.ASTHelpers.preComments(ast, text); - } - if (comments && comments.length > 0) { - return comments.filter(function (c) { return isDocComment(c); }); - } - } - return sentinelEmptyArray; - } - ASTHelpers.docComments = docComments; - function isDocComment(comment) { - if (comment.kind() === 6 /* MultiLineCommentTrivia */) { - var fullText = comment.fullText(); - return fullText.charAt(2) === "*" && fullText.charAt(3) !== "/"; - } - return false; - } - ASTHelpers.isDocComment = isDocComment; - function getParameterList(ast) { - if (ast) { - switch (ast.kind()) { - case 138 /* ConstructorDeclaration */: - return getParameterList(ast.callSignature); - case 130 /* FunctionDeclaration */: - return getParameterList(ast.callSignature); - case 219 /* ParenthesizedArrowFunctionExpression */: - return getParameterList(ast.callSignature); - case 144 /* ConstructSignature */: - return getParameterList(ast.callSignature); - case 136 /* MemberFunctionDeclaration */: - return getParameterList(ast.callSignature); - case 242 /* FunctionPropertyAssignment */: - return getParameterList(ast.callSignature); - case 223 /* FunctionExpression */: - return getParameterList(ast.callSignature); - case 146 /* MethodSignature */: - return getParameterList(ast.callSignature); - case 125 /* ConstructorType */: - return ast.parameterList; - case 123 /* FunctionType */: - return ast.parameterList; - case 143 /* CallSignature */: - return ast.parameterList; - case 140 /* GetAccessor */: - return getParameterList(ast.callSignature); - case 141 /* SetAccessor */: - return getParameterList(ast.callSignature); - } - } - return null; - } - ASTHelpers.getParameterList = getParameterList; - function getType(ast) { - if (ast) { - switch (ast.kind()) { - case 130 /* FunctionDeclaration */: - return getType(ast.callSignature); - case 219 /* ParenthesizedArrowFunctionExpression */: - return getType(ast.callSignature); - case 144 /* ConstructSignature */: - return getType(ast.callSignature); - case 136 /* MemberFunctionDeclaration */: - return getType(ast.callSignature); - case 242 /* FunctionPropertyAssignment */: - return getType(ast.callSignature); - case 223 /* FunctionExpression */: - return getType(ast.callSignature); - case 146 /* MethodSignature */: - return getType(ast.callSignature); - case 143 /* CallSignature */: - return getType(ast.typeAnnotation); - case 145 /* IndexSignature */: - return getType(ast.typeAnnotation); - case 142 /* PropertySignature */: - return getType(ast.typeAnnotation); - case 140 /* GetAccessor */: - return getType(ast.callSignature); - case 243 /* Parameter */: - return getType(ast.typeAnnotation); - case 137 /* MemberVariableDeclaration */: - return getType(ast.variableDeclarator); - case 226 /* VariableDeclarator */: - return getType(ast.typeAnnotation); - case 237 /* CatchClause */: - return getType(ast.typeAnnotation); - case 125 /* ConstructorType */: - return ast.type; - case 123 /* FunctionType */: - return ast.type; - case 245 /* TypeAnnotation */: - return ast.type; - } - } - return null; - } - ASTHelpers.getType = getType; - function getVariableStatement(variableDeclarator) { - if (variableDeclarator && variableDeclarator.parent && variableDeclarator.parent.parent && variableDeclarator.parent.parent.parent && variableDeclarator.parent.kind() === 2 /* SeparatedList */ && variableDeclarator.parent.parent.kind() === 225 /* VariableDeclaration */ && variableDeclarator.parent.parent.parent.kind() === 149 /* VariableStatement */) { - return variableDeclarator.parent.parent.parent; - } - return null; - } - function getVariableDeclaratorModifiers(variableDeclarator) { - var variableStatement = getVariableStatement(variableDeclarator); - return variableStatement ? variableStatement.modifiers : TypeScript.Syntax.emptyList(); - } - ASTHelpers.getVariableDeclaratorModifiers = getVariableDeclaratorModifiers; - function isIntegerLiteralAST(expression) { - if (expression) { - switch (expression.kind()) { - case 165 /* PlusExpression */: - case 166 /* NegateExpression */: - expression = expression.operand; - return expression.kind() === 13 /* NumericLiteral */ && TypeScript.IntegerUtilities.isInteger(expression.text()); - case 13 /* NumericLiteral */: - var text = expression.text(); - return TypeScript.IntegerUtilities.isInteger(text) || TypeScript.IntegerUtilities.isHexInteger(text); - } - } - return false; - } - ASTHelpers.isIntegerLiteralAST = isIntegerLiteralAST; - function getEnclosingModuleDeclaration(ast) { - while (ast) { - if (ast.kind() === 131 /* ModuleDeclaration */) { - return ast; - } - ast = ast.parent; - } - return null; - } - ASTHelpers.getEnclosingModuleDeclaration = getEnclosingModuleDeclaration; - function isEntireNameOfModuleDeclaration(nameAST) { - return parentIsModuleDeclaration(nameAST) && nameAST.parent.name === nameAST; - } - function getModuleDeclarationFromNameAST(ast) { - if (ast) { - switch (ast.kind()) { - case 14 /* StringLiteral */: - if (parentIsModuleDeclaration(ast) && ast.parent.stringLiteral === ast) { - return ast.parent; - } - return null; - case 11 /* IdentifierName */: - case 121 /* QualifiedName */: - if (isEntireNameOfModuleDeclaration(ast)) { - return ast.parent; - } - break; - default: - return null; - } - for (ast = ast.parent; ast && ast.kind() === 121 /* QualifiedName */; ast = ast.parent) { - if (isEntireNameOfModuleDeclaration(ast)) { - return ast.parent; - } - } - } - return null; - } - ASTHelpers.getModuleDeclarationFromNameAST = getModuleDeclarationFromNameAST; - function isLastNameOfModule(ast, astName) { - if (ast) { - if (ast.stringLiteral) { - return astName === ast.stringLiteral; - } - else if (ast.name.kind() === 121 /* QualifiedName */) { - return astName === ast.name.right; - } - else { - return astName === ast.name; - } - } - return false; - } - ASTHelpers.isLastNameOfModule = isLastNameOfModule; - function getNameOfIdentifierOrQualifiedName(name) { - if (name.kind() === 11 /* IdentifierName */) { - return name.text(); - } - else { - TypeScript.Debug.assert(name.kind() == 121 /* QualifiedName */); - var dotExpr = name; - return getNameOfIdentifierOrQualifiedName(dotExpr.left) + "." + getNameOfIdentifierOrQualifiedName(dotExpr.right); - } - } - ASTHelpers.getNameOfIdentifierOrQualifiedName = getNameOfIdentifierOrQualifiedName; - function getModuleNames(name, result) { - result = result || []; - if (name.kind() === 121 /* QualifiedName */) { - getModuleNames(name.left, result); - result.push(name.right); - } - else { - result.push(name); - } - return result; - } - ASTHelpers.getModuleNames = getModuleNames; - })(ASTHelpers = TypeScript.ASTHelpers || (TypeScript.ASTHelpers = {})); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - function stripStartAndEndQuotes(str) { - var firstCharCode = str && str.charCodeAt(0); - if (str && str.length >= 2 && firstCharCode === str.charCodeAt(str.length - 1) && (firstCharCode === 39 /* singleQuote */ || firstCharCode === 34 /* doubleQuote */)) { - return str.substring(1, str.length - 1); - } - return str; - } - TypeScript.stripStartAndEndQuotes = stripStartAndEndQuotes; - function isSingleQuoted(str) { - return str && str.length >= 2 && str.charCodeAt(0) === str.charCodeAt(str.length - 1) && str.charCodeAt(0) === 39 /* singleQuote */; - } - TypeScript.isSingleQuoted = isSingleQuoted; - function isDoubleQuoted(str) { - return str && str.length >= 2 && str.charCodeAt(0) === str.charCodeAt(str.length - 1) && str.charCodeAt(0) === 34 /* doubleQuote */; - } - TypeScript.isDoubleQuoted = isDoubleQuoted; - function isQuoted(str) { - return isDoubleQuoted(str) || isSingleQuoted(str); - } - TypeScript.isQuoted = isQuoted; - function quoteStr(str) { - return "\"" + str + "\""; - } - TypeScript.quoteStr = quoteStr; - var switchToForwardSlashesRegEx = /\\/g; - function switchToForwardSlashes(path) { - return path.replace(switchToForwardSlashesRegEx, "/"); - } - TypeScript.switchToForwardSlashes = switchToForwardSlashes; - function trimModName(modName) { - if (modName.length > 5 && modName.substring(modName.length - 5, modName.length) === ".d.ts") { - return modName.substring(0, modName.length - 5); - } - if (modName.length > 3 && modName.substring(modName.length - 3, modName.length) === ".ts") { - return modName.substring(0, modName.length - 3); - } - if (modName.length > 3 && modName.substring(modName.length - 3, modName.length) === ".js") { - return modName.substring(0, modName.length - 3); - } - return modName; - } - TypeScript.trimModName = trimModName; - function getDeclareFilePath(fname) { - return isTSFile(fname) ? changePathToDTS(fname) : changePathToDTS(fname); - } - TypeScript.getDeclareFilePath = getDeclareFilePath; - function isFileOfExtension(fname, ext) { - var invariantFname = fname.toLocaleUpperCase(); - var invariantExt = ext.toLocaleUpperCase(); - var extLength = invariantExt.length; - return invariantFname.length > extLength && invariantFname.substring(invariantFname.length - extLength, invariantFname.length) === invariantExt; - } - function isTSFile(fname) { - return isFileOfExtension(fname, ".ts"); - } - TypeScript.isTSFile = isTSFile; - function isDTSFile(fname) { - return isFileOfExtension(fname, ".d.ts"); - } - TypeScript.isDTSFile = isDTSFile; - function getPrettyName(modPath, quote, treatAsFileName) { - if (quote === void 0) { quote = true; } - if (treatAsFileName === void 0) { treatAsFileName = false; } - var modName = treatAsFileName ? switchToForwardSlashes(modPath) : trimModName(stripStartAndEndQuotes(modPath)); - var components = this.getPathComponents(modName); - return components.length ? (quote ? quoteStr(components[components.length - 1]) : components[components.length - 1]) : modPath; - } - TypeScript.getPrettyName = getPrettyName; - function getPathComponents(path) { - return path.split("/"); - } - TypeScript.getPathComponents = getPathComponents; - function getRelativePathToFixedPath(fixedModFilePath, absoluteModPath, isAbsoultePathURL) { - if (isAbsoultePathURL === void 0) { isAbsoultePathURL = true; } - absoluteModPath = switchToForwardSlashes(absoluteModPath); - var modComponents = this.getPathComponents(absoluteModPath); - var fixedModComponents = this.getPathComponents(fixedModFilePath); - var joinStartIndex = 0; - for (; joinStartIndex < modComponents.length && joinStartIndex < fixedModComponents.length; joinStartIndex++) { - if (fixedModComponents[joinStartIndex] !== modComponents[joinStartIndex]) { - break; - } - } - if (joinStartIndex !== 0) { - var relativePath = ""; - var relativePathComponents = modComponents.slice(joinStartIndex, modComponents.length); - for (; joinStartIndex < fixedModComponents.length; joinStartIndex++) { - if (fixedModComponents[joinStartIndex] !== "") { - relativePath = relativePath + "../"; - } - } - return relativePath + relativePathComponents.join("/"); - } - if (isAbsoultePathURL && absoluteModPath.indexOf("://") === -1) { - absoluteModPath = "file:///" + absoluteModPath; - } - return absoluteModPath; - } - TypeScript.getRelativePathToFixedPath = getRelativePathToFixedPath; - function changePathToDTS(modPath) { - return trimModName(stripStartAndEndQuotes(modPath)) + ".d.ts"; - } - TypeScript.changePathToDTS = changePathToDTS; - function isRelative(path) { - return path.length > 0 && path.charAt(0) === "."; - } - TypeScript.isRelative = isRelative; - function isRooted(path) { - return path.length > 0 && (path.charAt(0) === "\\" || path.charAt(0) === "/" || (path.indexOf(":\\") !== -1) || (path.indexOf(":/") !== -1)); - } - TypeScript.isRooted = isRooted; - function getRootFilePath(outFname) { - if (outFname === "") { - return outFname; - } - else { - var isPath = outFname.indexOf("/") !== -1; - return isPath ? filePath(outFname) : ""; - } - } - TypeScript.getRootFilePath = getRootFilePath; - function filePathComponents(fullPath) { - fullPath = switchToForwardSlashes(fullPath); - var components = getPathComponents(fullPath); - return components.slice(0, components.length - 1); - } - TypeScript.filePathComponents = filePathComponents; - function filePath(fullPath) { - var path = filePathComponents(fullPath); - return path.join("/") + "/"; - } - TypeScript.filePath = filePath; - function convertToDirectoryPath(dirPath) { - if (dirPath && dirPath.charAt(dirPath.length - 1) !== "/") { - dirPath += "/"; - } - return dirPath; - } - TypeScript.convertToDirectoryPath = convertToDirectoryPath; - var normalizePathRegEx = /^\\\\[^\\]/; - function normalizePath(path) { - if (normalizePathRegEx.test(path)) { - path = "file:" + path; - } - var parts = this.getPathComponents(switchToForwardSlashes(path)); - var normalizedParts = []; - for (var i = 0; i < parts.length; i++) { - var part = parts[i]; - if (part === ".") { - continue; - } - if (normalizedParts.length > 0 && TypeScript.ArrayUtilities.last(normalizedParts) !== ".." && part === "..") { - normalizedParts.pop(); - continue; - } - normalizedParts.push(part); - } - return normalizedParts.join("/"); - } - TypeScript.normalizePath = normalizePath; -})(TypeScript || (TypeScript = {})); -var ts; -(function (ts) { - var scanner = ts.createScanner(1 /* ES5 */, true); - var emptyArray = []; - function createNode(kind, pos, end, flags, parent) { - var node = new (ts.getNodeConstructor(kind))(); - node.pos = pos; - node.end = end; - node.flags = flags; - node.parent = parent; - return node; - } - var NodeObject = (function () { - function NodeObject() { - } - NodeObject.prototype.getSourceFile = function () { - return ts.getSourceFileOfNode(this); - }; - NodeObject.prototype.getStart = function (sourceFile) { - return ts.getTokenPosOfNode(this, sourceFile); - }; - NodeObject.prototype.getFullStart = function () { - return this.pos; - }; - NodeObject.prototype.getEnd = function () { - return this.end; - }; - NodeObject.prototype.getWidth = function (sourceFile) { - return this.getEnd() - this.getStart(sourceFile); - }; - NodeObject.prototype.getFullWidth = function () { - return this.end - this.getFullStart(); - }; - NodeObject.prototype.getLeadingTriviaWidth = function (sourceFile) { - return this.getStart(sourceFile) - this.pos; - }; - NodeObject.prototype.getFullText = function (sourceFile) { - return (sourceFile || this.getSourceFile()).text.substring(this.pos, this.end); - }; - NodeObject.prototype.addSyntheticNodes = function (nodes, pos, end) { - scanner.setTextPos(pos); - while (pos < end) { - var token = scanner.scan(); - var textPos = scanner.getTextPos(); - var node = nodes.push(createNode(token, pos, textPos, 512 /* Synthetic */, this)); - pos = textPos; - } - return pos; - }; - NodeObject.prototype.createSyntaxList = function (nodes) { - var list = createNode(184 /* SyntaxList */, nodes.pos, nodes.end, 512 /* Synthetic */, this); - list._children = []; - var pos = nodes.pos; - for (var i = 0, len = nodes.length; i < len; i++) { - var node = nodes[i]; - if (pos < node.pos) { - pos = this.addSyntheticNodes(list._children, pos, node.pos); - } - list._children.push(node); - pos = node.end; - } - if (pos < nodes.end) { - this.addSyntheticNodes(list._children, pos, nodes.end); - } - return list; - }; - NodeObject.prototype.createChildren = function (sourceFile) { - var _this = this; - if (this.kind > 115 /* Missing */) { - scanner.setText((sourceFile || this.getSourceFile()).text); - var children = []; - var pos = this.pos; - var processNode = function (node) { - if (pos < node.pos) { - pos = _this.addSyntheticNodes(children, pos, node.pos); - } - children.push(node); - pos = node.end; - }; - var processNodes = function (nodes) { - if (pos < nodes.pos) { - pos = _this.addSyntheticNodes(children, pos, nodes.pos); - } - children.push(_this.createSyntaxList(nodes)); - pos = nodes.end; - }; - ts.forEachChild(this, processNode, processNodes); - if (pos < this.end) { - this.addSyntheticNodes(children, pos, this.end); - } - scanner.setText(undefined); - } - this._children = children || emptyArray; - }; - NodeObject.prototype.getChildCount = function (sourceFile) { - if (!this._children) - this.createChildren(sourceFile); - return this._children.length; - }; - NodeObject.prototype.getChildAt = function (index, sourceFile) { - if (!this._children) - this.createChildren(sourceFile); - return this._children[index]; - }; - NodeObject.prototype.getChildren = function (sourceFile) { - if (!this._children) - this.createChildren(sourceFile); - return this._children; - }; - NodeObject.prototype.getFirstToken = function (sourceFile) { - var children = this.getChildren(); - for (var i = 0; i < children.length; i++) { - var child = children[i]; - if (child.kind < 115 /* Missing */) - return child; - if (child.kind > 115 /* Missing */) - return child.getFirstToken(sourceFile); - } - }; - NodeObject.prototype.getLastToken = function (sourceFile) { - var children = this.getChildren(sourceFile); - for (var i = children.length - 1; i >= 0; i--) { - var child = children[i]; - if (child.kind < 115 /* Missing */) - return child; - if (child.kind > 115 /* Missing */) - return child.getLastToken(sourceFile); - } - }; - return NodeObject; - })(); - var SymbolObject = (function () { - function SymbolObject(flags, name) { - this.flags = flags; - this.name = name; - } - SymbolObject.prototype.getFlags = function () { - return this.flags; - }; - SymbolObject.prototype.getName = function () { - return this.name; - }; - SymbolObject.prototype.getDeclarations = function () { - return this.declarations; - }; - SymbolObject.prototype.getDocumentationComment = function () { - if (this.documentationComment === undefined) { - this.documentationComment = getJsDocCommentsFromDeclarations(this.declarations, this.name, !(this.flags & 2 /* Property */)); - } - return this.documentationComment; - }; - return SymbolObject; - })(); - function getJsDocCommentsFromDeclarations(declarations, name, canUseParsedParamTagComments) { - var documentationComment = []; - var docComments = getJsDocCommentsSeparatedByNewLines(); - ts.forEach(docComments, function (docComment) { - if (documentationComment.length) { - documentationComment.push(lineBreakPart()); - } - documentationComment.push(docComment); - }); - return documentationComment; - function getJsDocCommentsSeparatedByNewLines() { - var paramTag = "@param"; - var jsDocCommentParts = []; - ts.forEach(declarations, function (declaration) { - var sourceFileOfDeclaration = ts.getSourceFileOfNode(declaration); - if (canUseParsedParamTagComments && declaration.kind === 118 /* Parameter */) { - ts.forEach(getJsDocCommentTextRange(declaration.parent, sourceFileOfDeclaration), function (jsDocCommentTextRange) { - var cleanedParamJsDocComment = getCleanedParamJsDocComment(jsDocCommentTextRange.pos, jsDocCommentTextRange.end, sourceFileOfDeclaration); - if (cleanedParamJsDocComment) { - jsDocCommentParts.push.apply(jsDocCommentParts, cleanedParamJsDocComment); - } - }); - } - if (declaration.kind === 177 /* ModuleDeclaration */ && declaration.body.kind === 177 /* ModuleDeclaration */) { - return; - } - while (declaration.kind === 177 /* ModuleDeclaration */ && declaration.parent.kind === 177 /* ModuleDeclaration */) { - declaration = declaration.parent; - } - ts.forEach(getJsDocCommentTextRange(declaration.kind === 171 /* VariableDeclaration */ ? declaration.parent : declaration, sourceFileOfDeclaration), function (jsDocCommentTextRange) { - var cleanedJsDocComment = getCleanedJsDocComment(jsDocCommentTextRange.pos, jsDocCommentTextRange.end, sourceFileOfDeclaration); - if (cleanedJsDocComment) { - jsDocCommentParts.push.apply(jsDocCommentParts, cleanedJsDocComment); - } - }); - }); - return jsDocCommentParts; - function getJsDocCommentTextRange(node, sourceFile) { - return ts.map(ts.getJsDocComments(node, sourceFile), function (jsDocComment) { - return { - pos: jsDocComment.pos + "/*".length, - end: jsDocComment.end - "*/".length - }; - }); - } - function consumeWhiteSpacesOnTheLine(pos, end, sourceFile, maxSpacesToRemove) { - if (maxSpacesToRemove !== undefined) { - end = Math.min(end, pos + maxSpacesToRemove); - } - for (; pos < end; pos++) { - var ch = sourceFile.text.charCodeAt(pos); - if (!ts.isWhiteSpace(ch) || ts.isLineBreak(ch)) { - return pos; - } - } - return end; - } - function consumeLineBreaks(pos, end, sourceFile) { - while (pos < end && ts.isLineBreak(sourceFile.text.charCodeAt(pos))) { - pos++; - } - return pos; - } - function isName(pos, end, sourceFile, name) { - return pos + name.length < end && sourceFile.text.substr(pos, name.length) === name && ts.isWhiteSpace(sourceFile.text.charCodeAt(pos + name.length)); - } - function isParamTag(pos, end, sourceFile) { - return isName(pos, end, sourceFile, paramTag); - } - function getCleanedJsDocComment(pos, end, sourceFile) { - var spacesToRemoveAfterAsterisk; - var docComments = []; - var isInParamTag = false; - while (pos < end) { - var docCommentTextOfLine = ""; - pos = consumeWhiteSpacesOnTheLine(pos, end, sourceFile); - if (pos < end && sourceFile.text.charCodeAt(pos) === 42 /* asterisk */) { - var lineStartPos = pos + 1; - pos = consumeWhiteSpacesOnTheLine(pos + 1, end, sourceFile, spacesToRemoveAfterAsterisk); - if (spacesToRemoveAfterAsterisk === undefined && pos < end && !ts.isLineBreak(sourceFile.text.charCodeAt(pos))) { - spacesToRemoveAfterAsterisk = pos - lineStartPos; - } - } - else if (spacesToRemoveAfterAsterisk === undefined) { - spacesToRemoveAfterAsterisk = 0; - } - while (pos < end && !ts.isLineBreak(sourceFile.text.charCodeAt(pos))) { - var ch = sourceFile.text.charAt(pos); - if (ch === "@") { - if (isParamTag(pos, end, sourceFile)) { - isInParamTag = true; - pos += paramTag.length; - continue; - } - else { - isInParamTag = false; - } - } - if (!isInParamTag) { - docCommentTextOfLine += ch; - } - pos++; - } - pos = consumeLineBreaks(pos, end, sourceFile); - if (docCommentTextOfLine) { - docComments.push(textPart(docCommentTextOfLine)); - } - } - return docComments; - } - function getCleanedParamJsDocComment(pos, end, sourceFile) { - var paramHelpStringMargin; - var paramDocComments = []; - while (pos < end) { - if (isParamTag(pos, end, sourceFile)) { - pos = consumeWhiteSpaces(pos + paramTag.length); - if (pos >= end) { - break; - } - if (sourceFile.text.charCodeAt(pos) === 123 /* openBrace */) { - pos++; - for (var curlies = 1; pos < end; pos++) { - var charCode = sourceFile.text.charCodeAt(pos); - if (charCode === 123 /* openBrace */) { - curlies++; - continue; - } - if (charCode === 125 /* closeBrace */) { - curlies--; - if (curlies === 0) { - pos++; - break; - } - else { - continue; - } - } - if (charCode === 64 /* at */) { - break; - } - } - pos = consumeWhiteSpaces(pos); - if (pos >= end) { - break; - } - } - if (isName(pos, end, sourceFile, name)) { - pos = consumeWhiteSpaces(pos + name.length); - if (pos >= end) { - break; - } - var paramHelpString = ""; - var firstLineParamHelpStringPos = pos; - while (pos < end) { - var ch = sourceFile.text.charCodeAt(pos); - if (ts.isLineBreak(ch)) { - if (paramHelpString) { - paramDocComments.push(textPart(paramHelpString)); - paramHelpString = ""; - } - setPosForParamHelpStringOnNextLine(firstLineParamHelpStringPos); - continue; - } - if (ch === 64 /* at */) { - break; - } - paramHelpString += sourceFile.text.charAt(pos); - pos++; - } - if (paramHelpString) { - paramDocComments.push(textPart(paramHelpString)); - } - paramHelpStringMargin = undefined; - } - if (sourceFile.text.charCodeAt(pos) === 64 /* at */) { - continue; - } - } - pos++; - } - return paramDocComments; - function consumeWhiteSpaces(pos) { - while (pos < end && ts.isWhiteSpace(sourceFile.text.charCodeAt(pos))) { - pos++; - } - return pos; - } - function setPosForParamHelpStringOnNextLine(firstLineParamHelpStringPos) { - pos = consumeLineBreaks(pos, end, sourceFile); - if (pos >= end) { - return; - } - if (paramHelpStringMargin === undefined) { - paramHelpStringMargin = sourceFile.getLineAndCharacterFromPosition(firstLineParamHelpStringPos).character - 1; - } - var startOfLinePos = pos; - pos = consumeWhiteSpacesOnTheLine(pos, end, sourceFile, paramHelpStringMargin); - if (pos >= end) { - return; - } - var consumedSpaces = pos - startOfLinePos; - if (consumedSpaces < paramHelpStringMargin) { - var ch = sourceFile.text.charCodeAt(pos); - if (ch === 42 /* asterisk */) { - pos = consumeWhiteSpacesOnTheLine(pos + 1, end, sourceFile, paramHelpStringMargin - consumedSpaces - 1); - } - } - } - } - } - } - var TypeObject = (function () { - function TypeObject(checker, flags) { - this.checker = checker; - this.flags = flags; - } - TypeObject.prototype.getFlags = function () { - return this.flags; - }; - TypeObject.prototype.getSymbol = function () { - return this.symbol; - }; - TypeObject.prototype.getProperties = function () { - return this.checker.getPropertiesOfType(this); - }; - TypeObject.prototype.getProperty = function (propertyName) { - return this.checker.getPropertyOfType(this, propertyName); - }; - TypeObject.prototype.getApparentProperties = function () { - return this.checker.getAugmentedPropertiesOfApparentType(this); - }; - TypeObject.prototype.getCallSignatures = function () { - return this.checker.getSignaturesOfType(this, 0 /* Call */); - }; - TypeObject.prototype.getConstructSignatures = function () { - return this.checker.getSignaturesOfType(this, 1 /* Construct */); - }; - TypeObject.prototype.getStringIndexType = function () { - return this.checker.getIndexTypeOfType(this, 0 /* String */); - }; - TypeObject.prototype.getNumberIndexType = function () { - return this.checker.getIndexTypeOfType(this, 1 /* Number */); - }; - return TypeObject; - })(); - var SignatureObject = (function () { - function SignatureObject(checker) { - this.checker = checker; - } - SignatureObject.prototype.getDeclaration = function () { - return this.declaration; - }; - SignatureObject.prototype.getTypeParameters = function () { - return this.typeParameters; - }; - SignatureObject.prototype.getParameters = function () { - return this.parameters; - }; - SignatureObject.prototype.getReturnType = function () { - return this.checker.getReturnTypeOfSignature(this); - }; - SignatureObject.prototype.getDocumentationComment = function () { - if (this.documentationComment === undefined) { - this.documentationComment = this.declaration ? getJsDocCommentsFromDeclarations([this.declaration], this.declaration.name ? this.declaration.name.text : "", false) : []; - } - return this.documentationComment; - }; - return SignatureObject; - })(); - var incrementalParse = TypeScript.IncrementalParser.parse; - var SourceFileObject = (function (_super) { - __extends(SourceFileObject, _super); - function SourceFileObject() { - _super.apply(this, arguments); - } - SourceFileObject.prototype.getLineAndCharacterFromPosition = function (position) { - return null; - }; - SourceFileObject.prototype.getPositionFromLineAndCharacter = function (line, character) { - return -1; - }; - SourceFileObject.prototype.getSourceUnit = function () { - return this.getSyntaxTree().sourceUnit(); - }; - SourceFileObject.prototype.getScriptSnapshot = function () { - return this.scriptSnapshot; - }; - SourceFileObject.prototype.getLineMap = function () { - return this.getSyntaxTree().lineMap(); - }; - SourceFileObject.prototype.getNamedDeclarations = function () { - if (!this.namedDeclarations) { - var sourceFile = this; - var namedDeclarations = []; - ts.forEachChild(sourceFile, function visit(node) { - switch (node.kind) { - case 172 /* FunctionDeclaration */: - case 120 /* Method */: - var functionDeclaration = node; - if (functionDeclaration.name && functionDeclaration.name.kind !== 115 /* Missing */) { - var lastDeclaration = namedDeclarations.length > 0 ? namedDeclarations[namedDeclarations.length - 1] : undefined; - if (lastDeclaration && functionDeclaration.symbol === lastDeclaration.symbol) { - if (functionDeclaration.body && !lastDeclaration.body) { - namedDeclarations[namedDeclarations.length - 1] = functionDeclaration; - } - } - else { - namedDeclarations.push(node); - } - ts.forEachChild(node, visit); - } - break; - case 174 /* ClassDeclaration */: - case 175 /* InterfaceDeclaration */: - case 176 /* EnumDeclaration */: - case 177 /* ModuleDeclaration */: - case 179 /* ImportDeclaration */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 129 /* TypeLiteral */: - if (node.name) { - namedDeclarations.push(node); - } - case 121 /* Constructor */: - case 149 /* VariableStatement */: - case 178 /* ModuleBlock */: - case 173 /* FunctionBlock */: - ts.forEachChild(node, visit); - break; - case 118 /* Parameter */: - if (!(node.flags & ts.NodeFlags.AccessibilityModifier)) { - break; - } - case 171 /* VariableDeclaration */: - case 181 /* EnumMember */: - case 119 /* Property */: - namedDeclarations.push(node); - break; - } - }); - this.namedDeclarations = namedDeclarations; - } - return this.namedDeclarations; - }; - SourceFileObject.prototype.getSyntaxTree = function () { - if (!this.syntaxTree) { - var start = new Date().getTime(); - this.syntaxTree = TypeScript.Parser.parse(this.filename, TypeScript.SimpleText.fromScriptSnapshot(this.scriptSnapshot), this.languageVersion, this.isDeclareFile()); - var time = new Date().getTime() - start; - } - return this.syntaxTree; - }; - SourceFileObject.prototype.isDeclareFile = function () { - return TypeScript.isDTSFile(this.filename); - }; - SourceFileObject.prototype.update = function (scriptSnapshot, version, isOpen, textChangeRange) { - var oldSyntaxTree = this.syntaxTree; - if (textChangeRange && ts.Debug.shouldAssert(1 /* Normal */)) { - var oldText = this.scriptSnapshot; - var newText = scriptSnapshot; - TypeScript.Debug.assert((oldText.getLength() - textChangeRange.span().length() + textChangeRange.newLength()) === newText.getLength()); - if (ts.Debug.shouldAssert(3 /* VeryAggressive */)) { - var oldTextPrefix = oldText.getText(0, textChangeRange.span().start()); - var newTextPrefix = newText.getText(0, textChangeRange.span().start()); - TypeScript.Debug.assert(oldTextPrefix === newTextPrefix); - var oldTextSuffix = oldText.getText(textChangeRange.span().end(), oldText.getLength()); - var newTextSuffix = newText.getText(textChangeRange.newSpan().end(), newText.getLength()); - TypeScript.Debug.assert(oldTextSuffix === newTextSuffix); - } - } - var text = TypeScript.SimpleText.fromScriptSnapshot(scriptSnapshot); - var newSyntaxTree = !textChangeRange || !oldSyntaxTree ? TypeScript.Parser.parse(this.filename, text, this.languageVersion, TypeScript.isDTSFile(this.filename)) : TypeScript.IncrementalParser.parse(oldSyntaxTree, textChangeRange, text); - return SourceFileObject.createSourceFileObject(this.filename, scriptSnapshot, this.languageVersion, version, isOpen, newSyntaxTree); - }; - SourceFileObject.createSourceFileObject = function (filename, scriptSnapshot, languageVersion, version, isOpen, syntaxTree) { - var newSourceFile = ts.createSourceFile(filename, scriptSnapshot.getText(0, scriptSnapshot.getLength()), languageVersion, version, isOpen); - newSourceFile.scriptSnapshot = scriptSnapshot; - newSourceFile.syntaxTree = syntaxTree; - return newSourceFile; - }; - return SourceFileObject; - })(NodeObject); - var TextChange = (function () { - function TextChange() { - } - return TextChange; - })(); - ts.TextChange = TextChange; - (function (OutputFileType) { - OutputFileType[OutputFileType["JavaScript"] = 0] = "JavaScript"; - OutputFileType[OutputFileType["SourceMap"] = 1] = "SourceMap"; - OutputFileType[OutputFileType["Declaration"] = 2] = "Declaration"; - })(ts.OutputFileType || (ts.OutputFileType = {})); - var OutputFileType = ts.OutputFileType; - (function (EndOfLineState) { - EndOfLineState[EndOfLineState["Start"] = 0] = "Start"; - EndOfLineState[EndOfLineState["InMultiLineCommentTrivia"] = 1] = "InMultiLineCommentTrivia"; - EndOfLineState[EndOfLineState["InSingleQuoteStringLiteral"] = 2] = "InSingleQuoteStringLiteral"; - EndOfLineState[EndOfLineState["InDoubleQuoteStringLiteral"] = 3] = "InDoubleQuoteStringLiteral"; - })(ts.EndOfLineState || (ts.EndOfLineState = {})); - var EndOfLineState = ts.EndOfLineState; - (function (TokenClass) { - TokenClass[TokenClass["Punctuation"] = 0] = "Punctuation"; - TokenClass[TokenClass["Keyword"] = 1] = "Keyword"; - TokenClass[TokenClass["Operator"] = 2] = "Operator"; - TokenClass[TokenClass["Comment"] = 3] = "Comment"; - TokenClass[TokenClass["Whitespace"] = 4] = "Whitespace"; - TokenClass[TokenClass["Identifier"] = 5] = "Identifier"; - TokenClass[TokenClass["NumberLiteral"] = 6] = "NumberLiteral"; - TokenClass[TokenClass["StringLiteral"] = 7] = "StringLiteral"; - TokenClass[TokenClass["RegExpLiteral"] = 8] = "RegExpLiteral"; - })(ts.TokenClass || (ts.TokenClass = {})); - var TokenClass = ts.TokenClass; - var ScriptElementKind = (function () { - function ScriptElementKind() { - } - ScriptElementKind.unknown = ""; - ScriptElementKind.keyword = "keyword"; - ScriptElementKind.scriptElement = "script"; - ScriptElementKind.moduleElement = "module"; - ScriptElementKind.classElement = "class"; - ScriptElementKind.interfaceElement = "interface"; - ScriptElementKind.enumElement = "enum"; - ScriptElementKind.variableElement = "var"; - ScriptElementKind.localVariableElement = "local var"; - ScriptElementKind.functionElement = "function"; - ScriptElementKind.localFunctionElement = "local function"; - ScriptElementKind.memberFunctionElement = "method"; - ScriptElementKind.memberGetAccessorElement = "getter"; - ScriptElementKind.memberSetAccessorElement = "setter"; - ScriptElementKind.memberVariableElement = "property"; - ScriptElementKind.constructorImplementationElement = "constructor"; - ScriptElementKind.callSignatureElement = "call"; - ScriptElementKind.indexSignatureElement = "index"; - ScriptElementKind.constructSignatureElement = "construct"; - ScriptElementKind.parameterElement = "parameter"; - ScriptElementKind.typeParameterElement = "type parameter"; - ScriptElementKind.primitiveType = "primitive type"; - ScriptElementKind.label = "label"; - ScriptElementKind.alias = "alias"; - return ScriptElementKind; - })(); - ts.ScriptElementKind = ScriptElementKind; - var ScriptElementKindModifier = (function () { - function ScriptElementKindModifier() { - } - ScriptElementKindModifier.none = ""; - ScriptElementKindModifier.publicMemberModifier = "public"; - ScriptElementKindModifier.privateMemberModifier = "private"; - ScriptElementKindModifier.protectedMemberModifier = "protected"; - ScriptElementKindModifier.exportedModifier = "export"; - ScriptElementKindModifier.ambientModifier = "declare"; - ScriptElementKindModifier.staticModifier = "static"; - return ScriptElementKindModifier; - })(); - ts.ScriptElementKindModifier = ScriptElementKindModifier; - var ClassificationTypeNames = (function () { - function ClassificationTypeNames() { - } - ClassificationTypeNames.comment = "comment"; - ClassificationTypeNames.identifier = "identifier"; - ClassificationTypeNames.keyword = "keyword"; - ClassificationTypeNames.numericLiteral = "number"; - ClassificationTypeNames.operator = "operator"; - ClassificationTypeNames.stringLiteral = "string"; - ClassificationTypeNames.whiteSpace = "whitespace"; - ClassificationTypeNames.text = "text"; - ClassificationTypeNames.punctuation = "punctuation"; - ClassificationTypeNames.className = "class name"; - ClassificationTypeNames.enumName = "enum name"; - ClassificationTypeNames.interfaceName = "interface name"; - ClassificationTypeNames.moduleName = "module name"; - ClassificationTypeNames.typeParameterName = "type parameter name"; - return ClassificationTypeNames; - })(); - ts.ClassificationTypeNames = ClassificationTypeNames; - var MatchKind; - (function (MatchKind) { - MatchKind[MatchKind["none"] = 0] = "none"; - MatchKind[MatchKind["exact"] = 1] = "exact"; - MatchKind[MatchKind["substring"] = 2] = "substring"; - MatchKind[MatchKind["prefix"] = 3] = "prefix"; - })(MatchKind || (MatchKind = {})); - function displayPartsToString(displayParts) { - if (displayParts) { - return ts.map(displayParts, function (displayPart) { return displayPart.text; }).join(""); - } - return ""; - } - ts.displayPartsToString = displayPartsToString; - var displayPartWriter = getDisplayPartWriter(); - function getDisplayPartWriter() { - var displayParts; - var lineStart; - var indent; - resetWriter(); - return { - displayParts: function () { return displayParts; }, - writeKind: writeKind, - writeSymbol: writeSymbol, - writeLine: writeLine, - increaseIndent: function () { - indent++; - }, - decreaseIndent: function () { - indent--; - }, - clear: resetWriter, - trackSymbol: function () { - } - }; - function writeIndent() { - if (lineStart) { - displayParts.push(displayPart(ts.getIndentString(indent), 16 /* space */)); - lineStart = false; - } - } - function writeKind(text, kind) { - writeIndent(); - displayParts.push(displayPart(text, kind)); - } - function writeSymbol(text, symbol) { - writeIndent(); - displayParts.push(symbolPart(text, symbol)); - } - function writeLine() { - displayParts.push(lineBreakPart()); - lineStart = true; - } - function resetWriter() { - displayParts = []; - lineStart = true; - indent = 0; - } - } - function displayPart(text, kind, symbol) { - return { - text: text, - kind: ts.SymbolDisplayPartKind[kind] - }; - } - function spacePart() { - return displayPart(" ", 16 /* space */); - } - ts.spacePart = spacePart; - function keywordPart(kind) { - return displayPart(ts.tokenToString(kind), 5 /* keyword */); - } - ts.keywordPart = keywordPart; - function punctuationPart(kind) { - return displayPart(ts.tokenToString(kind), 15 /* punctuation */); - } - ts.punctuationPart = punctuationPart; - function operatorPart(kind) { - return displayPart(ts.tokenToString(kind), 12 /* operator */); - } - ts.operatorPart = operatorPart; - function textPart(text) { - return displayPart(text, 17 /* text */); - } - ts.textPart = textPart; - function lineBreakPart() { - return displayPart("\n", 6 /* lineBreak */); - } - ts.lineBreakPart = lineBreakPart; - function isFirstDeclarationOfSymbolParameter(symbol) { - return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 118 /* Parameter */; - } - function isLocalVariableOrFunction(symbol) { - if (symbol.parent) { - return false; - } - return ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 141 /* FunctionExpression */) { - return true; - } - if (declaration.kind !== 171 /* VariableDeclaration */ && declaration.kind !== 172 /* FunctionDeclaration */) { - return false; - } - for (var parent = declaration.parent; parent.kind !== 173 /* FunctionBlock */; parent = parent.parent) { - if (parent.kind === 182 /* SourceFile */ || parent.kind === 178 /* ModuleBlock */) { - return false; - } - } - return true; - }); - } - function symbolPart(text, symbol) { - return displayPart(text, displayPartKind(symbol), symbol); - function displayPartKind(symbol) { - var flags = symbol.flags; - if (flags & 1 /* Variable */) { - return isFirstDeclarationOfSymbolParameter(symbol) ? 13 /* parameterName */ : 9 /* localName */; - } - else if (flags & 2 /* Property */) { - return 14 /* propertyName */; - } - else if (flags & 4 /* EnumMember */) { - return 19 /* enumMemberName */; - } - else if (flags & 8 /* Function */) { - return 20 /* functionName */; - } - else if (flags & 16 /* Class */) { - return 1 /* className */; - } - else if (flags & 32 /* Interface */) { - return 4 /* interfaceName */; - } - else if (flags & 64 /* Enum */) { - return 2 /* enumName */; - } - else if (flags & ts.SymbolFlags.Module) { - return 11 /* moduleName */; - } - else if (flags & 2048 /* Method */) { - return 10 /* methodName */; - } - else if (flags & 262144 /* TypeParameter */) { - return 18 /* typeParameterName */; - } - return 17 /* text */; - } - } - ts.symbolPart = symbolPart; - function mapToDisplayParts(writeDisplayParts) { - writeDisplayParts(displayPartWriter); - var result = displayPartWriter.displayParts(); - displayPartWriter.clear(); - return result; - } - function typeToDisplayParts(typechecker, type, enclosingDeclaration, flags) { - return mapToDisplayParts(function (writer) { - typechecker.writeType(type, writer, enclosingDeclaration, flags); - }); - } - ts.typeToDisplayParts = typeToDisplayParts; - function symbolToDisplayParts(typeChecker, symbol, enclosingDeclaration, meaning, flags) { - return mapToDisplayParts(function (writer) { - typeChecker.writeSymbol(symbol, writer, enclosingDeclaration, meaning, flags); - }); - } - ts.symbolToDisplayParts = symbolToDisplayParts; - function signatureToDisplayParts(typechecker, signature, enclosingDeclaration, flags) { - return mapToDisplayParts(function (writer) { - typechecker.writeSignature(signature, writer, enclosingDeclaration, flags); - }); - } - function getDefaultCompilerOptions() { - return { - target: 1 /* ES5 */, - module: 0 /* None */ - }; - } - ts.getDefaultCompilerOptions = getDefaultCompilerOptions; - function compareDataObjects(dst, src) { - for (var e in dst) { - if (typeof dst[e] === "object") { - if (!compareDataObjects(dst[e], src[e])) - return false; - } - else if (typeof dst[e] !== "function") { - if (dst[e] !== src[e]) - return false; - } - } - return true; - } - ts.compareDataObjects = compareDataObjects; - var OperationCanceledException = (function () { - function OperationCanceledException() { - } - return OperationCanceledException; - })(); - ts.OperationCanceledException = OperationCanceledException; - var CancellationTokenObject = (function () { - function CancellationTokenObject(cancellationToken) { - this.cancellationToken = cancellationToken; - } - CancellationTokenObject.prototype.isCancellationRequested = function () { - return this.cancellationToken && this.cancellationToken.isCancellationRequested(); - }; - CancellationTokenObject.prototype.throwIfCancellationRequested = function () { - if (this.isCancellationRequested()) { - throw new OperationCanceledException(); - } - }; - CancellationTokenObject.None = new CancellationTokenObject(null); - return CancellationTokenObject; - })(); - ts.CancellationTokenObject = CancellationTokenObject; - var HostCache = (function () { - function HostCache(host) { - this.host = host; - this.filenameToEntry = {}; - var filenames = host.getScriptFileNames(); - for (var i = 0, n = filenames.length; i < n; i++) { - var filename = filenames[i]; - this.filenameToEntry[TypeScript.switchToForwardSlashes(filename)] = { - filename: filename, - version: host.getScriptVersion(filename), - isOpen: host.getScriptIsOpen(filename) - }; - } - this._compilationSettings = host.getCompilationSettings() || getDefaultCompilerOptions(); - } - HostCache.prototype.compilationSettings = function () { - return this._compilationSettings; - }; - HostCache.prototype.getEntry = function (filename) { - filename = TypeScript.switchToForwardSlashes(filename); - return ts.lookUp(this.filenameToEntry, filename); - }; - HostCache.prototype.contains = function (filename) { - return !!this.getEntry(filename); - }; - HostCache.prototype.getHostfilename = function (filename) { - var hostCacheEntry = this.getEntry(filename); - if (hostCacheEntry) { - return hostCacheEntry.filename; - } - return filename; - }; - HostCache.prototype.getFilenames = function () { - var _this = this; - var fileNames = []; - ts.forEachKey(this.filenameToEntry, function (key) { - if (ts.hasProperty(_this.filenameToEntry, key)) - fileNames.push(key); - }); - return fileNames; - }; - HostCache.prototype.getVersion = function (filename) { - return this.getEntry(filename).version; - }; - HostCache.prototype.isOpen = function (filename) { - return this.getEntry(filename).isOpen; - }; - HostCache.prototype.getScriptSnapshot = function (filename) { - var file = this.getEntry(filename); - if (!file.sourceText) { - file.sourceText = this.host.getScriptSnapshot(file.filename); - } - return file.sourceText; - }; - HostCache.prototype.getChangeRange = function (filename, lastKnownVersion, oldScriptSnapshot) { - var currentVersion = this.getVersion(filename); - if (lastKnownVersion === currentVersion) { - return TypeScript.TextChangeRange.unchanged; - } - var scriptSnapshot = this.getScriptSnapshot(filename); - return scriptSnapshot.getChangeRange(oldScriptSnapshot); - }; - return HostCache; - })(); - var SyntaxTreeCache = (function () { - function SyntaxTreeCache(host) { - this.host = host; - this.currentFilename = ""; - this.currentFileVersion = null; - this.currentSourceFile = null; - this.currentFileSyntaxTree = null; - this.hostCache = new HostCache(host); - } - SyntaxTreeCache.prototype.initialize = function (filename) { - ts.Debug.assert(!!this.currentFileSyntaxTree === !!this.currentSourceFile); - this.hostCache = new HostCache(this.host); - var version = this.hostCache.getVersion(filename); - var syntaxTree = null; - var sourceFile; - if (this.currentFileSyntaxTree === null || this.currentFilename !== filename) { - var scriptSnapshot = this.hostCache.getScriptSnapshot(filename); - syntaxTree = this.createSyntaxTree(filename, scriptSnapshot); - sourceFile = createSourceFileFromScriptSnapshot(filename, scriptSnapshot, getDefaultCompilerOptions(), version, true); - fixupParentReferences(sourceFile); - } - else if (this.currentFileVersion !== version) { - var scriptSnapshot = this.hostCache.getScriptSnapshot(filename); - syntaxTree = this.updateSyntaxTree(filename, scriptSnapshot, this.currentSourceFile.getScriptSnapshot(), this.currentFileSyntaxTree, this.currentFileVersion); - var editRange = this.hostCache.getChangeRange(filename, this.currentFileVersion, this.currentSourceFile.getScriptSnapshot()); - sourceFile = !editRange ? createSourceFileFromScriptSnapshot(filename, scriptSnapshot, getDefaultCompilerOptions(), version, true) : this.currentSourceFile.update(scriptSnapshot, version, true, editRange); - fixupParentReferences(sourceFile); - } - if (syntaxTree !== null) { - ts.Debug.assert(sourceFile); - this.currentFileVersion = version; - this.currentFilename = filename; - this.currentFileSyntaxTree = syntaxTree; - this.currentSourceFile = sourceFile; - } - function fixupParentReferences(sourceFile) { - var parent = sourceFile; - function walk(n) { - n.parent = parent; - var saveParent = parent; - parent = n; - ts.forEachChild(n, walk); - parent = saveParent; - } - ts.forEachChild(sourceFile, walk); - } - }; - SyntaxTreeCache.prototype.getCurrentFileSyntaxTree = function (filename) { - this.initialize(filename); - return this.currentFileSyntaxTree; - }; - SyntaxTreeCache.prototype.getCurrentSourceFile = function (filename) { - this.initialize(filename); - return this.currentSourceFile; - }; - SyntaxTreeCache.prototype.getCurrentScriptSnapshot = function (filename) { - this.getCurrentFileSyntaxTree(filename); - return this.getCurrentSourceFile(filename).getScriptSnapshot(); - }; - SyntaxTreeCache.prototype.createSyntaxTree = function (filename, scriptSnapshot) { - var text = TypeScript.SimpleText.fromScriptSnapshot(scriptSnapshot); - var syntaxTree = TypeScript.Parser.parse(filename, text, getDefaultCompilerOptions().target, TypeScript.isDTSFile(filename)); - return syntaxTree; - }; - SyntaxTreeCache.prototype.updateSyntaxTree = function (filename, scriptSnapshot, previousScriptSnapshot, previousSyntaxTree, previousFileVersion) { - var editRange = this.hostCache.getChangeRange(filename, previousFileVersion, previousScriptSnapshot); - if (editRange === null) { - return this.createSyntaxTree(filename, scriptSnapshot); - } - var nextSyntaxTree = TypeScript.IncrementalParser.parse(previousSyntaxTree, editRange, TypeScript.SimpleText.fromScriptSnapshot(scriptSnapshot)); - this.ensureInvariants(filename, editRange, nextSyntaxTree, previousScriptSnapshot, scriptSnapshot); - return nextSyntaxTree; - }; - SyntaxTreeCache.prototype.ensureInvariants = function (filename, editRange, incrementalTree, oldScriptSnapshot, newScriptSnapshot) { - var expectedNewLength = oldScriptSnapshot.getLength() - editRange.span().length() + editRange.newLength(); - var actualNewLength = newScriptSnapshot.getLength(); - function provideMoreDebugInfo() { - var debugInformation = ["expected length:", expectedNewLength, "and actual length:", actualNewLength, "are not equal\r\n"]; - var oldSpan = editRange.span(); - function prettyPrintString(s) { - return '"' + s.replace(/\r/g, '\\r').replace(/\n/g, '\\n') + '"'; - } - debugInformation.push('Edit range (old text) (start: ' + oldSpan.start() + ', end: ' + oldSpan.end() + ') \r\n'); - debugInformation.push('Old text edit range contents: ' + prettyPrintString(oldScriptSnapshot.getText(oldSpan.start(), oldSpan.end()))); - var newSpan = editRange.newSpan(); - debugInformation.push('Edit range (new text) (start: ' + newSpan.start() + ', end: ' + newSpan.end() + ') \r\n'); - debugInformation.push('New text edit range contents: ' + prettyPrintString(newScriptSnapshot.getText(newSpan.start(), newSpan.end()))); - return debugInformation.join(' '); - } - ts.Debug.assert(expectedNewLength === actualNewLength, "Expected length is different from actual!", provideMoreDebugInfo); - if (ts.Debug.shouldAssert(3 /* VeryAggressive */)) { - var oldPrefixText = oldScriptSnapshot.getText(0, editRange.span().start()); - var newPrefixText = newScriptSnapshot.getText(0, editRange.span().start()); - ts.Debug.assert(oldPrefixText === newPrefixText, 'Expected equal prefix texts!'); - var oldSuffixText = oldScriptSnapshot.getText(editRange.span().end(), oldScriptSnapshot.getLength()); - var newSuffixText = newScriptSnapshot.getText(editRange.newSpan().end(), newScriptSnapshot.getLength()); - ts.Debug.assert(oldSuffixText === newSuffixText, 'Expected equal suffix texts!'); - var incrementalTreeText = TypeScript.fullText(incrementalTree.sourceUnit()); - var actualSnapshotText = newScriptSnapshot.getText(0, newScriptSnapshot.getLength()); - ts.Debug.assert(incrementalTreeText === actualSnapshotText, 'Expected full texts to be equal'); - } - }; - return SyntaxTreeCache; - })(); - function createSourceFileFromScriptSnapshot(filename, scriptSnapshot, settings, version, isOpen) { - return SourceFileObject.createSourceFileObject(filename, scriptSnapshot, settings.target, version, isOpen); - } - function createDocumentRegistry() { - var buckets = {}; - function getKeyFromCompilationSettings(settings) { - return "_" + ts.ScriptTarget[settings.target]; - } - function getBucketForCompilationSettings(settings, createIfMissing) { - var key = getKeyFromCompilationSettings(settings); - var bucket = ts.lookUp(buckets, key); - if (!bucket && createIfMissing) { - buckets[key] = bucket = {}; - } - return bucket; - } - function reportStats() { - var bucketInfoArray = Object.keys(buckets).filter(function (name) { return name && name.charAt(0) === '_'; }).map(function (name) { - var entries = ts.lookUp(buckets, name); - var sourceFiles = []; - for (var i in entries) { - var entry = entries[i]; - sourceFiles.push({ - name: i, - refCount: entry.refCount, - references: entry.owners.slice(0) - }); - } - sourceFiles.sort(function (x, y) { return y.refCount - x.refCount; }); - return { - bucket: name, - sourceFiles: sourceFiles - }; - }); - return JSON.stringify(bucketInfoArray, null, 2); - } - function acquireDocument(filename, compilationSettings, scriptSnapshot, version, isOpen) { - var bucket = getBucketForCompilationSettings(compilationSettings, true); - var entry = ts.lookUp(bucket, filename); - if (!entry) { - var sourceFile = createSourceFileFromScriptSnapshot(filename, scriptSnapshot, compilationSettings, version, isOpen); - bucket[filename] = entry = { - sourceFile: sourceFile, - refCount: 0, - owners: [] - }; - } - entry.refCount++; - return entry.sourceFile; - } - function updateDocument(sourceFile, filename, compilationSettings, scriptSnapshot, version, isOpen, textChangeRange) { - var bucket = getBucketForCompilationSettings(compilationSettings, false); - ts.Debug.assert(bucket); - var entry = ts.lookUp(bucket, filename); - ts.Debug.assert(entry); - if (entry.sourceFile.isOpen === isOpen && entry.sourceFile.version === version) { - return entry.sourceFile; - } - entry.sourceFile = entry.sourceFile.update(scriptSnapshot, version, isOpen, textChangeRange); - return entry.sourceFile; - } - function releaseDocument(filename, compilationSettings) { - var bucket = getBucketForCompilationSettings(compilationSettings, false); - ts.Debug.assert(bucket); - var entry = ts.lookUp(bucket, filename); - entry.refCount--; - ts.Debug.assert(entry.refCount >= 0); - if (entry.refCount === 0) { - delete bucket[filename]; - } - } - return { - acquireDocument: acquireDocument, - updateDocument: updateDocument, - releaseDocument: releaseDocument, - reportStats: reportStats - }; - } - ts.createDocumentRegistry = createDocumentRegistry; - function getNodeModifiers(node) { - var flags = node.flags; - var result = []; - if (flags & 32 /* Private */) - result.push(ScriptElementKindModifier.privateMemberModifier); - if (flags & 64 /* Protected */) - result.push(ScriptElementKindModifier.protectedMemberModifier); - if (flags & 16 /* Public */) - result.push(ScriptElementKindModifier.publicMemberModifier); - if (flags & 128 /* Static */) - result.push(ScriptElementKindModifier.staticModifier); - if (flags & 1 /* Export */) - result.push(ScriptElementKindModifier.exportedModifier); - if (ts.isInAmbientContext(node)) - result.push(ScriptElementKindModifier.ambientModifier); - return result.length > 0 ? result.join(',') : ScriptElementKindModifier.none; - } - ts.getNodeModifiers = getNodeModifiers; - function getTargetLabel(referenceNode, labelName) { - while (referenceNode) { - if (referenceNode.kind === 164 /* LabeledStatement */ && referenceNode.label.text === labelName) { - return referenceNode.label; - } - referenceNode = referenceNode.parent; - } - return undefined; - } - function isJumpStatementTarget(node) { - return node.kind === 59 /* Identifier */ && (node.parent.kind === 158 /* BreakStatement */ || node.parent.kind === 157 /* ContinueStatement */) && node.parent.label === node; - } - function isLabelOfLabeledStatement(node) { - return node.kind === 59 /* Identifier */ && node.parent.kind === 164 /* LabeledStatement */ && node.parent.label === node; - } - function isLabeledBy(node, labelName) { - for (var owner = node.parent; owner.kind === 164 /* LabeledStatement */; owner = owner.parent) { - if (owner.label.text === labelName) { - return true; - } - } - return false; - } - function isLabelName(node) { - return isLabelOfLabeledStatement(node) || isJumpStatementTarget(node); - } - function isCallExpressionTarget(node) { - if (node.parent.kind === 135 /* PropertyAccess */ && node.parent.right === node) - node = node.parent; - return node.parent.kind === 137 /* CallExpression */ && node.parent.func === node; - } - function isNewExpressionTarget(node) { - if (node.parent.kind === 135 /* PropertyAccess */ && node.parent.right === node) - node = node.parent; - return node.parent.kind === 138 /* NewExpression */ && node.parent.func === node; - } - function isNameOfFunctionDeclaration(node) { - return node.kind === 59 /* Identifier */ && ts.isAnyFunction(node.parent) && node.parent.name === node; - } - function isNameOfPropertyAssignment(node) { - return (node.kind === 59 /* Identifier */ || node.kind === 7 /* StringLiteral */ || node.kind === 6 /* NumericLiteral */) && node.parent.kind === 134 /* PropertyAssignment */ && node.parent.name === node; - } - function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) { - if (node.kind === 7 /* StringLiteral */ || node.kind === 6 /* NumericLiteral */) { - switch (node.parent.kind) { - case 119 /* Property */: - case 134 /* PropertyAssignment */: - case 181 /* EnumMember */: - case 120 /* Method */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 177 /* ModuleDeclaration */: - return node.parent.name === node; - case 136 /* IndexedAccess */: - return node.parent.index === node; - } - } - return false; - } - function isNameOfExternalModuleImportOrDeclaration(node) { - return node.kind === 7 /* StringLiteral */ && ((node.parent.kind === 177 /* ModuleDeclaration */ && node.parent.name === node) || (node.parent.kind === 179 /* ImportDeclaration */ && node.parent.externalModuleName === node)); - } - var SemanticMeaning; - (function (SemanticMeaning) { - SemanticMeaning[SemanticMeaning["None"] = 0x0] = "None"; - SemanticMeaning[SemanticMeaning["Value"] = 0x1] = "Value"; - SemanticMeaning[SemanticMeaning["Type"] = 0x2] = "Type"; - SemanticMeaning[SemanticMeaning["Namespace"] = 0x4] = "Namespace"; - SemanticMeaning[SemanticMeaning["All"] = SemanticMeaning.Value | SemanticMeaning.Type | SemanticMeaning.Namespace] = "All"; - })(SemanticMeaning || (SemanticMeaning = {})); - var BreakContinueSearchType; - (function (BreakContinueSearchType) { - BreakContinueSearchType[BreakContinueSearchType["None"] = 0x0] = "None"; - BreakContinueSearchType[BreakContinueSearchType["Unlabeled"] = 0x1] = "Unlabeled"; - BreakContinueSearchType[BreakContinueSearchType["Labeled"] = 0x2] = "Labeled"; - BreakContinueSearchType[BreakContinueSearchType["All"] = BreakContinueSearchType.Unlabeled | BreakContinueSearchType.Labeled] = "All"; - })(BreakContinueSearchType || (BreakContinueSearchType = {})); - var keywordCompletions = []; - for (var i = ts.SyntaxKind.FirstKeyword; i <= ts.SyntaxKind.LastKeyword; i++) { - keywordCompletions.push({ - name: ts.tokenToString(i), - kind: ScriptElementKind.keyword, - kindModifiers: ScriptElementKindModifier.none - }); - } - function createLanguageService(host, documentRegistry) { - var syntaxTreeCache = new SyntaxTreeCache(host); - var formattingRulesProvider; - var hostCache; - var program; - var typeInfoResolver; - var fullTypeCheckChecker_doNotAccessDirectly; - var useCaseSensitivefilenames = false; - var sourceFilesByName = {}; - var documentRegistry = documentRegistry; - var cancellationToken = new CancellationTokenObject(host.getCancellationToken()); - var activeCompletionSession; - var writer = undefined; - if (!ts.localizedDiagnosticMessages) { - ts.localizedDiagnosticMessages = host.getLocalizedDiagnosticMessages(); - } - function getCanonicalFileName(filename) { - return useCaseSensitivefilenames ? filename : filename.toLowerCase(); - } - function getSourceFile(filename) { - return ts.lookUp(sourceFilesByName, getCanonicalFileName(filename)); - } - function getFullTypeCheckChecker() { - return fullTypeCheckChecker_doNotAccessDirectly || (fullTypeCheckChecker_doNotAccessDirectly = program.getTypeChecker(true)); - } - function createCompilerHost() { - return { - getSourceFile: function (filename, languageVersion) { - var sourceFile = getSourceFile(filename); - return sourceFile && sourceFile.getSourceFile(); - }, - getCancellationToken: function () { return cancellationToken; }, - getCanonicalFileName: function (filename) { return useCaseSensitivefilenames ? filename : filename.toLowerCase(); }, - useCaseSensitiveFileNames: function () { return useCaseSensitivefilenames; }, - getNewLine: function () { return "\r\n"; }, - getDefaultLibFilename: function () { - return host.getDefaultLibFilename(); - }, - writeFile: function (filename, data, writeByteOrderMark) { - writer(filename, data, writeByteOrderMark); - }, - getCurrentDirectory: function () { - return host.getCurrentDirectory(); - } - }; - } - function sourceFileUpToDate(sourceFile) { - return sourceFile && sourceFile.version === hostCache.getVersion(sourceFile.filename) && sourceFile.isOpen === hostCache.isOpen(sourceFile.filename); - } - function programUpToDate() { - if (!program) { - return false; - } - var hostFilenames = hostCache.getFilenames(); - if (program.getSourceFiles().length !== hostFilenames.length) { - return false; - } - for (var i = 0, n = hostFilenames.length; i < n; i++) { - if (!sourceFileUpToDate(program.getSourceFile(hostFilenames[i]))) { - return false; - } - } - return compareDataObjects(program.getCompilerOptions(), hostCache.compilationSettings()); - } - function synchronizeHostData() { - hostCache = new HostCache(host); - if (programUpToDate()) { - return; - } - var compilationSettings = hostCache.compilationSettings(); - var oldProgram = program; - if (oldProgram) { - var oldSettings = program.getCompilerOptions(); - var settingsChangeAffectsSyntax = oldSettings.target !== compilationSettings.target || oldSettings.module !== compilationSettings.module; - var changesInCompilationSettingsAffectSyntax = oldSettings && compilationSettings && !compareDataObjects(oldSettings, compilationSettings) && settingsChangeAffectsSyntax; - var oldSourceFiles = program.getSourceFiles(); - for (var i = 0, n = oldSourceFiles.length; i < n; i++) { - cancellationToken.throwIfCancellationRequested(); - var filename = oldSourceFiles[i].filename; - if (!hostCache.contains(filename) || changesInCompilationSettingsAffectSyntax) { - documentRegistry.releaseDocument(filename, oldSettings); - delete sourceFilesByName[getCanonicalFileName(filename)]; - } - } - } - var hostfilenames = hostCache.getFilenames(); - for (var i = 0, n = hostfilenames.length; i < n; i++) { - var filename = hostfilenames[i]; - var version = hostCache.getVersion(filename); - var isOpen = hostCache.isOpen(filename); - var scriptSnapshot = hostCache.getScriptSnapshot(filename); - var sourceFile = getSourceFile(filename); - if (sourceFile) { - if (sourceFileUpToDate(sourceFile)) { - continue; - } - var textChangeRange = null; - if (sourceFile.isOpen && isOpen) { - textChangeRange = hostCache.getChangeRange(filename, sourceFile.version, sourceFile.getScriptSnapshot()); - } - sourceFile = documentRegistry.updateDocument(sourceFile, filename, compilationSettings, scriptSnapshot, version, isOpen, textChangeRange); - } - else { - sourceFile = documentRegistry.acquireDocument(filename, compilationSettings, scriptSnapshot, version, isOpen); - } - sourceFilesByName[getCanonicalFileName(filename)] = sourceFile; - } - program = ts.createProgram(hostfilenames, compilationSettings, createCompilerHost()); - typeInfoResolver = program.getTypeChecker(false); - fullTypeCheckChecker_doNotAccessDirectly = undefined; - } - function cleanupSemanticCache() { - if (program) { - typeInfoResolver = program.getTypeChecker(false); - fullTypeCheckChecker_doNotAccessDirectly = undefined; - } - } - function dispose() { - if (program) { - ts.forEach(program.getSourceFiles(), function (f) { - documentRegistry.releaseDocument(f.filename, program.getCompilerOptions()); - }); - } - } - function getSyntacticDiagnostics(filename) { - synchronizeHostData(); - filename = TypeScript.switchToForwardSlashes(filename); - return program.getDiagnostics(getSourceFile(filename).getSourceFile()); - } - function getSemanticDiagnostics(filename) { - synchronizeHostData(); - filename = TypeScript.switchToForwardSlashes(filename); - var compilerOptions = program.getCompilerOptions(); - var checker = getFullTypeCheckChecker(); - var targetSourceFile = getSourceFile(filename); - var allDiagnostics = checker.getDiagnostics(targetSourceFile); - if (compilerOptions.declaration) { - allDiagnostics = allDiagnostics.concat(checker.getDeclarationDiagnostics(targetSourceFile)); - } - return allDiagnostics; - } - function getCompilerOptionsDiagnostics() { - synchronizeHostData(); - return program.getGlobalDiagnostics(); - } - function getValidCompletionEntryDisplayName(symbol, target) { - var displayName = symbol.getName(); - if (displayName && displayName.length > 0) { - var firstCharCode = displayName.charCodeAt(0); - if ((symbol.flags & ts.SymbolFlags.Namespace) && (firstCharCode === 39 /* singleQuote */ || firstCharCode === 34 /* doubleQuote */)) { - return undefined; - } - if (displayName && displayName.length >= 2 && firstCharCode === displayName.charCodeAt(displayName.length - 1) && (firstCharCode === 39 /* singleQuote */ || firstCharCode === 34 /* doubleQuote */)) { - displayName = displayName.substring(1, displayName.length - 1); - } - var isValid = ts.isIdentifierStart(displayName.charCodeAt(0), target); - for (var i = 1, n = displayName.length; isValid && i < n; i++) { - isValid = ts.isIdentifierPart(displayName.charCodeAt(i), target); - } - if (isValid) { - return displayName; - } - } - return undefined; - } - function createCompletionEntry(symbol, typeChecker) { - var displayName = getValidCompletionEntryDisplayName(symbol, program.getCompilerOptions().target); - if (!displayName) { - return undefined; - } - return { - name: displayName, - kind: getSymbolKind(symbol, typeChecker), - kindModifiers: getSymbolModifiers(symbol) - }; - } - function getCompletionsAtPosition(filename, position, isMemberCompletion) { - function getCompletionEntriesFromSymbols(symbols, session) { - ts.forEach(symbols, function (symbol) { - var entry = createCompletionEntry(symbol, session.typeChecker); - if (entry && !ts.lookUp(session.symbols, entry.name)) { - session.entries.push(entry); - session.symbols[entry.name] = symbol; - } - }); - } - function isCompletionListBlocker(sourceUnit, position) { - if (position < 0 || position > TypeScript.fullWidth(sourceUnit)) { - return true; - } - return TypeScript.Syntax.isEntirelyInsideComment(sourceUnit, position) || TypeScript.Syntax.isEntirelyInStringOrRegularExpressionLiteral(sourceUnit, position) || isIdentifierDefinitionLocation(sourceUnit, position) || isRightOfIllegalDot(sourceUnit, position); - } - function getContainingObjectLiteralApplicableForCompletion(sourceUnit, position) { - var previousToken = getNonIdentifierCompleteTokenOnLeft(sourceUnit, position); - if (previousToken) { - var parent = previousToken.parent; - switch (previousToken.kind()) { - case 70 /* OpenBraceToken */: - case 79 /* CommaToken */: - if (parent && parent.kind() === 2 /* SeparatedList */) { - parent = parent.parent; - } - if (parent && parent.kind() === 216 /* ObjectLiteralExpression */) { - return parent; - } - break; - } - } - return undefined; - } - function isIdentifierDefinitionLocation(sourceUnit, position) { - var positionedToken = getNonIdentifierCompleteTokenOnLeft(sourceUnit, position); - if (positionedToken) { - var containingNodeKind = TypeScript.Syntax.containingNode(positionedToken) && TypeScript.Syntax.containingNode(positionedToken).kind(); - switch (positionedToken.kind()) { - case 79 /* CommaToken */: - return containingNodeKind === 228 /* ParameterList */ || containingNodeKind === 225 /* VariableDeclaration */ || containingNodeKind === 133 /* EnumDeclaration */; - case 72 /* OpenParenToken */: - return containingNodeKind === 228 /* ParameterList */ || containingNodeKind === 237 /* CatchClause */; - case 70 /* OpenBraceToken */: - return containingNodeKind === 133 /* EnumDeclaration */; - case 57 /* PublicKeyword */: - case 55 /* PrivateKeyword */: - case 58 /* StaticKeyword */: - case 77 /* DotDotDotToken */: - return containingNodeKind === 243 /* Parameter */; - case 44 /* ClassKeyword */: - case 65 /* ModuleKeyword */: - case 46 /* EnumKeyword */: - case 52 /* InterfaceKeyword */: - case 27 /* FunctionKeyword */: - case 40 /* VarKeyword */: - case 64 /* GetKeyword */: - case 68 /* SetKeyword */: - return true; - } - switch (positionedToken.text()) { - case "class": - case "interface": - case "enum": - case "module": - return true; - } - } - return false; - } - function getNonIdentifierCompleteTokenOnLeft(sourceUnit, position) { - var positionedToken = TypeScript.Syntax.findCompleteTokenOnLeft(sourceUnit, position, true); - if (positionedToken && position === TypeScript.end(positionedToken) && positionedToken.kind() == 10 /* EndOfFileToken */) { - positionedToken = TypeScript.previousToken(positionedToken, true); - } - if (positionedToken && position === TypeScript.end(positionedToken) && positionedToken.kind() === 11 /* IdentifierName */) { - positionedToken = TypeScript.previousToken(positionedToken, true); - } - return positionedToken; - } - function isRightOfIllegalDot(sourceUnit, position) { - var positionedToken = getNonIdentifierCompleteTokenOnLeft(sourceUnit, position); - if (positionedToken) { - switch (positionedToken.kind()) { - case 76 /* DotToken */: - var leftOfDotPositionedToken = TypeScript.previousToken(positionedToken, true); - return leftOfDotPositionedToken && leftOfDotPositionedToken.kind() === 13 /* NumericLiteral */; - case 13 /* NumericLiteral */: - var text = positionedToken.text(); - return text.charAt(text.length - 1) === "."; - } - } - return false; - } - function isPunctuation(kind) { - return (ts.SyntaxKind.FirstPunctuation <= kind && kind <= ts.SyntaxKind.LastPunctuation); - } - function filterContextualMembersList(contextualMemberSymbols, existingMembers) { - if (!existingMembers || existingMembers.length === 0) { - return contextualMemberSymbols; - } - var existingMemberNames = {}; - ts.forEach(existingMembers, function (m) { - if (m.kind !== 134 /* PropertyAssignment */) { - return; - } - if (m.getStart() <= position && position <= m.getEnd()) { - return; - } - existingMemberNames[m.name.text] = true; - }); - var filteredMembers = []; - ts.forEach(contextualMemberSymbols, function (s) { - if (!existingMemberNames[s.name]) { - filteredMembers.push(s); - } - }); - return filteredMembers; - } - synchronizeHostData(); - filename = TypeScript.switchToForwardSlashes(filename); - var sourceFile = getSourceFile(filename); - var sourceUnit = sourceFile.getSourceUnit(); - if (isCompletionListBlocker(sourceFile.getSyntaxTree().sourceUnit(), position)) { - host.log("Returning an empty list because completion was blocked."); - return null; - } - var node = TypeScript.ASTHelpers.getAstAtPosition(sourceUnit, position, true, true); - if (node && node.kind() === 11 /* IdentifierName */ && TypeScript.start(node) === TypeScript.end(node)) { - node = node.parent; - } - var isRightOfDot = false; - if (node && node.kind() === 213 /* MemberAccessExpression */ && TypeScript.end(node.expression) < position) { - isRightOfDot = true; - node = node.expression; - } - else if (node && node.kind() === 121 /* QualifiedName */ && TypeScript.end(node.left) < position) { - isRightOfDot = true; - node = node.left; - } - else if (node && node.parent && node.kind() === 11 /* IdentifierName */ && node.parent.kind() === 213 /* MemberAccessExpression */ && node.parent.name === node) { - isRightOfDot = true; - node = node.parent.expression; - } - else if (node && node.parent && node.kind() === 11 /* IdentifierName */ && node.parent.kind() === 121 /* QualifiedName */ && node.parent.right === node) { - isRightOfDot = true; - node = node.parent.left; - } - var precedingToken = ts.findTokenOnLeftOfPosition(sourceFile, TypeScript.end(node)); - var mappedNode; - if (!precedingToken) { - mappedNode = sourceFile; - } - else if (isPunctuation(precedingToken.kind)) { - mappedNode = precedingToken.parent; - } - else { - mappedNode = precedingToken; - } - ts.Debug.assert(mappedNode, "Could not map a Fidelity node to an AST node"); - activeCompletionSession = { - filename: filename, - position: position, - entries: [], - symbols: {}, - location: mappedNode, - typeChecker: typeInfoResolver - }; - if (isRightOfDot) { - var symbols = []; - isMemberCompletion = true; - if (mappedNode.kind === 59 /* Identifier */ || mappedNode.kind === 116 /* QualifiedName */ || mappedNode.kind === 135 /* PropertyAccess */) { - var symbol = typeInfoResolver.getSymbolInfo(mappedNode); - if (symbol && symbol.flags & 4194304 /* Import */) { - symbol = typeInfoResolver.getAliasedSymbol(symbol); - } - if (symbol && symbol.flags & ts.SymbolFlags.HasExports) { - ts.forEachValue(symbol.exports, function (symbol) { - if (typeInfoResolver.isValidPropertyAccess((mappedNode.parent), symbol.name)) { - symbols.push(symbol); - } - }); - } - } - var type = typeInfoResolver.getTypeOfNode(mappedNode); - var apparentType = type && typeInfoResolver.getApparentType(type); - if (apparentType) { - ts.forEach(apparentType.getApparentProperties(), function (symbol) { - if (typeInfoResolver.isValidPropertyAccess((mappedNode.parent), symbol.name)) { - symbols.push(symbol); - } - }); - } - getCompletionEntriesFromSymbols(symbols, activeCompletionSession); - } - else { - var containingObjectLiteral = getContainingObjectLiteralApplicableForCompletion(sourceFile.getSyntaxTree().sourceUnit(), position); - if (containingObjectLiteral) { - var objectLiteral = (mappedNode.kind === 133 /* ObjectLiteral */ ? mappedNode : ts.getAncestor(mappedNode, 133 /* ObjectLiteral */)); - ts.Debug.assert(objectLiteral); - isMemberCompletion = true; - var contextualType = typeInfoResolver.getContextualType(objectLiteral); - if (!contextualType) { - return undefined; - } - var contextualTypeMembers = typeInfoResolver.getPropertiesOfType(contextualType); - if (contextualTypeMembers && contextualTypeMembers.length > 0) { - var filteredMembers = filterContextualMembersList(contextualTypeMembers, objectLiteral.properties); - getCompletionEntriesFromSymbols(filteredMembers, activeCompletionSession); - } - } - else { - isMemberCompletion = false; - var symbolMeanings = ts.SymbolFlags.Type | ts.SymbolFlags.Value | ts.SymbolFlags.Namespace | 4194304 /* Import */; - var symbols = typeInfoResolver.getSymbolsInScope(mappedNode, symbolMeanings); - getCompletionEntriesFromSymbols(symbols, activeCompletionSession); - } - } - if (!isMemberCompletion) { - Array.prototype.push.apply(activeCompletionSession.entries, keywordCompletions); - } - return { - isMemberCompletion: isMemberCompletion, - entries: activeCompletionSession.entries - }; - } - function getCompletionEntryDetails(filename, position, entryName) { - filename = TypeScript.switchToForwardSlashes(filename); - var session = activeCompletionSession; - if (!session || session.filename !== filename || session.position !== position) { - return undefined; - } - var symbol = ts.lookUp(activeCompletionSession.symbols, entryName); - if (symbol) { - var type = session.typeChecker.getTypeOfSymbol(symbol); - ts.Debug.assert(type, "Could not find type for symbol"); - var completionEntry = createCompletionEntry(symbol, session.typeChecker); - var displayPartsDocumentationsAndSymbolKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, getSourceFile(filename), session.location, session.typeChecker, session.location); - return { - name: entryName, - kind: displayPartsDocumentationsAndSymbolKind.symbolKind, - kindModifiers: completionEntry.kindModifiers, - displayParts: displayPartsDocumentationsAndSymbolKind.displayParts, - documentation: displayPartsDocumentationsAndSymbolKind.documentation - }; - } - else { - return { - name: entryName, - kind: ScriptElementKind.keyword, - kindModifiers: ScriptElementKindModifier.none, - displayParts: [displayPart(entryName, 5 /* keyword */)], - documentation: undefined - }; - } - } - function getContainerNode(node) { - while (true) { - node = node.parent; - if (!node) { - return node; - } - switch (node.kind) { - case 182 /* SourceFile */: - case 120 /* Method */: - case 172 /* FunctionDeclaration */: - case 141 /* FunctionExpression */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 174 /* ClassDeclaration */: - case 175 /* InterfaceDeclaration */: - case 176 /* EnumDeclaration */: - case 177 /* ModuleDeclaration */: - return node; - } - } - } - function getSymbolKind(symbol, typeResolver) { - var flags = typeInfoResolver.getRootSymbol(symbol).getFlags(); - if (flags & 16 /* Class */) - return ScriptElementKind.classElement; - if (flags & 64 /* Enum */) - return ScriptElementKind.enumElement; - if (flags & 32 /* Interface */) - return ScriptElementKind.interfaceElement; - if (flags & 262144 /* TypeParameter */) - return ScriptElementKind.typeParameterElement; - var result = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, flags, typeResolver); - if (result === ScriptElementKind.unknown) { - if (flags & 262144 /* TypeParameter */) - return ScriptElementKind.typeParameterElement; - if (flags & 4 /* EnumMember */) - return ScriptElementKind.variableElement; - if (flags & 4194304 /* Import */) - return ScriptElementKind.alias; - } - return result; - } - function getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, flags, typeResolver) { - if (typeResolver.isUndefinedSymbol(symbol)) { - return ScriptElementKind.variableElement; - } - if (typeResolver.isArgumentsSymbol(symbol)) { - return ScriptElementKind.localVariableElement; - } - if (flags & 1 /* Variable */) { - if (isFirstDeclarationOfSymbolParameter(symbol)) { - return ScriptElementKind.parameterElement; - } - return isLocalVariableOrFunction(symbol) ? ScriptElementKind.localVariableElement : ScriptElementKind.variableElement; - } - if (flags & 8 /* Function */) - return isLocalVariableOrFunction(symbol) ? ScriptElementKind.localFunctionElement : ScriptElementKind.functionElement; - if (flags & 8192 /* GetAccessor */) - return ScriptElementKind.memberGetAccessorElement; - if (flags & 16384 /* SetAccessor */) - return ScriptElementKind.memberSetAccessorElement; - if (flags & 2048 /* Method */) - return ScriptElementKind.memberFunctionElement; - if (flags & 2 /* Property */) - return ScriptElementKind.memberVariableElement; - if (flags & 4096 /* Constructor */) - return ScriptElementKind.constructorImplementationElement; - return ScriptElementKind.unknown; - } - function getTypeKind(type) { - var flags = type.getFlags(); - if (flags & 128 /* Enum */) - return ScriptElementKind.enumElement; - if (flags & 1024 /* Class */) - return ScriptElementKind.classElement; - if (flags & 2048 /* Interface */) - return ScriptElementKind.interfaceElement; - if (flags & 512 /* TypeParameter */) - return ScriptElementKind.typeParameterElement; - if (flags & ts.TypeFlags.Intrinsic) - return ScriptElementKind.primitiveType; - if (flags & 256 /* StringLiteral */) - return ScriptElementKind.primitiveType; - return ScriptElementKind.unknown; - } - function getNodeKind(node) { - switch (node.kind) { - case 177 /* ModuleDeclaration */: - return ScriptElementKind.moduleElement; - case 174 /* ClassDeclaration */: - return ScriptElementKind.classElement; - case 175 /* InterfaceDeclaration */: - return ScriptElementKind.interfaceElement; - case 176 /* EnumDeclaration */: - return ScriptElementKind.enumElement; - case 171 /* VariableDeclaration */: - return ScriptElementKind.variableElement; - case 172 /* FunctionDeclaration */: - return ScriptElementKind.functionElement; - case 122 /* GetAccessor */: - return ScriptElementKind.memberGetAccessorElement; - case 123 /* SetAccessor */: - return ScriptElementKind.memberSetAccessorElement; - case 120 /* Method */: - return ScriptElementKind.memberFunctionElement; - case 119 /* Property */: - return ScriptElementKind.memberVariableElement; - case 126 /* IndexSignature */: - return ScriptElementKind.indexSignatureElement; - case 125 /* ConstructSignature */: - return ScriptElementKind.constructSignatureElement; - case 124 /* CallSignature */: - return ScriptElementKind.callSignatureElement; - case 121 /* Constructor */: - return ScriptElementKind.constructorImplementationElement; - case 117 /* TypeParameter */: - return ScriptElementKind.typeParameterElement; - case 181 /* EnumMember */: - return ScriptElementKind.variableElement; - case 118 /* Parameter */: - return (node.flags & ts.NodeFlags.AccessibilityModifier) ? ScriptElementKind.memberVariableElement : ScriptElementKind.parameterElement; - return ScriptElementKind.unknown; - } - } - function getSymbolModifiers(symbol) { - return symbol && symbol.declarations && symbol.declarations.length > 0 ? getNodeModifiers(symbol.declarations[0]) : ScriptElementKindModifier.none; - } - function getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, sourceFile, enclosingDeclaration, typeResolver, location) { - var displayParts = []; - var documentation; - var symbolFlags = typeResolver.getRootSymbol(symbol).flags; - var symbolKind = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, symbolFlags, typeResolver); - var hasAddedSymbolInfo; - if (symbolKind !== ScriptElementKind.unknown || symbolFlags & 16 /* Class */ || symbolFlags & 4194304 /* Import */) { - if (symbolKind === ScriptElementKind.memberGetAccessorElement || symbolKind === ScriptElementKind.memberSetAccessorElement) { - symbolKind = ScriptElementKind.memberVariableElement; - } - var type = typeResolver.getTypeOfSymbol(symbol); - if (type) { - if (isCallExpressionTarget(location) || isNewExpressionTarget(location)) { - var callExpression; - if (location.parent.kind === 135 /* PropertyAccess */ && location.parent.right === location) { - location = location.parent; - } - callExpression = location.parent; - var candidateSignatures = []; - signature = typeResolver.getResolvedSignature(callExpression, candidateSignatures); - if (!signature && candidateSignatures.length) { - signature = candidateSignatures[0]; - } - var useConstructSignatures = callExpression.kind === 138 /* NewExpression */ || callExpression.func.kind === 85 /* SuperKeyword */; - var allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); - if (!ts.contains(allSignatures, signature.target || signature)) { - signature = allSignatures.length ? allSignatures[0] : undefined; - } - if (signature) { - if (useConstructSignatures && (symbolFlags & 16 /* Class */)) { - symbolKind = ScriptElementKind.constructorImplementationElement; - addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); - } - else if (symbolFlags & 4194304 /* Import */) { - symbolKind = ScriptElementKind.alias; - displayParts.push(punctuationPart(11 /* OpenParenToken */)); - displayParts.push(textPart(symbolKind)); - displayParts.push(punctuationPart(12 /* CloseParenToken */)); - displayParts.push(spacePart()); - if (useConstructSignatures) { - displayParts.push(keywordPart(82 /* NewKeyword */)); - displayParts.push(spacePart()); - } - addFullSymbolName(symbol); - } - else { - addPrefixForAnyFunctionOrVar(symbol, symbolKind); - } - switch (symbolKind) { - case ScriptElementKind.memberVariableElement: - case ScriptElementKind.variableElement: - case ScriptElementKind.parameterElement: - case ScriptElementKind.localVariableElement: - displayParts.push(punctuationPart(46 /* ColonToken */)); - displayParts.push(spacePart()); - if (useConstructSignatures) { - displayParts.push(keywordPart(82 /* NewKeyword */)); - displayParts.push(spacePart()); - } - if (!(type.flags & 16384 /* Anonymous */)) { - displayParts.push.apply(displayParts, symbolToDisplayParts(typeResolver, type.symbol, enclosingDeclaration, undefined, 1 /* WriteTypeParametersOrArguments */)); - } - addSignatureDisplayParts(signature, allSignatures, 8 /* WriteArrowStyleSignature */); - break; - default: - addSignatureDisplayParts(signature, allSignatures); - } - hasAddedSymbolInfo = true; - } - } - else if ((isNameOfFunctionDeclaration(location) && !(symbol.flags & ts.SymbolFlags.Accessor)) || (location.kind === 107 /* ConstructorKeyword */ && location.parent.kind === 121 /* Constructor */)) { - var signature; - var functionDeclaration = location.parent; - var allSignatures = functionDeclaration.kind === 121 /* Constructor */ ? type.getConstructSignatures() : type.getCallSignatures(); - if (!typeResolver.isImplementationOfOverload(functionDeclaration)) { - signature = typeResolver.getSignatureFromDeclaration(functionDeclaration); - } - else { - signature = allSignatures[0]; - } - if (functionDeclaration.kind === 121 /* Constructor */) { - addPrefixForAnyFunctionOrVar(type.symbol, ScriptElementKind.constructorImplementationElement); - } - else { - addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 124 /* CallSignature */ && !(type.symbol.flags & 512 /* TypeLiteral */ || type.symbol.flags & 1024 /* ObjectLiteral */) ? type.symbol : symbol, symbolKind); - } - addSignatureDisplayParts(signature, allSignatures); - hasAddedSymbolInfo = true; - } - } - } - if (symbolFlags & 16 /* Class */ && !hasAddedSymbolInfo) { - displayParts.push(keywordPart(63 /* ClassKeyword */)); - displayParts.push(spacePart()); - addFullSymbolName(symbol); - writeTypeParametersOfSymbol(symbol, sourceFile); - } - if (symbolFlags & 32 /* Interface */) { - addNewLineIfDisplayPartsExist(); - displayParts.push(keywordPart(97 /* InterfaceKeyword */)); - displayParts.push(spacePart()); - addFullSymbolName(symbol); - writeTypeParametersOfSymbol(symbol, sourceFile); - } - if (symbolFlags & 64 /* Enum */) { - addNewLineIfDisplayPartsExist(); - displayParts.push(keywordPart(71 /* EnumKeyword */)); - displayParts.push(spacePart()); - addFullSymbolName(symbol); - } - if (symbolFlags & ts.SymbolFlags.Module) { - addNewLineIfDisplayPartsExist(); - displayParts.push(keywordPart(110 /* ModuleKeyword */)); - displayParts.push(spacePart()); - addFullSymbolName(symbol); - } - if (symbolFlags & 262144 /* TypeParameter */) { - addNewLineIfDisplayPartsExist(); - displayParts.push(punctuationPart(11 /* OpenParenToken */)); - displayParts.push(textPart("type parameter")); - displayParts.push(punctuationPart(12 /* CloseParenToken */)); - displayParts.push(spacePart()); - addFullSymbolName(symbol); - displayParts.push(spacePart()); - displayParts.push(keywordPart(80 /* InKeyword */)); - displayParts.push(spacePart()); - if (symbol.parent) { - addFullSymbolName(symbol.parent, enclosingDeclaration); - writeTypeParametersOfSymbol(symbol.parent, enclosingDeclaration); - } - else { - var signatureDeclaration = ts.getDeclarationOfKind(symbol, 117 /* TypeParameter */).parent; - var signature = typeResolver.getSignatureFromDeclaration(signatureDeclaration); - if (signatureDeclaration.kind === 125 /* ConstructSignature */) { - displayParts.push(keywordPart(82 /* NewKeyword */)); - displayParts.push(spacePart()); - } - else if (signatureDeclaration.kind !== 124 /* CallSignature */ && signatureDeclaration.name) { - addFullSymbolName(signatureDeclaration.symbol); - } - displayParts.push.apply(displayParts, signatureToDisplayParts(typeResolver, signature, sourceFile, 32 /* WriteTypeArgumentsOfSignature */)); - } - } - if (symbolFlags & 4 /* EnumMember */) { - addPrefixForAnyFunctionOrVar(symbol, "enum member"); - var declaration = symbol.declarations[0]; - if (declaration.kind === 181 /* EnumMember */) { - var constantValue = typeResolver.getEnumMemberValue(declaration); - if (constantValue !== undefined) { - displayParts.push(spacePart()); - displayParts.push(operatorPart(47 /* EqualsToken */)); - displayParts.push(spacePart()); - displayParts.push(displayPart(constantValue.toString(), 7 /* numericLiteral */)); - } - } - } - if (symbolFlags & 4194304 /* Import */) { - addNewLineIfDisplayPartsExist(); - displayParts.push(keywordPart(79 /* ImportKeyword */)); - displayParts.push(spacePart()); - addFullSymbolName(symbol); - displayParts.push(spacePart()); - displayParts.push(punctuationPart(47 /* EqualsToken */)); - displayParts.push(spacePart()); - ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 179 /* ImportDeclaration */) { - var importDeclaration = declaration; - if (importDeclaration.externalModuleName) { - displayParts.push(keywordPart(111 /* RequireKeyword */)); - displayParts.push(punctuationPart(11 /* OpenParenToken */)); - displayParts.push(displayPart(ts.getTextOfNode(importDeclaration.externalModuleName), 8 /* stringLiteral */)); - displayParts.push(punctuationPart(12 /* CloseParenToken */)); - } - else { - var internalAliasSymbol = typeResolver.getSymbolInfo(importDeclaration.entityName); - addFullSymbolName(internalAliasSymbol, enclosingDeclaration); - } - return true; - } - }); - } - if (!hasAddedSymbolInfo) { - if (symbolKind !== ScriptElementKind.unknown) { - if (type) { - addPrefixForAnyFunctionOrVar(symbol, symbolKind); - if (symbolKind === ScriptElementKind.memberVariableElement || symbolFlags & 1 /* Variable */ || symbolKind === ScriptElementKind.localVariableElement) { - displayParts.push(punctuationPart(46 /* ColonToken */)); - displayParts.push(spacePart()); - if (type.symbol && type.symbol.flags & 262144 /* TypeParameter */) { - var typeParameterParts = mapToDisplayParts(function (writer) { - typeResolver.writeTypeParameter(type, writer, enclosingDeclaration); - }); - displayParts.push.apply(displayParts, typeParameterParts); - } - else { - displayParts.push.apply(displayParts, typeToDisplayParts(typeResolver, type, enclosingDeclaration)); - } - } - else if (symbolFlags & 8 /* Function */ || symbolFlags & 2048 /* Method */ || symbolFlags & 4096 /* Constructor */ || symbolFlags & ts.SymbolFlags.Signature || symbolFlags & ts.SymbolFlags.Accessor) { - var allSignatures = type.getCallSignatures(); - addSignatureDisplayParts(allSignatures[0], allSignatures); - } - } - } - else { - symbolKind = getSymbolKind(symbol, typeResolver); - } - } - if (!documentation) { - documentation = symbol.getDocumentationComment(); - } - return { displayParts: displayParts, documentation: documentation, symbolKind: symbolKind }; - function addNewLineIfDisplayPartsExist() { - if (displayParts.length) { - displayParts.push(lineBreakPart()); - } - } - function addFullSymbolName(symbol, enclosingDeclaration) { - var fullSymbolDisplayParts = symbolToDisplayParts(typeResolver, symbol, enclosingDeclaration || sourceFile, undefined, 1 /* WriteTypeParametersOrArguments */ | 2 /* UseOnlyExternalAliasing */); - displayParts.push.apply(displayParts, fullSymbolDisplayParts); - } - function addPrefixForAnyFunctionOrVar(symbol, symbolKind) { - addNewLineIfDisplayPartsExist(); - if (symbolKind) { - displayParts.push(punctuationPart(11 /* OpenParenToken */)); - displayParts.push(textPart(symbolKind)); - displayParts.push(punctuationPart(12 /* CloseParenToken */)); - displayParts.push(spacePart()); - addFullSymbolName(symbol); - } - } - function addSignatureDisplayParts(signature, allSignatures, flags) { - displayParts.push.apply(displayParts, signatureToDisplayParts(typeResolver, signature, enclosingDeclaration, flags | 32 /* WriteTypeArgumentsOfSignature */)); - if (allSignatures.length > 1) { - displayParts.push(spacePart()); - displayParts.push(punctuationPart(11 /* OpenParenToken */)); - displayParts.push(operatorPart(28 /* PlusToken */)); - displayParts.push(displayPart((allSignatures.length - 1).toString(), 7 /* numericLiteral */)); - displayParts.push(spacePart()); - displayParts.push(textPart(allSignatures.length === 2 ? "overload" : "overloads")); - displayParts.push(punctuationPart(12 /* CloseParenToken */)); - } - documentation = signature.getDocumentationComment(); - } - function writeTypeParametersOfSymbol(symbol, enclosingDeclaration) { - var typeParameterParts = mapToDisplayParts(function (writer) { - typeResolver.writeTypeParametersOfSymbol(symbol, writer, enclosingDeclaration); - }); - displayParts.push.apply(displayParts, typeParameterParts); - } - } - function getQuickInfoAtPosition(fileName, position) { - synchronizeHostData(); - fileName = TypeScript.switchToForwardSlashes(fileName); - var sourceFile = getSourceFile(fileName); - var node = ts.getTouchingPropertyName(sourceFile, position); - if (!node) { - return undefined; - } - var symbol = typeInfoResolver.getSymbolInfo(node); - if (!symbol) { - switch (node.kind) { - case 59 /* Identifier */: - case 135 /* PropertyAccess */: - case 116 /* QualifiedName */: - case 87 /* ThisKeyword */: - case 85 /* SuperKeyword */: - var type = typeInfoResolver.getTypeOfNode(node); - if (type) { - return { - kind: ScriptElementKind.unknown, - kindModifiers: ScriptElementKindModifier.none, - textSpan: new TypeScript.TextSpan(node.getStart(), node.getWidth()), - displayParts: typeToDisplayParts(typeInfoResolver, type, getContainerNode(node)), - documentation: type.symbol ? type.symbol.getDocumentationComment() : undefined - }; - } - } - return undefined; - } - var displayPartsDocumentationsAndKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, sourceFile, getContainerNode(node), typeInfoResolver, node); - return { - kind: displayPartsDocumentationsAndKind.symbolKind, - kindModifiers: getSymbolModifiers(symbol), - textSpan: new TypeScript.TextSpan(node.getStart(), node.getWidth()), - displayParts: displayPartsDocumentationsAndKind.displayParts, - documentation: displayPartsDocumentationsAndKind.documentation - }; - } - function getDefinitionAtPosition(filename, position) { - function getDefinitionInfo(node, symbolKind, symbolName, containerName) { - return { - fileName: node.getSourceFile().filename, - textSpan: TypeScript.TextSpan.fromBounds(node.getStart(), node.getEnd()), - kind: symbolKind, - name: symbolName, - containerKind: undefined, - containerName: containerName - }; - } - function tryAddSignature(signatureDeclarations, selectConstructors, symbolKind, symbolName, containerName, result) { - var declarations = []; - var definition; - ts.forEach(signatureDeclarations, function (d) { - if ((selectConstructors && d.kind === 121 /* Constructor */) || (!selectConstructors && (d.kind === 172 /* FunctionDeclaration */ || d.kind === 120 /* Method */))) { - declarations.push(d); - if (d.body) - definition = d; - } - }); - if (definition) { - result.push(getDefinitionInfo(definition, symbolKind, symbolName, containerName)); - return true; - } - else if (declarations.length) { - result.push(getDefinitionInfo(declarations[declarations.length - 1], symbolKind, symbolName, containerName)); - return true; - } - return false; - } - function tryAddConstructSignature(symbol, location, symbolKind, symbolName, containerName, result) { - if (isNewExpressionTarget(location) || location.kind === 107 /* ConstructorKeyword */) { - if (symbol.flags & 16 /* Class */) { - var classDeclaration = symbol.getDeclarations()[0]; - ts.Debug.assert(classDeclaration && classDeclaration.kind === 174 /* ClassDeclaration */); - return tryAddSignature(classDeclaration.members, true, symbolKind, symbolName, containerName, result); - } - } - return false; - } - function tryAddCallSignature(symbol, location, symbolKind, symbolName, containerName, result) { - if (isCallExpressionTarget(location) || isNewExpressionTarget(location) || isNameOfFunctionDeclaration(location)) { - return tryAddSignature(symbol.declarations, false, symbolKind, symbolName, containerName, result); - } - return false; - } - synchronizeHostData(); - filename = TypeScript.switchToForwardSlashes(filename); - var sourceFile = getSourceFile(filename); - var node = ts.getTouchingPropertyName(sourceFile, position); - if (!node) { - return undefined; - } - if (isJumpStatementTarget(node)) { - var labelName = node.text; - var label = getTargetLabel(node.parent, node.text); - return label ? [getDefinitionInfo(label, ScriptElementKind.label, labelName, undefined)] : undefined; - } - var comment = ts.forEach(sourceFile.referencedFiles, function (r) { return (r.pos <= position && position < r.end) ? r : undefined; }); - if (comment) { - var targetFilename = ts.isRootedDiskPath(comment.filename) ? comment.filename : ts.combinePaths(ts.getDirectoryPath(filename), comment.filename); - targetFilename = ts.normalizePath(targetFilename); - if (program.getSourceFile(targetFilename)) { - return [{ - fileName: targetFilename, - textSpan: TypeScript.TextSpan.fromBounds(0, 0), - kind: ScriptElementKind.scriptElement, - name: comment.filename, - containerName: undefined, - containerKind: undefined - }]; - } - return undefined; - } - var symbol = typeInfoResolver.getSymbolInfo(node); - if (!symbol || !(symbol.getDeclarations())) { - return undefined; - } - var result = []; - var declarations = symbol.getDeclarations(); - var symbolName = typeInfoResolver.symbolToString(symbol); - var symbolKind = getSymbolKind(symbol, typeInfoResolver); - var containerSymbol = symbol.parent; - var containerName = containerSymbol ? typeInfoResolver.symbolToString(containerSymbol, node) : ""; - if (!tryAddConstructSignature(symbol, node, symbolKind, symbolName, containerName, result) && !tryAddCallSignature(symbol, node, symbolKind, symbolName, containerName, result)) { - ts.forEach(declarations, function (declaration) { - result.push(getDefinitionInfo(declaration, symbolKind, symbolName, containerName)); - }); - } - return result; - } - function getOccurrencesAtPosition(filename, position) { - synchronizeHostData(); - filename = TypeScript.switchToForwardSlashes(filename); - var sourceFile = getSourceFile(filename); - var node = ts.getTouchingWord(sourceFile, position); - if (!node) { - return undefined; - } - if (node.kind === 59 /* Identifier */ || node.kind === 87 /* ThisKeyword */ || node.kind === 85 /* SuperKeyword */ || isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || isNameOfExternalModuleImportOrDeclaration(node)) { - return getReferencesForNode(node, [sourceFile], false, false); - } - switch (node.kind) { - case 78 /* IfKeyword */: - case 70 /* ElseKeyword */: - if (hasKind(node.parent, 152 /* IfStatement */)) { - return getIfElseOccurrences(node.parent); - } - break; - case 84 /* ReturnKeyword */: - if (hasKind(node.parent, 159 /* ReturnStatement */)) { - return getReturnOccurrences(node.parent); - } - break; - case 88 /* ThrowKeyword */: - if (hasKind(node.parent, 165 /* ThrowStatement */)) { - return getThrowOccurrences(node.parent); - } - break; - case 90 /* TryKeyword */: - case 62 /* CatchKeyword */: - case 75 /* FinallyKeyword */: - if (hasKind(parent(parent(node)), 166 /* TryStatement */)) { - return getTryCatchFinallyOccurrences(node.parent.parent); - } - break; - case 86 /* SwitchKeyword */: - if (hasKind(node.parent, 161 /* SwitchStatement */)) { - return getSwitchCaseDefaultOccurrences(node.parent); - } - break; - case 61 /* CaseKeyword */: - case 67 /* DefaultKeyword */: - if (hasKind(parent(parent(node)), 161 /* SwitchStatement */)) { - return getSwitchCaseDefaultOccurrences(node.parent.parent); - } - break; - case 60 /* BreakKeyword */: - case 65 /* ContinueKeyword */: - if (hasKind(node.parent, 158 /* BreakStatement */) || hasKind(node.parent, 157 /* ContinueStatement */)) { - return getBreakOrContinueStatementOccurences(node.parent); - } - break; - case 76 /* ForKeyword */: - if (hasKind(node.parent, 155 /* ForStatement */) || hasKind(node.parent, 156 /* ForInStatement */)) { - return getLoopBreakContinueOccurrences(node.parent); - } - break; - case 94 /* WhileKeyword */: - case 69 /* DoKeyword */: - if (hasKind(node.parent, 154 /* WhileStatement */) || hasKind(node.parent, 153 /* DoStatement */)) { - return getLoopBreakContinueOccurrences(node.parent); - } - break; - case 107 /* ConstructorKeyword */: - if (hasKind(node.parent, 121 /* Constructor */)) { - return getConstructorOccurrences(node.parent); - } - break; - case 109 /* GetKeyword */: - case 113 /* SetKeyword */: - if (hasKind(node.parent, 122 /* GetAccessor */) || hasKind(node.parent, 123 /* SetAccessor */)) { - return getGetAndSetOccurrences(node.parent); - } - } - return undefined; - function getIfElseOccurrences(ifStatement) { - var keywords = []; - while (hasKind(ifStatement.parent, 152 /* IfStatement */) && ifStatement.parent.elseStatement === ifStatement) { - ifStatement = ifStatement.parent; - } - while (ifStatement) { - var children = ifStatement.getChildren(); - pushKeywordIf(keywords, children[0], 78 /* IfKeyword */); - for (var i = children.length - 1; i >= 0; i--) { - if (pushKeywordIf(keywords, children[i], 70 /* ElseKeyword */)) { - break; - } - } - if (!hasKind(ifStatement.elseStatement, 152 /* IfStatement */)) { - break; - } - ifStatement = ifStatement.elseStatement; - } - var result = []; - for (var i = 0; i < keywords.length; i++) { - if (keywords[i].kind === 70 /* ElseKeyword */ && i < keywords.length - 1) { - var elseKeyword = keywords[i]; - var ifKeyword = keywords[i + 1]; - var shouldHighlightNextKeyword = true; - for (var j = ifKeyword.getStart() - 1; j >= elseKeyword.end; j--) { - if (!ts.isWhiteSpace(sourceFile.text.charCodeAt(j))) { - shouldHighlightNextKeyword = false; - break; - } - } - if (shouldHighlightNextKeyword) { - result.push({ - fileName: filename, - textSpan: TypeScript.TextSpan.fromBounds(elseKeyword.getStart(), ifKeyword.end), - isWriteAccess: false - }); - i++; - continue; - } - } - result.push(getReferenceEntryFromNode(keywords[i])); - } - return result; - } - function getReturnOccurrences(returnStatement) { - var func = ts.getContainingFunction(returnStatement); - if (!(func && hasKind(func.body, 173 /* FunctionBlock */))) { - return undefined; - } - var keywords = []; - ts.forEachReturnStatement(func.body, function (returnStatement) { - pushKeywordIf(keywords, returnStatement.getFirstToken(), 84 /* ReturnKeyword */); - }); - ts.forEach(aggregateOwnedThrowStatements(func.body), function (throwStatement) { - pushKeywordIf(keywords, throwStatement.getFirstToken(), 88 /* ThrowKeyword */); - }); - return ts.map(keywords, getReferenceEntryFromNode); - } - function getThrowOccurrences(throwStatement) { - var owner = getThrowStatementOwner(throwStatement); - if (!owner) { - return undefined; - } - var keywords = []; - ts.forEach(aggregateOwnedThrowStatements(owner), function (throwStatement) { - pushKeywordIf(keywords, throwStatement.getFirstToken(), 88 /* ThrowKeyword */); - }); - if (owner.kind === 173 /* FunctionBlock */) { - ts.forEachReturnStatement(owner, function (returnStatement) { - pushKeywordIf(keywords, returnStatement.getFirstToken(), 84 /* ReturnKeyword */); - }); - } - return ts.map(keywords, getReferenceEntryFromNode); - } - function aggregateOwnedThrowStatements(node) { - var statementAccumulator = []; - aggregate(node); - return statementAccumulator; - function aggregate(node) { - if (node.kind === 165 /* ThrowStatement */) { - statementAccumulator.push(node); - } - else if (node.kind === 166 /* TryStatement */) { - var tryStatement = node; - if (tryStatement.catchBlock) { - aggregate(tryStatement.catchBlock); - } - else { - aggregate(tryStatement.tryBlock); - } - if (tryStatement.finallyBlock) { - aggregate(tryStatement.finallyBlock); - } - } - else if (!ts.isAnyFunction(node)) { - ts.forEachChild(node, aggregate); - } - } - ; - } - function getThrowStatementOwner(throwStatement) { - var child = throwStatement; - while (child.parent) { - var parent = child.parent; - if (parent.kind === 173 /* FunctionBlock */ || parent.kind === 182 /* SourceFile */) { - return parent; - } - if (parent.kind === 166 /* TryStatement */) { - var tryStatement = parent; - if (tryStatement.tryBlock === child && tryStatement.catchBlock) { - return child; - } - } - child = parent; - } - return undefined; - } - function getTryCatchFinallyOccurrences(tryStatement) { - var keywords = []; - pushKeywordIf(keywords, tryStatement.getFirstToken(), 90 /* TryKeyword */); - if (tryStatement.catchBlock) { - pushKeywordIf(keywords, tryStatement.catchBlock.getFirstToken(), 62 /* CatchKeyword */); - } - if (tryStatement.finallyBlock) { - pushKeywordIf(keywords, tryStatement.finallyBlock.getFirstToken(), 75 /* FinallyKeyword */); - } - return ts.map(keywords, getReferenceEntryFromNode); - } - function getLoopBreakContinueOccurrences(loopNode) { - var keywords = []; - if (pushKeywordIf(keywords, loopNode.getFirstToken(), 76 /* ForKeyword */, 94 /* WhileKeyword */, 69 /* DoKeyword */)) { - if (loopNode.kind === 153 /* DoStatement */) { - var loopTokens = loopNode.getChildren(); - for (var i = loopTokens.length - 1; i >= 0; i--) { - if (pushKeywordIf(keywords, loopTokens[i], 94 /* WhileKeyword */)) { - break; - } - } - } - } - var breaksAndContinues = aggregateAllBreakAndContinueStatements(loopNode.statement); - ts.forEach(breaksAndContinues, function (statement) { - if (ownsBreakOrContinueStatement(loopNode, statement)) { - pushKeywordIf(keywords, statement.getFirstToken(), 60 /* BreakKeyword */, 65 /* ContinueKeyword */); - } - }); - return ts.map(keywords, getReferenceEntryFromNode); - } - function getSwitchCaseDefaultOccurrences(switchStatement) { - var keywords = []; - pushKeywordIf(keywords, switchStatement.getFirstToken(), 86 /* SwitchKeyword */); - var breakSearchType = BreakContinueSearchType.All; - ts.forEach(switchStatement.clauses, function (clause) { - pushKeywordIf(keywords, clause.getFirstToken(), 61 /* CaseKeyword */, 67 /* DefaultKeyword */); - var breaksAndContinues = aggregateAllBreakAndContinueStatements(clause); - ts.forEach(breaksAndContinues, function (statement) { - if (ownsBreakOrContinueStatement(switchStatement, statement)) { - pushKeywordIf(keywords, statement.getFirstToken(), 60 /* BreakKeyword */); - } - }); - }); - return ts.map(keywords, getReferenceEntryFromNode); - } - function getBreakOrContinueStatementOccurences(breakOrContinueStatement) { - var owner = getBreakOrContinueOwner(breakOrContinueStatement); - if (owner) { - switch (owner.kind) { - case 155 /* ForStatement */: - case 156 /* ForInStatement */: - case 153 /* DoStatement */: - case 154 /* WhileStatement */: - return getLoopBreakContinueOccurrences(owner); - case 161 /* SwitchStatement */: - return getSwitchCaseDefaultOccurrences(owner); - } - } - return undefined; - } - function aggregateAllBreakAndContinueStatements(node) { - var statementAccumulator = []; - aggregate(node); - return statementAccumulator; - function aggregate(node) { - if (node.kind === 158 /* BreakStatement */ || node.kind === 157 /* ContinueStatement */) { - statementAccumulator.push(node); - } - else if (!ts.isAnyFunction(node)) { - ts.forEachChild(node, aggregate); - } - } - ; - } - function ownsBreakOrContinueStatement(owner, statement) { - var actualOwner = getBreakOrContinueOwner(statement); - return actualOwner && actualOwner === owner; - } - function getBreakOrContinueOwner(statement) { - for (var node = statement.parent; node; node = node.parent) { - switch (node.kind) { - case 161 /* SwitchStatement */: - if (statement.kind === 157 /* ContinueStatement */) { - continue; - } - case 155 /* ForStatement */: - case 156 /* ForInStatement */: - case 154 /* WhileStatement */: - case 153 /* DoStatement */: - if (!statement.label || isLabeledBy(node, statement.label.text)) { - return node; - } - break; - default: - if (ts.isAnyFunction(node)) { - return undefined; - } - break; - } - } - return undefined; - } - function getConstructorOccurrences(constructorDeclaration) { - var declarations = constructorDeclaration.symbol.getDeclarations(); - var keywords = []; - ts.forEach(declarations, function (declaration) { - ts.forEach(declaration.getChildren(), function (token) { - return pushKeywordIf(keywords, token, 107 /* ConstructorKeyword */); - }); - }); - return ts.map(keywords, getReferenceEntryFromNode); - } - function getGetAndSetOccurrences(accessorDeclaration) { - var keywords = []; - tryPushAccessorKeyword(accessorDeclaration.symbol, 122 /* GetAccessor */); - tryPushAccessorKeyword(accessorDeclaration.symbol, 123 /* SetAccessor */); - return ts.map(keywords, getReferenceEntryFromNode); - function tryPushAccessorKeyword(accessorSymbol, accessorKind) { - var accessor = ts.getDeclarationOfKind(accessorSymbol, accessorKind); - if (accessor) { - ts.forEach(accessor.getChildren(), function (child) { return pushKeywordIf(keywords, child, 109 /* GetKeyword */, 113 /* SetKeyword */); }); - } - } - } - function hasKind(node, kind) { - return node !== undefined && node.kind === kind; - } - function parent(node) { - return node && node.parent; - } - function pushKeywordIf(keywordList, token) { - var expected = []; - for (var _i = 2; _i < arguments.length; _i++) { - expected[_i - 2] = arguments[_i]; - } - if (token && ts.contains(expected, token.kind)) { - keywordList.push(token); - return true; - } - return false; - } - } - function findRenameLocations(fileName, position, findInStrings, findInComments) { - return findReferences(fileName, position, findInStrings, findInComments); - } - function getReferencesAtPosition(fileName, position) { - return findReferences(fileName, position, false, false); - } - function findReferences(fileName, position, findInStrings, findInComments) { - synchronizeHostData(); - fileName = TypeScript.switchToForwardSlashes(fileName); - var sourceFile = getSourceFile(fileName); - var node = ts.getTouchingPropertyName(sourceFile, position); - if (!node) { - return undefined; - } - if (node.kind !== 59 /* Identifier */ && !isLiteralNameOfPropertyDeclarationOrIndexAccess(node) && !isNameOfExternalModuleImportOrDeclaration(node)) { - return undefined; - } - ts.Debug.assert(node.kind === 59 /* Identifier */ || node.kind === 6 /* NumericLiteral */ || node.kind === 7 /* StringLiteral */); - return getReferencesForNode(node, program.getSourceFiles(), findInStrings, findInComments); - } - function getReferencesForNode(node, sourceFiles, findInStrings, findInComments) { - if (isLabelName(node)) { - if (isJumpStatementTarget(node)) { - var labelDefinition = getTargetLabel(node.parent, node.text); - return labelDefinition ? getLabelReferencesInNode(labelDefinition.parent, labelDefinition) : [getReferenceEntryFromNode(node)]; - } - else { - return getLabelReferencesInNode(node.parent, node); - } - } - if (node.kind === 87 /* ThisKeyword */) { - return getReferencesForThisKeyword(node, sourceFiles); - } - if (node.kind === 85 /* SuperKeyword */) { - return getReferencesForSuperKeyword(node); - } - var symbol = typeInfoResolver.getSymbolInfo(node); - if (!symbol) { - return [getReferenceEntryFromNode(node)]; - } - if (!symbol.getDeclarations()) { - return undefined; - } - var result; - var searchMeaning = getIntersectingMeaningFromDeclarations(getMeaningFromLocation(node), symbol.getDeclarations()); - var symbolName = getNormalizedSymbolName(symbol); - var scope = getSymbolScope(symbol); - if (scope) { - result = []; - getReferencesInNode(scope, symbol, symbolName, node, searchMeaning, findInStrings, findInComments, result); - } - else { - ts.forEach(sourceFiles, function (sourceFile) { - cancellationToken.throwIfCancellationRequested(); - if (ts.lookUp(sourceFile.identifiers, symbolName)) { - result = result || []; - getReferencesInNode(sourceFile, symbol, symbolName, node, searchMeaning, findInStrings, findInComments, result); - } - }); - } - return result; - function getNormalizedSymbolName(symbol) { - var functionExpression = ts.getDeclarationOfKind(symbol, 141 /* FunctionExpression */); - if (functionExpression && functionExpression.name) { - var name = functionExpression.name.text; - } - else { - var name = symbol.name; - } - var length = name.length; - if (length >= 2 && name.charCodeAt(0) === 34 /* doubleQuote */ && name.charCodeAt(length - 1) === 34 /* doubleQuote */) { - return name.substring(1, length - 1); - } - ; - return name; - } - function getSymbolScope(symbol) { - if (symbol.getFlags() && (2 /* Property */ | 2048 /* Method */)) { - var privateDeclaration = ts.forEach(symbol.getDeclarations(), function (d) { return (d.flags & 32 /* Private */) ? d : undefined; }); - if (privateDeclaration) { - return privateDeclaration.parent; - } - } - if (symbol.parent) { - return undefined; - } - var scope = undefined; - var declarations = symbol.getDeclarations(); - for (var i = 0, n = declarations.length; i < n; i++) { - var container = getContainerNode(declarations[i]); - if (scope && scope !== container) { - return undefined; - } - if (container.kind === 182 /* SourceFile */ && !ts.isExternalModule(container)) { - return undefined; - } - scope = container; - } - return scope; - } - function getPossibleSymbolReferencePositions(sourceFile, symbolName, start, end) { - var positions = []; - if (!symbolName || !symbolName.length) { - return positions; - } - var text = sourceFile.text; - var sourceLength = text.length; - var symbolNameLength = symbolName.length; - var position = text.indexOf(symbolName, start); - while (position >= 0) { - cancellationToken.throwIfCancellationRequested(); - if (position > end) - break; - var endPosition = position + symbolNameLength; - if ((position === 0 || !ts.isIdentifierPart(text.charCodeAt(position - 1), 1 /* ES5 */)) && (endPosition === sourceLength || !ts.isIdentifierPart(text.charCodeAt(endPosition), 1 /* ES5 */))) { - positions.push(position); - } - position = text.indexOf(symbolName, position + symbolNameLength + 1); - } - return positions; - } - function getLabelReferencesInNode(container, targetLabel) { - var result = []; - var sourceFile = container.getSourceFile(); - var labelName = targetLabel.text; - var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, labelName, container.getStart(), container.getEnd()); - ts.forEach(possiblePositions, function (position) { - cancellationToken.throwIfCancellationRequested(); - var node = ts.getTouchingWord(sourceFile, position); - if (!node || node.getWidth() !== labelName.length) { - return; - } - if (node === targetLabel || (isJumpStatementTarget(node) && getTargetLabel(node, labelName) === targetLabel)) { - result.push(getReferenceEntryFromNode(node)); - } - }); - return result; - } - function isValidReferencePosition(node, searchSymbolName) { - if (node) { - switch (node.kind) { - case 59 /* Identifier */: - return node.getWidth() === searchSymbolName.length; - case 7 /* StringLiteral */: - if (isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || isNameOfExternalModuleImportOrDeclaration(node)) { - return node.getWidth() === searchSymbolName.length + 2; - } - break; - case 6 /* NumericLiteral */: - if (isLiteralNameOfPropertyDeclarationOrIndexAccess(node)) { - return node.getWidth() === searchSymbolName.length; - } - break; - } - } - return false; - } - function getReferencesInNode(container, searchSymbol, searchText, searchLocation, searchMeaning, findInStrings, findInComments, result) { - var sourceFile = container.getSourceFile(); - var tripleSlashDirectivePrefixRegex = /^\/\/\/\s* token.getStart(); - } - function isInComment(position) { - var token = ts.getTokenAtPosition(sourceFile, position); - if (token && position < token.getStart()) { - var commentRanges = ts.getLeadingCommentRanges(sourceFile.text, token.pos); - return ts.forEach(commentRanges, function (c) { - if (c.pos < position && position < c.end) { - var commentText = sourceFile.text.substring(c.pos, c.end); - if (!tripleSlashDirectivePrefixRegex.test(commentText)) { - return true; - } - } - }); - } - return false; - } - } - function getReferencesForSuperKeyword(superKeyword) { - var searchSpaceNode = ts.getSuperContainer(superKeyword); - if (!searchSpaceNode) { - return undefined; - } - var staticFlag = 128 /* Static */; - switch (searchSpaceNode.kind) { - case 119 /* Property */: - case 120 /* Method */: - case 121 /* Constructor */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - staticFlag &= searchSpaceNode.flags; - searchSpaceNode = searchSpaceNode.parent; - break; - default: - return undefined; - } - var result = []; - var sourceFile = searchSpaceNode.getSourceFile(); - var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "super", searchSpaceNode.getStart(), searchSpaceNode.getEnd()); - ts.forEach(possiblePositions, function (position) { - cancellationToken.throwIfCancellationRequested(); - var node = ts.getTouchingWord(sourceFile, position); - if (!node || node.kind !== 85 /* SuperKeyword */) { - return; - } - var container = ts.getSuperContainer(node); - if (container && (128 /* Static */ & container.flags) === staticFlag && container.parent.symbol === searchSpaceNode.symbol) { - result.push(getReferenceEntryFromNode(node)); - } - }); - return result; - } - function getReferencesForThisKeyword(thisOrSuperKeyword, sourceFiles) { - var searchSpaceNode = ts.getThisContainer(thisOrSuperKeyword, false); - var staticFlag = 128 /* Static */; - switch (searchSpaceNode.kind) { - case 119 /* Property */: - case 120 /* Method */: - case 121 /* Constructor */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - staticFlag &= searchSpaceNode.flags; - searchSpaceNode = searchSpaceNode.parent; - break; - case 182 /* SourceFile */: - if (ts.isExternalModule(searchSpaceNode)) { - return undefined; - } - case 172 /* FunctionDeclaration */: - case 141 /* FunctionExpression */: - break; - default: - return undefined; - } - var result = []; - if (searchSpaceNode.kind === 182 /* SourceFile */) { - ts.forEach(sourceFiles, function (sourceFile) { - var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", sourceFile.getStart(), sourceFile.getEnd()); - getThisReferencesInFile(sourceFile, sourceFile, possiblePositions, result); - }); - } - else { - var sourceFile = searchSpaceNode.getSourceFile(); - var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", searchSpaceNode.getStart(), searchSpaceNode.getEnd()); - getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, result); - } - return result; - function getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, result) { - ts.forEach(possiblePositions, function (position) { - cancellationToken.throwIfCancellationRequested(); - var node = ts.getTouchingWord(sourceFile, position); - if (!node || node.kind !== 87 /* ThisKeyword */) { - return; - } - var container = ts.getThisContainer(node, false); - switch (searchSpaceNode.kind) { - case 141 /* FunctionExpression */: - case 172 /* FunctionDeclaration */: - if (searchSpaceNode.symbol === container.symbol) { - result.push(getReferenceEntryFromNode(node)); - } - break; - case 174 /* ClassDeclaration */: - if (container.parent && searchSpaceNode.symbol === container.parent.symbol && (container.flags & 128 /* Static */) === staticFlag) { - result.push(getReferenceEntryFromNode(node)); - } - break; - case 182 /* SourceFile */: - if (container.kind === 182 /* SourceFile */ && !ts.isExternalModule(container)) { - result.push(getReferenceEntryFromNode(node)); - } - break; - } - }); - } - } - function populateSearchSymbolSet(symbol, location) { - var result = [symbol]; - var rootSymbol = typeInfoResolver.getRootSymbol(symbol); - if (rootSymbol && rootSymbol !== symbol) { - result.push(rootSymbol); - } - if (isNameOfPropertyAssignment(location)) { - var symbolFromContextualType = getPropertySymbolFromContextualType(location); - if (symbolFromContextualType) - result.push(typeInfoResolver.getRootSymbol(symbolFromContextualType)); - } - if (symbol.parent && symbol.parent.flags & (16 /* Class */ | 32 /* Interface */)) { - getPropertySymbolsFromBaseTypes(symbol.parent, symbol.getName(), result); - } - return result; - } - function getPropertySymbolsFromBaseTypes(symbol, propertyName, result) { - if (symbol && symbol.flags & (16 /* Class */ | 32 /* Interface */)) { - ts.forEach(symbol.getDeclarations(), function (declaration) { - if (declaration.kind === 174 /* ClassDeclaration */) { - getPropertySymbolFromTypeReference(declaration.baseType); - ts.forEach(declaration.implementedTypes, getPropertySymbolFromTypeReference); - } - else if (declaration.kind === 175 /* InterfaceDeclaration */) { - ts.forEach(declaration.baseTypes, getPropertySymbolFromTypeReference); - } - }); - } - return; - function getPropertySymbolFromTypeReference(typeReference) { - if (typeReference) { - var type = typeInfoResolver.getTypeOfNode(typeReference); - if (type) { - var propertySymbol = typeInfoResolver.getPropertyOfType(type, propertyName); - if (propertySymbol) { - result.push(propertySymbol); - } - getPropertySymbolsFromBaseTypes(type.symbol, propertyName, result); - } - } - } - } - function isRelatableToSearchSet(searchSymbols, referenceSymbol, referenceLocation) { - var referenceSymbolTarget = typeInfoResolver.getRootSymbol(referenceSymbol); - if (searchSymbols.indexOf(referenceSymbolTarget) >= 0) { - return true; - } - if (isNameOfPropertyAssignment(referenceLocation)) { - var symbolFromContextualType = getPropertySymbolFromContextualType(referenceLocation); - if (symbolFromContextualType && searchSymbols.indexOf(typeInfoResolver.getRootSymbol(symbolFromContextualType)) >= 0) { - return true; - } - } - if (referenceSymbol.parent && referenceSymbol.parent.flags & (16 /* Class */ | 32 /* Interface */)) { - var result = []; - getPropertySymbolsFromBaseTypes(referenceSymbol.parent, referenceSymbol.getName(), result); - return ts.forEach(result, function (s) { return searchSymbols.indexOf(s) >= 0; }); - } - return false; - } - function getPropertySymbolFromContextualType(node) { - if (isNameOfPropertyAssignment(node)) { - var objectLiteral = node.parent.parent; - var contextualType = typeInfoResolver.getContextualType(objectLiteral); - if (contextualType) { - return typeInfoResolver.getPropertyOfType(contextualType, node.text); - } - } - return undefined; - } - function getIntersectingMeaningFromDeclarations(meaning, declarations) { - if (declarations) { - do { - var lastIterationMeaning = meaning; - for (var i = 0, n = declarations.length; i < n; i++) { - var declarationMeaning = getMeaningFromDeclaration(declarations[i]); - if (declarationMeaning & meaning) { - meaning |= declarationMeaning; - } - } - } while (meaning !== lastIterationMeaning); - } - return meaning; - } - } - function getReferenceEntryFromNode(node) { - var start = node.getStart(); - var end = node.getEnd(); - if (node.kind === 7 /* StringLiteral */) { - start += 1; - end -= 1; - } - return { - fileName: node.getSourceFile().filename, - textSpan: TypeScript.TextSpan.fromBounds(start, end), - isWriteAccess: isWriteAccess(node) - }; - } - function isWriteAccess(node) { - if (node.kind === 59 /* Identifier */ && ts.isDeclarationOrFunctionExpressionOrCatchVariableName(node)) { - return true; - } - var parent = node.parent; - if (parent) { - if (parent.kind === 144 /* PostfixOperator */ || parent.kind === 143 /* PrefixOperator */) { - return true; - } - else if (parent.kind === 145 /* BinaryExpression */ && parent.left === node) { - var operator = parent.operator; - return ts.SyntaxKind.FirstAssignment <= operator && operator <= ts.SyntaxKind.LastAssignment; - } - } - return false; - } - function getNavigateToItems(searchValue) { - synchronizeHostData(); - var terms = searchValue.split(" "); - var searchTerms = ts.map(terms, function (t) { return ({ caseSensitive: hasAnyUpperCaseCharacter(t), term: t }); }); - var items = []; - ts.forEach(program.getSourceFiles(), function (sourceFile) { - cancellationToken.throwIfCancellationRequested(); - var filename = sourceFile.filename; - var declarations = sourceFile.getNamedDeclarations(); - for (var i = 0, n = declarations.length; i < n; i++) { - var declaration = declarations[i]; - var name = declaration.name.text; - var matchKind = getMatchKind(searchTerms, name); - if (matchKind !== 0 /* none */) { - var container = getContainerNode(declaration); - items.push({ - name: name, - kind: getNodeKind(declaration), - kindModifiers: getNodeModifiers(declaration), - matchKind: MatchKind[matchKind], - fileName: filename, - textSpan: TypeScript.TextSpan.fromBounds(declaration.getStart(), declaration.getEnd()), - containerName: container.name ? container.name.text : "", - containerKind: container.name ? getNodeKind(container) : "" - }); - } - } - }); - return items; - function hasAnyUpperCaseCharacter(s) { - for (var i = 0, n = s.length; i < n; i++) { - var c = s.charCodeAt(i); - if ((65 /* A */ <= c && c <= 90 /* Z */) || (c >= 127 /* maxAsciiCharacter */ && s.charAt(i).toLocaleLowerCase() !== s.charAt(i))) { - return true; - } - } - return false; - } - function getMatchKind(searchTerms, name) { - var matchKind = 0 /* none */; - if (name) { - for (var j = 0, n = searchTerms.length; j < n; j++) { - var searchTerm = searchTerms[j]; - var nameToSearch = searchTerm.caseSensitive ? name : name.toLocaleLowerCase(); - var index = nameToSearch.indexOf(searchTerm.term); - if (index < 0) { - return 0 /* none */; - } - var termKind = 2 /* substring */; - if (index === 0) { - termKind = name.length === searchTerm.term.length ? 1 /* exact */ : 3 /* prefix */; - } - if (matchKind === 0 /* none */ || termKind < matchKind) { - matchKind = termKind; - } - } - } - return matchKind; - } - } - function containErrors(diagnostics) { - return ts.forEach(diagnostics, function (diagnostic) { return diagnostic.category === 1 /* Error */; }); - } - function getEmitOutput(filename) { - synchronizeHostData(); - filename = TypeScript.switchToForwardSlashes(filename); - var compilerOptions = program.getCompilerOptions(); - var targetSourceFile = program.getSourceFile(filename); - var shouldEmitToOwnFile = ts.shouldEmitToOwnFile(targetSourceFile, compilerOptions); - var emitDeclaration = compilerOptions.declaration; - var emitOutput = { - outputFiles: [], - emitOutputStatus: undefined - }; - function getEmitOutputWriter(filename, data, writeByteOrderMark) { - emitOutput.outputFiles.push({ - name: filename, - writeByteOrderMark: writeByteOrderMark, - text: data - }); - } - writer = getEmitOutputWriter; - var syntacticDiagnostics = []; - var containSyntacticErrors = false; - if (shouldEmitToOwnFile) { - containSyntacticErrors = containErrors(program.getDiagnostics(targetSourceFile)); - } - else { - containSyntacticErrors = ts.forEach(program.getSourceFiles(), function (sourceFile) { - if (!ts.isExternalModuleOrDeclarationFile(sourceFile)) { - return containErrors(program.getDiagnostics(sourceFile)); - } - return false; - }); - } - if (containSyntacticErrors) { - emitOutput.emitOutputStatus = 1 /* AllOutputGenerationSkipped */; - writer = undefined; - return emitOutput; - } - var emitFilesResult = getFullTypeCheckChecker().emitFiles(targetSourceFile); - emitOutput.emitOutputStatus = emitFilesResult.emitResultStatus; - writer = undefined; - return emitOutput; - } - function getMeaningFromDeclaration(node) { - switch (node.kind) { - case 118 /* Parameter */: - case 171 /* VariableDeclaration */: - case 119 /* Property */: - case 134 /* PropertyAssignment */: - case 181 /* EnumMember */: - case 120 /* Method */: - case 121 /* Constructor */: - case 122 /* GetAccessor */: - case 123 /* SetAccessor */: - case 172 /* FunctionDeclaration */: - case 141 /* FunctionExpression */: - case 142 /* ArrowFunction */: - case 168 /* CatchBlock */: - return 1 /* Value */; - case 117 /* TypeParameter */: - case 175 /* InterfaceDeclaration */: - case 129 /* TypeLiteral */: - return 2 /* Type */; - case 174 /* ClassDeclaration */: - case 176 /* EnumDeclaration */: - return 1 /* Value */ | 2 /* Type */; - case 177 /* ModuleDeclaration */: - if (node.name.kind === 7 /* StringLiteral */) { - return 4 /* Namespace */ | 1 /* Value */; - } - else if (ts.isInstantiated(node)) { - return 4 /* Namespace */ | 1 /* Value */; - } - else { - return 4 /* Namespace */; - } - break; - case 179 /* ImportDeclaration */: - return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; - } - ts.Debug.fail("Unknown declaration type"); - } - function isTypeReference(node) { - if (node.parent.kind === 116 /* QualifiedName */ && node.parent.right === node) - node = node.parent; - return node.parent.kind === 127 /* TypeReference */; - } - function isNamespaceReference(node) { - var root = node; - var isLastClause = true; - if (root.parent.kind === 116 /* QualifiedName */) { - while (root.parent && root.parent.kind === 116 /* QualifiedName */) - root = root.parent; - isLastClause = root.right === node; - } - return root.parent.kind === 127 /* TypeReference */ && !isLastClause; - } - function isInRightSideOfImport(node) { - while (node.parent.kind === 116 /* QualifiedName */) { - node = node.parent; - } - return node.parent.kind === 179 /* ImportDeclaration */ && node.parent.entityName === node; - } - function getMeaningFromRightHandSideOfImport(node) { - ts.Debug.assert(node.kind === 59 /* Identifier */); - if (node.parent.kind === 116 /* QualifiedName */ && node.parent.right === node && node.parent.parent.kind === 179 /* ImportDeclaration */) { - return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; - } - return 4 /* Namespace */; - } - function getMeaningFromLocation(node) { - if (node.parent.kind === 180 /* ExportAssignment */) { - return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; - } - else if (isInRightSideOfImport(node)) { - return getMeaningFromRightHandSideOfImport(node); - } - else if (ts.isDeclarationOrFunctionExpressionOrCatchVariableName(node)) { - return getMeaningFromDeclaration(node.parent); - } - else if (isTypeReference(node)) { - return 2 /* Type */; - } - else if (isNamespaceReference(node)) { - return 4 /* Namespace */; - } - else { - return 1 /* Value */; - } - } - function getSignatureHelpItems(fileName, position) { - synchronizeHostData(); - fileName = TypeScript.switchToForwardSlashes(fileName); - var sourceFile = getSourceFile(fileName); - return ts.SignatureHelp.getSignatureHelpItems(sourceFile, position, typeInfoResolver, cancellationToken); - } - function getSignatureAtPosition(filename, position) { - var signatureHelpItems = getSignatureHelpItems(filename, position); - if (!signatureHelpItems) { - return undefined; - } - var currentArgumentState = { argumentIndex: signatureHelpItems.argumentIndex, argumentCount: signatureHelpItems.argumentCount }; - var formalSignatures = []; - ts.forEach(signatureHelpItems.items, function (signature) { - var signatureInfoString = displayPartsToString(signature.prefixDisplayParts); - var parameters = []; - if (signature.parameters) { - for (var i = 0, n = signature.parameters.length; i < n; i++) { - var parameter = signature.parameters[i]; - if (i) { - signatureInfoString += displayPartsToString(signature.separatorDisplayParts); - } - var start = signatureInfoString.length; - signatureInfoString += displayPartsToString(parameter.displayParts); - var end = signatureInfoString.length - 1; - parameters.push({ - name: parameter.name, - isVariable: i === n - 1 && signature.isVariadic, - docComment: displayPartsToString(parameter.documentation), - minChar: start, - limChar: end - }); - } - } - signatureInfoString += displayPartsToString(signature.suffixDisplayParts); - formalSignatures.push({ - signatureInfo: signatureInfoString, - docComment: displayPartsToString(signature.documentation), - parameters: parameters, - typeParameters: [] - }); - }); - var actualSignature = { - parameterMinChar: signatureHelpItems.applicableSpan.start(), - parameterLimChar: signatureHelpItems.applicableSpan.end(), - currentParameterIsTypeParameter: false, - currentParameter: currentArgumentState.argumentIndex - }; - return { - actual: actualSignature, - formal: formalSignatures, - activeFormal: 0 - }; - } - function getSyntaxTree(filename) { - filename = TypeScript.switchToForwardSlashes(filename); - return syntaxTreeCache.getCurrentFileSyntaxTree(filename); - } - function getCurrentSourceFile(filename) { - filename = TypeScript.switchToForwardSlashes(filename); - var currentSourceFile = syntaxTreeCache.getCurrentSourceFile(filename); - return currentSourceFile; - } - function getNameOrDottedNameSpan(filename, startPos, endPos) { - function getTypeInfoEligiblePath(filename, position, isConstructorValidPosition) { - var sourceUnit = syntaxTreeCache.getCurrentFileSyntaxTree(filename).sourceUnit(); - var ast = TypeScript.ASTHelpers.getAstAtPosition(sourceUnit, position, false, true); - if (ast === null) { - return null; - } - if (ast.kind() === 228 /* ParameterList */ && ast.parent.kind() === 143 /* CallSignature */ && ast.parent.parent.kind() === 138 /* ConstructorDeclaration */) { - ast = ast.parent.parent; - } - switch (ast.kind()) { - default: - return null; - case 138 /* ConstructorDeclaration */: - var constructorAST = ast; - if (!isConstructorValidPosition || !(position >= TypeScript.start(constructorAST) && position <= TypeScript.start(constructorAST) + "constructor".length)) { - return null; - } - else { - return ast; - } - case 130 /* FunctionDeclaration */: - return null; - case 213 /* MemberAccessExpression */: - case 121 /* QualifiedName */: - case 50 /* SuperKeyword */: - case 14 /* StringLiteral */: - case 35 /* ThisKeyword */: - case 11 /* IdentifierName */: - return ast; - } - } - filename = TypeScript.switchToForwardSlashes(filename); - var node = getTypeInfoEligiblePath(filename, startPos, false); - if (!node) - return null; - while (node) { - if (TypeScript.ASTHelpers.isNameOfMemberAccessExpression(node) || TypeScript.ASTHelpers.isRightSideOfQualifiedName(node)) { - node = node.parent; - } - else { - break; - } - } - return TypeScript.TextSpan.fromBounds(TypeScript.start(node), TypeScript.end(node)); - } - function getBreakpointStatementAtPosition(filename, position) { - filename = TypeScript.switchToForwardSlashes(filename); - var syntaxtree = getSyntaxTree(filename); - return TypeScript.Services.Breakpoints.getBreakpointLocation(syntaxtree, position); - } - function getNavigationBarItems(filename) { - filename = TypeScript.switchToForwardSlashes(filename); - return ts.NavigationBar.getNavigationBarItems(getCurrentSourceFile(filename)); - } - function getSemanticClassifications(fileName, span) { - synchronizeHostData(); - fileName = TypeScript.switchToForwardSlashes(fileName); - var sourceFile = getSourceFile(fileName); - var result = []; - processNode(sourceFile); - return result; - function classifySymbol(symbol, meaningAtPosition) { - var flags = symbol.getFlags(); - if (flags & 16 /* Class */) { - return ClassificationTypeNames.className; - } - else if (flags & 64 /* Enum */) { - return ClassificationTypeNames.enumName; - } - else if (meaningAtPosition & 2 /* Type */) { - if (flags & 32 /* Interface */) { - return ClassificationTypeNames.interfaceName; - } - else if (flags & 262144 /* TypeParameter */) { - return ClassificationTypeNames.typeParameterName; - } - } - else if (flags & ts.SymbolFlags.Module) { - return ClassificationTypeNames.moduleName; - } - return undefined; - } - function processNode(node) { - if (node && span.intersectsWith(node.getStart(), node.getWidth())) { - if (node.kind === 59 /* Identifier */ && node.getWidth() > 0) { - var symbol = typeInfoResolver.getSymbolInfo(node); - if (symbol) { - var type = classifySymbol(symbol, getMeaningFromLocation(node)); - if (type) { - result.push({ - textSpan: new TypeScript.TextSpan(node.getStart(), node.getWidth()), - classificationType: type - }); - } - } - } - ts.forEachChild(node, processNode); - } - } - } - function getSyntacticClassifications(fileName, span) { - fileName = TypeScript.switchToForwardSlashes(fileName); - var sourceFile = getCurrentSourceFile(fileName); - var result = []; - processElement(sourceFile.getSourceUnit()); - return result; - function classifyTrivia(trivia) { - if (trivia.isComment() && span.intersectsWith(trivia.fullStart(), trivia.fullWidth())) { - result.push({ - textSpan: new TypeScript.TextSpan(trivia.fullStart(), trivia.fullWidth()), - classificationType: ClassificationTypeNames.comment - }); - } - } - function classifyTriviaList(trivia) { - for (var i = 0, n = trivia.count(); i < n; i++) { - classifyTrivia(trivia.syntaxTriviaAt(i)); - } - } - function classifyToken(token) { - if (token.hasLeadingComment()) { - classifyTriviaList(token.leadingTrivia()); - } - if (TypeScript.width(token) > 0) { - var type = classifyTokenType(token); - if (type) { - result.push({ - textSpan: new TypeScript.TextSpan(TypeScript.start(token), TypeScript.width(token)), - classificationType: type - }); - } - } - if (token.hasTrailingComment()) { - classifyTriviaList(token.trailingTrivia()); - } - } - function classifyTokenType(token) { - var tokenKind = token.kind(); - if (TypeScript.SyntaxFacts.isAnyKeyword(token.kind())) { - return ClassificationTypeNames.keyword; - } - if (tokenKind === 80 /* LessThanToken */ || tokenKind === 81 /* GreaterThanToken */) { - var tokenParentKind = token.parent.kind(); - if (tokenParentKind === 229 /* TypeArgumentList */ || tokenParentKind === 230 /* TypeParameterList */) { - return ClassificationTypeNames.punctuation; - } - } - if (TypeScript.SyntaxFacts.isBinaryExpressionOperatorToken(tokenKind) || TypeScript.SyntaxFacts.isPrefixUnaryExpressionOperatorToken(tokenKind)) { - return ClassificationTypeNames.operator; - } - else if (TypeScript.SyntaxFacts.isAnyPunctuation(tokenKind)) { - return ClassificationTypeNames.punctuation; - } - else if (tokenKind === 13 /* NumericLiteral */) { - return ClassificationTypeNames.numericLiteral; - } - else if (tokenKind === 14 /* StringLiteral */) { - return ClassificationTypeNames.stringLiteral; - } - else if (tokenKind === 12 /* RegularExpressionLiteral */) { - return ClassificationTypeNames.stringLiteral; - } - else if (tokenKind === 11 /* IdentifierName */) { - var current = token; - var parent = token.parent; - while (parent.kind() === 121 /* QualifiedName */) { - current = parent; - parent = parent.parent; - } - switch (parent.kind()) { - case 241 /* SimplePropertyAssignment */: - if (parent.propertyName === token) { - return ClassificationTypeNames.identifier; - } - return; - case 132 /* ClassDeclaration */: - if (parent.identifier === token) { - return ClassificationTypeNames.className; - } - return; - case 239 /* TypeParameter */: - if (parent.identifier === token) { - return ClassificationTypeNames.typeParameterName; - } - return; - case 129 /* InterfaceDeclaration */: - if (parent.identifier === token) { - return ClassificationTypeNames.interfaceName; - } - return; - case 133 /* EnumDeclaration */: - if (parent.identifier === token) { - return ClassificationTypeNames.enumName; - } - return; - case 131 /* ModuleDeclaration */: - if (parent.name === current) { - return ClassificationTypeNames.moduleName; - } - return; - default: - return ClassificationTypeNames.text; - } - } - } - function processElement(element) { - if (!TypeScript.isShared(element) && span.intersectsWith(TypeScript.fullStart(element), TypeScript.fullWidth(element))) { - for (var i = 0, n = TypeScript.childCount(element); i < n; i++) { - var child = TypeScript.childAt(element, i); - if (child) { - if (TypeScript.isToken(child)) { - classifyToken(child); - } - else { - processElement(child); - } - } - } - } - } - } - function getOutliningSpans(filename) { - filename = TypeScript.switchToForwardSlashes(filename); - var sourceFile = getCurrentSourceFile(filename); - return ts.OutliningElementsCollector.collectElements(sourceFile); - } - function getBraceMatchingAtPosition(filename, position) { - var sourceFile = getCurrentSourceFile(filename); - var result = []; - var token = ts.getTouchingToken(sourceFile, position); - if (token.getStart(sourceFile) === position) { - var matchKind = getMatchingTokenKind(token); - if (matchKind) { - var parentElement = token.parent; - var childNodes = parentElement.getChildren(sourceFile); - for (var i = 0, n = childNodes.length; i < n; i++) { - var current = childNodes[i]; - if (current.kind === matchKind) { - var range1 = new TypeScript.TextSpan(token.getStart(sourceFile), token.getWidth(sourceFile)); - var range2 = new TypeScript.TextSpan(current.getStart(sourceFile), current.getWidth(sourceFile)); - if (range1.start() < range2.start()) { - result.push(range1, range2); - } - else { - result.push(range2, range1); - } - break; - } - } - } - } - return result; - function getMatchingTokenKind(token) { - switch (token.kind) { - case 9 /* OpenBraceToken */: - return 10 /* CloseBraceToken */; - case 11 /* OpenParenToken */: - return 12 /* CloseParenToken */; - case 13 /* OpenBracketToken */: - return 14 /* CloseBracketToken */; - case 19 /* LessThanToken */: - return 20 /* GreaterThanToken */; - case 10 /* CloseBraceToken */: - return 9 /* OpenBraceToken */; - case 12 /* CloseParenToken */: - return 11 /* OpenParenToken */; - case 14 /* CloseBracketToken */: - return 13 /* OpenBracketToken */; - case 20 /* GreaterThanToken */: - return 19 /* LessThanToken */; - } - return undefined; - } - } - function getIndentationAtPosition(filename, position, editorOptions) { - filename = TypeScript.switchToForwardSlashes(filename); - var sourceFile = getCurrentSourceFile(filename); - var options = new TypeScript.FormattingOptions(!editorOptions.ConvertTabsToSpaces, editorOptions.TabSize, editorOptions.IndentSize, editorOptions.NewLineCharacter); - return ts.formatting.SmartIndenter.getIndentation(position, sourceFile, options); - } - function getFormattingManager(filename, options) { - if (formattingRulesProvider == null) { - formattingRulesProvider = new TypeScript.Services.Formatting.RulesProvider(host); - } - formattingRulesProvider.ensureUpToDate(options); - var syntaxTree = getSyntaxTree(filename); - var scriptSnapshot = syntaxTreeCache.getCurrentScriptSnapshot(filename); - var scriptText = TypeScript.SimpleText.fromScriptSnapshot(scriptSnapshot); - var textSnapshot = new TypeScript.Services.Formatting.TextSnapshot(scriptText); - var manager = new TypeScript.Services.Formatting.FormattingManager(syntaxTree, textSnapshot, formattingRulesProvider, options); - return manager; - } - function getFormattingEditsForRange(fileName, start, end, options) { - fileName = TypeScript.switchToForwardSlashes(fileName); - var manager = getFormattingManager(fileName, options); - return manager.formatSelection(start, end); - } - function getFormattingEditsForDocument(fileName, options) { - fileName = TypeScript.switchToForwardSlashes(fileName); - var manager = getFormattingManager(fileName, options); - return manager.formatDocument(); - } - function getFormattingEditsAfterKeystroke(fileName, position, key, options) { - fileName = TypeScript.switchToForwardSlashes(fileName); - var manager = getFormattingManager(fileName, options); - if (key === "}") { - return manager.formatOnClosingCurlyBrace(position); - } - else if (key === ";") { - return manager.formatOnSemicolon(position); - } - else if (key === "\n") { - return manager.formatOnEnter(position); - } - return []; - } - function getTodoComments(filename, descriptors) { - filename = TypeScript.switchToForwardSlashes(filename); - var sourceFile = getCurrentSourceFile(filename); - cancellationToken.throwIfCancellationRequested(); - var fileContents = sourceFile.text; - cancellationToken.throwIfCancellationRequested(); - var result = []; - if (descriptors.length > 0) { - var regExp = getTodoCommentsRegExp(); - var matchArray; - while (matchArray = regExp.exec(fileContents)) { - cancellationToken.throwIfCancellationRequested(); - var firstDescriptorCaptureIndex = 3; - ts.Debug.assert(matchArray.length === descriptors.length + firstDescriptorCaptureIndex); - var preamble = matchArray[1]; - var matchPosition = matchArray.index + preamble.length; - var token = ts.getTokenAtPosition(sourceFile, matchPosition); - if (token.getStart() <= matchPosition && matchPosition < token.getEnd()) { - continue; - } - if (!getContainingComment(ts.getTrailingCommentRanges(fileContents, token.getFullStart()), matchPosition) && !getContainingComment(ts.getLeadingCommentRanges(fileContents, token.getFullStart()), matchPosition)) { - continue; - } - var descriptor = undefined; - for (var i = 0, n = descriptors.length; i < n; i++) { - if (matchArray[i + firstDescriptorCaptureIndex]) { - descriptor = descriptors[i]; - } - } - ts.Debug.assert(descriptor); - if (isLetterOrDigit(fileContents.charCodeAt(matchPosition + descriptor.text.length))) { - continue; - } - var message = matchArray[2]; - result.push({ - descriptor: descriptor, - message: message, - position: matchPosition - }); - } - } - return result; - function escapeRegExp(str) { - return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); - } - function getTodoCommentsRegExp() { - var singleLineCommentStart = /(?:\/\/+\s*)/.source; - var multiLineCommentStart = /(?:\/\*+\s*)/.source; - var anyNumberOfSpacesAndAsterixesAtStartOfLine = /(?:^(?:\s|\*)*)/.source; - var preamble = "(" + anyNumberOfSpacesAndAsterixesAtStartOfLine + "|" + singleLineCommentStart + "|" + multiLineCommentStart + ")"; - var literals = "(?:" + ts.map(descriptors, function (d) { return "(" + escapeRegExp(d.text) + ")"; }).join("|") + ")"; - var endOfLineOrEndOfComment = /(?:$|\*\/)/.source; - var messageRemainder = /(?:.*?)/.source; - var messagePortion = "(" + literals + messageRemainder + ")"; - var regExpString = preamble + messagePortion + endOfLineOrEndOfComment; - return new RegExp(regExpString, "gim"); - } - function getContainingComment(comments, position) { - if (comments) { - for (var i = 0, n = comments.length; i < n; i++) { - var comment = comments[i]; - if (comment.pos <= position && position < comment.end) { - return comment; - } - } - } - return undefined; - } - function isLetterOrDigit(char) { - return (char >= 97 /* a */ && char <= 122 /* z */) || (char >= 65 /* A */ && char <= 90 /* Z */) || (char >= 48 /* _0 */ && char <= 57 /* _9 */); - } - } - function getRenameInfo(fileName, position) { - synchronizeHostData(); - fileName = TypeScript.switchToForwardSlashes(fileName); - var sourceFile = getSourceFile(fileName); - var node = ts.getTouchingWord(sourceFile, position); - if (node && node.kind === 59 /* Identifier */) { - var symbol = typeInfoResolver.getSymbolInfo(node); - if (symbol && symbol.getDeclarations() && symbol.getDeclarations().length > 0) { - var kind = getSymbolKind(symbol, typeInfoResolver); - if (kind) { - return getRenameInfo(symbol.name, typeInfoResolver.getFullyQualifiedName(symbol), kind, getSymbolModifiers(symbol), new TypeScript.TextSpan(node.getStart(), node.getWidth())); - } - } - } - return getRenameInfoError(ts.getLocaleSpecificMessage(ts.Diagnostics.You_cannot_rename_this_element.key)); - function getRenameInfoError(localizedErrorMessage) { - return { - canRename: false, - localizedErrorMessage: ts.getLocaleSpecificMessage(ts.Diagnostics.You_cannot_rename_this_element.key), - displayName: undefined, - fullDisplayName: undefined, - kind: undefined, - kindModifiers: undefined, - triggerSpan: undefined - }; - } - function getRenameInfo(displayName, fullDisplayName, kind, kindModifiers, triggerSpan) { - return { - canRename: true, - localizedErrorMessage: undefined, - displayName: displayName, - fullDisplayName: fullDisplayName, - kind: kind, - kindModifiers: kindModifiers, - triggerSpan: triggerSpan - }; - } - } - return { - dispose: dispose, - cleanupSemanticCache: cleanupSemanticCache, - getSyntacticDiagnostics: getSyntacticDiagnostics, - getSemanticDiagnostics: getSemanticDiagnostics, - getCompilerOptionsDiagnostics: getCompilerOptionsDiagnostics, - getSyntacticClassifications: getSyntacticClassifications, - getSemanticClassifications: getSemanticClassifications, - getCompletionsAtPosition: getCompletionsAtPosition, - getCompletionEntryDetails: getCompletionEntryDetails, - getSignatureHelpItems: getSignatureHelpItems, - getQuickInfoAtPosition: getQuickInfoAtPosition, - getDefinitionAtPosition: getDefinitionAtPosition, - getReferencesAtPosition: getReferencesAtPosition, - getOccurrencesAtPosition: getOccurrencesAtPosition, - getImplementorsAtPosition: function (filename, position) { return []; }, - getNameOrDottedNameSpan: getNameOrDottedNameSpan, - getBreakpointStatementAtPosition: getBreakpointStatementAtPosition, - getNavigateToItems: getNavigateToItems, - getRenameInfo: getRenameInfo, - findRenameLocations: findRenameLocations, - getNavigationBarItems: getNavigationBarItems, - getOutliningSpans: getOutliningSpans, - getTodoComments: getTodoComments, - getBraceMatchingAtPosition: getBraceMatchingAtPosition, - getIndentationAtPosition: getIndentationAtPosition, - getFormattingEditsForRange: getFormattingEditsForRange, - getFormattingEditsForDocument: getFormattingEditsForDocument, - getFormattingEditsAfterKeystroke: getFormattingEditsAfterKeystroke, - getEmitOutput: getEmitOutput, - getSignatureAtPosition: getSignatureAtPosition - }; - } - ts.createLanguageService = createLanguageService; - function createClassifier(host) { - var scanner = ts.createScanner(1 /* ES5 */, false); - var noRegexTable = []; - noRegexTable[59 /* Identifier */] = true; - noRegexTable[7 /* StringLiteral */] = true; - noRegexTable[6 /* NumericLiteral */] = true; - noRegexTable[8 /* RegularExpressionLiteral */] = true; - noRegexTable[87 /* ThisKeyword */] = true; - noRegexTable[33 /* PlusPlusToken */] = true; - noRegexTable[34 /* MinusMinusToken */] = true; - noRegexTable[12 /* CloseParenToken */] = true; - noRegexTable[14 /* CloseBracketToken */] = true; - noRegexTable[10 /* CloseBraceToken */] = true; - noRegexTable[89 /* TrueKeyword */] = true; - noRegexTable[74 /* FalseKeyword */] = true; - function isAccessibilityModifier(kind) { - switch (kind) { - case 102 /* PublicKeyword */: - case 100 /* PrivateKeyword */: - case 101 /* ProtectedKeyword */: - return true; - } - return false; - } - function canFollow(keyword1, keyword2) { - if (isAccessibilityModifier(keyword1)) { - if (keyword2 === 109 /* GetKeyword */ || keyword2 === 113 /* SetKeyword */ || keyword2 === 107 /* ConstructorKeyword */ || keyword2 === 103 /* StaticKeyword */) { - return true; - } - return false; - } - return true; - } - function getClassificationsForLine(text, lexState) { - var offset = 0; - var lastTokenOrCommentEnd = 0; - var token = 0 /* Unknown */; - var lastNonTriviaToken = 0 /* Unknown */; - switch (lexState) { - case 3 /* InDoubleQuoteStringLiteral */: - text = '"\\\n' + text; - offset = 3; - break; - case 2 /* InSingleQuoteStringLiteral */: - text = "'\\\n" + text; - offset = 3; - break; - case 1 /* InMultiLineCommentTrivia */: - text = "/*\n" + text; - offset = 3; - break; - } - scanner.setText(text); - var result = { - finalLexState: 0 /* Start */, - entries: [] - }; - var angleBracketStack = 0; - do { - token = scanner.scan(); - if (!ts.isTrivia(token)) { - if ((token === 31 /* SlashToken */ || token === 51 /* SlashEqualsToken */) && !noRegexTable[lastNonTriviaToken]) { - if (scanner.reScanSlashToken() === 8 /* RegularExpressionLiteral */) { - token = 8 /* RegularExpressionLiteral */; - } - } - else if (lastNonTriviaToken === 15 /* DotToken */ && isKeyword(token)) { - token = 59 /* Identifier */; - } - else if (isKeyword(lastNonTriviaToken) && isKeyword(token) && !canFollow(lastNonTriviaToken, token)) { - token = 59 /* Identifier */; - } - else if (lastNonTriviaToken === 59 /* Identifier */ && token === 19 /* LessThanToken */) { - angleBracketStack++; - } - else if (token === 20 /* GreaterThanToken */ && angleBracketStack > 0) { - angleBracketStack--; - } - else if (token === 105 /* AnyKeyword */ || token === 114 /* StringKeyword */ || token === 112 /* NumberKeyword */ || token === 106 /* BooleanKeyword */) { - if (angleBracketStack > 0) { - token = 59 /* Identifier */; - } - } - lastNonTriviaToken = token; - } - processToken(); - } while (token !== 1 /* EndOfFileToken */); - return result; - function processToken() { - var start = scanner.getTokenPos(); - var end = scanner.getTextPos(); - addResult(end - start, classFromKind(token)); - if (end >= text.length) { - if (token === 7 /* StringLiteral */) { - var tokenText = scanner.getTokenText(); - if (tokenText.length > 0 && tokenText.charCodeAt(tokenText.length - 1) === 92 /* backslash */) { - var quoteChar = tokenText.charCodeAt(0); - result.finalLexState = quoteChar === 34 /* doubleQuote */ ? 3 /* InDoubleQuoteStringLiteral */ : 2 /* InSingleQuoteStringLiteral */; - } - } - else if (token === 3 /* MultiLineCommentTrivia */) { - var tokenText = scanner.getTokenText(); - if (!(tokenText.length > 3 && tokenText.charCodeAt(tokenText.length - 2) === 42 /* asterisk */ && tokenText.charCodeAt(tokenText.length - 1) === 47 /* slash */)) { - result.finalLexState = 1 /* InMultiLineCommentTrivia */; - } - } - } - } - function addResult(length, classification) { - if (length > 0) { - if (result.entries.length === 0) { - length -= offset; - } - result.entries.push({ length: length, classification: classification }); - } - } - } - function isBinaryExpressionOperatorToken(token) { - switch (token) { - case 30 /* AsteriskToken */: - case 31 /* SlashToken */: - case 32 /* PercentToken */: - case 28 /* PlusToken */: - case 29 /* MinusToken */: - case 35 /* LessThanLessThanToken */: - case 36 /* GreaterThanGreaterThanToken */: - case 37 /* GreaterThanGreaterThanGreaterThanToken */: - case 19 /* LessThanToken */: - case 20 /* GreaterThanToken */: - case 21 /* LessThanEqualsToken */: - case 22 /* GreaterThanEqualsToken */: - case 81 /* InstanceOfKeyword */: - case 80 /* InKeyword */: - case 23 /* EqualsEqualsToken */: - case 24 /* ExclamationEqualsToken */: - case 25 /* EqualsEqualsEqualsToken */: - case 26 /* ExclamationEqualsEqualsToken */: - case 38 /* AmpersandToken */: - case 40 /* CaretToken */: - case 39 /* BarToken */: - case 43 /* AmpersandAmpersandToken */: - case 44 /* BarBarToken */: - case 57 /* BarEqualsToken */: - case 56 /* AmpersandEqualsToken */: - case 58 /* CaretEqualsToken */: - case 53 /* LessThanLessThanEqualsToken */: - case 54 /* GreaterThanGreaterThanEqualsToken */: - case 55 /* GreaterThanGreaterThanGreaterThanEqualsToken */: - case 48 /* PlusEqualsToken */: - case 49 /* MinusEqualsToken */: - case 50 /* AsteriskEqualsToken */: - case 51 /* SlashEqualsToken */: - case 52 /* PercentEqualsToken */: - case 47 /* EqualsToken */: - case 18 /* CommaToken */: - return true; - default: - return false; - } - } - function isPrefixUnaryExpressionOperatorToken(token) { - switch (token) { - case 28 /* PlusToken */: - case 29 /* MinusToken */: - case 42 /* TildeToken */: - case 41 /* ExclamationToken */: - case 33 /* PlusPlusToken */: - case 34 /* MinusMinusToken */: - return true; - default: - return false; - } - } - function isKeyword(token) { - return token >= ts.SyntaxKind.FirstKeyword && token <= ts.SyntaxKind.LastKeyword; - } - function classFromKind(token) { - if (isKeyword(token)) { - return 1 /* Keyword */; - } - else if (isBinaryExpressionOperatorToken(token) || isPrefixUnaryExpressionOperatorToken(token)) { - return 2 /* Operator */; - } - else if (token >= ts.SyntaxKind.FirstPunctuation && token <= ts.SyntaxKind.LastPunctuation) { - return 0 /* Punctuation */; - } - switch (token) { - case 6 /* NumericLiteral */: - return 6 /* NumberLiteral */; - case 7 /* StringLiteral */: - return 7 /* StringLiteral */; - case 8 /* RegularExpressionLiteral */: - return 8 /* RegExpLiteral */; - case 3 /* MultiLineCommentTrivia */: - case 2 /* SingleLineCommentTrivia */: - return 3 /* Comment */; - case 5 /* WhitespaceTrivia */: - return 4 /* Whitespace */; - case 59 /* Identifier */: - default: - return 5 /* Identifier */; - } - } - return { - getClassificationsForLine: getClassificationsForLine - }; - } - ts.createClassifier = createClassifier; - function initializeServices() { - ts.objectAllocator = { - getNodeConstructor: function (kind) { - function Node() { - } - var proto = kind === 182 /* SourceFile */ ? new SourceFileObject() : new NodeObject(); - proto.kind = kind; - proto.pos = 0; - proto.end = 0; - proto.flags = 0; - proto.parent = undefined; - Node.prototype = proto; - return Node; - }, - getSymbolConstructor: function () { return SymbolObject; }, - getTypeConstructor: function () { return TypeObject; }, - getSignatureConstructor: function () { return SignatureObject; } - }; - } - initializeServices(); -})(ts || (ts = {})); -var TypeScript; -(function (TypeScript) { - function isNoDefaultLibMatch(comment) { - var isNoDefaultLibRegex = /^(\/\/\/\s*/gim; - return isNoDefaultLibRegex.exec(comment); - } - TypeScript.tripleSlashReferenceRegExp = /^(\/\/\/\s*/; - function getFileReferenceFromReferencePath(fileName, text, position, comment, diagnostics) { - var lineMap = text.lineMap(); - var simpleReferenceRegEx = /^\/\/\/\s*= 7 && fullReference[6] === "true"; - return { - line: 0, - character: 0, - position: 0, - length: 0, - path: TypeScript.switchToForwardSlashes(adjustedPath), - isResident: isResident - }; - } - } - } - return null; - } - var reportDiagnostic = function () { - }; - function processImports(text, scanner, token, importedFiles) { - var lineChar = { line: -1, character: -1 }; - var lineMap = text.lineMap(); - var start = new Date().getTime(); - while (token.kind() !== 10 /* EndOfFileToken */) { - if (token.kind() === 49 /* ImportKeyword */) { - var importToken = token; - token = scanner.scan(false); - if (TypeScript.SyntaxFacts.isIdentifierNameOrAnyKeyword(token)) { - token = scanner.scan(false); - if (token.kind() === 107 /* EqualsToken */) { - token = scanner.scan(false); - if (token.kind() === 65 /* ModuleKeyword */ || token.kind() === 66 /* RequireKeyword */) { - token = scanner.scan(false); - if (token.kind() === 72 /* OpenParenToken */) { - token = scanner.scan(false); - lineMap.fillLineAndCharacterFromPosition(TypeScript.start(importToken, text), lineChar); - if (token.kind() === 14 /* StringLiteral */) { - var ref = { - line: lineChar.line, - character: lineChar.character, - position: TypeScript.start(token, text), - length: TypeScript.width(token), - path: TypeScript.stripStartAndEndQuotes(TypeScript.switchToForwardSlashes(token.text())), - isResident: false - }; - importedFiles.push(ref); - } - } - } - } - } - } - token = scanner.scan(false); - } - var totalTime = new Date().getTime() - start; - } - function processTripleSlashDirectives(fileName, text, firstToken) { - var leadingTrivia = firstToken.leadingTrivia(text); - var position = 0; - var lineChar = { line: -1, character: -1 }; - var noDefaultLib = false; - var diagnostics = []; - var referencedFiles = []; - var lineMap = text.lineMap(); - for (var i = 0, n = leadingTrivia.count(); i < n; i++) { - var trivia = leadingTrivia.syntaxTriviaAt(i); - if (trivia.kind() === 7 /* SingleLineCommentTrivia */) { - var triviaText = trivia.fullText(); - var referencedCode = getFileReferenceFromReferencePath(fileName, text, position, triviaText, diagnostics); - if (referencedCode) { - lineMap.fillLineAndCharacterFromPosition(position, lineChar); - referencedCode.position = position; - referencedCode.length = trivia.fullWidth(); - referencedCode.line = lineChar.line; - referencedCode.character = lineChar.character; - referencedFiles.push(referencedCode); - } - var isNoDefaultLib = isNoDefaultLibMatch(triviaText); - if (isNoDefaultLib) { - noDefaultLib = isNoDefaultLib[3] === "true"; - } - } - position += trivia.fullWidth(); - } - return { noDefaultLib: noDefaultLib, diagnostics: diagnostics, referencedFiles: referencedFiles }; - } - function preProcessFile(fileName, sourceText, readImportFiles) { - if (readImportFiles === void 0) { readImportFiles = true; } - var text = TypeScript.SimpleText.fromScriptSnapshot(sourceText); - var scanner = TypeScript.Scanner.createScanner(1 /* ES5 */, text, reportDiagnostic); - var firstToken = scanner.scan(false); - var importedFiles = []; - if (readImportFiles) { - processImports(text, scanner, firstToken, importedFiles); - } - var properties = processTripleSlashDirectives(fileName, text, firstToken); - return { referencedFiles: properties.referencedFiles, importedFiles: importedFiles, isLibFile: properties.noDefaultLib, diagnostics: properties.diagnostics }; - } - TypeScript.preProcessFile = preProcessFile; - function getReferencedFiles(fileName, sourceText) { - return preProcessFile(fileName, sourceText, false).referencedFiles; - } - TypeScript.getReferencedFiles = getReferencedFiles; -})(TypeScript || (TypeScript = {})); -var debugObjectHost = this; -var ts; -(function (ts) { - (function (LanguageVersion) { - LanguageVersion[LanguageVersion["EcmaScript3"] = 0] = "EcmaScript3"; - LanguageVersion[LanguageVersion["EcmaScript5"] = 1] = "EcmaScript5"; - })(ts.LanguageVersion || (ts.LanguageVersion = {})); - var LanguageVersion = ts.LanguageVersion; - (function (ModuleGenTarget) { - ModuleGenTarget[ModuleGenTarget["Unspecified"] = 0] = "Unspecified"; - ModuleGenTarget[ModuleGenTarget["Synchronous"] = 1] = "Synchronous"; - ModuleGenTarget[ModuleGenTarget["Asynchronous"] = 2] = "Asynchronous"; - })(ts.ModuleGenTarget || (ts.ModuleGenTarget = {})); - var ModuleGenTarget = ts.ModuleGenTarget; - function languageVersionToScriptTarget(languageVersion) { - if (typeof languageVersion === "undefined") - return undefined; - switch (languageVersion) { - case 0 /* EcmaScript3 */: - return 0 /* ES3 */; - case 1 /* EcmaScript5 */: - return 1 /* ES5 */; - default: - throw Error("unsupported LanguageVersion value: " + languageVersion); - } - } - function moduleGenTargetToModuleKind(moduleGenTarget) { - if (typeof moduleGenTarget === "undefined") - return undefined; - switch (moduleGenTarget) { - case 2 /* Asynchronous */: - return 2 /* AMD */; - case 1 /* Synchronous */: - return 1 /* CommonJS */; - case 0 /* Unspecified */: - return 0 /* None */; - default: - throw Error("unsupported ModuleGenTarget value: " + moduleGenTarget); - } - } - function scriptTargetTolanguageVersion(scriptTarget) { - if (typeof scriptTarget === "undefined") - return undefined; - switch (scriptTarget) { - case 0 /* ES3 */: - return 0 /* EcmaScript3 */; - case 1 /* ES5 */: - return 1 /* EcmaScript5 */; - default: - throw Error("unsupported ScriptTarget value: " + scriptTarget); - } - } - function moduleKindToModuleGenTarget(moduleKind) { - if (typeof moduleKind === "undefined") - return undefined; - switch (moduleKind) { - case 2 /* AMD */: - return 2 /* Asynchronous */; - case 1 /* CommonJS */: - return 1 /* Synchronous */; - case 0 /* None */: - return 0 /* Unspecified */; - default: - throw Error("unsupported ModuleKind value: " + moduleKind); - } - } - function compilationSettingsToCompilerOptions(settings) { - var options = {}; - options.removeComments = settings.removeComments; - options.noResolve = settings.noResolve; - options.noImplicitAny = settings.noImplicitAny; - options.noLib = settings.noLib; - options.target = languageVersionToScriptTarget(settings.codeGenTarget); - options.module = moduleGenTargetToModuleKind(settings.moduleGenTarget); - options.out = settings.outFileOption; - options.outDir = settings.outDirOption; - options.sourceMap = settings.mapSourceFiles; - options.mapRoot = settings.mapRoot; - options.sourceRoot = settings.sourceRoot; - options.declaration = settings.generateDeclarationFiles; - options.codepage = settings.codepage; - options.emitBOM = settings.emitBOM; - return options; - } - function compilerOptionsToCompilationSettings(options) { - var settings = {}; - settings.removeComments = options.removeComments; - settings.noResolve = options.noResolve; - settings.noImplicitAny = options.noImplicitAny; - settings.noLib = options.noLib; - settings.codeGenTarget = scriptTargetTolanguageVersion(options.target); - settings.moduleGenTarget = moduleKindToModuleGenTarget(options.module); - settings.outFileOption = options.out; - settings.outDirOption = options.outDir; - settings.mapSourceFiles = options.sourceMap; - settings.mapRoot = options.mapRoot; - settings.sourceRoot = options.sourceRoot; - settings.generateDeclarationFiles = options.declaration; - settings.codepage = options.codepage; - settings.emitBOM = options.emitBOM; - return settings; - } - function logInternalError(logger, err) { - logger.log("*INTERNAL ERROR* - Exception in typescript services: " + err.message); - } - var ScriptSnapshotShimAdapter = (function () { - function ScriptSnapshotShimAdapter(scriptSnapshotShim) { - this.scriptSnapshotShim = scriptSnapshotShim; - this.lineStartPositions = null; - } - ScriptSnapshotShimAdapter.prototype.getText = function (start, end) { - return this.scriptSnapshotShim.getText(start, end); - }; - ScriptSnapshotShimAdapter.prototype.getLength = function () { - return this.scriptSnapshotShim.getLength(); - }; - ScriptSnapshotShimAdapter.prototype.getLineStartPositions = function () { - if (this.lineStartPositions == null) { - this.lineStartPositions = JSON.parse(this.scriptSnapshotShim.getLineStartPositions()); - } - return this.lineStartPositions; - }; - ScriptSnapshotShimAdapter.prototype.getChangeRange = function (oldSnapshot) { - var oldSnapshotShim = oldSnapshot; - var encoded = this.scriptSnapshotShim.getChangeRange(oldSnapshotShim.scriptSnapshotShim); - if (encoded == null) { - return null; - } - var decoded = JSON.parse(encoded); - return new TypeScript.TextChangeRange(new TypeScript.TextSpan(decoded.span.start, decoded.span.length), decoded.newLength); - }; - return ScriptSnapshotShimAdapter; - })(); - var LanguageServiceShimHostAdapter = (function () { - function LanguageServiceShimHostAdapter(shimHost) { - this.shimHost = shimHost; - } - LanguageServiceShimHostAdapter.prototype.log = function (s) { - this.shimHost.log(s); - }; - LanguageServiceShimHostAdapter.prototype.getCompilationSettings = function () { - var settingsJson = this.shimHost.getCompilationSettings(); - if (settingsJson == null || settingsJson == "") { - throw Error("LanguageServiceShimHostAdapter.getCompilationSettings: empty compilationSettings"); - return null; - } - var options = compilationSettingsToCompilerOptions(JSON.parse(settingsJson)); - return options; - }; - LanguageServiceShimHostAdapter.prototype.getScriptFileNames = function () { - var encoded = this.shimHost.getScriptFileNames(); - return JSON.parse(encoded); - }; - LanguageServiceShimHostAdapter.prototype.getScriptSnapshot = function (fileName) { - return new ScriptSnapshotShimAdapter(this.shimHost.getScriptSnapshot(fileName)); - }; - LanguageServiceShimHostAdapter.prototype.getScriptVersion = function (fileName) { - return this.shimHost.getScriptVersion(fileName); - }; - LanguageServiceShimHostAdapter.prototype.getScriptIsOpen = function (fileName) { - return this.shimHost.getScriptIsOpen(fileName); - }; - LanguageServiceShimHostAdapter.prototype.getLocalizedDiagnosticMessages = function () { - var diagnosticMessagesJson = this.shimHost.getLocalizedDiagnosticMessages(); - if (diagnosticMessagesJson == null || diagnosticMessagesJson == "") { - return null; - } - try { - return JSON.parse(diagnosticMessagesJson); - } - catch (e) { - this.log(e.description || "diagnosticMessages.generated.json has invalid JSON format"); - return null; - } - }; - LanguageServiceShimHostAdapter.prototype.getCancellationToken = function () { - return this.shimHost.getCancellationToken(); - }; - LanguageServiceShimHostAdapter.prototype.getDefaultLibFilename = function () { - return this.shimHost.getDefaultLibFilename(); - }; - LanguageServiceShimHostAdapter.prototype.getCurrentDirectory = function () { - return this.shimHost.getCurrentDirectory(); - }; - return LanguageServiceShimHostAdapter; - })(); - ts.LanguageServiceShimHostAdapter = LanguageServiceShimHostAdapter; - function simpleForwardCall(logger, actionDescription, action) { - logger.log(actionDescription); - var start = Date.now(); - var result = action(); - var end = Date.now(); - logger.log(actionDescription + " completed in " + (end - start) + " msec"); - if (typeof (result) === "string") { - var str = result; - if (str.length > 128) { - str = str.substring(0, 128) + "..."; - } - logger.log(" result.length=" + str.length + ", result='" + JSON.stringify(str) + "'"); - } - return result; - } - function forwardJSONCall(logger, actionDescription, action) { - try { - var result = simpleForwardCall(logger, actionDescription, action); - return JSON.stringify({ result: result }); - } - catch (err) { - if (err instanceof ts.OperationCanceledException) { - return JSON.stringify({ canceled: true }); - } - logInternalError(logger, err); - err.description = actionDescription; - return JSON.stringify({ error: err }); - } - } - var ShimBase = (function () { - function ShimBase(factory) { - this.factory = factory; - factory.registerShim(this); - } - ShimBase.prototype.dispose = function (dummy) { - this.factory.unregisterShim(this); - }; - return ShimBase; - })(); - var LanguageServiceShimObject = (function (_super) { - __extends(LanguageServiceShimObject, _super); - function LanguageServiceShimObject(factory, host, languageService) { - _super.call(this, factory); - this.host = host; - this.languageService = languageService; - this.logger = this.host; - } - LanguageServiceShimObject.prototype.forwardJSONCall = function (actionDescription, action) { - return forwardJSONCall(this.logger, actionDescription, action); - }; - LanguageServiceShimObject.prototype.dispose = function (dummy) { - this.logger.log("dispose()"); - this.languageService.dispose(); - this.languageService = null; - if (debugObjectHost && debugObjectHost.CollectGarbage) { - debugObjectHost.CollectGarbage(); - this.logger.log("CollectGarbage()"); - } - this.logger = null; - _super.prototype.dispose.call(this, dummy); - }; - LanguageServiceShimObject.prototype.refresh = function (throwOnError) { - this.forwardJSONCall("refresh(" + throwOnError + ")", function () { - return null; - }); - }; - LanguageServiceShimObject.prototype.cleanupSemanticCache = function () { - var _this = this; - this.forwardJSONCall("cleanupSemanticCache()", function () { - _this.languageService.cleanupSemanticCache(); - return null; - }); - }; - LanguageServiceShimObject.realizeDiagnostic = function (diagnostic) { - return { - message: diagnostic.messageText, - start: diagnostic.start, - length: diagnostic.length, - category: ts.DiagnosticCategory[diagnostic.category].toLowerCase(), - code: diagnostic.code - }; - }; - LanguageServiceShimObject.prototype.realizeDiagnosticWithFileName = function (diagnostic) { - return { - fileName: diagnostic.file.filename, - message: diagnostic.messageText, - start: diagnostic.start, - length: diagnostic.length, - category: ts.DiagnosticCategory[diagnostic.category].toLowerCase() - }; - }; - LanguageServiceShimObject.prototype.getSyntacticClassifications = function (fileName, start, length) { - var _this = this; - return this.forwardJSONCall("getSyntacticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { - var classifications = _this.languageService.getSyntacticClassifications(fileName, new TypeScript.TextSpan(start, length)); - return classifications; - }); - }; - LanguageServiceShimObject.prototype.getSemanticClassifications = function (fileName, start, length) { - var _this = this; - return this.forwardJSONCall("getSemanticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { - var classifications = _this.languageService.getSemanticClassifications(fileName, new TypeScript.TextSpan(start, length)); - return classifications; - }); - }; - LanguageServiceShimObject.prototype.getSyntacticDiagnostics = function (fileName) { - var _this = this; - return this.forwardJSONCall("getSyntacticDiagnostics('" + fileName + "')", function () { - var errors = _this.languageService.getSyntacticDiagnostics(fileName); - return errors.map(LanguageServiceShimObject.realizeDiagnostic); - }); - }; - LanguageServiceShimObject.prototype.getSemanticDiagnostics = function (fileName) { - var _this = this; - return this.forwardJSONCall("getSemanticDiagnostics('" + fileName + "')", function () { - var errors = _this.languageService.getSemanticDiagnostics(fileName); - return errors.map(LanguageServiceShimObject.realizeDiagnostic); - }); - }; - LanguageServiceShimObject.prototype.getCompilerOptionsDiagnostics = function () { - var _this = this; - return this.forwardJSONCall("getCompilerOptionsDiagnostics()", function () { - var errors = _this.languageService.getCompilerOptionsDiagnostics(); - return errors.map(function (d) { return _this.realizeDiagnosticWithFileName(d); }); - }); - }; - LanguageServiceShimObject.prototype.getQuickInfoAtPosition = function (fileName, position) { - var _this = this; - return this.forwardJSONCall("getQuickInfoAtPosition('" + fileName + "', " + position + ")", function () { - var quickInfo = _this.languageService.getQuickInfoAtPosition(fileName, position); - return quickInfo; - }); - }; - LanguageServiceShimObject.prototype.getNameOrDottedNameSpan = function (fileName, startPos, endPos) { - var _this = this; - return this.forwardJSONCall("getNameOrDottedNameSpan('" + fileName + "', " + startPos + ", " + endPos + ")", function () { - var spanInfo = _this.languageService.getNameOrDottedNameSpan(fileName, startPos, endPos); - return spanInfo; - }); - }; - LanguageServiceShimObject.prototype.getBreakpointStatementAtPosition = function (fileName, position) { - var _this = this; - return this.forwardJSONCall("getBreakpointStatementAtPosition('" + fileName + "', " + position + ")", function () { - var spanInfo = _this.languageService.getBreakpointStatementAtPosition(fileName, position); - return spanInfo; - }); - }; - LanguageServiceShimObject.prototype.getSignatureHelpItems = function (fileName, position) { - var _this = this; - return this.forwardJSONCall("getSignatureHelpItems('" + fileName + "', " + position + ")", function () { - var signatureInfo = _this.languageService.getSignatureHelpItems(fileName, position); - return signatureInfo; - }); - }; - LanguageServiceShimObject.prototype.getSignatureAtPosition = function (fileName, position) { - var _this = this; - return this.forwardJSONCall("getSignatureAtPosition('" + fileName + "', " + position + ")", function () { - return _this.languageService.getSignatureAtPosition(fileName, position); - }); - }; - LanguageServiceShimObject.prototype.getDefinitionAtPosition = function (fileName, position) { - var _this = this; - return this.forwardJSONCall("getDefinitionAtPosition('" + fileName + "', " + position + ")", function () { - return _this.languageService.getDefinitionAtPosition(fileName, position); - }); - }; - LanguageServiceShimObject.prototype.getRenameInfo = function (fileName, position) { - var _this = this; - return this.forwardJSONCall("getRenameInfo('" + fileName + "', " + position + ")", function () { - return _this.languageService.getRenameInfo(fileName, position); - }); - }; - LanguageServiceShimObject.prototype.findRenameLocations = function (fileName, position, findInStrings, findInComments) { - var _this = this; - return this.forwardJSONCall("findRenameLocations('" + fileName + "', " + position + ", " + findInStrings + ", " + findInComments + ")", function () { - return _this.languageService.findRenameLocations(fileName, position, findInStrings, findInComments); - }); - }; - LanguageServiceShimObject.prototype.getBraceMatchingAtPosition = function (fileName, position) { - var _this = this; - return this.forwardJSONCall("getBraceMatchingAtPosition('" + fileName + "', " + position + ")", function () { - var textRanges = _this.languageService.getBraceMatchingAtPosition(fileName, position); - return textRanges; - }); - }; - LanguageServiceShimObject.prototype.getIndentationAtPosition = function (fileName, position, options) { - var _this = this; - return this.forwardJSONCall("getIndentationAtPosition('" + fileName + "', " + position + ")", function () { - var localOptions = JSON.parse(options); - return _this.languageService.getIndentationAtPosition(fileName, position, localOptions); - }); - }; - LanguageServiceShimObject.prototype.getReferencesAtPosition = function (fileName, position) { - var _this = this; - return this.forwardJSONCall("getReferencesAtPosition('" + fileName + "', " + position + ")", function () { - return _this.languageService.getReferencesAtPosition(fileName, position); - }); - }; - LanguageServiceShimObject.prototype.getOccurrencesAtPosition = function (fileName, position) { - var _this = this; - return this.forwardJSONCall("getOccurrencesAtPosition('" + fileName + "', " + position + ")", function () { - return _this.languageService.getOccurrencesAtPosition(fileName, position); - }); - }; - LanguageServiceShimObject.prototype.getImplementorsAtPosition = function (fileName, position) { - var _this = this; - return this.forwardJSONCall("getImplementorsAtPosition('" + fileName + "', " + position + ")", function () { - return _this.languageService.getImplementorsAtPosition(fileName, position); - }); - }; - LanguageServiceShimObject.prototype.getCompletionsAtPosition = function (fileName, position, isMemberCompletion) { - var _this = this; - return this.forwardJSONCall("getCompletionsAtPosition('" + fileName + "', " + position + ", " + isMemberCompletion + ")", function () { - var completion = _this.languageService.getCompletionsAtPosition(fileName, position, isMemberCompletion); - return completion; - }); - }; - LanguageServiceShimObject.prototype.getCompletionEntryDetails = function (fileName, position, entryName) { - var _this = this; - return this.forwardJSONCall("getCompletionEntryDetails('" + fileName + "', " + position + ", " + entryName + ")", function () { - var details = _this.languageService.getCompletionEntryDetails(fileName, position, entryName); - return details; - }); - }; - LanguageServiceShimObject.prototype.getFormattingEditsForRange = function (fileName, start, end, options) { - var _this = this; - return this.forwardJSONCall("getFormattingEditsForRange('" + fileName + "', " + start + ", " + end + ")", function () { - var localOptions = JSON.parse(options); - var edits = _this.languageService.getFormattingEditsForRange(fileName, start, end, localOptions); - return edits; - }); - }; - LanguageServiceShimObject.prototype.getFormattingEditsForDocument = function (fileName, options) { - var _this = this; - return this.forwardJSONCall("getFormattingEditsForDocument('" + fileName + "')", function () { - var localOptions = JSON.parse(options); - var edits = _this.languageService.getFormattingEditsForDocument(fileName, localOptions); - return edits; - }); - }; - LanguageServiceShimObject.prototype.getFormattingEditsAfterKeystroke = function (fileName, position, key, options) { - var _this = this; - return this.forwardJSONCall("getFormattingEditsAfterKeystroke('" + fileName + "', " + position + ", '" + key + "')", function () { - var localOptions = JSON.parse(options); - var edits = _this.languageService.getFormattingEditsAfterKeystroke(fileName, position, key, localOptions); - return edits; - }); - }; - LanguageServiceShimObject.prototype.getNavigateToItems = function (searchValue) { - var _this = this; - return this.forwardJSONCall("getNavigateToItems('" + searchValue + "')", function () { - var items = _this.languageService.getNavigateToItems(searchValue); - return items; - }); - }; - LanguageServiceShimObject.prototype.getNavigationBarItems = function (fileName) { - var _this = this; - return this.forwardJSONCall("getNavigationBarItems('" + fileName + "')", function () { - var items = _this.languageService.getNavigationBarItems(fileName); - return items; - }); - }; - LanguageServiceShimObject.prototype.getOutliningSpans = function (fileName) { - var _this = this; - return this.forwardJSONCall("getOutliningSpans('" + fileName + "')", function () { - var items = _this.languageService.getOutliningSpans(fileName); - return items; - }); - }; - LanguageServiceShimObject.prototype.getTodoComments = function (fileName, descriptors) { - var _this = this; - return this.forwardJSONCall("getTodoComments('" + fileName + "')", function () { - var items = _this.languageService.getTodoComments(fileName, JSON.parse(descriptors)); - return items; - }); - }; - LanguageServiceShimObject.prototype.getEmitOutput = function (fileName) { - var _this = this; - return this.forwardJSONCall("getEmitOutput('" + fileName + "')", function () { - var output = _this.languageService.getEmitOutput(fileName); - return output; - }); - }; - return LanguageServiceShimObject; - })(ShimBase); - var ClassifierShimObject = (function (_super) { - __extends(ClassifierShimObject, _super); - function ClassifierShimObject(factory, logger) { - _super.call(this, factory); - this.logger = logger; - this.classifier = ts.createClassifier(this.logger); - } - ClassifierShimObject.prototype.getClassificationsForLine = function (text, lexState) { - var classification = this.classifier.getClassificationsForLine(text, lexState); - var items = classification.entries; - var result = ""; - for (var i = 0; i < items.length; i++) { - result += items[i].length + "\n"; - result += items[i].classification + "\n"; - } - result += classification.finalLexState; - return result; - }; - return ClassifierShimObject; - })(ShimBase); - var CoreServicesShimObject = (function (_super) { - __extends(CoreServicesShimObject, _super); - function CoreServicesShimObject(factory, logger) { - _super.call(this, factory); - this.logger = logger; - } - CoreServicesShimObject.prototype.forwardJSONCall = function (actionDescription, action) { - return forwardJSONCall(this.logger, actionDescription, action); - }; - CoreServicesShimObject.prototype.getPreProcessedFileInfo = function (fileName, sourceText) { - return this.forwardJSONCall("getPreProcessedFileInfo('" + fileName + "')", function () { - var result = TypeScript.preProcessFile(fileName, sourceText); - return result; - }); - }; - CoreServicesShimObject.prototype.getDefaultCompilationSettings = function () { - return this.forwardJSONCall("getDefaultCompilationSettings()", function () { - return compilerOptionsToCompilationSettings(ts.getDefaultCompilerOptions()); - }); - }; - return CoreServicesShimObject; - })(ShimBase); - var TypeScriptServicesFactory = (function () { - function TypeScriptServicesFactory() { - this._shims = []; - this.documentRegistry = ts.createDocumentRegistry(); - } - TypeScriptServicesFactory.prototype.createLanguageServiceShim = function (host) { - try { - var hostAdapter = new LanguageServiceShimHostAdapter(host); - var languageService = ts.createLanguageService(hostAdapter, this.documentRegistry); - return new LanguageServiceShimObject(this, host, languageService); - } - catch (err) { - logInternalError(host, err); - throw err; - } - }; - TypeScriptServicesFactory.prototype.createClassifierShim = function (logger) { - try { - return new ClassifierShimObject(this, logger); - } - catch (err) { - logInternalError(logger, err); - throw err; - } - }; - TypeScriptServicesFactory.prototype.createCoreServicesShim = function (logger) { - try { - return new CoreServicesShimObject(this, logger); - } - catch (err) { - logInternalError(logger, err); - throw err; - } - }; - TypeScriptServicesFactory.prototype.close = function () { - this._shims = []; - this.documentRegistry = ts.createDocumentRegistry(); - }; - TypeScriptServicesFactory.prototype.registerShim = function (shim) { - this._shims.push(shim); - }; - TypeScriptServicesFactory.prototype.unregisterShim = function (shim) { - for (var i = 0, n = this._shims.length; i < n; i++) { - if (this._shims[i] === shim) { - delete this._shims[i]; - return; - } - } - throw TypeScript.Errors.invalidOperation(); - }; - return TypeScriptServicesFactory; - })(); - ts.TypeScriptServicesFactory = TypeScriptServicesFactory; -})(ts || (ts = {})); -var TypeScript; -(function (TypeScript) { - var Services; - (function (Services) { - Services.TypeScriptServicesFactory = ts.TypeScriptServicesFactory; - })(Services = TypeScript.Services || (TypeScript.Services = {})); -})(TypeScript || (TypeScript = {})); diff --git a/pages/third_party/typescript/package.json b/pages/third_party/typescript/package.json deleted file mode 100644 index eb6b973912..0000000000 --- a/pages/third_party/typescript/package.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "name": "typescript", - "author": { - "name": "Microsoft Corp." - }, - "homepage": "http://typescriptlang.org/", - "version": "1.3.0", - "licenses": [ - { - "type": "Apache License 2.0", - "url": "https://github.com/Microsoft/TypeScript/blob/master/LICENSE.txt" - } - ], - "description": "TypeScript is a language for application scale JavaScript development", - "keywords": [ - "TypeScript", - "Microsoft", - "compiler", - "language", - "javascript" - ], - "bugs": { - "url": "https://github.com/Microsoft/TypeScript/issues" - }, - "repository": { - "type": "git", - "url": "https://github.com/Microsoft/TypeScript.git" - }, - "preferGlobal": true, - "main": "./bin/tsc.js", - "bin": { - "tsc": "./bin/tsc" - }, - "engines": { - "node": ">=0.8.0" - }, - "devDependencies": { - "jake": "latest", - "mocha": "latest", - "chai": "latest", - "browserify": "latest", - "istanbul": "latest", - "codeclimate-test-reporter": "latest" - }, - "scripts": { - "test": "jake generate-code-coverage" - }, - "gitHead": "39daf6cfbeb627b5aca5106977760e4272c67b8f", - "_id": "typescript@1.3.0", - "_shasum": "b48262ac7444971b447ffc6bb56c69854eef02e1", - "_from": "typescript@>=1.3.0 <1.4.0", - "_npmVersion": "1.4.28", - "_npmUser": { - "name": "typescript", - "email": "typescript@microsoft.com" - }, - "maintainers": [ - { - "name": "typescript", - "email": "typescript@microsoft.com" - } - ], - "dist": { - "shasum": "b48262ac7444971b447ffc6bb56c69854eef02e1", - "tarball": "http://registry.npmjs.org/typescript/-/typescript-1.3.0.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/typescript/-/typescript-1.3.0.tgz" -} diff --git a/pages/third_party/typescript/scripts/importDefinitelyTypedTests.ts b/pages/third_party/typescript/scripts/importDefinitelyTypedTests.ts deleted file mode 100644 index f33ba1dd52..0000000000 --- a/pages/third_party/typescript/scripts/importDefinitelyTypedTests.ts +++ /dev/null @@ -1,125 +0,0 @@ -declare var require: any, process: any; -declare var __dirname: any; - -var fs = require("fs"); -var path = require("path"); -var child_process = require('child_process'); - -var tscRoot = path.join(__dirname, "..\\"); -var tscPath = path.join(tscRoot, "built", "instrumented", "tsc.js"); -var rwcTestPath = path.join(tscRoot, "tests", "cases", "rwc", "dt"); -var definitelyTypedRoot = process.argv[2]; - -function fileExtensionIs(path: string, extension: string): boolean { - var pathLen = path.length; - var extLen = extension.length; - return pathLen > extLen && path.substr(pathLen - extLen, extLen).toLocaleLowerCase() === extension.toLocaleLowerCase(); -} - -function copyFileSync(source, destination) { - var text = fs.readFileSync(source); - fs.writeFileSync(destination, text); -} - -function importDefinitelyTypedTest(testCaseName: string, testFiles: string[], responseFile: string ) { - var cmd = "node " + tscPath + " --module commonjs " + testFiles.join(" "); - if (responseFile) cmd += " @" + responseFile; - - var testDirectoryName = testCaseName + "_" + Math.floor((Math.random() * 10000) + 1); - var testDirectoryPath = path.join(process.env["temp"], testDirectoryName); - if (fs.existsSync(testDirectoryPath)) { - throw new Error("Could not create test directory"); - } - fs.mkdirSync(testDirectoryPath); - - child_process.exec(cmd, { - maxBuffer: 1 * 1024 * 1024, - cwd: testDirectoryPath - }, (error, stdout, stderr) => { - console.log("importing " + testCaseName + " ..."); - console.log(cmd); - - if (error) { - console.log("importing " + testCaseName + " ..."); - console.log(cmd); - console.log("==> error " + JSON.stringify(error)); - console.log("==> stdout " + String(stdout)); - console.log("==> stderr " + String(stderr)); - console.log("\r\n"); - return; - } - - // copy generated file to output location - var outputFilePath = path.join(testDirectoryPath, "iocapture0.json"); - var testCasePath = path.join(rwcTestPath, "DefinitelyTyped_" + testCaseName + ".json"); - copyFileSync(outputFilePath, testCasePath); - - //console.log("output generated at: " + outputFilePath); - - if (!fs.existsSync(testCasePath)) { - throw new Error("could not find test case at: " + testCasePath); - } - else { - fs.unlinkSync(outputFilePath); - fs.rmdirSync(testDirectoryPath); - //console.log("testcase generated at: " + testCasePath); - //console.log("Done."); - } - //console.log("\r\n"); - - }) - .on('error', function (error) { - console.log("==> error " + JSON.stringify(error)); - console.log("\r\n"); - }); -} - -function importDefinitelyTypedTests(definitelyTypedRoot: string): void { - fs.readdir(definitelyTypedRoot, (err, subDirectorys) => { - if (err) throw err; - - subDirectorys - .filter(d => ["_infrastructure", "node_modules", ".git"].indexOf(d) < 0) - .filter(i => i.indexOf("sipml") >=0 ) - .filter(i => fs.statSync(path.join(definitelyTypedRoot, i)).isDirectory()) - .forEach(d => { - var directoryPath = path.join(definitelyTypedRoot, d); - fs.readdir(directoryPath, function (err, files) { - if (err) throw err; - - var tsFiles = []; - var testFiles = []; - var paramFile; - - files - .map(f => path.join(directoryPath, f)) - .forEach(f => { - if (fileExtensionIs(f, ".ts")) tsFiles.push(f); - else if (fileExtensionIs(f, ".tscparams")) paramFile = f; - - if (fileExtensionIs(f, "-tests.ts")) testFiles.push(f); - }); - - if (testFiles.length === 0) { - // no test files but multiple d.ts's, e.g. winjs - var regexp = new RegExp(d + "(([-][0-9])|([\.]d[\.]ts))"); - if (tsFiles.length > 1 && tsFiles.every(t => fileExtensionIs(t, ".d.ts") && regexp.test(t))) { - tsFiles.forEach(filename => { - importDefinitelyTypedTest(path.basename(filename, ".d.ts"), [filename], paramFile); - }); - } - else { - importDefinitelyTypedTest(d, tsFiles, paramFile); - } - } - else { - testFiles.forEach(filename => { - importDefinitelyTypedTest(path.basename(filename, "-tests.ts"), [filename], paramFile); - }); - } - }); - }) - }); -} - -importDefinitelyTypedTests(definitelyTypedRoot); \ No newline at end of file diff --git a/pages/third_party/typescript/scripts/processDiagnosticMessages.ts b/pages/third_party/typescript/scripts/processDiagnosticMessages.ts deleted file mode 100644 index 6a4aaad9f9..0000000000 --- a/pages/third_party/typescript/scripts/processDiagnosticMessages.ts +++ /dev/null @@ -1,185 +0,0 @@ -/// - -interface DiagnosticDetails { - category: string; - code: number; -} - -interface InputDiagnosticMessageTable { - [msg: string]: DiagnosticDetails; -} - -interface IIndexable { - [key: string]: V; -} - -function main(): void { - if (sys.args.length < 1) { - sys.write("Usage:" + sys.newLine) - sys.write("\tnode processDiagnosticMessages.js " + sys.newLine); - return; - } - - var inputFilePath = sys.args[0].replace(/\\/g, "/"); - var inputStr = sys.readFile(inputFilePath); - - var diagnosticMesages: InputDiagnosticMessageTable = JSON.parse(inputStr); - - var names = Utilities.getObjectKeys(diagnosticMesages); - var nameMap = buildUniqueNameMap(names); - - var infoFileOutput = buildInfoFileOutput(diagnosticMesages, nameMap); - - // TODO: Fix path joining - var inputDirectory = inputFilePath.substr(0,inputFilePath.lastIndexOf("/")); - var fileOutputPath = inputDirectory + "/diagnosticInformationMap.generated.ts"; - sys.writeFile(fileOutputPath, infoFileOutput); -} - -function buildUniqueNameMap(names: string[]): IIndexable { - var nameMap: IIndexable = {}; - - var uniqueNames = NameGenerator.ensureUniqueness(names, /* isCaseSensitive */ false, /* isFixed */ undefined); - - for (var i = 0; i < names.length; i++) { - nameMap[names[i]] = uniqueNames[i]; - } - - return nameMap; -} - -function buildInfoFileOutput(messageTable: InputDiagnosticMessageTable, nameMap: IIndexable): string { - var result = - '// \r\n' + - '/// \r\n' + - 'module ts {\r\n' + - ' export var Diagnostics = {\r\n'; - var names = Utilities.getObjectKeys(messageTable); - for (var i = 0; i < names.length; i++) { - var name = names[i]; - var diagnosticDetails = messageTable[name]; - - result += - ' ' + convertPropertyName(nameMap[name]) + - ': { code: ' + diagnosticDetails.code + - ', category: DiagnosticCategory.' + diagnosticDetails.category + - ', key: "' + name.replace('"', '\\"') + - '" },\r\n'; - } - - result += ' };\r\n}'; - - return result; -} - -function convertPropertyName(origName: string): string { - var result = origName.split("").map(char => { - if (char === '*') { return "_Asterisk"; } - if (char === '/') { return "_Slash"; } - if (char === ':') { return "_Colon"; } - return /\w/.test(char) ? char : "_"; - }).join(""); - - - // get rid of all multi-underscores - result = result.replace(/_+/g, "_"); - - // remove any leading underscore, unless it is followed by a number. - result = result.replace(/^_([^\d])/, "$1") - - // get rid of all trailing underscores. - result = result.replace(/_$/, ""); - - return result; -} - -module NameGenerator { - export function ensureUniqueness(names: string[], isCaseSensitive: boolean, isFixed?: boolean[]): string[]{ - if (!isFixed) { - isFixed = names.map(() => false) - } - - var names = names.slice(); - ensureUniquenessInPlace(names, isCaseSensitive, isFixed); - return names; - } - - function ensureUniquenessInPlace(names: string[], isCaseSensitive: boolean, isFixed: boolean[]): void { - for (var i = 0; i < names.length; i++) { - var name = names[i]; - var collisionIndices = Utilities.collectMatchingIndices(name, names, isCaseSensitive); - - // We will always have one "collision" because getCollisionIndices returns the index of name itself as well; - // so if we only have one collision, then there are no issues. - if (collisionIndices.length < 2) { - continue; - } - - handleCollisions(name, names, isFixed, collisionIndices, isCaseSensitive); - } - } - - function handleCollisions(name: string, proposedNames: string[], isFixed: boolean[], collisionIndices: number[], isCaseSensitive: boolean): void { - var suffix = 1; - - for (var i = 0; i < collisionIndices.length; i++) { - var collisionIndex = collisionIndices[i]; - - if (isFixed[collisionIndex]) { - // can't do anything about this name. - continue; - } - - while (true) { - var newName = name + suffix; - suffix++; - - // Check if we've synthesized a unique name, and if so - // replace the conflicting name with the new one. - if (!proposedNames.some(name => Utilities.stringEquals(name, newName, isCaseSensitive))) { - proposedNames[collisionIndex] = newName; - break; - } - } - } - } -} - -module Utilities { - /// Return a list of all indices where a string occurs. - export function collectMatchingIndices(name: string, proposedNames: string[], isCaseSensitive: boolean): number[] { - var matchingIndices: number[] = []; - - for (var i = 0; i < proposedNames.length; i++) { - if (stringEquals(name, proposedNames[i], isCaseSensitive)) { - matchingIndices.push(i); - } - } - - return matchingIndices; - } - - export function stringEquals(s1: string, s2: string, caseSensitive: boolean): boolean { - if (caseSensitive) { - s1 = s1.toLowerCase(); - s2 = s2.toLowerCase(); - } - - return s1 == s2; - } - - // Like Object.keys - export function getObjectKeys(obj: any): string[]{ - var result: string[] = []; - - for (var name in obj) { - if (obj.hasOwnProperty(name)) { - result.push(name); - } - } - - return result; - } -} - -main(); \ No newline at end of file diff --git a/pages/third_party/typescript/scripts/word2md.js b/pages/third_party/typescript/scripts/word2md.js deleted file mode 100644 index 8f9cd276f9..0000000000 --- a/pages/third_party/typescript/scripts/word2md.js +++ /dev/null @@ -1,184 +0,0 @@ -var sys = (function () { - var args = []; - for (var i = 0; i < WScript.Arguments.length; i++) { - args[i] = WScript.Arguments.Item(i); - } - return { - args: args, - createObject: function (typeName) { return new ActiveXObject(typeName); }, - write: function (s) { return WScript.StdOut.Write(s); } - }; -})(); -function convertDocumentToMarkdown(doc) { - var result = ""; - var lastStyle; - var lastInTable; - var tableColumnCount; - var tableCellIndex; - var columnAlignment = []; - function setProperties(target, properties) { - for (var name in properties) { - if (properties.hasOwnProperty(name)) { - var value = properties[name]; - if (typeof value === "object") { - setProperties(target[name], value); - } - else { - target[name] = value; - } - } - } - } - function findReplace(findText, findOptions, replaceText, replaceOptions) { - var find = doc.range().find; - find.clearFormatting(); - setProperties(find, findOptions); - var replace = find.replacement; - replace.clearFormatting(); - setProperties(replace, replaceOptions); - find.execute(findText, false, false, false, false, false, true, 0, true, replaceText, 2); - } - function write(s) { - result += s; - } - function writeTableHeader() { - for (var i = 0; i < tableColumnCount - 1; i++) { - switch (columnAlignment[i]) { - case 1: - write("|:---:"); - break; - case 2: - write("|---:"); - break; - default: - write("|---"); - } - } - write("|\n"); - } - function trimEndFormattingMarks(text) { - var i = text.length; - while (i > 0 && text.charCodeAt(i - 1) < 0x20) - i--; - return text.substr(0, i); - } - function writeBlockEnd() { - switch (lastStyle) { - case "Code": - write("```\n\n"); - break; - case "List Paragraph": - case "Table": - case "TOC": - write("\n"); - break; - } - } - function writeParagraph(p) { - var text = p.range.text; - var style = p.style.nameLocal; - var inTable = p.range.tables.count > 0; - var level = 1; - var sectionBreak = text.indexOf("\x0C") >= 0; - text = trimEndFormattingMarks(text); - if (inTable) { - style = "Table"; - } - else if (style.match(/\s\d$/)) { - level = +style.substr(style.length - 1); - style = style.substr(0, style.length - 2); - } - if (lastStyle && style !== lastStyle) { - writeBlockEnd(); - } - switch (style) { - case "Heading": - case "Appendix": - var section = p.range.listFormat.listString; - write("####".substr(0, level) + ' ' + section + " " + text + "\n\n"); - break; - case "Normal": - if (text.length) { - write(text + "\n\n"); - } - break; - case "List Paragraph": - write(" ".substr(0, p.range.listFormat.listLevelNumber * 2 - 2) + "* " + text + "\n"); - break; - case "Grammar": - write("  " + text.replace(/\s\s\s/g, " ").replace(/\x0B/g, " \n   ") + "\n\n"); - break; - case "Code": - if (lastStyle !== "Code") { - write("```TypeScript\n"); - } - else { - write("\n"); - } - write(text.replace(/\x0B/g, " \n") + "\n"); - break; - case "Table": - if (!lastInTable) { - tableColumnCount = p.range.tables.item(1).columns.count + 1; - tableCellIndex = 0; - } - if (tableCellIndex < tableColumnCount) { - columnAlignment[tableCellIndex] = p.alignment; - } - write("|" + text); - tableCellIndex++; - if (tableCellIndex % tableColumnCount === 0) { - write("\n"); - if (tableCellIndex === tableColumnCount) { - writeTableHeader(); - } - } - break; - case "TOC Heading": - write("## " + text + "\n\n"); - break; - case "TOC": - var strings = text.split("\t"); - write(" ".substr(0, level * 2 - 2) + "* [" + strings[0] + " " + strings[1] + "](#" + strings[0] + ")\n"); - break; - } - if (sectionBreak) { - write("
\n\n"); - } - lastStyle = style; - lastInTable = inTable; - } - function writeDocument() { - for (var p = doc.paragraphs.first; p; p = p.next()) { - writeParagraph(p); - } - writeBlockEnd(); - } - findReplace("<", {}, "<", {}); - findReplace("<", { style: "Code" }, "<", {}); - findReplace("<", { style: "Code Fragment" }, "<", {}); - findReplace("<", { style: "Terminal" }, "<", {}); - findReplace("", { font: { subscript: true } }, "^&", { font: { subscript: false } }); - findReplace("", { style: "Code Fragment" }, "`^&`", { style: -66 }); - findReplace("", { style: "Production" }, "*^&*", { style: -66 }); - findReplace("", { style: "Terminal" }, "`^&`", { style: -66 }); - findReplace("", { font: { bold: true, italic: true } }, "***^&***", { font: { bold: false, italic: false } }); - findReplace("", { font: { italic: true } }, "*^&*", { font: { italic: false } }); - doc.fields.toggleShowCodes(); - findReplace("^19 REF", {}, "[^&](#^&)", {}); - doc.fields.toggleShowCodes(); - writeDocument(); - return result; -} -function main(args) { - if (args.length !== 1) { - sys.write("Syntax: word2md \n"); - return; - } - var app = sys.createObject("Word.Application"); - var doc = app.documents.open(args[0]); - sys.write(convertDocumentToMarkdown(doc)); - doc.close(false); - app.quit(); -} -main(sys.args); diff --git a/pages/third_party/typescript/scripts/word2md.ts b/pages/third_party/typescript/scripts/word2md.ts deleted file mode 100644 index b1bc50b0cb..0000000000 --- a/pages/third_party/typescript/scripts/word2md.ts +++ /dev/null @@ -1,339 +0,0 @@ -// word2md - Word to Markdown conversion tool -// -// word2md converts a Microsoft Word document to Markdown formatted text. The tool uses the -// Word Automation APIs to start an instance of Word and access the contents of the document -// being converted. The tool must be run using the cscript.exe script host and requires Word -// to be installed on the target machine. The name of the document to convert must be specified -// as a command line argument and the resulting Markdown is written to standard output. The -// tool recognizes the specific Word styles used in the TypeScript Language Specification. - -module Word { - - export interface Collection { - count: number; - item(index: number): T; - } - - export interface Font { - bold: boolean; - italic: boolean; - subscript: boolean; - superscript: boolean; - } - - export interface Find { - font: Font; - format: boolean; - replacement: Replacement; - style: any; - text: string; - clearFormatting(): void; - execute( - findText: string, - matchCase: boolean, - matchWholeWord: boolean, - matchWildcards: boolean, - matchSoundsLike: boolean, - matchAllWordForms: boolean, - forward: boolean, - wrap: number, - format: boolean, - replaceWith: string, - replace: number): boolean; - } - - export interface Replacement { - font: Font; - style: any; - text: string; - clearFormatting(): void; - } - - export interface ListFormat { - listLevelNumber: number; - listString: string; - } - - export interface Column { - } - - export interface Columns extends Collection { - } - - export interface Table { - columns: Columns; - } - - export interface Tables extends Collection { - } - - export interface Range { - find: Find; - listFormat: ListFormat; - tables: Tables; - text: string; - words: Ranges; - } - - export interface Ranges extends Collection { - } - - export interface Style { - nameLocal: string; - } - - export interface Paragraph { - alignment: number; - range: Range; - style: Style; - next(): Paragraph; - } - - export interface Paragraphs extends Collection { - first: Paragraph; - } - - export interface Field { - } - - export interface Fields extends Collection { - toggleShowCodes(): void; - } - - export interface Document { - fields: Fields; - paragraphs: Paragraphs; - close(saveChanges: boolean): void; - range(): Range; - } - - export interface Documents extends Collection { - open(filename: string): Document; - } - - export interface Application { - documents: Documents; - quit(): void; - } -} - -var sys = (function () { - var args: string[] = []; - for (var i = 0; i < WScript.Arguments.length; i++) { - args[i] = WScript.Arguments.Item(i); - } - return { - args: args, - createObject: (typeName: string) => new ActiveXObject(typeName), - write: (s: string) => WScript.StdOut.Write(s) - }; -})(); - -interface FindReplaceOptions { - style?: any; - font?: { - bold?: boolean; - italic?: boolean; - subscript?: boolean; - }; -} - -function convertDocumentToMarkdown(doc: Word.Document): string { - - var result: string = ""; - var lastStyle: string; - var lastInTable: boolean; - var tableColumnCount: number; - var tableCellIndex: number; - var columnAlignment: number[] = []; - - function setProperties(target: any, properties: any) { - for (var name in properties) { - if (properties.hasOwnProperty(name)) { - var value = properties[name]; - if (typeof value === "object") { - setProperties(target[name], value); - } - else { - target[name] = value; - } - } - } - } - - function findReplace(findText: string, findOptions: FindReplaceOptions, replaceText: string, replaceOptions: FindReplaceOptions) { - var find = doc.range().find; - find.clearFormatting(); - setProperties(find, findOptions); - var replace = find.replacement; - replace.clearFormatting(); - setProperties(replace, replaceOptions); - find.execute(findText, false, false, false, false, false, true, 0, true, replaceText, 2); - } - - function write(s: string) { - result += s; - } - - function writeTableHeader() { - for (var i = 0; i < tableColumnCount - 1; i++) { - switch (columnAlignment[i]) { - case 1: - write("|:---:"); - break; - case 2: - write("|---:"); - break; - default: - write("|---"); - } - } - write("|\n"); - } - - function trimEndFormattingMarks(text: string) { - var i = text.length; - while (i > 0 && text.charCodeAt(i - 1) < 0x20) i--; - return text.substr(0, i); - } - - function writeBlockEnd() { - switch (lastStyle) { - case "Code": - write("```\n\n"); - break; - case "List Paragraph": - case "Table": - case "TOC": - write("\n"); - break; - } - } - - function writeParagraph(p: Word.Paragraph) { - - var text = p.range.text; - var style = p.style.nameLocal; - var inTable = p.range.tables.count > 0; - var level = 1; - var sectionBreak = text.indexOf("\x0C") >= 0; - - text = trimEndFormattingMarks(text); - if (inTable) { - style = "Table"; - } - else if (style.match(/\s\d$/)) { - level = +style.substr(style.length - 1); - style = style.substr(0, style.length - 2); - } - if (lastStyle && style !== lastStyle) { - writeBlockEnd(); - } - - switch (style) { - - case "Heading": - case "Appendix": - var section = p.range.listFormat.listString; - write("####".substr(0, level) + ' ' + section + " " + text + "\n\n"); - break; - - case "Normal": - if (text.length) { - write(text + "\n\n"); - } - break; - - case "List Paragraph": - write(" ".substr(0, p.range.listFormat.listLevelNumber * 2 - 2) + "* " + text + "\n"); - break; - - case "Grammar": - write("  " + text.replace(/\s\s\s/g, " ").replace(/\x0B/g, " \n   ") + "\n\n"); - break; - - case "Code": - if (lastStyle !== "Code") { - write("```TypeScript\n"); - } - else { - write("\n"); - } - write(text.replace(/\x0B/g, " \n") + "\n"); - break; - - case "Table": - if (!lastInTable) { - tableColumnCount = p.range.tables.item(1).columns.count + 1; - tableCellIndex = 0; - } - if (tableCellIndex < tableColumnCount) { - columnAlignment[tableCellIndex] = p.alignment; - } - write("|" + text); - tableCellIndex++; - if (tableCellIndex % tableColumnCount === 0) { - write("\n"); - if (tableCellIndex === tableColumnCount) { - writeTableHeader(); - } - } - break; - - case "TOC Heading": - write("## " + text + "\n\n"); - break; - - case "TOC": - var strings = text.split("\t"); - write(" ".substr(0, level * 2 - 2) + "* [" + strings[0] + " " + strings[1] + "](#" + strings[0] + ")\n"); - break; - } - - if (sectionBreak) { - write("
\n\n"); - } - lastStyle = style; - lastInTable = inTable; - } - - function writeDocument() { - for (var p = doc.paragraphs.first; p; p = p.next()) { - writeParagraph(p); - } - writeBlockEnd(); - } - - findReplace("<", {}, "<", {}); - findReplace("<", { style: "Code" }, "<", {}); - findReplace("<", { style: "Code Fragment" }, "<", {}); - findReplace("<", { style: "Terminal" }, "<", {}); - findReplace("", { font: { subscript: true } }, "^&", { font: { subscript: false } }); - findReplace("", { style: "Code Fragment" }, "`^&`", { style: -66 /* default font */ }); - findReplace("", { style: "Production" }, "*^&*", { style: -66 /* default font */}); - findReplace("", { style: "Terminal" }, "`^&`", { style: -66 /* default font */}); - findReplace("", { font: { bold: true, italic: true } }, "***^&***", { font: { bold: false, italic: false } }); - findReplace("", { font: { italic: true } }, "*^&*", { font: { italic: false } }); - - doc.fields.toggleShowCodes(); - findReplace("^19 REF", {}, "[^&](#^&)", {}); - doc.fields.toggleShowCodes(); - - writeDocument(); - - return result; -} - -function main(args: string[]) { - if (args.length !== 1) { - sys.write("Syntax: word2md \n"); - return; - } - var app: Word.Application = sys.createObject("Word.Application"); - var doc = app.documents.open(args[0]); - sys.write(convertDocumentToMarkdown(doc)); - doc.close(false); - app.quit(); -} - -main(sys.args); diff --git a/perf/List.js b/perf/List.js index a132aa89f7..375155e46d 100644 --- a/perf/List.js +++ b/perf/List.js @@ -1,47 +1,44 @@ +/* global Immutable */ describe('List', function () { - describe('builds from array', function () { + var array2 = []; + for (var ii = 0; ii < 2; ii++) { + array2[ii] = ii; + } - var array2 = []; - for (var ii = 0; ii < 2; ii++) { - array2[ii] = ii; - } - - it('of 2', function () { - Immutable.List(array2); - }); - - var array8 = []; - for (var ii = 0; ii < 8; ii++) { - array8[ii] = ii; - } + it('of 2', function () { + Immutable.List(array2); + }); - it('of 8', function () { - Immutable.List(array8); - }); + var array8 = []; + for (var ii = 0; ii < 8; ii++) { + array8[ii] = ii; + } - var array32 = []; - for (var ii = 0; ii < 32; ii++) { - array32[ii] = ii; - } + it('of 8', function () { + Immutable.List(array8); + }); - it('of 32', function () { - Immutable.List(array32); - }); + var array32 = []; + for (var ii = 0; ii < 32; ii++) { + array32[ii] = ii; + } - var array1024 = []; - for (var ii = 0; ii < 1024; ii++) { - array1024[ii] = ii; - } + it('of 32', function () { + Immutable.List(array32); + }); - it('of 1024', function () { - Immutable.List(array1024); - }); + var array1024 = []; + for (var ii = 0; ii < 1024; ii++) { + array1024[ii] = ii; + } + it('of 1024', function () { + Immutable.List(array1024); + }); }); describe('pushes into', function () { - it('2 times', function () { var list = Immutable.List(); for (var ii = 0; ii < 2; ii++) { @@ -69,11 +66,9 @@ describe('List', function () { list = list.push(ii); } }); - }); describe('pushes into transient', function () { - it('2 times', function () { var list = Immutable.List().asMutable(); for (var ii = 0; ii < 2; ii++) { @@ -105,8 +100,15 @@ describe('List', function () { } list = list.asImmutable(); }); - }); - + describe('some', function () { + it('100 000 items', () => { + const list = Immutable.List(); + for (let i = 0; i < 100000; i++) { + list.push(i); + } + list.some((item) => item === 50000); + }); + }); }); diff --git a/perf/Map.js b/perf/Map.js index f32bf36e29..b5758c7074 100644 --- a/perf/Map.js +++ b/perf/Map.js @@ -1,13 +1,12 @@ +/* global Immutable */ describe('Map', function () { - describe('builds from an object', function () { - var obj2 = {}; for (var ii = 0; ii < 2; ii++) { obj2['x' + ii] = ii; } - it('of 2', function() { + it('of 2', function () { Immutable.Map(obj2); }); @@ -16,7 +15,7 @@ describe('Map', function () { obj8['x' + ii] = ii; } - it('of 8', function() { + it('of 8', function () { Immutable.Map(obj8); }); @@ -25,7 +24,7 @@ describe('Map', function () { obj32['x' + ii] = ii; } - it('of 32', function() { + it('of 32', function () { Immutable.Map(obj32); }); @@ -34,20 +33,18 @@ describe('Map', function () { obj1024['x' + ii] = ii; } - it('of 1024', function() { + it('of 1024', function () { Immutable.Map(obj1024); }); - }); describe('builds from an array', function () { - var array2 = []; for (var ii = 0; ii < 2; ii++) { array2[ii] = ['x' + ii, ii]; } - it('of 2', function() { + it('of 2', function () { Immutable.Map(array2); }); @@ -56,7 +53,7 @@ describe('Map', function () { array8[ii] = ['x' + ii, ii]; } - it('of 8', function() { + it('of 8', function () { Immutable.Map(array8); }); @@ -65,7 +62,7 @@ describe('Map', function () { array32[ii] = ['x' + ii, ii]; } - it('of 32', function() { + it('of 32', function () { Immutable.Map(array32); }); @@ -74,62 +71,68 @@ describe('Map', function () { array1024[ii] = ['x' + ii, ii]; } - it('of 1024', function() { + it('of 1024', function () { Immutable.Map(array1024); }); - }); describe('builds from a List', function () { - var list2 = Immutable.List().asMutable(); for (var ii = 0; ii < 2; ii++) { - list2 = list2.push( - Immutable.List(['x' + ii, ii]) - ); + list2 = list2.push(Immutable.List(['x' + ii, ii])); } list2 = list2.asImmutable(); - it('of 2', function() { + it('of 2', function () { Immutable.Map(list2); }); var list8 = Immutable.List().asMutable(); for (var ii = 0; ii < 8; ii++) { - list8 = list8.push( - Immutable.List(['x' + ii, ii]) - ); + list8 = list8.push(Immutable.List(['x' + ii, ii])); } list8 = list8.asImmutable(); - it('of 8', function() { + it('of 8', function () { Immutable.Map(list8); }); var list32 = Immutable.List().asMutable(); for (var ii = 0; ii < 32; ii++) { - list32 = list32.push( - Immutable.List(['x' + ii, ii]) - ); + list32 = list32.push(Immutable.List(['x' + ii, ii])); } list32 = list32.asImmutable(); - it('of 32', function() { + it('of 32', function () { Immutable.Map(list32); }); var list1024 = Immutable.List().asMutable(); for (var ii = 0; ii < 1024; ii++) { - list1024 = list1024.push( - Immutable.List(['x' + ii, ii]) - ); + list1024 = list1024.push(Immutable.List(['x' + ii, ii])); } list1024 = list1024.asImmutable(); - it('of 1024', function() { + it('of 1024', function () { Immutable.Map(list1024); }); - }); + describe('merge a map', () => { + [2, 8, 32, 1024].forEach((size) => { + const obj1 = {}; + const obj2 = {}; + for (let ii = 0; ii < size; ii++) { + obj1['k' + ii] = '1_' + ii; + obj2['k' + ii] = '2_' + ii; + } + + const map1 = Immutable.Map(obj1); + const map2 = Immutable.Map(obj2); + + it('of ' + size, () => { + map1.merge(map2); + }); + }); + }); }); diff --git a/perf/Record.js b/perf/Record.js new file mode 100644 index 0000000000..712c077a58 --- /dev/null +++ b/perf/Record.js @@ -0,0 +1,80 @@ +/* global Immutable */ +describe('Record', () => { + describe('builds from an object', () => { + [2, 5, 10, 100, 1000].forEach((size) => { + var defaults = {}; + var values = {}; + for (var ii = 0; ii < size; ii++) { + defaults['x' + ii] = null; + values['x' + ii] = ii; + } + + var Rec = Immutable.Record(defaults); + + it('of ' + size, () => { + Rec(values); + }); + }); + }); + + describe('update random using set()', () => { + [2, 5, 10, 100, 1000].forEach((size) => { + var defaults = {}; + var values = {}; + for (var ii = 0; ii < size; ii++) { + defaults['x' + ii] = null; + values['x' + ii] = ii; + } + + var Rec = Immutable.Record(defaults); + var rec = Rec(values); + + var key = 'x' + Math.floor(size / 2); + + it('of ' + size, () => { + rec.set(key, 999); + }); + }); + }); + + describe('access random using get()', () => { + [2, 5, 10, 100, 1000].forEach((size) => { + var defaults = {}; + var values = {}; + for (var ii = 0; ii < size; ii++) { + defaults['x' + ii] = null; + values['x' + ii] = ii; + } + + var Rec = Immutable.Record(defaults); + var rec = Rec(values); + + var key = 'x' + Math.floor(size / 2); + + it('of ' + size, () => { + rec.get(key); + }); + }); + }); + + describe('access random using property', () => { + [2, 5, 10, 100, 1000].forEach((size) => { + var defaults = {}; + var values = {}; + for (var ii = 0; ii < size; ii++) { + defaults['x' + ii] = null; + values['x' + ii] = ii; + } + + var Rec = Immutable.Record(defaults); + var rec = Rec(values); + + var key = 'x' + Math.floor(size / 2); + + it('of ' + size, () => { + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + rec[key]; + }); + }); + }); +}); diff --git a/perf/toJS.js b/perf/toJS.js new file mode 100644 index 0000000000..d924d332d8 --- /dev/null +++ b/perf/toJS.js @@ -0,0 +1,22 @@ +/* global Immutable */ +describe('toJS', () => { + const array32 = []; + for (let ii = 0; ii < 32; ii++) { + array32[ii] = ii; + } + const list = Immutable.List(array32); + + it('List of 32', () => { + Immutable.toJS(list); + }); + + const obj32 = {}; + for (let ii = 0; ii < 32; ii++) { + obj32[ii] = ii; + } + const map = Immutable.Map(obj32); + + it('Map of 32', () => { + Immutable.toJS(map); + }); +}); diff --git a/resources/COPYRIGHT b/resources/COPYRIGHT deleted file mode 100644 index 54f9e0ac13..0000000000 --- a/resources/COPYRIGHT +++ /dev/null @@ -1,8 +0,0 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ diff --git a/resources/bench.js b/resources/bench.js deleted file mode 100644 index 10370f2cc7..0000000000 --- a/resources/bench.js +++ /dev/null @@ -1,231 +0,0 @@ -var Benchmark = require('benchmark'); -var child_process = require('child_process'); -var colors = require('colors'); -var fs = require('fs'); -var path = require('path'); -var Promise = require("bluebird"); -var vm = require('vm'); - -var exec = Promise.promisify(child_process.exec); -var readdir = Promise.promisify(fs.readdir); -var readFile = Promise.promisify(fs.readFile); - -var perfDir = path.resolve(__dirname, '../perf/'); - -Promise.all([ - readFile(path.resolve(__dirname, '../dist/immutable.js'), { encoding: 'utf8' }), - exec('git show master:dist/immutable.js') -]).then(function (args) { - var newSrc = args[0]; - var oldSrc = args[1].toString({ encoding: 'utf8' }).slice(0, -1); // wtf, comma? - return newSrc === oldSrc ? [newSrc] : [newSrc, oldSrc]; -}).then(function (sources) { - return sources.map(function (source) { - var sourceExports = {}; - var sourceModule = { exports: sourceExports }; - vm.runInNewContext(source, { - require: require, - module: sourceModule, - exports: sourceExports - }, 'immutable.js'); - return sourceModule.exports; - }); -}).then(function (modules) { - return readdir(perfDir).then(function (filepaths) { - return Promise.all(filepaths.map(function (filepath) { - return readFile(path.resolve(perfDir, filepath)).then(function (source) { - return { - path: filepath, - source: source - }; - }); - })) - }).then(function (sources) { - var tests = {}; - - modules.forEach(function (Immutable, version) { - sources.forEach(function (source) { - var description = []; - var beforeStack = []; - var beforeFn; - var prevBeforeFn; - - function describe(name, fn) { - description.push(name); - beforeStack.push(prevBeforeFn); - prevBeforeFn = beforeFn; - fn(); - beforeFn = prevBeforeFn; - prevBeforeFn = beforeStack.pop(); - description.pop(); - } - - function beforeEach(fn) { - beforeFn = !prevBeforeFn ? fn : function (prevBeforeFn) { - return function () { prevBeforeFn(); fn(); }; - }(prevBeforeFn); - } - - function it(name, test) { - var fullName = description.join(' > ') + ' ' + name; - (tests[fullName] || (tests[fullName] = { - description: fullName, - tests: [] - })).tests[version] = { - before: beforeFn, - test: test - }; - } - - vm.runInNewContext(source.source, { - describe: describe, - it: it, - beforeEach: beforeEach, - console: console, - Immutable: Immutable - }, source.path); - }); - }); - - // Array<{ - // description: String, - // tests: Array<{ - // before: Function, - // test: Function - // }> // one per module, [new,old] or just [new] - // }> - return Object.keys(tests).map(function (key) { return tests[key]; }); - }); -}).then(function (tests) { - var suites = []; - - tests.forEach(function (test) { - var suite = new Benchmark.Suite(test.description, { - onStart: function (event) { - console.log(event.currentTarget.name.bold); - process.stdout.write(' ...running... '.gray); - }, - onComplete: function (event) { - process.stdout.write('\r\x1B[K'); - var stats = Array.prototype.map.call(event.currentTarget, function (target) { - return target.stats; - }); - - - function pad(n, s) { - return Array(Math.max(0, 1 + n - s.length)).join(' ') + s; - } - - function fmt(b) { - return Math.floor(b).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ','); - } - - function pct(p) { - return (Math.floor(p * 10000) / 100) + '%'; - } - - var dualRuns = stats.length === 2; - - if (dualRuns) { - - var prevMean = 1 / stats[1].mean; - var prevLow = 1 / (stats[1].mean + stats[1].deviation * 2); - var prevHigh = 1 / (stats[1].mean - stats[1].deviation * 2); - - // console.log( - // (dualRuns ? ' Old: '.bold.gray : ' ') + - // ( - // pad(9, fmt(prevLow)) + ' ' + - // pad(9, fmt(prevMean)) + ' ' + - // pad(9, fmt(prevHigh)) + ' ops/sec' - // ) - // ); - - var prevLowmoe = 1 / (stats[1].mean + stats[1].moe); - var prevHighmoe = 1 / (stats[1].mean - stats[1].moe); - - console.log( - (dualRuns ? ' Old: '.bold.gray : ' ') + - ( - pad(9, fmt(prevLowmoe)) + ' ' + - pad(9, fmt(prevMean)) + ' ' + - pad(9, fmt(prevHighmoe)) + ' ops/sec' - ) - ); - } - - var mean = 1 / stats[0].mean; - var low = 1 / (stats[0].mean + stats[0].deviation * 2); - var high = 1 / (stats[0].mean - stats[0].deviation * 2); - - // console.log( - // (dualRuns ? ' New: '.bold.gray : ' ') + - // ( - // pad(9, fmt(low)) + ' ' + - // pad(9, fmt(mean)) + ' ' + - // pad(9, fmt(high)) + ' ops/sec' - // ) - // ); - - var lowmoe = 1 / (stats[0].mean + stats[0].moe); - var highmoe = 1 / (stats[0].mean - stats[0].moe); - - console.log( - (dualRuns ? ' New: '.bold.gray : ' ') + - ( - pad(9, fmt(lowmoe)) + ' ' + - pad(9, fmt(mean)) + ' ' + - pad(9, fmt(highmoe)) + ' ops/sec' - ) - ); - - if (dualRuns) { - - var diffMean = (mean - prevMean) / prevMean; - - var comparison = event.currentTarget[1].compare(event.currentTarget[0]); - var comparison2 = event.currentTarget[0].compare(event.currentTarget[1]); - console.log(' compare: ' + comparison + ' ' + comparison2); - - console.log(' diff: ' + pct(diffMean)); - - function sq(p) { - return p * p; - } - - var rme = Math.sqrt( - (sq(stats[0].rme / 100) + sq(stats[1].rme / 100)) / 2 - ); - // console.log('rmeN: ' + stats[0].rme); - // console.log('rmeO: ' + stats[1].rme); - console.log(' rme: ' + pct(rme)); - } - - // console.log(stats); - } - }); - - test.tests.forEach(function (run) { - suite.add({ - fn: run.test, - onStart: run.before, - onCycle: run.before - }); - }); - - suites.push(suite); - }); - - var onBenchComplete; - var promise = new Promise(function (_resolve) { - onBenchComplete = _resolve; - }); - - Benchmark.invoke(suites, 'run', { onComplete: onBenchComplete }); - - return onBenchComplete; -}).then(function () { - console.log('all done'); -}).catch(function (error) { - console.log('ugh', error.stack); -}); diff --git a/resources/benchmark.js b/resources/benchmark.js new file mode 100644 index 0000000000..a2e77aa399 --- /dev/null +++ b/resources/benchmark.js @@ -0,0 +1,283 @@ +var Benchmark = require('benchmark'); +var child_process = require('child_process'); +var fs = require('fs'); +var path = require('path'); +var vm = require('vm'); + +function promisify(fn) { + return function () { + return new Promise((resolve, reject) => + fn.apply( + this, + Array.prototype.slice + .call(arguments) + .concat((err, out) => (err ? reject(err) : resolve(out))) + ) + ); + }; +} + +var exec = promisify(child_process.exec); +var readdir = promisify(fs.readdir); +var readFile = promisify(fs.readFile); + +var perfDir = path.resolve(__dirname, '../perf/'); + +Promise.all([ + readFile(path.resolve(__dirname, '../dist/immutable.js'), { + encoding: 'utf8', + }), + exec('git show main:dist/immutable.js'), +]) + .then(function (args) { + var newSrc = args[0]; + var oldSrc = args[1].toString({ encoding: 'utf8' }).slice(0, -1); // wtf, comma? + return newSrc === oldSrc ? [newSrc] : [newSrc, oldSrc]; + }) + .then(function (sources) { + return sources.map(function (source) { + var sourceExports = {}; + var sourceModule = { exports: sourceExports }; + vm.runInNewContext( + source, + { + require: require, + module: sourceModule, + exports: sourceExports, + }, + 'immutable.js' + ); + return sourceModule.exports; + }); + }) + .then(function (modules) { + return readdir(perfDir) + .then(function (filepaths) { + return Promise.all( + filepaths.map(function (filepath) { + return readFile(path.resolve(perfDir, filepath)).then( + function (source) { + return { + path: filepath, + source: source, + }; + } + ); + }) + ); + }) + .then(function (sources) { + var tests = {}; + + modules.forEach(function (Immutable, version) { + sources.forEach(function (source) { + var description = []; + var beforeStack = []; + var beforeFn; + var prevBeforeFn; + + function describe(name, fn) { + description.push(name); + beforeStack.push(prevBeforeFn); + prevBeforeFn = beforeFn; + fn(); + beforeFn = prevBeforeFn; + prevBeforeFn = beforeStack.pop(); + description.pop(); + } + + function beforeEach(fn) { + beforeFn = !prevBeforeFn + ? fn + : (function (prevBeforeFn) { + return function () { + prevBeforeFn(); + fn(); + }; + })(prevBeforeFn); + } + + function it(name, test) { + var fullName = description.join(' > ') + ' ' + name; + ( + tests[fullName] || + (tests[fullName] = { + description: fullName, + tests: [], + }) + ).tests[version] = { + before: beforeFn, + test: test, + }; + } + + vm.runInNewContext( + source.source, + { + describe: describe, + it: it, + beforeEach: beforeEach, + console: console, + Immutable: Immutable, + }, + source.path + ); + }); + }); + + // Array<{ + // description: String, + // tests: Array<{ + // before: Function, + // test: Function + // }> // one per module, [new,old] or just [new] + // }> + return Object.keys(tests).map(function (key) { + return tests[key]; + }); + }); + }) + .then(function (tests) { + var suites = []; + + tests.forEach(function (test) { + var suite = new Benchmark.Suite(test.description, { + onStart: function (event) { + console.log(event.currentTarget.name.bold); + process.stdout.write(' ...running... '.gray); + }, + onComplete: function (event) { + process.stdout.write('\r\x1B[K'); + var stats = Array.prototype.map.call( + event.currentTarget, + function (target) { + return target.stats; + } + ); + + function pad(n, s) { + return Array(Math.max(0, 1 + n - s.length)).join(' ') + s; + } + + function fmt(b) { + return Math.floor(b) + .toString() + .replace(/\B(?=(\d{3})+(?!\d))/g, ','); + } + + function pct(p) { + return Math.floor(p * 10000) / 100 + '%'; + } + + var dualRuns = stats.length === 2; + + if (dualRuns) { + var prevMean = 1 / stats[1].mean; + // var prevLow = 1 / (stats[1].mean + stats[1].deviation * 2); + // var prevHigh = 1 / (stats[1].mean - stats[1].deviation * 2); + + // console.log( + // (dualRuns ? ' Old: '.bold.gray : ' ') + + // ( + // pad(9, fmt(prevLow)) + ' ' + + // pad(9, fmt(prevMean)) + ' ' + + // pad(9, fmt(prevHigh)) + ' ops/sec' + // ) + // ); + + var prevLowmoe = 1 / (stats[1].mean + stats[1].moe); + var prevHighmoe = 1 / (stats[1].mean - stats[1].moe); + + console.log( + (dualRuns ? ' Old: '.bold.gray : ' ') + + (pad(9, fmt(prevLowmoe)) + + ' ' + + pad(9, fmt(prevMean)) + + ' ' + + pad(9, fmt(prevHighmoe)) + + ' ops/sec') + ); + } + + var mean = 1 / stats[0].mean; + // var low = 1 / (stats[0].mean + stats[0].deviation * 2); + // var high = 1 / (stats[0].mean - stats[0].deviation * 2); + + // console.log( + // (dualRuns ? ' New: '.bold.gray : ' ') + + // ( + // pad(9, fmt(low)) + ' ' + + // pad(9, fmt(mean)) + ' ' + + // pad(9, fmt(high)) + ' ops/sec' + // ) + // ); + + var lowmoe = 1 / (stats[0].mean + stats[0].moe); + var highmoe = 1 / (stats[0].mean - stats[0].moe); + + console.log( + (dualRuns ? ' New: '.bold.gray : ' ') + + (pad(9, fmt(lowmoe)) + + ' ' + + pad(9, fmt(mean)) + + ' ' + + pad(9, fmt(highmoe)) + + ' ops/sec') + ); + + if (dualRuns) { + var diffMean = (mean - prevMean) / prevMean; + + var comparison = event.currentTarget[1].compare( + event.currentTarget[0] + ); + var comparison2 = event.currentTarget[0].compare( + event.currentTarget[1] + ); + console.log(' compare: ' + comparison + ' ' + comparison2); + + console.log(' diff: ' + pct(diffMean)); + + function sq(p) { + return p * p; + } + + var rme = Math.sqrt( + (sq(stats[0].rme / 100) + sq(stats[1].rme / 100)) / 2 + ); + // console.log('rmeN: ' + stats[0].rme); + // console.log('rmeO: ' + stats[1].rme); + console.log(' rme: ' + pct(rme)); + } + + // console.log(stats); + }, + }); + + test.tests.forEach(function (run) { + suite.add({ + fn: run.test, + onStart: run.before, + onCycle: run.before, + }); + }); + + suites.push(suite); + }); + + var onBenchComplete; + // eslint-disable-next-line @typescript-eslint/no-unused-vars + var promise = new Promise(function (_resolve) { + onBenchComplete = _resolve; + }); + + Benchmark.invoke(suites, 'run', { onComplete: onBenchComplete }); + + return onBenchComplete; + }) + .then(function () { + console.log('all done'); + }) + .catch(function (error) { + console.log('ugh', error.stack); + }); diff --git a/resources/check-build-output.mjs b/resources/check-build-output.mjs new file mode 100644 index 0000000000..1cfffc5b84 --- /dev/null +++ b/resources/check-build-output.mjs @@ -0,0 +1,45 @@ +import fs from 'node:fs'; +import path from 'node:path'; + +const packageJsonContent = JSON.parse(fs.readFileSync('package.json', 'utf8')); + +// remove "dist/" prefix from the file names +const distPrefix = 'dist'; +const removeDistPrefix = (file) => path.basename(file); + +const expectedFiles = [ + removeDistPrefix(packageJsonContent.main), + removeDistPrefix(packageJsonContent.module), + removeDistPrefix(packageJsonContent.types), + + // extra files that are not in package.json + 'immutable.min.js', + 'immutable.js.flow', +]; + +console.log('expected files: ', expectedFiles); + +const filesInDistDir = fs + .readdirSync(distPrefix) + .filter((file) => !file.startsWith('.')); + +// There should be no extra files in the dist directory and all expected files should be present +const extraFiles = filesInDistDir.filter( + (file) => !expectedFiles.includes(file) +); +if (extraFiles.length > 0) { + console.error('Extra files found in dist directory:', extraFiles); +} + +const missingFiles = expectedFiles.filter( + (file) => !filesInDistDir.includes(file) +); +if (missingFiles.length > 0) { + console.error('Missing files in dist directory:', missingFiles); +} + +if (extraFiles.length > 0 || missingFiles.length > 0) { + process.exit(1); +} + +console.log('All expected files are present in the dist directory.'); diff --git a/resources/check-git-clean.sh b/resources/check-git-clean.sh new file mode 100755 index 0000000000..3ea73552f8 --- /dev/null +++ b/resources/check-git-clean.sh @@ -0,0 +1,13 @@ +#!/bin/bash -e + +if ! git diff --quiet; then echo " + +$(tput setf 4)The CI build resulted in additional changed files. +Typically this is due to not running $(tput smul)npm test$(tput rmul) locally before +submitting a pull request. + +The following changes were found:$(tput sgr0) +"; + + git diff --exit-code; +fi; diff --git a/resources/copyright.mjs b/resources/copyright.mjs new file mode 100644 index 0000000000..7323639f46 --- /dev/null +++ b/resources/copyright.mjs @@ -0,0 +1,8 @@ +import fs from 'fs'; + +const copyright = fs.readFileSync('./LICENSE', 'utf-8'); +const lines = copyright.trim().split('\n'); + +export default `/**\n * @license\n${lines + .map((line) => ` * ${line}`) + .join('\n')}\n */`; diff --git a/resources/declassify.js b/resources/declassify.js deleted file mode 100644 index e216b694a9..0000000000 --- a/resources/declassify.js +++ /dev/null @@ -1,136 +0,0 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -var acorn = require('acorn'); -var estraverse = require('estraverse'); -var MagicString = require('magic-string'); - -/** - * ES6 Class transpiler woefully lacking in features. Overwhelming priority to - * produce the smallest reasonable source code. - * - * Clowntown: - * - * * Members are assigned directly to prototype instead of defined as - * properties. - * - * * Class Expressions only work when prefixed by an export declaration - * - */ -function declassify(source) { - if (!/\bclass\b/.test(source)) { - return source; - } - - var body = new MagicString(source); - - var ast = acorn.parse(source, { - ecmaVersion: 6, - locations: true - }); - - var needsCreateClass; - var classInfo; - - estraverse.traverse(ast, { - enter: function (node) { - switch (node.type) { - case 'ExportDeclaration': - var declaration = node.declaration; - if (declaration.type === 'ClassExpression' || - declaration.type === 'ClassDeclaration') { - body.insert( - declaration.start, - node.default ? - declaration.id.name + ';' : - '{' + declaration.id.name + '};' - ); - } - break; - - case 'ClassExpression': - case 'ClassDeclaration': - var className = node.id.name; - - classInfo = { - name: className, - prev: classInfo, - }; - - var classExpr = ''; - - var hasSuper = !!node.superClass; - if (hasSuper) { - needsCreateClass = true; - var superExpr = body.slice(node.superClass.start, node.superClass.end); - classExpr += 'createClass(' + className + ', ' + superExpr + ');'; - } - - var hasConstructor = node.body.body.some(function (method) { - return method.type === 'MethodDefinition' && - method.key.name === 'constructor'; - }); - if (!hasConstructor) { - classExpr += 'function ' + className + '() {}'; - } - - body.overwrite(node.start, node.body.start, classExpr); - - // remove { } around class body - body.remove(node.body.start, node.body.start + 1); - body.remove(node.body.end - 1, node.body.end); - break; - - case 'MethodDefinition': - if (node.key.name === 'constructor') { - body.overwrite( - node.key.start, - node.key.end, - 'function ' + classInfo.name - ); - } else { - var methodName = node.key.name; - body.overwrite( - node.start, - node.key.end, - classInfo.name + (node.static ? '.' : '.prototype.') + - methodName + ' = function' - ); - body.insert(node.end, ';'); - } - break; - - case 'CallExpression': - if ( - (node.callee.type === 'Identifier' && node.callee.name === 'super') || - (node.callee.type === 'MemberExpression' && node.callee.object.name === 'super') - ) { - throw new Error('super not supported'); - } - break; - } - }, - leave: function(node) { - switch (node.type) { - case 'ClassExpression': - case 'ClassDeclaration': - classInfo = classInfo.prev; - break; - } - } - }); - - if (needsCreateClass) { - body.prepend('import createClass from "./utils/createClass"'); - } - - return body.toString(); -} - -module.exports = declassify; diff --git a/resources/dist-stats.mjs b/resources/dist-stats.mjs new file mode 100644 index 0000000000..7c6079db38 --- /dev/null +++ b/resources/dist-stats.mjs @@ -0,0 +1,92 @@ +import fs from 'node:fs/promises'; +import { deflate } from 'zlib'; +import 'colors'; + +const VERIFY_AGAINST_VERSION = '4'; + +const deflateContent = (content) => + new Promise((resolve, reject) => + deflate(content, (error, out) => (error ? reject(error) : resolve(out))) + ); + +const space = (n, s) => + new Array(Math.max(0, 10 + n - (s || '').length)).join(' ') + (s || ''); + +const bytes = (b) => + `${b.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',')} bytes`; + +const diff = (n, o) => { + const d = n - o; + return d === 0 ? '' : d < 0 ? ` ${bytes(d)}`.green : ` +${bytes(d)}`.red; +}; + +const percentage = (s, b) => ` ${Math.floor(10000 * (1 - s / b)) / 100}%`.grey; + +let bundlephobaInfoCache; + +async function bundlephobaInfo(key) { + if (!bundlephobaInfoCache) { + try { + const res = await fetch( + `https://bundlephobia.com/api/size?package=immutable@${VERIFY_AGAINST_VERSION}` + ); + + if (res.status !== 200) { + throw new Error( + `Unable to fetch bundlephobia in dist-stats.mjs. Status code is "${res.status}"` + ); + } + + bundlephobaInfoCache = await res.json(); + } catch (err) { + console.error(err.message); + + throw err; + } + } + + return bundlephobaInfoCache[key]; +} + +/** + * + * @param {PromiseFulfilledResult} promise + */ +function promiseNumberValue(promise) { + if (!promise || !promise.value) { + return null; + } + + const value = promise.value; + + return value === null || typeof value === 'number' + ? value + : Number(Buffer.byteLength(value, 'utf8')); +} + +Promise.allSettled([ + fs.readFile('dist/immutable.js'), + fs.readFile('dist/immutable.min.js'), + bundlephobaInfo('size'), + fs.readFile('dist/immutable.min.js').then(deflateContent), + bundlephobaInfo('gzip'), +]).then(([rawNew, minNew, minOld, zipNew, zipOld]) => { + console.log(` Raw: ${space(14, bytes(promiseNumberValue(rawNew)).cyan)}`); + if (minOld.status === 'fulfilled') { + console.log( + ` Min: ${space(14, bytes(promiseNumberValue(minNew)).cyan)}${percentage( + minNew.value, + rawNew.value + )}${space(15, diff(promiseNumberValue(minNew), promiseNumberValue(minOld)))}` + ); + } + + if (zipOld.status === 'fulfilled') { + console.log( + ` Zip: ${space(14, bytes(promiseNumberValue(zipNew)).cyan)}${percentage( + promiseNumberValue(zipNew), + promiseNumberValue(rawNew) + )}${space(15, diff(promiseNumberValue(zipNew), promiseNumberValue(zipOld)))}` + ); + } +}); diff --git a/resources/identity.svg b/resources/identity.svg new file mode 100644 index 0000000000..b363971cef --- /dev/null +++ b/resources/identity.svg @@ -0,0 +1,174 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/immutable-global.js b/resources/immutable-global.js deleted file mode 100644 index 1b3cbe3ec0..0000000000 --- a/resources/immutable-global.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = global.Immutable; diff --git a/resources/jest.d.ts b/resources/jest.d.ts deleted file mode 100644 index 80e8bada2c..0000000000 --- a/resources/jest.d.ts +++ /dev/null @@ -1,71 +0,0 @@ -declare var jasmine: any; - -declare function afterEach(fn: any): any; -declare function beforeEach(fn: any): any; -declare function describe(name: string, fn: any): void; -declare var it: { - (name: string, fn: any): void; - only: (name: string, fn: any) => void; -} -declare function expect(val: any): Expect; -declare var jest: Jest; -declare function pit(name: string, fn: any): void; -declare function xdescribe(name: string, fn: any): void; -declare function xit(name: string, fn: any): void; - -interface Expect { - not: Expect - toThrow(message?: string): void - toBe(value: any): void - toEqual(value: any): void - toValueEqual(value: any): void - toBeFalsy(): void - toBeTruthy(): void - toBeNull(): void - toBeUndefined(): void - toBeDefined(): void - toMatch(regexp: RegExp): void - toContain(string: string): void - toBeCloseTo(number: number, delta: number): void - toBeGreaterThan(number: number): void - toBeLessThan(number: number): void - toBeCalled(): void - toBeCalledWith(...arguments): void - lastCalledWith(...arguments): void -} - -interface Jest { - autoMockOff(): void - autoMockOn(): void - clearAllTimers(): void - dontMock(moduleName: string): void - genMockFromModule(moduleObj: Object): Object - genMockFunction(): MockFunction - genMockFn(): MockFunction - mock(moduleName: string): void - runAllTicks(): void - runAllTimers(): void - runOnlyPendingTimers(): void - setMock(moduleName: string, moduleExports: Object): void -} - -interface MockFunction { - (...arguments): any - mock: { - calls: Array> - instances: Array - } - mockClear(): void - mockImplementation(fn: Function): MockFunction - mockImpl(fn: Function): MockFunction - mockReturnThis(): MockFunction - mockReturnValue(value: any): MockFunction - mockReturnValueOnce(value: any): MockFunction -} - -// Allow importing jasmine-check -declare module 'jasmine-check' { - export function install(global?: any): void; -} -declare var check: any; -declare var gen: any; diff --git a/resources/jestPreprocessor.js b/resources/jestPreprocessor.js index 6167492445..5ea6aa5036 100644 --- a/resources/jestPreprocessor.js +++ b/resources/jestPreprocessor.js @@ -1,83 +1,71 @@ -// preprocessor.js -var fs = require('fs'); -var path = require('path'); var typescript = require('typescript'); -var react = require('react-tools'); - -var CACHE_DIR = path.join(path.resolve(__dirname + '/../build')); +const makeSynchronous = require('make-synchronous'); + +const TYPESCRIPT_OPTIONS = { + noEmitOnError: true, + target: typescript.ScriptTarget.ES2015, + module: typescript.ModuleKind.CommonJS, + strictNullChecks: true, + sourceMap: true, + inlineSourceMap: true, +}; -function isFileNewer(a, b) { - try { - return fs.statSync(a).mtime > fs.statSync(b).mtime; - } catch (ex) { - return false; - } +function transpileTypeScript(src, path) { + return typescript.transpile(src, TYPESCRIPT_OPTIONS, path, []); } -function compileTypeScript(filePath) { - var options = { - outDir: CACHE_DIR, - noEmitOnError: true, - target: typescript.ScriptTarget.ES5, - module: typescript.ModuleKind.CommonJS - }; - - // re-use cached source if possible - var outputPath = path.join(options.outDir, path.basename(filePath, '.ts')) + '.js'; - if (isFileNewer(outputPath, filePath)) { - return fs.readFileSync(outputPath, {encoding: 'utf8'}); - } - - if (fs.existsSync(outputPath)) { - fs.unlinkSync(outputPath); - } - - var host = typescript.createCompilerHost(options); - var program = typescript.createProgram([filePath], options, host); - - var diagnostics = program.getSyntacticDiagnostics(); - - if (diagnostics.length === 0) { - diagnostics = program.getGlobalDiagnostics(); - } - - if (diagnostics.length === 0) { - diagnostics = program.getSemanticDiagnostics(); - } - - if (diagnostics.length === 0) { - var emitOutput = program.emit(); - diagnostics = emitOutput.diagnostics; - } - - if (diagnostics.length === 0) { - return fs.readFileSync(outputPath, {encoding: 'utf8'}); - } +function transpileJavaScript(src, path) { + // Need to make this sync by calling `makeSynchronous` + // while https://github.com/facebook/jest/issues/9504 is not resolved + const fn = makeSynchronous(async (path) => { + const rollup = require('rollup'); + const buble = require('@rollup/plugin-buble'); + const commonjs = require('@rollup/plugin-commonjs'); + const json = require('@rollup/plugin-json'); + const typescript = require('@rollup/plugin-typescript'); + + // same input options as in rollup-config.js + const inputOptions = { + input: path, + onwarn: () => {}, + plugins: [commonjs(), json(), typescript(), buble()], + }; + + const bundle = await rollup.rollup(inputOptions); + + const { output } = await bundle.generate({ + file: path, + format: 'cjs', + sourcemap: true, + }); + + await bundle.close(); + + const { code, map } = output[0]; + + if (!code) { + throw new Error( + 'Unable to get code from rollup output in jestPreprocessor. Did rollup version changed ?' + ); + } - diagnostics.forEach(function(diagnostic) { - var loc = typescript.getLineAndCharacterOfPosition(diagnostic.file, diagnostic.start); - console.error('%s %d:%d %s', diagnostic.file.fileName, loc.line, loc.character, diagnostic.messageText); + return { code, map }; }); - throw new Error('Compiling ' + filePath + ' failed'); -} -function withLocalImmutable(filePath, jsSrc) { - return jsSrc.replace( - /require\('immutable/g, - "require('" + path.relative(path.dirname(filePath), process.cwd()) - ); + return fn(path); } module.exports = { - process: function(src, filePath) { - if (filePath.match(/\.ts$/) && !filePath.match(/\.d\.ts$/)) { - return withLocalImmutable(filePath, compileTypeScript(filePath)); + process(src, path) { + if (path.endsWith('.ts') || path.endsWith('.tsx')) { + return { code: transpileTypeScript(src, path) }; } - if (filePath.match(/\.js$/) && ~filePath.indexOf('/__tests__/')) { - return withLocalImmutable(filePath, react.transform(src, {harmony: true})); - } + return transpileJavaScript(src, path); + }, - return src; - } + getCacheKey() { + // ignore cache, as there is a conflict between rollup compile and jest preprocessor. + return Date.now().toString(); + }, }; diff --git a/resources/jestResolver.js b/resources/jestResolver.js new file mode 100644 index 0000000000..a379bc4421 --- /dev/null +++ b/resources/jestResolver.js @@ -0,0 +1,17 @@ +const path = require('path'); +const pkg = require('../package.json'); + +module.exports = (request, options) => { + if (request === 'immutable') { + if (process.env.CI) { + // In CI environment, test the real built file to be sure that the build is not broken + return path.resolve(options.rootDir, pkg.main); + } + + // In development mode, we want sourcemaps, live reload, etc., so point to the src/ directory + return `${options.rootDir}/src/Immutable.js`; + } + + // Call the defaultResolver, if we want to load non-immutable + return options.defaultResolver(request, options); +}; diff --git a/resources/node_test.sh b/resources/node_test.sh deleted file mode 100755 index a7c231a7fb..0000000000 --- a/resources/node_test.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -# bail out if anything fails -set -e - -# Run all tests using jest -if [[ $TRAVIS ]] -then jest -i # Travis tests are run inline -else jest -fi - -# Ensure documentation is not broken -gulp diff --git a/resources/prepare-dist.sh b/resources/prepare-dist.sh new file mode 100755 index 0000000000..d8d86a0573 --- /dev/null +++ b/resources/prepare-dist.sh @@ -0,0 +1,25 @@ +#!/bin/sh -e + +# This script prepares an npm directory with files safe to publish to npm or the +# npm git branch: +# +# "immutable": "git://github.com/immutable-js/immutable-js.git#npm" +# + +# Create empty npm directory +rm -rf npm +mkdir -p npm + +# Copy over necessary files +cp -r dist npm/ +cp README.md npm/ +cp LICENSE npm/ + +# Ensure a vanilla package.json before deploying so other tools do not interpret +# The built output as requiring any further transformation. +node -e "var package = require('./package.json'); \ + package = Object.fromEntries(Object.entries(package).filter(([key]) => package.publishKeys.includes(key))); \ + require('fs').writeFileSync('./npm/package.json', JSON.stringify(package, null, 2));" + +# Retain marginal support for bower on the npm branch +cp npm/package.json npm/bower.json diff --git a/resources/rollup-config.mjs b/resources/rollup-config.mjs new file mode 100644 index 0000000000..6963235c5d --- /dev/null +++ b/resources/rollup-config.mjs @@ -0,0 +1,47 @@ +import path from 'path'; +import buble from '@rollup/plugin-buble'; +import commonjs from '@rollup/plugin-commonjs'; +import json from '@rollup/plugin-json'; +import terser from '@rollup/plugin-terser'; +// TODO replace @rollup/plugin-typescript with babel after babel migration +import typescript from '@rollup/plugin-typescript'; +import copyright from './copyright.mjs'; + +const SRC_DIR = path.resolve('src'); +const DIST_DIR = path.resolve('dist'); + +export default [ + { + input: path.join(SRC_DIR, 'Immutable.js'), + plugins: [commonjs(), json(), typescript(), buble()], + output: [ + // umd build + { + banner: copyright, + name: 'Immutable', + exports: 'named', + file: path.join(DIST_DIR, 'immutable.js'), + format: 'umd', + sourcemap: false, + }, + // minified build for browsers + { + banner: copyright, + name: 'Immutable', + exports: 'named', + file: path.join(DIST_DIR, 'immutable.min.js'), + format: 'umd', + sourcemap: false, + plugins: [terser()], + }, + // es build for bundlers and node + { + banner: copyright, + name: 'Immutable', + file: path.join(DIST_DIR, 'immutable.es.js'), + format: 'es', + sourcemap: false, + }, + ], + }, +]; diff --git a/resources/stripCopyright.js b/resources/stripCopyright.js deleted file mode 100644 index 39ba85defc..0000000000 --- a/resources/stripCopyright.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -var fs = require('fs'); - -function stripCopyright(source) { - var copyright = getCopyright(); - var position = source.indexOf(copyright); - if (position === -1) { - return source; - } - return source.slice(0, position) + source.slice(position + copyright.length); -} - -var _copyright; -function getCopyright() { - return _copyright || (_copyright = fs.readFileSync('resources/COPYRIGHT')); -} - -module.exports = stripCopyright; diff --git a/src/Collection.js b/src/Collection.js index a24ee4229c..650ff654ff 100644 --- a/src/Collection.js +++ b/src/Collection.js @@ -1,27 +1,36 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -import { Iterable } from './Iterable' - - -export class Collection extends Iterable { - constructor() { - throw TypeError('Abstract'); +import { Seq, KeyedSeq, IndexedSeq, SetSeq } from './Seq'; +import { isCollection } from './predicates/isCollection'; +import { isKeyed } from './predicates/isKeyed'; +import { isIndexed } from './predicates/isIndexed'; +import { isAssociative } from './predicates/isAssociative'; + +export class Collection { + constructor(value) { + // eslint-disable-next-line no-constructor-return + return isCollection(value) ? value : Seq(value); } } -export class KeyedCollection extends Collection {} - -export class IndexedCollection extends Collection {} +export class KeyedCollection extends Collection { + constructor(value) { + // eslint-disable-next-line no-constructor-return + return isKeyed(value) ? value : KeyedSeq(value); + } +} -export class SetCollection extends Collection {} +export class IndexedCollection extends Collection { + constructor(value) { + // eslint-disable-next-line no-constructor-return + return isIndexed(value) ? value : IndexedSeq(value); + } +} +export class SetCollection extends Collection { + constructor(value) { + // eslint-disable-next-line no-constructor-return + return isCollection(value) && !isAssociative(value) ? value : SetSeq(value); + } +} Collection.Keyed = KeyedCollection; Collection.Indexed = IndexedCollection; diff --git a/src/CollectionImpl.js b/src/CollectionImpl.js new file mode 100644 index 0000000000..befb3dadc2 --- /dev/null +++ b/src/CollectionImpl.js @@ -0,0 +1,789 @@ +import { + Collection, + KeyedCollection, + IndexedCollection, + SetCollection, +} from './Collection'; +import { IS_COLLECTION_SYMBOL } from './predicates/isCollection'; +import { isKeyed, IS_KEYED_SYMBOL } from './predicates/isKeyed'; +import { isIndexed, IS_INDEXED_SYMBOL } from './predicates/isIndexed'; +import { isOrdered, IS_ORDERED_SYMBOL } from './predicates/isOrdered'; +import { is } from './is'; +import { + NOT_SET, + ensureSize, + wrapIndex, + returnTrue, + resolveBegin, +} from './TrieUtils'; +import { hash } from './Hash'; +import { imul, smi } from './Math'; +import { + Iterator, + ITERATOR_SYMBOL, + ITERATE_KEYS, + ITERATE_VALUES, + ITERATE_ENTRIES, +} from './Iterator'; + +import arrCopy from './utils/arrCopy'; +import assertNotInfinite from './utils/assertNotInfinite'; +import deepEqual from './utils/deepEqual'; +import mixin from './utils/mixin'; +import quoteString from './utils/quoteString'; + +import { toJS } from './toJS'; +import { Map } from './Map'; +import { OrderedMap } from './OrderedMap'; +import { List } from './List'; +import { Set } from './Set'; +import { OrderedSet } from './OrderedSet'; +import { Stack } from './Stack'; +import { Range } from './Range'; +import { KeyedSeq, IndexedSeq, SetSeq, ArraySeq } from './Seq'; +import { + reify, + ToKeyedSequence, + ToIndexedSequence, + ToSetSequence, + FromEntriesSequence, + flipFactory, + mapFactory, + reverseFactory, + filterFactory, + countByFactory, + groupByFactory, + sliceFactory, + takeWhileFactory, + skipWhileFactory, + concatFactory, + flattenFactory, + flatMapFactory, + interposeFactory, + sortFactory, + maxFactory, + zipWithFactory, + partitionFactory, +} from './Operations'; +import { getIn } from './methods/getIn'; +import { hasIn } from './methods/hasIn'; +import { toObject } from './methods/toObject'; + +export { Collection, CollectionPrototype, IndexedCollectionPrototype }; + +Collection.Iterator = Iterator; + +mixin(Collection, { + // ### Conversion to other types + + toArray() { + assertNotInfinite(this.size); + const array = new Array(this.size || 0); + const useTuples = isKeyed(this); + let i = 0; + this.__iterate((v, k) => { + // Keyed collections produce an array of tuples. + array[i++] = useTuples ? [k, v] : v; + }); + return array; + }, + + toIndexedSeq() { + return new ToIndexedSequence(this); + }, + + toJS() { + return toJS(this); + }, + + toKeyedSeq() { + return new ToKeyedSequence(this, true); + }, + + toMap() { + // Use Late Binding here to solve the circular dependency. + return Map(this.toKeyedSeq()); + }, + + toObject: toObject, + + toOrderedMap() { + // Use Late Binding here to solve the circular dependency. + return OrderedMap(this.toKeyedSeq()); + }, + + toOrderedSet() { + // Use Late Binding here to solve the circular dependency. + return OrderedSet(isKeyed(this) ? this.valueSeq() : this); + }, + + toSet() { + // Use Late Binding here to solve the circular dependency. + return Set(isKeyed(this) ? this.valueSeq() : this); + }, + + toSetSeq() { + return new ToSetSequence(this); + }, + + toSeq() { + return isIndexed(this) + ? this.toIndexedSeq() + : isKeyed(this) + ? this.toKeyedSeq() + : this.toSetSeq(); + }, + + toStack() { + // Use Late Binding here to solve the circular dependency. + return Stack(isKeyed(this) ? this.valueSeq() : this); + }, + + toList() { + // Use Late Binding here to solve the circular dependency. + return List(isKeyed(this) ? this.valueSeq() : this); + }, + + // ### Common JavaScript methods and properties + + toString() { + return '[Collection]'; + }, + + __toString(head, tail) { + if (this.size === 0) { + return head + tail; + } + return ( + head + + ' ' + + this.toSeq().map(this.__toStringMapper).join(', ') + + ' ' + + tail + ); + }, + + // ### ES6 Collection methods (ES6 Array and Map) + + concat(...values) { + return reify(this, concatFactory(this, values)); + }, + + includes(searchValue) { + return this.some((value) => is(value, searchValue)); + }, + + entries() { + return this.__iterator(ITERATE_ENTRIES); + }, + + every(predicate, context) { + assertNotInfinite(this.size); + let returnValue = true; + this.__iterate((v, k, c) => { + if (!predicate.call(context, v, k, c)) { + returnValue = false; + return false; + } + }); + return returnValue; + }, + + filter(predicate, context) { + return reify(this, filterFactory(this, predicate, context, true)); + }, + + partition(predicate, context) { + return partitionFactory(this, predicate, context); + }, + + find(predicate, context, notSetValue) { + const entry = this.findEntry(predicate, context); + return entry ? entry[1] : notSetValue; + }, + + forEach(sideEffect, context) { + assertNotInfinite(this.size); + return this.__iterate(context ? sideEffect.bind(context) : sideEffect); + }, + + join(separator) { + assertNotInfinite(this.size); + separator = separator !== undefined ? '' + separator : ','; + let joined = ''; + let isFirst = true; + this.__iterate((v) => { + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + isFirst ? (isFirst = false) : (joined += separator); + joined += v !== null && v !== undefined ? v.toString() : ''; + }); + return joined; + }, + + keys() { + return this.__iterator(ITERATE_KEYS); + }, + + map(mapper, context) { + return reify(this, mapFactory(this, mapper, context)); + }, + + reduce(reducer, initialReduction, context) { + return reduce( + this, + reducer, + initialReduction, + context, + arguments.length < 2, + false + ); + }, + + reduceRight(reducer, initialReduction, context) { + return reduce( + this, + reducer, + initialReduction, + context, + arguments.length < 2, + true + ); + }, + + reverse() { + return reify(this, reverseFactory(this, true)); + }, + + slice(begin, end) { + return reify(this, sliceFactory(this, begin, end, true)); + }, + + some(predicate, context) { + assertNotInfinite(this.size); + let returnValue = false; + this.__iterate((v, k, c) => { + if (predicate.call(context, v, k, c)) { + returnValue = true; + return false; + } + }); + return returnValue; + }, + + sort(comparator) { + return reify(this, sortFactory(this, comparator)); + }, + + values() { + return this.__iterator(ITERATE_VALUES); + }, + + // ### More sequential methods + + butLast() { + return this.slice(0, -1); + }, + + isEmpty() { + return this.size !== undefined ? this.size === 0 : !this.some(() => true); + }, + + count(predicate, context) { + return ensureSize( + predicate ? this.toSeq().filter(predicate, context) : this + ); + }, + + countBy(grouper, context) { + return countByFactory(this, grouper, context); + }, + + equals(other) { + return deepEqual(this, other); + }, + + entrySeq() { + // eslint-disable-next-line @typescript-eslint/no-this-alias + const collection = this; + if (collection._cache) { + // We cache as an entries array, so we can just return the cache! + return new ArraySeq(collection._cache); + } + const entriesSequence = collection.toSeq().map(entryMapper).toIndexedSeq(); + entriesSequence.fromEntrySeq = () => collection.toSeq(); + return entriesSequence; + }, + + filterNot(predicate, context) { + return this.filter(not(predicate), context); + }, + + findEntry(predicate, context, notSetValue) { + let found = notSetValue; + this.__iterate((v, k, c) => { + if (predicate.call(context, v, k, c)) { + found = [k, v]; + return false; + } + }); + return found; + }, + + findKey(predicate, context) { + const entry = this.findEntry(predicate, context); + return entry && entry[0]; + }, + + findLast(predicate, context, notSetValue) { + return this.toKeyedSeq().reverse().find(predicate, context, notSetValue); + }, + + findLastEntry(predicate, context, notSetValue) { + return this.toKeyedSeq() + .reverse() + .findEntry(predicate, context, notSetValue); + }, + + findLastKey(predicate, context) { + return this.toKeyedSeq().reverse().findKey(predicate, context); + }, + + first(notSetValue) { + return this.find(returnTrue, null, notSetValue); + }, + + flatMap(mapper, context) { + return reify(this, flatMapFactory(this, mapper, context)); + }, + + flatten(depth) { + return reify(this, flattenFactory(this, depth, true)); + }, + + fromEntrySeq() { + return new FromEntriesSequence(this); + }, + + get(searchKey, notSetValue) { + return this.find((_, key) => is(key, searchKey), undefined, notSetValue); + }, + + getIn: getIn, + + groupBy(grouper, context) { + return groupByFactory(this, grouper, context); + }, + + has(searchKey) { + return this.get(searchKey, NOT_SET) !== NOT_SET; + }, + + hasIn: hasIn, + + isSubset(iter) { + iter = typeof iter.includes === 'function' ? iter : Collection(iter); + return this.every((value) => iter.includes(value)); + }, + + isSuperset(iter) { + iter = typeof iter.isSubset === 'function' ? iter : Collection(iter); + return iter.isSubset(this); + }, + + keyOf(searchValue) { + return this.findKey((value) => is(value, searchValue)); + }, + + keySeq() { + return this.toSeq().map(keyMapper).toIndexedSeq(); + }, + + last(notSetValue) { + return this.toSeq().reverse().first(notSetValue); + }, + + lastKeyOf(searchValue) { + return this.toKeyedSeq().reverse().keyOf(searchValue); + }, + + max(comparator) { + return maxFactory(this, comparator); + }, + + maxBy(mapper, comparator) { + return maxFactory(this, comparator, mapper); + }, + + min(comparator) { + return maxFactory( + this, + comparator ? neg(comparator) : defaultNegComparator + ); + }, + + minBy(mapper, comparator) { + return maxFactory( + this, + comparator ? neg(comparator) : defaultNegComparator, + mapper + ); + }, + + rest() { + return this.slice(1); + }, + + skip(amount) { + return amount === 0 ? this : this.slice(Math.max(0, amount)); + }, + + skipLast(amount) { + return amount === 0 ? this : this.slice(0, -Math.max(0, amount)); + }, + + skipWhile(predicate, context) { + return reify(this, skipWhileFactory(this, predicate, context, true)); + }, + + skipUntil(predicate, context) { + return this.skipWhile(not(predicate), context); + }, + + sortBy(mapper, comparator) { + return reify(this, sortFactory(this, comparator, mapper)); + }, + + take(amount) { + return this.slice(0, Math.max(0, amount)); + }, + + takeLast(amount) { + return this.slice(-Math.max(0, amount)); + }, + + takeWhile(predicate, context) { + return reify(this, takeWhileFactory(this, predicate, context)); + }, + + takeUntil(predicate, context) { + return this.takeWhile(not(predicate), context); + }, + + update(fn) { + return fn(this); + }, + + valueSeq() { + return this.toIndexedSeq(); + }, + + // ### Hashable Object + + hashCode() { + return this.__hash || (this.__hash = hashCollection(this)); + }, + + // ### Internal + + // abstract __iterate(fn, reverse) + + // abstract __iterator(type, reverse) +}); + +const CollectionPrototype = Collection.prototype; +CollectionPrototype[IS_COLLECTION_SYMBOL] = true; +CollectionPrototype[ITERATOR_SYMBOL] = CollectionPrototype.values; +CollectionPrototype.toJSON = CollectionPrototype.toArray; +CollectionPrototype.__toStringMapper = quoteString; +CollectionPrototype.inspect = CollectionPrototype.toSource = function () { + return this.toString(); +}; +CollectionPrototype.chain = CollectionPrototype.flatMap; +CollectionPrototype.contains = CollectionPrototype.includes; + +mixin(KeyedCollection, { + // ### More sequential methods + + flip() { + return reify(this, flipFactory(this)); + }, + + mapEntries(mapper, context) { + let iterations = 0; + return reify( + this, + this.toSeq() + .map((v, k) => mapper.call(context, [k, v], iterations++, this)) + .fromEntrySeq() + ); + }, + + mapKeys(mapper, context) { + return reify( + this, + this.toSeq() + .flip() + .map((k, v) => mapper.call(context, k, v, this)) + .flip() + ); + }, +}); + +const KeyedCollectionPrototype = KeyedCollection.prototype; +KeyedCollectionPrototype[IS_KEYED_SYMBOL] = true; +KeyedCollectionPrototype[ITERATOR_SYMBOL] = CollectionPrototype.entries; +KeyedCollectionPrototype.toJSON = toObject; +KeyedCollectionPrototype.__toStringMapper = (v, k) => + quoteString(k) + ': ' + quoteString(v); + +mixin(IndexedCollection, { + // ### Conversion to other types + + toKeyedSeq() { + return new ToKeyedSequence(this, false); + }, + + // ### ES6 Collection methods (ES6 Array and Map) + + filter(predicate, context) { + return reify(this, filterFactory(this, predicate, context, false)); + }, + + findIndex(predicate, context) { + const entry = this.findEntry(predicate, context); + return entry ? entry[0] : -1; + }, + + indexOf(searchValue) { + const key = this.keyOf(searchValue); + return key === undefined ? -1 : key; + }, + + lastIndexOf(searchValue) { + const key = this.lastKeyOf(searchValue); + return key === undefined ? -1 : key; + }, + + reverse() { + return reify(this, reverseFactory(this, false)); + }, + + slice(begin, end) { + return reify(this, sliceFactory(this, begin, end, false)); + }, + + splice(index, removeNum /*, ...values*/) { + const numArgs = arguments.length; + removeNum = Math.max(removeNum || 0, 0); + if (numArgs === 0 || (numArgs === 2 && !removeNum)) { + return this; + } + // If index is negative, it should resolve relative to the size of the + // collection. However size may be expensive to compute if not cached, so + // only call count() if the number is in fact negative. + index = resolveBegin(index, index < 0 ? this.count() : this.size); + const spliced = this.slice(0, index); + return reify( + this, + numArgs === 1 + ? spliced + : spliced.concat(arrCopy(arguments, 2), this.slice(index + removeNum)) + ); + }, + + // ### More collection methods + + findLastIndex(predicate, context) { + const entry = this.findLastEntry(predicate, context); + return entry ? entry[0] : -1; + }, + + first(notSetValue) { + return this.get(0, notSetValue); + }, + + flatten(depth) { + return reify(this, flattenFactory(this, depth, false)); + }, + + get(index, notSetValue) { + index = wrapIndex(this, index); + return index < 0 || + this.size === Infinity || + (this.size !== undefined && index > this.size) + ? notSetValue + : this.find((_, key) => key === index, undefined, notSetValue); + }, + + has(index) { + index = wrapIndex(this, index); + return ( + index >= 0 && + (this.size !== undefined + ? this.size === Infinity || index < this.size + : this.indexOf(index) !== -1) + ); + }, + + interpose(separator) { + return reify(this, interposeFactory(this, separator)); + }, + + interleave(/*...collections*/) { + const collections = [this].concat(arrCopy(arguments)); + const zipped = zipWithFactory(this.toSeq(), IndexedSeq.of, collections); + const interleaved = zipped.flatten(true); + if (zipped.size) { + interleaved.size = zipped.size * collections.length; + } + return reify(this, interleaved); + }, + + keySeq() { + return Range(0, this.size); + }, + + last(notSetValue) { + return this.get(-1, notSetValue); + }, + + skipWhile(predicate, context) { + return reify(this, skipWhileFactory(this, predicate, context, false)); + }, + + zip(/*, ...collections */) { + const collections = [this].concat(arrCopy(arguments)); + return reify(this, zipWithFactory(this, defaultZipper, collections)); + }, + + zipAll(/*, ...collections */) { + const collections = [this].concat(arrCopy(arguments)); + return reify(this, zipWithFactory(this, defaultZipper, collections, true)); + }, + + zipWith(zipper /*, ...collections */) { + const collections = arrCopy(arguments); + collections[0] = this; + return reify(this, zipWithFactory(this, zipper, collections)); + }, +}); + +const IndexedCollectionPrototype = IndexedCollection.prototype; +IndexedCollectionPrototype[IS_INDEXED_SYMBOL] = true; +IndexedCollectionPrototype[IS_ORDERED_SYMBOL] = true; + +mixin(SetCollection, { + // ### ES6 Collection methods (ES6 Array and Map) + + get(value, notSetValue) { + return this.has(value) ? value : notSetValue; + }, + + includes(value) { + return this.has(value); + }, + + // ### More sequential methods + + keySeq() { + return this.valueSeq(); + }, +}); + +const SetCollectionPrototype = SetCollection.prototype; +SetCollectionPrototype.has = CollectionPrototype.includes; +SetCollectionPrototype.contains = SetCollectionPrototype.includes; +SetCollectionPrototype.keys = SetCollectionPrototype.values; + +// Mixin subclasses + +mixin(KeyedSeq, KeyedCollectionPrototype); +mixin(IndexedSeq, IndexedCollectionPrototype); +mixin(SetSeq, SetCollectionPrototype); + +// #pragma Helper functions + +function reduce(collection, reducer, reduction, context, useFirst, reverse) { + assertNotInfinite(collection.size); + collection.__iterate((v, k, c) => { + if (useFirst) { + useFirst = false; + reduction = v; + } else { + reduction = reducer.call(context, reduction, v, k, c); + } + }, reverse); + return reduction; +} + +function keyMapper(v, k) { + return k; +} + +function entryMapper(v, k) { + return [k, v]; +} + +function not(predicate) { + return function () { + return !predicate.apply(this, arguments); + }; +} + +function neg(predicate) { + return function () { + return -predicate.apply(this, arguments); + }; +} + +function defaultZipper() { + return arrCopy(arguments); +} + +function defaultNegComparator(a, b) { + return a < b ? 1 : a > b ? -1 : 0; +} + +function hashCollection(collection) { + if (collection.size === Infinity) { + return 0; + } + const ordered = isOrdered(collection); + const keyed = isKeyed(collection); + let h = ordered ? 1 : 0; + + collection.__iterate( + keyed + ? ordered + ? (v, k) => { + h = (31 * h + hashMerge(hash(v), hash(k))) | 0; + } + : (v, k) => { + h = (h + hashMerge(hash(v), hash(k))) | 0; + } + : ordered + ? (v) => { + h = (31 * h + hash(v)) | 0; + } + : (v) => { + h = (h + hash(v)) | 0; + } + ); + + return murmurHashOfSize(collection.size, h); +} + +function murmurHashOfSize(size, h) { + h = imul(h, 0xcc9e2d51); + h = imul((h << 15) | (h >>> -15), 0x1b873593); + h = imul((h << 13) | (h >>> -13), 5); + h = ((h + 0xe6546b64) | 0) ^ size; + h = imul(h ^ (h >>> 16), 0x85ebca6b); + h = imul(h ^ (h >>> 13), 0xc2b2ae35); + h = smi(h ^ (h >>> 16)); + return h; +} + +function hashMerge(a, b) { + return (a ^ (b + 0x9e3779b9 + (a << 6) + (a >> 2))) | 0; // int +} diff --git a/src/Hash.js b/src/Hash.js index 14f3803d50..d1c65f7978 100644 --- a/src/Hash.js +++ b/src/Hash.js @@ -1,69 +1,82 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +import { smi } from './Math'; -import { smi } from './Math' +const defaultValueOf = Object.prototype.valueOf; export function hash(o) { - if (o === false || o === null || o === undefined) { - return 0; - } - if (typeof o.valueOf === 'function') { - o = o.valueOf(); - if (o === false || o === null || o === undefined) { - return 0; - } - } - if (o === true) { - return 1; - } - var type = typeof o; - if (type === 'number') { - if (o !== o || o === Infinity) { - return 0; - } - var h = o | 0; - if (h !== o) { - h ^= o * 0xFFFFFFFF; - } - while (o > 0xFFFFFFFF) { - o /= 0xFFFFFFFF; - h ^= o; - } - return smi(h); - } - if (type === 'string') { - return o.length > STRING_HASH_CACHE_MIN_STRLEN ? cachedHashString(o) : hashString(o); + // eslint-disable-next-line eqeqeq + if (o == null) { + return hashNullish(o); } + if (typeof o.hashCode === 'function') { - return o.hashCode(); + // Drop any high bits from accidentally long hash codes. + return smi(o.hashCode(o)); + } + + const v = valueOf(o); + + // eslint-disable-next-line eqeqeq + if (v == null) { + return hashNullish(v); + } + + switch (typeof v) { + case 'boolean': + // The hash values for built-in constants are a 1 value for each 5-byte + // shift region expect for the first, which encodes the value. This + // reduces the odds of a hash collision for these common values. + return v ? 0x42108421 : 0x42108420; + case 'number': + return hashNumber(v); + case 'string': + return v.length > STRING_HASH_CACHE_MIN_STRLEN + ? cachedHashString(v) + : hashString(v); + case 'object': + case 'function': + return hashJSObj(v); + case 'symbol': + return hashSymbol(v); + default: + if (typeof v.toString === 'function') { + return hashString(v.toString()); + } + throw new Error('Value type ' + typeof v + ' cannot be hashed.'); + } +} + +function hashNullish(nullish) { + return nullish === null ? 0x42108422 : /* undefined */ 0x42108423; +} + +// Compress arbitrarily large numbers into smi hashes. +function hashNumber(n) { + if (n !== n || n === Infinity) { + return 0; } - if (type === 'object') { - return hashJSObj(o); + let hash = n | 0; + if (hash !== n) { + hash ^= n * 0xffffffff; } - if (typeof o.toString === 'function') { - return hashString(o.toString()); + while (n > 0xffffffff) { + n /= 0xffffffff; + hash ^= n; } - throw new Error('Value type ' + type + ' cannot be hashed.'); + return smi(hash); } function cachedHashString(string) { - var hash = stringHashCache[string]; - if (hash === undefined) { - hash = hashString(string); + let hashed = stringHashCache[string]; + if (hashed === undefined) { + hashed = hashString(string); if (STRING_HASH_CACHE_SIZE === STRING_HASH_CACHE_MAX_SIZE) { STRING_HASH_CACHE_SIZE = 0; stringHashCache = {}; } STRING_HASH_CACHE_SIZE++; - stringHashCache[string] = hash; + stringHashCache[string] = hashed; } - return hash; + return hashed; } // http://jsperf.com/hashing-strings @@ -74,90 +87,106 @@ function hashString(string) { // where s[i] is the ith character of the string and n is the length of // the string. We "mod" the result to make it between 0 (inclusive) and 2^31 // (exclusive) by dropping high bits. - var hash = 0; - for (var ii = 0; ii < string.length; ii++) { - hash = 31 * hash + string.charCodeAt(ii) | 0; + let hashed = 0; + for (let ii = 0; ii < string.length; ii++) { + hashed = (31 * hashed + string.charCodeAt(ii)) | 0; } - return smi(hash); + return smi(hashed); +} + +function hashSymbol(sym) { + let hashed = symbolMap[sym]; + if (hashed !== undefined) { + return hashed; + } + + hashed = nextHash(); + + symbolMap[sym] = hashed; + + return hashed; } function hashJSObj(obj) { - var hash; + let hashed; if (usingWeakMap) { - hash = weakMap.get(obj); - if (hash !== undefined) { - return hash; + hashed = weakMap.get(obj); + if (hashed !== undefined) { + return hashed; } } - hash = obj[UID_HASH_KEY]; - if (hash !== undefined) { - return hash; + hashed = obj[UID_HASH_KEY]; + if (hashed !== undefined) { + return hashed; } if (!canDefineProperty) { - hash = obj.propertyIsEnumerable && obj.propertyIsEnumerable[UID_HASH_KEY]; - if (hash !== undefined) { - return hash; + hashed = obj.propertyIsEnumerable && obj.propertyIsEnumerable[UID_HASH_KEY]; + if (hashed !== undefined) { + return hashed; } - hash = getIENodeHash(obj); - if (hash !== undefined) { - return hash; + hashed = getIENodeHash(obj); + if (hashed !== undefined) { + return hashed; } } - hash = ++objHashUID; - if (objHashUID & 0x40000000) { - objHashUID = 0; - } + hashed = nextHash(); if (usingWeakMap) { - weakMap.set(obj, hash); + weakMap.set(obj, hashed); } else if (isExtensible !== undefined && isExtensible(obj) === false) { throw new Error('Non-extensible objects are not allowed as keys.'); } else if (canDefineProperty) { Object.defineProperty(obj, UID_HASH_KEY, { - 'enumerable': false, - 'configurable': false, - 'writable': false, - 'value': hash + enumerable: false, + configurable: false, + writable: false, + value: hashed, }); - } else if (obj.propertyIsEnumerable !== undefined && - obj.propertyIsEnumerable === obj.constructor.prototype.propertyIsEnumerable) { + } else if ( + obj.propertyIsEnumerable !== undefined && + obj.propertyIsEnumerable === obj.constructor.prototype.propertyIsEnumerable + ) { // Since we can't define a non-enumerable property on the object // we'll hijack one of the less-used non-enumerable properties to // save our hash on it. Since this is a function it will not show up in // `JSON.stringify` which is what we want. - obj.propertyIsEnumerable = function() { - return this.constructor.prototype.propertyIsEnumerable.apply(this, arguments); + obj.propertyIsEnumerable = function () { + return this.constructor.prototype.propertyIsEnumerable.apply( + this, + arguments + ); }; - obj.propertyIsEnumerable[UID_HASH_KEY] = hash; + obj.propertyIsEnumerable[UID_HASH_KEY] = hashed; } else if (obj.nodeType !== undefined) { // At this point we couldn't get the IE `uniqueID` to use as a hash // and we couldn't use a non-enumerable property to exploit the // dontEnum bug so we simply add the `UID_HASH_KEY` on the node // itself. - obj[UID_HASH_KEY] = hash; + obj[UID_HASH_KEY] = hashed; } else { throw new Error('Unable to set a non-enumerable property on object.'); } - return hash; + return hashed; } // Get references to ES5 object methods. -var isExtensible = Object.isExtensible; +const isExtensible = Object.isExtensible; // True if Object.defineProperty works as expected. IE8 fails this test. -var canDefineProperty = (function() { +const canDefineProperty = (function () { try { Object.defineProperty({}, '@', {}); return true; + // eslint-disable-next-line @typescript-eslint/no-unused-vars } catch (e) { return false; } -}()); +})(); // IE has a `uniqueID` property on DOM nodes. We can construct the hash from it // and avoid memory leaks from the IE cloneNode bug. @@ -172,21 +201,37 @@ function getIENodeHash(node) { } } +function valueOf(obj) { + return obj.valueOf !== defaultValueOf && typeof obj.valueOf === 'function' + ? obj.valueOf(obj) + : obj; +} + +function nextHash() { + const nextHash = ++_objHashUID; + if (_objHashUID & 0x40000000) { + _objHashUID = 0; + } + return nextHash; +} + // If possible, use a WeakMap. -var usingWeakMap = typeof WeakMap === 'function'; -var weakMap; +const usingWeakMap = typeof WeakMap === 'function'; +let weakMap; if (usingWeakMap) { weakMap = new WeakMap(); } -var objHashUID = 0; +const symbolMap = Object.create(null); + +let _objHashUID = 0; -var UID_HASH_KEY = '__immutablehash__'; +let UID_HASH_KEY = '__immutablehash__'; if (typeof Symbol === 'function') { UID_HASH_KEY = Symbol(UID_HASH_KEY); } -var STRING_HASH_CACHE_MIN_STRLEN = 16; -var STRING_HASH_CACHE_MAX_SIZE = 255; -var STRING_HASH_CACHE_SIZE = 0; -var stringHashCache = {}; +const STRING_HASH_CACHE_MIN_STRLEN = 16; +const STRING_HASH_CACHE_MAX_SIZE = 255; +let STRING_HASH_CACHE_SIZE = 0; +let stringHashCache = {}; diff --git a/src/Immutable.js b/src/Immutable.js index 2754f0cbad..98945f762e 100644 --- a/src/Immutable.js +++ b/src/Immutable.js @@ -1,46 +1,103 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +import { Seq } from './Seq'; +import { OrderedMap } from './OrderedMap'; +import { List } from './List'; +import { Map } from './Map'; +import { Stack } from './Stack'; +import { OrderedSet } from './OrderedSet'; +import { PairSorting } from './PairSorting'; +import { Set } from './Set'; +import { Record } from './Record'; +import { Range } from './Range'; +import { Repeat } from './Repeat'; +import { is } from './is'; +import { fromJS } from './fromJS'; -import { Seq } from './Seq' -import { Collection } from './Collection' -import { OrderedMap } from './OrderedMap' -import { List } from './List' -import { Map } from './Map' -import { Stack } from './Stack' -import { OrderedSet } from './OrderedSet' -import { Set } from './Set' -import { Record } from './Record' -import { Range } from './Range' -import { Repeat } from './Repeat' -import { is } from './is' -import { fromJS } from './fromJS' -import { Iterable } from './IterableImpl' +import isPlainObject from './utils/isPlainObj'; +// Functional predicates +import { isImmutable } from './predicates/isImmutable'; +import { isCollection } from './predicates/isCollection'; +import { isKeyed } from './predicates/isKeyed'; +import { isIndexed } from './predicates/isIndexed'; +import { isAssociative } from './predicates/isAssociative'; +import { isOrdered } from './predicates/isOrdered'; +import { isValueObject } from './predicates/isValueObject'; +import { isSeq } from './predicates/isSeq'; +import { isList } from './predicates/isList'; +import { isMap } from './predicates/isMap'; +import { isOrderedMap } from './predicates/isOrderedMap'; +import { isStack } from './predicates/isStack'; +import { isSet } from './predicates/isSet'; +import { isOrderedSet } from './predicates/isOrderedSet'; +import { isRecord } from './predicates/isRecord'; -export default { +import { Collection } from './CollectionImpl'; +import { hash } from './Hash'; - Iterable: Iterable, +// Functional read/write API +import { get } from './functional/get'; +import { getIn } from './functional/getIn'; +import { has } from './functional/has'; +import { hasIn } from './functional/hasIn'; +import { merge, mergeDeep, mergeWith, mergeDeepWith } from './functional/merge'; +import { remove } from './functional/remove'; +import { removeIn } from './functional/removeIn'; +import { set } from './functional/set'; +import { setIn } from './functional/setIn'; +import { update } from './functional/update'; +import { updateIn } from './functional/updateIn'; - Seq: Seq, - Collection: Collection, - Map: Map, - OrderedMap: OrderedMap, - List: List, - Stack: Stack, - Set: Set, - OrderedSet: OrderedSet, +import { version } from '../package.json'; - Record: Record, - Range: Range, - Repeat: Repeat, - - is: is, - fromJS: fromJS +// Note: Iterable is deprecated +const Iterable = Collection; +export { + version, + Collection, + Iterable, + Seq, + Map, + OrderedMap, + List, + Stack, + Set, + OrderedSet, + PairSorting, + Record, + Range, + Repeat, + is, + fromJS, + hash, + isImmutable, + isCollection, + isKeyed, + isIndexed, + isAssociative, + isOrdered, + isPlainObject, + isValueObject, + isSeq, + isList, + isMap, + isOrderedMap, + isStack, + isSet, + isOrderedSet, + isRecord, + get, + getIn, + has, + hasIn, + merge, + mergeDeep, + mergeWith, + mergeDeepWith, + remove, + removeIn, + set, + setIn, + update, + updateIn, }; diff --git a/src/Iterable.js b/src/Iterable.js deleted file mode 100644 index f856a03e41..0000000000 --- a/src/Iterable.js +++ /dev/null @@ -1,72 +0,0 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -import { Seq, KeyedSeq, IndexedSeq, SetSeq } from './Seq' - - -export class Iterable { - constructor(value) { - return isIterable(value) ? value : Seq(value); - } -} - -export class KeyedIterable extends Iterable { - constructor(value) { - return isKeyed(value) ? value : KeyedSeq(value); - } -} - -export class IndexedIterable extends Iterable { - constructor(value) { - return isIndexed(value) ? value : IndexedSeq(value); - } -} - -export class SetIterable extends Iterable { - constructor(value) { - return isIterable(value) && !isAssociative(value) ? value : SetSeq(value); - } -} - - -export function isIterable(maybeIterable) { - return !!(maybeIterable && maybeIterable[IS_ITERABLE_SENTINEL]); -} - -export function isKeyed(maybeKeyed) { - return !!(maybeKeyed && maybeKeyed[IS_KEYED_SENTINEL]); -} - -export function isIndexed(maybeIndexed) { - return !!(maybeIndexed && maybeIndexed[IS_INDEXED_SENTINEL]); -} - -export function isAssociative(maybeAssociative) { - return isKeyed(maybeAssociative) || isIndexed(maybeAssociative); -} - -export function isOrdered(maybeOrdered) { - return !!(maybeOrdered && maybeOrdered[IS_ORDERED_SENTINEL]); -} - -Iterable.isIterable = isIterable; -Iterable.isKeyed = isKeyed; -Iterable.isIndexed = isIndexed; -Iterable.isAssociative = isAssociative; -Iterable.isOrdered = isOrdered; - -Iterable.Keyed = KeyedIterable; -Iterable.Indexed = IndexedIterable; -Iterable.Set = SetIterable; - - -export var IS_ITERABLE_SENTINEL = '@@__IMMUTABLE_ITERABLE__@@'; -export var IS_KEYED_SENTINEL = '@@__IMMUTABLE_KEYED__@@'; -export var IS_INDEXED_SENTINEL = '@@__IMMUTABLE_INDEXED__@@'; -export var IS_ORDERED_SENTINEL = '@@__IMMUTABLE_ORDERED__@@'; diff --git a/src/IterableImpl.js b/src/IterableImpl.js deleted file mode 100644 index 37e4919ce3..0000000000 --- a/src/IterableImpl.js +++ /dev/null @@ -1,749 +0,0 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -import { Iterable, KeyedIterable, IndexedIterable, SetIterable, - isIterable, isKeyed, isIndexed, isAssociative, isOrdered, - IS_ITERABLE_SENTINEL, IS_KEYED_SENTINEL, IS_INDEXED_SENTINEL, IS_ORDERED_SENTINEL } from './Iterable' - -import { is } from './is' -import { arrCopy, NOT_SET, ensureSize, wrapIndex, - returnTrue, resolveBegin } from './TrieUtils' -import { hash } from './Hash' -import { imul, smi } from './Math' -import { Iterator, - ITERATOR_SYMBOL, ITERATE_KEYS, ITERATE_VALUES, ITERATE_ENTRIES } from './Iterator' - -import assertNotInfinite from './utils/assertNotInfinite' -import forceIterator from './utils/forceIterator' -import deepEqual from './utils/deepEqual' -import mixin from './utils/mixin' - -import { Map } from './Map' -import { OrderedMap } from './OrderedMap' -import { List } from './List' -import { Set } from './Set' -import { OrderedSet } from './OrderedSet' -import { Stack } from './Stack' -import { Range } from './Range' -import { KeyedSeq, IndexedSeq, SetSeq, ArraySeq } from './Seq' -import { KeyedCollection, IndexedCollection, SetCollection } from './Collection' -import { reify, ToKeyedSequence, ToIndexedSequence, ToSetSequence, - FromEntriesSequence, flipFactory, mapFactory, reverseFactory, - filterFactory, countByFactory, groupByFactory, sliceFactory, - takeWhileFactory, skipWhileFactory, concatFactory, - flattenFactory, flatMapFactory, interposeFactory, sortFactory, - maxFactory, zipWithFactory } from './Operations' - -export { Iterable, KeyedIterable, IndexedIterable, SetIterable, - isIterable, isKeyed, isIndexed, isAssociative, isOrdered, IS_ORDERED_SENTINEL } - - -Iterable.Iterator = Iterator; - -mixin(Iterable, { - - // ### Conversion to other types - - toArray() { - assertNotInfinite(this.size); - var array = new Array(this.size || 0); - this.valueSeq().__iterate((v, i) => { array[i] = v; }); - return array; - }, - - toIndexedSeq() { - return new ToIndexedSequence(this); - }, - - toJS() { - return this.toSeq().map( - value => value && typeof value.toJS === 'function' ? value.toJS() : value - ).__toJS(); - }, - - toJSON() { - return this.toSeq().map( - value => value && typeof value.toJSON === 'function' ? value.toJSON() : value - ).__toJS(); - }, - - toKeyedSeq() { - return new ToKeyedSequence(this, true); - }, - - toMap() { - // Use Late Binding here to solve the circular dependency. - return Map(this.toKeyedSeq()); - }, - - toObject() { - assertNotInfinite(this.size); - var object = {}; - this.__iterate((v, k) => { object[k] = v; }); - return object; - }, - - toOrderedMap() { - // Use Late Binding here to solve the circular dependency. - return OrderedMap(this.toKeyedSeq()); - }, - - toOrderedSet() { - // Use Late Binding here to solve the circular dependency. - return OrderedSet(isKeyed(this) ? this.valueSeq() : this); - }, - - toSet() { - // Use Late Binding here to solve the circular dependency. - return Set(isKeyed(this) ? this.valueSeq() : this); - }, - - toSetSeq() { - return new ToSetSequence(this); - }, - - toSeq() { - return isIndexed(this) ? this.toIndexedSeq() : - isKeyed(this) ? this.toKeyedSeq() : - this.toSetSeq(); - }, - - toStack() { - // Use Late Binding here to solve the circular dependency. - return Stack(isKeyed(this) ? this.valueSeq() : this); - }, - - toList() { - // Use Late Binding here to solve the circular dependency. - return List(isKeyed(this) ? this.valueSeq() : this); - }, - - - // ### Common JavaScript methods and properties - - toString() { - return '[Iterable]'; - }, - - __toString(head, tail) { - if (this.size === 0) { - return head + tail; - } - return head + ' ' + this.toSeq().map(this.__toStringMapper).join(', ') + ' ' + tail; - }, - - - // ### ES6 Collection methods (ES6 Array and Map) - - concat(...values) { - return reify(this, concatFactory(this, values)); - }, - - includes(searchValue) { - return this.some(value => is(value, searchValue)); - }, - - entries() { - return this.__iterator(ITERATE_ENTRIES); - }, - - every(predicate, context) { - assertNotInfinite(this.size); - var returnValue = true; - this.__iterate((v, k, c) => { - if (!predicate.call(context, v, k, c)) { - returnValue = false; - return false; - } - }); - return returnValue; - }, - - filter(predicate, context) { - return reify(this, filterFactory(this, predicate, context, true)); - }, - - find(predicate, context, notSetValue) { - var entry = this.findEntry(predicate, context); - return entry ? entry[1] : notSetValue; - }, - - forEach(sideEffect, context) { - assertNotInfinite(this.size); - return this.__iterate(context ? sideEffect.bind(context) : sideEffect); - }, - - join(separator) { - assertNotInfinite(this.size); - separator = separator !== undefined ? '' + separator : ','; - var joined = ''; - var isFirst = true; - this.__iterate(v => { - isFirst ? (isFirst = false) : (joined += separator); - joined += v !== null && v !== undefined ? v.toString() : ''; - }); - return joined; - }, - - keys() { - return this.__iterator(ITERATE_KEYS); - }, - - map(mapper, context) { - return reify(this, mapFactory(this, mapper, context)); - }, - - reduce(reducer, initialReduction, context) { - assertNotInfinite(this.size); - var reduction; - var useFirst; - if (arguments.length < 2) { - useFirst = true; - } else { - reduction = initialReduction; - } - this.__iterate((v, k, c) => { - if (useFirst) { - useFirst = false; - reduction = v; - } else { - reduction = reducer.call(context, reduction, v, k, c); - } - }); - return reduction; - }, - - reduceRight(reducer, initialReduction, context) { - var reversed = this.toKeyedSeq().reverse(); - return reversed.reduce.apply(reversed, arguments); - }, - - reverse() { - return reify(this, reverseFactory(this, true)); - }, - - slice(begin, end) { - return reify(this, sliceFactory(this, begin, end, true)); - }, - - some(predicate, context) { - return !this.every(not(predicate), context); - }, - - sort(comparator) { - return reify(this, sortFactory(this, comparator)); - }, - - values() { - return this.__iterator(ITERATE_VALUES); - }, - - - // ### More sequential methods - - butLast() { - return this.slice(0, -1); - }, - - isEmpty() { - return this.size !== undefined ? this.size === 0 : !this.some(() => true); - }, - - count(predicate, context) { - return ensureSize( - predicate ? this.toSeq().filter(predicate, context) : this - ); - }, - - countBy(grouper, context) { - return countByFactory(this, grouper, context); - }, - - equals(other) { - return deepEqual(this, other); - }, - - entrySeq() { - var iterable = this; - if (iterable._cache) { - // We cache as an entries array, so we can just return the cache! - return new ArraySeq(iterable._cache); - } - var entriesSequence = iterable.toSeq().map(entryMapper).toIndexedSeq(); - entriesSequence.fromEntrySeq = () => iterable.toSeq(); - return entriesSequence; - }, - - filterNot(predicate, context) { - return this.filter(not(predicate), context); - }, - - findEntry(predicate, context, notSetValue) { - var found = notSetValue; - this.__iterate((v, k, c) => { - if (predicate.call(context, v, k, c)) { - found = [k, v]; - return false; - } - }); - return found; - }, - - findKey(predicate, context) { - var entry = this.findEntry(predicate, context); - return entry && entry[0]; - }, - - findLast(predicate, context, notSetValue) { - return this.toKeyedSeq().reverse().find(predicate, context, notSetValue); - }, - - findLastEntry(predicate, context, notSetValue) { - return this.toKeyedSeq().reverse().findEntry(predicate, context, notSetValue); - }, - - findLastKey(predicate, context) { - return this.toKeyedSeq().reverse().findKey(predicate, context); - }, - - first() { - return this.find(returnTrue); - }, - - flatMap(mapper, context) { - return reify(this, flatMapFactory(this, mapper, context)); - }, - - flatten(depth) { - return reify(this, flattenFactory(this, depth, true)); - }, - - fromEntrySeq() { - return new FromEntriesSequence(this); - }, - - get(searchKey, notSetValue) { - return this.find((_, key) => is(key, searchKey), undefined, notSetValue); - }, - - getIn(searchKeyPath, notSetValue) { - var nested = this; - // Note: in an ES6 environment, we would prefer: - // for (var key of searchKeyPath) { - var iter = forceIterator(searchKeyPath); - var step; - while (!(step = iter.next()).done) { - var key = step.value; - nested = nested && nested.get ? nested.get(key, NOT_SET) : NOT_SET; - if (nested === NOT_SET) { - return notSetValue; - } - } - return nested; - }, - - groupBy(grouper, context) { - return groupByFactory(this, grouper, context); - }, - - has(searchKey) { - return this.get(searchKey, NOT_SET) !== NOT_SET; - }, - - hasIn(searchKeyPath) { - return this.getIn(searchKeyPath, NOT_SET) !== NOT_SET; - }, - - isSubset(iter) { - iter = typeof iter.includes === 'function' ? iter : Iterable(iter); - return this.every(value => iter.includes(value)); - }, - - isSuperset(iter) { - iter = typeof iter.isSubset === 'function' ? iter : Iterable(iter); - return iter.isSubset(this); - }, - - keyOf(searchValue) { - return this.findKey(value => is(value, searchValue)); - }, - - keySeq() { - return this.toSeq().map(keyMapper).toIndexedSeq(); - }, - - last() { - return this.toSeq().reverse().first(); - }, - - lastKeyOf(searchValue) { - return this.toKeyedSeq().reverse().keyOf(searchValue); - }, - - max(comparator) { - return maxFactory(this, comparator); - }, - - maxBy(mapper, comparator) { - return maxFactory(this, comparator, mapper); - }, - - min(comparator) { - return maxFactory(this, comparator ? neg(comparator) : defaultNegComparator); - }, - - minBy(mapper, comparator) { - return maxFactory(this, comparator ? neg(comparator) : defaultNegComparator, mapper); - }, - - rest() { - return this.slice(1); - }, - - skip(amount) { - return this.slice(Math.max(0, amount)); - }, - - skipLast(amount) { - return reify(this, this.toSeq().reverse().skip(amount).reverse()); - }, - - skipWhile(predicate, context) { - return reify(this, skipWhileFactory(this, predicate, context, true)); - }, - - skipUntil(predicate, context) { - return this.skipWhile(not(predicate), context); - }, - - sortBy(mapper, comparator) { - return reify(this, sortFactory(this, comparator, mapper)); - }, - - take(amount) { - return this.slice(0, Math.max(0, amount)); - }, - - takeLast(amount) { - return reify(this, this.toSeq().reverse().take(amount).reverse()); - }, - - takeWhile(predicate, context) { - return reify(this, takeWhileFactory(this, predicate, context)); - }, - - takeUntil(predicate, context) { - return this.takeWhile(not(predicate), context); - }, - - valueSeq() { - return this.toIndexedSeq(); - }, - - - // ### Hashable Object - - hashCode() { - return this.__hash || (this.__hash = hashIterable(this)); - } - - - // ### Internal - - // abstract __iterate(fn, reverse) - - // abstract __iterator(type, reverse) -}); - -// var IS_ITERABLE_SENTINEL = '@@__IMMUTABLE_ITERABLE__@@'; -// var IS_KEYED_SENTINEL = '@@__IMMUTABLE_KEYED__@@'; -// var IS_INDEXED_SENTINEL = '@@__IMMUTABLE_INDEXED__@@'; -// var IS_ORDERED_SENTINEL = '@@__IMMUTABLE_ORDERED__@@'; - -var IterablePrototype = Iterable.prototype; -IterablePrototype[IS_ITERABLE_SENTINEL] = true; -IterablePrototype[ITERATOR_SYMBOL] = IterablePrototype.values; -IterablePrototype.__toJS = IterablePrototype.toArray; -IterablePrototype.__toStringMapper = quoteString; -IterablePrototype.inspect = -IterablePrototype.toSource = function() { return this.toString(); }; -IterablePrototype.chain = IterablePrototype.flatMap; -IterablePrototype.contains = IterablePrototype.includes; - -mixin(KeyedIterable, { - - // ### More sequential methods - - flip() { - return reify(this, flipFactory(this)); - }, - - mapEntries(mapper, context) { - var iterations = 0; - return reify(this, - this.toSeq().map( - (v, k) => mapper.call(context, [k, v], iterations++, this) - ).fromEntrySeq() - ); - }, - - mapKeys(mapper, context) { - return reify(this, - this.toSeq().flip().map( - (k, v) => mapper.call(context, k, v, this) - ).flip() - ); - } - -}); - -var KeyedIterablePrototype = KeyedIterable.prototype; -KeyedIterablePrototype[IS_KEYED_SENTINEL] = true; -KeyedIterablePrototype[ITERATOR_SYMBOL] = IterablePrototype.entries; -KeyedIterablePrototype.__toJS = IterablePrototype.toObject; -KeyedIterablePrototype.__toStringMapper = (v, k) => JSON.stringify(k) + ': ' + quoteString(v); - - - -mixin(IndexedIterable, { - - // ### Conversion to other types - - toKeyedSeq() { - return new ToKeyedSequence(this, false); - }, - - - // ### ES6 Collection methods (ES6 Array and Map) - - filter(predicate, context) { - return reify(this, filterFactory(this, predicate, context, false)); - }, - - findIndex(predicate, context) { - var entry = this.findEntry(predicate, context); - return entry ? entry[0] : -1; - }, - - indexOf(searchValue) { - var key = this.keyOf(searchValue); - return key === undefined ? -1 : key; - }, - - lastIndexOf(searchValue) { - var key = this.lastKeyOf(searchValue); - return key === undefined ? -1 : key; - }, - - reverse() { - return reify(this, reverseFactory(this, false)); - }, - - slice(begin, end) { - return reify(this, sliceFactory(this, begin, end, false)); - }, - - splice(index, removeNum /*, ...values*/) { - var numArgs = arguments.length; - removeNum = Math.max(removeNum | 0, 0); - if (numArgs === 0 || (numArgs === 2 && !removeNum)) { - return this; - } - // If index is negative, it should resolve relative to the size of the - // collection. However size may be expensive to compute if not cached, so - // only call count() if the number is in fact negative. - index = resolveBegin(index, index < 0 ? this.count() : this.size); - var spliced = this.slice(0, index); - return reify( - this, - numArgs === 1 ? - spliced : - spliced.concat(arrCopy(arguments, 2), this.slice(index + removeNum)) - ); - }, - - - // ### More collection methods - - findLastIndex(predicate, context) { - var entry = this.findLastEntry(predicate, context); - return entry ? entry[0] : -1; - }, - - first() { - return this.get(0); - }, - - flatten(depth) { - return reify(this, flattenFactory(this, depth, false)); - }, - - get(index, notSetValue) { - index = wrapIndex(this, index); - return (index < 0 || (this.size === Infinity || - (this.size !== undefined && index > this.size))) ? - notSetValue : - this.find((_, key) => key === index, undefined, notSetValue); - }, - - has(index) { - index = wrapIndex(this, index); - return index >= 0 && (this.size !== undefined ? - this.size === Infinity || index < this.size : - this.indexOf(index) !== -1 - ); - }, - - interpose(separator) { - return reify(this, interposeFactory(this, separator)); - }, - - interleave(/*...iterables*/) { - var iterables = [this].concat(arrCopy(arguments)); - var zipped = zipWithFactory(this.toSeq(), IndexedSeq.of, iterables); - var interleaved = zipped.flatten(true); - if (zipped.size) { - interleaved.size = zipped.size * iterables.length; - } - return reify(this, interleaved); - }, - - keySeq() { - return Range(0, this.size); - }, - - last() { - return this.get(-1); - }, - - skipWhile(predicate, context) { - return reify(this, skipWhileFactory(this, predicate, context, false)); - }, - - zip(/*, ...iterables */) { - var iterables = [this].concat(arrCopy(arguments)); - return reify(this, zipWithFactory(this, defaultZipper, iterables)); - }, - - zipWith(zipper/*, ...iterables */) { - var iterables = arrCopy(arguments); - iterables[0] = this; - return reify(this, zipWithFactory(this, zipper, iterables)); - } - -}); - -IndexedIterable.prototype[IS_INDEXED_SENTINEL] = true; -IndexedIterable.prototype[IS_ORDERED_SENTINEL] = true; - - - -mixin(SetIterable, { - - // ### ES6 Collection methods (ES6 Array and Map) - - get(value, notSetValue) { - return this.has(value) ? value : notSetValue; - }, - - includes(value) { - return this.has(value); - }, - - - // ### More sequential methods - - keySeq() { - return this.valueSeq(); - } - -}); - -SetIterable.prototype.has = IterablePrototype.includes; -SetIterable.prototype.contains = SetIterable.prototype.includes; - - -// Mixin subclasses - -mixin(KeyedSeq, KeyedIterable.prototype); -mixin(IndexedSeq, IndexedIterable.prototype); -mixin(SetSeq, SetIterable.prototype); - -mixin(KeyedCollection, KeyedIterable.prototype); -mixin(IndexedCollection, IndexedIterable.prototype); -mixin(SetCollection, SetIterable.prototype); - - -// #pragma Helper functions - -function keyMapper(v, k) { - return k; -} - -function entryMapper(v, k) { - return [k, v]; -} - -function not(predicate) { - return function() { - return !predicate.apply(this, arguments); - } -} - -function neg(predicate) { - return function() { - return -predicate.apply(this, arguments); - } -} - -function quoteString(value) { - return typeof value === 'string' ? JSON.stringify(value) : String(value); -} - -function defaultZipper() { - return arrCopy(arguments); -} - -function defaultNegComparator(a, b) { - return a < b ? 1 : a > b ? -1 : 0; -} - -function hashIterable(iterable) { - if (iterable.size === Infinity) { - return 0; - } - var ordered = isOrdered(iterable); - var keyed = isKeyed(iterable); - var h = ordered ? 1 : 0; - var size = iterable.__iterate( - keyed ? - ordered ? - (v, k) => { h = 31 * h + hashMerge(hash(v), hash(k)) | 0; } : - (v, k) => { h = h + hashMerge(hash(v), hash(k)) | 0; } : - ordered ? - v => { h = 31 * h + hash(v) | 0; } : - v => { h = h + hash(v) | 0; } - ); - return murmurHashOfSize(size, h); -} - -function murmurHashOfSize(size, h) { - h = imul(h, 0xCC9E2D51); - h = imul(h << 15 | h >>> -15, 0x1B873593); - h = imul(h << 13 | h >>> -13, 5); - h = (h + 0xE6546B64 | 0) ^ size; - h = imul(h ^ h >>> 16, 0x85EBCA6B); - h = imul(h ^ h >>> 13, 0xC2B2AE35); - h = smi(h ^ h >>> 16); - return h; -} - -function hashMerge(a, b) { - return a ^ b + 0x9E3779B9 + (a << 6) + (a >> 2) | 0; // int -} diff --git a/src/Iterator.js b/src/Iterator.js index bc1614716e..1954a3661c 100644 --- a/src/Iterator.js +++ b/src/Iterator.js @@ -1,23 +1,11 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +export const ITERATE_KEYS = 0; +export const ITERATE_VALUES = 1; +export const ITERATE_ENTRIES = 2; -/* global Symbol */ - -export var ITERATE_KEYS = 0; -export var ITERATE_VALUES = 1; -export var ITERATE_ENTRIES = 2; - -var REAL_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; -var FAUX_ITERATOR_SYMBOL = '@@iterator'; - -export var ITERATOR_SYMBOL = REAL_ITERATOR_SYMBOL || FAUX_ITERATOR_SYMBOL; +const REAL_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; +const FAUX_ITERATOR_SYMBOL = '@@iterator'; +export const ITERATOR_SYMBOL = REAL_ITERATOR_SYMBOL || FAUX_ITERATOR_SYMBOL; export class Iterator { constructor(next) { @@ -33,18 +21,23 @@ Iterator.KEYS = ITERATE_KEYS; Iterator.VALUES = ITERATE_VALUES; Iterator.ENTRIES = ITERATE_ENTRIES; -Iterator.prototype.inspect = -Iterator.prototype.toSource = function () { return this.toString(); } +Iterator.prototype.inspect = Iterator.prototype.toSource = function () { + return this.toString(); +}; Iterator.prototype[ITERATOR_SYMBOL] = function () { return this; }; - export function iteratorValue(type, k, v, iteratorResult) { - var value = type === 0 ? k : type === 1 ? v : [k, v]; - iteratorResult ? (iteratorResult.value = value) : (iteratorResult = { - value: value, done: false - }); + const value = + type === ITERATE_KEYS ? k : type === ITERATE_VALUES ? v : [k, v]; + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + iteratorResult + ? (iteratorResult.value = value) + : (iteratorResult = { + value: value, + done: false, + }); return iteratorResult; } @@ -53,6 +46,11 @@ export function iteratorDone() { } export function hasIterator(maybeIterable) { + if (Array.isArray(maybeIterable)) { + // IE11 trick as it does not support `Symbol.iterator` + return true; + } + return !!getIteratorFn(maybeIterable); } @@ -61,16 +59,26 @@ export function isIterator(maybeIterator) { } export function getIterator(iterable) { - var iteratorFn = getIteratorFn(iterable); + const iteratorFn = getIteratorFn(iterable); return iteratorFn && iteratorFn.call(iterable); } function getIteratorFn(iterable) { - var iteratorFn = iterable && ( - (REAL_ITERATOR_SYMBOL && iterable[REAL_ITERATOR_SYMBOL]) || - iterable[FAUX_ITERATOR_SYMBOL] - ); + const iteratorFn = + iterable && + ((REAL_ITERATOR_SYMBOL && iterable[REAL_ITERATOR_SYMBOL]) || + iterable[FAUX_ITERATOR_SYMBOL]); if (typeof iteratorFn === 'function') { return iteratorFn; } } + +export function isEntriesIterable(maybeIterable) { + const iteratorFn = getIteratorFn(maybeIterable); + return iteratorFn && iteratorFn === maybeIterable.entries; +} + +export function isKeysIterable(maybeIterable) { + const iteratorFn = getIteratorFn(maybeIterable); + return iteratorFn && iteratorFn === maybeIterable.keys; +} diff --git a/src/List.js b/src/List.js index 675babf396..966b9e1b2c 100644 --- a/src/List.js +++ b/src/List.js @@ -1,45 +1,57 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -import { fromJS } from './fromJS' -import { DELETE, SHIFT, SIZE, MASK, DID_ALTER, OwnerID, MakeRef, - SetRef, wrapIndex, wholeSlice, resolveBegin, resolveEnd } from './TrieUtils' -import { isIterable, IndexedIterable } from './Iterable' -import { IndexedCollection } from './Collection' -import { MapPrototype, mergeIntoCollectionWith, deepMerger, deepMergerWith } from './Map' -import { Iterator, iteratorValue, iteratorDone } from './Iterator' - -import assertNotInfinite from './utils/assertNotInfinite' - +import { + DELETE, + SHIFT, + SIZE, + MASK, + OwnerID, + MakeRef, + SetRef, + wrapIndex, + wholeSlice, + resolveBegin, + resolveEnd, +} from './TrieUtils'; +import { IS_LIST_SYMBOL, isList } from './predicates/isList'; +import { IndexedCollection } from './Collection'; +import { hasIterator, Iterator, iteratorValue, iteratorDone } from './Iterator'; +import { setIn } from './methods/setIn'; +import { deleteIn } from './methods/deleteIn'; +import { update } from './methods/update'; +import { updateIn } from './methods/updateIn'; +import { mergeIn } from './methods/mergeIn'; +import { mergeDeepIn } from './methods/mergeDeepIn'; +import { withMutations } from './methods/withMutations'; +import { asMutable } from './methods/asMutable'; +import { asImmutable } from './methods/asImmutable'; +import { wasAltered } from './methods/wasAltered'; +import assertNotInfinite from './utils/assertNotInfinite'; export class List extends IndexedCollection { - // @pragma Construction constructor(value) { - var empty = emptyList(); - if (value === null || value === undefined) { + const empty = emptyList(); + if (value === undefined || value === null) { + // eslint-disable-next-line no-constructor-return return empty; } if (isList(value)) { + // eslint-disable-next-line no-constructor-return return value; } - var iter = IndexedIterable(value); - var size = iter.size; + const iter = IndexedCollection(value); + const size = iter.size; if (size === 0) { + // eslint-disable-next-line no-constructor-return return empty; } assertNotInfinite(size); if (size > 0 && size < SIZE) { + // eslint-disable-next-line no-constructor-return return makeList(0, size, SHIFT, null, new VNode(iter.toArray())); } - return empty.withMutations(list => { + // eslint-disable-next-line no-constructor-return + return empty.withMutations((list) => { list.setSize(size); iter.forEach((v, i) => list.set(i, v)); }); @@ -59,7 +71,7 @@ export class List extends IndexedCollection { index = wrapIndex(this, index); if (index >= 0 && index < this.size) { index += this._origin; - var node = listNodeFor(this, index); + const node = listNodeFor(this, index); return node && node.array[index & MASK]; } return notSetValue; @@ -72,10 +84,13 @@ export class List extends IndexedCollection { } remove(index) { - return !this.has(index) ? this : - index === 0 ? this.shift() : - index === this.size - 1 ? this.pop() : - this.splice(index, 1); + return !this.has(index) + ? this + : index === 0 + ? this.shift() + : index === this.size - 1 + ? this.pop() + : this.splice(index, 1); } insert(index, value) { @@ -89,8 +104,7 @@ export class List extends IndexedCollection { if (this.__ownerID) { this.size = this._origin = this._capacity = 0; this._level = SHIFT; - this._root = this._tail = null; - this.__hash = undefined; + this._root = this._tail = this.__hash = undefined; this.__altered = true; return this; } @@ -98,11 +112,11 @@ export class List extends IndexedCollection { } push(/*...values*/) { - var values = arguments; - var oldSize = this.size; - return this.withMutations(list => { + const values = arguments; + const oldSize = this.size; + return this.withMutations((list) => { setListBounds(list, 0, oldSize + values.length); - for (var ii = 0; ii < values.length; ii++) { + for (let ii = 0; ii < values.length; ii++) { list.set(oldSize + ii, values[ii]); } }); @@ -113,10 +127,10 @@ export class List extends IndexedCollection { } unshift(/*...values*/) { - var values = arguments; - return this.withMutations(list => { + const values = arguments; + return this.withMutations((list) => { setListBounds(list, -values.length); - for (var ii = 0; ii < values.length; ii++) { + for (let ii = 0; ii < values.length; ii++) { list.set(ii, values[ii]); } }); @@ -126,32 +140,65 @@ export class List extends IndexedCollection { return setListBounds(this, 1); } - // @pragma Composition + shuffle(random = Math.random) { + return this.withMutations((mutable) => { + // implementation of the Fisher-Yates shuffle: https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle + let current = mutable.size; + let destination; + let tmp; - merge(/*...iters*/) { - return mergeIntoListWith(this, undefined, arguments); - } + while (current) { + destination = Math.floor(random() * current--); - mergeWith(merger, ...iters) { - return mergeIntoListWith(this, merger, iters); + tmp = mutable.get(destination); + mutable.set(destination, mutable.get(current)); + mutable.set(current, tmp); + } + }); } - mergeDeep(/*...iters*/) { - return mergeIntoListWith(this, deepMerger, arguments); - } + // @pragma Composition - mergeDeepWith(merger, ...iters) { - return mergeIntoListWith(this, deepMergerWith(merger), iters); + concat(/*...collections*/) { + const seqs = []; + for (let i = 0; i < arguments.length; i++) { + const argument = arguments[i]; + const seq = IndexedCollection( + typeof argument !== 'string' && hasIterator(argument) + ? argument + : [argument] + ); + if (seq.size !== 0) { + seqs.push(seq); + } + } + if (seqs.length === 0) { + return this; + } + if (this.size === 0 && !this.__ownerID && seqs.length === 1) { + return this.constructor(seqs[0]); + } + return this.withMutations((list) => { + seqs.forEach((seq) => seq.forEach((value) => list.push(value))); + }); } setSize(size) { return setListBounds(this, 0, size); } + map(mapper, context) { + return this.withMutations((list) => { + for (let i = 0; i < this.size; i++) { + list.set(i, mapper.call(context, list.get(i), i, this)); + } + }); + } + // @pragma Iteration slice(begin, end) { - var size = this.size; + const size = this.size; if (wholeSlice(begin, end, size)) { return this; } @@ -163,22 +210,22 @@ export class List extends IndexedCollection { } __iterator(type, reverse) { - var index = 0; - var values = iterateList(this, reverse); + let index = reverse ? this.size : 0; + const values = iterateList(this, reverse); return new Iterator(() => { - var value = values(); - return value === DONE ? - iteratorDone() : - iteratorValue(type, index++, value); + const value = values(); + return value === DONE + ? iteratorDone() + : iteratorValue(type, reverse ? --index : index++, value); }); } __iterate(fn, reverse) { - var index = 0; - var values = iterateList(this, reverse); - var value; + let index = reverse ? this.size : 0; + const values = iterateList(this, reverse); + let value; while ((value = values()) !== DONE) { - if (fn(value, index++, this) === false) { + if (fn(value, reverse ? --index : index++, this) === false) { break; } } @@ -190,36 +237,47 @@ export class List extends IndexedCollection { return this; } if (!ownerID) { + if (this.size === 0) { + return emptyList(); + } this.__ownerID = ownerID; + this.__altered = false; return this; } - return makeList(this._origin, this._capacity, this._level, this._root, this._tail, ownerID, this.__hash); + return makeList( + this._origin, + this._capacity, + this._level, + this._root, + this._tail, + ownerID, + this.__hash + ); } } -export function isList(maybeList) { - return !!(maybeList && maybeList[IS_LIST_SENTINEL]); -} - List.isList = isList; -var IS_LIST_SENTINEL = '@@__IMMUTABLE_LIST__@@'; - -export var ListPrototype = List.prototype; -ListPrototype[IS_LIST_SENTINEL] = true; +const ListPrototype = List.prototype; +ListPrototype[IS_LIST_SYMBOL] = true; ListPrototype[DELETE] = ListPrototype.remove; -ListPrototype.setIn = MapPrototype.setIn; -ListPrototype.deleteIn = -ListPrototype.removeIn = MapPrototype.removeIn; -ListPrototype.update = MapPrototype.update; -ListPrototype.updateIn = MapPrototype.updateIn; -ListPrototype.mergeIn = MapPrototype.mergeIn; -ListPrototype.mergeDeepIn = MapPrototype.mergeDeepIn; -ListPrototype.withMutations = MapPrototype.withMutations; -ListPrototype.asMutable = MapPrototype.asMutable; -ListPrototype.asImmutable = MapPrototype.asImmutable; -ListPrototype.wasAltered = MapPrototype.wasAltered; - +ListPrototype.merge = ListPrototype.concat; +ListPrototype.setIn = setIn; +ListPrototype.deleteIn = ListPrototype.removeIn = deleteIn; +ListPrototype.update = update; +ListPrototype.updateIn = updateIn; +ListPrototype.mergeIn = mergeIn; +ListPrototype.mergeDeepIn = mergeDeepIn; +ListPrototype.withMutations = withMutations; +ListPrototype.wasAltered = wasAltered; +ListPrototype.asImmutable = asImmutable; +ListPrototype['@@transducer/init'] = ListPrototype.asMutable = asMutable; +ListPrototype['@@transducer/step'] = function (result, arr) { + return result.push(arr); +}; +ListPrototype['@@transducer/result'] = function (obj) { + return obj.asImmutable(); +}; class VNode { constructor(array, ownerID) { @@ -230,18 +288,22 @@ class VNode { // TODO: seems like these methods are very similar removeBefore(ownerID, level, index) { - if (index === level ? 1 << level : 0 || this.array.length === 0) { + if ( + (index & ((1 << (level + SHIFT)) - 1)) === 0 || + this.array.length === 0 + ) { return this; } - var originIndex = (index >>> level) & MASK; + const originIndex = (index >>> level) & MASK; if (originIndex >= this.array.length) { return new VNode([], ownerID); } - var removingFirst = originIndex === 0; - var newChild; + const removingFirst = originIndex === 0; + let newChild; if (level > 0) { - var oldChild = this.array[originIndex]; - newChild = oldChild && oldChild.removeBefore(ownerID, level - SHIFT, index); + const oldChild = this.array[originIndex]; + newChild = + oldChild && oldChild.removeBefore(ownerID, level - SHIFT, index); if (newChild === oldChild && removingFirst) { return this; } @@ -249,9 +311,9 @@ class VNode { if (removingFirst && !newChild) { return this; } - var editable = editableVNode(this, ownerID); + const editable = editableVNode(this, ownerID); if (!removingFirst) { - for (var ii = 0; ii < originIndex; ii++) { + for (let ii = 0; ii < originIndex; ii++) { editable.array[ii] = undefined; } } @@ -262,24 +324,28 @@ class VNode { } removeAfter(ownerID, level, index) { - if (index === (level ? 1 << level : 0) || this.array.length === 0) { + if ( + index === (level ? 1 << (level + SHIFT) : SIZE) || + this.array.length === 0 + ) { return this; } - var sizeIndex = ((index - 1) >>> level) & MASK; + const sizeIndex = ((index - 1) >>> level) & MASK; if (sizeIndex >= this.array.length) { return this; } - var newChild; + let newChild; if (level > 0) { - var oldChild = this.array[sizeIndex]; - newChild = oldChild && oldChild.removeAfter(ownerID, level - SHIFT, index); + const oldChild = this.array[sizeIndex]; + newChild = + oldChild && oldChild.removeAfter(ownerID, level - SHIFT, index); if (newChild === oldChild && sizeIndex === this.array.length - 1) { return this; } } - var editable = editableVNode(this, ownerID); + const editable = editableVNode(this, ownerID); editable.array.splice(sizeIndex + 1); if (newChild) { editable.array[sizeIndex] = newChild; @@ -288,27 +354,26 @@ class VNode { } } - -var DONE = {}; +const DONE = {}; function iterateList(list, reverse) { - var left = list._origin; - var right = list._capacity; - var tailPos = getTailOffset(right); - var tail = list._tail; + const left = list._origin; + const right = list._capacity; + const tailPos = getTailOffset(right); + const tail = list._tail; return iterateNodeOrLeaf(list._root, list._level, 0); function iterateNodeOrLeaf(node, level, offset) { - return level === 0 ? - iterateLeaf(node, offset) : - iterateNode(node, level, offset); + return level === 0 + ? iterateLeaf(node, offset) + : iterateNode(node, level, offset); } function iterateLeaf(node, offset) { - var array = offset === tailPos ? tail && tail.array : node && node.array; - var from = offset > left ? 0 : left - offset; - var to = right - offset; + const array = offset === tailPos ? tail && tail.array : node && node.array; + let from = offset > left ? 0 : left - offset; + let to = right - offset; if (to > SIZE) { to = SIZE; } @@ -316,23 +381,23 @@ function iterateList(list, reverse) { if (from === to) { return DONE; } - var idx = reverse ? --to : from++; + const idx = reverse ? --to : from++; return array && array[idx]; }; } function iterateNode(node, level, offset) { - var values; - var array = node && node.array; - var from = offset > left ? 0 : (left - offset) >> level; - var to = ((right - offset) >> level) + 1; + let values; + const array = node && node.array; + let from = offset > left ? 0 : (left - offset) >> level; + let to = ((right - offset) >> level) + 1; if (to > SIZE) { to = SIZE; } return () => { - do { + while (true) { if (values) { - var value = values(); + const value = values(); if (value !== DONE) { return value; } @@ -341,17 +406,19 @@ function iterateList(list, reverse) { if (from === to) { return DONE; } - var idx = reverse ? --to : from++; + const idx = reverse ? --to : from++; values = iterateNodeOrLeaf( - array && array[idx], level - SHIFT, offset + (idx << level) + array && array[idx], + level - SHIFT, + offset + (idx << level) ); - } while (true); + } }; } } function makeList(origin, capacity, level, root, tail, ownerID, hash) { - var list = Object.create(ListPrototype); + const list = Object.create(ListPrototype); list.size = capacity - origin; list._origin = origin; list._capacity = capacity; @@ -364,9 +431,8 @@ function makeList(origin, capacity, level, root, tail, ownerID, hash) { return list; } -var EMPTY_LIST; export function emptyList() { - return EMPTY_LIST || (EMPTY_LIST = makeList(0, 0, SHIFT)); + return makeList(0, 0, SHIFT); } function updateList(list, index, value) { @@ -377,22 +443,30 @@ function updateList(list, index, value) { } if (index >= list.size || index < 0) { - return list.withMutations(list => { - index < 0 ? - setListBounds(list, index).set(0, value) : - setListBounds(list, 0, index + 1).set(index, value) + return list.withMutations((list) => { + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + index < 0 + ? setListBounds(list, index).set(0, value) + : setListBounds(list, 0, index + 1).set(index, value); }); } index += list._origin; - var newTail = list._tail; - var newRoot = list._root; - var didAlter = MakeRef(DID_ALTER); + let newTail = list._tail; + let newRoot = list._root; + const didAlter = MakeRef(); if (index >= getTailOffset(list._capacity)) { newTail = updateVNode(newTail, list.__ownerID, 0, index, value, didAlter); } else { - newRoot = updateVNode(newRoot, list.__ownerID, list._level, index, value, didAlter); + newRoot = updateVNode( + newRoot, + list.__ownerID, + list._level, + index, + value, + didAlter + ); } if (!didAlter.value) { @@ -410,17 +484,24 @@ function updateList(list, index, value) { } function updateVNode(node, ownerID, level, index, value, didAlter) { - var idx = (index >>> level) & MASK; - var nodeHas = node && idx < node.array.length; + const idx = (index >>> level) & MASK; + const nodeHas = node && idx < node.array.length; if (!nodeHas && value === undefined) { return node; } - var newNode; + let newNode; if (level > 0) { - var lowerNode = node && node.array[idx]; - var newLowerNode = updateVNode(lowerNode, ownerID, level - SHIFT, index, value, didAlter); + const lowerNode = node && node.array[idx]; + const newLowerNode = updateVNode( + lowerNode, + ownerID, + level - SHIFT, + index, + value, + didAlter + ); if (newLowerNode === lowerNode) { return node; } @@ -433,7 +514,9 @@ function updateVNode(node, ownerID, level, index, value, didAlter) { return node; } - SetRef(didAlter); + if (didAlter) { + SetRef(didAlter); + } newNode = editableVNode(node, ownerID); if (value === undefined && idx === newNode.array.length - 1) { @@ -456,8 +539,8 @@ function listNodeFor(list, rawIndex) { return list._tail; } if (rawIndex < 1 << (list._level + SHIFT)) { - var node = list._root; - var level = list._level; + let node = list._root; + let level = list._level; while (node && level > 0) { node = node.array[(rawIndex >>> level) & MASK]; level -= SHIFT; @@ -470,16 +553,21 @@ function setListBounds(list, begin, end) { // Sanitize begin & end using this shorthand for ToInt32(argument) // http://www.ecma-international.org/ecma-262/6.0/#sec-toint32 if (begin !== undefined) { - begin = begin | 0; + begin |= 0; } if (end !== undefined) { - end = end | 0; - } - var owner = list.__ownerID || new OwnerID(); - var oldOrigin = list._origin; - var oldCapacity = list._capacity; - var newOrigin = oldOrigin + begin; - var newCapacity = end === undefined ? oldCapacity : end < 0 ? oldCapacity + end : oldOrigin + end; + end |= 0; + } + const owner = list.__ownerID || new OwnerID(); + let oldOrigin = list._origin; + let oldCapacity = list._capacity; + let newOrigin = oldOrigin + begin; + let newCapacity = + end === undefined + ? oldCapacity + : end < 0 + ? oldCapacity + end + : oldOrigin + end; if (newOrigin === oldOrigin && newCapacity === oldCapacity) { return list; } @@ -489,13 +577,16 @@ function setListBounds(list, begin, end) { return list.clear(); } - var newLevel = list._level; - var newRoot = list._root; + let newLevel = list._level; + let newRoot = list._root; // New origin might need creating a higher root. - var offsetShift = 0; + let offsetShift = 0; while (newOrigin + offsetShift < 0) { - newRoot = new VNode(newRoot && newRoot.array.length ? [undefined, newRoot] : [], owner); + newRoot = new VNode( + newRoot && newRoot.array.length ? [undefined, newRoot] : [], + owner + ); newLevel += SHIFT; offsetShift += 1 << newLevel; } @@ -506,27 +597,38 @@ function setListBounds(list, begin, end) { oldCapacity += offsetShift; } - var oldTailOffset = getTailOffset(oldCapacity); - var newTailOffset = getTailOffset(newCapacity); + const oldTailOffset = getTailOffset(oldCapacity); + const newTailOffset = getTailOffset(newCapacity); // New size might need creating a higher root. while (newTailOffset >= 1 << (newLevel + SHIFT)) { - newRoot = new VNode(newRoot && newRoot.array.length ? [newRoot] : [], owner); + newRoot = new VNode( + newRoot && newRoot.array.length ? [newRoot] : [], + owner + ); newLevel += SHIFT; } // Locate or create the new tail. - var oldTail = list._tail; - var newTail = newTailOffset < oldTailOffset ? - listNodeFor(list, newCapacity - 1) : - newTailOffset > oldTailOffset ? new VNode([], owner) : oldTail; + const oldTail = list._tail; + let newTail = + newTailOffset < oldTailOffset + ? listNodeFor(list, newCapacity - 1) + : newTailOffset > oldTailOffset + ? new VNode([], owner) + : oldTail; // Merge Tail into tree. - if (oldTail && newTailOffset > oldTailOffset && newOrigin < oldCapacity && oldTail.array.length) { + if ( + oldTail && + newTailOffset > oldTailOffset && + newOrigin < oldCapacity && + oldTail.array.length + ) { newRoot = editableVNode(newRoot, owner); - var node = newRoot; - for (var level = newLevel; level > SHIFT; level -= SHIFT) { - var idx = (oldTailOffset >>> level) & MASK; + let node = newRoot; + for (let level = newLevel; level > SHIFT; level -= SHIFT) { + const idx = (oldTailOffset >>> level) & MASK; node = node.array[idx] = editableVNode(node.array[idx], owner); } node.array[(oldTailOffset >>> SHIFT) & MASK] = oldTail; @@ -545,14 +647,14 @@ function setListBounds(list, begin, end) { newRoot = null; newTail = newTail && newTail.removeBefore(owner, 0, newOrigin); - // Otherwise, if the root has been trimmed, garbage collect. + // Otherwise, if the root has been trimmed, garbage collect. } else if (newOrigin > oldOrigin || newTailOffset < oldTailOffset) { offsetShift = 0; // Identify the new top root node of the subtree of the old root. while (newRoot) { - var beginIndex = (newOrigin >>> newLevel) & MASK; - if (beginIndex !== (newTailOffset >>> newLevel) & MASK) { + const beginIndex = (newOrigin >>> newLevel) & MASK; + if ((beginIndex !== newTailOffset >>> newLevel) & MASK) { break; } if (beginIndex) { @@ -567,7 +669,11 @@ function setListBounds(list, begin, end) { newRoot = newRoot.removeBefore(owner, newLevel, newOrigin - offsetShift); } if (newRoot && newTailOffset < oldTailOffset) { - newRoot = newRoot.removeAfter(owner, newLevel, newTailOffset - offsetShift); + newRoot = newRoot.removeAfter( + owner, + newLevel, + newTailOffset - offsetShift + ); } if (offsetShift) { newOrigin -= offsetShift; @@ -589,26 +695,6 @@ function setListBounds(list, begin, end) { return makeList(newOrigin, newCapacity, newLevel, newRoot, newTail); } -function mergeIntoListWith(list, merger, iterables) { - var iters = []; - var maxSize = 0; - for (var ii = 0; ii < iterables.length; ii++) { - var value = iterables[ii]; - var iter = IndexedIterable(value); - if (iter.size > maxSize) { - maxSize = iter.size; - } - if (!isIterable(value)) { - iter = iter.map(v => fromJS(v)); - } - iters.push(iter); - } - if (maxSize > list.size) { - list = list.setSize(maxSize); - } - return mergeIntoCollectionWith(list, merger, iters); -} - function getTailOffset(size) { - return size < SIZE ? 0 : (((size - 1) >>> SHIFT) << SHIFT); + return size < SIZE ? 0 : ((size - 1) >>> SHIFT) << SHIFT; } diff --git a/src/Map.js b/src/Map.js index 6f9782305d..672e70cac4 100644 --- a/src/Map.js +++ b/src/Map.js @@ -1,51 +1,51 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -import { is } from './is' -import { fromJS } from './fromJS' -import { isIterable, KeyedIterable, isOrdered } from './Iterable' -import { KeyedCollection } from './Collection' -import { DELETE, SHIFT, SIZE, MASK, NOT_SET, CHANGE_LENGTH, DID_ALTER, OwnerID, - MakeRef, SetRef, arrCopy } from './TrieUtils' -import { hash } from './Hash' -import { Iterator, iteratorValue, iteratorDone } from './Iterator' -import { sortFactory } from './Operations' -import forceIterator from './utils/forceIterator' -import invariant from './utils/invariant' -import assertNotInfinite from './utils/assertNotInfinite' - -import { OrderedMap } from './OrderedMap' - +import { is } from './is'; +import { Collection, KeyedCollection } from './Collection'; +import { IS_MAP_SYMBOL, isMap } from './predicates/isMap'; +import { isOrdered } from './predicates/isOrdered'; +import { + DELETE, + SHIFT, + SIZE, + MASK, + NOT_SET, + OwnerID, + MakeRef, + SetRef, +} from './TrieUtils'; +import { hash } from './Hash'; +import { Iterator, iteratorValue, iteratorDone } from './Iterator'; +import { sortFactory } from './Operations'; +import arrCopy from './utils/arrCopy'; +import assertNotInfinite from './utils/assertNotInfinite'; +import { setIn } from './methods/setIn'; +import { deleteIn } from './methods/deleteIn'; +import { update } from './methods/update'; +import { updateIn } from './methods/updateIn'; +import { merge, mergeWith } from './methods/merge'; +import { mergeDeep, mergeDeepWith } from './methods/mergeDeep'; +import { mergeIn } from './methods/mergeIn'; +import { mergeDeepIn } from './methods/mergeDeepIn'; +import { withMutations } from './methods/withMutations'; +import { asMutable } from './methods/asMutable'; +import { asImmutable } from './methods/asImmutable'; +import { wasAltered } from './methods/wasAltered'; + +import { OrderedMap } from './OrderedMap'; export class Map extends KeyedCollection { - // @pragma Construction constructor(value) { - return value === null || value === undefined ? emptyMap() : - isMap(value) && !isOrdered(value) ? value : - emptyMap().withMutations(map => { - var iter = KeyedIterable(value); - assertNotInfinite(iter.size); - iter.forEach((v, k) => map.set(k, v)); - }); - } - - static of(...keyValues) { - return emptyMap().withMutations(map => { - for (var i = 0; i < keyValues.length; i += 2) { - if (i + 1 >= keyValues.length) { - throw new Error('Missing value for key: ' + keyValues[i]); - } - map.set(keyValues[i], keyValues[i + 1]); - } - }); + // eslint-disable-next-line no-constructor-return + return value === undefined || value === null + ? emptyMap() + : isMap(value) && !isOrdered(value) + ? value + : emptyMap().withMutations((map) => { + const iter = KeyedCollection(value); + assertNotInfinite(iter.size); + iter.forEach((v, k) => map.set(k, v)); + }); } toString() { @@ -55,9 +55,9 @@ export class Map extends KeyedCollection { // @pragma Access get(k, notSetValue) { - return this._root ? - this._root.get(0, undefined, k, notSetValue) : - notSetValue; + return this._root + ? this._root.get(0, undefined, k, notSetValue) + : notSetValue; } // @pragma Modification @@ -66,36 +66,20 @@ export class Map extends KeyedCollection { return updateMap(this, k, v); } - setIn(keyPath, v) { - return this.updateIn(keyPath, NOT_SET, () => v); - } - remove(k) { return updateMap(this, k, NOT_SET); } - deleteIn(keyPath) { - return this.updateIn(keyPath, () => NOT_SET); - } + deleteAll(keys) { + const collection = Collection(keys); - update(k, notSetValue, updater) { - return arguments.length === 1 ? - k(this) : - this.updateIn([k], notSetValue, updater); - } - - updateIn(keyPath, notSetValue, updater) { - if (!updater) { - updater = notSetValue; - notSetValue = undefined; + if (collection.size === 0) { + return this; } - var updatedValue = updateInDeepMap( - this, - forceIterator(keyPath), - notSetValue, - updater - ); - return updatedValue === NOT_SET ? undefined : updatedValue; + + return this.withMutations((map) => { + collection.forEach((key) => map.remove(key)); + }); } clear() { @@ -114,42 +98,6 @@ export class Map extends KeyedCollection { // @pragma Composition - merge(/*...iters*/) { - return mergeIntoMapWith(this, undefined, arguments); - } - - mergeWith(merger, ...iters) { - return mergeIntoMapWith(this, merger, iters); - } - - mergeIn(keyPath, ...iters) { - return this.updateIn( - keyPath, - emptyMap(), - m => typeof m.merge === 'function' ? - m.merge.apply(m, iters) : - iters[iters.length - 1] - ); - } - - mergeDeep(/*...iters*/) { - return mergeIntoMapWith(this, deepMerger, arguments); - } - - mergeDeepWith(merger, ...iters) { - return mergeIntoMapWith(this, deepMergerWith(merger), iters); - } - - mergeDeepIn(keyPath, ...iters) { - return this.updateIn( - keyPath, - emptyMap(), - m => typeof m.mergeDeep === 'function' ? - m.mergeDeep.apply(m, iters) : - iters[iters.length - 1] - ); - } - sort(comparator) { // Late binding return OrderedMap(sortFactory(this, comparator)); @@ -160,36 +108,28 @@ export class Map extends KeyedCollection { return OrderedMap(sortFactory(this, comparator, mapper)); } - // @pragma Mutability - - withMutations(fn) { - var mutable = this.asMutable(); - fn(mutable); - return mutable.wasAltered() ? mutable.__ensureOwner(this.__ownerID) : this; - } - - asMutable() { - return this.__ownerID ? this : this.__ensureOwner(new OwnerID()); - } - - asImmutable() { - return this.__ensureOwner(); + map(mapper, context) { + return this.withMutations((map) => { + map.forEach((value, key) => { + map.set(key, mapper.call(context, value, key, this)); + }); + }); } - wasAltered() { - return this.__altered; - } + // @pragma Mutability __iterator(type, reverse) { return new MapIterator(this, type, reverse); } __iterate(fn, reverse) { - var iterations = 0; - this._root && this._root.iterate(entry => { - iterations++; - return fn(entry[1], entry[0], this); - }, reverse); + let iterations = 0; + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + this._root && + this._root.iterate((entry) => { + iterations++; + return fn(entry[1], entry[0], this); + }, reverse); return iterations; } @@ -198,6 +138,9 @@ export class Map extends KeyedCollection { return this; } if (!ownerID) { + if (this.size === 0) { + return emptyMap(); + } this.__ownerID = ownerID; this.__altered = false; return this; @@ -206,32 +149,44 @@ export class Map extends KeyedCollection { } } -export function isMap(maybeMap) { - return !!(maybeMap && maybeMap[IS_MAP_SENTINEL]); -} - Map.isMap = isMap; -var IS_MAP_SENTINEL = '@@__IMMUTABLE_MAP__@@'; - -export var MapPrototype = Map.prototype; -MapPrototype[IS_MAP_SENTINEL] = true; +const MapPrototype = Map.prototype; +MapPrototype[IS_MAP_SYMBOL] = true; MapPrototype[DELETE] = MapPrototype.remove; -MapPrototype.removeIn = MapPrototype.deleteIn; - +MapPrototype.removeAll = MapPrototype.deleteAll; +MapPrototype.setIn = setIn; +MapPrototype.removeIn = MapPrototype.deleteIn = deleteIn; +MapPrototype.update = update; +MapPrototype.updateIn = updateIn; +MapPrototype.merge = MapPrototype.concat = merge; +MapPrototype.mergeWith = mergeWith; +MapPrototype.mergeDeep = mergeDeep; +MapPrototype.mergeDeepWith = mergeDeepWith; +MapPrototype.mergeIn = mergeIn; +MapPrototype.mergeDeepIn = mergeDeepIn; +MapPrototype.withMutations = withMutations; +MapPrototype.wasAltered = wasAltered; +MapPrototype.asImmutable = asImmutable; +MapPrototype['@@transducer/init'] = MapPrototype.asMutable = asMutable; +MapPrototype['@@transducer/step'] = function (result, arr) { + return result.set(arr[0], arr[1]); +}; +MapPrototype['@@transducer/result'] = function (obj) { + return obj.asImmutable(); +}; // #pragma Trie Nodes class ArrayMapNode { - constructor(ownerID, entries) { this.ownerID = ownerID; this.entries = entries; } get(shift, keyHash, key, notSetValue) { - var entries = this.entries; - for (var ii = 0, len = entries.length; ii < len; ii++) { + const entries = this.entries; + for (let ii = 0, len = entries.length; ii < len; ii++) { if (is(key, entries[ii][0])) { return entries[ii][1]; } @@ -240,22 +195,24 @@ class ArrayMapNode { } update(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { - var removed = value === NOT_SET; + const removed = value === NOT_SET; - var entries = this.entries; - var idx = 0; - for (var len = entries.length; idx < len; idx++) { + const entries = this.entries; + let idx = 0; + const len = entries.length; + for (; idx < len; idx++) { if (is(key, entries[idx][0])) { break; } } - var exists = idx < len; + const exists = idx < len; if (exists ? entries[idx][1] === value : removed) { return this; } SetRef(didAlter); + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here (removed || !exists) && SetRef(didChangeSize); if (removed && entries.length === 1) { @@ -266,12 +223,15 @@ class ArrayMapNode { return createNodes(ownerID, entries, key, value); } - var isEditable = ownerID && ownerID === this.ownerID; - var newEntries = isEditable ? entries : arrCopy(entries); + const isEditable = ownerID && ownerID === this.ownerID; + const newEntries = isEditable ? entries : arrCopy(entries); if (exists) { if (removed) { - idx === len - 1 ? newEntries.pop() : (newEntries[idx] = newEntries.pop()); + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + idx === len - 1 + ? newEntries.pop() + : (newEntries[idx] = newEntries.pop()); } else { newEntries[idx] = [key, value]; } @@ -289,7 +249,6 @@ class ArrayMapNode { } class BitmapIndexedNode { - constructor(ownerID, bitmap, nodes) { this.ownerID = ownerID; this.bitmap = bitmap; @@ -300,29 +259,44 @@ class BitmapIndexedNode { if (keyHash === undefined) { keyHash = hash(key); } - var bit = (1 << ((shift === 0 ? keyHash : keyHash >>> shift) & MASK)); - var bitmap = this.bitmap; - return (bitmap & bit) === 0 ? notSetValue : - this.nodes[popCount(bitmap & (bit - 1))].get(shift + SHIFT, keyHash, key, notSetValue); + const bit = 1 << ((shift === 0 ? keyHash : keyHash >>> shift) & MASK); + const bitmap = this.bitmap; + return (bitmap & bit) === 0 + ? notSetValue + : this.nodes[popCount(bitmap & (bit - 1))].get( + shift + SHIFT, + keyHash, + key, + notSetValue + ); } update(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { if (keyHash === undefined) { keyHash = hash(key); } - var keyHashFrag = (shift === 0 ? keyHash : keyHash >>> shift) & MASK; - var bit = 1 << keyHashFrag; - var bitmap = this.bitmap; - var exists = (bitmap & bit) !== 0; + const keyHashFrag = (shift === 0 ? keyHash : keyHash >>> shift) & MASK; + const bit = 1 << keyHashFrag; + const bitmap = this.bitmap; + const exists = (bitmap & bit) !== 0; if (!exists && value === NOT_SET) { return this; } - var idx = popCount(bitmap & (bit - 1)); - var nodes = this.nodes; - var node = exists ? nodes[idx] : undefined; - var newNode = updateNode(node, ownerID, shift + SHIFT, keyHash, key, value, didChangeSize, didAlter); + const idx = popCount(bitmap & (bit - 1)); + const nodes = this.nodes; + const node = exists ? nodes[idx] : undefined; + const newNode = updateNode( + node, + ownerID, + shift + SHIFT, + keyHash, + key, + value, + didChangeSize, + didAlter + ); if (newNode === node) { return this; @@ -332,7 +306,12 @@ class BitmapIndexedNode { return expandNodes(ownerID, nodes, bitmap, keyHashFrag, newNode); } - if (exists && !newNode && nodes.length === 2 && isLeafNode(nodes[idx ^ 1])) { + if ( + exists && + !newNode && + nodes.length === 2 && + isLeafNode(nodes[idx ^ 1]) + ) { return nodes[idx ^ 1]; } @@ -340,12 +319,13 @@ class BitmapIndexedNode { return newNode; } - var isEditable = ownerID && ownerID === this.ownerID; - var newBitmap = exists ? newNode ? bitmap : bitmap ^ bit : bitmap | bit; - var newNodes = exists ? newNode ? - setIn(nodes, idx, newNode, isEditable) : - spliceOut(nodes, idx, isEditable) : - spliceIn(nodes, idx, newNode, isEditable); + const isEditable = ownerID && ownerID === this.ownerID; + const newBitmap = exists ? (newNode ? bitmap : bitmap ^ bit) : bitmap | bit; + const newNodes = exists + ? newNode + ? setAt(nodes, idx, newNode, isEditable) + : spliceOut(nodes, idx, isEditable) + : spliceIn(nodes, idx, newNode, isEditable); if (isEditable) { this.bitmap = newBitmap; @@ -358,7 +338,6 @@ class BitmapIndexedNode { } class HashArrayMapNode { - constructor(ownerID, count, nodes) { this.ownerID = ownerID; this.count = count; @@ -369,30 +348,41 @@ class HashArrayMapNode { if (keyHash === undefined) { keyHash = hash(key); } - var idx = (shift === 0 ? keyHash : keyHash >>> shift) & MASK; - var node = this.nodes[idx]; - return node ? node.get(shift + SHIFT, keyHash, key, notSetValue) : notSetValue; + const idx = (shift === 0 ? keyHash : keyHash >>> shift) & MASK; + const node = this.nodes[idx]; + return node + ? node.get(shift + SHIFT, keyHash, key, notSetValue) + : notSetValue; } update(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { if (keyHash === undefined) { keyHash = hash(key); } - var idx = (shift === 0 ? keyHash : keyHash >>> shift) & MASK; - var removed = value === NOT_SET; - var nodes = this.nodes; - var node = nodes[idx]; + const idx = (shift === 0 ? keyHash : keyHash >>> shift) & MASK; + const removed = value === NOT_SET; + const nodes = this.nodes; + const node = nodes[idx]; if (removed && !node) { return this; } - var newNode = updateNode(node, ownerID, shift + SHIFT, keyHash, key, value, didChangeSize, didAlter); + const newNode = updateNode( + node, + ownerID, + shift + SHIFT, + keyHash, + key, + value, + didChangeSize, + didAlter + ); if (newNode === node) { return this; } - var newCount = this.count; + let newCount = this.count; if (!node) { newCount++; } else if (!newNode) { @@ -402,8 +392,8 @@ class HashArrayMapNode { } } - var isEditable = ownerID && ownerID === this.ownerID; - var newNodes = setIn(nodes, idx, newNode, isEditable); + const isEditable = ownerID && ownerID === this.ownerID; + const newNodes = setAt(nodes, idx, newNode, isEditable); if (isEditable) { this.count = newCount; @@ -416,7 +406,6 @@ class HashArrayMapNode { } class HashCollisionNode { - constructor(ownerID, keyHash, entries) { this.ownerID = ownerID; this.keyHash = keyHash; @@ -424,8 +413,8 @@ class HashCollisionNode { } get(shift, keyHash, key, notSetValue) { - var entries = this.entries; - for (var ii = 0, len = entries.length; ii < len; ii++) { + const entries = this.entries; + for (let ii = 0, len = entries.length; ii < len; ii++) { if (is(key, entries[ii][0])) { return entries[ii][1]; } @@ -438,7 +427,7 @@ class HashCollisionNode { keyHash = hash(key); } - var removed = value === NOT_SET; + const removed = value === NOT_SET; if (keyHash !== this.keyHash) { if (removed) { @@ -449,32 +438,37 @@ class HashCollisionNode { return mergeIntoNode(this, ownerID, shift, keyHash, [key, value]); } - var entries = this.entries; - var idx = 0; - for (var len = entries.length; idx < len; idx++) { + const entries = this.entries; + let idx = 0; + const len = entries.length; + for (; idx < len; idx++) { if (is(key, entries[idx][0])) { break; } } - var exists = idx < len; + const exists = idx < len; if (exists ? entries[idx][1] === value : removed) { return this; } SetRef(didAlter); + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here (removed || !exists) && SetRef(didChangeSize); if (removed && len === 2) { return new ValueNode(ownerID, this.keyHash, entries[idx ^ 1]); } - var isEditable = ownerID && ownerID === this.ownerID; - var newEntries = isEditable ? entries : arrCopy(entries); + const isEditable = ownerID && ownerID === this.ownerID; + const newEntries = isEditable ? entries : arrCopy(entries); if (exists) { if (removed) { - idx === len - 1 ? newEntries.pop() : (newEntries[idx] = newEntries.pop()); + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + idx === len - 1 + ? newEntries.pop() + : (newEntries[idx] = newEntries.pop()); } else { newEntries[idx] = [key, value]; } @@ -492,7 +486,6 @@ class HashCollisionNode { } class ValueNode { - constructor(ownerID, keyHash, entry) { this.ownerID = ownerID; this.keyHash = keyHash; @@ -504,8 +497,8 @@ class ValueNode { } update(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { - var removed = value === NOT_SET; - var keyMatch = is(key, this.entry[0]); + const removed = value === NOT_SET; + const keyMatch = is(key, this.entry[0]); if (keyMatch ? value === this.entry[1] : removed) { return this; } @@ -530,36 +523,35 @@ class ValueNode { } } - // #pragma Iterators -ArrayMapNode.prototype.iterate = -HashCollisionNode.prototype.iterate = function (fn, reverse) { - var entries = this.entries; - for (var ii = 0, maxIndex = entries.length - 1; ii <= maxIndex; ii++) { - if (fn(entries[reverse ? maxIndex - ii : ii]) === false) { - return false; +ArrayMapNode.prototype.iterate = HashCollisionNode.prototype.iterate = + function (fn, reverse) { + const entries = this.entries; + for (let ii = 0, maxIndex = entries.length - 1; ii <= maxIndex; ii++) { + if (fn(entries[reverse ? maxIndex - ii : ii]) === false) { + return false; + } } - } -} + }; -BitmapIndexedNode.prototype.iterate = -HashArrayMapNode.prototype.iterate = function (fn, reverse) { - var nodes = this.nodes; - for (var ii = 0, maxIndex = nodes.length - 1; ii <= maxIndex; ii++) { - var node = nodes[reverse ? maxIndex - ii : ii]; - if (node && node.iterate(fn, reverse) === false) { - return false; +BitmapIndexedNode.prototype.iterate = HashArrayMapNode.prototype.iterate = + function (fn, reverse) { + const nodes = this.nodes; + for (let ii = 0, maxIndex = nodes.length - 1; ii <= maxIndex; ii++) { + const node = nodes[reverse ? maxIndex - ii : ii]; + if (node && node.iterate(fn, reverse) === false) { + return false; + } } - } -} + }; +// eslint-disable-next-line @typescript-eslint/no-unused-vars ValueNode.prototype.iterate = function (fn, reverse) { return fn(this.entry); -} +}; class MapIterator extends Iterator { - constructor(map, type, reverse) { this._type = type; this._reverse = reverse; @@ -567,12 +559,12 @@ class MapIterator extends Iterator { } next() { - var type = this._type; - var stack = this._stack; + const type = this._type; + let stack = this._stack; while (stack) { - var node = stack.node; - var index = stack.index++; - var maxIndex; + const node = stack.node; + const index = stack.index++; + let maxIndex; if (node.entry) { if (index === 0) { return mapIteratorValue(type, node.entry); @@ -580,12 +572,15 @@ class MapIterator extends Iterator { } else if (node.entries) { maxIndex = node.entries.length - 1; if (index <= maxIndex) { - return mapIteratorValue(type, node.entries[this._reverse ? maxIndex - index : index]); + return mapIteratorValue( + type, + node.entries[this._reverse ? maxIndex - index : index] + ); } } else { maxIndex = node.nodes.length - 1; if (index <= maxIndex) { - var subNode = node.nodes[this._reverse ? maxIndex - index : index]; + const subNode = node.nodes[this._reverse ? maxIndex - index : index]; if (subNode) { if (subNode.entry) { return mapIteratorValue(type, subNode.entry); @@ -609,12 +604,12 @@ function mapIteratorFrame(node, prev) { return { node: node, index: 0, - __prev: prev + __prev: prev, }; } function makeMap(size, root, ownerID, hash) { - var map = Object.create(MapPrototype); + const map = Object.create(MapPrototype); map.size = size; map._root = root; map.__ownerID = ownerID; @@ -623,14 +618,14 @@ function makeMap(size, root, ownerID, hash) { return map; } -var EMPTY_MAP; +let EMPTY_MAP; export function emptyMap() { return EMPTY_MAP || (EMPTY_MAP = makeMap(0)); } function updateMap(map, k, v) { - var newRoot; - var newSize; + let newRoot; + let newSize; if (!map._root) { if (v === NOT_SET) { return map; @@ -638,13 +633,22 @@ function updateMap(map, k, v) { newSize = 1; newRoot = new ArrayMapNode(map.__ownerID, [[k, v]]); } else { - var didChangeSize = MakeRef(CHANGE_LENGTH); - var didAlter = MakeRef(DID_ALTER); - newRoot = updateNode(map._root, map.__ownerID, 0, undefined, k, v, didChangeSize, didAlter); + const didChangeSize = MakeRef(); + const didAlter = MakeRef(); + newRoot = updateNode( + map._root, + map.__ownerID, + 0, + undefined, + k, + v, + didChangeSize, + didAlter + ); if (!didAlter.value) { return map; } - newSize = map.size + (didChangeSize.value ? v === NOT_SET ? -1 : 1 : 0); + newSize = map.size + (didChangeSize.value ? (v === NOT_SET ? -1 : 1) : 0); } if (map.__ownerID) { map.size = newSize; @@ -656,7 +660,16 @@ function updateMap(map, k, v) { return newRoot ? makeMap(newSize, newRoot) : emptyMap(); } -function updateNode(node, ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { +function updateNode( + node, + ownerID, + shift, + keyHash, + key, + value, + didChangeSize, + didAlter +) { if (!node) { if (value === NOT_SET) { return node; @@ -665,11 +678,21 @@ function updateNode(node, ownerID, shift, keyHash, key, value, didChangeSize, di SetRef(didChangeSize); return new ValueNode(ownerID, keyHash, [key, value]); } - return node.update(ownerID, shift, keyHash, key, value, didChangeSize, didAlter); + return node.update( + ownerID, + shift, + keyHash, + key, + value, + didChangeSize, + didAlter + ); } function isLeafNode(node) { - return node.constructor === ValueNode || node.constructor === HashCollisionNode; + return ( + node.constructor === ValueNode || node.constructor === HashCollisionNode + ); } function mergeIntoNode(node, ownerID, shift, keyHash, entry) { @@ -677,13 +700,15 @@ function mergeIntoNode(node, ownerID, shift, keyHash, entry) { return new HashCollisionNode(ownerID, keyHash, [node.entry, entry]); } - var idx1 = (shift === 0 ? node.keyHash : node.keyHash >>> shift) & MASK; - var idx2 = (shift === 0 ? keyHash : keyHash >>> shift) & MASK; + const idx1 = (shift === 0 ? node.keyHash : node.keyHash >>> shift) & MASK; + const idx2 = (shift === 0 ? keyHash : keyHash >>> shift) & MASK; - var newNode; - var nodes = idx1 === idx2 ? - [mergeIntoNode(node, ownerID, shift + SHIFT, keyHash, entry)] : - ((newNode = new ValueNode(ownerID, keyHash, entry)), idx1 < idx2 ? [node, newNode] : [newNode, node]); + let newNode; + const nodes = + idx1 === idx2 + ? [mergeIntoNode(node, ownerID, shift + SHIFT, keyHash, entry)] + : ((newNode = new ValueNode(ownerID, keyHash, entry)), + idx1 < idx2 ? [node, newNode] : [newNode, node]); return new BitmapIndexedNode(ownerID, (1 << idx1) | (1 << idx2), nodes); } @@ -692,20 +717,20 @@ function createNodes(ownerID, entries, key, value) { if (!ownerID) { ownerID = new OwnerID(); } - var node = new ValueNode(ownerID, hash(key), [key, value]); - for (var ii = 0; ii < entries.length; ii++) { - var entry = entries[ii]; + let node = new ValueNode(ownerID, hash(key), [key, value]); + for (let ii = 0; ii < entries.length; ii++) { + const entry = entries[ii]; node = node.update(ownerID, 0, undefined, entry[0], entry[1]); } return node; } function packNodes(ownerID, nodes, count, excluding) { - var bitmap = 0; - var packedII = 0; - var packedNodes = new Array(count); - for (var ii = 0, bit = 1, len = nodes.length; ii < len; ii++, bit <<= 1) { - var node = nodes[ii]; + let bitmap = 0; + let packedII = 0; + const packedNodes = new Array(count); + for (let ii = 0, bit = 1, len = nodes.length; ii < len; ii++, bit <<= 1) { + const node = nodes[ii]; if (node !== undefined && ii !== excluding) { bitmap |= bit; packedNodes[packedII++] = node; @@ -715,117 +740,39 @@ function packNodes(ownerID, nodes, count, excluding) { } function expandNodes(ownerID, nodes, bitmap, including, node) { - var count = 0; - var expandedNodes = new Array(SIZE); - for (var ii = 0; bitmap !== 0; ii++, bitmap >>>= 1) { + let count = 0; + const expandedNodes = new Array(SIZE); + for (let ii = 0; bitmap !== 0; ii++, bitmap >>>= 1) { expandedNodes[ii] = bitmap & 1 ? nodes[count++] : undefined; } expandedNodes[including] = node; return new HashArrayMapNode(ownerID, count + 1, expandedNodes); } -function mergeIntoMapWith(map, merger, iterables) { - var iters = []; - for (var ii = 0; ii < iterables.length; ii++) { - var value = iterables[ii]; - var iter = KeyedIterable(value); - if (!isIterable(value)) { - iter = iter.map(v => fromJS(v)); - } - iters.push(iter); - } - return mergeIntoCollectionWith(map, merger, iters); -} - -export function deepMerger(existing, value, key) { - return existing && existing.mergeDeep && isIterable(value) ? - existing.mergeDeep(value) : - is(existing, value) ? existing : value; -} - -export function deepMergerWith(merger) { - return (existing, value, key) => { - if (existing && existing.mergeDeepWith && isIterable(value)) { - return existing.mergeDeepWith(merger, value); - } - var nextValue = merger(existing, value, key); - return is(existing, nextValue) ? existing : nextValue; - }; -} - -export function mergeIntoCollectionWith(collection, merger, iters) { - iters = iters.filter(x => x.size !== 0); - if (iters.length === 0) { - return collection; - } - if (collection.size === 0 && !collection.__ownerID && iters.length === 1) { - return collection.constructor(iters[0]); - } - return collection.withMutations(collection => { - var mergeIntoMap = merger ? - (value, key) => { - collection.update(key, NOT_SET, existing => - existing === NOT_SET ? value : merger(existing, value, key) - ); - } : - (value, key) => { - collection.set(key, value); - } - for (var ii = 0; ii < iters.length; ii++) { - iters[ii].forEach(mergeIntoMap); - } - }); -} - -function updateInDeepMap(existing, keyPathIter, notSetValue, updater) { - var isNotSet = existing === NOT_SET; - var step = keyPathIter.next(); - if (step.done) { - var existingValue = isNotSet ? notSetValue : existing; - var newValue = updater(existingValue); - return newValue === existingValue ? existing : newValue; - } - invariant( - isNotSet || (existing && existing.set), - 'invalid keyPath' - ); - var key = step.value; - var nextExisting = isNotSet ? NOT_SET : existing.get(key, NOT_SET); - var nextUpdated = updateInDeepMap( - nextExisting, - keyPathIter, - notSetValue, - updater - ); - return nextUpdated === nextExisting ? existing : - nextUpdated === NOT_SET ? existing.remove(key) : - (isNotSet ? emptyMap() : existing).set(key, nextUpdated); -} - function popCount(x) { - x = x - ((x >> 1) & 0x55555555); + x -= (x >> 1) & 0x55555555; x = (x & 0x33333333) + ((x >> 2) & 0x33333333); x = (x + (x >> 4)) & 0x0f0f0f0f; - x = x + (x >> 8); - x = x + (x >> 16); + x += x >> 8; + x += x >> 16; return x & 0x7f; } -function setIn(array, idx, val, canEdit) { - var newArray = canEdit ? array : arrCopy(array); +function setAt(array, idx, val, canEdit) { + const newArray = canEdit ? array : arrCopy(array); newArray[idx] = val; return newArray; } function spliceIn(array, idx, val, canEdit) { - var newLen = array.length + 1; + const newLen = array.length + 1; if (canEdit && idx + 1 === newLen) { array[idx] = val; return array; } - var newArray = new Array(newLen); - var after = 0; - for (var ii = 0; ii < newLen; ii++) { + const newArray = new Array(newLen); + let after = 0; + for (let ii = 0; ii < newLen; ii++) { if (ii === idx) { newArray[ii] = val; after = -1; @@ -837,14 +784,14 @@ function spliceIn(array, idx, val, canEdit) { } function spliceOut(array, idx, canEdit) { - var newLen = array.length - 1; + const newLen = array.length - 1; if (canEdit && idx === newLen) { array.pop(); return array; } - var newArray = new Array(newLen); - var after = 0; - for (var ii = 0; ii < newLen; ii++) { + const newArray = new Array(newLen); + let after = 0; + for (let ii = 0; ii < newLen; ii++) { if (ii === idx) { after = 1; } @@ -853,6 +800,6 @@ function spliceOut(array, idx, canEdit) { return newArray; } -var MAX_ARRAY_MAP_SIZE = SIZE / 4; -var MAX_BITMAP_INDEXED_SIZE = SIZE / 2; -var MIN_HASH_ARRAY_MAP_SIZE = SIZE / 4; +const MAX_ARRAY_MAP_SIZE = SIZE / 4; +const MAX_BITMAP_INDEXED_SIZE = SIZE / 2; +const MIN_HASH_ARRAY_MAP_SIZE = SIZE / 4; diff --git a/src/Math.js b/src/Math.js index 7f5570b01b..0075e73cd3 100644 --- a/src/Math.js +++ b/src/Math.js @@ -1,28 +1,19 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -export var imul = - typeof Math.imul === 'function' && Math.imul(0xffffffff, 2) === -2 ? - Math.imul : - function imul(a, b) { - a = a | 0; // int - b = b | 0; // int - var c = a & 0xffff; - var d = b & 0xffff; - // Shift by 0 fixes the sign on the high part. - return (c * d) + ((((a >>> 16) * d + c * (b >>> 16)) << 16) >>> 0) | 0; // int - }; +export const imul = + typeof Math.imul === 'function' && Math.imul(0xffffffff, 2) === -2 + ? Math.imul + : function imul(a, b) { + a |= 0; // int + b |= 0; // int + const c = a & 0xffff; + const d = b & 0xffff; + // Shift by 0 fixes the sign on the high part. + return (c * d + ((((a >>> 16) * d + c * (b >>> 16)) << 16) >>> 0)) | 0; // int + }; // v8 has an optimization for storing 31-bit signed numbers. // Values which have either 00 or 11 as the high order bits qualify. // This function drops the highest order bit in a signed number, maintaining // the sign bit. export function smi(i32) { - return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF); + return ((i32 >>> 1) & 0x40000000) | (i32 & 0xbfffffff); } diff --git a/src/Operations.js b/src/Operations.js index 92ed18a5d6..bb3b16568d 100644 --- a/src/Operations.js +++ b/src/Operations.js @@ -1,26 +1,43 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -import { NOT_SET, ensureSize, wrapIndex, wholeSlice, resolveBegin, resolveEnd } from './TrieUtils' -import { isIterable, isKeyed, isIndexed, isOrdered, - Iterable, KeyedIterable, SetIterable, IndexedIterable, - IS_ORDERED_SENTINEL } from './Iterable' -import { getIterator, Iterator, iteratorValue, iteratorDone, - ITERATE_KEYS, ITERATE_VALUES, ITERATE_ENTRIES } from './Iterator' -import { isSeq, Seq, KeyedSeq, SetSeq, IndexedSeq, - keyedSeqFromValue, indexedSeqFromValue, ArraySeq } from './Seq' - -import assertNotInfinite from './utils/assertNotInfinite' - -import { Map } from './Map' -import { OrderedMap } from './OrderedMap' - +import { + NOT_SET, + ensureSize, + wrapIndex, + wholeSlice, + resolveBegin, + resolveEnd, +} from './TrieUtils'; +import { + Collection, + KeyedCollection, + SetCollection, + IndexedCollection, +} from './Collection'; +import { isCollection } from './predicates/isCollection'; +import { IS_KEYED_SYMBOL, isKeyed } from './predicates/isKeyed'; +import { IS_INDEXED_SYMBOL, isIndexed } from './predicates/isIndexed'; +import { isOrdered, IS_ORDERED_SYMBOL } from './predicates/isOrdered'; +import { isSeq } from './predicates/isSeq'; +import { + getIterator, + Iterator, + iteratorValue, + iteratorDone, + ITERATE_KEYS, + ITERATE_VALUES, + ITERATE_ENTRIES, +} from './Iterator'; +import { + Seq, + KeyedSeq, + SetSeq, + IndexedSeq, + keyedSeqFromValue, + indexedSeqFromValue, + ArraySeq, +} from './Seq'; + +import { Map } from './Map'; +import { OrderedMap } from './OrderedMap'; export class ToKeyedSequence extends KeyedSeq { constructor(indexed, useKeys) { @@ -42,7 +59,7 @@ export class ToKeyedSequence extends KeyedSeq { } reverse() { - var reversedSequence = reverseFactory(this, true); + const reversedSequence = reverseFactory(this, true); if (!this._useKeys) { reversedSequence.valueSeq = () => this._iter.toSeq().reverse(); } @@ -50,7 +67,7 @@ export class ToKeyedSequence extends KeyedSeq { } map(mapper, context) { - var mappedSequence = mapFactory(this, mapper, context); + const mappedSequence = mapFactory(this, mapper, context); if (!this._useKeys) { mappedSequence.valueSeq = () => this._iter.toSeq().map(mapper, context); } @@ -58,31 +75,14 @@ export class ToKeyedSequence extends KeyedSeq { } __iterate(fn, reverse) { - var ii; - return this._iter.__iterate( - this._useKeys ? - (v, k) => fn(v, k, this) : - ((ii = reverse ? resolveSize(this) : 0), - v => fn(v, reverse ? --ii : ii++, this)), - reverse - ); + return this._iter.__iterate((v, k) => fn(v, k, this), reverse); } __iterator(type, reverse) { - if (this._useKeys) { - return this._iter.__iterator(type, reverse); - } - var iterator = this._iter.__iterator(ITERATE_VALUES, reverse); - var ii = reverse ? resolveSize(this) : 0; - return new Iterator(() => { - var step = iterator.next(); - return step.done ? step : - iteratorValue(type, reverse ? --ii : ii++, step.value, step); - }); + return this._iter.__iterator(type, reverse); } } -ToKeyedSequence.prototype[IS_ORDERED_SENTINEL] = true; - +ToKeyedSequence.prototype[IS_ORDERED_SYMBOL] = true; export class ToIndexedSequence extends IndexedSeq { constructor(iter) { @@ -95,22 +95,34 @@ export class ToIndexedSequence extends IndexedSeq { } __iterate(fn, reverse) { - var iterations = 0; - return this._iter.__iterate(v => fn(v, iterations++, this), reverse); + let i = 0; + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + reverse && ensureSize(this); + return this._iter.__iterate( + (v) => fn(v, reverse ? this.size - ++i : i++, this), + reverse + ); } __iterator(type, reverse) { - var iterator = this._iter.__iterator(ITERATE_VALUES, reverse); - var iterations = 0; + const iterator = this._iter.__iterator(ITERATE_VALUES, reverse); + let i = 0; + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + reverse && ensureSize(this); return new Iterator(() => { - var step = iterator.next(); - return step.done ? step : - iteratorValue(type, iterations++, step.value, step) + const step = iterator.next(); + return step.done + ? step + : iteratorValue( + type, + reverse ? this.size - ++i : i++, + step.value, + step + ); }); } } - export class ToSetSequence extends SetSeq { constructor(iter) { this._iter = iter; @@ -122,20 +134,20 @@ export class ToSetSequence extends SetSeq { } __iterate(fn, reverse) { - return this._iter.__iterate(v => fn(v, v, this), reverse); + return this._iter.__iterate((v) => fn(v, v, this), reverse); } __iterator(type, reverse) { - var iterator = this._iter.__iterator(ITERATE_VALUES, reverse); + const iterator = this._iter.__iterator(ITERATE_VALUES, reverse); return new Iterator(() => { - var step = iterator.next(); - return step.done ? step : - iteratorValue(type, step.value, step.value, step); + const step = iterator.next(); + return step.done + ? step + : iteratorValue(type, step.value, step.value, step); }); } } - export class FromEntriesSequence extends KeyedSeq { constructor(entries) { this._iter = entries; @@ -147,15 +159,15 @@ export class FromEntriesSequence extends KeyedSeq { } __iterate(fn, reverse) { - return this._iter.__iterate(entry => { + return this._iter.__iterate((entry) => { // Check if entry exists first so array access doesn't throw for holes // in the parent iteration. if (entry) { validateEntry(entry); - var indexedIterable = isIterable(entry); + const indexedCollection = isCollection(entry); return fn( - indexedIterable ? entry.get(1) : entry[1], - indexedIterable ? entry.get(0) : entry[0], + indexedCollection ? entry.get(1) : entry[1], + indexedCollection ? entry.get(0) : entry[0], this ); } @@ -163,23 +175,23 @@ export class FromEntriesSequence extends KeyedSeq { } __iterator(type, reverse) { - var iterator = this._iter.__iterator(ITERATE_VALUES, reverse); + const iterator = this._iter.__iterator(ITERATE_VALUES, reverse); return new Iterator(() => { while (true) { - var step = iterator.next(); + const step = iterator.next(); if (step.done) { return step; } - var entry = step.value; + const entry = step.value; // Check if entry exists first so array access doesn't throw for holes // in the parent iteration. if (entry) { validateEntry(entry); - var indexedIterable = isIterable(entry); + const indexedCollection = isCollection(entry); return iteratorValue( type, - indexedIterable ? entry.get(0) : entry[0], - indexedIterable ? entry.get(1) : entry[1], + indexedCollection ? entry.get(0) : entry[0], + indexedCollection ? entry.get(1) : entry[1], step ); } @@ -189,130 +201,149 @@ export class FromEntriesSequence extends KeyedSeq { } ToIndexedSequence.prototype.cacheResult = -ToKeyedSequence.prototype.cacheResult = -ToSetSequence.prototype.cacheResult = -FromEntriesSequence.prototype.cacheResult = - cacheResultThrough; - - -export function flipFactory(iterable) { - var flipSequence = makeSequence(iterable); - flipSequence._iter = iterable; - flipSequence.size = iterable.size; - flipSequence.flip = () => iterable; + ToKeyedSequence.prototype.cacheResult = + ToSetSequence.prototype.cacheResult = + FromEntriesSequence.prototype.cacheResult = + cacheResultThrough; + +export function flipFactory(collection) { + const flipSequence = makeSequence(collection); + flipSequence._iter = collection; + flipSequence.size = collection.size; + flipSequence.flip = () => collection; flipSequence.reverse = function () { - var reversedSequence = iterable.reverse.apply(this); // super.reverse() - reversedSequence.flip = () => iterable.reverse(); + const reversedSequence = collection.reverse.apply(this); // super.reverse() + reversedSequence.flip = () => collection.reverse(); return reversedSequence; }; - flipSequence.has = key => iterable.includes(key); - flipSequence.includes = key => iterable.has(key); + flipSequence.has = (key) => collection.includes(key); + flipSequence.includes = (key) => collection.has(key); flipSequence.cacheResult = cacheResultThrough; flipSequence.__iterateUncached = function (fn, reverse) { - return iterable.__iterate((v, k) => fn(k, v, this) !== false, reverse); - } - flipSequence.__iteratorUncached = function(type, reverse) { + return collection.__iterate((v, k) => fn(k, v, this) !== false, reverse); + }; + flipSequence.__iteratorUncached = function (type, reverse) { if (type === ITERATE_ENTRIES) { - var iterator = iterable.__iterator(type, reverse); + const iterator = collection.__iterator(type, reverse); return new Iterator(() => { - var step = iterator.next(); + const step = iterator.next(); if (!step.done) { - var k = step.value[0]; + const k = step.value[0]; step.value[0] = step.value[1]; step.value[1] = k; } return step; }); } - return iterable.__iterator( + return collection.__iterator( type === ITERATE_VALUES ? ITERATE_KEYS : ITERATE_VALUES, reverse ); - } + }; return flipSequence; } - -export function mapFactory(iterable, mapper, context) { - var mappedSequence = makeSequence(iterable); - mappedSequence.size = iterable.size; - mappedSequence.has = key => iterable.has(key); +export function mapFactory(collection, mapper, context) { + const mappedSequence = makeSequence(collection); + mappedSequence.size = collection.size; + mappedSequence.has = (key) => collection.has(key); mappedSequence.get = (key, notSetValue) => { - var v = iterable.get(key, NOT_SET); - return v === NOT_SET ? - notSetValue : - mapper.call(context, v, key, iterable); + const v = collection.get(key, NOT_SET); + return v === NOT_SET + ? notSetValue + : mapper.call(context, v, key, collection); }; mappedSequence.__iterateUncached = function (fn, reverse) { - return iterable.__iterate( + return collection.__iterate( (v, k, c) => fn(mapper.call(context, v, k, c), k, this) !== false, reverse ); - } + }; mappedSequence.__iteratorUncached = function (type, reverse) { - var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse); + const iterator = collection.__iterator(ITERATE_ENTRIES, reverse); return new Iterator(() => { - var step = iterator.next(); + const step = iterator.next(); if (step.done) { return step; } - var entry = step.value; - var key = entry[0]; + const entry = step.value; + const key = entry[0]; return iteratorValue( type, key, - mapper.call(context, entry[1], key, iterable), + mapper.call(context, entry[1], key, collection), step ); }); - } + }; return mappedSequence; } - -export function reverseFactory(iterable, useKeys) { - var reversedSequence = makeSequence(iterable); - reversedSequence._iter = iterable; - reversedSequence.size = iterable.size; - reversedSequence.reverse = () => iterable; - if (iterable.flip) { +export function reverseFactory(collection, useKeys) { + const reversedSequence = makeSequence(collection); + reversedSequence._iter = collection; + reversedSequence.size = collection.size; + reversedSequence.reverse = () => collection; + if (collection.flip) { reversedSequence.flip = function () { - var flipSequence = flipFactory(iterable); - flipSequence.reverse = () => iterable.flip(); + const flipSequence = flipFactory(collection); + flipSequence.reverse = () => collection.flip(); return flipSequence; }; } reversedSequence.get = (key, notSetValue) => - iterable.get(useKeys ? key : -1 - key, notSetValue); - reversedSequence.has = key => - iterable.has(useKeys ? key : -1 - key); - reversedSequence.includes = value => iterable.includes(value); + collection.get(useKeys ? key : -1 - key, notSetValue); + reversedSequence.has = (key) => collection.has(useKeys ? key : -1 - key); + reversedSequence.includes = (value) => collection.includes(value); reversedSequence.cacheResult = cacheResultThrough; reversedSequence.__iterate = function (fn, reverse) { - return iterable.__iterate((v, k) => fn(v, k, this), !reverse); + let i = 0; + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + reverse && ensureSize(collection); + return collection.__iterate( + (v, k) => fn(v, useKeys ? k : reverse ? this.size - ++i : i++, this), + !reverse + ); + }; + reversedSequence.__iterator = (type, reverse) => { + let i = 0; + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + reverse && ensureSize(collection); + const iterator = collection.__iterator(ITERATE_ENTRIES, !reverse); + return new Iterator(() => { + const step = iterator.next(); + if (step.done) { + return step; + } + const entry = step.value; + return iteratorValue( + type, + useKeys ? entry[0] : reverse ? this.size - ++i : i++, + entry[1], + step + ); + }); }; - reversedSequence.__iterator = - (type, reverse) => iterable.__iterator(type, !reverse); return reversedSequence; } - -export function filterFactory(iterable, predicate, context, useKeys) { - var filterSequence = makeSequence(iterable); +export function filterFactory(collection, predicate, context, useKeys) { + const filterSequence = makeSequence(collection); if (useKeys) { - filterSequence.has = key => { - var v = iterable.get(key, NOT_SET); - return v !== NOT_SET && !!predicate.call(context, v, key, iterable); + filterSequence.has = (key) => { + const v = collection.get(key, NOT_SET); + return v !== NOT_SET && !!predicate.call(context, v, key, collection); }; filterSequence.get = (key, notSetValue) => { - var v = iterable.get(key, NOT_SET); - return v !== NOT_SET && predicate.call(context, v, key, iterable) ? - v : notSetValue; + const v = collection.get(key, NOT_SET); + return v !== NOT_SET && predicate.call(context, v, key, collection) + ? v + : notSetValue; }; } filterSequence.__iterateUncached = function (fn, reverse) { - var iterations = 0; - iterable.__iterate((v, k, c) => { + let iterations = 0; + collection.__iterate((v, k, c) => { if (predicate.call(context, v, k, c)) { iterations++; return fn(v, useKeys ? k : iterations - 1, this); @@ -321,137 +352,135 @@ export function filterFactory(iterable, predicate, context, useKeys) { return iterations; }; filterSequence.__iteratorUncached = function (type, reverse) { - var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse); - var iterations = 0; + const iterator = collection.__iterator(ITERATE_ENTRIES, reverse); + let iterations = 0; return new Iterator(() => { while (true) { - var step = iterator.next(); + const step = iterator.next(); if (step.done) { return step; } - var entry = step.value; - var key = entry[0]; - var value = entry[1]; - if (predicate.call(context, value, key, iterable)) { + const entry = step.value; + const key = entry[0]; + const value = entry[1]; + if (predicate.call(context, value, key, collection)) { return iteratorValue(type, useKeys ? key : iterations++, value, step); } } }); - } + }; return filterSequence; } - -export function countByFactory(iterable, grouper, context) { - var groups = Map().asMutable(); - iterable.__iterate((v, k) => { - groups.update( - grouper.call(context, v, k, iterable), - 0, - a => a + 1 - ); +export function countByFactory(collection, grouper, context) { + const groups = Map().asMutable(); + collection.__iterate((v, k) => { + groups.update(grouper.call(context, v, k, collection), 0, (a) => a + 1); }); return groups.asImmutable(); } - -export function groupByFactory(iterable, grouper, context) { - var isKeyedIter = isKeyed(iterable); - var groups = (isOrdered(iterable) ? OrderedMap() : Map()).asMutable(); - iterable.__iterate((v, k) => { +export function groupByFactory(collection, grouper, context) { + const isKeyedIter = isKeyed(collection); + const groups = (isOrdered(collection) ? OrderedMap() : Map()).asMutable(); + collection.__iterate((v, k) => { groups.update( - grouper.call(context, v, k, iterable), - a => (a = a || [], a.push(isKeyedIter ? [k, v] : v), a) + grouper.call(context, v, k, collection), + (a) => ((a = a || []), a.push(isKeyedIter ? [k, v] : v), a) ); }); - var coerce = iterableClass(iterable); - return groups.map(arr => reify(iterable, coerce(arr))); + const coerce = collectionClass(collection); + return groups.map((arr) => reify(collection, coerce(arr))).asImmutable(); } +export function partitionFactory(collection, predicate, context) { + const isKeyedIter = isKeyed(collection); + const groups = [[], []]; + collection.__iterate((v, k) => { + groups[predicate.call(context, v, k, collection) ? 1 : 0].push( + isKeyedIter ? [k, v] : v + ); + }); + const coerce = collectionClass(collection); + return groups.map((arr) => reify(collection, coerce(arr))); +} -export function sliceFactory(iterable, begin, end, useKeys) { - var originalSize = iterable.size; - - // Sanitize begin & end using this shorthand for ToInt32(argument) - // http://www.ecma-international.org/ecma-262/6.0/#sec-toint32 - if (begin !== undefined) { - begin = begin | 0; - } - if (end !== undefined) { - if (end === Infinity) { - end = originalSize; - } else { - end = end | 0; - } - } +export function sliceFactory(collection, begin, end, useKeys) { + const originalSize = collection.size; if (wholeSlice(begin, end, originalSize)) { - return iterable; + return collection; } - var resolvedBegin = resolveBegin(begin, originalSize); - var resolvedEnd = resolveEnd(end, originalSize); - - // begin or end will be NaN if they were provided as negative numbers and - // this iterable's size is unknown. In that case, cache first so there is + // begin or end can not be resolved if they were provided as negative numbers and + // this collection's size is unknown. In that case, cache first so there is // a known size and these do not resolve to NaN. - if (resolvedBegin !== resolvedBegin || resolvedEnd !== resolvedEnd) { - return sliceFactory(iterable.toSeq().cacheResult(), begin, end, useKeys); + if (typeof originalSize === 'undefined' && (begin < 0 || end < 0)) { + return sliceFactory(collection.toSeq().cacheResult(), begin, end, useKeys); } + const resolvedBegin = resolveBegin(begin, originalSize); + const resolvedEnd = resolveEnd(end, originalSize); + // Note: resolvedEnd is undefined when the original sequence's length is // unknown and this slice did not supply an end and should contain all // elements after resolvedBegin. // In that case, resolvedSize will be NaN and sliceSize will remain undefined. - var resolvedSize = resolvedEnd - resolvedBegin; - var sliceSize; + const resolvedSize = resolvedEnd - resolvedBegin; + let sliceSize; if (resolvedSize === resolvedSize) { sliceSize = resolvedSize < 0 ? 0 : resolvedSize; } - var sliceSeq = makeSequence(iterable); + const sliceSeq = makeSequence(collection); - // If iterable.size is undefined, the size of the realized sliceSeq is + // If collection.size is undefined, the size of the realized sliceSeq is // unknown at this point unless the number of items to slice is 0 - sliceSeq.size = sliceSize === 0 ? sliceSize : iterable.size && sliceSize || undefined; + sliceSeq.size = + sliceSize === 0 ? sliceSize : (collection.size && sliceSize) || undefined; - if (!useKeys && isSeq(iterable) && sliceSize >= 0) { + if (!useKeys && isSeq(collection) && sliceSize >= 0) { sliceSeq.get = function (index, notSetValue) { index = wrapIndex(this, index); - return index >= 0 && index < sliceSize ? - iterable.get(index + resolvedBegin, notSetValue) : - notSetValue; - } + return index >= 0 && index < sliceSize + ? collection.get(index + resolvedBegin, notSetValue) + : notSetValue; + }; } - sliceSeq.__iterateUncached = function(fn, reverse) { + sliceSeq.__iterateUncached = function (fn, reverse) { if (sliceSize === 0) { return 0; } if (reverse) { return this.cacheResult().__iterate(fn, reverse); } - var skipped = 0; - var isSkipping = true; - var iterations = 0; - iterable.__iterate((v, k) => { + let skipped = 0; + let isSkipping = true; + let iterations = 0; + collection.__iterate((v, k) => { if (!(isSkipping && (isSkipping = skipped++ < resolvedBegin))) { iterations++; - return fn(v, useKeys ? k : iterations - 1, this) !== false && - iterations !== sliceSize; + return ( + fn(v, useKeys ? k : iterations - 1, this) !== false && + iterations !== sliceSize + ); } }); return iterations; }; - sliceSeq.__iteratorUncached = function(type, reverse) { + sliceSeq.__iteratorUncached = function (type, reverse) { if (sliceSize !== 0 && reverse) { return this.cacheResult().__iterator(type, reverse); } // Don't bother instantiating parent iterator if taking 0. - var iterator = sliceSize !== 0 && iterable.__iterator(type, reverse); - var skipped = 0; - var iterations = 0; + if (sliceSize === 0) { + return new Iterator(iteratorDone); + } + const iterator = collection.__iterator(type, reverse); + let skipped = 0; + let iterations = 0; return new Iterator(() => { while (skipped++ < resolvedBegin) { iterator.next(); @@ -459,71 +488,69 @@ export function sliceFactory(iterable, begin, end, useKeys) { if (++iterations > sliceSize) { return iteratorDone(); } - var step = iterator.next(); - if (useKeys || type === ITERATE_VALUES) { + const step = iterator.next(); + if (useKeys || type === ITERATE_VALUES || step.done) { return step; - } else if (type === ITERATE_KEYS) { + } + if (type === ITERATE_KEYS) { return iteratorValue(type, iterations - 1, undefined, step); - } else { - return iteratorValue(type, iterations - 1, step.value[1], step); } + return iteratorValue(type, iterations - 1, step.value[1], step); }); - } + }; return sliceSeq; } - -export function takeWhileFactory(iterable, predicate, context) { - var takeSequence = makeSequence(iterable); - takeSequence.__iterateUncached = function(fn, reverse) { +export function takeWhileFactory(collection, predicate, context) { + const takeSequence = makeSequence(collection); + takeSequence.__iterateUncached = function (fn, reverse) { if (reverse) { return this.cacheResult().__iterate(fn, reverse); } - var iterations = 0; - iterable.__iterate((v, k, c) => - predicate.call(context, v, k, c) && ++iterations && fn(v, k, this) + let iterations = 0; + collection.__iterate( + (v, k, c) => + predicate.call(context, v, k, c) && ++iterations && fn(v, k, this) ); return iterations; }; - takeSequence.__iteratorUncached = function(type, reverse) { + takeSequence.__iteratorUncached = function (type, reverse) { if (reverse) { return this.cacheResult().__iterator(type, reverse); } - var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse); - var iterating = true; + const iterator = collection.__iterator(ITERATE_ENTRIES, reverse); + let iterating = true; return new Iterator(() => { if (!iterating) { return iteratorDone(); } - var step = iterator.next(); + const step = iterator.next(); if (step.done) { return step; } - var entry = step.value; - var k = entry[0]; - var v = entry[1]; + const entry = step.value; + const k = entry[0]; + const v = entry[1]; if (!predicate.call(context, v, k, this)) { iterating = false; return iteratorDone(); } - return type === ITERATE_ENTRIES ? step : - iteratorValue(type, k, v, step); + return type === ITERATE_ENTRIES ? step : iteratorValue(type, k, v, step); }); }; return takeSequence; } - -export function skipWhileFactory(iterable, predicate, context, useKeys) { - var skipSequence = makeSequence(iterable); +export function skipWhileFactory(collection, predicate, context, useKeys) { + const skipSequence = makeSequence(collection); skipSequence.__iterateUncached = function (fn, reverse) { if (reverse) { return this.cacheResult().__iterate(fn, reverse); } - var isSkipping = true; - var iterations = 0; - iterable.__iterate((v, k, c) => { + let isSkipping = true; + let iterations = 0; + collection.__iterate((v, k, c) => { if (!(isSkipping && (isSkipping = predicate.call(context, v, k, c)))) { iterations++; return fn(v, useKeys ? k : iterations - 1, this); @@ -531,121 +558,211 @@ export function skipWhileFactory(iterable, predicate, context, useKeys) { }); return iterations; }; - skipSequence.__iteratorUncached = function(type, reverse) { + skipSequence.__iteratorUncached = function (type, reverse) { if (reverse) { return this.cacheResult().__iterator(type, reverse); } - var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse); - var skipping = true; - var iterations = 0; + const iterator = collection.__iterator(ITERATE_ENTRIES, reverse); + let skipping = true; + let iterations = 0; return new Iterator(() => { - var step, k, v; + let step; + let k; + let v; do { step = iterator.next(); if (step.done) { if (useKeys || type === ITERATE_VALUES) { return step; - } else if (type === ITERATE_KEYS) { + } + if (type === ITERATE_KEYS) { return iteratorValue(type, iterations++, undefined, step); - } else { - return iteratorValue(type, iterations++, step.value[1], step); } + return iteratorValue(type, iterations++, step.value[1], step); } - var entry = step.value; + const entry = step.value; k = entry[0]; v = entry[1]; + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here skipping && (skipping = predicate.call(context, v, k, this)); } while (skipping); - return type === ITERATE_ENTRIES ? step : - iteratorValue(type, k, v, step); + return type === ITERATE_ENTRIES ? step : iteratorValue(type, k, v, step); }); }; return skipSequence; } +class ConcatSeq extends Seq { + constructor(iterables) { + this._wrappedIterables = iterables.flatMap((iterable) => { + if (iterable._wrappedIterables) { + return iterable._wrappedIterables; + } + return [iterable]; + }); + this.size = this._wrappedIterables.reduce((sum, iterable) => { + if (sum !== undefined) { + const size = iterable.size; + if (size !== undefined) { + return sum + size; + } + } + }, 0); + this[IS_KEYED_SYMBOL] = this._wrappedIterables[0][IS_KEYED_SYMBOL]; + this[IS_INDEXED_SYMBOL] = this._wrappedIterables[0][IS_INDEXED_SYMBOL]; + this[IS_ORDERED_SYMBOL] = this._wrappedIterables[0][IS_ORDERED_SYMBOL]; + } + + __iterateUncached(fn, reverse) { + if (this._wrappedIterables.length === 0) { + return; + } + + if (reverse) { + return this.cacheResult().__iterate(fn, reverse); + } + + let iterableIndex = 0; + const useKeys = isKeyed(this); + const iteratorType = useKeys ? ITERATE_ENTRIES : ITERATE_VALUES; + let currentIterator = this._wrappedIterables[iterableIndex].__iterator( + iteratorType, + reverse + ); + + let keepGoing = true; + let index = 0; + while (keepGoing) { + let next = currentIterator.next(); + while (next.done) { + iterableIndex++; + if (iterableIndex === this._wrappedIterables.length) { + return index; + } + currentIterator = this._wrappedIterables[iterableIndex].__iterator( + iteratorType, + reverse + ); + next = currentIterator.next(); + } + const fnResult = useKeys + ? fn(next.value[1], next.value[0], this) + : fn(next.value, index, this); + keepGoing = fnResult !== false; + index++; + } + return index; + } -export function concatFactory(iterable, values) { - var isKeyedIterable = isKeyed(iterable); - var iters = [iterable].concat(values).map(v => { - if (!isIterable(v)) { - v = isKeyedIterable ? - keyedSeqFromValue(v) : - indexedSeqFromValue(Array.isArray(v) ? v : [v]); - } else if (isKeyedIterable) { - v = KeyedIterable(v); + __iteratorUncached(type, reverse) { + if (this._wrappedIterables.length === 0) { + return new Iterator(iteratorDone); + } + + if (reverse) { + return this.cacheResult().__iterator(type, reverse); } - return v; - }).filter(v => v.size !== 0); + + let iterableIndex = 0; + let currentIterator = this._wrappedIterables[iterableIndex].__iterator( + type, + reverse + ); + return new Iterator(() => { + let next = currentIterator.next(); + while (next.done) { + iterableIndex++; + if (iterableIndex === this._wrappedIterables.length) { + return next; + } + currentIterator = this._wrappedIterables[iterableIndex].__iterator( + type, + reverse + ); + next = currentIterator.next(); + } + return next; + }); + } +} + +export function concatFactory(collection, values) { + const isKeyedCollection = isKeyed(collection); + const iters = [collection] + .concat(values) + .map((v) => { + if (!isCollection(v)) { + v = isKeyedCollection + ? keyedSeqFromValue(v) + : indexedSeqFromValue(Array.isArray(v) ? v : [v]); + } else if (isKeyedCollection) { + v = KeyedCollection(v); + } + return v; + }) + .filter((v) => v.size !== 0); if (iters.length === 0) { - return iterable; + return collection; } if (iters.length === 1) { - var singleton = iters[0]; - if (singleton === iterable || - isKeyedIterable && isKeyed(singleton) || - isIndexed(iterable) && isIndexed(singleton)) { + const singleton = iters[0]; + if ( + singleton === collection || + (isKeyedCollection && isKeyed(singleton)) || + (isIndexed(collection) && isIndexed(singleton)) + ) { return singleton; } } - var concatSeq = new ArraySeq(iters); - if (isKeyedIterable) { - concatSeq = concatSeq.toKeyedSeq(); - } else if (!isIndexed(iterable)) { - concatSeq = concatSeq.toSetSeq(); - } - concatSeq = concatSeq.flatten(true); - concatSeq.size = iters.reduce( - (sum, seq) => { - if (sum !== undefined) { - var size = seq.size; - if (size !== undefined) { - return sum + size; - } - } - }, - 0 - ); - return concatSeq; + return new ConcatSeq(iters); } - -export function flattenFactory(iterable, depth, useKeys) { - var flatSequence = makeSequence(iterable); - flatSequence.__iterateUncached = function(fn, reverse) { - var iterations = 0; - var stopped = false; +export function flattenFactory(collection, depth, useKeys) { + const flatSequence = makeSequence(collection); + flatSequence.__iterateUncached = function (fn, reverse) { + if (reverse) { + return this.cacheResult().__iterate(fn, reverse); + } + let iterations = 0; + let stopped = false; function flatDeep(iter, currentDepth) { iter.__iterate((v, k) => { - if ((!depth || currentDepth < depth) && isIterable(v)) { + if ((!depth || currentDepth < depth) && isCollection(v)) { flatDeep(v, currentDepth + 1); - } else if (fn(v, useKeys ? k : iterations++, this) === false) { - stopped = true; + } else { + iterations++; + if (fn(v, useKeys ? k : iterations - 1, flatSequence) === false) { + stopped = true; + } } return !stopped; }, reverse); } - flatDeep(iterable, 0); + flatDeep(collection, 0); return iterations; - } - flatSequence.__iteratorUncached = function(type, reverse) { - var iterator = iterable.__iterator(type, reverse); - var stack = []; - var iterations = 0; + }; + flatSequence.__iteratorUncached = function (type, reverse) { + if (reverse) { + return this.cacheResult().__iterator(type, reverse); + } + let iterator = collection.__iterator(type, reverse); + const stack = []; + let iterations = 0; return new Iterator(() => { while (iterator) { - var step = iterator.next(); + const step = iterator.next(); if (step.done !== false) { iterator = stack.pop(); continue; } - var v = step.value; + let v = step.value; if (type === ITERATE_ENTRIES) { v = v[1]; } - if ((!depth || stack.length < depth) && isIterable(v)) { + if ((!depth || stack.length < depth) && isCollection(v)) { stack.push(iterator); iterator = v.__iterator(type, reverse); } else { @@ -654,35 +771,35 @@ export function flattenFactory(iterable, depth, useKeys) { } return iteratorDone(); }); - } + }; return flatSequence; } - -export function flatMapFactory(iterable, mapper, context) { - var coerce = iterableClass(iterable); - return iterable.toSeq().map( - (v, k) => coerce(mapper.call(context, v, k, iterable)) - ).flatten(true); +export function flatMapFactory(collection, mapper, context) { + const coerce = collectionClass(collection); + return collection + .toSeq() + .map((v, k) => coerce(mapper.call(context, v, k, collection))) + .flatten(true); } - -export function interposeFactory(iterable, separator) { - var interposedSequence = makeSequence(iterable); - interposedSequence.size = iterable.size && iterable.size * 2 -1; - interposedSequence.__iterateUncached = function(fn, reverse) { - var iterations = 0; - iterable.__iterate((v, k) => - (!iterations || fn(separator, iterations++, this) !== false) && - fn(v, iterations++, this) !== false, +export function interposeFactory(collection, separator) { + const interposedSequence = makeSequence(collection); + interposedSequence.size = collection.size && collection.size * 2 - 1; + interposedSequence.__iterateUncached = function (fn, reverse) { + let iterations = 0; + collection.__iterate( + (v) => + (!iterations || fn(separator, iterations++, this) !== false) && + fn(v, iterations++, this) !== false, reverse ); return iterations; }; - interposedSequence.__iteratorUncached = function(type, reverse) { - var iterator = iterable.__iterator(ITERATE_VALUES, reverse); - var iterations = 0; - var step; + interposedSequence.__iteratorUncached = function (type, reverse) { + const iterator = collection.__iterator(ITERATE_VALUES, reverse); + let iterations = 0; + let step; return new Iterator(() => { if (!step || iterations % 2) { step = iterator.next(); @@ -690,63 +807,74 @@ export function interposeFactory(iterable, separator) { return step; } } - return iterations % 2 ? - iteratorValue(type, iterations++, separator) : - iteratorValue(type, iterations++, step.value, step); + return iterations % 2 + ? iteratorValue(type, iterations++, separator) + : iteratorValue(type, iterations++, step.value, step); }); }; return interposedSequence; } - -export function sortFactory(iterable, comparator, mapper) { +export function sortFactory(collection, comparator, mapper) { if (!comparator) { comparator = defaultComparator; } - var isKeyedIterable = isKeyed(iterable); - var index = 0; - var entries = iterable.toSeq().map( - (v, k) => [k, v, index++, mapper ? mapper(v, k, iterable) : v] - ).toArray(); - entries.sort((a, b) => comparator(a[3], b[3]) || a[2] - b[2]).forEach( - isKeyedIterable ? - (v, i) => { entries[i].length = 2; } : - (v, i) => { entries[i] = v[1]; } - ); - return isKeyedIterable ? KeyedSeq(entries) : - isIndexed(iterable) ? IndexedSeq(entries) : - SetSeq(entries); + const isKeyedCollection = isKeyed(collection); + let index = 0; + const entries = collection + .toSeq() + .map((v, k) => [k, v, index++, mapper ? mapper(v, k, collection) : v]) + .valueSeq() + .toArray(); + entries + .sort((a, b) => comparator(a[3], b[3]) || a[2] - b[2]) + .forEach( + isKeyedCollection + ? (v, i) => { + entries[i].length = 2; + } + : (v, i) => { + entries[i] = v[1]; + } + ); + return isKeyedCollection + ? KeyedSeq(entries) + : isIndexed(collection) + ? IndexedSeq(entries) + : SetSeq(entries); } - -export function maxFactory(iterable, comparator, mapper) { +export function maxFactory(collection, comparator, mapper) { if (!comparator) { comparator = defaultComparator; } if (mapper) { - var entry = iterable.toSeq() - .map((v, k) => [v, mapper(v, k, iterable)]) - .reduce((a, b) => maxCompare(comparator, a[1], b[1]) ? b : a); + const entry = collection + .toSeq() + .map((v, k) => [v, mapper(v, k, collection)]) + .reduce((a, b) => (maxCompare(comparator, a[1], b[1]) ? b : a)); return entry && entry[0]; - } else { - return iterable.reduce((a, b) => maxCompare(comparator, a, b) ? b : a); } + return collection.reduce((a, b) => (maxCompare(comparator, a, b) ? b : a)); } function maxCompare(comparator, a, b) { - var comp = comparator(b, a); + const comp = comparator(b, a); // b is considered the new max if the comparator declares them equal, but // they are not equal and b is in fact a nullish value. - return (comp === 0 && b !== a && (b === undefined || b === null || b !== b)) || comp > 0; + return ( + (comp === 0 && b !== a && (b === undefined || b === null || b !== b)) || + comp > 0 + ); } - -export function zipWithFactory(keyIter, zipper, iters) { - var zipSequence = makeSequence(keyIter); - zipSequence.size = new ArraySeq(iters).map(i => i.size).min(); +export function zipWithFactory(keyIter, zipper, iters, zipAll) { + const zipSequence = makeSequence(keyIter); + const sizes = new ArraySeq(iters).map((i) => i.size); + zipSequence.size = zipAll ? sizes.max() : sizes.min(); // Note: this a generic base implementation of __iterate in terms of // __iterator which may be more generically useful in the future. - zipSequence.__iterate = function(fn, reverse) { + zipSequence.__iterate = function (fn, reverse) { /* generic: var iterator = this.__iterator(ITERATE_ENTRIES, reverse); var step; @@ -760,9 +888,9 @@ export function zipWithFactory(keyIter, zipper, iters) { return iterations; */ // indexed: - var iterator = this.__iterator(ITERATE_VALUES, reverse); - var step; - var iterations = 0; + const iterator = this.__iterator(ITERATE_VALUES, reverse); + let step; + let iterations = 0; while (!(step = iterator.next()).done) { if (fn(step.value, iterations++, this) === false) { break; @@ -770,17 +898,19 @@ export function zipWithFactory(keyIter, zipper, iters) { } return iterations; }; - zipSequence.__iteratorUncached = function(type, reverse) { - var iterators = iters.map(i => - (i = Iterable(i), getIterator(reverse ? i.reverse() : i)) + zipSequence.__iteratorUncached = function (type, reverse) { + const iterators = iters.map( + (i) => ((i = Collection(i)), getIterator(reverse ? i.reverse() : i)) ); - var iterations = 0; - var isDone = false; + let iterations = 0; + let isDone = false; return new Iterator(() => { - var steps; + let steps; if (!isDone) { - steps = iterators.map(i => i.next()); - isDone = steps.some(s => s.done); + steps = iterators.map((i) => i.next()); + isDone = zipAll + ? steps.every((s) => s.done) + : steps.some((s) => s.done); } if (isDone) { return iteratorDone(); @@ -788,18 +918,20 @@ export function zipWithFactory(keyIter, zipper, iters) { return iteratorValue( type, iterations++, - zipper.apply(null, steps.map(s => s.value)) + zipper.apply( + null, + steps.map((s) => s.value) + ) ); }); }; - return zipSequence + return zipSequence; } - // #pragma Helper Functions export function reify(iter, seq) { - return isSeq(iter) ? seq : iter.constructor(seq); + return iter === seq ? iter : isSeq(iter) ? seq : iter.constructor(seq); } function validateEntry(entry) { @@ -808,23 +940,21 @@ function validateEntry(entry) { } } -function resolveSize(iter) { - assertNotInfinite(iter.size); - return ensureSize(iter); +function collectionClass(collection) { + return isKeyed(collection) + ? KeyedCollection + : isIndexed(collection) + ? IndexedCollection + : SetCollection; } -function iterableClass(iterable) { - return isKeyed(iterable) ? KeyedIterable : - isIndexed(iterable) ? IndexedIterable : - SetIterable; -} - -function makeSequence(iterable) { +function makeSequence(collection) { return Object.create( - ( - isKeyed(iterable) ? KeyedSeq : - isIndexed(iterable) ? IndexedSeq : - SetSeq + (isKeyed(collection) + ? KeyedSeq + : isIndexed(collection) + ? IndexedSeq + : SetSeq ).prototype ); } @@ -834,11 +964,22 @@ function cacheResultThrough() { this._iter.cacheResult(); this.size = this._iter.size; return this; - } else { - return Seq.prototype.cacheResult.call(this); } + return Seq.prototype.cacheResult.call(this); } function defaultComparator(a, b) { + if (a === undefined && b === undefined) { + return 0; + } + + if (a === undefined) { + return 1; + } + + if (b === undefined) { + return -1; + } + return a > b ? 1 : a < b ? -1 : 0; } diff --git a/src/OrderedMap.js b/src/OrderedMap.js index 2351a70c93..c6867b6c83 100644 --- a/src/OrderedMap.js +++ b/src/OrderedMap.js @@ -1,31 +1,25 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -import { KeyedIterable, IS_ORDERED_SENTINEL, isOrdered } from './Iterable' -import { Map, isMap, emptyMap } from './Map' -import { emptyList } from './List' -import { DELETE, NOT_SET, SIZE } from './TrieUtils' -import assertNotInfinite from './utils/assertNotInfinite' - +import { KeyedCollection } from './Collection'; +import { IS_ORDERED_SYMBOL } from './predicates/isOrdered'; +import { isOrderedMap } from './predicates/isOrderedMap'; +import { Map, emptyMap } from './Map'; +import { emptyList } from './List'; +import { DELETE, NOT_SET, SIZE } from './TrieUtils'; +import assertNotInfinite from './utils/assertNotInfinite'; export class OrderedMap extends Map { - // @pragma Construction constructor(value) { - return value === null || value === undefined ? emptyOrderedMap() : - isOrderedMap(value) ? value : - emptyOrderedMap().withMutations(map => { - var iter = KeyedIterable(value); - assertNotInfinite(iter.size); - iter.forEach((v, k) => map.set(k, v)); - }); + // eslint-disable-next-line no-constructor-return + return value === undefined || value === null + ? emptyOrderedMap() + : isOrderedMap(value) + ? value + : emptyOrderedMap().withMutations((map) => { + const iter = KeyedCollection(value); + assertNotInfinite(iter.size); + iter.forEach((v, k) => map.set(k, v)); + }); } static of(/*...values*/) { @@ -39,7 +33,7 @@ export class OrderedMap extends Map { // @pragma Access get(k, notSetValue) { - var index = this._map.get(k); + const index = this._map.get(k); return index !== undefined ? this._list.get(index)[1] : notSetValue; } @@ -53,6 +47,7 @@ export class OrderedMap extends Map { this.size = 0; this._map.clear(); this._list.clear(); + this.__altered = true; return this; } return emptyOrderedMap(); @@ -66,13 +61,9 @@ export class OrderedMap extends Map { return updateOrderedMap(this, k, NOT_SET); } - wasAltered() { - return this._map.wasAltered() || this._list.wasAltered(); - } - __iterate(fn, reverse) { return this._list.__iterate( - entry => entry && fn(entry[1], entry[0], this), + (entry) => entry && fn(entry[1], entry[0], this), reverse ); } @@ -85,10 +76,14 @@ export class OrderedMap extends Map { if (ownerID === this.__ownerID) { return this; } - var newMap = this._map.__ensureOwner(ownerID); - var newList = this._list.__ensureOwner(ownerID); + const newMap = this._map.__ensureOwner(ownerID); + const newList = this._list.__ensureOwner(ownerID); if (!ownerID) { + if (this.size === 0) { + return emptyOrderedMap(); + } this.__ownerID = ownerID; + this.__altered = false; this._map = newMap; this._list = newList; return this; @@ -97,46 +92,49 @@ export class OrderedMap extends Map { } } -function isOrderedMap(maybeOrderedMap) { - return isMap(maybeOrderedMap) && isOrdered(maybeOrderedMap); -} - OrderedMap.isOrderedMap = isOrderedMap; -OrderedMap.prototype[IS_ORDERED_SENTINEL] = true; +OrderedMap.prototype[IS_ORDERED_SYMBOL] = true; OrderedMap.prototype[DELETE] = OrderedMap.prototype.remove; - - function makeOrderedMap(map, list, ownerID, hash) { - var omap = Object.create(OrderedMap.prototype); + const omap = Object.create(OrderedMap.prototype); omap.size = map ? map.size : 0; omap._map = map; omap._list = list; omap.__ownerID = ownerID; omap.__hash = hash; + omap.__altered = false; return omap; } -var EMPTY_ORDERED_MAP; +let EMPTY_ORDERED_MAP; export function emptyOrderedMap() { - return EMPTY_ORDERED_MAP || (EMPTY_ORDERED_MAP = makeOrderedMap(emptyMap(), emptyList())); + return ( + EMPTY_ORDERED_MAP || + (EMPTY_ORDERED_MAP = makeOrderedMap(emptyMap(), emptyList())) + ); } function updateOrderedMap(omap, k, v) { - var map = omap._map; - var list = omap._list; - var i = map.get(k); - var has = i !== undefined; - var newMap; - var newList; - if (v === NOT_SET) { // removed + const map = omap._map; + const list = omap._list; + const i = map.get(k); + const has = i !== undefined; + let newMap; + let newList; + if (v === NOT_SET) { + // removed if (!has) { return omap; } if (list.size >= SIZE && list.size >= map.size * 2) { newList = list.filter((entry, idx) => entry !== undefined && i !== idx); - newMap = newList.toKeyedSeq().map(entry => entry[0]).flip().toMap(); + newMap = newList + .toKeyedSeq() + .map((entry) => entry[0]) + .flip() + .toMap(); if (omap.__ownerID) { newMap.__ownerID = newList.__ownerID = omap.__ownerID; } @@ -144,23 +142,22 @@ function updateOrderedMap(omap, k, v) { newMap = map.remove(k); newList = i === list.size - 1 ? list.pop() : list.set(i, undefined); } - } else { - if (has) { - if (v === list.get(i)[1]) { - return omap; - } - newMap = map; - newList = list.set(i, [k, v]); - } else { - newMap = map.set(k, list.size); - newList = list.set(list.size, [k, v]); + } else if (has) { + if (v === list.get(i)[1]) { + return omap; } + newMap = map; + newList = list.set(i, [k, v]); + } else { + newMap = map.set(k, list.size); + newList = list.set(list.size, [k, v]); } if (omap.__ownerID) { omap.size = newMap.size; omap._map = newMap; omap._list = newList; omap.__hash = undefined; + omap.__altered = true; return omap; } return makeOrderedMap(newMap, newList); diff --git a/src/OrderedSet.js b/src/OrderedSet.js index 01df6bdcff..98da36416f 100644 --- a/src/OrderedSet.js +++ b/src/OrderedSet.js @@ -1,30 +1,25 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -import { SetIterable, KeyedIterable, IS_ORDERED_SENTINEL, isOrdered } from './Iterable' -import { Set, isSet } from './Set' -import { emptyOrderedMap } from './OrderedMap' -import assertNotInfinite from './utils/assertNotInfinite' - +import { SetCollection, KeyedCollection } from './Collection'; +import { IS_ORDERED_SYMBOL } from './predicates/isOrdered'; +import { isOrderedSet } from './predicates/isOrderedSet'; +import { IndexedCollectionPrototype } from './CollectionImpl'; +import { Set } from './Set'; +import { emptyOrderedMap } from './OrderedMap'; +import assertNotInfinite from './utils/assertNotInfinite'; export class OrderedSet extends Set { - // @pragma Construction constructor(value) { - return value === null || value === undefined ? emptyOrderedSet() : - isOrderedSet(value) ? value : - emptyOrderedSet().withMutations(set => { - var iter = SetIterable(value); - assertNotInfinite(iter.size); - iter.forEach(v => set.add(v)); - }); + // eslint-disable-next-line no-constructor-return + return value === undefined || value === null + ? emptyOrderedSet() + : isOrderedSet(value) + ? value + : emptyOrderedSet().withMutations((set) => { + const iter = SetCollection(value); + assertNotInfinite(iter.size); + iter.forEach((v) => set.add(v)); + }); } static of(/*...values*/) { @@ -32,7 +27,7 @@ export class OrderedSet extends Set { } static fromKeys(value) { - return this(KeyedIterable(value).keySeq()); + return this(KeyedCollection(value).keySeq()); } toString() { @@ -40,27 +35,28 @@ export class OrderedSet extends Set { } } -function isOrderedSet(maybeOrderedSet) { - return isSet(maybeOrderedSet) && isOrdered(maybeOrderedSet); -} - OrderedSet.isOrderedSet = isOrderedSet; -var OrderedSetPrototype = OrderedSet.prototype; -OrderedSetPrototype[IS_ORDERED_SENTINEL] = true; +const OrderedSetPrototype = OrderedSet.prototype; +OrderedSetPrototype[IS_ORDERED_SYMBOL] = true; +OrderedSetPrototype.zip = IndexedCollectionPrototype.zip; +OrderedSetPrototype.zipWith = IndexedCollectionPrototype.zipWith; +OrderedSetPrototype.zipAll = IndexedCollectionPrototype.zipAll; OrderedSetPrototype.__empty = emptyOrderedSet; OrderedSetPrototype.__make = makeOrderedSet; function makeOrderedSet(map, ownerID) { - var set = Object.create(OrderedSetPrototype); + const set = Object.create(OrderedSetPrototype); set.size = map ? map.size : 0; set._map = map; set.__ownerID = ownerID; return set; } -var EMPTY_ORDERED_SET; +let EMPTY_ORDERED_SET; function emptyOrderedSet() { - return EMPTY_ORDERED_SET || (EMPTY_ORDERED_SET = makeOrderedSet(emptyOrderedMap())); + return ( + EMPTY_ORDERED_SET || (EMPTY_ORDERED_SET = makeOrderedSet(emptyOrderedMap())) + ); } diff --git a/src/PairSorting.js b/src/PairSorting.js new file mode 100644 index 0000000000..a8d6e4e240 --- /dev/null +++ b/src/PairSorting.js @@ -0,0 +1,4 @@ +export const PairSorting = { + LeftThenRight: -1, + RightThenLeft: +1, +}; diff --git a/src/Range.js b/src/Range.js index 7821e4f9b5..a7ac912aed 100644 --- a/src/Range.js +++ b/src/Range.js @@ -1,19 +1,9 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -import { wrapIndex, wholeSlice, resolveBegin, resolveEnd } from './TrieUtils' -import { IndexedSeq } from './Seq' -import { Iterator, iteratorValue, iteratorDone } from './Iterator' - -import invariant from './utils/invariant' -import deepEqual from './utils/deepEqual' +import { wrapIndex, wholeSlice, resolveBegin, resolveEnd } from './TrieUtils'; +import { IndexedSeq } from './Seq'; +import { Iterator, iteratorValue, iteratorDone } from './Iterator'; +import invariant from './utils/invariant'; +import deepEqual from './utils/deepEqual'; /** * Returns a lazy seq of nums from start (inclusive) to end @@ -21,17 +11,22 @@ import deepEqual from './utils/deepEqual' * infinity. When start is equal to end, returns empty list. */ export class Range extends IndexedSeq { - - constructor(start, end, step) { + constructor(start, end, step = 1) { if (!(this instanceof Range)) { + // eslint-disable-next-line no-constructor-return return new Range(start, end, step); } invariant(step !== 0, 'Cannot step a Range by 0'); - start = start || 0; - if (end === undefined) { - end = Infinity; - } - step = step === undefined ? 1 : Math.abs(step); + invariant( + start !== undefined, + 'You must define a start value when using Range' + ); + invariant( + end !== undefined, + 'You must define an end value when using Range' + ); + + step = Math.abs(step); if (end < start) { step = -step; } @@ -41,33 +36,33 @@ export class Range extends IndexedSeq { this.size = Math.max(0, Math.ceil((end - start) / step - 1) + 1); if (this.size === 0) { if (EMPTY_RANGE) { + // eslint-disable-next-line no-constructor-return return EMPTY_RANGE; } + // eslint-disable-next-line @typescript-eslint/no-this-alias EMPTY_RANGE = this; } } toString() { - if (this.size === 0) { - return 'Range []'; - } - return 'Range [ ' + - this._start + '...' + this._end + - (this._step !== 1 ? ' by ' + this._step : '') + - ' ]'; + return this.size === 0 + ? 'Range []' + : `Range [ ${this._start}...${this._end}${this._step !== 1 ? ' by ' + this._step : ''} ]`; } get(index, notSetValue) { - return this.has(index) ? - this._start + wrapIndex(this, index) * this._step : - notSetValue; + return this.has(index) + ? this._start + wrapIndex(this, index) * this._step + : notSetValue; } includes(searchValue) { - var possibleIndex = (searchValue - this._start) / this._step; - return possibleIndex >= 0 && + const possibleIndex = (searchValue - this._start) / this._step; + return ( + possibleIndex >= 0 && possibleIndex < this.size && - possibleIndex === Math.floor(possibleIndex); + possibleIndex === Math.floor(possibleIndex) + ); } slice(begin, end) { @@ -79,15 +74,19 @@ export class Range extends IndexedSeq { if (end <= begin) { return new Range(0, 0); } - return new Range(this.get(begin, this._end), this.get(end, this._end), this._step); + return new Range( + this.get(begin, this._end), + this.get(end, this._end), + this._step + ); } indexOf(searchValue) { - var offsetValue = searchValue - this._start; + const offsetValue = searchValue - this._start; if (offsetValue % this._step === 0) { - var index = offsetValue / this._step; + const index = offsetValue / this._step; if (index >= 0 && index < this.size) { - return index + return index; } } return -1; @@ -98,37 +97,41 @@ export class Range extends IndexedSeq { } __iterate(fn, reverse) { - var maxIndex = this.size - 1; - var step = this._step; - var value = reverse ? this._start + maxIndex * step : this._start; - for (var ii = 0; ii <= maxIndex; ii++) { - if (fn(value, ii, this) === false) { - return ii + 1; + const size = this.size; + const step = this._step; + let value = reverse ? this._start + (size - 1) * step : this._start; + let i = 0; + while (i !== size) { + if (fn(value, reverse ? size - ++i : i++, this) === false) { + break; } value += reverse ? -step : step; } - return ii; + return i; } __iterator(type, reverse) { - var maxIndex = this.size - 1; - var step = this._step; - var value = reverse ? this._start + maxIndex * step : this._start; - var ii = 0; + const size = this.size; + const step = this._step; + let value = reverse ? this._start + (size - 1) * step : this._start; + let i = 0; return new Iterator(() => { - var v = value; + if (i === size) { + return iteratorDone(); + } + const v = value; value += reverse ? -step : step; - return ii > maxIndex ? iteratorDone() : iteratorValue(type, ii++, v); + return iteratorValue(type, reverse ? size - ++i : i++, v); }); } equals(other) { - return other instanceof Range ? - this._start === other._start && - this._end === other._end && - this._step === other._step : - deepEqual(this, other); + return other instanceof Range + ? this._start === other._start && + this._end === other._end && + this._step === other._step + : deepEqual(this, other); } } -var EMPTY_RANGE; +let EMPTY_RANGE; diff --git a/src/Record.js b/src/Record.js index fb2787ca88..89100a6410 100644 --- a/src/Record.js +++ b/src/Record.js @@ -1,26 +1,55 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +import { toJS } from './toJS'; +import { KeyedCollection } from './Collection'; +import { keyedSeqFromValue } from './Seq'; +import { List } from './List'; +import { ITERATE_ENTRIES, ITERATOR_SYMBOL } from './Iterator'; +import { isRecord, IS_RECORD_SYMBOL } from './predicates/isRecord'; +import { CollectionPrototype } from './CollectionImpl'; +import { DELETE } from './TrieUtils'; +import { getIn } from './methods/getIn'; +import { setIn } from './methods/setIn'; +import { deleteIn } from './methods/deleteIn'; +import { update } from './methods/update'; +import { updateIn } from './methods/updateIn'; +import { merge, mergeWith } from './methods/merge'; +import { mergeDeep, mergeDeepWith } from './methods/mergeDeep'; +import { mergeIn } from './methods/mergeIn'; +import { mergeDeepIn } from './methods/mergeDeepIn'; +import { withMutations } from './methods/withMutations'; +import { asMutable } from './methods/asMutable'; +import { asImmutable } from './methods/asImmutable'; -import { KeyedIterable } from './Iterable' -import { KeyedCollection } from './Collection' -import { Map, MapPrototype, emptyMap } from './Map' -import { DELETE } from './TrieUtils' +import invariant from './utils/invariant'; +import quoteString from './utils/quoteString'; +import { isImmutable } from './predicates/isImmutable'; -import invariant from './utils/invariant' +function throwOnInvalidDefaultValues(defaultValues) { + if (isRecord(defaultValues)) { + throw new Error( + 'Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.' + ); + } + if (isImmutable(defaultValues)) { + throw new Error( + 'Can not call `Record` with an immutable Collection as default values. Use a plain javascript object instead.' + ); + } -export class Record extends KeyedCollection { + if (defaultValues === null || typeof defaultValues !== 'object') { + throw new Error( + 'Can not call `Record` with a non-object as default values. Use a plain javascript object instead.' + ); + } +} +export class Record { constructor(defaultValues, name) { - var hasInitialized; + let hasInitialized; + + throwOnInvalidDefaultValues(defaultValues); - var RecordType = function Record(values) { + const RecordType = function Record(values) { if (values instanceof RecordType) { return values; } @@ -29,150 +58,212 @@ export class Record extends KeyedCollection { } if (!hasInitialized) { hasInitialized = true; - var keys = Object.keys(defaultValues); - setProps(RecordTypePrototype, keys); - RecordTypePrototype.size = keys.length; + const keys = Object.keys(defaultValues); + const indices = (RecordTypePrototype._indices = {}); + // Deprecated: left to attempt not to break any external code which + // relies on a ._name property existing on record instances. + // Use Record.getDescriptiveName() instead RecordTypePrototype._name = name; RecordTypePrototype._keys = keys; RecordTypePrototype._defaultValues = defaultValues; + for (let i = 0; i < keys.length; i++) { + const propName = keys[i]; + indices[propName] = i; + if (RecordTypePrototype[propName]) { + /* eslint-disable no-console */ + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + typeof console === 'object' && + console.warn && + console.warn( + 'Cannot define ' + + recordName(this) + + ' with property "' + + propName + + '" since that property name is part of the Record API.' + ); + /* eslint-enable no-console */ + } else { + setProp(RecordTypePrototype, propName); + } + } } - this._map = Map(values); + this.__ownerID = undefined; + this._values = List().withMutations((l) => { + l.setSize(this._keys.length); + KeyedCollection(values).forEach((v, k) => { + l.set(this._indices[k], v === this._defaultValues[k] ? undefined : v); + }); + }); + return this; }; - var RecordTypePrototype = RecordType.prototype = Object.create(RecordPrototype); + const RecordTypePrototype = (RecordType.prototype = + Object.create(RecordPrototype)); RecordTypePrototype.constructor = RecordType; + if (name) { + RecordType.displayName = name; + } + + // eslint-disable-next-line no-constructor-return return RecordType; } toString() { - return this.__toString(recordName(this) + ' {', '}'); + let str = recordName(this) + ' { '; + const keys = this._keys; + let k; + for (let i = 0, l = keys.length; i !== l; i++) { + k = keys[i]; + str += (i ? ', ' : '') + k + ': ' + quoteString(this.get(k)); + } + return str + ' }'; + } + + equals(other) { + return ( + this === other || + (isRecord(other) && recordSeq(this).equals(recordSeq(other))) + ); + } + + hashCode() { + return recordSeq(this).hashCode(); } // @pragma Access has(k) { - return this._defaultValues.hasOwnProperty(k); + return this._indices.hasOwnProperty(k); } get(k, notSetValue) { if (!this.has(k)) { return notSetValue; } - var defaultVal = this._defaultValues[k]; - return this._map ? this._map.get(k, defaultVal) : defaultVal; + const index = this._indices[k]; + const value = this._values.get(index); + return value === undefined ? this._defaultValues[k] : value; } // @pragma Modification - clear() { - if (this.__ownerID) { - this._map && this._map.clear(); - return this; - } - var RecordType = this.constructor; - return RecordType._empty || (RecordType._empty = makeRecord(this, emptyMap())); - } - set(k, v) { - if (!this.has(k)) { - throw new Error('Cannot set unknown key "' + k + '" on ' + recordName(this)); - } - if (this._map && !this._map.has(k)) { - var defaultVal = this._defaultValues[k]; - if (v === defaultVal) { - return this; + if (this.has(k)) { + const newValues = this._values.set( + this._indices[k], + v === this._defaultValues[k] ? undefined : v + ); + if (newValues !== this._values && !this.__ownerID) { + return makeRecord(this, newValues); } } - var newMap = this._map && this._map.set(k, v); - if (this.__ownerID || newMap === this._map) { - return this; - } - return makeRecord(this, newMap); + return this; } remove(k) { - if (!this.has(k)) { - return this; - } - var newMap = this._map && this._map.remove(k); - if (this.__ownerID || newMap === this._map) { - return this; - } - return makeRecord(this, newMap); + return this.set(k); + } + + clear() { + const newValues = this._values.clear().setSize(this._keys.length); + + return this.__ownerID ? this : makeRecord(this, newValues); } wasAltered() { - return this._map.wasAltered(); + return this._values.wasAltered(); + } + + toSeq() { + return recordSeq(this); + } + + toJS() { + return toJS(this); + } + + entries() { + return this.__iterator(ITERATE_ENTRIES); } __iterator(type, reverse) { - return KeyedIterable(this._defaultValues).map((_, k) => this.get(k)).__iterator(type, reverse); + return recordSeq(this).__iterator(type, reverse); } __iterate(fn, reverse) { - return KeyedIterable(this._defaultValues).map((_, k) => this.get(k)).__iterate(fn, reverse); + return recordSeq(this).__iterate(fn, reverse); } __ensureOwner(ownerID) { if (ownerID === this.__ownerID) { return this; } - var newMap = this._map && this._map.__ensureOwner(ownerID); + const newValues = this._values.__ensureOwner(ownerID); if (!ownerID) { this.__ownerID = ownerID; - this._map = newMap; + this._values = newValues; return this; } - return makeRecord(this, newMap, ownerID); + return makeRecord(this, newValues, ownerID); } } -var RecordPrototype = Record.prototype; +Record.isRecord = isRecord; +Record.getDescriptiveName = recordName; +const RecordPrototype = Record.prototype; +RecordPrototype[IS_RECORD_SYMBOL] = true; RecordPrototype[DELETE] = RecordPrototype.remove; -RecordPrototype.deleteIn = -RecordPrototype.removeIn = MapPrototype.removeIn; -RecordPrototype.merge = MapPrototype.merge; -RecordPrototype.mergeWith = MapPrototype.mergeWith; -RecordPrototype.mergeIn = MapPrototype.mergeIn; -RecordPrototype.mergeDeep = MapPrototype.mergeDeep; -RecordPrototype.mergeDeepWith = MapPrototype.mergeDeepWith; -RecordPrototype.mergeDeepIn = MapPrototype.mergeDeepIn; -RecordPrototype.setIn = MapPrototype.setIn; -RecordPrototype.update = MapPrototype.update; -RecordPrototype.updateIn = MapPrototype.updateIn; -RecordPrototype.withMutations = MapPrototype.withMutations; -RecordPrototype.asMutable = MapPrototype.asMutable; -RecordPrototype.asImmutable = MapPrototype.asImmutable; - - -function makeRecord(likeRecord, map, ownerID) { - var record = Object.create(Object.getPrototypeOf(likeRecord)); - record._map = map; +RecordPrototype.deleteIn = RecordPrototype.removeIn = deleteIn; +RecordPrototype.getIn = getIn; +RecordPrototype.hasIn = CollectionPrototype.hasIn; +RecordPrototype.merge = merge; +RecordPrototype.mergeWith = mergeWith; +RecordPrototype.mergeIn = mergeIn; +RecordPrototype.mergeDeep = mergeDeep; +RecordPrototype.mergeDeepWith = mergeDeepWith; +RecordPrototype.mergeDeepIn = mergeDeepIn; +RecordPrototype.setIn = setIn; +RecordPrototype.update = update; +RecordPrototype.updateIn = updateIn; +RecordPrototype.withMutations = withMutations; +RecordPrototype.asMutable = asMutable; +RecordPrototype.asImmutable = asImmutable; +RecordPrototype[ITERATOR_SYMBOL] = RecordPrototype.entries; +RecordPrototype.toJSON = RecordPrototype.toObject = + CollectionPrototype.toObject; +RecordPrototype.inspect = RecordPrototype.toSource = function () { + return this.toString(); +}; + +function makeRecord(likeRecord, values, ownerID) { + const record = Object.create(Object.getPrototypeOf(likeRecord)); + record._values = values; record.__ownerID = ownerID; return record; } function recordName(record) { - return record._name || record.constructor.name || 'Record'; + return record.constructor.displayName || record.constructor.name || 'Record'; +} + +function recordSeq(record) { + return keyedSeqFromValue(record._keys.map((k) => [k, record.get(k)])); } -function setProps(prototype, names) { +function setProp(prototype, name) { try { - names.forEach(setProp.bind(undefined, prototype)); + Object.defineProperty(prototype, name, { + get: function () { + return this.get(name); + }, + set: function (value) { + invariant(this.__ownerID, 'Cannot set on an immutable record.'); + this.set(name, value); + }, + }); + // eslint-disable-next-line @typescript-eslint/no-unused-vars -- TODO enable eslint here } catch (error) { // Object.defineProperty failed. Probably IE8. } } - -function setProp(prototype, name) { - Object.defineProperty(prototype, name, { - get: function() { - return this.get(name); - }, - set: function(value) { - invariant(this.__ownerID, 'Cannot set on an immutable record.'); - this.set(name, value); - } - }); -} diff --git a/src/Repeat.js b/src/Repeat.js index 6135a1ec79..0fb106156c 100644 --- a/src/Repeat.js +++ b/src/Repeat.js @@ -1,36 +1,28 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -import { wholeSlice, resolveBegin, resolveEnd } from './TrieUtils' -import { IndexedSeq } from './Seq' -import { is } from './is' -import { Iterator, iteratorValue, iteratorDone } from './Iterator' - -import deepEqual from './utils/deepEqual' +import { wholeSlice, resolveBegin, resolveEnd } from './TrieUtils'; +import { IndexedSeq } from './Seq'; +import { is } from './is'; +import { Iterator, iteratorValue, iteratorDone } from './Iterator'; +import deepEqual from './utils/deepEqual'; /** * Returns a lazy Seq of `value` repeated `times` times. When `times` is * undefined, returns an infinite sequence of `value`. */ export class Repeat extends IndexedSeq { - constructor(value, times) { if (!(this instanceof Repeat)) { + // eslint-disable-next-line no-constructor-return return new Repeat(value, times); } this._value = value; this.size = times === undefined ? Infinity : Math.max(0, times); if (this.size === 0) { if (EMPTY_REPEAT) { + // eslint-disable-next-line no-constructor-return return EMPTY_REPEAT; } + // eslint-disable-next-line @typescript-eslint/no-this-alias EMPTY_REPEAT = this; } } @@ -51,9 +43,13 @@ export class Repeat extends IndexedSeq { } slice(begin, end) { - var size = this.size; - return wholeSlice(begin, end, size) ? this : - new Repeat(this._value, resolveEnd(end, size) - resolveBegin(begin, size)); + const size = this.size; + return wholeSlice(begin, end, size) + ? this + : new Repeat( + this._value, + resolveEnd(end, size) - resolveBegin(begin, size) + ); } reverse() { @@ -75,26 +71,31 @@ export class Repeat extends IndexedSeq { } __iterate(fn, reverse) { - for (var ii = 0; ii < this.size; ii++) { - if (fn(this._value, ii, this) === false) { - return ii + 1; + const size = this.size; + let i = 0; + while (i !== size) { + if (fn(this._value, reverse ? size - ++i : i++, this) === false) { + break; } } - return ii; + return i; } __iterator(type, reverse) { - var ii = 0; + const size = this.size; + let i = 0; return new Iterator(() => - ii < this.size ? iteratorValue(type, ii++, this._value) : iteratorDone() + i === size + ? iteratorDone() + : iteratorValue(type, reverse ? size - ++i : i++, this._value) ); } equals(other) { - return other instanceof Repeat ? - is(this._value, other._value) : - deepEqual(other); + return other instanceof Repeat + ? is(this._value, other._value) + : deepEqual(this, other); } } -var EMPTY_REPEAT; +let EMPTY_REPEAT; diff --git a/src/Seq.js b/src/Seq.js index e8b313d2d5..fd2a1dea58 100644 --- a/src/Seq.js +++ b/src/Seq.js @@ -1,27 +1,34 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -import { wrapIndex } from './TrieUtils' -import { isIterable, isKeyed, Iterable, IS_ORDERED_SENTINEL } from './Iterable' -import { Iterator, iteratorValue, iteratorDone, hasIterator, isIterator, getIterator } from './Iterator' - -import isArrayLike from './utils/isArrayLike' - - -export class Seq extends Iterable { +import { wrapIndex } from './TrieUtils'; +import { Collection } from './Collection'; +import { IS_SEQ_SYMBOL, isSeq } from './predicates/isSeq'; +import { isImmutable } from './predicates/isImmutable'; +import { isCollection } from './predicates/isCollection'; +import { isKeyed } from './predicates/isKeyed'; +import { isAssociative } from './predicates/isAssociative'; +import { isRecord } from './predicates/isRecord'; +import { IS_ORDERED_SYMBOL } from './predicates/isOrdered'; +import { + Iterator, + iteratorValue, + iteratorDone, + hasIterator, + isIterator, + getIterator, + isEntriesIterable, + isKeysIterable, +} from './Iterator'; + +import hasOwnProperty from './utils/hasOwnProperty'; +import isArrayLike from './utils/isArrayLike'; + +export class Seq extends Collection { constructor(value) { - return value === null || value === undefined ? emptySequence() : - isIterable(value) ? value.toSeq() : seqFromValue(value); - } - - static of(/*...values*/) { - return Seq(arguments); + // eslint-disable-next-line no-constructor-return + return value === undefined || value === null + ? emptySequence() + : isImmutable(value) + ? value.toSeq() + : seqFromValue(value); } toSeq() { @@ -43,24 +50,52 @@ export class Seq extends Iterable { // abstract __iterateUncached(fn, reverse) __iterate(fn, reverse) { - return seqIterate(this, fn, reverse, true); + const cache = this._cache; + if (cache) { + const size = cache.length; + let i = 0; + while (i !== size) { + const entry = cache[reverse ? size - ++i : i++]; + if (fn(entry[1], entry[0], this) === false) { + break; + } + } + return i; + } + return this.__iterateUncached(fn, reverse); } // abstract __iteratorUncached(type, reverse) __iterator(type, reverse) { - return seqIterator(this, type, reverse, true); + const cache = this._cache; + if (cache) { + const size = cache.length; + let i = 0; + return new Iterator(() => { + if (i === size) { + return iteratorDone(); + } + const entry = cache[reverse ? size - ++i : i++]; + return iteratorValue(type, entry[0], entry[1]); + }); + } + return this.__iteratorUncached(type, reverse); } } - export class KeyedSeq extends Seq { constructor(value) { - return value === null || value === undefined ? - emptySequence().toKeyedSeq() : - isIterable(value) ? - (isKeyed(value) ? value.toSeq() : value.fromEntrySeq()) : - keyedSeqFromValue(value); + // eslint-disable-next-line no-constructor-return + return value === undefined || value === null + ? emptySequence().toKeyedSeq() + : isCollection(value) + ? isKeyed(value) + ? value.toSeq() + : value.fromEntrySeq() + : isRecord(value) + ? value.toSeq() + : keyedSeqFromValue(value); } toKeyedSeq() { @@ -68,12 +103,18 @@ export class KeyedSeq extends Seq { } } - export class IndexedSeq extends Seq { constructor(value) { - return value === null || value === undefined ? emptySequence() : - !isIterable(value) ? indexedSeqFromValue(value) : - isKeyed(value) ? value.entrySeq() : value.toIndexedSeq(); + // eslint-disable-next-line no-constructor-return + return value === undefined || value === null + ? emptySequence() + : isCollection(value) + ? isKeyed(value) + ? value.entrySeq() + : value.toIndexedSeq() + : isRecord(value) + ? value.toSeq().entrySeq() + : indexedSeqFromValue(value); } static of(/*...values*/) { @@ -87,23 +128,13 @@ export class IndexedSeq extends Seq { toString() { return this.__toString('Seq [', ']'); } - - __iterate(fn, reverse) { - return seqIterate(this, fn, reverse, false); - } - - __iterator(type, reverse) { - return seqIterator(this, type, reverse, false); - } } - export class SetSeq extends Seq { constructor(value) { + // eslint-disable-next-line no-constructor-return return ( - value === null || value === undefined ? emptySequence() : - !isIterable(value) ? indexedSeqFromValue(value) : - isKeyed(value) ? value.entrySeq() : value + isCollection(value) && !isAssociative(value) ? value : IndexedSeq(value) ).toSetSeq(); } @@ -116,17 +147,12 @@ export class SetSeq extends Seq { } } - Seq.isSeq = isSeq; Seq.Keyed = KeyedSeq; Seq.Set = SetSeq; Seq.Indexed = IndexedSeq; -var IS_SEQ_SENTINEL = '@@__IMMUTABLE_SEQ__@@'; - -Seq.prototype[IS_SEQ_SENTINEL] = true; - - +Seq.prototype[IS_SEQ_SYMBOL] = true; // #pragma Root Sequences @@ -141,32 +167,37 @@ export class ArraySeq extends IndexedSeq { } __iterate(fn, reverse) { - var array = this._array; - var maxIndex = array.length - 1; - for (var ii = 0; ii <= maxIndex; ii++) { - if (fn(array[reverse ? maxIndex - ii : ii], ii, this) === false) { - return ii + 1; + const array = this._array; + const size = array.length; + let i = 0; + while (i !== size) { + const ii = reverse ? size - ++i : i++; + if (fn(array[ii], ii, this) === false) { + break; } } - return ii; + return i; } __iterator(type, reverse) { - var array = this._array; - var maxIndex = array.length - 1; - var ii = 0; - return new Iterator(() => - ii > maxIndex ? - iteratorDone() : - iteratorValue(type, ii, array[reverse ? maxIndex - ii++ : ii++]) - ); + const array = this._array; + const size = array.length; + let i = 0; + return new Iterator(() => { + if (i === size) { + return iteratorDone(); + } + const ii = reverse ? size - ++i : i++; + return iteratorValue(type, ii, array[ii]); + }); } } - class ObjectSeq extends KeyedSeq { constructor(object) { - var keys = Object.keys(object); + const keys = Object.keys(object).concat( + Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(object) : [] + ); this._object = object; this._keys = keys; this.size = keys.length; @@ -180,53 +211,54 @@ class ObjectSeq extends KeyedSeq { } has(key) { - return this._object.hasOwnProperty(key); + return hasOwnProperty.call(this._object, key); } __iterate(fn, reverse) { - var object = this._object; - var keys = this._keys; - var maxIndex = keys.length - 1; - for (var ii = 0; ii <= maxIndex; ii++) { - var key = keys[reverse ? maxIndex - ii : ii]; + const object = this._object; + const keys = this._keys; + const size = keys.length; + let i = 0; + while (i !== size) { + const key = keys[reverse ? size - ++i : i++]; if (fn(object[key], key, this) === false) { - return ii + 1; + break; } } - return ii; + return i; } __iterator(type, reverse) { - var object = this._object; - var keys = this._keys; - var maxIndex = keys.length - 1; - var ii = 0; + const object = this._object; + const keys = this._keys; + const size = keys.length; + let i = 0; return new Iterator(() => { - var key = keys[reverse ? maxIndex - ii : ii]; - return ii++ > maxIndex ? - iteratorDone() : - iteratorValue(type, key, object[key]); + if (i === size) { + return iteratorDone(); + } + const key = keys[reverse ? size - ++i : i++]; + return iteratorValue(type, key, object[key]); }); } } -ObjectSeq.prototype[IS_ORDERED_SENTINEL] = true; - +ObjectSeq.prototype[IS_ORDERED_SYMBOL] = true; -class IterableSeq extends IndexedSeq { - constructor(iterable) { - this._iterable = iterable; - this.size = iterable.length || iterable.size; +class CollectionSeq extends IndexedSeq { + constructor(collection) { + this._collection = collection; + this.size = collection.length || collection.size; } __iterateUncached(fn, reverse) { if (reverse) { return this.cacheResult().__iterate(fn, reverse); } - var iterable = this._iterable; - var iterator = getIterator(iterable); - var iterations = 0; + const collection = this._collection; + const iterator = getIterator(collection); + let iterations = 0; if (isIterator(iterator)) { - var step; + let step; while (!(step = iterator.next()).done) { if (fn(step.value, iterations++, this) === false) { break; @@ -240,155 +272,72 @@ class IterableSeq extends IndexedSeq { if (reverse) { return this.cacheResult().__iterator(type, reverse); } - var iterable = this._iterable; - var iterator = getIterator(iterable); + const collection = this._collection; + const iterator = getIterator(collection); if (!isIterator(iterator)) { return new Iterator(iteratorDone); } - var iterations = 0; + let iterations = 0; return new Iterator(() => { - var step = iterator.next(); + const step = iterator.next(); return step.done ? step : iteratorValue(type, iterations++, step.value); }); } } - -class IteratorSeq extends IndexedSeq { - constructor(iterator) { - this._iterator = iterator; - this._iteratorCache = []; - } - - __iterateUncached(fn, reverse) { - if (reverse) { - return this.cacheResult().__iterate(fn, reverse); - } - var iterator = this._iterator; - var cache = this._iteratorCache; - var iterations = 0; - while (iterations < cache.length) { - if (fn(cache[iterations], iterations++, this) === false) { - return iterations; - } - } - var step; - while (!(step = iterator.next()).done) { - var val = step.value; - cache[iterations] = val; - if (fn(val, iterations++, this) === false) { - break; - } - } - return iterations; - } - - __iteratorUncached(type, reverse) { - if (reverse) { - return this.cacheResult().__iterator(type, reverse); - } - var iterator = this._iterator; - var cache = this._iteratorCache; - var iterations = 0; - return new Iterator(() => { - if (iterations >= cache.length) { - var step = iterator.next(); - if (step.done) { - return step; - } - cache[iterations] = step.value; - } - return iteratorValue(type, iterations, cache[iterations++]); - }); - } -} - - - // # pragma Helper functions -export function isSeq(maybeSeq) { - return !!(maybeSeq && maybeSeq[IS_SEQ_SENTINEL]); -} - -var EMPTY_SEQ; +let EMPTY_SEQ; function emptySequence() { return EMPTY_SEQ || (EMPTY_SEQ = new ArraySeq([])); } export function keyedSeqFromValue(value) { - var seq = - Array.isArray(value) ? new ArraySeq(value).fromEntrySeq() : - isIterator(value) ? new IteratorSeq(value).fromEntrySeq() : - hasIterator(value) ? new IterableSeq(value).fromEntrySeq() : - typeof value === 'object' ? new ObjectSeq(value) : - undefined; - if (!seq) { - throw new TypeError( - 'Expected Array or iterable object of [k, v] entries, '+ - 'or keyed object: ' + value - ); + const seq = maybeIndexedSeqFromValue(value); + if (seq) { + return seq.fromEntrySeq(); } - return seq; + if (typeof value === 'object') { + return new ObjectSeq(value); + } + throw new TypeError( + 'Expected Array or collection object of [k, v] entries, or keyed object: ' + + value + ); } export function indexedSeqFromValue(value) { - var seq = maybeIndexedSeqFromValue(value); - if (!seq) { - throw new TypeError( - 'Expected Array or iterable object of values: ' + value - ); + const seq = maybeIndexedSeqFromValue(value); + if (seq) { + return seq; } - return seq; + throw new TypeError( + 'Expected Array or collection object of values: ' + value + ); } function seqFromValue(value) { - var seq = maybeIndexedSeqFromValue(value) || - (typeof value === 'object' && new ObjectSeq(value)); - if (!seq) { - throw new TypeError( - 'Expected Array or iterable object of values, or keyed object: ' + value - ); - } - return seq; -} - -function maybeIndexedSeqFromValue(value) { - return ( - isArrayLike(value) ? new ArraySeq(value) : - isIterator(value) ? new IteratorSeq(value) : - hasIterator(value) ? new IterableSeq(value) : - undefined + const seq = maybeIndexedSeqFromValue(value); + if (seq) { + return isEntriesIterable(value) + ? seq.fromEntrySeq() + : isKeysIterable(value) + ? seq.toSetSeq() + : seq; + } + if (typeof value === 'object') { + return new ObjectSeq(value); + } + throw new TypeError( + 'Expected Array or collection object of values, or keyed object: ' + value ); } -function seqIterate(seq, fn, reverse, useKeys) { - var cache = seq._cache; - if (cache) { - var maxIndex = cache.length - 1; - for (var ii = 0; ii <= maxIndex; ii++) { - var entry = cache[reverse ? maxIndex - ii : ii]; - if (fn(entry[1], useKeys ? entry[0] : ii, seq) === false) { - return ii + 1; - } - } - return ii; - } - return seq.__iterateUncached(fn, reverse); -} - -function seqIterator(seq, type, reverse, useKeys) { - var cache = seq._cache; - if (cache) { - var maxIndex = cache.length - 1; - var ii = 0; - return new Iterator(() => { - var entry = cache[reverse ? maxIndex - ii : ii]; - return ii++ > maxIndex ? - iteratorDone() : - iteratorValue(type, useKeys ? entry[0] : ii - 1, entry[1]); - }); - } - return seq.__iteratorUncached(type, reverse); +function maybeIndexedSeqFromValue(value) { + return isArrayLike(value) + ? new ArraySeq(value) + : hasIterator(value) + ? new CollectionSeq(value) + : undefined; } diff --git a/src/Set.js b/src/Set.js index 0fa11714f5..cc42bc10f7 100644 --- a/src/Set.js +++ b/src/Set.js @@ -1,34 +1,30 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -import { SetIterable, KeyedIterable, isOrdered } from './Iterable' -import { SetCollection } from './Collection' -import { emptyMap, MapPrototype } from './Map' -import { DELETE } from './TrieUtils' -import { sortFactory } from './Operations' -import assertNotInfinite from './utils/assertNotInfinite' - -import { OrderedSet } from './OrderedSet' - +import { Collection, SetCollection, KeyedCollection } from './Collection'; +import { isOrdered } from './predicates/isOrdered'; +import { IS_SET_SYMBOL, isSet } from './predicates/isSet'; +import { emptyMap } from './Map'; +import { DELETE } from './TrieUtils'; +import { sortFactory } from './Operations'; +import assertNotInfinite from './utils/assertNotInfinite'; +import { asImmutable } from './methods/asImmutable'; +import { asMutable } from './methods/asMutable'; +import { withMutations } from './methods/withMutations'; + +import { OrderedSet } from './OrderedSet'; export class Set extends SetCollection { - // @pragma Construction constructor(value) { - return value === null || value === undefined ? emptySet() : - isSet(value) && !isOrdered(value) ? value : - emptySet().withMutations(set => { - var iter = SetIterable(value); - assertNotInfinite(iter.size); - iter.forEach(v => set.add(v)); - }); + // eslint-disable-next-line no-constructor-return + return value === undefined || value === null + ? emptySet() + : isSet(value) && !isOrdered(value) + ? value + : emptySet().withMutations((set) => { + const iter = SetCollection(value); + assertNotInfinite(iter.size); + iter.forEach((v) => set.add(v)); + }); } static of(/*...values*/) { @@ -36,7 +32,21 @@ export class Set extends SetCollection { } static fromKeys(value) { - return this(KeyedIterable(value).keySeq()); + return this(KeyedCollection(value).keySeq()); + } + + static intersect(sets) { + sets = Collection(sets).toArray(); + return sets.length + ? SetPrototype.intersect.apply(Set(sets.pop()), sets) + : emptySet(); + } + + static union(sets) { + sets = Collection(sets).toArray(); + return sets.length + ? SetPrototype.union.apply(Set(sets.pop()), sets) + : emptySet(); } toString() { @@ -52,7 +62,7 @@ export class Set extends SetCollection { // @pragma Modification add(value) { - return updateSet(this, this._map.set(value, true)); + return updateSet(this, this._map.set(value, value)); } remove(value) { @@ -65,17 +75,41 @@ export class Set extends SetCollection { // @pragma Composition + map(mapper, context) { + // keep track if the set is altered by the map function + let didChanges = false; + + const newMap = updateSet( + this, + this._map.mapEntries(([, v]) => { + const mapped = mapper.call(context, v, v, this); + + if (mapped !== v) { + didChanges = true; + } + + return [mapped, mapped]; + }, context) + ); + + return didChanges ? newMap : this; + } + union(...iters) { - iters = iters.filter(x => x.size !== 0); + iters = iters.filter((x) => x.size !== 0); if (iters.length === 0) { return this; } if (this.size === 0 && !this.__ownerID && iters.length === 1) { return this.constructor(iters[0]); } - return this.withMutations(set => { - for (var ii = 0; ii < iters.length; ii++) { - SetIterable(iters[ii]).forEach(value => set.add(value)); + return this.withMutations((set) => { + for (let ii = 0; ii < iters.length; ii++) { + if (typeof iters[ii] === 'string') { + set.add(iters[ii]); + } else { + SetCollection(iters[ii]).forEach((value) => set.add(value)); + } } }); } @@ -84,13 +118,16 @@ export class Set extends SetCollection { if (iters.length === 0) { return this; } - iters = iters.map(iter => SetIterable(iter)); - var originalSet = this; - return this.withMutations(set => { - originalSet.forEach(value => { - if (!iters.every(iter => iter.includes(value))) { - set.remove(value); - } + iters = iters.map((iter) => SetCollection(iter)); + const toRemove = []; + this.forEach((value) => { + if (!iters.every((iter) => iter.includes(value))) { + toRemove.push(value); + } + }); + return this.withMutations((set) => { + toRemove.forEach((value) => { + set.remove(value); }); }); } @@ -99,25 +136,20 @@ export class Set extends SetCollection { if (iters.length === 0) { return this; } - iters = iters.map(iter => SetIterable(iter)); - var originalSet = this; - return this.withMutations(set => { - originalSet.forEach(value => { - if (iters.some(iter => iter.includes(value))) { - set.remove(value); - } + iters = iters.map((iter) => SetCollection(iter)); + const toRemove = []; + this.forEach((value) => { + if (iters.some((iter) => iter.includes(value))) { + toRemove.push(value); + } + }); + return this.withMutations((set) => { + toRemove.forEach((value) => { + set.remove(value); }); }); } - merge() { - return this.union.apply(this, arguments); - } - - mergeWith(merger, ...iters) { - return this.union.apply(this, iters); - } - sort(comparator) { // Late binding return OrderedSet(sortFactory(this, comparator)); @@ -133,19 +165,22 @@ export class Set extends SetCollection { } __iterate(fn, reverse) { - return this._map.__iterate((_, k) => fn(k, k, this), reverse); + return this._map.__iterate((k) => fn(k, k, this), reverse); } __iterator(type, reverse) { - return this._map.map((_, k) => k).__iterator(type, reverse); + return this._map.__iterator(type, reverse); } __ensureOwner(ownerID) { if (ownerID === this.__ownerID) { return this; } - var newMap = this._map.__ensureOwner(ownerID); + const newMap = this._map.__ensureOwner(ownerID); if (!ownerID) { + if (this.size === 0) { + return this.__empty(); + } this.__ownerID = ownerID; this._map = newMap; return this; @@ -154,22 +189,21 @@ export class Set extends SetCollection { } } -export function isSet(maybeSet) { - return !!(maybeSet && maybeSet[IS_SET_SENTINEL]); -} - Set.isSet = isSet; -var IS_SET_SENTINEL = '@@__IMMUTABLE_SET__@@'; - -var SetPrototype = Set.prototype; -SetPrototype[IS_SET_SENTINEL] = true; +const SetPrototype = Set.prototype; +SetPrototype[IS_SET_SYMBOL] = true; SetPrototype[DELETE] = SetPrototype.remove; -SetPrototype.mergeDeep = SetPrototype.merge; -SetPrototype.mergeDeepWith = SetPrototype.mergeWith; -SetPrototype.withMutations = MapPrototype.withMutations; -SetPrototype.asMutable = MapPrototype.asMutable; -SetPrototype.asImmutable = MapPrototype.asImmutable; +SetPrototype.merge = SetPrototype.concat = SetPrototype.union; +SetPrototype.withMutations = withMutations; +SetPrototype.asImmutable = asImmutable; +SetPrototype['@@transducer/init'] = SetPrototype.asMutable = asMutable; +SetPrototype['@@transducer/step'] = function (result, arr) { + return result.add(arr); +}; +SetPrototype['@@transducer/result'] = function (obj) { + return obj.asImmutable(); +}; SetPrototype.__empty = emptySet; SetPrototype.__make = makeSet; @@ -180,20 +214,22 @@ function updateSet(set, newMap) { set._map = newMap; return set; } - return newMap === set._map ? set : - newMap.size === 0 ? set.__empty() : - set.__make(newMap); + return newMap === set._map + ? set + : newMap.size === 0 + ? set.__empty() + : set.__make(newMap); } function makeSet(map, ownerID) { - var set = Object.create(SetPrototype); + const set = Object.create(SetPrototype); set.size = map ? map.size : 0; set._map = map; set.__ownerID = ownerID; return set; } -var EMPTY_SET; +let EMPTY_SET; function emptySet() { return EMPTY_SET || (EMPTY_SET = makeSet(emptyMap())); } diff --git a/src/Stack.js b/src/Stack.js index 26f7d7b9cc..32414fa3a0 100644 --- a/src/Stack.js +++ b/src/Stack.js @@ -1,28 +1,24 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -import { wholeSlice, resolveBegin, resolveEnd, wrapIndex } from './TrieUtils' -import { IndexedIterable } from './Iterable' -import { IndexedCollection } from './Collection' -import { MapPrototype } from './Map' -import { Iterator, iteratorValue, iteratorDone } from './Iterator' -import assertNotInfinite from './utils/assertNotInfinite' - +import { wholeSlice, resolveBegin, resolveEnd, wrapIndex } from './TrieUtils'; +import { IndexedCollection } from './Collection'; +import { ArraySeq } from './Seq'; +import { Iterator, iteratorValue, iteratorDone } from './Iterator'; +import { IS_STACK_SYMBOL, isStack } from './predicates/isStack'; +import assertNotInfinite from './utils/assertNotInfinite'; +import { asImmutable } from './methods/asImmutable'; +import { asMutable } from './methods/asMutable'; +import { wasAltered } from './methods/wasAltered'; +import { withMutations } from './methods/withMutations'; export class Stack extends IndexedCollection { - // @pragma Construction constructor(value) { - return value === null || value === undefined ? emptyStack() : - isStack(value) ? value : - emptyStack().unshiftAll(value); + // eslint-disable-next-line no-constructor-return + return value === undefined || value === null + ? emptyStack() + : isStack(value) + ? value + : emptyStack().pushAll(value); } static of(/*...values*/) { @@ -36,7 +32,7 @@ export class Stack extends IndexedCollection { // @pragma Access get(index, notSetValue) { - var head = this._head; + let head = this._head; index = wrapIndex(this, index); while (head && index--) { head = head.next; @@ -54,12 +50,12 @@ export class Stack extends IndexedCollection { if (arguments.length === 0) { return this; } - var newSize = this.size + arguments.length; - var head = this._head; - for (var ii = arguments.length - 1; ii >= 0; ii--) { + const newSize = this.size + arguments.length; + let head = this._head; + for (let ii = arguments.length - 1; ii >= 0; ii--) { head = { value: arguments[ii], - next: head + next: head, }; } if (this.__ownerID) { @@ -73,20 +69,23 @@ export class Stack extends IndexedCollection { } pushAll(iter) { - iter = IndexedIterable(iter); + iter = IndexedCollection(iter); if (iter.size === 0) { return this; } + if (this.size === 0 && isStack(iter)) { + return iter; + } assertNotInfinite(iter.size); - var newSize = this.size; - var head = this._head; - iter.reverse().forEach(value => { + let newSize = this.size; + let head = this._head; + iter.__iterate((value) => { newSize++; head = { value: value, - next: head + next: head, }; - }); + }, /* reverse */ true); if (this.__ownerID) { this.size = newSize; this._head = head; @@ -101,18 +100,6 @@ export class Stack extends IndexedCollection { return this.slice(1); } - unshift(/*...values*/) { - return this.push.apply(this, arguments); - } - - unshiftAll(iter) { - return this.pushAll(iter); - } - - shift() { - return this.pop.apply(this, arguments); - } - clear() { if (this.size === 0) { return this; @@ -131,14 +118,14 @@ export class Stack extends IndexedCollection { if (wholeSlice(begin, end, this.size)) { return this; } - var resolvedBegin = resolveBegin(begin, this.size); - var resolvedEnd = resolveEnd(end, this.size); + let resolvedBegin = resolveBegin(begin, this.size); + const resolvedEnd = resolveEnd(end, this.size); if (resolvedEnd !== this.size) { // super.slice(begin, end); return IndexedCollection.prototype.slice.call(this, begin, end); } - var newSize = this.size - resolvedBegin; - var head = this._head; + const newSize = this.size - resolvedBegin; + let head = this._head; while (resolvedBegin--) { head = head.next; } @@ -159,6 +146,9 @@ export class Stack extends IndexedCollection { return this; } if (!ownerID) { + if (this.size === 0) { + return emptyStack(); + } this.__ownerID = ownerID; this.__altered = false; return this; @@ -170,10 +160,13 @@ export class Stack extends IndexedCollection { __iterate(fn, reverse) { if (reverse) { - return this.reverse().__iterate(fn); + return new ArraySeq(this.toArray()).__iterate( + (v, k) => fn(v, k, this), + reverse + ); } - var iterations = 0; - var node = this._head; + let iterations = 0; + let node = this._head; while (node) { if (fn(node.value, iterations++, this) === false) { break; @@ -185,13 +178,13 @@ export class Stack extends IndexedCollection { __iterator(type, reverse) { if (reverse) { - return this.reverse().__iterator(type); + return new ArraySeq(this.toArray()).__iterator(type, reverse); } - var iterations = 0; - var node = this._head; + let iterations = 0; + let node = this._head; return new Iterator(() => { if (node) { - var value = node.value; + const value = node.value; node = node.next; return iteratorValue(type, iterations++, value); } @@ -200,24 +193,26 @@ export class Stack extends IndexedCollection { } } -function isStack(maybeStack) { - return !!(maybeStack && maybeStack[IS_STACK_SENTINEL]); -} - Stack.isStack = isStack; -var IS_STACK_SENTINEL = '@@__IMMUTABLE_STACK__@@'; - -var StackPrototype = Stack.prototype; -StackPrototype[IS_STACK_SENTINEL] = true; -StackPrototype.withMutations = MapPrototype.withMutations; -StackPrototype.asMutable = MapPrototype.asMutable; -StackPrototype.asImmutable = MapPrototype.asImmutable; -StackPrototype.wasAltered = MapPrototype.wasAltered; - +const StackPrototype = Stack.prototype; +StackPrototype[IS_STACK_SYMBOL] = true; +StackPrototype.shift = StackPrototype.pop; +StackPrototype.unshift = StackPrototype.push; +StackPrototype.unshiftAll = StackPrototype.pushAll; +StackPrototype.withMutations = withMutations; +StackPrototype.wasAltered = wasAltered; +StackPrototype.asImmutable = asImmutable; +StackPrototype['@@transducer/init'] = StackPrototype.asMutable = asMutable; +StackPrototype['@@transducer/step'] = function (result, arr) { + return result.unshift(arr); +}; +StackPrototype['@@transducer/result'] = function (obj) { + return obj.asImmutable(); +}; function makeStack(size, head, ownerID, hash) { - var map = Object.create(StackPrototype); + const map = Object.create(StackPrototype); map.size = size; map._head = head; map.__ownerID = ownerID; @@ -226,7 +221,7 @@ function makeStack(size, head, ownerID, hash) { return map; } -var EMPTY_STACK; +let EMPTY_STACK; function emptyStack() { return EMPTY_STACK || (EMPTY_STACK = makeStack(0)); } diff --git a/src/TrieUtils.js b/src/TrieUtils.js deleted file mode 100644 index 6d47b49137..0000000000 --- a/src/TrieUtils.js +++ /dev/null @@ -1,102 +0,0 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - - -// Used for setting prototype methods that IE8 chokes on. -export var DELETE = 'delete'; - -// Constants describing the size of trie nodes. -export var SHIFT = 5; // Resulted in best performance after ______? -export var SIZE = 1 << SHIFT; -export var MASK = SIZE - 1; - -// A consistent shared value representing "not set" which equals nothing other -// than itself, and nothing that could be provided externally. -export var NOT_SET = {}; - -// Boolean references, Rough equivalent of `bool &`. -export var CHANGE_LENGTH = { value: false }; -export var DID_ALTER = { value: false }; - -export function MakeRef(ref) { - ref.value = false; - return ref; -} - -export function SetRef(ref) { - ref && (ref.value = true); -} - -// A function which returns a value representing an "owner" for transient writes -// to tries. The return value will only ever equal itself, and will not equal -// the return of any subsequent call of this function. -export function OwnerID() {} - -// http://jsperf.com/copy-array-inline -export function arrCopy(arr, offset) { - offset = offset || 0; - var len = Math.max(0, arr.length - offset); - var newArr = new Array(len); - for (var ii = 0; ii < len; ii++) { - newArr[ii] = arr[ii + offset]; - } - return newArr; -} - -export function ensureSize(iter) { - if (iter.size === undefined) { - iter.size = iter.__iterate(returnTrue); - } - return iter.size; -} - -export function wrapIndex(iter, index) { - // This implements "is array index" which the ECMAString spec defines as: - // - // A String property name P is an array index if and only if - // ToString(ToUint32(P)) is equal to P and ToUint32(P) is not equal - // to 2^32−1. - // - // http://www.ecma-international.org/ecma-262/6.0/#sec-array-exotic-objects - if (typeof index !== 'number') { - var uint32Index = index >>> 0; // N >>> 0 is shorthand for ToUint32 - if ('' + uint32Index !== index || uint32Index === 4294967295) { - return NaN; - } - index = uint32Index; - } - return index < 0 ? ensureSize(iter) + index : index; -} - -export function returnTrue() { - return true; -} - -export function wholeSlice(begin, end, size) { - return (begin === 0 || (size !== undefined && begin <= -size)) && - (end === undefined || (size !== undefined && end >= size)); -} - -export function resolveBegin(begin, size) { - return resolveIndex(begin, size, 0); -} - -export function resolveEnd(end, size) { - return resolveIndex(end, size, size); -} - -function resolveIndex(index, size, defaultIndex) { - return index === undefined ? - defaultIndex : - index < 0 ? - Math.max(0, size + index) : - size === undefined ? - index : - Math.min(size, index); -} diff --git a/src/TrieUtils.ts b/src/TrieUtils.ts new file mode 100644 index 0000000000..d5c75c179b --- /dev/null +++ b/src/TrieUtils.ts @@ -0,0 +1,105 @@ +import type { Collection } from '../type-definitions/immutable'; + +// Used for setting prototype methods that IE8 chokes on. +export const DELETE = 'delete'; + +// Constants describing the size of trie nodes. +export const SHIFT = 5; // Resulted in best performance after ______? +export const SIZE = 1 << SHIFT; +export const MASK = SIZE - 1; + +// A consistent shared value representing "not set" which equals nothing other +// than itself, and nothing that could be provided externally. +export const NOT_SET = {}; + +type Ref = { value: boolean }; + +// Boolean references, Rough equivalent of `bool &`. +export function MakeRef(): Ref { + return { value: false }; +} + +export function SetRef(ref: Ref): void { + if (ref) { + ref.value = true; + } +} + +// A function which returns a value representing an "owner" for transient writes +// to tries. The return value will only ever equal itself, and will not equal +// the return of any subsequent call of this function. +export function OwnerID() {} + +export function ensureSize(iter: Collection): number { + // @ts-expect-error size should exists on Collection + if (iter.size === undefined) { + // @ts-expect-error size should exists on Collection, __iterate does exist on Collection + iter.size = iter.__iterate(returnTrue); + } + // @ts-expect-error size should exists on Collection + return iter.size; +} + +export function wrapIndex( + iter: Collection, + index: number +): number { + // This implements "is array index" which the ECMAString spec defines as: + // + // A String property name P is an array index if and only if + // ToString(ToUint32(P)) is equal to P and ToUint32(P) is not equal + // to 2^32−1. + // + // http://www.ecma-international.org/ecma-262/6.0/#sec-array-exotic-objects + if (typeof index !== 'number') { + const uint32Index = index >>> 0; // N >>> 0 is shorthand for ToUint32 + if ('' + uint32Index !== index || uint32Index === 4294967295) { + return NaN; + } + index = uint32Index; + } + return index < 0 ? ensureSize(iter) + index : index; +} + +export function returnTrue(): true { + return true; +} + +export function wholeSlice(begin: number, end: number, size: number): boolean { + return ( + ((begin === 0 && !isNeg(begin)) || + (size !== undefined && begin <= -size)) && + (end === undefined || (size !== undefined && end >= size)) + ); +} + +export function resolveBegin(begin: number, size: number): number { + return resolveIndex(begin, size, 0); +} + +export function resolveEnd(end: number, size: number): number { + return resolveIndex(end, size, size); +} + +function resolveIndex( + index: number, + size: number, + defaultIndex: number +): number { + // Sanitize indices using this shorthand for ToInt32(argument) + // http://www.ecma-international.org/ecma-262/6.0/#sec-toint32 + return index === undefined + ? defaultIndex + : isNeg(index) + ? size === Infinity + ? size + : Math.max(0, size + index) | 0 + : size === undefined || size === index + ? index + : Math.min(size, index) | 0; +} + +function isNeg(value: number): boolean { + // Account for -0 which is negative, but not less than 0. + return value < 0 || (value === 0 && 1 / value === -Infinity); +} diff --git a/src/fromJS.js b/src/fromJS.js index a393ebaf4a..7586c12a58 100644 --- a/src/fromJS.js +++ b/src/fromJS.js @@ -1,40 +1,51 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +import { Seq } from './Seq'; +import { hasIterator } from './Iterator'; +import { isImmutable } from './predicates/isImmutable'; +import { isIndexed } from './predicates/isIndexed'; +import { isKeyed } from './predicates/isKeyed'; +import isArrayLike from './utils/isArrayLike'; +import isPlainObj from './utils/isPlainObj'; -import { KeyedSeq, IndexedSeq } from './Seq' - -export function fromJS(json, converter) { - return converter ? - fromJSWith(converter, json, '', {'': json}) : - fromJSDefault(json); -} - -function fromJSWith(converter, json, key, parentJSON) { - if (Array.isArray(json)) { - return converter.call(parentJSON, key, IndexedSeq(json).map((v, k) => fromJSWith(converter, v, k, json))); - } - if (isPlainObj(json)) { - return converter.call(parentJSON, key, KeyedSeq(json).map((v, k) => fromJSWith(converter, v, k, json))); - } - return json; +export function fromJS(value, converter) { + return fromJSWith( + [], + converter || defaultConverter, + value, + '', + converter && converter.length > 2 ? [] : undefined, + { '': value } + ); } -function fromJSDefault(json) { - if (Array.isArray(json)) { - return IndexedSeq(json).map(fromJSDefault).toList(); - } - if (isPlainObj(json)) { - return KeyedSeq(json).map(fromJSDefault).toMap(); +function fromJSWith(stack, converter, value, key, keyPath, parentValue) { + if ( + typeof value !== 'string' && + !isImmutable(value) && + (isArrayLike(value) || hasIterator(value) || isPlainObj(value)) + ) { + if (~stack.indexOf(value)) { + throw new TypeError('Cannot convert circular structure to Immutable'); + } + stack.push(value); + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + keyPath && key !== '' && keyPath.push(key); + const converted = converter.call( + parentValue, + key, + Seq(value).map((v, k) => + fromJSWith(stack, converter, v, k, keyPath, value) + ), + keyPath && keyPath.slice() + ); + stack.pop(); + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + keyPath && keyPath.pop(); + return converted; } - return json; + return value; } -function isPlainObj(value) { - return value && (value.constructor === Object || value.constructor === undefined); +function defaultConverter(k, v) { + // Effectively the opposite of "Collection.toSeq()" + return isIndexed(v) ? v.toList() : isKeyed(v) ? v.toMap() : v.toSet(); } diff --git a/src/functional/get.ts b/src/functional/get.ts new file mode 100644 index 0000000000..e6306b8f58 --- /dev/null +++ b/src/functional/get.ts @@ -0,0 +1,72 @@ +import type { Collection, Record } from '../../type-definitions/immutable'; +import { isImmutable } from '../predicates/isImmutable'; +import { has } from './has'; + +/** + * Returns the value within the provided collection associated with the + * provided key, or notSetValue if the key is not defined in the collection. + * + * A functional alternative to `collection.get(key)` which will also work on + * plain Objects and Arrays as an alternative for `collection[key]`. + * + * + * ```js + * import { get } from 'immutable'; + * + * get([ 'dog', 'frog', 'cat' ], 1) // 'frog' + * get({ x: 123, y: 456 }, 'x') // 123 + * get({ x: 123, y: 456 }, 'z', 'ifNotSet') // 'ifNotSet' + * ``` + */ +export function get(collection: Collection, key: K): V | undefined; +export function get( + collection: Collection, + key: K, + notSetValue: NSV +): V | NSV; +export function get( + record: Record, + key: K, + notSetValue: unknown +): TProps[K]; +export function get(collection: Array, key: number): V | undefined; +export function get( + collection: Array, + key: number, + notSetValue: NSV +): V | NSV; +export function get( + object: C, + key: K, + notSetValue: unknown +): C[K]; +export function get( + collection: { [key: string]: V }, + key: string +): V | undefined; +export function get( + collection: { [key: string]: V }, + key: string, + notSetValue: NSV +): V | NSV; +export function get( + collection: Collection | Array | { [key: string]: V }, + key: K, + notSetValue?: NSV +): V | NSV; +export function get( + collection: Collection | Array | { [key: string]: V }, + key: K, + notSetValue?: NSV +): V | NSV { + return isImmutable(collection) + ? collection.get(key, notSetValue) + : !has(collection, key) + ? notSetValue + : // @ts-expect-error weird "get" here, + typeof collection.get === 'function' + ? // @ts-expect-error weird "get" here, + collection.get(key) + : // @ts-expect-error key is unknown here, + collection[key]; +} diff --git a/src/functional/getIn.ts b/src/functional/getIn.ts new file mode 100644 index 0000000000..11f9cdf384 --- /dev/null +++ b/src/functional/getIn.ts @@ -0,0 +1,41 @@ +import coerceKeyPath from '../utils/coerceKeyPath'; +import { NOT_SET } from '../TrieUtils'; +import { get } from './get'; +import type { KeyPath } from '../../type-definitions/immutable'; + +type GetType = typeof get; +type GetTypeParameters = Parameters; +type CollectionType = GetTypeParameters[0]; +type Key = GetTypeParameters[1]; + +/** + * Returns the value at the provided key path starting at the provided + * collection, or notSetValue if the key path is not defined. + * + * A functional alternative to `collection.getIn(keypath)` which will also + * work with plain Objects and Arrays. + * + * + * ```js + * import { getIn } from 'immutable'; + * + * getIn({ x: { y: { z: 123 }}}, ['x', 'y', 'z']) // 123 + * getIn({ x: { y: { z: 123 }}}, ['x', 'q', 'p'], 'ifNotSet') // 'ifNotSet' + * ``` + */ +export function getIn( + collection: CollectionType, + searchKeyPath: KeyPath, + notSetValue?: GetTypeParameters[2] +): ReturnType { + const keyPath = coerceKeyPath(searchKeyPath); + let i = 0; + while (i !== keyPath.length) { + // @ts-expect-error keyPath[i++] can not be undefined by design + collection = get(collection, keyPath[i++], NOT_SET); + if (collection === NOT_SET) { + return notSetValue; + } + } + return collection; +} diff --git a/src/functional/has.ts b/src/functional/has.ts new file mode 100644 index 0000000000..322370314e --- /dev/null +++ b/src/functional/has.ts @@ -0,0 +1,28 @@ +import { isImmutable } from '../predicates/isImmutable'; +import hasOwnProperty from '../utils/hasOwnProperty'; +import isDataStructure from '../utils/isDataStructure'; + +/** + * Returns true if the key is defined in the provided collection. + * + * A functional alternative to `collection.has(key)` which will also work with + * plain Objects and Arrays as an alternative for + * `collection.hasOwnProperty(key)`. + * + * + * ```js + * import { has } from 'immutable'; + * + * has([ 'dog', 'frog', 'cat' ], 2) // true + * has([ 'dog', 'frog', 'cat' ], 5) // false + * has({ x: 123, y: 456 }, 'x') // true + * has({ x: 123, y: 456 }, 'z') // false + * ``` + */ +export function has(collection: object, key: unknown): boolean { + return isImmutable(collection) + ? // @ts-expect-error key might be a number or symbol, which is not handled be Record key type + collection.has(key) + : // @ts-expect-error key might be anything else than PropertyKey, and will return false in that case but runtime is OK + isDataStructure(collection) && hasOwnProperty.call(collection, key); +} diff --git a/src/functional/hasIn.ts b/src/functional/hasIn.ts new file mode 100644 index 0000000000..28041a7323 --- /dev/null +++ b/src/functional/hasIn.ts @@ -0,0 +1,25 @@ +import { getIn } from './getIn'; +import { NOT_SET } from '../TrieUtils'; + +type GetInParameters = Parameters; + +/** + * Returns true if the key path is defined in the provided collection. + * + * A functional alternative to `collection.hasIn(keypath)` which will also + * work with plain Objects and Arrays. + * + * + * ```js + * import { hasIn } from 'immutable'; + * + * hasIn({ x: { y: { z: 123 }}}, ['x', 'y', 'z']) // true + * hasIn({ x: { y: { z: 123 }}}, ['x', 'q', 'p']) // false + * ``` + */ +export function hasIn( + collection: GetInParameters[0], + keyPath: GetInParameters[1] +): boolean { + return getIn(collection, keyPath, NOT_SET) !== NOT_SET; +} diff --git a/src/functional/merge.js b/src/functional/merge.js new file mode 100644 index 0000000000..b2d231a0c9 --- /dev/null +++ b/src/functional/merge.js @@ -0,0 +1,99 @@ +import { isImmutable } from '../predicates/isImmutable'; +import { isIndexed } from '../predicates/isIndexed'; +import { isKeyed } from '../predicates/isKeyed'; +import { IndexedCollection, KeyedCollection } from '../Collection'; +import { Seq } from '../Seq'; +import hasOwnProperty from '../utils/hasOwnProperty'; +import isDataStructure from '../utils/isDataStructure'; +import shallowCopy from '../utils/shallowCopy'; + +export function merge(collection, ...sources) { + return mergeWithSources(collection, sources); +} + +export function mergeWith(merger, collection, ...sources) { + return mergeWithSources(collection, sources, merger); +} + +export function mergeDeep(collection, ...sources) { + return mergeDeepWithSources(collection, sources); +} + +export function mergeDeepWith(merger, collection, ...sources) { + return mergeDeepWithSources(collection, sources, merger); +} + +export function mergeDeepWithSources(collection, sources, merger) { + return mergeWithSources(collection, sources, deepMergerWith(merger)); +} + +export function mergeWithSources(collection, sources, merger) { + if (!isDataStructure(collection)) { + throw new TypeError( + 'Cannot merge into non-data-structure value: ' + collection + ); + } + if (isImmutable(collection)) { + return typeof merger === 'function' && collection.mergeWith + ? collection.mergeWith(merger, ...sources) + : collection.merge + ? collection.merge(...sources) + : collection.concat(...sources); + } + const isArray = Array.isArray(collection); + let merged = collection; + const Collection = isArray ? IndexedCollection : KeyedCollection; + const mergeItem = isArray + ? (value) => { + // Copy on write + if (merged === collection) { + merged = shallowCopy(merged); + } + merged.push(value); + } + : (value, key) => { + const hasVal = hasOwnProperty.call(merged, key); + const nextVal = + hasVal && merger ? merger(merged[key], value, key) : value; + if (!hasVal || nextVal !== merged[key]) { + // Copy on write + if (merged === collection) { + merged = shallowCopy(merged); + } + merged[key] = nextVal; + } + }; + for (let i = 0; i < sources.length; i++) { + Collection(sources[i]).forEach(mergeItem); + } + return merged; +} + +function deepMergerWith(merger) { + function deepMerger(oldValue, newValue, key) { + return isDataStructure(oldValue) && + isDataStructure(newValue) && + areMergeable(oldValue, newValue) + ? mergeWithSources(oldValue, [newValue], deepMerger) + : merger + ? merger(oldValue, newValue, key) + : newValue; + } + return deepMerger; +} + +/** + * It's unclear what the desired behavior is for merging two collections that + * fall into separate categories between keyed, indexed, or set-like, so we only + * consider them mergeable if they fall into the same category. + */ +function areMergeable(oldDataStructure, newDataStructure) { + const oldSeq = Seq(oldDataStructure); + const newSeq = Seq(newDataStructure); + // This logic assumes that a sequence can only fall into one of the three + // categories mentioned above (since there's no `isSetLike()` method). + return ( + isIndexed(oldSeq) === isIndexed(newSeq) && + isKeyed(oldSeq) === isKeyed(newSeq) + ); +} diff --git a/src/functional/remove.ts b/src/functional/remove.ts new file mode 100644 index 0000000000..60aff0fa36 --- /dev/null +++ b/src/functional/remove.ts @@ -0,0 +1,83 @@ +import type { Collection, Record } from '../../type-definitions/immutable'; +import { isImmutable } from '../predicates/isImmutable'; +import hasOwnProperty from '../utils/hasOwnProperty'; +import isDataStructure from '../utils/isDataStructure'; +import shallowCopy from '../utils/shallowCopy'; + +/** + * Returns a copy of the collection with the value at key removed. + * + * A functional alternative to `collection.remove(key)` which will also work + * with plain Objects and Arrays as an alternative for + * `delete collectionCopy[key]`. + * + * + * ```js + * import { remove } from 'immutable'; + * + * const originalArray = [ 'dog', 'frog', 'cat' ] + * remove(originalArray, 1) // [ 'dog', 'cat' ] + * console.log(originalArray) // [ 'dog', 'frog', 'cat' ] + * const originalObject = { x: 123, y: 456 } + * remove(originalObject, 'x') // { y: 456 } + * console.log(originalObject) // { x: 123, y: 456 } + * ``` + */ +export function remove>( + collection: C, + key: K +): C; +export function remove< + TProps extends object, + C extends Record, + K extends keyof TProps, +>(collection: C, key: K): C; +export function remove>(collection: C, key: number): C; +export function remove(collection: C, key: K): C; +export function remove< + C extends { [key: PropertyKey]: unknown }, + K extends keyof C, +>(collection: C, key: K): C; +export function remove< + K, + C extends + | Collection + | Array + | { [key: PropertyKey]: unknown }, +>(collection: C, key: K): C; +export function remove( + collection: + | Collection + | Array + | { [key: PropertyKey]: unknown }, + key: K +) { + if (!isDataStructure(collection)) { + throw new TypeError( + 'Cannot update non-data-structure value: ' + collection + ); + } + if (isImmutable(collection)) { + // @ts-expect-error weird "remove" here, + if (!collection.remove) { + throw new TypeError( + 'Cannot update immutable value without .remove() method: ' + collection + ); + } + // @ts-expect-error weird "remove" here, + return collection.remove(key); + } + // @ts-expect-error assert that key is a string, a number or a symbol here + if (!hasOwnProperty.call(collection, key)) { + return collection; + } + const collectionCopy = shallowCopy(collection); + if (Array.isArray(collectionCopy)) { + // @ts-expect-error assert that key is a number here + collectionCopy.splice(key, 1); + } else { + // @ts-expect-error assert that key is a string, a number or a symbol here + delete collectionCopy[key]; + } + return collectionCopy; +} diff --git a/src/functional/removeIn.ts b/src/functional/removeIn.ts new file mode 100644 index 0000000000..3b97be0dcd --- /dev/null +++ b/src/functional/removeIn.ts @@ -0,0 +1,27 @@ +import { updateIn, type PossibleCollection } from './updateIn'; +import { NOT_SET } from '../TrieUtils'; +import type { KeyPath } from '../../type-definitions/immutable'; + +/** + * Returns a copy of the collection with the value at the key path removed. + * + * A functional alternative to `collection.removeIn(keypath)` which will also + * work with plain Objects and Arrays. + * + * + * ```js + * import { removeIn } from 'immutable'; + * + * const original = { x: { y: { z: 123 }}} + * removeIn(original, ['x', 'y', 'z']) // { x: { y: {}}} + * console.log(original) // { x: { y: { z: 123 }}} + * ``` + */ +export function removeIn< + K extends PropertyKey, + V, + TProps extends object, + C extends PossibleCollection, +>(collection: C, keyPath: KeyPath): C { + return updateIn(collection, keyPath, () => NOT_SET); +} diff --git a/src/functional/set.ts b/src/functional/set.ts new file mode 100644 index 0000000000..e8e688abd0 --- /dev/null +++ b/src/functional/set.ts @@ -0,0 +1,76 @@ +import type { Collection, Record } from '../../type-definitions/immutable'; +import { isImmutable } from '../predicates/isImmutable'; +import hasOwnProperty from '../utils/hasOwnProperty'; +import isDataStructure from '../utils/isDataStructure'; +import shallowCopy from '../utils/shallowCopy'; + +/** + * Returns a copy of the collection with the value at key set to the provided + * value. + * + * A functional alternative to `collection.set(key, value)` which will also + * work with plain Objects and Arrays as an alternative for + * `collectionCopy[key] = value`. + * + * + * ```js + * import { set } from 'immutable'; + * + * const originalArray = [ 'dog', 'frog', 'cat' ] + * set(originalArray, 1, 'cow') // [ 'dog', 'cow', 'cat' ] + * console.log(originalArray) // [ 'dog', 'frog', 'cat' ] + * const originalObject = { x: 123, y: 456 } + * set(originalObject, 'x', 789) // { x: 789, y: 456 } + * console.log(originalObject) // { x: 123, y: 456 } + * ``` + */ +export function set>( + collection: C, + key: K, + value: V +): C; +export function set< + TProps extends object, + C extends Record, + K extends keyof TProps, +>(record: C, key: K, value: TProps[K]): C; +export function set>( + collection: C, + key: number, + value: V +): C; +export function set(object: C, key: K, value: C[K]): C; +export function set( + collection: C, + key: string, + value: V +): C; +export function set | { [key: string]: V }>( + collection: C, + key: K | string, + value: V +): C { + if (!isDataStructure(collection)) { + throw new TypeError( + 'Cannot update non-data-structure value: ' + collection + ); + } + if (isImmutable(collection)) { + // @ts-expect-error weird "set" here, + if (!collection.set) { + throw new TypeError( + 'Cannot update immutable value without .set() method: ' + collection + ); + } + // @ts-expect-error weird "set" here, + return collection.set(key, value); + } + // @ts-expect-error mix of key and string here. Probably need a more fine type here + if (hasOwnProperty.call(collection, key) && value === collection[key]) { + return collection; + } + const collectionCopy = shallowCopy(collection); + // @ts-expect-error mix of key and string here. Probably need a more fine type here + collectionCopy[key] = value; + return collectionCopy; +} diff --git a/src/functional/setIn.ts b/src/functional/setIn.ts new file mode 100644 index 0000000000..7955e3e38d --- /dev/null +++ b/src/functional/setIn.ts @@ -0,0 +1,28 @@ +import { updateIn, type PossibleCollection } from './updateIn'; +import { NOT_SET } from '../TrieUtils'; +import type { KeyPath } from '../../type-definitions/immutable'; + +/** + * Returns a copy of the collection with the value at the key path set to the + * provided value. + * + * A functional alternative to `collection.setIn(keypath)` which will also + * work with plain Objects and Arrays. + * + * + * ```js + * import { setIn } from 'immutable'; + * + * const original = { x: { y: { z: 123 }}} + * setIn(original, ['x', 'y', 'z'], 456) // { x: { y: { z: 456 }}} + * console.log(original) // { x: { y: { z: 123 }}} + * ``` + */ +export function setIn< + K extends PropertyKey, + V, + TProps extends object, + C extends PossibleCollection, +>(collection: C, keyPath: KeyPath, value: unknown): C { + return updateIn(collection, keyPath, NOT_SET, () => value); +} diff --git a/src/functional/update.ts b/src/functional/update.ts new file mode 100644 index 0000000000..81d5426539 --- /dev/null +++ b/src/functional/update.ts @@ -0,0 +1,112 @@ +import type { Collection, Record } from '../../type-definitions/immutable'; +import { updateIn, type PossibleCollection } from './updateIn'; + +type UpdaterFunction = (value: V | undefined) => V | undefined; +type UpdaterFunctionWithNSV = (value: V | NSV) => V; + +/** + * Returns a copy of the collection with the value at key set to the result of + * providing the existing value to the updating function. + * + * A functional alternative to `collection.update(key, fn)` which will also + * work with plain Objects and Arrays as an alternative for + * `collectionCopy[key] = fn(collection[key])`. + * + * + * ```js + * import { update } from 'immutable'; + * + * const originalArray = [ 'dog', 'frog', 'cat' ] + * update(originalArray, 1, val => val.toUpperCase()) // [ 'dog', 'FROG', 'cat' ] + * console.log(originalArray) // [ 'dog', 'frog', 'cat' ] + * const originalObject = { x: 123, y: 456 } + * update(originalObject, 'x', val => val * 6) // { x: 738, y: 456 } + * console.log(originalObject) // { x: 123, y: 456 } + * ``` + */ +export function update>( + collection: C, + key: K, + updater: (value: V | undefined) => V | undefined +): C; +export function update, NSV>( + collection: C, + key: K, + notSetValue: NSV, + updater: (value: V | NSV) => V +): C; +export function update< + TProps extends object, + C extends Record, + K extends keyof TProps, +>(record: C, key: K, updater: (value: TProps[K]) => TProps[K]): C; +export function update< + TProps extends object, + C extends Record, + K extends keyof TProps, + NSV, +>( + record: C, + key: K, + notSetValue: NSV, + updater: (value: TProps[K] | NSV) => TProps[K] +): C; +export function update>( + collection: C, + key: number, + updater: UpdaterFunction +): C; +export function update, NSV>( + collection: C, + key: number, + notSetValue: NSV, + updater: (value: V | NSV) => V +): C; +export function update( + object: C, + key: K, + updater: (value: C[K]) => C[K] +): C; +export function update( + object: C, + key: K, + notSetValue: NSV, + updater: (value: C[K] | NSV) => C[K] +): C; +export function update( + collection: C, + key: K, + updater: (value: V) => V +): { [key: string]: V }; +export function update< + V, + C extends { [key: string]: V }, + K extends keyof C, + NSV, +>( + collection: C, + key: K, + notSetValue: NSV, + updater: (value: V | NSV) => V +): { [key: string]: V }; + +export function update< + K, + V, + TProps extends object, + C extends PossibleCollection, + NSV, +>( + collection: C, + key: K, + notSetValue: NSV | UpdaterFunction, + updater?: UpdaterFunctionWithNSV +) { + return updateIn( + // @ts-expect-error Index signature for type string is missing in type V[] + collection, + [key], + notSetValue, + updater + ); +} diff --git a/src/functional/updateIn.ts b/src/functional/updateIn.ts new file mode 100644 index 0000000000..99eed7980e --- /dev/null +++ b/src/functional/updateIn.ts @@ -0,0 +1,189 @@ +import { isImmutable } from '../predicates/isImmutable'; +import coerceKeyPath from '../utils/coerceKeyPath'; +import isDataStructure from '../utils/isDataStructure'; +import quoteString from '../utils/quoteString'; +import { NOT_SET } from '../TrieUtils'; +import { emptyMap } from '../Map'; +import { get } from './get'; +import { remove } from './remove'; +import { set } from './set'; +import type { + Collection, + KeyPath, + Record, + RetrievePath, +} from '../../type-definitions/immutable'; + +/** + * Returns a copy of the collection with the value at key path set to the + * result of providing the existing value to the updating function. + * + * A functional alternative to `collection.updateIn(keypath)` which will also + * work with plain Objects and Arrays. + * + * + * ```js + * import { updateIn } from 'immutable' + * + * const original = { x: { y: { z: 123 }}} + * updateIn(original, ['x', 'y', 'z'], val => val * 6) // { x: { y: { z: 738 }}} + * console.log(original) // { x: { y: { z: 123 }}} + * ``` + */ + +export type PossibleCollection = + | Collection + | Record + | Array; + +type UpdaterFunction = ( + value: RetrievePath> | undefined +) => unknown | undefined; +type UpdaterFunctionWithNSV = ( + value: RetrievePath> | NSV +) => unknown; + +export function updateIn>( + collection: C, + keyPath: KeyPath, + updater: UpdaterFunction +): C; +export function updateIn, NSV>( + collection: C, + keyPath: KeyPath, + notSetValue: NSV, + updater: UpdaterFunctionWithNSV +): C; +export function updateIn< + TProps extends object, + C extends Record, + K extends keyof TProps, +>(record: C, keyPath: KeyPath, updater: UpdaterFunction): C; +export function updateIn< + TProps extends object, + C extends Record, + K extends keyof TProps, + NSV, +>( + record: C, + keyPath: KeyPath, + notSetValue: NSV, + updater: UpdaterFunctionWithNSV +): C; +export function updateIn>( + collection: C, + keyPath: KeyPath, + updater: UpdaterFunction +): Array; +export function updateIn, NSV>( + collection: C, + keyPath: KeyPath, + notSetValue: NSV, + updater: UpdaterFunctionWithNSV +): Array; +export function updateIn( + object: C, + keyPath: KeyPath, + updater: UpdaterFunction +): C; +export function updateIn( + object: C, + keyPath: KeyPath, + notSetValue: NSV, + updater: UpdaterFunctionWithNSV +): C; +export function updateIn( + collection: C, + keyPath: KeyPath, + updater: UpdaterFunction +): { [key: PropertyKey]: V }; +export function updateIn( + collection: C, + keyPath: KeyPath, + notSetValue: NSV, + updater: UpdaterFunction +): { [key: PropertyKey]: V }; + +export function updateIn< + K, + V, + TProps extends object, + C extends PossibleCollection, + NSV, +>( + collection: C, + keyPath: KeyPath, + notSetValue: NSV | UpdaterFunction | undefined, + updater?: UpdaterFunctionWithNSV +): C { + if (!updater) { + // handle the fact that `notSetValue` is optional here, in that case `updater` is the updater function + // @ts-expect-error updater is a function here + updater = notSetValue as UpdaterFunction; + notSetValue = undefined; + } + const updatedValue = updateInDeeply( + isImmutable(collection), + // @ts-expect-error type issues with Record and mixed types + collection, + coerceKeyPath(keyPath), + 0, + notSetValue, + updater + ); + // @ts-expect-error mixed return type + return updatedValue === NOT_SET ? notSetValue : updatedValue; +} + +function updateInDeeply< + K, + TProps extends object, + C extends PossibleCollection, + NSV, +>( + inImmutable: boolean, + existing: C, + keyPath: Array, + i: number, + notSetValue: NSV | undefined, + updater: UpdaterFunctionWithNSV | UpdaterFunction +): C { + const wasNotSet = existing === NOT_SET; + if (i === keyPath.length) { + const existingValue = wasNotSet ? notSetValue : existing; + // @ts-expect-error mixed type with optional value + const newValue = updater(existingValue); + // @ts-expect-error mixed type + return newValue === existingValue ? existing : newValue; + } + if (!wasNotSet && !isDataStructure(existing)) { + throw new TypeError( + 'Cannot update within non-data-structure value in path [' + + Array.from(keyPath).slice(0, i).map(quoteString) + + ']: ' + + existing + ); + } + const key = keyPath[i]; + + const nextExisting = wasNotSet ? NOT_SET : get(existing, key, NOT_SET); + const nextUpdated = updateInDeeply( + nextExisting === NOT_SET ? inImmutable : isImmutable(nextExisting), + // @ts-expect-error mixed type + nextExisting, + keyPath, + i + 1, + notSetValue, + updater + ); + + return nextUpdated === nextExisting + ? existing + : nextUpdated === NOT_SET + ? remove(existing, key) + : set( + wasNotSet ? (inImmutable ? emptyMap() : {}) : existing, + key, + nextUpdated + ); +} diff --git a/src/is.js b/src/is.ts similarity index 78% rename from src/is.js rename to src/is.ts index 4feaa66aef..f4430c52fd 100644 --- a/src/is.js +++ b/src/is.ts @@ -1,11 +1,4 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +import { isValueObject } from './predicates/isValueObject'; /** * An extension of the "same-value" algorithm as [described for use by ES6 Map @@ -40,7 +33,7 @@ * not be performant. An alternative is to implement `equals` and `hashCode`. * * `equals` takes another object, presumably of similar type, and returns true - * if the it is equal. Equality is symmetrical, so the same result should be + * if it is equal. Equality is symmetrical, so the same result should be * returned if this and the argument are flipped. * * assert( a.equals(b) === b.equals(a) ); @@ -58,18 +51,20 @@ * assert( a.hashCode() === b.hashCode() ); * } * - * All Immutable collections implement `equals` and `hashCode`. - * + * All Immutable collections are Value Objects: they implement `equals()` + * and `hashCode()`. */ -export function is(valueA, valueB) { +export function is(valueA: unknown, valueB: unknown): boolean { if (valueA === valueB || (valueA !== valueA && valueB !== valueB)) { return true; } if (!valueA || !valueB) { return false; } - if (typeof valueA.valueOf === 'function' && - typeof valueB.valueOf === 'function') { + if ( + typeof valueA.valueOf === 'function' && + typeof valueB.valueOf === 'function' + ) { valueA = valueA.valueOf(); valueB = valueB.valueOf(); if (valueA === valueB || (valueA !== valueA && valueB !== valueB)) { @@ -79,10 +74,9 @@ export function is(valueA, valueB) { return false; } } - if (typeof valueA.equals === 'function' && - typeof valueB.equals === 'function' && - valueA.equals(valueB)) { - return true; - } - return false; + return !!( + isValueObject(valueA) && + isValueObject(valueB) && + valueA.equals(valueB) + ); } diff --git a/src/methods/README.md b/src/methods/README.md new file mode 100644 index 0000000000..df2d26482f --- /dev/null +++ b/src/methods/README.md @@ -0,0 +1,5 @@ +These files represent common methods on Collection types, each will contain +references to "this" - expecting to be called as a prototypal method. + +They are separated into individual files to avoid circular dependencies when +possible, and to allow their use in multiple different Collections. diff --git a/src/methods/asImmutable.js b/src/methods/asImmutable.js new file mode 100644 index 0000000000..71ba0d2bf5 --- /dev/null +++ b/src/methods/asImmutable.js @@ -0,0 +1,3 @@ +export function asImmutable() { + return this.__ensureOwner(); +} diff --git a/src/methods/asMutable.js b/src/methods/asMutable.js new file mode 100644 index 0000000000..2e7abf576a --- /dev/null +++ b/src/methods/asMutable.js @@ -0,0 +1,5 @@ +import { OwnerID } from '../TrieUtils'; + +export function asMutable() { + return this.__ownerID ? this : this.__ensureOwner(new OwnerID()); +} diff --git a/src/methods/deleteIn.js b/src/methods/deleteIn.js new file mode 100644 index 0000000000..5a312ce8f9 --- /dev/null +++ b/src/methods/deleteIn.js @@ -0,0 +1,5 @@ +import { removeIn } from '../functional/removeIn'; + +export function deleteIn(keyPath) { + return removeIn(this, keyPath); +} diff --git a/src/methods/getIn.js b/src/methods/getIn.js new file mode 100644 index 0000000000..e202bae92c --- /dev/null +++ b/src/methods/getIn.js @@ -0,0 +1,5 @@ +import { getIn as _getIn } from '../functional/getIn'; + +export function getIn(searchKeyPath, notSetValue) { + return _getIn(this, searchKeyPath, notSetValue); +} diff --git a/src/methods/hasIn.js b/src/methods/hasIn.js new file mode 100644 index 0000000000..704dc5c80f --- /dev/null +++ b/src/methods/hasIn.js @@ -0,0 +1,5 @@ +import { hasIn as _hasIn } from '../functional/hasIn'; + +export function hasIn(searchKeyPath) { + return _hasIn(this, searchKeyPath); +} diff --git a/src/methods/merge.js b/src/methods/merge.js new file mode 100644 index 0000000000..427f7c466c --- /dev/null +++ b/src/methods/merge.js @@ -0,0 +1,51 @@ +import { KeyedCollection } from '../Collection'; +import { NOT_SET } from '../TrieUtils'; +import { update } from '../functional/update'; +import { isRecord } from '../predicates/isRecord'; + +export function merge(...iters) { + return mergeIntoKeyedWith(this, iters); +} + +export function mergeWith(merger, ...iters) { + if (typeof merger !== 'function') { + throw new TypeError('Invalid merger function: ' + merger); + } + return mergeIntoKeyedWith(this, iters, merger); +} + +function mergeIntoKeyedWith(collection, collections, merger) { + const iters = []; + for (let ii = 0; ii < collections.length; ii++) { + const collection = KeyedCollection(collections[ii]); + if (collection.size !== 0) { + iters.push(collection); + } + } + if (iters.length === 0) { + return collection; + } + if ( + collection.toSeq().size === 0 && + !collection.__ownerID && + iters.length === 1 + ) { + return isRecord(collection) + ? collection // Record is empty and will not be updated: return the same instance + : collection.constructor(iters[0]); + } + return collection.withMutations((collection) => { + const mergeIntoCollection = merger + ? (value, key) => { + update(collection, key, NOT_SET, (oldVal) => + oldVal === NOT_SET ? value : merger(oldVal, value, key) + ); + } + : (value, key) => { + collection.set(key, value); + }; + for (let ii = 0; ii < iters.length; ii++) { + iters[ii].forEach(mergeIntoCollection); + } + }); +} diff --git a/src/methods/mergeDeep.js b/src/methods/mergeDeep.js new file mode 100644 index 0000000000..e2238f664c --- /dev/null +++ b/src/methods/mergeDeep.js @@ -0,0 +1,9 @@ +import { mergeDeepWithSources } from '../functional/merge'; + +export function mergeDeep(...iters) { + return mergeDeepWithSources(this, iters); +} + +export function mergeDeepWith(merger, ...iters) { + return mergeDeepWithSources(this, iters, merger); +} diff --git a/src/methods/mergeDeepIn.js b/src/methods/mergeDeepIn.js new file mode 100644 index 0000000000..119369b7ba --- /dev/null +++ b/src/methods/mergeDeepIn.js @@ -0,0 +1,9 @@ +import { mergeDeepWithSources } from '../functional/merge'; +import { updateIn } from '../functional/updateIn'; +import { emptyMap } from '../Map'; + +export function mergeDeepIn(keyPath, ...iters) { + return updateIn(this, keyPath, emptyMap(), (m) => + mergeDeepWithSources(m, iters) + ); +} diff --git a/src/methods/mergeIn.js b/src/methods/mergeIn.js new file mode 100644 index 0000000000..9af239c4d0 --- /dev/null +++ b/src/methods/mergeIn.js @@ -0,0 +1,7 @@ +import { mergeWithSources } from '../functional/merge'; +import { updateIn } from '../functional/updateIn'; +import { emptyMap } from '../Map'; + +export function mergeIn(keyPath, ...iters) { + return updateIn(this, keyPath, emptyMap(), (m) => mergeWithSources(m, iters)); +} diff --git a/src/methods/setIn.js b/src/methods/setIn.js new file mode 100644 index 0000000000..3ea05b89d6 --- /dev/null +++ b/src/methods/setIn.js @@ -0,0 +1,5 @@ +import { setIn as _setIn } from '../functional/setIn'; + +export function setIn(keyPath, v) { + return _setIn(this, keyPath, v); +} diff --git a/src/methods/toObject.js b/src/methods/toObject.js new file mode 100644 index 0000000000..fb927f0e48 --- /dev/null +++ b/src/methods/toObject.js @@ -0,0 +1,10 @@ +import assertNotInfinite from '../utils/assertNotInfinite'; + +export function toObject() { + assertNotInfinite(this.size); + const object = {}; + this.__iterate((v, k) => { + object[k] = v; + }); + return object; +} diff --git a/src/methods/update.js b/src/methods/update.js new file mode 100644 index 0000000000..0d533f7037 --- /dev/null +++ b/src/methods/update.js @@ -0,0 +1,7 @@ +import { update as _update } from '../functional/update'; + +export function update(key, notSetValue, updater) { + return arguments.length === 1 + ? key(this) + : _update(this, key, notSetValue, updater); +} diff --git a/src/methods/updateIn.js b/src/methods/updateIn.js new file mode 100644 index 0000000000..8df1860868 --- /dev/null +++ b/src/methods/updateIn.js @@ -0,0 +1,5 @@ +import { updateIn as _updateIn } from '../functional/updateIn'; + +export function updateIn(keyPath, notSetValue, updater) { + return _updateIn(this, keyPath, notSetValue, updater); +} diff --git a/src/methods/wasAltered.js b/src/methods/wasAltered.js new file mode 100644 index 0000000000..165a3e3ab2 --- /dev/null +++ b/src/methods/wasAltered.js @@ -0,0 +1,3 @@ +export function wasAltered() { + return this.__altered; +} diff --git a/src/methods/withMutations.js b/src/methods/withMutations.js new file mode 100644 index 0000000000..59c5cc83dc --- /dev/null +++ b/src/methods/withMutations.js @@ -0,0 +1,5 @@ +export function withMutations(fn) { + const mutable = this.asMutable(); + fn(mutable); + return mutable.wasAltered() ? mutable.__ensureOwner(this.__ownerID) : this; +} diff --git a/src/predicates/isAssociative.ts b/src/predicates/isAssociative.ts new file mode 100644 index 0000000000..e174616f7b --- /dev/null +++ b/src/predicates/isAssociative.ts @@ -0,0 +1,25 @@ +import { isKeyed } from './isKeyed'; +import { isIndexed } from './isIndexed'; +import type { Collection } from '../../type-definitions/immutable'; + +/** + * True if `maybeAssociative` is either a Keyed or Indexed Collection. + * + * ```js + * import { isAssociative, Map, List, Stack, Set } from 'immutable'; + * + * isAssociative([]); // false + * isAssociative({}); // false + * isAssociative(Map()); // true + * isAssociative(List()); // true + * isAssociative(Stack()); // true + * isAssociative(Set()); // false + * ``` + */ +export function isAssociative( + maybeAssociative: unknown +): maybeAssociative is + | Collection.Keyed + | Collection.Indexed { + return isKeyed(maybeAssociative) || isIndexed(maybeAssociative); +} diff --git a/src/predicates/isCollection.ts b/src/predicates/isCollection.ts new file mode 100644 index 0000000000..738a4614e0 --- /dev/null +++ b/src/predicates/isCollection.ts @@ -0,0 +1,27 @@ +import type { Collection } from '../../type-definitions/immutable'; + +// Note: value is unchanged to not break immutable-devtools. +export const IS_COLLECTION_SYMBOL = '@@__IMMUTABLE_ITERABLE__@@'; + +/** + * True if `maybeCollection` is a Collection, or any of its subclasses. + * + * ```js + * import { isCollection, Map, List, Stack } from 'immutable'; + * + * isCollection([]); // false + * isCollection({}); // false + * isCollection(Map()); // true + * isCollection(List()); // true + * isCollection(Stack()); // true + * ``` + */ +export function isCollection( + maybeCollection: unknown +): maybeCollection is Collection { + return Boolean( + maybeCollection && + // @ts-expect-error: maybeCollection is typed as `{}`, need to change in 6.0 to `maybeCollection && typeof maybeCollection === 'object' && IS_COLLECTION_SYMBOL in maybeCollection` + maybeCollection[IS_COLLECTION_SYMBOL] + ); +} diff --git a/src/predicates/isImmutable.ts b/src/predicates/isImmutable.ts new file mode 100644 index 0000000000..d01bd03afb --- /dev/null +++ b/src/predicates/isImmutable.ts @@ -0,0 +1,24 @@ +import type { Collection, Record } from '../../type-definitions/immutable'; +import { isCollection } from './isCollection'; +import { isRecord } from './isRecord'; + +/** + * True if `maybeImmutable` is an Immutable Collection or Record. + * + * Note: Still returns true even if the collections is within a `withMutations()`. + * + * ```js + * import { isImmutable, Map, List, Stack } from 'immutable'; + * isImmutable([]); // false + * isImmutable({}); // false + * isImmutable(Map()); // true + * isImmutable(List()); // true + * isImmutable(Stack()); // true + * isImmutable(Map().asMutable()); // true + * ``` + */ +export function isImmutable( + maybeImmutable: unknown +): maybeImmutable is Collection | Record { + return isCollection(maybeImmutable) || isRecord(maybeImmutable); +} diff --git a/src/predicates/isIndexed.ts b/src/predicates/isIndexed.ts new file mode 100644 index 0000000000..3e20595af5 --- /dev/null +++ b/src/predicates/isIndexed.ts @@ -0,0 +1,27 @@ +import type { Collection } from '../../type-definitions/immutable'; + +export const IS_INDEXED_SYMBOL = '@@__IMMUTABLE_INDEXED__@@'; + +/** + * True if `maybeIndexed` is a Collection.Indexed, or any of its subclasses. + * + * ```js + * import { isIndexed, Map, List, Stack, Set } from 'immutable'; + * + * isIndexed([]); // false + * isIndexed({}); // false + * isIndexed(Map()); // false + * isIndexed(List()); // true + * isIndexed(Stack()); // true + * isIndexed(Set()); // false + * ``` + */ +export function isIndexed( + maybeIndexed: unknown +): maybeIndexed is Collection.Indexed { + return Boolean( + maybeIndexed && + // @ts-expect-error: maybeIndexed is typed as `{}`, need to change in 6.0 to `maybeIndexed && typeof maybeIndexed === 'object' && IS_INDEXED_SYMBOL in maybeIndexed` + maybeIndexed[IS_INDEXED_SYMBOL] + ); +} diff --git a/src/predicates/isKeyed.ts b/src/predicates/isKeyed.ts new file mode 100644 index 0000000000..35f7b7e9c8 --- /dev/null +++ b/src/predicates/isKeyed.ts @@ -0,0 +1,26 @@ +import type { Collection } from '../../type-definitions/immutable'; + +export const IS_KEYED_SYMBOL = '@@__IMMUTABLE_KEYED__@@'; + +/** + * True if `maybeKeyed` is a Collection.Keyed, or any of its subclasses. + * + * ```js + * import { isKeyed, Map, List, Stack } from 'immutable'; + * + * isKeyed([]); // false + * isKeyed({}); // false + * isKeyed(Map()); // true + * isKeyed(List()); // false + * isKeyed(Stack()); // false + * ``` + */ +export function isKeyed( + maybeKeyed: unknown +): maybeKeyed is Collection.Keyed { + return Boolean( + maybeKeyed && + // @ts-expect-error: maybeKeyed is typed as `{}`, need to change in 6.0 to `maybeKeyed && typeof maybeKeyed === 'object' && IS_KEYED_SYMBOL in maybeKeyed` + maybeKeyed[IS_KEYED_SYMBOL] + ); +} diff --git a/src/predicates/isList.ts b/src/predicates/isList.ts new file mode 100644 index 0000000000..080427eb2a --- /dev/null +++ b/src/predicates/isList.ts @@ -0,0 +1,14 @@ +import type { List } from '../../type-definitions/immutable'; + +export const IS_LIST_SYMBOL = '@@__IMMUTABLE_LIST__@@'; + +/** + * True if `maybeList` is a List. + */ +export function isList(maybeList: unknown): maybeList is List { + return Boolean( + maybeList && + // @ts-expect-error: maybeList is typed as `{}`, need to change in 6.0 to `maybeList && typeof maybeList === 'object' && IS_LIST_SYMBOL in maybeList` + maybeList[IS_LIST_SYMBOL] + ); +} diff --git a/src/predicates/isMap.ts b/src/predicates/isMap.ts new file mode 100644 index 0000000000..ef96c7e138 --- /dev/null +++ b/src/predicates/isMap.ts @@ -0,0 +1,16 @@ +import type { Map } from '../../type-definitions/immutable'; + +export const IS_MAP_SYMBOL = '@@__IMMUTABLE_MAP__@@'; + +/** + * True if `maybeMap` is a Map. + * + * Also true for OrderedMaps. + */ +export function isMap(maybeMap: unknown): maybeMap is Map { + return Boolean( + maybeMap && + // @ts-expect-error: maybeMap is typed as `{}`, need to change in 6.0 to `maybeMap && typeof maybeMap === 'object' && IS_MAP_SYMBOL in maybeMap` + maybeMap[IS_MAP_SYMBOL] + ); +} diff --git a/src/predicates/isOrdered.ts b/src/predicates/isOrdered.ts new file mode 100644 index 0000000000..2e20d415ff --- /dev/null +++ b/src/predicates/isOrdered.ts @@ -0,0 +1,31 @@ +import type { OrderedCollection } from '../../type-definitions/immutable'; + +export const IS_ORDERED_SYMBOL = '@@__IMMUTABLE_ORDERED__@@'; + +/** + * True if `maybeOrdered` is a Collection where iteration order is well + * defined. True for Collection.Indexed as well as OrderedMap and OrderedSet. + * + * ```js + * import { isOrdered, Map, OrderedMap, List, Set } from 'immutable'; + * + * isOrdered([]); // false + * isOrdered({}); // false + * isOrdered(Map()); // false + * isOrdered(OrderedMap()); // true + * isOrdered(List()); // true + * isOrdered(Set()); // false + * ``` + */ +export function isOrdered( + maybeOrdered: Iterable +): maybeOrdered is OrderedCollection; +export function isOrdered( + maybeOrdered: unknown +): maybeOrdered is OrderedCollection { + return Boolean( + maybeOrdered && + // @ts-expect-error: maybeOrdered is typed as `{}`, need to change in 6.0 to `maybeOrdered && typeof maybeOrdered === 'object' && IS_ORDERED_SYMBOL in maybeOrdered` + maybeOrdered[IS_ORDERED_SYMBOL] + ); +} diff --git a/src/predicates/isOrderedMap.ts b/src/predicates/isOrderedMap.ts new file mode 100644 index 0000000000..ac56e200b5 --- /dev/null +++ b/src/predicates/isOrderedMap.ts @@ -0,0 +1,12 @@ +import type { OrderedMap } from '../../type-definitions/immutable'; +import { isMap } from './isMap'; +import { isOrdered } from './isOrdered'; + +/** + * True if `maybeOrderedMap` is an OrderedMap. + */ +export function isOrderedMap( + maybeOrderedMap: unknown +): maybeOrderedMap is OrderedMap { + return isMap(maybeOrderedMap) && isOrdered(maybeOrderedMap); +} diff --git a/src/predicates/isOrderedSet.ts b/src/predicates/isOrderedSet.ts new file mode 100644 index 0000000000..8ac58beb96 --- /dev/null +++ b/src/predicates/isOrderedSet.ts @@ -0,0 +1,12 @@ +import { isSet } from './isSet'; +import { isOrdered } from './isOrdered'; +import type { OrderedSet } from '../../type-definitions/immutable'; + +/** + * True if `maybeOrderedSet` is an OrderedSet. + */ +export function isOrderedSet( + maybeOrderedSet: unknown +): maybeOrderedSet is OrderedSet { + return isSet(maybeOrderedSet) && isOrdered(maybeOrderedSet); +} diff --git a/src/predicates/isRecord.ts b/src/predicates/isRecord.ts new file mode 100644 index 0000000000..ff9b1cdde8 --- /dev/null +++ b/src/predicates/isRecord.ts @@ -0,0 +1,14 @@ +import type { Record } from '../../type-definitions/immutable'; + +export const IS_RECORD_SYMBOL = '@@__IMMUTABLE_RECORD__@@'; + +/** + * True if `maybeRecord` is a Record. + */ +export function isRecord(maybeRecord: unknown): maybeRecord is Record { + return Boolean( + maybeRecord && + // @ts-expect-error: maybeRecord is typed as `{}`, need to change in 6.0 to `maybeRecord && typeof maybeRecord === 'object' && IS_RECORD_SYMBOL in maybeRecord` + maybeRecord[IS_RECORD_SYMBOL] + ); +} diff --git a/src/predicates/isSeq.ts b/src/predicates/isSeq.ts new file mode 100644 index 0000000000..1b0f26f04a --- /dev/null +++ b/src/predicates/isSeq.ts @@ -0,0 +1,19 @@ +import type { Seq } from '../../type-definitions/immutable'; + +export const IS_SEQ_SYMBOL = '@@__IMMUTABLE_SEQ__@@'; + +/** + * True if `maybeSeq` is a Seq. + */ +export function isSeq( + maybeSeq: unknown +): maybeSeq is + | Seq.Indexed + | Seq.Keyed + | Seq.Set { + return Boolean( + maybeSeq && + // @ts-expect-error: maybeSeq is typed as `{}`, need to change in 6.0 to `maybeSeq && typeof maybeSeq === 'object' && MAYBE_SEQ_SYMBOL in maybeSeq` + maybeSeq[IS_SEQ_SYMBOL] + ); +} diff --git a/src/predicates/isSet.ts b/src/predicates/isSet.ts new file mode 100644 index 0000000000..a9a59fe71c --- /dev/null +++ b/src/predicates/isSet.ts @@ -0,0 +1,16 @@ +import type { Set } from '../../type-definitions/immutable'; + +export const IS_SET_SYMBOL = '@@__IMMUTABLE_SET__@@'; + +/** + * True if `maybeSet` is a Set. + * + * Also true for OrderedSets. + */ +export function isSet(maybeSet: unknown): maybeSet is Set { + return Boolean( + maybeSet && + // @ts-expect-error: maybeSet is typed as `{}`, need to change in 6.0 to `maybeSeq && typeof maybeSet === 'object' && MAYBE_SET_SYMBOL in maybeSet` + maybeSet[IS_SET_SYMBOL] + ); +} diff --git a/src/predicates/isStack.ts b/src/predicates/isStack.ts new file mode 100644 index 0000000000..b62768f88e --- /dev/null +++ b/src/predicates/isStack.ts @@ -0,0 +1,14 @@ +import type { Stack } from '../../type-definitions/immutable'; + +export const IS_STACK_SYMBOL = '@@__IMMUTABLE_STACK__@@'; + +/** + * True if `maybeStack` is a Stack. + */ +export function isStack(maybeStack: unknown): maybeStack is Stack { + return Boolean( + maybeStack && + // @ts-expect-error: maybeStack is typed as `{}`, need to change in 6.0 to `maybeStack && typeof maybeStack === 'object' && MAYBE_STACK_SYMBOL in maybeStack` + maybeStack[IS_STACK_SYMBOL] + ); +} diff --git a/src/predicates/isValueObject.ts b/src/predicates/isValueObject.ts new file mode 100644 index 0000000000..f603b517ea --- /dev/null +++ b/src/predicates/isValueObject.ts @@ -0,0 +1,18 @@ +import type { ValueObject } from '../../type-definitions/immutable'; + +/** + * True if `maybeValue` is a JavaScript Object which has *both* `equals()` + * and `hashCode()` methods. + * + * Any two instances of *value objects* can be compared for value equality with + * `Immutable.is()` and can be used as keys in a `Map` or members in a `Set`. + */ +export function isValueObject(maybeValue: unknown): maybeValue is ValueObject { + return Boolean( + maybeValue && + // @ts-expect-error: maybeValue is typed as `{}` + typeof maybeValue.equals === 'function' && + // @ts-expect-error: maybeValue is typed as `{}` + typeof maybeValue.hashCode === 'function' + ); +} diff --git a/src/toJS.js b/src/toJS.js new file mode 100644 index 0000000000..2d820416c8 --- /dev/null +++ b/src/toJS.js @@ -0,0 +1,28 @@ +import { Seq } from './Seq'; +import { isCollection } from './predicates/isCollection'; +import { isKeyed } from './predicates/isKeyed'; +import isDataStructure from './utils/isDataStructure'; + +export function toJS(value) { + if (!value || typeof value !== 'object') { + return value; + } + if (!isCollection(value)) { + if (!isDataStructure(value)) { + return value; + } + value = Seq(value); + } + if (isKeyed(value)) { + const result = {}; + value.__iterate((v, k) => { + result[k] = toJS(v); + }); + return result; + } + const result = []; + value.__iterate((v) => { + result.push(toJS(v)); + }); + return result; +} diff --git a/src/utils/arrCopy.ts b/src/utils/arrCopy.ts new file mode 100644 index 0000000000..e6cc653f98 --- /dev/null +++ b/src/utils/arrCopy.ts @@ -0,0 +1,12 @@ +// http://jsperf.com/copy-array-inline + +export default function arrCopy(arr: Array, offset?: number): Array { + offset = offset || 0; + const len = Math.max(0, arr.length - offset); + const newArr: Array = new Array(len); + for (let ii = 0; ii < len; ii++) { + // @ts-expect-error We may want to guard for undefined values with `if (arr[ii + offset] !== undefined`, but ths should not happen by design + newArr[ii] = arr[ii + offset]; + } + return newArr; +} diff --git a/src/utils/assertNotInfinite.js b/src/utils/assertNotInfinite.js deleted file mode 100644 index aace777ba1..0000000000 --- a/src/utils/assertNotInfinite.js +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -import invariant from './invariant' - -export default function assertNotInfinite(size) { - invariant( - size !== Infinity, - 'Cannot perform this action with an infinite size.' - ); -} diff --git a/src/utils/assertNotInfinite.ts b/src/utils/assertNotInfinite.ts new file mode 100644 index 0000000000..52abc8fc4c --- /dev/null +++ b/src/utils/assertNotInfinite.ts @@ -0,0 +1,8 @@ +import invariant from './invariant'; + +export default function assertNotInfinite(size: number): void { + invariant( + size !== Infinity, + 'Cannot perform this action with an infinite size.' + ); +} diff --git a/src/utils/coerceKeyPath.ts b/src/utils/coerceKeyPath.ts new file mode 100644 index 0000000000..843981f0ea --- /dev/null +++ b/src/utils/coerceKeyPath.ts @@ -0,0 +1,15 @@ +import type { KeyPath } from '../../type-definitions/immutable'; +import { isOrdered } from '../predicates/isOrdered'; +import isArrayLike from './isArrayLike'; + +export default function coerceKeyPath(keyPath: KeyPath): ArrayLike { + if (isArrayLike(keyPath) && typeof keyPath !== 'string') { + return keyPath; + } + if (isOrdered(keyPath)) { + return keyPath.toArray(); + } + throw new TypeError( + 'Invalid keyPath: expected Ordered Collection or Array: ' + keyPath + ); +} diff --git a/src/utils/createClass.js b/src/utils/createClass.js deleted file mode 100644 index 8f59cf42b4..0000000000 --- a/src/utils/createClass.js +++ /dev/null @@ -1,15 +0,0 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -export default function createClass(ctor, superClass) { - if (superClass) { - ctor.prototype = Object.create(superClass.prototype); - } - ctor.prototype.constructor = ctor; -} diff --git a/src/utils/deepEqual.js b/src/utils/deepEqual.js deleted file mode 100644 index cc2074206d..0000000000 --- a/src/utils/deepEqual.js +++ /dev/null @@ -1,69 +0,0 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -import { is } from '../is' -import { NOT_SET } from '../TrieUtils' -import { isIterable, isKeyed, isIndexed, isAssociative, isOrdered } from '../Iterable' - -export default function deepEqual(a, b) { - if (a === b) { - return true; - } - - if ( - !isIterable(b) || - a.size !== undefined && b.size !== undefined && a.size !== b.size || - a.__hash !== undefined && b.__hash !== undefined && a.__hash !== b.__hash || - isKeyed(a) !== isKeyed(b) || - isIndexed(a) !== isIndexed(b) || - isOrdered(a) !== isOrdered(b) - ) { - return false; - } - - if (a.size === 0 && b.size === 0) { - return true; - } - - var notAssociative = !isAssociative(a); - - if (isOrdered(a)) { - var entries = a.entries(); - return b.every((v, k) => { - var entry = entries.next().value; - return entry && is(entry[1], v) && (notAssociative || is(entry[0], k)); - }) && entries.next().done; - } - - var flipped = false; - - if (a.size === undefined) { - if (b.size === undefined) { - if (typeof a.cacheResult === 'function') { - a.cacheResult(); - } - } else { - flipped = true; - var _ = a; - a = b; - b = _; - } - } - - var allEqual = true; - var bSize = b.__iterate((v, k) => { - if (notAssociative ? !a.has(v) : - flipped ? !is(v, a.get(k, NOT_SET)) : !is(a.get(k, NOT_SET), v)) { - allEqual = false; - return false; - } - }); - - return allEqual && a.size === bSize; -} diff --git a/src/utils/deepEqual.ts b/src/utils/deepEqual.ts new file mode 100644 index 0000000000..c76d62c840 --- /dev/null +++ b/src/utils/deepEqual.ts @@ -0,0 +1,97 @@ +import { is } from '../is'; +import { NOT_SET } from '../TrieUtils'; +import { isCollection } from '../predicates/isCollection'; +import { isKeyed } from '../predicates/isKeyed'; +import { isIndexed } from '../predicates/isIndexed'; +import { isAssociative } from '../predicates/isAssociative'; +import { isOrdered } from '../predicates/isOrdered'; +import type { Collection } from '../../type-definitions/immutable'; +import type { Repeat } from '../Repeat'; +import type { Range } from '../Range'; + +export default function deepEqual( + a: Range | Repeat | Collection, + b: unknown +): boolean { + if (a === b) { + return true; + } + + if ( + !isCollection(b) || + // @ts-expect-error size should exists on Collection + (a.size !== undefined && b.size !== undefined && a.size !== b.size) || + // @ts-expect-error __hash exists on Collection + (a.__hash !== undefined && + // @ts-expect-error __hash exists on Collection + b.__hash !== undefined && + // @ts-expect-error __hash exists on Collection + a.__hash !== b.__hash) || + isKeyed(a) !== isKeyed(b) || + isIndexed(a) !== isIndexed(b) || + // @ts-expect-error Range extends Collection, which implements [Symbol.iterator], so it is valid + isOrdered(a) !== isOrdered(b) + ) { + return false; + } + + // @ts-expect-error size should exists on Collection + if (a.size === 0 && b.size === 0) { + return true; + } + + const notAssociative = !isAssociative(a); + + // @ts-expect-error Range extends Collection, which implements [Symbol.iterator], so it is valid + if (isOrdered(a)) { + const entries = a.entries(); + // @ts-expect-error need to cast as boolean + return ( + b.every((v, k) => { + const entry = entries.next().value; + return entry && is(entry[1], v) && (notAssociative || is(entry[0], k)); + }) && entries.next().done + ); + } + + let flipped = false; + + if (a.size === undefined) { + // @ts-expect-error size should exists on Collection + if (b.size === undefined) { + if (typeof a.cacheResult === 'function') { + a.cacheResult(); + } + } else { + flipped = true; + const _ = a; + a = b; + b = _; + } + } + + let allEqual = true; + const bSize: number = + // @ts-expect-error b is Range | Repeat | Collection as it may have been flipped, and __iterate is valid + b.__iterate((v, k) => { + if ( + notAssociative + ? // @ts-expect-error has exists on Collection + !a.has(v) + : flipped + ? // @ts-expect-error type of `get` does not "catch" the version with `notSetValue` + !is(v, a.get(k, NOT_SET)) + : // @ts-expect-error type of `get` does not "catch" the version with `notSetValue` + !is(a.get(k, NOT_SET), v) + ) { + allEqual = false; + return false; + } + }); + + return ( + allEqual && + // @ts-expect-error size should exists on Collection + a.size === bSize + ); +} diff --git a/src/utils/forceIterator.js b/src/utils/forceIterator.js deleted file mode 100644 index 845aa06a07..0000000000 --- a/src/utils/forceIterator.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -import { Iterable } from '../Iterable' -import { getIterator } from '../Iterator' -import isArrayLike from './isArrayLike' - -export default function forceIterator(keyPath) { - var iter = getIterator(keyPath); - if (!iter) { - // Array might not be iterable in this environment, so we need a fallback - // to our wrapped type. - if (!isArrayLike(keyPath)) { - throw new TypeError('Expected iterable or array-like: ' + keyPath); - } - iter = getIterator(Iterable(keyPath)); - } - return iter; -} diff --git a/src/utils/hasOwnProperty.ts b/src/utils/hasOwnProperty.ts new file mode 100644 index 0000000000..cb5ba22368 --- /dev/null +++ b/src/utils/hasOwnProperty.ts @@ -0,0 +1 @@ +export default Object.prototype.hasOwnProperty; diff --git a/src/utils/invariant.js b/src/utils/invariant.js deleted file mode 100644 index 867c8ae786..0000000000 --- a/src/utils/invariant.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -export default function invariant(condition, error) { - if (!condition) throw new Error(error); -} diff --git a/src/utils/invariant.ts b/src/utils/invariant.ts new file mode 100644 index 0000000000..958e6c977b --- /dev/null +++ b/src/utils/invariant.ts @@ -0,0 +1,6 @@ +export default function invariant( + condition: unknown, + error: string +): asserts condition { + if (!condition) throw new Error(error); +} diff --git a/src/utils/isArrayLike.js b/src/utils/isArrayLike.js deleted file mode 100644 index 9283c72fb0..0000000000 --- a/src/utils/isArrayLike.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -export default function isArrayLike(value) { - return value && typeof value.length === 'number'; -} diff --git a/src/utils/isArrayLike.ts b/src/utils/isArrayLike.ts new file mode 100644 index 0000000000..82659d6c54 --- /dev/null +++ b/src/utils/isArrayLike.ts @@ -0,0 +1,25 @@ +export default function isArrayLike( + value: unknown +): value is ArrayLike { + if (Array.isArray(value) || typeof value === 'string') { + return true; + } + + // @ts-expect-error "Type 'unknown' is not assignable to type 'boolean'" : convert to Boolean + return ( + value && + typeof value === 'object' && + // @ts-expect-error check that `'length' in value &&` + Number.isInteger(value.length) && + // @ts-expect-error check that `'length' in value &&` + value.length >= 0 && + // @ts-expect-error check that `'length' in value &&` + (value.length === 0 + ? // Only {length: 0} is considered Array-like. + Object.keys(value).length === 1 + : // An object is only Array-like if it has a property where the last value + // in the array-like may be found (which could be undefined). + // @ts-expect-error check that `'length' in value &&` + value.hasOwnProperty(value.length - 1)) + ); +} diff --git a/src/utils/isDataStructure.ts b/src/utils/isDataStructure.ts new file mode 100644 index 0000000000..e71c55bb7d --- /dev/null +++ b/src/utils/isDataStructure.ts @@ -0,0 +1,20 @@ +import type { Collection, Record } from '../../type-definitions/immutable'; +import { isImmutable } from '../predicates/isImmutable'; +import isPlainObj from './isPlainObj'; + +/** + * Returns true if the value is a potentially-persistent data structure, either + * provided by Immutable.js or a plain Array or Object. + */ +export default function isDataStructure( + value: unknown +): value is + | Collection + | Record + | Array + | object { + return ( + typeof value === 'object' && + (isImmutable(value) || Array.isArray(value) || isPlainObj(value)) + ); +} diff --git a/src/utils/isPlainObj.ts b/src/utils/isPlainObj.ts new file mode 100644 index 0000000000..07e73e208a --- /dev/null +++ b/src/utils/isPlainObj.ts @@ -0,0 +1,26 @@ +const toString = Object.prototype.toString; + +export default function isPlainObject(value: unknown): value is object { + // The base prototype's toString deals with Argument objects and native namespaces like Math + if ( + !value || + typeof value !== 'object' || + toString.call(value) !== '[object Object]' + ) { + return false; + } + + const proto = Object.getPrototypeOf(value); + if (proto === null) { + return true; + } + + // Iteratively going up the prototype chain is needed for cross-realm environments (differing contexts, iframes, etc) + let parentProto = proto; + let nextProto = Object.getPrototypeOf(proto); + while (nextProto !== null) { + parentProto = nextProto; + nextProto = Object.getPrototypeOf(parentProto); + } + return parentProto === proto; +} diff --git a/src/utils/mixin.js b/src/utils/mixin.js deleted file mode 100644 index cff365086d..0000000000 --- a/src/utils/mixin.js +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -/** - * Contributes additional methods to a constructor - */ -export default function mixin(ctor, methods) { - var keyCopier = key => { ctor.prototype[key] = methods[key]; }; - Object.keys(methods).forEach(keyCopier); - Object.getOwnPropertySymbols && - Object.getOwnPropertySymbols(methods).forEach(keyCopier); - return ctor; -} diff --git a/src/utils/mixin.ts b/src/utils/mixin.ts new file mode 100644 index 0000000000..3d4cee5fc6 --- /dev/null +++ b/src/utils/mixin.ts @@ -0,0 +1,20 @@ +type Constructor = new (...args: unknown[]) => T; + +/** + * Contributes additional methods to a constructor + */ +export default function mixin( + ctor: C, + // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type + methods: Record +): C { + const keyCopier = (key: string | symbol): void => { + // @ts-expect-error how to handle symbol ? + ctor.prototype[key] = methods[key]; + }; + Object.keys(methods).forEach(keyCopier); + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + Object.getOwnPropertySymbols && + Object.getOwnPropertySymbols(methods).forEach(keyCopier); + return ctor; +} diff --git a/src/utils/quoteString.ts b/src/utils/quoteString.ts new file mode 100644 index 0000000000..8d9b825a38 --- /dev/null +++ b/src/utils/quoteString.ts @@ -0,0 +1,11 @@ +/** + * Converts a value to a string, adding quotes if a string was provided. + */ +export default function quoteString(value: unknown): string { + try { + return typeof value === 'string' ? JSON.stringify(value) : String(value); + // eslint-disable-next-line @typescript-eslint/no-unused-vars + } catch (_ignoreError) { + return JSON.stringify(value); + } +} diff --git a/src/utils/shallowCopy.ts b/src/utils/shallowCopy.ts new file mode 100644 index 0000000000..37aad28015 --- /dev/null +++ b/src/utils/shallowCopy.ts @@ -0,0 +1,19 @@ +import arrCopy from './arrCopy'; +import hasOwnProperty from './hasOwnProperty'; + +export default function shallowCopy(from: Array): Array; +export default function shallowCopy(from: O): O; +export default function shallowCopy( + from: Array | O +): Array | O { + if (Array.isArray(from)) { + return arrCopy(from); + } + const to: Partial = {}; + for (const key in from) { + if (hasOwnProperty.call(from, key)) { + to[key] = from[key]; + } + } + return to as O; +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000000..b0fa1baad1 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + /* Base Options: */ + "esModuleInterop": true, + "skipLibCheck": true, + "target": "es2022", + "allowJs": true, + "resolveJsonModule": true, + "moduleDetection": "force", + "isolatedModules": true, + "verbatimModuleSyntax": true, + /* Strictness */ + "strict": true, + "noUncheckedIndexedAccess": true, + "noImplicitOverride": true, + /* If NOT transpiling with TypeScript: */ + "module": "ESNext", + "moduleResolution": "bundler", + "noEmit": true, + /* If your code runs in the DOM: */ + "lib": ["es2022", "dom", "dom.iterable"] + } +} diff --git a/tsconfig.src.json b/tsconfig.src.json new file mode 100644 index 0000000000..ae550d9ff2 --- /dev/null +++ b/tsconfig.src.json @@ -0,0 +1,4 @@ +{ + "extends": "./tsconfig.json", + "include": ["src/Immutable.js"] +} diff --git a/tstyche.config.json b/tstyche.config.json new file mode 100644 index 0000000000..903317e015 --- /dev/null +++ b/tstyche.config.json @@ -0,0 +1,6 @@ +{ + "$schema": "https://tstyche.org/schemas/config.json", + "testFileMatch": [ + "type-definitions/ts-tests/*.ts" + ] +} diff --git a/type-definitions/Immutable.d.ts b/type-definitions/Immutable.d.ts deleted file mode 100644 index e1fc668153..0000000000 --- a/type-definitions/Immutable.d.ts +++ /dev/null @@ -1,2539 +0,0 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -/** - * Immutable data encourages pure functions (data-in, data-out) and lends itself - * to much simpler application development and enabling techniques from - * functional programming such as lazy evaluation. - * - * While designed to bring these powerful functional concepts to JavaScript, it - * presents an Object-Oriented API familiar to Javascript engineers and closely - * mirroring that of Array, Map, and Set. It is easy and efficient to convert to - * and from plain Javascript types. - - * Note: all examples are presented in [ES6][]. To run in all browsers, they - * need to be translated to ES3. For example: - * - * // ES6 - * foo.map(x => x * x); - * // ES3 - * foo.map(function (x) { return x * x; }); - * - * [ES6]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/New_in_JavaScript/ECMAScript_6_support_in_Mozilla - */ - -declare module Immutable { - - /** - * Deeply converts plain JS objects and arrays to Immutable Maps and Lists. - * - * If a `reviver` is optionally provided, it will be called with every - * collection as a Seq (beginning with the most nested collections - * and proceeding to the top-level collection itself), along with the key - * refering to each collection and the parent JS object provided as `this`. - * For the top level, object, the key will be `""`. This `reviver` is expected - * to return a new Immutable Iterable, allowing for custom conversions from - * deep JS objects. - * - * This example converts JSON to List and OrderedMap: - * - * Immutable.fromJS({a: {b: [10, 20, 30]}, c: 40}, function (key, value) { - * var isIndexed = Immutable.Iterable.isIndexed(value); - * return isIndexed ? value.toList() : value.toOrderedMap(); - * }); - * - * // true, "b", {b: [10, 20, 30]} - * // false, "a", {a: {b: [10, 20, 30]}, c: 40} - * // false, "", {"": {a: {b: [10, 20, 30]}, c: 40}} - * - * If `reviver` is not provided, the default behavior will convert Arrays into - * Lists and Objects into Maps. - * - * `reviver` acts similarly to the [same parameter in `JSON.parse`][1]. - * - * `Immutable.fromJS` is conservative in its conversion. It will only convert - * arrays which pass `Array.isArray` to Lists, and only raw objects (no custom - * prototype) to Map. - * - * Keep in mind, when using JS objects to construct Immutable Maps, that - * JavaScript Object properties are always strings, even if written in a - * quote-less shorthand, while Immutable Maps accept keys of any type. - * - * ```js - * var obj = { 1: "one" }; - * Object.keys(obj); // [ "1" ] - * obj["1"]; // "one" - * obj[1]; // "one" - * - * var map = Map(obj); - * map.get("1"); // "one" - * map.get(1); // undefined - * ``` - * - * Property access for JavaScript Objects first converts the key to a string, - * but since Immutable Map keys can be of any type the argument to `get()` is - * not altered. - * - * [1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#Example.3A_Using_the_reviver_parameter - * "Using the reviver parameter" - */ - export function fromJS( - json: any, - reviver?: (k: any, v: Iterable) => any - ): any; - - - /** - * Value equality check with semantics similar to `Object.is`, but treats - * Immutable `Iterable`s as values, equal if the second `Iterable` includes - * equivalent values. - * - * It's used throughout Immutable when checking for equality, including `Map` - * key equality and `Set` membership. - * - * var map1 = Immutable.Map({a:1, b:1, c:1}); - * var map2 = Immutable.Map({a:1, b:1, c:1}); - * assert(map1 !== map2); - * assert(Object.is(map1, map2) === false); - * assert(Immutable.is(map1, map2) === true); - * - * Note: Unlike `Object.is`, `Immutable.is` assumes `0` and `-0` are the same - * value, matching the behavior of ES6 Map key equality. - */ - export function is(first: any, second: any): boolean; - - - /** - * Lists are ordered indexed dense collections, much like a JavaScript - * Array. - * - * Lists are immutable and fully persistent with O(log32 N) gets and sets, - * and O(1) push and pop. - * - * Lists implement Deque, with efficient addition and removal from both the - * end (`push`, `pop`) and beginning (`unshift`, `shift`). - * - * Unlike a JavaScript Array, there is no distinction between an - * "unset" index and an index set to `undefined`. `List#forEach` visits all - * indices from 0 to size, regardless of whether they were explicitly defined. - */ - export module List { - - /** - * True if the provided value is a List - */ - function isList(maybeList: any): boolean; - - /** - * Creates a new List containing `values`. - */ - function of(...values: T[]): List; - } - - /** - * Create a new immutable List containing the values of the provided - * iterable-like. - */ - export function List(): List; - export function List(iter: Iterable.Indexed): List; - export function List(iter: Iterable.Set): List; - export function List(iter: Iterable.Keyed): List; - export function List(array: Array): List; - export function List(iterator: Iterator): List; - export function List(iterable: /*Iterable*/Object): List; - - - export interface List extends Collection.Indexed { - - // Persistent changes - - /** - * Returns a new List which includes `value` at `index`. If `index` already - * exists in this List, it will be replaced. - * - * `index` may be a negative number, which indexes back from the end of the - * List. `v.set(-1, "value")` sets the last item in the List. - * - * If `index` larger than `size`, the returned List's `size` will be large - * enough to include the `index`. - */ - set(index: number, value: T): List; - - /** - * Returns a new List which excludes this `index` and with a size 1 less - * than this List. Values at indices above `index` are shifted down by 1 to - * fill the position. - * - * This is synonymous with `list.splice(index, 1)`. - * - * `index` may be a negative number, which indexes back from the end of the - * List. `v.delete(-1)` deletes the last item in the List. - * - * Note: `delete` cannot be safely used in IE8 - * @alias remove - */ - delete(index: number): List; - remove(index: number): List; - - /** - * Returns a new List with `value` at `index` with a size 1 more than this - * List. Values at indices above `index` are shifted over by 1. - * - * This is synonymous with `list.splice(index, 0, value) - */ - insert(index: number, value: T): List; - - /** - * Returns a new List with 0 size and no values. - */ - clear(): List; - - /** - * Returns a new List with the provided `values` appended, starting at this - * List's `size`. - */ - push(...values: T[]): List; - - /** - * Returns a new List with a size ones less than this List, excluding - * the last index in this List. - * - * Note: this differs from `Array#pop` because it returns a new - * List rather than the removed value. Use `last()` to get the last value - * in this List. - */ - pop(): List; - - /** - * Returns a new List with the provided `values` prepended, shifting other - * values ahead to higher indices. - */ - unshift(...values: T[]): List; - - /** - * Returns a new List with a size ones less than this List, excluding - * the first index in this List, shifting all other values to a lower index. - * - * Note: this differs from `Array#shift` because it returns a new - * List rather than the removed value. Use `first()` to get the first - * value in this List. - */ - shift(): List; - - /** - * Returns a new List with an updated value at `index` with the return - * value of calling `updater` with the existing value, or `notSetValue` if - * `index` was not set. If called with a single argument, `updater` is - * called with the List itself. - * - * `index` may be a negative number, which indexes back from the end of the - * List. `v.update(-1)` updates the last item in the List. - * - * @see `Map#update` - */ - update(updater: (value: List) => List): List; - update(index: number, updater: (value: T) => T): List; - update(index: number, notSetValue: T, updater: (value: T) => T): List; - - /** - * @see `Map#merge` - */ - merge(...iterables: Iterable.Indexed[]): List; - merge(...iterables: Array[]): List; - - /** - * @see `Map#mergeWith` - */ - mergeWith( - merger: (previous?: T, next?: T, key?: number) => T, - ...iterables: Iterable.Indexed[] - ): List; - mergeWith( - merger: (previous?: T, next?: T, key?: number) => T, - ...iterables: Array[] - ): List; - - /** - * @see `Map#mergeDeep` - */ - mergeDeep(...iterables: Iterable.Indexed[]): List; - mergeDeep(...iterables: Array[]): List; - - /** - * @see `Map#mergeDeepWith` - */ - mergeDeepWith( - merger: (previous?: T, next?: T, key?: number) => T, - ...iterables: Iterable.Indexed[] - ): List; - mergeDeepWith( - merger: (previous?: T, next?: T, key?: number) => T, - ...iterables: Array[] - ): List; - - /** - * Returns a new List with size `size`. If `size` is less than this - * List's size, the new List will exclude values at the higher indices. - * If `size` is greater than this List's size, the new List will have - * undefined values for the newly available indices. - * - * When building a new List and the final size is known up front, `setSize` - * used in conjunction with `withMutations` may result in the more - * performant construction. - */ - setSize(size: number): List; - - - // Deep persistent changes - - /** - * Returns a new List having set `value` at this `keyPath`. If any keys in - * `keyPath` do not exist, a new immutable Map will be created at that key. - * - * Index numbers are used as keys to determine the path to follow in - * the List. - */ - setIn(keyPath: Array, value: any): List; - setIn(keyPath: Iterable, value: any): List; - - /** - * Returns a new List having removed the value at this `keyPath`. If any - * keys in `keyPath` do not exist, no change will occur. - * - * @alias removeIn - */ - deleteIn(keyPath: Array): List; - deleteIn(keyPath: Iterable): List; - removeIn(keyPath: Array): List; - removeIn(keyPath: Iterable): List; - - /** - * @see `Map#updateIn` - */ - updateIn( - keyPath: Array, - updater: (value: any) => any - ): List; - updateIn( - keyPath: Array, - notSetValue: any, - updater: (value: any) => any - ): List; - updateIn( - keyPath: Iterable, - updater: (value: any) => any - ): List; - updateIn( - keyPath: Iterable, - notSetValue: any, - updater: (value: any) => any - ): List; - - /** - * @see `Map#mergeIn` - */ - mergeIn( - keyPath: Iterable, - ...iterables: Iterable.Indexed[] - ): List; - mergeIn( - keyPath: Array, - ...iterables: Iterable.Indexed[] - ): List; - mergeIn( - keyPath: Array, - ...iterables: Array[] - ): List; - - /** - * @see `Map#mergeDeepIn` - */ - mergeDeepIn( - keyPath: Iterable, - ...iterables: Iterable.Indexed[] - ): List; - mergeDeepIn( - keyPath: Array, - ...iterables: Iterable.Indexed[] - ): List; - mergeDeepIn( - keyPath: Array, - ...iterables: Array[] - ): List; - - - // Transient changes - - /** - * Note: Not all methods can be used on a mutable collection or within - * `withMutations`! Only `set`, `push`, `pop`, `shift`, `unshift` and - * `merge` may be used mutatively. - * - * @see `Map#withMutations` - */ - withMutations(mutator: (mutable: List) => any): List; - - /** - * @see `Map#asMutable` - */ - asMutable(): List; - - /** - * @see `Map#asImmutable` - */ - asImmutable(): List; - } - - - /** - * Immutable Map is an unordered Iterable.Keyed of (key, value) pairs with - * `O(log32 N)` gets and `O(log32 N)` persistent sets. - * - * Iteration order of a Map is undefined, however is stable. Multiple - * iterations of the same Map will iterate in the same order. - * - * Map's keys can be of any type, and use `Immutable.is` to determine key - * equality. This allows the use of any value (including NaN) as a key. - * - * Because `Immutable.is` returns equality based on value semantics, and - * Immutable collections are treated as values, any Immutable collection may - * be used as a key. - * - * Map().set(List.of(1), 'listofone').get(List.of(1)); - * // 'listofone' - * - * Any JavaScript object may be used as a key, however strict identity is used - * to evaluate key equality. Two similar looking objects will represent two - * different keys. - * - * Implemented by a hash-array mapped trie. - */ - export module Map { - - /** - * True if the provided value is a Map - */ - function isMap(maybeMap: any): boolean; - - /** - * Creates a new Map from alternating keys and values - */ - function of(...keyValues: any[]): Map; - } - - /** - * Creates a new Immutable Map. - * - * Created with the same key value pairs as the provided Iterable.Keyed or - * JavaScript Object or expects an Iterable of [K, V] tuple entries. - * - * var newMap = Map({key: "value"}); - * var newMap = Map([["key", "value"]]); - * - * Keep in mind, when using JS objects to construct Immutable Maps, that - * JavaScript Object properties are always strings, even if written in a - * quote-less shorthand, while Immutable Maps accept keys of any type. - * - * ```js - * var obj = { 1: "one" }; - * Object.keys(obj); // [ "1" ] - * obj["1"]; // "one" - * obj[1]; // "one" - * - * var map = Map(obj); - * map.get("1"); // "one" - * map.get(1); // undefined - * ``` - * - * Property access for JavaScript Objects first converts the key to a string, - * but since Immutable Map keys can be of any type the argument to `get()` is - * not altered. - */ - export function Map(): Map; - export function Map(iter: Iterable.Keyed): Map; - export function Map(iter: Iterable>): Map; - export function Map(array: Array>): Map; - export function Map(obj: {[key: string]: V}): Map; - export function Map(iterator: Iterator>): Map; - export function Map(iterable: /*Iterable<[K,V]>*/Object): Map; - - export interface Map extends Collection.Keyed { - - // Persistent changes - - /** - * Returns a new Map also containing the new key, value pair. If an equivalent - * key already exists in this Map, it will be replaced. - */ - set(key: K, value: V): Map; - - /** - * Returns a new Map which excludes this `key`. - * - * Note: `delete` cannot be safely used in IE8, but is provided to mirror - * the ES6 collection API. - * @alias remove - */ - delete(key: K): Map; - remove(key: K): Map; - - /** - * Returns a new Map containing no keys or values. - */ - clear(): Map; - - /** - * Returns a new Map having updated the value at this `key` with the return - * value of calling `updater` with the existing value, or `notSetValue` if - * the key was not set. If called with only a single argument, `updater` is - * called with the Map itself. - * - * Equivalent to: `map.set(key, updater(map.get(key, notSetValue)))`. - */ - update(updater: (value: Map) => Map): Map; - update(key: K, updater: (value: V) => V): Map; - update(key: K, notSetValue: V, updater: (value: V) => V): Map; - - /** - * Returns a new Map resulting from merging the provided Iterables - * (or JS objects) into this Map. In other words, this takes each entry of - * each iterable and sets it on this Map. - * - * If any of the values provided to `merge` are not Iterable (would return - * false for `Immutable.Iterable.isIterable`) then they are deeply converted - * via `Immutable.fromJS` before being merged. However, if the value is an - * Iterable but includes non-iterable JS objects or arrays, those nested - * values will be preserved. - * - * var x = Immutable.Map({a: 10, b: 20, c: 30}); - * var y = Immutable.Map({b: 40, a: 50, d: 60}); - * x.merge(y) // { a: 50, b: 40, c: 30, d: 60 } - * y.merge(x) // { b: 20, a: 10, d: 60, c: 30 } - * - */ - merge(...iterables: Iterable[]): Map; - merge(...iterables: {[key: string]: V}[]): Map; - - /** - * Like `merge()`, `mergeWith()` returns a new Map resulting from merging - * the provided Iterables (or JS objects) into this Map, but uses the - * `merger` function for dealing with conflicts. - * - * var x = Immutable.Map({a: 10, b: 20, c: 30}); - * var y = Immutable.Map({b: 40, a: 50, d: 60}); - * x.mergeWith((prev, next) => prev / next, y) // { a: 0.2, b: 0.5, c: 30, d: 60 } - * y.mergeWith((prev, next) => prev / next, x) // { b: 2, a: 5, d: 60, c: 30 } - * - */ - mergeWith( - merger: (previous?: V, next?: V, key?: K) => V, - ...iterables: Iterable[] - ): Map; - mergeWith( - merger: (previous?: V, next?: V, key?: K) => V, - ...iterables: {[key: string]: V}[] - ): Map; - - /** - * Like `merge()`, but when two Iterables conflict, it merges them as well, - * recursing deeply through the nested data. - * - * var x = Immutable.fromJS({a: { x: 10, y: 10 }, b: { x: 20, y: 50 } }); - * var y = Immutable.fromJS({a: { x: 2 }, b: { y: 5 }, c: { z: 3 } }); - * x.mergeDeep(y) // {a: { x: 2, y: 10 }, b: { x: 20, y: 5 }, c: { z: 3 } } - * - */ - mergeDeep(...iterables: Iterable[]): Map; - mergeDeep(...iterables: {[key: string]: V}[]): Map; - - /** - * Like `mergeDeep()`, but when two non-Iterables conflict, it uses the - * `merger` function to determine the resulting value. - * - * var x = Immutable.fromJS({a: { x: 10, y: 10 }, b: { x: 20, y: 50 } }); - * var y = Immutable.fromJS({a: { x: 2 }, b: { y: 5 }, c: { z: 3 } }); - * x.mergeDeepWith((prev, next) => prev / next, y) - * // {a: { x: 5, y: 10 }, b: { x: 20, y: 10 }, c: { z: 3 } } - * - */ - mergeDeepWith( - merger: (previous?: V, next?: V, key?: K) => V, - ...iterables: Iterable[] - ): Map; - mergeDeepWith( - merger: (previous?: V, next?: V, key?: K) => V, - ...iterables: {[key: string]: V}[] - ): Map; - - - // Deep persistent changes - - /** - * Returns a new Map having set `value` at this `keyPath`. If any keys in - * `keyPath` do not exist, a new immutable Map will be created at that key. - */ - setIn(keyPath: Array, value: any): Map; - setIn(KeyPath: Iterable, value: any): Map; - - /** - * Returns a new Map having removed the value at this `keyPath`. If any keys - * in `keyPath` do not exist, no change will occur. - * - * @alias removeIn - */ - deleteIn(keyPath: Array): Map; - deleteIn(keyPath: Iterable): Map; - removeIn(keyPath: Array): Map; - removeIn(keyPath: Iterable): Map; - - /** - * Returns a new Map having applied the `updater` to the entry found at the - * keyPath. - * - * If any keys in `keyPath` do not exist, new Immutable `Map`s will - * be created at those keys. If the `keyPath` does not already contain a - * value, the `updater` function will be called with `notSetValue`, if - * provided, otherwise `undefined`. - * - * var data = Immutable.fromJS({ a: { b: { c: 10 } } }); - * data = data.updateIn(['a', 'b', 'c'], val => val * 2); - * // { a: { b: { c: 20 } } } - * - * If the `updater` function returns the same value it was called with, then - * no change will occur. This is still true if `notSetValue` is provided. - * - * var data1 = Immutable.fromJS({ a: { b: { c: 10 } } }); - * data2 = data1.updateIn(['x', 'y', 'z'], 100, val => val); - * assert(data2 === data1); - * - */ - updateIn( - keyPath: Array, - updater: (value: any) => any - ): Map; - updateIn( - keyPath: Array, - notSetValue: any, - updater: (value: any) => any - ): Map; - updateIn( - keyPath: Iterable, - updater: (value: any) => any - ): Map; - updateIn( - keyPath: Iterable, - notSetValue: any, - updater: (value: any) => any - ): Map; - - /** - * A combination of `updateIn` and `merge`, returning a new Map, but - * performing the merge at a point arrived at by following the keyPath. - * In other words, these two lines are equivalent: - * - * x.updateIn(['a', 'b', 'c'], abc => abc.merge(y)); - * x.mergeIn(['a', 'b', 'c'], y); - * - */ - mergeIn( - keyPath: Iterable, - ...iterables: Iterable[] - ): Map; - mergeIn( - keyPath: Array, - ...iterables: Iterable[] - ): Map; - mergeIn( - keyPath: Array, - ...iterables: {[key: string]: V}[] - ): Map; - - /** - * A combination of `updateIn` and `mergeDeep`, returning a new Map, but - * performing the deep merge at a point arrived at by following the keyPath. - * In other words, these two lines are equivalent: - * - * x.updateIn(['a', 'b', 'c'], abc => abc.mergeDeep(y)); - * x.mergeDeepIn(['a', 'b', 'c'], y); - * - */ - mergeDeepIn( - keyPath: Iterable, - ...iterables: Iterable[] - ): Map; - mergeDeepIn( - keyPath: Array, - ...iterables: Iterable[] - ): Map; - mergeDeepIn( - keyPath: Array, - ...iterables: {[key: string]: V}[] - ): Map; - - - // Transient changes - - /** - * Every time you call one of the above functions, a new immutable Map is - * created. If a pure function calls a number of these to produce a final - * return value, then a penalty on performance and memory has been paid by - * creating all of the intermediate immutable Maps. - * - * If you need to apply a series of mutations to produce a new immutable - * Map, `withMutations()` creates a temporary mutable copy of the Map which - * can apply mutations in a highly performant manner. In fact, this is - * exactly how complex mutations like `merge` are done. - * - * As an example, this results in the creation of 2, not 4, new Maps: - * - * var map1 = Immutable.Map(); - * var map2 = map1.withMutations(map => { - * map.set('a', 1).set('b', 2).set('c', 3); - * }); - * assert(map1.size === 0); - * assert(map2.size === 3); - * - * Note: Not all methods can be used on a mutable collection or within - * `withMutations`! Only `set` and `merge` may be used mutatively. - * - */ - withMutations(mutator: (mutable: Map) => any): Map; - - /** - * Another way to avoid creation of intermediate Immutable maps is to create - * a mutable copy of this collection. Mutable copies *always* return `this`, - * and thus shouldn't be used for equality. Your function should never return - * a mutable copy of a collection, only use it internally to create a new - * collection. If possible, use `withMutations` as it provides an easier to - * use API. - * - * Note: if the collection is already mutable, `asMutable` returns itself. - * - * Note: Not all methods can be used on a mutable collection or within - * `withMutations`! Only `set` and `merge` may be used mutatively. - */ - asMutable(): Map; - - /** - * The yin to `asMutable`'s yang. Because it applies to mutable collections, - * this operation is *mutable* and returns itself. Once performed, the mutable - * copy has become immutable and can be safely returned from a function. - */ - asImmutable(): Map; - } - - - /** - * A type of Map that has the additional guarantee that the iteration order of - * entries will be the order in which they were set(). - * - * The iteration behavior of OrderedMap is the same as native ES6 Map and - * JavaScript Object. - * - * Note that `OrderedMap` are more expensive than non-ordered `Map` and may - * consume more memory. `OrderedMap#set` is amortized O(log32 N), but not - * stable. - */ - - export module OrderedMap { - - /** - * True if the provided value is an OrderedMap. - */ - function isOrderedMap(maybeOrderedMap: any): boolean; - } - - /** - * Creates a new Immutable OrderedMap. - * - * Created with the same key value pairs as the provided Iterable.Keyed or - * JavaScript Object or expects an Iterable of [K, V] tuple entries. - * - * The iteration order of key-value pairs provided to this constructor will - * be preserved in the OrderedMap. - * - * var newOrderedMap = OrderedMap({key: "value"}); - * var newOrderedMap = OrderedMap([["key", "value"]]); - * - */ - export function OrderedMap(): OrderedMap; - export function OrderedMap(iter: Iterable.Keyed): OrderedMap; - export function OrderedMap(iter: Iterable>): OrderedMap; - export function OrderedMap(array: Array>): OrderedMap; - export function OrderedMap(obj: {[key: string]: V}): OrderedMap; - export function OrderedMap(iterator: Iterator>): OrderedMap; - export function OrderedMap(iterable: /*Iterable<[K,V]>*/Object): OrderedMap; - - export interface OrderedMap extends Map {} - - - /** - * A Collection of unique values with `O(log32 N)` adds and has. - * - * When iterating a Set, the entries will be (value, value) pairs. Iteration - * order of a Set is undefined, however is stable. Multiple iterations of the - * same Set will iterate in the same order. - * - * Set values, like Map keys, may be of any type. Equality is determined using - * `Immutable.is`, enabling Sets to uniquely include other Immutable - * collections, custom value types, and NaN. - */ - export module Set { - - /** - * True if the provided value is a Set - */ - function isSet(maybeSet: any): boolean; - - /** - * Creates a new Set containing `values`. - */ - function of(...values: T[]): Set; - - /** - * `Set.fromKeys()` creates a new immutable Set containing the keys from - * this Iterable or JavaScript Object. - */ - function fromKeys(iter: Iterable): Set; - function fromKeys(obj: {[key: string]: any}): Set; - } - - /** - * Create a new immutable Set containing the values of the provided - * iterable-like. - */ - export function Set(): Set; - export function Set(iter: Iterable.Set): Set; - export function Set(iter: Iterable.Indexed): Set; - export function Set(iter: Iterable.Keyed): Set; - export function Set(array: Array): Set; - export function Set(iterator: Iterator): Set; - export function Set(iterable: /*Iterable*/Object): Set; - - export interface Set extends Collection.Set { - - // Persistent changes - - /** - * Returns a new Set which also includes this value. - */ - add(value: T): Set; - - /** - * Returns a new Set which excludes this value. - * - * Note: `delete` cannot be safely used in IE8 - * @alias remove - */ - delete(value: T): Set; - remove(value: T): Set; - - /** - * Returns a new Set containing no values. - */ - clear(): Set; - - /** - * Returns a Set including any value from `iterables` that does not already - * exist in this Set. - * @alias merge - */ - union(...iterables: Iterable[]): Set; - union(...iterables: Array[]): Set; - merge(...iterables: Iterable[]): Set; - merge(...iterables: Array[]): Set; - - - /** - * Returns a Set which has removed any values not also contained - * within `iterables`. - */ - intersect(...iterables: Iterable[]): Set; - intersect(...iterables: Array[]): Set; - - /** - * Returns a Set excluding any values contained within `iterables`. - */ - subtract(...iterables: Iterable[]): Set; - subtract(...iterables: Array[]): Set; - - - // Transient changes - - /** - * Note: Not all methods can be used on a mutable collection or within - * `withMutations`! Only `add` may be used mutatively. - * - * @see `Map#withMutations` - */ - withMutations(mutator: (mutable: Set) => any): Set; - - /** - * @see `Map#asMutable` - */ - asMutable(): Set; - - /** - * @see `Map#asImmutable` - */ - asImmutable(): Set; - } - - - /** - * A type of Set that has the additional guarantee that the iteration order of - * values will be the order in which they were `add`ed. - * - * The iteration behavior of OrderedSet is the same as native ES6 Set. - * - * Note that `OrderedSet` are more expensive than non-ordered `Set` and may - * consume more memory. `OrderedSet#add` is amortized O(log32 N), but not - * stable. - */ - export module OrderedSet { - - /** - * True if the provided value is an OrderedSet. - */ - function isOrderedSet(maybeOrderedSet: any): boolean; - - /** - * Creates a new OrderedSet containing `values`. - */ - function of(...values: T[]): OrderedSet; - - /** - * `OrderedSet.fromKeys()` creates a new immutable OrderedSet containing - * the keys from this Iterable or JavaScript Object. - */ - function fromKeys(iter: Iterable): OrderedSet; - function fromKeys(obj: {[key: string]: any}): OrderedSet; - } - - /** - * Create a new immutable OrderedSet containing the values of the provided - * iterable-like. - */ - export function OrderedSet(): OrderedSet; - export function OrderedSet(iter: Iterable.Set): OrderedSet; - export function OrderedSet(iter: Iterable.Indexed): OrderedSet; - export function OrderedSet(iter: Iterable.Keyed): OrderedSet; - export function OrderedSet(array: Array): OrderedSet; - export function OrderedSet(iterator: Iterator): OrderedSet; - export function OrderedSet(iterable: /*Iterable*/Object): OrderedSet; - - export interface OrderedSet extends Set {} - - - /** - * Stacks are indexed collections which support very efficient O(1) addition - * and removal from the front using `unshift(v)` and `shift()`. - * - * For familiarity, Stack also provides `push(v)`, `pop()`, and `peek()`, but - * be aware that they also operate on the front of the list, unlike List or - * a JavaScript Array. - * - * Note: `reverse()` or any inherent reverse traversal (`reduceRight`, - * `lastIndexOf`, etc.) is not efficient with a Stack. - * - * Stack is implemented with a Single-Linked List. - */ - export module Stack { - - /** - * True if the provided value is a Stack - */ - function isStack(maybeStack: any): boolean; - - /** - * Creates a new Stack containing `values`. - */ - function of(...values: T[]): Stack; - } - - /** - * Create a new immutable Stack containing the values of the provided - * iterable-like. - * - * The iteration order of the provided iterable is preserved in the - * resulting `Stack`. - */ - export function Stack(): Stack; - export function Stack(iter: Iterable.Indexed): Stack; - export function Stack(iter: Iterable.Set): Stack; - export function Stack(iter: Iterable.Keyed): Stack; - export function Stack(array: Array): Stack; - export function Stack(iterator: Iterator): Stack; - export function Stack(iterable: /*Iterable*/Object): Stack; - - export interface Stack extends Collection.Indexed { - - // Reading values - - /** - * Alias for `Stack.first()`. - */ - peek(): T; - - - // Persistent changes - - /** - * Returns a new Stack with 0 size and no values. - */ - clear(): Stack; - - /** - * Returns a new Stack with the provided `values` prepended, shifting other - * values ahead to higher indices. - * - * This is very efficient for Stack. - */ - unshift(...values: T[]): Stack; - - /** - * Like `Stack#unshift`, but accepts a iterable rather than varargs. - */ - unshiftAll(iter: Iterable): Stack; - unshiftAll(iter: Array): Stack; - - /** - * Returns a new Stack with a size ones less than this Stack, excluding - * the first item in this Stack, shifting all other values to a lower index. - * - * Note: this differs from `Array#shift` because it returns a new - * Stack rather than the removed value. Use `first()` or `peek()` to get the - * first value in this Stack. - */ - shift(): Stack; - - /** - * Alias for `Stack#unshift` and is not equivalent to `List#push`. - */ - push(...values: T[]): Stack; - - /** - * Alias for `Stack#unshiftAll`. - */ - pushAll(iter: Iterable): Stack; - pushAll(iter: Array): Stack; - - /** - * Alias for `Stack#shift` and is not equivalent to `List#pop`. - */ - pop(): Stack; - - - // Transient changes - - /** - * Note: Not all methods can be used on a mutable collection or within - * `withMutations`! Only `set`, `push`, and `pop` may be used mutatively. - * - * @see `Map#withMutations` - */ - withMutations(mutator: (mutable: Stack) => any): Stack; - - /** - * @see `Map#asMutable` - */ - asMutable(): Stack; - - /** - * @see `Map#asImmutable` - */ - asImmutable(): Stack; - } - - - /** - * Returns a Seq.Indexed of numbers from `start` (inclusive) to `end` - * (exclusive), by `step`, where `start` defaults to 0, `step` to 1, and `end` to - * infinity. When `start` is equal to `end`, returns empty range. - * - * Range() // [0,1,2,3,...] - * Range(10) // [10,11,12,13,...] - * Range(10,15) // [10,11,12,13,14] - * Range(10,30,5) // [10,15,20,25] - * Range(30,10,5) // [30,25,20,15] - * Range(30,30,5) // [] - * - */ - export function Range(start?: number, end?: number, step?: number): Seq.Indexed; - - - /** - * Returns a Seq.Indexed of `value` repeated `times` times. When `times` is - * not defined, returns an infinite `Seq` of `value`. - * - * Repeat('foo') // ['foo','foo','foo',...] - * Repeat('bar',4) // ['bar','bar','bar','bar'] - * - */ - export function Repeat(value: T, times?: number): Seq.Indexed; - - - /** - * Creates a new Class which produces Record instances. A record is similar to - * a JS object, but enforce a specific set of allowed string keys, and have - * default values. - * - * var ABRecord = Record({a:1, b:2}) - * var myRecord = new ABRecord({b:3}) - * - * Records always have a value for the keys they define. `remove`ing a key - * from a record simply resets it to the default value for that key. - * - * myRecord.size // 2 - * myRecord.get('a') // 1 - * myRecord.get('b') // 3 - * myRecordWithoutB = myRecord.remove('b') - * myRecordWithoutB.get('b') // 2 - * myRecordWithoutB.size // 2 - * - * Values provided to the constructor not found in the Record type will - * be ignored. For example, in this case, ABRecord is provided a key "x" even - * though only "a" and "b" have been defined. The value for "x" will be - * ignored for this record. - * - * var myRecord = new ABRecord({b:3, x:10}) - * myRecord.get('x') // undefined - * - * Because Records have a known set of string keys, property get access works - * as expected, however property sets will throw an Error. - * - * Note: IE8 does not support property access. Only use `get()` when - * supporting IE8. - * - * myRecord.b // 3 - * myRecord.b = 5 // throws Error - * - * Record Classes can be extended as well, allowing for custom methods on your - * Record. This is not a common pattern in functional environments, but is in - * many JS programs. - * - * Note: TypeScript does not support this type of subclassing. - * - * class ABRecord extends Record({a:1,b:2}) { - * getAB() { - * return this.a + this.b; - * } - * } - * - * var myRecord = new ABRecord({b: 3}) - * myRecord.getAB() // 4 - * - */ - export module Record { - export interface Class { - new (): Map; - new (values: {[key: string]: any}): Map; - new (values: Iterable): Map; // deprecated - - (): Map; - (values: {[key: string]: any}): Map; - (values: Iterable): Map; // deprecated - } - } - - export function Record( - defaultValues: {[key: string]: any}, name?: string - ): Record.Class; - - - /** - * Represents a sequence of values, but may not be backed by a concrete data - * structure. - * - * **Seq is immutable** — Once a Seq is created, it cannot be - * changed, appended to, rearranged or otherwise modified. Instead, any - * mutative method called on a `Seq` will return a new `Seq`. - * - * **Seq is lazy** — Seq does as little work as necessary to respond to any - * method call. Values are often created during iteration, including implicit - * iteration when reducing or converting to a concrete data structure such as - * a `List` or JavaScript `Array`. - * - * For example, the following performs no work, because the resulting - * Seq's values are never iterated: - * - * var oddSquares = Immutable.Seq.of(1,2,3,4,5,6,7,8) - * .filter(x => x % 2).map(x => x * x); - * - * Once the Seq is used, it performs only the work necessary. In this - * example, no intermediate data structures are ever created, filter is only - * called three times, and map is only called once: - * - * console.log(oddSquares.get(1)); // 9 - * - * Seq allows for the efficient chaining of operations, - * allowing for the expression of logic that can otherwise be very tedious: - * - * Immutable.Seq({a:1, b:1, c:1}) - * .flip().map(key => key.toUpperCase()).flip().toObject(); - * // Map { A: 1, B: 1, C: 1 } - * - * As well as expressing logic that would otherwise be memory or time limited: - * - * Immutable.Range(1, Infinity) - * .skip(1000) - * .map(n => -n) - * .filter(n => n % 2 === 0) - * .take(2) - * .reduce((r, n) => r * n, 1); - * // 1006008 - * - * Seq is often used to provide a rich collection API to JavaScript Object. - * - * Immutable.Seq({ x: 0, y: 1, z: 2 }).map(v => v * 2).toObject(); - * // { x: 0, y: 2, z: 4 } - */ - - export module Seq { - /** - * True if `maybeSeq` is a Seq, it is not backed by a concrete - * structure such as Map, List, or Set. - */ - function isSeq(maybeSeq: any): boolean; - - /** - * Returns a Seq of the values provided. Alias for `Seq.Indexed.of()`. - */ - function of(...values: T[]): Seq.Indexed; - - - /** - * `Seq` which represents key-value pairs. - */ - export module Keyed {} - - /** - * Always returns a Seq.Keyed, if input is not keyed, expects an - * iterable of [K, V] tuples. - */ - export function Keyed(): Seq.Keyed; - export function Keyed(seq: Iterable.Keyed): Seq.Keyed; - export function Keyed(seq: Iterable): Seq.Keyed; - export function Keyed(array: Array): Seq.Keyed; - export function Keyed(obj: {[key: string]: V}): Seq.Keyed; - export function Keyed(iterator: Iterator): Seq.Keyed; - export function Keyed(iterable: /*Iterable<[K,V]>*/Object): Seq.Keyed; - - export interface Keyed extends Seq, Iterable.Keyed { - - /** - * Returns itself - */ - toSeq(): /*this*/Seq.Keyed - } - - - /** - * `Seq` which represents an ordered indexed list of values. - */ - module Indexed { - - /** - * Provides an Seq.Indexed of the values provided. - */ - function of(...values: T[]): Seq.Indexed; - } - - /** - * Always returns Seq.Indexed, discarding associated keys and - * supplying incrementing indices. - */ - export function Indexed(): Seq.Indexed; - export function Indexed(seq: Iterable.Indexed): Seq.Indexed; - export function Indexed(seq: Iterable.Set): Seq.Indexed; - export function Indexed(seq: Iterable.Keyed): Seq.Indexed; - export function Indexed(array: Array): Seq.Indexed; - export function Indexed(iterator: Iterator): Seq.Indexed; - export function Indexed(iterable: /*Iterable*/Object): Seq.Indexed; - - export interface Indexed extends Seq, Iterable.Indexed { - - /** - * Returns itself - */ - toSeq(): /*this*/Seq.Indexed - } - - - /** - * `Seq` which represents a set of values. - * - * Because `Seq` are often lazy, `Seq.Set` does not provide the same guarantee - * of value uniqueness as the concrete `Set`. - */ - export module Set { - - /** - * Returns a Seq.Set of the provided values - */ - function of(...values: T[]): Seq.Set; - } - - /** - * Always returns a Seq.Set, discarding associated indices or keys. - */ - export function Set(): Seq.Set; - export function Set(seq: Iterable.Set): Seq.Set; - export function Set(seq: Iterable.Indexed): Seq.Set; - export function Set(seq: Iterable.Keyed): Seq.Set; - export function Set(array: Array): Seq.Set; - export function Set(iterator: Iterator): Seq.Set; - export function Set(iterable: /*Iterable*/Object): Seq.Set; - - export interface Set extends Seq, Iterable.Set { - - /** - * Returns itself - */ - toSeq(): /*this*/Seq.Set - } - - } - - /** - * Creates a Seq. - * - * Returns a particular kind of `Seq` based on the input. - * - * * If a `Seq`, that same `Seq`. - * * If an `Iterable`, a `Seq` of the same kind (Keyed, Indexed, or Set). - * * If an Array-like, an `Seq.Indexed`. - * * If an Object with an Iterator, an `Seq.Indexed`. - * * If an Iterator, an `Seq.Indexed`. - * * If an Object, a `Seq.Keyed`. - * - */ - export function Seq(): Seq; - export function Seq(seq: Seq): Seq; - export function Seq(iterable: Iterable): Seq; - export function Seq(array: Array): Seq.Indexed; - export function Seq(obj: {[key: string]: V}): Seq.Keyed; - export function Seq(iterator: Iterator): Seq.Indexed; - export function Seq(iterable: /*ES6Iterable*/Object): Seq.Indexed; - - export interface Seq extends Iterable { - - /** - * Some Seqs can describe their size lazily. When this is the case, - * size will be an integer. Otherwise it will be undefined. - * - * For example, Seqs returned from `map()` or `reverse()` - * preserve the size of the original `Seq` while `filter()` does not. - * - * Note: `Range`, `Repeat` and `Seq`s made from `Array`s and `Object`s will - * always have a size. - */ - size: number/*?*/; - - - // Force evaluation - - /** - * Because Sequences are lazy and designed to be chained together, they do - * not cache their results. For example, this map function is called a total - * of 6 times, as each `join` iterates the Seq of three values. - * - * var squares = Seq.of(1,2,3).map(x => x * x); - * squares.join() + squares.join(); - * - * If you know a `Seq` will be used multiple times, it may be more - * efficient to first cache it in memory. Here, the map function is called - * only 3 times. - * - * var squares = Seq.of(1,2,3).map(x => x * x).cacheResult(); - * squares.join() + squares.join(); - * - * Use this method judiciously, as it must fully evaluate a Seq which can be - * a burden on memory and possibly performance. - * - * Note: after calling `cacheResult`, a Seq will always have a `size`. - */ - cacheResult(): /*this*/Seq; - } - - /** - * The `Iterable` is a set of (key, value) entries which can be iterated, and - * is the base class for all collections in `immutable`, allowing them to - * make use of all the Iterable methods (such as `map` and `filter`). - * - * Note: An iterable is always iterated in the same order, however that order - * may not always be well defined, as is the case for the `Map` and `Set`. - */ - export module Iterable { - /** - * True if `maybeIterable` is an Iterable, or any of its subclasses. - */ - function isIterable(maybeIterable: any): boolean; - - /** - * True if `maybeKeyed` is an Iterable.Keyed, or any of its subclasses. - */ - function isKeyed(maybeKeyed: any): boolean; - - /** - * True if `maybeIndexed` is a Iterable.Indexed, or any of its subclasses. - */ - function isIndexed(maybeIndexed: any): boolean; - - /** - * True if `maybeAssociative` is either a keyed or indexed Iterable. - */ - function isAssociative(maybeAssociative: any): boolean; - - /** - * True if `maybeOrdered` is an Iterable where iteration order is well - * defined. True for Iterable.Indexed as well as OrderedMap and OrderedSet. - */ - function isOrdered(maybeOrdered: any): boolean; - - - /** - * Keyed Iterables have discrete keys tied to each value. - * - * When iterating `Iterable.Keyed`, each iteration will yield a `[K, V]` - * tuple, in other words, `Iterable#entries` is the default iterator for - * Keyed Iterables. - */ - export module Keyed {} - - /** - * Creates an Iterable.Keyed - * - * Similar to `Iterable()`, however it expects iterable-likes of [K, V] - * tuples if not constructed from a Iterable.Keyed or JS Object. - */ - export function Keyed(iter: Iterable.Keyed): Iterable.Keyed; - export function Keyed(iter: Iterable): Iterable.Keyed; - export function Keyed(array: Array): Iterable.Keyed; - export function Keyed(obj: {[key: string]: V}): Iterable.Keyed; - export function Keyed(iterator: Iterator): Iterable.Keyed; - export function Keyed(iterable: /*Iterable<[K,V]>*/Object): Iterable.Keyed; - - export interface Keyed extends Iterable { - - /** - * Returns Seq.Keyed. - * @override - */ - toSeq(): Seq.Keyed; - - - // Sequence functions - - /** - * Returns a new Iterable.Keyed of the same type where the keys and values - * have been flipped. - * - * Seq({ a: 'z', b: 'y' }).flip() // { z: 'a', y: 'b' } - * - */ - flip(): /*this*/Iterable.Keyed; - - /** - * Returns a new Iterable.Keyed of the same type with keys passed through - * a `mapper` function. - * - * Seq({ a: 1, b: 2 }) - * .mapKeys(x => x.toUpperCase()) - * // Seq { A: 1, B: 2 } - * - */ - mapKeys( - mapper: (key?: K, value?: V, iter?: /*this*/Iterable.Keyed) => M, - context?: any - ): /*this*/Iterable.Keyed; - - /** - * Returns a new Iterable.Keyed of the same type with entries - * ([key, value] tuples) passed through a `mapper` function. - * - * Seq({ a: 1, b: 2 }) - * .mapEntries(([k, v]) => [k.toUpperCase(), v * 2]) - * // Seq { A: 2, B: 4 } - * - */ - mapEntries( - mapper: ( - entry?: /*(K, V)*/Array, - index?: number, - iter?: /*this*/Iterable.Keyed - ) => /*[KM, VM]*/Array, - context?: any - ): /*this*/Iterable.Keyed; - } - - - /** - * Indexed Iterables have incrementing numeric keys. They exhibit - * slightly different behavior than `Iterable.Keyed` for some methods in order - * to better mirror the behavior of JavaScript's `Array`, and add methods - * which do not make sense on non-indexed Iterables such as `indexOf`. - * - * Unlike JavaScript arrays, `Iterable.Indexed`s are always dense. "Unset" - * indices and `undefined` indices are indistinguishable, and all indices from - * 0 to `size` are visited when iterated. - * - * All Iterable.Indexed methods return re-indexed Iterables. In other words, - * indices always start at 0 and increment until size. If you wish to - * preserve indices, using them as keys, convert to a Iterable.Keyed by - * calling `toKeyedSeq`. - */ - export module Indexed {} - - /** - * Creates a new Iterable.Indexed. - */ - export function Indexed(iter: Iterable.Indexed): Iterable.Indexed; - export function Indexed(iter: Iterable.Set): Iterable.Indexed; - export function Indexed(iter: Iterable.Keyed): Iterable.Indexed; - export function Indexed(array: Array): Iterable.Indexed; - export function Indexed(iterator: Iterator): Iterable.Indexed; - export function Indexed(iterable: /*Iterable*/Object): Iterable.Indexed; - - export interface Indexed extends Iterable { - - // Reading values - - /** - * Returns the value associated with the provided index, or notSetValue if - * the index is beyond the bounds of the Iterable. - * - * `index` may be a negative number, which indexes back from the end of the - * Iterable. `s.get(-1)` gets the last item in the Iterable. - */ - get(index: number, notSetValue?: T): T; - - - // Conversion to Seq - - /** - * Returns Seq.Indexed. - * @override - */ - toSeq(): Seq.Indexed; - - /** - * If this is an iterable of [key, value] entry tuples, it will return a - * Seq.Keyed of those entries. - */ - fromEntrySeq(): Seq.Keyed; - - - // Combination - - /** - * Returns an Iterable of the same type with `separator` between each item - * in this Iterable. - */ - interpose(separator: T): /*this*/Iterable.Indexed; - - /** - * Returns an Iterable of the same type with the provided `iterables` - * interleaved into this iterable. - * - * The resulting Iterable includes the first item from each, then the - * second from each, etc. - * - * I.Seq.of(1,2,3).interleave(I.Seq.of('A','B','C')) - * // Seq [ 1, 'A', 2, 'B', 3, 'C' ] - * - * The shortest Iterable stops interleave. - * - * I.Seq.of(1,2,3).interleave( - * I.Seq.of('A','B'), - * I.Seq.of('X','Y','Z') - * ) - * // Seq [ 1, 'A', 'X', 2, 'B', 'Y' ] - */ - interleave(...iterables: Array>): /*this*/Iterable.Indexed; - - /** - * Splice returns a new indexed Iterable by replacing a region of this - * Iterable with new values. If values are not provided, it only skips the - * region to be removed. - * - * `index` may be a negative number, which indexes back from the end of the - * Iterable. `s.splice(-2)` splices after the second to last item. - * - * Seq(['a','b','c','d']).splice(1, 2, 'q', 'r', 's') - * // Seq ['a', 'q', 'r', 's', 'd'] - * - */ - splice( - index: number, - removeNum: number, - ...values: /*Array | T>*/any[] - ): /*this*/Iterable.Indexed; - - /** - * Returns an Iterable of the same type "zipped" with the provided - * iterables. - * - * Like `zipWith`, but using the default `zipper`: creating an `Array`. - * - * var a = Seq.of(1, 2, 3); - * var b = Seq.of(4, 5, 6); - * var c = a.zip(b); // Seq [ [ 1, 4 ], [ 2, 5 ], [ 3, 6 ] ] - * - */ - zip(...iterables: Array>): /*this*/Iterable.Indexed; - - /** - * Returns an Iterable of the same type "zipped" with the provided - * iterables by using a custom `zipper` function. - * - * var a = Seq.of(1, 2, 3); - * var b = Seq.of(4, 5, 6); - * var c = a.zipWith((a, b) => a + b, b); // Seq [ 5, 7, 9 ] - * - */ - zipWith( - zipper: (value: T, otherValue: U) => Z, - otherIterable: Iterable - ): Iterable.Indexed; - zipWith( - zipper: (value: T, otherValue: U, thirdValue: V) => Z, - otherIterable: Iterable, - thirdIterable: Iterable - ): Iterable.Indexed; - zipWith( - zipper: (...any: Array) => Z, - ...iterables: Array> - ): Iterable.Indexed; - - - // Search for value - - /** - * Returns the first index at which a given value can be found in the - * Iterable, or -1 if it is not present. - */ - indexOf(searchValue: T): number; - - /** - * Returns the last index at which a given value can be found in the - * Iterable, or -1 if it is not present. - */ - lastIndexOf(searchValue: T): number; - - /** - * Returns the first index in the Iterable where a value satisfies the - * provided predicate function. Otherwise -1 is returned. - */ - findIndex( - predicate: (value?: T, index?: number, iter?: /*this*/Iterable.Indexed) => boolean, - context?: any - ): number; - - /** - * Returns the last index in the Iterable where a value satisfies the - * provided predicate function. Otherwise -1 is returned. - */ - findLastIndex( - predicate: (value?: T, index?: number, iter?: /*this*/Iterable.Indexed) => boolean, - context?: any - ): number; - } - - - /** - * Set Iterables only represent values. They have no associated keys or - * indices. Duplicate values are possible in Seq.Sets, however the - * concrete `Set` does not allow duplicate values. - * - * Iterable methods on Iterable.Set such as `map` and `forEach` will provide - * the value as both the first and second arguments to the provided function. - * - * var seq = Seq.Set.of('A', 'B', 'C'); - * assert.equal(seq.every((v, k) => v === k), true); - * - */ - export module Set {} - - /** - * Similar to `Iterable()`, but always returns a Iterable.Set. - */ - export function Set(iter: Iterable.Set): Iterable.Set; - export function Set(iter: Iterable.Indexed): Iterable.Set; - export function Set(iter: Iterable.Keyed): Iterable.Set; - export function Set(array: Array): Iterable.Set; - export function Set(iterator: Iterator): Iterable.Set; - export function Set(iterable: /*Iterable*/Object): Iterable.Set; - - export interface Set extends Iterable { - - /** - * Returns Seq.Set. - * @override - */ - toSeq(): Seq.Set; - } - - } - - /** - * Creates an Iterable. - * - * The type of Iterable created is based on the input. - * - * * If an `Iterable`, that same `Iterable`. - * * If an Array-like, an `Iterable.Indexed`. - * * If an Object with an Iterator, an `Iterable.Indexed`. - * * If an Iterator, an `Iterable.Indexed`. - * * If an Object, an `Iterable.Keyed`. - * - * This methods forces the conversion of Objects and Strings to Iterables. - * If you want to ensure that a Iterable of one item is returned, use - * `Seq.of`. - */ - export function Iterable(iterable: Iterable): Iterable; - export function Iterable(array: Array): Iterable.Indexed; - export function Iterable(obj: {[key: string]: V}): Iterable.Keyed; - export function Iterable(iterator: Iterator): Iterable.Indexed; - export function Iterable(iterable: /*ES6Iterable*/Object): Iterable.Indexed; - export function Iterable(value: V): Iterable.Indexed; - - export interface Iterable { - - // Value equality - - /** - * True if this and the other Iterable have value equality, as defined - * by `Immutable.is()`. - * - * Note: This is equivalent to `Immutable.is(this, other)`, but provided to - * allow for chained expressions. - */ - equals(other: Iterable): boolean; - - /** - * Computes and returns the hashed identity for this Iterable. - * - * The `hashCode` of an Iterable is used to determine potential equality, - * and is used when adding this to a `Set` or as a key in a `Map`, enabling - * lookup via a different instance. - * - * var a = List.of(1, 2, 3); - * var b = List.of(1, 2, 3); - * assert(a !== b); // different instances - * var set = Set.of(a); - * assert(set.has(b) === true); - * - * If two values have the same `hashCode`, they are [not guaranteed - * to be equal][Hash Collision]. If two values have different `hashCode`s, - * they must not be equal. - * - * [Hash Collision]: http://en.wikipedia.org/wiki/Collision_(computer_science) - */ - hashCode(): number; - - - // Reading values - - /** - * Returns the value associated with the provided key, or notSetValue if - * the Iterable does not contain this key. - * - * Note: it is possible a key may be associated with an `undefined` value, - * so if `notSetValue` is not provided and this method returns `undefined`, - * that does not guarantee the key was not found. - */ - get(key: K, notSetValue?: V): V; - - /** - * True if a key exists within this `Iterable`, using `Immutable.is` to determine equality - */ - has(key: K): boolean; - - /** - * True if a value exists within this `Iterable`, using `Immutable.is` to determine equality - * @alias contains - */ - includes(value: V): boolean; - contains(value: V): boolean; - - /** - * The first value in the Iterable. - */ - first(): V; - - /** - * The last value in the Iterable. - */ - last(): V; - - - // Reading deep values - - /** - * Returns the value found by following a path of keys or indices through - * nested Iterables. - */ - getIn(searchKeyPath: Array, notSetValue?: any): any; - getIn(searchKeyPath: Iterable, notSetValue?: any): any; - - /** - * True if the result of following a path of keys or indices through nested - * Iterables results in a set value. - */ - hasIn(searchKeyPath: Array): boolean; - hasIn(searchKeyPath: Iterable): boolean; - - - // Conversion to JavaScript types - - /** - * Deeply converts this Iterable to equivalent JS. - * - * `Iterable.Indexeds`, and `Iterable.Sets` become Arrays, while - * `Iterable.Keyeds` become Objects. - * - * @alias toJSON - */ - toJS(): any; - - /** - * Shallowly converts this iterable to an Array, discarding keys. - */ - toArray(): Array; - - /** - * Shallowly converts this Iterable to an Object. - * - * Throws if keys are not strings. - */ - toObject(): { [key: string]: V }; - - - // Conversion to Collections - - /** - * Converts this Iterable to a Map, Throws if keys are not hashable. - * - * Note: This is equivalent to `Map(this.toKeyedSeq())`, but provided - * for convenience and to allow for chained expressions. - */ - toMap(): Map; - - /** - * Converts this Iterable to a Map, maintaining the order of iteration. - * - * Note: This is equivalent to `OrderedMap(this.toKeyedSeq())`, but - * provided for convenience and to allow for chained expressions. - */ - toOrderedMap(): OrderedMap; - - /** - * Converts this Iterable to a Set, discarding keys. Throws if values - * are not hashable. - * - * Note: This is equivalent to `Set(this)`, but provided to allow for - * chained expressions. - */ - toSet(): Set; - - /** - * Converts this Iterable to a Set, maintaining the order of iteration and - * discarding keys. - * - * Note: This is equivalent to `OrderedSet(this.valueSeq())`, but provided - * for convenience and to allow for chained expressions. - */ - toOrderedSet(): OrderedSet; - - /** - * Converts this Iterable to a List, discarding keys. - * - * Note: This is equivalent to `List(this)`, but provided to allow - * for chained expressions. - */ - toList(): List; - - /** - * Converts this Iterable to a Stack, discarding keys. Throws if values - * are not hashable. - * - * Note: This is equivalent to `Stack(this)`, but provided to allow for - * chained expressions. - */ - toStack(): Stack; - - - // Conversion to Seq - - /** - * Converts this Iterable to a Seq of the same kind (indexed, - * keyed, or set). - */ - toSeq(): Seq; - - /** - * Returns a Seq.Keyed from this Iterable where indices are treated as keys. - * - * This is useful if you want to operate on an - * Iterable.Indexed and preserve the [index, value] pairs. - * - * The returned Seq will have identical iteration order as - * this Iterable. - * - * Example: - * - * var indexedSeq = Immutable.Seq.of('A', 'B', 'C'); - * indexedSeq.filter(v => v === 'B').toString() // Seq [ 'B' ] - * var keyedSeq = indexedSeq.toKeyedSeq(); - * keyedSeq.filter(v => v === 'B').toString() // Seq { 1: 'B' } - * - */ - toKeyedSeq(): Seq.Keyed; - - /** - * Returns an Seq.Indexed of the values of this Iterable, discarding keys. - */ - toIndexedSeq(): Seq.Indexed; - - /** - * Returns a Seq.Set of the values of this Iterable, discarding keys. - */ - toSetSeq(): Seq.Set; - - - // Iterators - - /** - * An iterator of this `Iterable`'s keys. - * - * Note: this will return an ES6 iterator which does not support Immutable JS sequence algorithms. Use `keySeq` instead, if this is what you want. - */ - keys(): Iterator; - - /** - * An iterator of this `Iterable`'s values. - * - * Note: this will return an ES6 iterator which does not support Immutable JS sequence algorithms. Use `valueSeq` instead, if this is what you want. - */ - values(): Iterator; - - /** - * An iterator of this `Iterable`'s entries as `[key, value]` tuples. - * - * Note: this will return an ES6 iterator which does not support Immutable JS sequence algorithms. Use `entrySeq` instead, if this is what you want. - */ - entries(): Iterator>; - - - // Iterables (Seq) - - /** - * Returns a new Seq.Indexed of the keys of this Iterable, - * discarding values. - */ - keySeq(): Seq.Indexed; - - /** - * Returns an Seq.Indexed of the values of this Iterable, discarding keys. - */ - valueSeq(): Seq.Indexed; - - /** - * Returns a new Seq.Indexed of [key, value] tuples. - */ - entrySeq(): Seq.Indexed>; - - - // Sequence algorithms - - /** - * Returns a new Iterable of the same type with values passed through a - * `mapper` function. - * - * Seq({ a: 1, b: 2 }).map(x => 10 * x) - * // Seq { a: 10, b: 20 } - * - */ - map( - mapper: (value?: V, key?: K, iter?: /*this*/Iterable) => M, - context?: any - ): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type with only the entries for which - * the `predicate` function returns true. - * - * Seq({a:1,b:2,c:3,d:4}).filter(x => x % 2 === 0) - * // Seq { b: 2, d: 4 } - * - */ - filter( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any - ): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type with only the entries for which - * the `predicate` function returns false. - * - * Seq({a:1,b:2,c:3,d:4}).filterNot(x => x % 2 === 0) - * // Seq { a: 1, c: 3 } - * - */ - filterNot( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any - ): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type in reverse order. - */ - reverse(): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type which includes the same entries, - * stably sorted by using a `comparator`. - * - * If a `comparator` is not provided, a default comparator uses `<` and `>`. - * - * `comparator(valueA, valueB)`: - * - * * Returns `0` if the elements should not be swapped. - * * Returns `-1` (or any negative number) if `valueA` comes before `valueB` - * * Returns `1` (or any positive number) if `valueA` comes after `valueB` - * * Is pure, i.e. it must always return the same value for the same pair - * of values. - * - * When sorting collections which have no defined order, their ordered - * equivalents will be returned. e.g. `map.sort()` returns OrderedMap. - */ - sort(comparator?: (valueA: V, valueB: V) => number): /*this*/Iterable; - - /** - * Like `sort`, but also accepts a `comparatorValueMapper` which allows for - * sorting by more sophisticated means: - * - * hitters.sortBy(hitter => hitter.avgHits); - * - */ - sortBy( - comparatorValueMapper: (value?: V, key?: K, iter?: /*this*/Iterable) => C, - comparator?: (valueA: C, valueB: C) => number - ): /*this*/Iterable; - - /** - * Returns a `Iterable.Keyed` of `Iterable.Keyeds`, grouped by the return - * value of the `grouper` function. - * - * Note: This is always an eager operation. - */ - groupBy( - grouper: (value?: V, key?: K, iter?: /*this*/Iterable) => G, - context?: any - ): /*Map*/Seq.Keyed>; - - - // Side effects - - /** - * The `sideEffect` is executed for every entry in the Iterable. - * - * Unlike `Array#forEach`, if any call of `sideEffect` returns - * `false`, the iteration will stop. Returns the number of entries iterated - * (including the last iteration which returned false). - */ - forEach( - sideEffect: (value?: V, key?: K, iter?: /*this*/Iterable) => any, - context?: any - ): number; - - - // Creating subsets - - /** - * Returns a new Iterable of the same type representing a portion of this - * Iterable from start up to but not including end. - * - * If begin is negative, it is offset from the end of the Iterable. e.g. - * `slice(-2)` returns a Iterable of the last two entries. If it is not - * provided the new Iterable will begin at the beginning of this Iterable. - * - * If end is negative, it is offset from the end of the Iterable. e.g. - * `slice(0, -1)` returns an Iterable of everything but the last entry. If - * it is not provided, the new Iterable will continue through the end of - * this Iterable. - * - * If the requested slice is equivalent to the current Iterable, then it - * will return itself. - */ - slice(begin?: number, end?: number): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type containing all entries except - * the first. - */ - rest(): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type containing all entries except - * the last. - */ - butLast(): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type which excludes the first `amount` - * entries from this Iterable. - */ - skip(amount: number): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type which excludes the last `amount` - * entries from this Iterable. - */ - skipLast(amount: number): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type which includes entries starting - * from when `predicate` first returns false. - * - * Seq.of('dog','frog','cat','hat','god') - * .skipWhile(x => x.match(/g/)) - * // Seq [ 'cat', 'hat', 'god' ] - * - */ - skipWhile( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any - ): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type which includes entries starting - * from when `predicate` first returns true. - * - * Seq.of('dog','frog','cat','hat','god') - * .skipUntil(x => x.match(/hat/)) - * // Seq [ 'hat', 'god' ] - * - */ - skipUntil( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any - ): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type which includes the first `amount` - * entries from this Iterable. - */ - take(amount: number): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type which includes the last `amount` - * entries from this Iterable. - */ - takeLast(amount: number): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type which includes entries from this - * Iterable as long as the `predicate` returns true. - * - * Seq.of('dog','frog','cat','hat','god') - * .takeWhile(x => x.match(/o/)) - * // Seq [ 'dog', 'frog' ] - * - */ - takeWhile( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any - ): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type which includes entries from this - * Iterable as long as the `predicate` returns false. - * - * Seq.of('dog','frog','cat','hat','god').takeUntil(x => x.match(/at/)) - * // ['dog', 'frog'] - * - */ - takeUntil( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any - ): /*this*/Iterable; - - - // Combination - - /** - * Returns a new Iterable of the same type with other values and - * iterable-like concatenated to this one. - * - * For Seqs, all entries will be present in - * the resulting iterable, even if they have the same key. - */ - concat(...valuesOrIterables: /*Array|V*/any[]): /*this*/Iterable; - - /** - * Flattens nested Iterables. - * - * Will deeply flatten the Iterable by default, returning an Iterable of the - * same type, but a `depth` can be provided in the form of a number or - * boolean (where true means to shallowly flatten one level). A depth of 0 - * (or shallow: false) will deeply flatten. - * - * Flattens only others Iterable, not Arrays or Objects. - * - * Note: `flatten(true)` operates on Iterable> and - * returns Iterable - */ - flatten(depth?: number): /*this*/Iterable; - flatten(shallow?: boolean): /*this*/Iterable; - - /** - * Flat-maps the Iterable, returning an Iterable of the same type. - * - * Similar to `iter.map(...).flatten(true)`. - */ - flatMap( - mapper: (value?: V, key?: K, iter?: /*this*/Iterable) => Iterable, - context?: any - ): /*this*/Iterable; - flatMap( - mapper: (value?: V, key?: K, iter?: /*this*/Iterable) => /*iterable-like*/any, - context?: any - ): /*this*/Iterable; - - - // Reducing a value - - /** - * Reduces the Iterable to a value by calling the `reducer` for every entry - * in the Iterable and passing along the reduced value. - * - * If `initialReduction` is not provided, or is null, the first item in the - * Iterable will be used. - * - * @see `Array#reduce`. - */ - reduce( - reducer: (reduction?: R, value?: V, key?: K, iter?: /*this*/Iterable) => R, - initialReduction?: R, - context?: any - ): R; - - /** - * Reduces the Iterable in reverse (from the right side). - * - * Note: Similar to this.reverse().reduce(), and provided for parity - * with `Array#reduceRight`. - */ - reduceRight( - reducer: (reduction?: R, value?: V, key?: K, iter?: /*this*/Iterable) => R, - initialReduction?: R, - context?: any - ): R; - - /** - * True if `predicate` returns true for all entries in the Iterable. - */ - every( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any - ): boolean; - - /** - * True if `predicate` returns true for any entry in the Iterable. - */ - some( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any - ): boolean; - - /** - * Joins values together as a string, inserting a separator between each. - * The default separator is `","`. - */ - join(separator?: string): string; - - /** - * Returns true if this Iterable includes no values. - * - * For some lazy `Seq`, `isEmpty` might need to iterate to determine - * emptiness. At most one iteration will occur. - */ - isEmpty(): boolean; - - /** - * Returns the size of this Iterable. - * - * Regardless of if this Iterable can describe its size lazily (some Seqs - * cannot), this method will always return the correct size. E.g. it - * evaluates a lazy `Seq` if necessary. - * - * If `predicate` is provided, then this returns the count of entries in the - * Iterable for which the `predicate` returns true. - */ - count(): number; - count( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any - ): number; - - /** - * Returns a `Seq.Keyed` of counts, grouped by the return value of - * the `grouper` function. - * - * Note: This is not a lazy operation. - */ - countBy( - grouper: (value?: V, key?: K, iter?: /*this*/Iterable) => G, - context?: any - ): Map; - - - // Search for value - - /** - * Returns the first value for which the `predicate` returns true. - */ - find( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any, - notSetValue?: V - ): V; - - /** - * Returns the last value for which the `predicate` returns true. - * - * Note: `predicate` will be called for each entry in reverse. - */ - findLast( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any, - notSetValue?: V - ): V; - - /** - * Returns the first [key, value] entry for which the `predicate` returns true. - */ - findEntry( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any, - notSetValue?: V - ): /*[K, V]*/Array; - - /** - * Returns the last [key, value] entry for which the `predicate` - * returns true. - * - * Note: `predicate` will be called for each entry in reverse. - */ - findLastEntry( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any, - notSetValue?: V - ): /*[K, V]*/Array; - - /** - * Returns the key for which the `predicate` returns true. - */ - findKey( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable.Keyed) => boolean, - context?: any - ): K; - - /** - * Returns the last key for which the `predicate` returns true. - * - * Note: `predicate` will be called for each entry in reverse. - */ - findLastKey( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable.Keyed) => boolean, - context?: any - ): K; - - /** - * Returns the key associated with the search value, or undefined. - */ - keyOf(searchValue: V): K; - - /** - * Returns the last key associated with the search value, or undefined. - */ - lastKeyOf(searchValue: V): K; - - /** - * Returns the maximum value in this collection. If any values are - * comparatively equivalent, the first one found will be returned. - * - * The `comparator` is used in the same way as `Iterable#sort`. If it is not - * provided, the default comparator is `>`. - * - * When two values are considered equivalent, the first encountered will be - * returned. Otherwise, `max` will operate independent of the order of input - * as long as the comparator is commutative. The default comparator `>` is - * commutative *only* when types do not differ. - * - * If `comparator` returns 0 and either value is NaN, undefined, or null, - * that value will be returned. - */ - max(comparator?: (valueA: V, valueB: V) => number): V; - - /** - * Like `max`, but also accepts a `comparatorValueMapper` which allows for - * comparing by more sophisticated means: - * - * hitters.maxBy(hitter => hitter.avgHits); - * - */ - maxBy( - comparatorValueMapper: (value?: V, key?: K, iter?: /*this*/Iterable) => C, - comparator?: (valueA: C, valueB: C) => number - ): V; - - /** - * Returns the minimum value in this collection. If any values are - * comparatively equivalent, the first one found will be returned. - * - * The `comparator` is used in the same way as `Iterable#sort`. If it is not - * provided, the default comparator is `<`. - * - * When two values are considered equivalent, the first encountered will be - * returned. Otherwise, `min` will operate independent of the order of input - * as long as the comparator is commutative. The default comparator `<` is - * commutative *only* when types do not differ. - * - * If `comparator` returns 0 and either value is NaN, undefined, or null, - * that value will be returned. - */ - min(comparator?: (valueA: V, valueB: V) => number): V; - - /** - * Like `min`, but also accepts a `comparatorValueMapper` which allows for - * comparing by more sophisticated means: - * - * hitters.minBy(hitter => hitter.avgHits); - * - */ - minBy( - comparatorValueMapper: (value?: V, key?: K, iter?: /*this*/Iterable) => C, - comparator?: (valueA: C, valueB: C) => number - ): V; - - - // Comparison - - /** - * True if `iter` includes every value in this Iterable. - */ - isSubset(iter: Iterable): boolean; - isSubset(iter: Array): boolean; - - /** - * True if this Iterable includes every value in `iter`. - */ - isSuperset(iter: Iterable): boolean; - isSuperset(iter: Array): boolean; - - - /** - * Note: this is here as a convenience to work around an issue with - * TypeScript https://github.com/Microsoft/TypeScript/issues/285, but - * Iterable does not define `size`, instead `Seq` defines `size` as - * nullable number, and `Collection` defines `size` as always a number. - * - * @ignore - */ - size: number; - } - - - /** - * Collection is the abstract base class for concrete data structures. It - * cannot be constructed directly. - * - * Implementations should extend one of the subclasses, `Collection.Keyed`, - * `Collection.Indexed`, or `Collection.Set`. - */ - export module Collection { - - - /** - * `Collection` which represents key-value pairs. - */ - export module Keyed {} - - export interface Keyed extends Collection, Iterable.Keyed { - - /** - * Returns Seq.Keyed. - * @override - */ - toSeq(): Seq.Keyed; - } - - - /** - * `Collection` which represents ordered indexed values. - */ - export module Indexed {} - - export interface Indexed extends Collection, Iterable.Indexed { - - /** - * Returns Seq.Indexed. - * @override - */ - toSeq(): Seq.Indexed; - } - - - /** - * `Collection` which represents values, unassociated with keys or indices. - * - * `Collection.Set` implementations should guarantee value uniqueness. - */ - export module Set {} - - export interface Set extends Collection, Iterable.Set { - - /** - * Returns Seq.Set. - * @override - */ - toSeq(): Seq.Set; - } - - } - - export interface Collection extends Iterable { - - /** - * All collections maintain their current `size` as an integer. - */ - size: number; - } - - - /** - * ES6 Iterator. - * - * This is not part of the Immutable library, but a common interface used by - * many types in ES6 JavaScript. - * - * @ignore - */ - export interface Iterator { - next(): { value: T; done: boolean; } - } - -} - -declare module "immutable" { - export = Immutable -} diff --git a/type-definitions/flow-tests/.flowconfig b/type-definitions/flow-tests/.flowconfig new file mode 100644 index 0000000000..8bacb74638 --- /dev/null +++ b/type-definitions/flow-tests/.flowconfig @@ -0,0 +1,9 @@ +[include] +../../ + +[options] +module.name_mapper='^immutable$' -> '../../type-definitions/immutable.js.flow' + +[ignore] +💩 Only interested in testing these files directly in this repo. +.*/node_modules/.* diff --git a/type-definitions/flow-tests/covariance.js b/type-definitions/flow-tests/covariance.js new file mode 100644 index 0000000000..6f325f4bae --- /dev/null +++ b/type-definitions/flow-tests/covariance.js @@ -0,0 +1,55 @@ +//@flow + +import { List, Map, Set, Stack, OrderedMap, OrderedSet } from 'immutable'; + +class A { + x: number; +} +class B extends A { + y: string; +} +class C { + z: string; +} + +// List covariance +declare var listOfB: List; +var listOfA: List = listOfB; +listOfA = List([new B()]); +// $FlowExpectedError[incompatible-type-arg] +var listOfC: List = listOfB; + +// Map covariance +declare var mapOfB: Map; +var mapOfA: Map = mapOfB; +mapOfA = Map({ b: new B() }); +// $FlowExpectedError[incompatible-type-arg] +var mapOfC: Map = mapOfB; + +// Set covariance +declare var setOfB: Set; +var setOfA: Set = setOfB; +setOfA = Set([new B()]); +// $FlowExpectedError[incompatible-type-arg] +var setOfC: Set = setOfB; + +// Stack covariance +declare var stackOfB: Stack; +var stackOfA: Stack = stackOfB; +stackOfA = Stack([new B()]); +// $FlowExpectedError[incompatible-type-arg] +var stackOfC: Stack = stackOfB; + +// OrderedMap covariance +declare var orderedMapOfB: OrderedMap; +var orderedMapOfA: OrderedMap = orderedMapOfB; +orderedMapOfA = OrderedMap({ b: new B() }); +// $FlowExpectedError[incompatible-type-arg] +var orderedMapOfC: OrderedMap = orderedMapOfB; + +// OrderedSet covariance +declare var orderedSetOfB: OrderedSet; +var orderedSetOfA: OrderedSet = orderedSetOfB; +orderedSetOfA = OrderedSet([new B()]); +// $FlowExpectedError[incompatible-type-arg] +var orderedSetOfC: OrderedSet = orderedSetOfB; diff --git a/type-definitions/flow-tests/es6-collections.js b/type-definitions/flow-tests/es6-collections.js new file mode 100644 index 0000000000..a763d6bf75 --- /dev/null +++ b/type-definitions/flow-tests/es6-collections.js @@ -0,0 +1,15 @@ +// @flow + +import { Map as ImmutableMap, Set as ImmutableSet } from 'immutable'; + +// Immutable.js collections +var mapImmutable: ImmutableMap = ImmutableMap(); +var setImmutable: ImmutableSet = ImmutableSet(); +var deleteResultImmutable: ImmutableMap = mapImmutable.delete( + 'foo' +); + +// ES6 collections +var mapES6: Map = new Map(); +var setES6: Set = new Set(); +var deleteResultES6: boolean = mapES6.delete('foo'); diff --git a/type-definitions/flow-tests/immutable-flow.js b/type-definitions/flow-tests/immutable-flow.js new file mode 100644 index 0000000000..c203962052 --- /dev/null +++ b/type-definitions/flow-tests/immutable-flow.js @@ -0,0 +1,1341 @@ +// @flow +// Some tests look like they are repeated in order to avoid false positives. +// Flow might not complain about an instance of (what it thinks is) T to be assigned to T + +import Immutable, { + List, + Map, + Stack, + Set, + Seq, + Range, + Repeat, + Record, + OrderedMap, + OrderedSet, + get, + getIn, + has, + hasIn, + merge, + mergeDeep, + mergeWith, + mergeDeepWith, + remove, + removeIn, + set, + setIn, + update, + updateIn, +} from 'immutable'; +import * as Immutable2 from 'immutable'; + +import type { + KeyedCollection, + IndexedCollection, + SetCollection, + KeyedSeq, + IndexedSeq, + SetSeq, + RecordFactory, + RecordOf, +} from 'immutable'; + +/** + * Although this looks like dead code, importing `Immutable` and + * `Immutable2` tests: + * + * 1. that default import works -- `import Immutable, {...} from 'immutable' + * 2. that importing everything works -- `import * as X from 'immutable'` + * 3. that individual imports are supported + */ +const ImmutableList = Immutable.List; +const ImmutableMap = Immutable.Map; +const ImmutableStack = Immutable.Stack; +const ImmutableSet = Immutable.Set; +const ImmutableKeyedCollection: KeyedCollection< + *, + * +> = Immutable.Collection.Keyed(); +const ImmutableRange = Immutable.Range; +const ImmutableRepeat = Immutable.Repeat; +const ImmutableIndexedSeq: IndexedSeq<*> = Immutable.Seq.Indexed(); + +const Immutable2List = Immutable2.List; +const Immutable2Map = Immutable2.Map; +const Immutable2Stack = Immutable2.Stack; +const Immutable2Set = Immutable2.Set; +const Immutable2KeyedCollection: Immutable2.KeyedCollection< + *, + * +> = Immutable2.Collection.Keyed(); +const Immutable2Range = Immutable2.Range; +const Immutable2Repeat = Immutable2.Repeat; +const Immutable2IndexedSeq: Immutable2.IndexedSeq<*> = Immutable2.Seq.Indexed(); + +var defaultExport: List<*> = Immutable.List(); +var moduleExport: List<*> = Immutable2.List(); + +var numberList: List = List(); +var numberOrStringList: List = List(); +var nullableNumberList: List = List(); +var stringToNumber: Map = Map(); +var orderedStringToNumber: OrderedMap = OrderedMap(); +var orderedStringToString: OrderedMap = OrderedMap(); +var orderedStringToNumberOrString: OrderedMap< + string, + string | number +> = OrderedMap(); +var orderedNumberToString: OrderedMap = OrderedMap(); +var orderedNumberToNumber: OrderedMap = OrderedMap(); +var stringToNumberOrString: Map = Map(); +var numberToString: Map = Map(); +var stringOrNumberToNumberOrString: Map< + string | number, + string | number +> = Map(); +var anyMap: Map = Map(); +var numberSet: Set = Set(); +var orderedStringSet: OrderedSet = OrderedSet(); +var orderedNumberSet: OrderedSet = OrderedSet(); +var orderedNumberOrStringSet: OrderedSet = OrderedSet(); +var numberOrStringSet: Set = Set(); +var stringSet: Set = Set(); +var numberStack: Stack = Stack(); +var numberOrStringStack: Stack = Stack(); +var number: number = 0; +var stringToNumberCollection: KeyedCollection = stringToNumber; +var numberToStringCollection: KeyedCollection = numberToString; +var partitions: [List, List]; + +numberList = List([1, 2]); +var numberListSize: number = numberList.size; +numberOrStringList = List(['a', 1]); +// $FlowExpectedError[incompatible-call] +numberList = List(['a', 'b']); + +numberList = List.of(1, 2); +numberOrStringList = List.of('a', 1); +// $FlowExpectedError[incompatible-call] +numberList = List.of('a', 1); + +numberList = List().set(0, 0); +numberOrStringList = List.of(0).set(1, 'a'); +// $FlowExpectedError[incompatible-call] +numberList = List().set(0, 'a'); + +numberList = List.of(1, 2, 3); +// $FlowExpectedError[incompatible-type] +var item: number = numberList.get(4); +var nullableItem: ?number = numberList.get(4); +var itemOrDefault: number = numberList.get(4, 10); + +// $FlowExpectedError[incompatible-type] +var item: number = numberList.first(); +// $FlowExpectedError[incompatible-type] +var func: () => number = () => numberList.first(); + +// $FlowExpectedError[incompatible-type] +var item: number = numberList.last(); +// $FlowExpectedError[incompatible-type] +var func: () => number = () => numberList.last(); + +numberList = List().insert(0, 0); +numberOrStringList = List.of(0).insert(1, 'a'); +// $FlowExpectedError[incompatible-call] +numberList = List().insert(0, 'a'); + +numberList = List().push(1, 1); +numberOrStringList = List().push(1, 'a'); +// $FlowExpectedError[incompatible-call] +numberList = List().push(0, 'a'); + +numberList = List().unshift(1, 1); +numberOrStringList = List().unshift(1, 'a'); +// $FlowExpectedError[incompatible-call] +numberList = List().unshift(0, 'a'); + +numberList = List.of(1).delete(0); +// $FlowExpectedError[incompatible-call] +numberList = List.of('a').delete(0); + +numberList = List.of(1).remove(0); +// $FlowExpectedError[incompatible-call] +numberList = List.of('a').remove(0); + +numberList = List.of(1).clear(); +// $FlowExpectedError[incompatible-call] +numberList = List.of('a').clear(); + +numberList = List.of(1).pop(); +// $FlowExpectedError[incompatible-call] +numberList = List.of('a').pop(); + +numberList = List.of(1).shift(); +// $FlowExpectedError[incompatible-call] +numberList = List.of('a').shift(); + +numberList = List.of('a').update((value) => List.of(1)); +// $FlowExpectedError[incompatible-call] +numberList = List.of(1).update((value) => List.of('a')); + +numberOrStringList = List.of('a').update(0, (value) => 1); +// $FlowExpectedError[incompatible-call] +numberList = List.of(1).update(0, (value) => 'a'); + +numberOrStringList = List.of(1).update(1, 0, (value) => 'a'); +// $FlowExpectedError[incompatible-call] +numberList = List.of(1).update(1, 0, (value) => 'a'); + +numberList = List.of(1).merge(List.of(2)); +numberOrStringList = List.of('a').merge(List.of(1)); +// $FlowExpectedError[incompatible-call] +numberList = List.of('a').merge(List.of(1)); + +// Functional API + +numberList = merge(List([1]), List([2])); +numberOrStringList = merge>(List(['a']), List([1])); +// $FlowExpectedError[incompatible-call] +numberList = merge(List(['a']), List([1])); + +nullableNumberList = List.of(1).setSize(2); + +// $FlowExpectedError[incompatible-type] setIn [] replaces the top-most value. number ~> List +numberList = List([1]).setIn([], 0); +{ + const x: number = List([1]).setIn([], 0); +} +// $FlowExpectedError[incompatible-call] "a" is not a valid key for List. +numberList = List([1]).setIn(['a'], 0); +// $FlowExpectedError[incompatible-type-arg] "a" is not a valid value for List of number. +numberList = List([1]).setIn([0], 'a'); +numberList = List([1]).setIn([0], 0); + +// $FlowExpectedError[incompatible-call] "a" is not a valid key for List. +List([List([List([1])])]).setIn([0, 0, 'a'], 'a'); +// $FlowExpectedError[incompatible-call] "a" is not a valid value for List of number. +List([List([List([1])])]).setIn([0, 0, 0], 'a'); +List([List([List([1])])]).setIn([0, 0, 0], 123); + +// $FlowExpectedError[incompatible-type] deleteIn [] replaces the top-most value. void ~> List +numberList = List([1]).deleteIn([]); +{ + const x: void = List([1]).deleteIn([]); +} +// $FlowExpectedError[incompatible-type] +numberList = List([1]).removeIn([]); +// $FlowExpectedError[incompatible-call] "a" is not a valid key for List. +numberList = List([1]).deleteIn(['a']); +// $FlowExpectedError[incompatible-call] +numberList = List([1]).removeIn(['a']); +numberList = List([1]).deleteIn([0]); +numberList = List([1]).removeIn([0]); + +// Functional API + +// $FlowExpectedError[incompatible-type] deleteIn [] replaces the top-most value. void ~> List +numberList = removeIn(List([1]), []); +{ + const x: void = removeIn(List([1]), []); +} +// $FlowExpectedError[incompatible-call] "a" is not a valid key for List. +numberList = removeIn(List([1]), ['a']); +numberList = removeIn(List([1]), [0]); + +// $FlowExpectedError[incompatible-type] updateIn [] replaces the top-most value. number ~> List +numberList = List([1]).updateIn([], () => 123); +{ + const x: number = List([1]).updateIn([], () => 123); +} +// $FlowExpectedError[incompatible-call] - 'a' is not a number +numberList = List([1]).updateIn([0], (val) => 'a'); +// $FlowExpectedError[incompatible-call] +numberList = List([1]).updateIn([0], 0, (val) => 'a'); +// $FlowExpectedError[incompatible-call] - 'a' in an invalid argument +numberList = List([1]).updateIn([0], 'a'); +// $FlowExpectedError[incompatible-call] +numberList = List([1]).updateIn([0], 0, 'a'); +numberList = List([1]).updateIn([0], (val) => val + 1); +numberList = List([1]).updateIn([0], 0, (val) => val + 1); + +numberList = List.of(1).mergeIn([], []); +numberList = List.of(1).mergeDeepIn([], []); + +numberList = List.of(1).withMutations((mutable) => mutable); + +numberList = List.of(1).asMutable(); +numberList = List.of(1).asImmutable(); + +numberList = List.of(1).map((value, index, iter) => 1); +// $FlowExpectedError[incompatible-call] +numberList = List.of(1).map((value, index, iter) => 'a'); + +numberList = List.of(1).flatMap((value, index, iter) => [1]); +// $FlowExpectedError[incompatible-call] +numberList = List.of(1).flatMap((value, index, iter) => ['a']); + +numberList = List.of(1).flatten(); + +// Specific type for filter(Boolean) which removes nullability. +numberList = nullableNumberList.filter(Boolean); + +partitions = List([1,2,3]).partition(value => value % 2); + +/* Map */ + +stringToNumber = Map(); +let stringToNumberSize: number = stringToNumber.size; +stringToNumberOrString = Map(); +numberToString = Map(); + +stringToNumber = Map({ a: 1 }); +// $FlowExpectedError[incompatible-type-arg] +stringToNumber = Map({ a: 'a' }); + +stringToNumber = Map([['a', 1]]); +stringToNumber = Map(List([['a', 1]])); +// $FlowExpectedError[incompatible-call] +stringToNumber = Map([['a', 'b']]); +// $FlowExpectedError[incompatible-call] -- this is actually a Map +stringToNumber = Map(List([['a', 'a']])); +// $FlowFixMe[incompatible-call] - This is Iterable>, ideally it could be interpreted as Iterable<[string, string]> +stringToNumber = Map(List([List(['a', 'a'])])); + +stringOrNumberToNumberOrString = Map({ a: 'a' }).set('b', 1).set(2, 'c'); +// $FlowExpectedError[incompatible-call] +stringToNumber = Map({ a: 0 }).set('b', ''); +// $FlowExpectedError[incompatible-call] +stringToNumber = Map().set(1, ''); + +// Functional API + +stringToNumber = set(set(Map({ a: 0 }), 'b', 1), 'c', 2); +// $FlowExpectedError[incompatible-call] - Functional API currently requires arguments to have the same value types. +stringOrNumberToNumberOrString = set(set(Map({ a: 'a' }), 'b', 1), 2, 'c'); +// $FlowExpectedError[incompatible-call] +stringToNumber = set(Map({ a: 0 }), 'b', ''); +// $FlowExpectedError[incompatible-call] +stringToNumber = set(Map(), 1, ''); + +stringToNumber = Map({ a: 0 }).delete('a'); +stringToNumber = Map({ a: 0 }).remove('a'); +// $FlowExpectedError[incompatible-type-arg] +stringToNumber = Map({ a: 0 }).delete(1); +// $FlowExpectedError[incompatible-type-arg] +stringToNumber = Map({ a: 0 }).remove(1); + +stringToNumber = Map({ a: 0 }).deleteAll(['a']); +stringToNumber = Map({ a: 0 }).removeAll(['a']); +// $FlowExpectedError[prop-missing] +stringToNumber = Map({ a: 0 }).deleteAll(1); +// $FlowExpectedError[incompatible-type-arg] +stringToNumber = Map({ a: 0 }).deleteAll([1]); +// $FlowExpectedError[incompatible-type-arg] +stringToNumber = Map({ a: 0 }).removeAll([1]); + +stringToNumber = Map({ a: 0 }).clear(); + +stringToNumber = Map({ a: 1 }).update((value) => Map({ a: 1 })); +// $FlowExpectedError[incompatible-type-arg] +stringToNumber = Map({ a: 1 }).update((value) => Map({ '1': 'a' })); + +stringToNumberOrString = Map({ a: 1 }).update('a', (value) => 'a'); +// $FlowExpectedError[incompatible-call] +stringToNumber = Map({ a: 1 }).update('a', (value) => 'a'); + +stringToNumberOrString = Map({ a: 1 }).update('a', 'b', (value) => 'a'); +// $FlowExpectedError[incompatible-type-arg] +// $FlowExpectedError[incompatible-call] +stringToNumber = Map({ a: 1 }).update('a', 'b', (value) => 'a'); +// $FlowExpectedError[incompatible-type-arg] +stringToNumberOrString = Map({ a: 1 }).merge({ a: { a: '1' } }); +// $FlowExpectedError[incompatible-type-arg] +stringToNumberOrString = Map({ a: 1 }).update('a', 'b', (value) => { + a: '1'; +}); + +stringToNumber = Map({ a: 1 }).merge(Map({ a: 1 })); +stringToNumberOrString = Map({ a: 1 }).merge({ a: 'b' }); +// $FlowExpectedError[incompatible-type-arg] +stringToNumber = Map({ a: 1 }).merge({ a: 'b' }); +// $FlowExpectedError[incompatible-call] +stringToNumber = Map({ a: 1 }).merge([[1, 'a']]); +// $FlowExpectedError[incompatible-type-arg] +stringToNumber = Map({ a: 1 }).merge(numberToString); + +// Functional API +stringToNumber = merge(Map({ a: 1 }), Map({ a: 1 })); +// $FlowExpectedError[incompatible-call] - Functional API currently requires arguments to have the same value types. +stringToNumberOrString = merge(Map({ a: 1 }), { a: 'b' }); +// $FlowExpectedError[incompatible-call] +stringToNumber = merge(Map({ a: 1 }), { a: 'b' }); +// $FlowExpectedError[incompatible-call] +stringToNumber = merge(Map({ a: 1 }), [[1, 'a']]); +// $FlowExpectedError[incompatible-call] +stringToNumber = merge(Map({ a: 1 }), numberToString); + +stringToNumber = Map({ a: 1 }).mergeWith((previous, next, key) => 1, { + a: 2, + b: 2, +}); +stringToNumber = Map({ a: 1 }).mergeWith( + // $FlowExpectedError[incompatible-call] + (previous, next, key) => previous + next, + // $FlowExpectedError[incompatible-type-arg] + { a: '2', b: '2' } +); +stringToNumberOrString = Map({ a: 1 }).mergeWith( + (previous, next, key) => previous + next, + { a: '2', b: '2' } +); +// $FlowExpectedError[incompatible-call] - the array [1] is not a valid argument +stringToNumber = Map({ a: 1 }).mergeWith((previous, next, key) => 1, [1]); + +stringToNumberOrString = Map({ a: 1 }).mergeDeep({ a: 'b' }); +// $FlowExpectedError[incompatible-type-arg] +stringToNumber = Map({ a: 1 }).mergeDeep({ a: 'b' }); + +stringToNumber = Map({ a: 1 }).mergeDeepWith((previous, next, key) => 1, { + a: 2, + b: 2, +}); +stringToNumber = Map({ a: 1 }).mergeDeepWith( + (previous, next, key) => 1, + // $FlowExpectedError[incompatible-type-arg] + { a: '2', b: '2' } +); +stringToNumberOrString = Map({ a: 1 }).mergeDeepWith( + (previous, next, key) => 1, + { a: '2', b: '2' } +); +// $FlowExpectedError[incompatible-call] - the array [1] is not a valid argument +stringToNumber = Map({ a: 1 }).mergeDeepWith((previous, next, key) => 1, [1]); + +// KeyedSeq can merge into Map +var stringToStringSeq: KeyedSeq = Seq({ b: 'B' }); +stringToNumberOrString = Map({ a: 1 }).merge(stringToStringSeq); + +// $FlowExpectedError[incompatible-type] +stringToNumber = Map({ a: 1 }).setIn([], 0); +// $FlowExpectedError[incompatible-type-arg] +stringToNumber = Map({ a: 1 }).setIn(['a'], 'a'); +stringToNumber = Map({ a: 1 }).setIn(['a'], 0); + +// $FlowExpectedError[incompatible-type] +stringToNumber = Map({ a: 1 }).deleteIn([]); +// $FlowExpectedError[incompatible-type] +stringToNumber = Map({ a: 1 }).removeIn([]); +stringToNumber = Map({ a: 1 }).deleteIn(['a']); +stringToNumber = Map({ a: 1 }).removeIn(['a']); + +// $FlowExpectedError[incompatible-type] +Map({ a: 1 }).updateIn([], (v) => v + 1); +// $FlowExpectedError[incompatible-call] +stringToNumber = Map({ a: 1 }).updateIn(['a'], (v) => 'a'); +stringToNumber = Map({ a: 1 }).updateIn(['a'], (v) => v + 1); +stringToNumber = Map({ a: 1 }).updateIn(['a'], 0, (v) => v + 1); + +Map({ x: Map({ y: Map({ z: 1 }) }) }).updateIn(['x', 'y', 'z'], (v) => v + 1); +Map({ x: Map({ y: Map({ z: 1 }) }) }).updateIn( + ['x', 'y', 'z'], + 0, + (v) => v + 1 +); + +// $FlowExpectedError[incompatible-call] +Map({ x: Map({ y: Map({ z: 1 }) }) }).updateIn(['x', 'y', 1], (v) => v + 1); +// $FlowExpectedError[incompatible-call] +Map({ x: Map({ y: Map({ z: 1 }) }) }).updateIn(['x', 'y', 'z'], (v) => 'a'); + +stringToNumber = Map({ a: 1 }).mergeIn([], []); +stringToNumber = Map({ a: 1 }).mergeDeepIn([], []); + +anyMap = Map({ a: {} }).mergeIn(['a'], Map({ b: 2 })); +anyMap = Map({ a: {} }).mergeDeepIn(['a'], Map({ b: 2 })); +anyMap = Map({ a: {} }).mergeIn(['a'], List([1, 2])); +anyMap = Map({ a: {} }).mergeDeepIn(['a'], List([1, 2])); +anyMap = Map({ a: {} }).mergeIn(['a'], { b: 2 }); +anyMap = Map({ a: {} }).mergeDeepIn(['a'], { b: 2 }); +// $FlowExpectedError[incompatible-call]: not iterable / object +anyMap = Map({ a: {} }).mergeIn(['a'], 1); +// $FlowExpectedError[incompatible-call]: not iterable / object +anyMap = Map({ a: {} }).mergeDeepIn(['a'], 1); +// $FlowExpectedError[incompatible-type-arg]: bad key type +stringToNumber = Map({ a: {} }).mergeIn([1], { b: 2 }); +// $FlowExpectedError[incompatible-type-arg]: bad key type +stringToNumber = Map({ a: {} }).mergeDeepIn([1], { b: 2 }); + +stringToNumber = Map({ a: 1 }).withMutations((mutable) => mutable); + +stringToNumber = Map({ a: 1 }).asMutable(); +stringToNumber = Map({ a: 1 }).asImmutable(); + +stringToNumber = Map({ a: 1 }).map((value, index, iter) => 1); +// $FlowExpectedError[incompatible-call] +stringToNumber = Map({ a: 1 }).map((value, index, iter) => 'a'); + +stringToNumber = Map({ a: 1 }).flatMap((value, index, iter) => [['b', 1]]); +// $FlowExpectedError[incompatible-call] +stringToNumber = Map({ a: 1 }).flatMap((value, index, iter) => [['a', 'a']]); +// $FlowExpectedError[incompatible-call] +stringToNumber = Map({ a: 1 }).flatMap((value, index, iter) => Map({ a: 'a' })); + +numberToString = Map({ a: 1 }).flip(); +// $FlowExpectedError[incompatible-type-arg] +stringToNumber = Map({ a: 1 }).flip(); + +numberToString = Map({ a: 'a' }).mapKeys((key, value, iter) => 1); +// $FlowExpectedError[incompatible-type-arg] +stringToNumber = Map({ a: 1 }).mapKeys((key, value, iter) => 1); + +anyMap = Map({ a: 1 }).flatten(); + +var stringToNullableNumber = Map({ a: 1, b: null }); +// $FlowExpectedError[incompatible-type-arg] +stringToNumber = stringToNullableNumber; +// Specific type for filter(Boolean) which removes nullability. +stringToNumber = stringToNullableNumber.filter(Boolean); + +[anyMap, ] = Map({ "a": 1, "b": 2}).partition((key, index, iter) => key % 2) + +/* OrderedMap */ + +orderedStringToNumber = Map({ a: 1 }).toOrderedMap(); +// $FlowExpectedError[incompatible-type-arg] - this is actually an OrderedMap +orderedStringToNumber = Map({ a: 'b' }).toOrderedMap(); +orderedStringToString = Map({ a: 'b' }).toOrderedMap(); + +orderedStringToNumber = OrderedMap({ a: 1 }); +// $FlowExpectedError[incompatible-type-arg] - this is actually an OrderedMap +orderedStringToNumber = OrderedMap({ a: '1' }); +orderedStringToString = OrderedMap({ a: '1' }); + +orderedStringToNumber = OrderedMap(Map({ a: 1 })); +// $FlowExpectedError[incompatible-type-arg] - it's actually an OrderedMap +orderedStringToNumber = OrderedMap(Map({ a: '1' })); + +orderedStringToNumber = OrderedMap(); + +orderedStringToNumber = OrderedMap().set('b', 2); +// $FlowExpectedError[incompatible-call] - this is actually an OrderedMap +orderedStringToNumber = OrderedMap().set('b', '2'); +orderedStringToString = OrderedMap().set('b', '2'); + +orderedStringToNumber = OrderedMap({ a: 1 }).delete('a'); +orderedStringToNumber = OrderedMap({ a: 1 }).remove('a'); +orderedStringToNumber = OrderedMap({ a: 1 }).clear(); + +orderedStringToNumber = OrderedMap({ a: 1 }).update(() => OrderedMap({ b: 1 })); +/** + * TODO: the following is valid but I question if it should be valid: + * + * ``` + * const x: OrderedMap = OrderedMap({'a': 1}) + * .update(() => OrderedMap({'b': '1'})) + * ``` + * + * In the above example, `update` is changing an OrderedMap to an OrderedMap + * This seems inconsistent with the typescript signature of + * + * ``` + * update(updater: (value: Map) => Map): Map + * ``` + */ +orderedStringToNumber = OrderedMap({ a: 1 }).update(() => + // $FlowExpectedError[incompatible-type-arg] - this is actually an OrderedMap + OrderedMap({ b: '1' }) +); +orderedStringToString = OrderedMap({ a: 1 }).update(() => + OrderedMap({ b: '1' }) +); + +orderedStringToNumber = OrderedMap({ a: 1 }).update('a', (value) => value + 1); +/** + * TODO: is the below the intended functionality? The typescript signature looks like + * + * ``` + * update(key: K, updater: (value: V) => V): Map; + * ``` + * + * so it seems like in this case the updater should only be able to return numbers. + * This comment applies to all of the update / merge functions in Map and OrderedMap + */ +// $FlowExpectedError[incompatible-call] - this is actually an OrderedMap +orderedStringToNumber = OrderedMap({ a: 1 }).update('a', () => 'b'); +orderedStringToNumberOrString = OrderedMap({ a: 1 }).update('a', () => 'b'); + +orderedStringToNumber = OrderedMap({ a: 1 }).update( + 'a', + 0, + (value) => value + 1 +); +// $FlowExpectedError[incompatible-call] - this is actually an OrderedMap +orderedStringToNumber = OrderedMap({ a: 1 }).update('a', 0, () => 'b'); +orderedStringToNumberOrString = OrderedMap({ a: 1 }).update('a', 0, () => 'b'); + +orderedStringToNumber = OrderedMap({ a: 1 }).merge({ b: 2 }); +// $FlowExpectedError[incompatible-type-arg] - this is actually an OrderedMap +orderedStringToNumber = OrderedMap({ a: 1 }).merge({ b: '2' }); +orderedStringToNumberOrString = OrderedMap({ a: 1 }).merge({ b: '2' }); + +orderedStringToNumber = OrderedMap({ a: 1 }).mergeWith( + (prev, next) => next, + { a: 2, b: 3 } +); +orderedStringToNumber = OrderedMap({ a: 1 }).mergeWith( + // $FlowExpectedError[incompatible-call] + (prev, next) => next, + // $FlowExpectedError[incompatible-type-arg] - this is actually an OrderedMap + { a: '2', b: '3' } +); +orderedStringToNumberOrString = OrderedMap({ a: 1 }).mergeWith( + (prev, next) => next, + { a: '2', b: '3' } +); +// $FlowExpectedError[incompatible-call] - the array [1] is not a valid argument +orderedStringToNumber = OrderedMap({ a: 1 }).mergeWith((prev, next) => next, [ + 1, +]); + +orderedStringToNumber = OrderedMap({ a: 1 }).mergeDeep({ a: 2 }); +// $FlowExpectedError[incompatible-type-arg] - this is actually an OrderedMap +orderedStringToNumber = OrderedMap({ a: 1 }).mergeDeep({ a: '2' }); +orderedStringToNumberOrString = OrderedMap({ a: 1 }).mergeDeep({ a: '2' }); + +orderedStringToNumber = OrderedMap({ a: 1 }).mergeDeepWith( + (prev, next) => next, + { a: 2, b: 3 } +); +orderedStringToNumber = OrderedMap({ a: 1 }).mergeDeepWith( + (prev, next) => next, + // $FlowExpectedError[incompatible-type-arg] - this is actually an OrderedMap + { a: '2', b: '3' } +); +orderedStringToNumberOrString = OrderedMap({ a: 1 }).mergeDeepWith( + (prev, next) => next, + { a: '2', b: '3' } +); +orderedStringToNumber = OrderedMap({ a: 1 }).mergeDeepWith( + (prev, next) => next, + // $FlowExpectedError[incompatible-call] - the array [1] is an invalid argument + [1] +); + +// $FlowExpectedError[incompatible-type] +orderedStringToNumber = OrderedMap({ a: 1 }).setIn([], 3); +// $FlowExpectedError[incompatible-type-arg] +orderedStringToNumber = OrderedMap({ a: 1 }).setIn([1], 3); +orderedStringToNumber = OrderedMap({ a: 1 }).setIn(['a'], 3); +// $FlowExpectedError[incompatible-type] +orderedStringToNumber = OrderedMap({ a: 1 }).deleteIn([]); +// $FlowExpectedError[incompatible-type] +orderedStringToNumber = OrderedMap({ a: 1 }).removeIn([]); +// $FlowExpectedError[incompatible-type-arg] +orderedStringToNumber = OrderedMap({ a: 1 }).deleteIn([1]); +// $FlowExpectedError[incompatible-type-arg] +orderedStringToNumber = OrderedMap({ a: 1 }).removeIn([1]); +orderedStringToNumber = OrderedMap({ a: 1 }).deleteIn(['b']); +orderedStringToNumber = OrderedMap({ a: 1 }).removeIn(['b']); + +// $FlowExpectedError[incompatible-type] +orderedStringToNumber = OrderedMap({ a: 1 }).updateIn([], (v) => v + 1); +// $FlowExpectedError[incompatible-type-arg] +orderedStringToNumber = OrderedMap({ a: 1 }).updateIn([1], (v) => v + 1); +// $FlowExpectedError[incompatible-call] +orderedStringToNumber = OrderedMap({ a: 1 }).updateIn(['a'], (v) => 'a'); +orderedStringToNumber = OrderedMap({ a: 1 }).updateIn(['a'], (v) => v + 1); +orderedStringToNumber = OrderedMap({ a: 1 }).updateIn(['a'], 0, (v) => v + 1); + +// $FlowExpectedError[incompatible-call] +OrderedMap({ x: OrderedMap({ y: 1 }) }).updateIn(['x', 1], (v) => v + 1); +// $FlowExpectedError[incompatible-call] +OrderedMap({ x: OrderedMap({ y: 1 }) }).updateIn(['x', 'y'], (v) => 'a'); +OrderedMap({ x: OrderedMap({ y: 1 }) }).updateIn(['x', 'y'], (v) => v + 1); +OrderedMap({ x: OrderedMap({ y: 1 }) }).updateIn(['x', 'y'], 0, (v) => v + 1); + +orderedStringToNumber = OrderedMap({ a: 1 }).mergeIn([], { b: 2 }); +orderedStringToNumber = OrderedMap({ a: 1 }).mergeDeepIn([], { b: 2 }); +orderedStringToNumber = OrderedMap({ a: 1 }).withMutations((mutable) => + mutable.set('b', 2) +); +orderedStringToNumber = OrderedMap({ a: 1 }).asMutable(); +orderedStringToNumber = OrderedMap({ a: 1 }).asImmutable(); + +orderedStringToNumber = OrderedMap({ a: 1 }).map((v) => v + 1); +// $FlowExpectedError[incompatible-call] - this is actually an OrderedMap +orderedStringToNumber = OrderedMap({ a: 1 }).map(() => 'a'); +orderedStringToString = OrderedMap({ a: 1 }).map(() => 'a'); + +orderedStringToNumber = OrderedMap({ a: 1 }).flatMap((v, k) => + OrderedMap({ [k]: v + 1 }) +); +orderedStringToNumber = OrderedMap({ a: 1 }).flatMap((v, k) => + // $FlowExpectedError[incompatible-call] - string "a" is not a number + OrderedMap({ [k]: 'a' }) +); + +// $FlowExpectedError[incompatible-type-arg] - this is actually an OrderedMap +orderedStringToNumber = OrderedMap({ a: 1 }).flip(); +orderedNumberToString = OrderedMap({ a: 1 }).flip(); + +orderedStringToNumber = OrderedMap({ a: 1 }).mapKeys((x) => x); +// $FlowExpectedError[incompatible-type-arg] - this is actually an OrderedMap +orderedStringToNumber = OrderedMap({ a: 1 }).mapKeys((x) => 1); +orderedNumberToNumber = OrderedMap({ a: 1 }).mapKeys((x) => 1); + +orderedStringToNumber = OrderedMap({ a: 1 }).flatten(); +orderedStringToNumber = OrderedMap({ a: 1 }).flatten(1); +orderedStringToNumber = OrderedMap({ a: 1 }).flatten(true); +// $FlowExpectedError[incompatible-call] - 'a' is an invalid argument +orderedStringToNumber = OrderedMap({ a: 1 }).flatten('a'); + +/* Set */ + +numberSet = Set(); +numberOrStringSet = Set(); +stringSet = Set(); + +numberSet = Set([1, 2, 3]); +// $FlowExpectedError[incompatible-call] +numberSet = Set(['a', 'b']); + +numberSet = Set.of(1, 2); +// $FlowExpectedError[incompatible-call] +numberSet = Set.of('a', 'b'); + +numberSet = Set.fromKeys(Map().set(1, '')); +stringSet = Set.fromKeys({ a: '' }); +// $FlowExpectedError[incompatible-type-arg] +numberSet = Set.fromKeys(Map({ a: 1 })); +// $FlowExpectedError[incompatible-type-arg] +numberSet = Set.fromKeys({ a: 1 }); + +numberOrStringSet = Set([1]).add('a'); +// $FlowExpectedError[incompatible-call] +numberSet = Set([1]).add('s'); + +numberSet = Set([1]).delete(1); +// $FlowExpectedError[incompatible-call] +numberSet = Set([1]).delete('a'); +// $FlowExpectedError[incompatible-call] +numberSet = Set(['a']).delete('a'); + +numberSet = Set([1]).remove(1); +// $FlowExpectedError[incompatible-call] +numberSet = Set([1]).remove('a'); +// $FlowExpectedError[incompatible-call] +numberSet = Set(['a']).remove('a'); + +numberSet = Set([1]).clear(); +// $FlowExpectedError[incompatible-call] +numberSet = Set(['a']).clear(); + +numberOrStringSet = Set(['a']).union([1]); +numberOrStringSet = Set(['a']).union(Set([1])); +numberSet = Set([1]).union([1]); +numberSet = Set([1]).union(Set([1])); +// $FlowExpectedError[incompatible-call] +numberSet = Set([1]).union(['a']); +// $FlowExpectedError[incompatible-call] +numberSet = Set([1]).union(Set(['a'])); + +numberOrStringSet = Set(['a']).merge([1]); +numberOrStringSet = Set(['a']).merge(Set([1])); +numberSet = Set([1]).merge([1]); +numberSet = Set([1]).merge(Set([1])); +// $FlowExpectedError[incompatible-call] +numberSet = Set([1]).merge(['a']); +// $FlowExpectedError[incompatible-call] +numberSet = Set([1]).merge(Set(['a'])); + +numberSet = Set([1]).intersect(Set([1])); +numberSet = Set([1]).intersect([1]); +numberSet = Set([1]).intersect(Set(['a'])); +numberSet = Set([1]).intersect(['a']); + +numberSet = Set([1]).subtract(Set([1])); +numberSet = Set([1]).subtract([1]); +numberSet = Set([1]).subtract(Set(['a'])); +numberSet = Set([1]).subtract(['a']); + +numberSet = Set([1]).withMutations((mutable) => mutable); +// $FlowExpectedError[incompatible-call] +stringSet = Set([1]).withMutations((mutable) => mutable); + +numberSet = Set([1]).asMutable(); +// $FlowExpectedError[incompatible-call] +stringSet = Set([1]).asMutable(); + +numberSet = Set([1]).asImmutable(); +// $FlowExpectedError[incompatible-call] +stringSet = Set([1]).asImmutable(); + +stringSet = Set([1]).map((value, index, iter) => 'a'); +// $FlowExpectedError[incompatible-call] +numberSet = Set([1]).map((value, index, iter) => 'a'); + +stringSet = Set([1]).flatMap((value, index, iter) => ['a']); +// $FlowExpectedError[incompatible-call] +numberSet = Set([1]).flatMap((value, index, iter) => ['a']); + +numberSet = Set([1]).flatten(); + +/* OrderedSet */ + +orderedStringSet = Set(['a']).toOrderedSet(); +// $FlowExpectedError[incompatible-call] - this is actually an OrderedSet +orderedStringSet = Set([1]).toOrderedSet(); +orderedNumberSet = Set([1]).toOrderedSet(); + +orderedStringSet = OrderedSet(['a']); +// $FlowExpectedError[incompatible-call] - this is actually an OrderedSet +orderedStringSet = OrderedSet([1]); +orderedNumberSet = OrderedSet([1]); + +orderedStringSet = OrderedSet(List.of('a')); +// $FlowExpectedError[incompatible-call] - this is actually an OrderedSet +orderedStringSet = OrderedSet(List.of(1)); +orderedNumberSet = OrderedSet(List.of(1)); + +orderedStringSet = OrderedSet.of('a', 'b', 'c'); +// $FlowExpectedError[incompatible-call] - this is actually an OrderedSet +orderedStringSet = OrderedSet.of(1); +orderedNumberSet = OrderedSet.of(1); + +orderedStringSet = OrderedSet.fromKeys(Map({ a: 1 })); +// $FlowExpectedError[incompatible-type-arg] - this is actually an OrderedSet +orderedNumberSet = OrderedSet.fromKeys(Map({ a: 1 })); + +orderedStringSet = OrderedSet.fromKeys({ a: 1 }); +// $FlowExpectedError[incompatible-type-arg] - this is actually an OrderedSet +orderedNumberSet = OrderedSet.fromKeys({ a: 1 }); + +orderedStringSet = OrderedSet(); + +orderedStringSet = OrderedSet.of('a').add('b'); +/** + * TODO: in typescript definitions, add looks like + * + * ``` + * add(value: T): Set + * ``` + * + * so we shouldn't be able to add a number to a set of strings + */ +// $FlowExpectedError[incompatible-call] - this is actually an OrderedSet +orderedStringSet = OrderedSet('a').add(1); +orderedNumberOrStringSet = OrderedSet('a').add(1); + +orderedStringSet = OrderedSet.of('a').delete('a'); +// $FlowExpectedError[incompatible-call] - 1 is an invalid arg +orderedStringSet = OrderedSet.of('a').delete(1); + +orderedStringSet = OrderedSet.of('a').remove('a'); +// $FlowExpectedError[incompatible-call] - 1 is an invalid arg +orderedStringSet = OrderedSet.of('a').remove(1); + +orderedStringSet = OrderedSet.of('a').clear(); + +orderedStringSet = OrderedSet.of('a').union(OrderedSet.of('b')); +/** + * TODO: typescript def looks like + * + * ``` + * union(...iterables: Array[]): Set + * ``` + * + * so we shouldn't be able to merge strings and numbers + */ +// $FlowExpectedError[incompatible-call] - this is actually an OrderedSet +orderedStringSet = OrderedSet.of('a').union(OrderedSet.of(1)); +orderedNumberOrStringSet = OrderedSet.of('a').union(OrderedSet.of(1)); + +orderedStringSet = OrderedSet.of('a').merge(OrderedSet.of('b')); +/** + * TODO: typescript def looks like + * + * ``` + * merge(...iterables: Array[]): Set + * ``` + * + * so we shouldn't be able to merge strings and numbers + */ +// $FlowExpectedError[incompatible-call] - this is actually an OrderedSet +orderedStringSet = OrderedSet.of('a').merge(OrderedSet.of(1)); +orderedNumberOrStringSet = OrderedSet.of('a').merge(OrderedSet.of(1)); + +orderedStringSet = OrderedSet.of('a', 'b').intersect(OrderedSet.of('a')); +/** + * TODO: typescript def looks like + * + * ``` + * intersect(...iterables: Array[]): Set + * ``` + * + * so we shouldn't be able to intersect strings and numbers + */ +orderedStringSet = OrderedSet.of('a', 'b').intersect(OrderedSet.of(1)); + +orderedStringSet = OrderedSet.of('a', 'b').subtract(OrderedSet.of('a')); +/** + * TODO: typescript def looks like + * + * ``` + * subtract(...iterables: Array[]): Set + * ``` + * + * so we shouldn't be able to intersect strings and numbers + */ +orderedStringSet = OrderedSet.of('a', 'b').subtract(OrderedSet.of(1)); + +orderedStringSet = OrderedSet().withMutations((mutable) => mutable.add('a')); +orderedStringSet = OrderedSet.of('a').asMutable(); +orderedStringSet = OrderedSet.of('a').asImmutable(); + +orderedStringSet = OrderedSet.of('a', 'b').map((m) => m); +// $FlowExpectedError[incompatible-call] - this is an OrderedSet +orderedStringSet = OrderedSet.of('a', 'b').map(() => 1); +orderedNumberSet = OrderedSet.of('a', 'b').map(() => 1); + +orderedStringSet = OrderedSet.of('a', 'b').flatMap((m) => [m]); +// $FlowExpectedError[incompatible-call] - this is an OrderedSet +orderedStringSet = OrderedSet.of('a', 'b').flatMap((m) => [1]); +orderedNumberSet = OrderedSet.of('a', 'b').flatMap((m) => [1]); + +orderedStringSet = OrderedSet.of('a', 'b').flatten(1); +orderedStringSet = OrderedSet.of('a', 'b').flatten(false); +// $FlowExpectedError[incompatible-call] - invalid arg for flatten +orderedStringSet = OrderedSet.of('a', 'b').flatten('a'); + +/* Stack */ + +numberStack = Stack([1, 2]); +let numberStackSize: number = numberStack.size; +numberOrStringStack = Stack(['a', 1]); +// $FlowExpectedError[incompatible-call] +numberStack = Stack(['a', 'b']); + +numberStack = Stack.of(1, 2); +numberOrStringStack = Stack.of('a', 1); +// $FlowExpectedError[incompatible-call] +numberStack = Stack.of('a', 1); + +number = Stack([1]).peek(); +// $FlowExpectedError[incompatible-type] +number = Stack(['a']).peek(); + +numberStack = Stack([1]).unshift(1); +numberOrStringStack = Stack([1]).unshift('a'); +// $FlowExpectedError[incompatible-call] +numberStack = Stack([1]).unshift('a'); + +numberStack = Stack([1]).unshiftAll([1]); +numberOrStringStack = Stack([1]).unshiftAll(['a']); +// $FlowExpectedError[incompatible-call] +numberStack = Stack([1]).unshiftAll(['a']); + +numberStack = Stack.of(1).shift(); +// $FlowExpectedError[incompatible-call] +numberStack = Stack.of('a').shift(); + +numberStack = Stack().push(1); +numberOrStringStack = Stack([1]).push('a'); +// $FlowExpectedError[incompatible-call] +numberStack = Stack().push('a'); + +numberStack = Stack().pushAll([1]); +numberOrStringStack = Stack([1]).pushAll(['a']); +// $FlowExpectedError[incompatible-call] +numberStack = Stack().push(['a']); + +numberStack = Stack.of(1).pop(); +// $FlowExpectedError[incompatible-call] +numberStack = Stack.of('a').pop(); + +numberStack = Stack([1]).withMutations((mutable) => mutable); +// $FlowExpectedError[incompatible-call] +numberStack = Stack(['a']).withMutations((mutable) => mutable); + +numberStack = Stack([1]).asMutable(); +// $FlowExpectedError[incompatible-call] +numberStack = Stack(['a']).asMutable(); + +numberStack = Stack([1]).asImmutable(); +// $FlowExpectedError[incompatible-call] +numberStack = Stack(['a']).asImmutable(); + +numberStack = Stack([1]).map((value, index, iter) => 1); +// $FlowExpectedError[incompatible-call] +numberStack = Stack([1]).map((value, index, iter) => 'a'); + +numberStack = Stack([1]).flatMap((value, index, iter) => [1]); +// $FlowExpectedError[incompatible-call] +numberStack = Stack([1]).flatMap((value, index, iter) => ['a']); + +numberStack = Stack([1]).flatten(); +numberStack = Stack(['a']).flatten(); + +/* Range & Repeat */ + +// `{}` provide namespaces +{ + const numberSequence: IndexedSeq = Range(0, 0, 0); +} +{ + const numberSequence: IndexedSeq = Repeat(1, 5); +} + +{ + const stringSequence: IndexedSeq = Repeat('a', 5); +} +{ + // $FlowExpectedError[incompatible-call] + const stringSequence: IndexedSeq = Repeat(0, 1); +} +{ + // $FlowExpectedError[incompatible-type-arg] + const stringSequence: IndexedSeq = Range(0, 0, 0); +} + +/* Seq */ + +let numberSeq = Seq([1, 2, 3]); +// $FlowExpectedError[incompatible-type] +let numberSeqSize: number = numberSeq.size; +let maybeNumberSeqSize: ?number = numberSeq.size; + +/* Record */ + +type PersonRecordFields = { age: number, name: string }; +type PersonRecord = RecordOf; +const makePersonRecord: RecordFactory = Record({ + age: 900, + name: 'Yoda', +}); + +const personRecordInstance: PersonRecord = makePersonRecord({ age: 25 }); + +{ + // $FlowExpectedError[incompatible-type] + const age: string = personRecordInstance.get('age'); +} +{ + // $FlowExpectedError[incompatible-type] + const age: string = personRecordInstance.age; +} +{ + const age: number = personRecordInstance.get('age'); +} +{ + const age: number = personRecordInstance.age; +} + +// $FlowExpectedError[incompatible-call] +personRecordInstance.set('invalid', 25); +personRecordInstance.set('name', '25'); +personRecordInstance.set('age', 33); + +// FixMe: The first should be FlowExpectedError[incompatible-call], and the second two should be correct, +// however all three produce a hard to understand error because there is a bug +// with Flow's $Call utility type. +// set(personRecordInstance, 'invalid', 25) +// set(personRecordInstance, 'name', '25') +// set(personRecordInstance, 'age', 33) + +// Create a Map from a non-prototype "plain" Object +let someObj = Object.create(null); +someObj.x = 1; +someObj.y = 2; +let mapOfSomeObj: Map = Map(someObj); +// $FlowExpectedError[incompatible-call] - someObj is string -> number +let mapOfSomeObjMistake: Map = Map(someObj); + +// getIn() type + +// Deep nested +const deepData1: List> = List([Map([['apple', 'sauce']])]); +const deepNestedString1 = deepData1.getIn([0, 'apple']); +{ + // $FlowExpectedError[incompatible-type] string is not a number + const fail: ?number = deepNestedString1; +} +{ + // $FlowExpectedError[incompatible-type] getIn can return undefined + const fail: string = deepNestedString1; +} +{ + const success: ?string = deepNestedString1; +} + +const listOfListOfNumber: List> = List([List([1, 2, 3])]); +const nestedNum = listOfListOfNumber.getIn([0, 1]); +{ + // $FlowExpectedError[incompatible-type] number is not string + const fail: ?string = nestedNum; +} +{ + // $FlowExpectedError[incompatible-type] getIn can return undefined + const fail: number = nestedNum; +} +{ + const success: ?number = nestedNum; +} +// $FlowExpectedError[incompatible-call] expected a number 1st key +listOfListOfNumber.getIn(['whoops', 1]); +// $FlowExpectedError[incompatible-call] expected a number 2nd key +listOfListOfNumber.getIn([0, 'whoops']); +// $FlowExpectedError[incompatible-call] too many keys! +listOfListOfNumber.getIn([0, 0, 'whoops']); + +// Deep nested +const deepData: List>> = List([ + Map([['apple', List(['sauce'])]]), +]); +const deepNestedString = deepData.getIn([0, 'apple', 0]); +{ + // $FlowExpectedError[incompatible-type] string is not a number + const fail: ?number = deepNestedString; +} +{ + // $FlowExpectedError[incompatible-type] getIn can return undefined + const fail: string = deepNestedString; +} +{ + const success: ?string = deepNestedString; +} +// $FlowExpectedError[incompatible-call] expected a string 2nd key +deepData.getIn([0, 0, 0]); +// $FlowExpectedError[incompatible-call] expected a number 3rd key +deepData.getIn([0, 'apple', 'whoops']); + +// Containing Records +const listOfPersonRecord: List = List([personRecordInstance]); +const firstAge = listOfPersonRecord.getIn([0, 'age']); +{ + // $FlowExpectedError[incompatible-type] expected a string key + const age: string = firstAge; +} +{ + // $FlowExpectedError[incompatible-type] getIn can return undefined + const age: number = firstAge; +} +{ + const age: ?number = firstAge; +} +// $FlowExpectedError[incompatible-call] - the first key is not an index +listOfPersonRecord.getIn(['wrong', 'age']); +// $FlowExpectedError[incompatible-call] - the second key is not an record key +listOfPersonRecord.getIn([0, 'mispeld']); +// $FlowExpectedError[incompatible-call] - the second key is not an record key +listOfPersonRecord.getIn([0, 0]); +// $FlowExpectedError[incompatible-call] +listOfPersonRecord.setIn([0, 'age'], 'Thirteen'); +listOfPersonRecord.setIn([0, 'age'], 13); +// $FlowExpectedError[prop-missing] +listOfPersonRecord.updateIn([0, 'age'], (value) => value.unknownFunction()); +listOfPersonRecord.updateIn([0, 'age'], (value) => value + 1); +listOfPersonRecord.updateIn([0, 'age'], 0, (value) => value + 1); + +// Recursive Records +type PersonRecord2Fields = { name: string, friends: List }; +type PersonRecord2 = RecordOf; +const makePersonRecord2: RecordFactory = Record({ + name: 'Adam', + friends: List(), +}); +const friendly: PersonRecord2 = makePersonRecord2(); +{ + // $FlowExpectedError[incompatible-type] string is not a number + const fail: ?number = friendly.getIn(['friends', 0, 'name']); +} +// notSetValue provided +{ + const success: string = friendly.getIn(['friends', 0, 'name'], 'Abbie'); +} +{ + const success: ?string = friendly.getIn(['friends', 0, 'name']); +} + +// Functional API + +{ + // $FlowExpectedError[incompatible-type] string is not a number + const fail: ?number = getIn(friendly, ['friends', 0, 'name']); +} +// notSetValue provided +{ + const success: string = getIn(friendly, ['friends', 0, 'name'], 'Abbie'); +} +{ + const success: ?string = getIn(friendly, ['friends', 0, 'name']); +} + +// Deep nested containing recursive Records +const friendlies: List = List([makePersonRecord2()]); +{ + // $FlowExpectedError[incompatible-type] string is not a number + const fail: ?number = friendlies.getIn([0, 'friends', 0, 'name']); +} +// notSetValue provided +{ + const success: string = friendlies.getIn([0, 'friends', 0, 'name'], 'Abbie'); +} +{ + const success: ?string = friendlies.getIn([0, 'friends', 0, 'name']); +} +// $FlowExpectedError[incompatible-call] +friendlies.setIn([0, 'friends', 0, 'name'], 123); +friendlies.setIn([0, 'friends', 0, 'name'], 'Sally'); +friendlies.updateIn([0, 'friends', 0, 'name'], (value) => + // $FlowExpectedError[prop-missing] + value.unknownFunction() +); +friendlies.updateIn([0, 'friends', 0, 'name'], (value) => value.toUpperCase()); +friendlies.updateIn([0, 'friends', 0, 'name'], 'Unknown Name', (value) => + value.toUpperCase() +); + +// Nested plain JS values +type PlainPerson = { name: string, friends: Array }; +const plainFriendly: PlainPerson = { name: 'Bobbie', friends: [] }; +const plainFriendlies: List = List([plainFriendly]); + +{ + // $FlowExpectedError[incompatible-call] 'fraaands' is an unknown key in PlainPerson + const fail: ?number = plainFriendlies.getIn([0, 'fraaands', 0, 'name']); +} +{ + // $FlowExpectedError[incompatible-call] 0 is an unknown key in PlainPerson + const fail: ?number = plainFriendlies.getIn([0, 'fraaands', 0, 0]); +} +{ + // $FlowExpectedError[incompatible-type] string is not a number + const fail: ?number = plainFriendlies.getIn([0, 'friends', 0, 'name']); +} +{ + // $FlowExpectedError[incompatible-type] can return undefined + const fail: string = plainFriendlies.getIn([0, 'friends', 0, 'name']); +} +{ + const success: ?string = plainFriendlies.getIn([0, 'friends', 0, 'name']); +} + +// $FlowExpectedError[incompatible-call] number is not a string +plainFriendlies.setIn([0, 'friends', 0, 'name'], 123); +plainFriendlies.setIn([0, 'friends', 0, 'name'], 'Morgan'); + +plainFriendlies.updateIn([0, 'friends', 0, 'name'], (value) => + // $FlowExpectedError[prop-missing] value is a string, this is an unknown function + value.unknownFunction() +); +plainFriendlies.updateIn([0, 'friends', 0, 'name'], (value) => + value.toUpperCase() +); + +// $FlowExpectedError[incompatible-call] number is not a string +plainFriendlies.updateIn([0, 'friends', 0, 'name'], () => 123); +plainFriendlies.updateIn([0, 'friends', 0, 'name'], () => 'Whitney'); + +// Functional API + +{ + // $FlowExpectedError[incompatible-call] 'fraaands' is an unknown key in PlainPerson + const fail: ?number = getIn(plainFriendlies, [0, 'fraaands', 0, 'name']); +} +{ + // $FlowExpectedError[incompatible-call] 0 is an unknown key in PlainPerson + const fail: ?number = getIn(plainFriendlies, [0, 'fraaands', 0, 0]); +} +{ + // $FlowExpectedError[incompatible-type] string is not a number + const fail: ?number = getIn(plainFriendlies, [0, 'friends', 0, 'name']); +} +{ + // $FlowExpectedError[incompatible-type] can return undefined + const fail: string = getIn(plainFriendlies, [0, 'friends', 0, 'name']); +} +{ + const success: ?string = getIn(plainFriendlies, [0, 'friends', 0, 'name']); +} + +// $FlowExpectedError[incompatible-call] number is not a string +setIn(plainFriendlies, [0, 'friends', 0, 'name'], 123); +setIn(plainFriendlies, [0, 'friends', 0, 'name'], 'Morgan'); + +updateIn(plainFriendlies, [0, 'friends', 0, 'name'], (value) => + // $FlowExpectedError[prop-missing] value is a string, this is an unknown function + value.unknownFunction() +); +updateIn(plainFriendlies, [0, 'friends', 0, 'name'], (value) => + value.toUpperCase() +); + +// $FlowExpectedError[incompatible-call] number is not a string +updateIn(plainFriendlies, [0, 'friends', 0, 'name'], () => 123); +updateIn(plainFriendlies, [0, 'friends', 0, 'name'], () => 'Whitney'); + +// Plain JS values + +{ + const success: number | void = get([1, 2, 3], 0); +} +{ + const success: number | string = get([1, 2, 3], 0, 'missing'); +} +{ + // $FlowExpectedError[incompatible-call] - string is not an array index + const success: number = get([1, 2, 3], 'z'); +} +// Note: does not return null since x is known to exist in {x,y} +{ + const success: number = get({ x: 10, y: 10 }, 'x'); +} +{ + // $FlowExpectedError[incompatible-call] - z is not in {x,y} + const success: number | void = get({ x: 10, y: 10 }, 'z'); +} +{ + const objMap: { [string]: number } = { x: 10, y: 10 }; + const success: number | void = get(objMap, 'z'); +} +{ + const success: number = get({ x: 10, y: 10 }, 'x', 'missing'); +} +{ + const objMap: { [string]: number } = { x: 10, y: 10 }; + const success: number | string = get(objMap, 'z', 'missing'); +} + +// Deeply nested records + +type DeepNestFields = { + foo: number, +}; +type DeepNest = RecordOf; +const deepNest: RecordFactory = Record({ + foo: 0, +}); + +type NestFields = { + deepNest: DeepNest, +}; +type Nest = RecordOf; +const nest: RecordFactory = Record({ + deepNest: deepNest(), +}); + +type StateFields = { + nest: Nest, +}; +type State = RecordOf; +const initialState: RecordFactory = Record({ + nest: nest(), +}); + +const state = initialState(); +(state.setIn(['nest', 'deepNest', 'foo'], 5): State); +// $FlowExpectedError[incompatible-call] +(state.setIn(['nest', 'deepNest', 'foo'], 'string'): State); +// $FlowExpectedError[incompatible-call] +(state.setIn(['nest', 'deepNest', 'unknownField'], 5): State); diff --git a/type-definitions/flow-tests/merge.js b/type-definitions/flow-tests/merge.js new file mode 100644 index 0000000000..ad4cc4b21f --- /dev/null +++ b/type-definitions/flow-tests/merge.js @@ -0,0 +1,138 @@ +// @flow +import { + List, + Map, + Record, + type RecordOf, + type RecordFactory, + get, + getIn, + has, + hasIn, + merge, + mergeDeep, + mergeWith, + mergeDeepWith, + remove, + removeIn, + set, + setIn, + update, + updateIn, +} from 'immutable'; + +// merge: Objects as Maps + +type ObjMap = { [key: string]: T }; +const objMap: ObjMap = { x: 12, y: 34 }; +(merge(objMap, { x: 321 }): ObjMap); +(merge(objMap, { z: 321 }): ObjMap); +// $FlowExpectedError[incompatible-call] +(merge(objMap, { x: 'abc' }): ObjMap); +(merge(objMap, [['x', 321]]): ObjMap); +(merge(objMap, [['z', 321]]): ObjMap); +// $FlowExpectedError[incompatible-call] +(merge(objMap, [['x', 'abc']]): ObjMap); +// $FlowExpectedError[incompatible-call] +(merge(objMap, [321]): ObjMap); +(merge(objMap, Map({ x: 123 })): ObjMap); +(merge(objMap, Map({ z: 123 })): ObjMap); +(merge(objMap, Map([['x', 123]])): ObjMap); +(merge(objMap, Map([['z', 123]])): ObjMap); +// $FlowExpectedError[incompatible-call] +(merge(objMap, List([123])): ObjMap); + +// merge: Maps + +const map = Map({ key: 'value' }); +(merge(map, { key: 'alternate' }): Map); +(merge(map, { otherKey: 'value' }): Map); +(merge(map, Map({ key: 'alternate' })): Map); +(merge(map, Map({ otherKey: 'value' })): Map); +(merge(map, [['otherKey', 'value']]): Map); +// $FlowExpectedError[incompatible-call] (functional merge cannot return union value types) +(merge(map, Map({ otherKey: 123 })): Map); +// $FlowExpectedError[incompatible-call] +(merge(map, [4, 5, 6]): Map); +// $FlowExpectedError[incompatible-call] +(merge(map, 123): Map); +// $FlowExpectedError[incompatible-call] +(merge(map, { '0': 123 }): Map); +// $FlowExpectedError[incompatible-call] +(merge(map, [ + [0, 4], + [1, 5], + [1, 6], +]): Map); + +// merge: Lists + +const list = List([1, 2, 3]); +(merge(list, [4, 5, 6]): List); +(merge(list, List([4, 5, 6])): List); +// $FlowExpectedError[incompatible-call] (functional merge cannot return union value types) +(merge(list, ['a', 'b', 'c']): List); +// $FlowExpectedError[incompatible-call] (functional merge cannot return union value types) +(merge(list, List(['a', 'b', 'c'])): List); +// $FlowExpectedError[incompatible-call] +(merge(list, 123): List); +// $FlowExpectedError[incompatible-call] +(merge(list, { '0': 123 }): List); +// $FlowExpectedError[incompatible-call] +(merge(list, Map({ '0': 123 })): List); +// $FlowExpectedError[incompatible-call] +(merge(list, [ + [0, 4], + [1, 5], + [1, 6], +]): List); + +// merge: Objects as Records + +type XYPoint = { x: number, y: number }; +const objRecord: XYPoint = { x: 12, y: 34 }; +(merge(objRecord, { x: 321 }): XYPoint); +(merge(objRecord, [['x', 321]]): XYPoint); +(merge(objRecord, Map({ x: 123 })): XYPoint); +(merge(objRecord, Map([['x', 123]])): XYPoint); +const xyPointRecord = Record({ x: 0, y: 0 }); +(merge(objRecord, xyPointRecord({ x: 321 })): XYPoint); +// $FlowExpectedError[incompatible-call] +(merge(objRecord, { x: 'abc' }): XYPoint); +// $FlowExpectedError[incompatible-call] +(merge({ x: 12, y: 34 }, [['x', 'abc']]): XYPoint); +// $FlowExpectedError[incompatible-call] +(merge(objRecord, { z: 321 }): XYPoint); +// $FlowExpectedError[prop-missing]] +// $FlowExpectedError[invalid-call-util]] +(merge(objRecord, [['z', 321]]): XYPoint); +// $FlowExpectedError[incompatible-call] +(merge(objRecord, Map({ z: 123 })): XYPoint); +// $FlowExpectedError[incompatible-call] +(merge(objRecord, Map([['z', 123]])): XYPoint); +// $FlowExpectedError[incompatible-call] +(merge(objRecord, [321]): XYPoint); +// $FlowExpectedError[incompatible-call] +(merge(objRecord, List([123])): XYPoint); + +// merge: Arrays + +const arr = [1, 2, 3]; +(merge(arr, [4, 5, 6]): Array); +(merge(arr, List([4, 5, 6])): Array); +// $FlowExpectedError[incompatible-call] (functional merge cannot return union value types) +(merge(arr, ['a', 'b', 'c']): Array); +// $FlowExpectedError[incompatible-call] (functional merge cannot return union value types) +(merge(arr, List(['a', 'b', 'c'])): Array); +// $FlowExpectedError[incompatible-call] +(merge(arr, 123): Array); +// $FlowExpectedError[incompatible-call] +(merge(arr, { '0': 123 }): Array); +// $FlowExpectedError[incompatible-call] +(merge(arr, Map({ '0': 123 })): Array); +// $FlowExpectedError[incompatible-call] +(merge(arr, [ + [0, 4], + [1, 5], + [1, 6], +]): Array); diff --git a/type-definitions/flow-tests/predicates.js b/type-definitions/flow-tests/predicates.js new file mode 100644 index 0000000000..a72072bb96 --- /dev/null +++ b/type-definitions/flow-tests/predicates.js @@ -0,0 +1,17 @@ +// @flow +import { List } from 'immutable'; + +declare var mystery: mixed; + +// $FlowExpectedError[cannot-resolve-name] +maybe.push('3'); + +if (mystery instanceof List) { + maybe.push('3'); +} + +// Note: Flow's support for %checks is still experimental. +// Support this in the future. +// if (List.isList(mystery)) { +// mystery.push('3'); +// } diff --git a/type-definitions/flow-tests/record.js b/type-definitions/flow-tests/record.js new file mode 100644 index 0000000000..d820608d92 --- /dev/null +++ b/type-definitions/flow-tests/record.js @@ -0,0 +1,217 @@ +// @flow +// Some tests look like they are repeated in order to avoid false positives. +// Flow might not complain about an instance of (what it thinks is) T to be assigned to T + +import { Record, type RecordFactory, type RecordOf, Map, List, merge } from 'immutable'; + +// Use the RecordFactory type to annotate +const Point2: RecordFactory<{ x: number, y: number }> = Record({ x: 0, y: 0 }); +const Point3: RecordFactory<{ x: number, y: number, z: number }> = Record({ + x: 0, + y: 0, + z: 0, +}); +type TGeoPoint = { lat: ?number, lon: ?number }; +const GeoPoint: RecordFactory = Record({ lat: null, lon: null }); + +// TODO: this should be FlowExpectedError - 'abc' is not a number +// However, due to support for the brittle support for subclassing, Flow +// cannot also type check default values in this position. +const PointWhoops: RecordFactory<{ x: number, y: number }> = Record({ + x: 0, + y: 'abc', +}); + +let origin2 = Point2({}); +let origin3 = Point3({}); +let geo = GeoPoint({ lat: 34 }); +// $FlowExpectedError[incompatible-call] +const mistake = Point2({ x: 'string' }); +origin3 = GeoPoint({ lat: 34 }); +geo = Point3({}); + +// Use RecordOf to type the return value of a Record factory function. +let geoPointExpected1: RecordOf = GeoPoint({}); + +// $FlowExpectedError[prop-missing] - Point2 does not return GeoPoint. +let geoPointExpected2: RecordOf = Point2({}); + +const px = origin2.get('x'); +const px2: number = origin2.x; +// $FlowExpectedError[incompatible-type] +const px3: number = origin2.get('x', 'not set value'); +const px4: number | string = origin2.get('x', 'not set value'); +// $FlowExpectedError[incompatible-call] +const pz = origin2.get('z'); +// $FlowExpectedError[incompatible-use] +const pz2 = origin2.z; + +origin2.set('x', 4); +// $FlowExpectedError[incompatible-call] +origin2.set('x', 'not-a-number'); +// $FlowExpectedError[incompatible-call] +origin2.set('z', 3); + +const name: string = Record.getDescriptiveName(origin2); +// $FlowExpectedError[incompatible-call] +const name2: string = Record.getDescriptiveName({}); + +// Note: need to cast through any when extending Records as if they ere classes +class ABClass extends (Record({ a: 1, b: 2 }): any) { + setA(a: number) { + return this.set('a', a); + } + + setB(b: number) { + return this.set('b', b); + } +} + +var t1 = new ABClass({ a: 1 }); +var t2 = t1.setA(3); +var t3 = t2.setB(10); +// Note: flow does not check extended Record classes yet +var t4 = t2.setC(10); + +// Note: flow does not check extended Record classes yet +var t1a: string = t1.a; +// Note: flow does not check extended Record classes yet +var t1c = t1.c; + +// Use of new to create record factories (supported, but discouraged) +type TPointNew = { x: number, y: number }; +type PointNew = RecordOf; +const MakePointNew: RecordFactory = new Record({ x: 0, y: 0 }); +// Not using new allows returning a record. +const origin: PointNew = MakePointNew(); +// Both get and prop access are supported with RecordOf +{ + const x: number = origin.get('x'); +} +{ + const x: number = origin.x; +} +{ + // $FlowExpectedError[incompatible-type] number is not a string + const x: string = origin.x; +} +// Can use the Record constructor type as an alternative, +// it just doesn't support property access. +const originAlt1: MakePointNew = MakePointNew(); +// Both get and prop access are supported with RecordOf +{ + const x: number = originAlt1.get('x'); +} +{ + // $FlowExpectedError[prop-missing] cannot use property access for this alternative annotation + const x: number = originAlt1.x; +} +// Can also sort of use the inner Record values type as an alternative, +// however it does not have the immutable record API, though useful for flowing +// immutable Records where plain objects are expected. +// Remember that Records are *read only*, and using the $ReadOnly helper type +// can ensure correct types. +const originAlt2: $ReadOnly = MakePointNew(); +{ + // $FlowExpectedError[prop-missing] cannot use Record API for this alternative annotation + const x: number = originAlt2.get('x'); +} +{ + const x: number = originAlt2.x; +} + +// Use of new may only return a class instance, not a record +// (supported but discouraged) +// $FlowExpectedError[class-object-subtyping] +// $FlowExpectedError[prop-missing] +const mistakeOriginNew: PointNew = new MakePointNew(); +// An alternative type strategy is instance based +const originNew: MakePointNew = new MakePointNew(); +// Only get, but not prop access are supported with class instances +{ + const x: number = originNew.get('x'); +} +{ + // $FlowExpectedError[prop-missing] property `x`. Property not found in RecordInstance + const x: number = originNew.x; +} + +// $FlowExpectedError[incompatible-call] instantiated with invalid type +const mistakeNewRecord = MakePointNew({ x: 'string' }); +// $FlowExpectedError[incompatible-call] instantiated with invalid type +const mistakeNewInstance = new MakePointNew({ x: 'string' }); + +// Subclassing + +// Note use of + for Read Only. +type TPerson = { +name: string, +age: number }; +const defaultValues: TPerson = { name: 'Aristotle', age: 2400 }; +const PersonRecord = Record(defaultValues); + +class Person extends PersonRecord { + getName(): string { + return this.get('name'); + } + + setName(name: string): this & TPerson { + return this.set('name', name); + } +} + +const person = new Person(); +(person.setName('Thales'): Person); +(person.getName(): string); +(person.setName('Thales').getName(): string); +(person.setName('Thales').name: string); +person.get('name'); +person.set('name', 'Thales'); +// $FlowExpectedError[incompatible-call] +person.get('unknown'); +// $FlowExpectedError[prop-missing] +person.set('unknown', 'Thales'); + +// Note: not +class PersonWithoutTypes extends PersonRecord { + getName(): string { + return this.get('name'); + } + + setName(name: string): this & TPerson { + return this.set('name', name); + } +} + +const person2 = new PersonWithoutTypes(); + +person2.get('name'); +// Note: no error +person2.get('unknown'); + + +// Functional Merge + +type XYPoint = { x: number, y: number }; +type XYPointRecord = RecordOf; +const xyRecord: RecordFactory = Record({ x: 0, y: 0 }); +const record = xyRecord(); +(merge(record, { x: 321 }): XYPointRecord); +(merge(record, xyRecord({ x: 321 })): XYPointRecord); +// $FlowExpectedError[incompatible-call] +(merge(record, { z: 321 }): XYPointRecord); +// $FlowExpectedError[incompatible-call] +(merge(record, { x: 'abc' }): XYPointRecord); +(merge(record, [['x', 321]]): XYPointRecord); +// $FlowExpectedError[prop-missing]] +(merge(record, [['z', 321]]): XYPointRecord); +// $FlowExpectedError[incompatible-call] +(merge(record, [['x', 'abc']]): XYPointRecord); +// $FlowExpectedError[incompatible-call] +(merge(record, [321]): XYPointRecord); +(merge(record, Map({ x: 123 })): XYPointRecord); +// $FlowExpectedError[incompatible-call] +(merge(record, Map({ z: 123 })): XYPointRecord); +(merge(record, Map([['x', 123]])): XYPointRecord); +// $FlowExpectedError[incompatible-call] +(merge(record, Map([['z', 123]])): XYPointRecord); +// $FlowExpectedError[incompatible-call] +(merge(record, List([123])): XYPointRecord); diff --git a/type-definitions/immutable.d.ts b/type-definitions/immutable.d.ts new file mode 100644 index 0000000000..331dc2c6a8 --- /dev/null +++ b/type-definitions/immutable.d.ts @@ -0,0 +1,6249 @@ +/** @ignore we should disable this rules, but let's activate it to enable eslint first */ +/** + * Immutable data encourages pure functions (data-in, data-out) and lends itself + * to much simpler application development and enabling techniques from + * functional programming such as lazy evaluation. + * + * While designed to bring these powerful functional concepts to JavaScript, it + * presents an Object-Oriented API familiar to Javascript engineers and closely + * mirroring that of Array, Map, and Set. It is easy and efficient to convert to + * and from plain Javascript types. + * + * ## How to read these docs + * + * In order to better explain what kinds of values the Immutable.js API expects + * and produces, this documentation is presented in a statically typed dialect of + * JavaScript (like [Flow][] or [TypeScript][]). You *don't need* to use these + * type checking tools in order to use Immutable.js, however becoming familiar + * with their syntax will help you get a deeper understanding of this API. + * + * **A few examples and how to read them.** + * + * All methods describe the kinds of data they accept and the kinds of data + * they return. For example a function which accepts two numbers and returns + * a number would look like this: + * + * ```js + * sum(first: number, second: number): number + * ``` + * + * Sometimes, methods can accept different kinds of data or return different + * kinds of data, and this is described with a *type variable*, which is + * typically in all-caps. For example, a function which always returns the same + * kind of data it was provided would look like this: + * + * ```js + * identity(value: T): T + * ``` + * + * Type variables are defined with classes and referred to in methods. For + * example, a class that holds onto a value for you might look like this: + * + * ```js + * class Box { + * constructor(value: T) + * getValue(): T + * } + * ``` + * + * In order to manipulate Immutable data, methods that we're used to affecting + * a Collection instead return a new Collection of the same type. The type + * `this` refers to the same kind of class. For example, a List which returns + * new Lists when you `push` a value onto it might look like: + * + * ```js + * class List { + * push(value: T): this + * } + * ``` + * + * Many methods in Immutable.js accept values which implement the JavaScript + * [Iterable][] protocol, and might appear like `Iterable` for something + * which represents sequence of strings. Typically in JavaScript we use plain + * Arrays (`[]`) when an Iterable is expected, but also all of the Immutable.js + * collections are iterable themselves! + * + * For example, to get a value deep within a structure of data, we might use + * `getIn` which expects an `Iterable` path: + * + * ``` + * getIn(path: Iterable): unknown + * ``` + * + * To use this method, we could pass an array: `data.getIn([ "key", 2 ])`. + * + * + * Note: All examples are presented in the modern [ES2015][] version of + * JavaScript. Use tools like Babel to support older browsers. + * + * For example: + * + * ```js + * // ES2015 + * const mappedFoo = foo.map(x => x * x); + * // ES5 + * var mappedFoo = foo.map(function (x) { return x * x; }); + * ``` + * + * [ES2015]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/New_in_JavaScript/ECMAScript_6_support_in_Mozilla + * [TypeScript]: https://www.typescriptlang.org/ + * [Flow]: https://flowtype.org/ + * [Iterable]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols + */ + +declare namespace Immutable { + /** @ignore */ + type OnlyObject = Extract; + + /** @ignore */ + type ContainObject = + OnlyObject extends object + ? OnlyObject extends never + ? false + : true + : false; + + /** + * @ignore + * + * Used to convert deeply all immutable types to a plain TS type. + * Using `unknown` on object instead of recursive call as we have a circular reference issue + */ + export type DeepCopy = + T extends Record + ? // convert Record to DeepCopy plain JS object + { + [key in keyof R]: ContainObject extends true + ? unknown + : R[key]; + } + : T extends MapOf + ? // convert MapOf to DeepCopy plain JS object + { + [key in keyof R]: ContainObject extends true + ? unknown + : R[key]; + } + : T extends Collection.Keyed + ? // convert KeyedCollection to DeepCopy plain JS object + { + [key in KeyedKey extends PropertyKey + ? KeyedKey + : string]: V extends object ? unknown : V; + } + : // convert IndexedCollection or Immutable.Set to DeepCopy plain JS array + // eslint-disable-next-line @typescript-eslint/no-unused-vars + T extends Collection + ? Array> + : T extends string | number // Iterable scalar types : should be kept as is + ? T + : T extends Iterable // Iterable are converted to plain JS array + ? Array> + : T extends object // plain JS object are converted deeply + ? { + [ObjectKey in keyof T]: ContainObject< + T[ObjectKey] + > extends true + ? unknown + : T[ObjectKey]; + } + : // other case : should be kept as is + T; + + /** + * Describes which item in a pair should be placed first when sorting + * + * @ignore + */ + export enum PairSorting { + LeftThenRight = -1, + RightThenLeft = +1, + } + + /** + * Function comparing two items of the same type. It can return: + * + * * a PairSorting value, to indicate whether the left-hand item or the right-hand item should be placed before the other + * + * * the traditional numeric return value - especially -1, 0, or 1 + * + * @ignore + */ + export type Comparator = (left: T, right: T) => PairSorting | number; + + /** + * @ignore + * + * KeyPath allowed for `xxxIn` methods + */ + export type KeyPath = OrderedCollection | ArrayLike; + + /** + * Lists are ordered indexed dense collections, much like a JavaScript + * Array. + * + * Lists are immutable and fully persistent with O(log32 N) gets and sets, + * and O(1) push and pop. + * + * Lists implement Deque, with efficient addition and removal from both the + * end (`push`, `pop`) and beginning (`unshift`, `shift`). + * + * Unlike a JavaScript Array, there is no distinction between an + * "unset" index and an index set to `undefined`. `List#forEach` visits all + * indices from 0 to size, regardless of whether they were explicitly defined. + */ + namespace List { + /** + * True if the provided value is a List + * + * + * ```js + * const { List } = require('immutable'); + * List.isList([]); // false + * List.isList(List()); // true + * ``` + */ + function isList(maybeList: unknown): maybeList is List; + + /** + * Creates a new List containing `values`. + * + * + * ```js + * const { List } = require('immutable'); + * List.of(1, 2, 3, 4) + * // List [ 1, 2, 3, 4 ] + * ``` + * + * Note: Values are not altered or converted in any way. + * + * + * ```js + * const { List } = require('immutable'); + * List.of({x:1}, 2, [3], 4) + * // List [ { x: 1 }, 2, [ 3 ], 4 ] + * ``` + */ + function of(...values: Array): List; + } + + /** + * Create a new immutable List containing the values of the provided + * collection-like. + * + * Note: `List` is a factory function and not a class, and does not use the + * `new` keyword during construction. + * + * + * ```js + * const { List, Set } = require('immutable') + * + * const emptyList = List() + * // List [] + * + * const plainArray = [ 1, 2, 3, 4 ] + * const listFromPlainArray = List(plainArray) + * // List [ 1, 2, 3, 4 ] + * + * const plainSet = Set([ 1, 2, 3, 4 ]) + * const listFromPlainSet = List(plainSet) + * // List [ 1, 2, 3, 4 ] + * + * const arrayIterator = plainArray[Symbol.iterator]() + * const listFromCollectionArray = List(arrayIterator) + * // List [ 1, 2, 3, 4 ] + * + * listFromPlainArray.equals(listFromCollectionArray) // true + * listFromPlainSet.equals(listFromCollectionArray) // true + * listFromPlainSet.equals(listFromPlainArray) // true + * ``` + */ + function List(collection?: Iterable | ArrayLike): List; + + interface List extends Collection.Indexed { + /** + * The number of items in this List. + */ + readonly size: number; + + // Persistent changes + + /** + * Returns a new List which includes `value` at `index`. If `index` already + * exists in this List, it will be replaced. + * + * `index` may be a negative number, which indexes back from the end of the + * List. `v.set(-1, "value")` sets the last item in the List. + * + * If `index` larger than `size`, the returned List's `size` will be large + * enough to include the `index`. + * + * + * ```js + * const originalList = List([ 0 ]); + * // List [ 0 ] + * originalList.set(1, 1); + * // List [ 0, 1 ] + * originalList.set(0, 'overwritten'); + * // List [ "overwritten" ] + * originalList.set(2, 2); + * // List [ 0, undefined, 2 ] + * + * List().set(50000, 'value').size; + * // 50001 + * ``` + * + * Note: `set` can be used in `withMutations`. + */ + set(index: number, value: T): List; + + /** + * Returns a new List which excludes this `index` and with a size 1 less + * than this List. Values at indices above `index` are shifted down by 1 to + * fill the position. + * + * This is synonymous with `list.splice(index, 1)`. + * + * `index` may be a negative number, which indexes back from the end of the + * List. `v.delete(-1)` deletes the last item in the List. + * + * Note: `delete` cannot be safely used in IE8 + * + * + * ```js + * List([ 0, 1, 2, 3, 4 ]).delete(0); + * // List [ 1, 2, 3, 4 ] + * ``` + * + * Since `delete()` re-indexes values, it produces a complete copy, which + * has `O(N)` complexity. + * + * Note: `delete` *cannot* be used in `withMutations`. + * + * @alias remove + */ + delete(index: number): List; + remove(index: number): List; + + /** + * Returns a new List with `value` at `index` with a size 1 more than this + * List. Values at indices above `index` are shifted over by 1. + * + * This is synonymous with `list.splice(index, 0, value)`. + * + * + * ```js + * List([ 0, 1, 2, 3, 4 ]).insert(6, 5) + * // List [ 0, 1, 2, 3, 4, 5 ] + * ``` + * + * Since `insert()` re-indexes values, it produces a complete copy, which + * has `O(N)` complexity. + * + * Note: `insert` *cannot* be used in `withMutations`. + */ + insert(index: number, value: T): List; + + /** + * Returns a new List with 0 size and no values in constant time. + * + * + * ```js + * List([ 1, 2, 3, 4 ]).clear() + * // List [] + * ``` + * + * Note: `clear` can be used in `withMutations`. + */ + clear(): List; + + /** + * Returns a new List with the provided `values` appended, starting at this + * List's `size`. + * + * + * ```js + * List([ 1, 2, 3, 4 ]).push(5) + * // List [ 1, 2, 3, 4, 5 ] + * ``` + * + * Note: `push` can be used in `withMutations`. + */ + push(...values: Array): List; + + /** + * Returns a new List with a size ones less than this List, excluding + * the last index in this List. + * + * Note: this differs from `Array#pop` because it returns a new + * List rather than the removed value. Use `last()` to get the last value + * in this List. + * + * ```js + * List([ 1, 2, 3, 4 ]).pop() + * // List[ 1, 2, 3 ] + * ``` + * + * Note: `pop` can be used in `withMutations`. + */ + pop(): List; + + /** + * Returns a new List with the provided `values` prepended, shifting other + * values ahead to higher indices. + * + * + * ```js + * List([ 2, 3, 4]).unshift(1); + * // List [ 1, 2, 3, 4 ] + * ``` + * + * Note: `unshift` can be used in `withMutations`. + */ + unshift(...values: Array): List; + + /** + * Returns a new List with a size ones less than this List, excluding + * the first index in this List, shifting all other values to a lower index. + * + * Note: this differs from `Array#shift` because it returns a new + * List rather than the removed value. Use `first()` to get the first + * value in this List. + * + * + * ```js + * List([ 0, 1, 2, 3, 4 ]).shift(); + * // List [ 1, 2, 3, 4 ] + * ``` + * + * Note: `shift` can be used in `withMutations`. + */ + shift(): List; + + /** + * Returns a new List with an updated value at `index` with the return + * value of calling `updater` with the existing value, or `notSetValue` if + * `index` was not set. If called with a single argument, `updater` is + * called with the List itself. + * + * `index` may be a negative number, which indexes back from the end of the + * List. `v.update(-1)` updates the last item in the List. + * + * + * ```js + * const list = List([ 'a', 'b', 'c' ]) + * const result = list.update(2, val => val.toUpperCase()) + * // List [ "a", "b", "C" ] + * ``` + * + * This can be very useful as a way to "chain" a normal function into a + * sequence of methods. RxJS calls this "let" and lodash calls it "thru". + * + * For example, to sum a List after mapping and filtering: + * + * + * ```js + * function sum(collection) { + * return collection.reduce((sum, x) => sum + x, 0) + * } + * + * List([ 1, 2, 3 ]) + * .map(x => x + 1) + * .filter(x => x % 2 === 0) + * .update(sum) + * // 6 + * ``` + * + * Note: `update(index)` can be used in `withMutations`. + * + * @see `Map#update` + */ + update(index: number, notSetValue: T, updater: (value: T) => T): this; + update( + index: number, + updater: (value: T | undefined) => T | undefined + ): this; + update(updater: (value: this) => R): R; + + /** + * Returns a new List with size `size`. If `size` is less than this + * List's size, the new List will exclude values at the higher indices. + * If `size` is greater than this List's size, the new List will have + * undefined values for the newly available indices. + * + * When building a new List and the final size is known up front, `setSize` + * used in conjunction with `withMutations` may result in the more + * performant construction. + */ + setSize(size: number): List; + + // Deep persistent changes + + /** + * Returns a new List having set `value` at this `keyPath`. If any keys in + * `keyPath` do not exist, a new immutable Map will be created at that key. + * + * Index numbers are used as keys to determine the path to follow in + * the List. + * + * + * ```js + * const { List } = require('immutable') + * const list = List([ 0, 1, 2, List([ 3, 4 ])]) + * list.setIn([3, 0], 999); + * // List [ 0, 1, 2, List [ 999, 4 ] ] + * ``` + * + * Plain JavaScript Object or Arrays may be nested within an Immutable.js + * Collection, and setIn() can update those values as well, treating them + * immutably by creating new copies of those values with the changes applied. + * + * + * ```js + * const { List } = require('immutable') + * const list = List([ 0, 1, 2, { plain: 'object' }]) + * list.setIn([3, 'plain'], 'value'); + * // List([ 0, 1, 2, { plain: 'value' }]) + * ``` + * + * Note: `setIn` can be used in `withMutations`. + */ + setIn(keyPath: Iterable, value: unknown): this; + + /** + * Returns a new List having removed the value at this `keyPath`. If any + * keys in `keyPath` do not exist, no change will occur. + * + * + * ```js + * const { List } = require('immutable') + * const list = List([ 0, 1, 2, List([ 3, 4 ])]) + * list.deleteIn([3, 0]); + * // List [ 0, 1, 2, List [ 4 ] ] + * ``` + * + * Plain JavaScript Object or Arrays may be nested within an Immutable.js + * Collection, and removeIn() can update those values as well, treating them + * immutably by creating new copies of those values with the changes applied. + * + * + * ```js + * const { List } = require('immutable') + * const list = List([ 0, 1, 2, { plain: 'object' }]) + * list.removeIn([3, 'plain']); + * // List([ 0, 1, 2, {}]) + * ``` + * + * Note: `deleteIn` *cannot* be safely used in `withMutations`. + * + * @alias removeIn + */ + deleteIn(keyPath: Iterable): this; + removeIn(keyPath: Iterable): this; + + /** + * Note: `updateIn` can be used in `withMutations`. + * + * @see `Map#updateIn` + */ + updateIn( + keyPath: Iterable, + notSetValue: unknown, + updater: (value: unknown) => unknown + ): this; + updateIn( + keyPath: Iterable, + updater: (value: unknown) => unknown + ): this; + + /** + * Note: `mergeIn` can be used in `withMutations`. + * + * @see `Map#mergeIn` + */ + mergeIn(keyPath: Iterable, ...collections: Array): this; + + /** + * Note: `mergeDeepIn` can be used in `withMutations`. + * + * @see `Map#mergeDeepIn` + */ + mergeDeepIn( + keyPath: Iterable, + ...collections: Array + ): this; + + // Transient changes + + /** + * Note: Not all methods can be safely used on a mutable collection or within + * `withMutations`! Check the documentation for each method to see if it + * allows being used in `withMutations`. + * + * @see `Map#withMutations` + */ + withMutations(mutator: (mutable: this) => unknown): this; + + /** + * An alternative API for withMutations() + * + * Note: Not all methods can be safely used on a mutable collection or within + * `withMutations`! Check the documentation for each method to see if it + * allows being used in `withMutations`. + * + * @see `Map#asMutable` + */ + asMutable(): this; + + /** + * @see `Map#wasAltered` + */ + wasAltered(): boolean; + + /** + * @see `Map#asImmutable` + */ + asImmutable(): this; + + // Sequence algorithms + + /** + * Returns a new List with other values or collections concatenated to this one. + * + * Note: `concat` can be used in `withMutations`. + * + * @alias merge + */ + concat(...valuesOrCollections: Array | C>): List; + merge(...collections: Array>): List; + + /** + * Returns a new List with values passed through a + * `mapper` function. + * + * + * ```js + * List([ 1, 2 ]).map(x => 10 * x) + * // List [ 10, 20 ] + * ``` + */ + map( + mapper: (value: T, key: number, iter: this) => M, + context?: unknown + ): List; + + /** + * Flat-maps the List, returning a new List. + * + * Similar to `list.map(...).flatten(true)`. + */ + flatMap( + mapper: (value: T, key: number, iter: this) => Iterable, + context?: unknown + ): List; + + /** + * Returns a new List with only the values for which the `predicate` + * function returns true. + * + * Note: `filter()` always returns a new instance, even if it results in + * not filtering out any values. + */ + filter( + predicate: (value: T, index: number, iter: this) => value is F, + context?: unknown + ): List; + filter( + predicate: (value: T, index: number, iter: this) => unknown, + context?: unknown + ): this; + + /** + * Returns a new List with the values for which the `predicate` + * function returns false and another for which is returns true. + */ + partition( + predicate: (this: C, value: T, index: number, iter: this) => value is F, + context?: C + ): [List, List]; + partition( + predicate: (this: C, value: T, index: number, iter: this) => unknown, + context?: C + ): [this, this]; + + /** + * Returns a List "zipped" with the provided collection. + * + * Like `zipWith`, but using the default `zipper`: creating an `Array`. + * + * + * ```js + * const a = List([ 1, 2, 3 ]); + * const b = List([ 4, 5, 6 ]); + * const c = a.zip(b); // List [ [ 1, 4 ], [ 2, 5 ], [ 3, 6 ] ] + * ``` + */ + zip(other: Collection): List<[T, U]>; + zip( + other: Collection, + other2: Collection + ): List<[T, U, V]>; + zip(...collections: Array>): List; + + /** + * Returns a List "zipped" with the provided collections. + * + * Unlike `zip`, `zipAll` continues zipping until the longest collection is + * exhausted. Missing values from shorter collections are filled with `undefined`. + * + * + * ```js + * const a = List([ 1, 2 ]); + * const b = List([ 3, 4, 5 ]); + * const c = a.zipAll(b); // List [ [ 1, 3 ], [ 2, 4 ], [ undefined, 5 ] ] + * ``` + * + * Note: Since zipAll will return a collection as large as the largest + * input, some results may contain undefined values. TypeScript cannot + * account for these without cases (as of v2.5). + */ + zipAll(other: Collection): List<[T, U]>; + zipAll( + other: Collection, + other2: Collection + ): List<[T, U, V]>; + zipAll(...collections: Array>): List; + + /** + * Returns a List "zipped" with the provided collections by using a + * custom `zipper` function. + * + * + * ```js + * const a = List([ 1, 2, 3 ]); + * const b = List([ 4, 5, 6 ]); + * const c = a.zipWith((a, b) => a + b, b); + * // List [ 5, 7, 9 ] + * ``` + */ + zipWith( + zipper: (value: T, otherValue: U) => Z, + otherCollection: Collection + ): List; + zipWith( + zipper: (value: T, otherValue: U, thirdValue: V) => Z, + otherCollection: Collection, + thirdCollection: Collection + ): List; + zipWith( + zipper: (...values: Array) => Z, + ...collections: Array> + ): List; + + /** + * Returns a new List with its values shuffled thanks to the + * [Fisher–Yates](https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle) + * algorithm. + * It uses Math.random, but you can provide your own random number generator. + */ + shuffle(random?: () => number): this; + } + + /** + * Immutable Map is an unordered Collection.Keyed of (key, value) pairs with + * `O(log32 N)` gets and `O(log32 N)` persistent sets. + * + * Iteration order of a Map is undefined, however is stable. Multiple + * iterations of the same Map will iterate in the same order. + * + * Map's keys can be of any type, and use `Immutable.is` to determine key + * equality. This allows the use of any value (including NaN) as a key. + * + * Because `Immutable.is` returns equality based on value semantics, and + * Immutable collections are treated as values, any Immutable collection may + * be used as a key. + * + * + * ```js + * const { Map, List } = require('immutable'); + * Map().set(List([ 1 ]), 'listofone').get(List([ 1 ])); + * // 'listofone' + * ``` + * + * Any JavaScript object may be used as a key, however strict identity is used + * to evaluate key equality. Two similar looking objects will represent two + * different keys. + * + * Implemented by a hash-array mapped trie. + */ + namespace Map { + /** + * True if the provided value is a Map + * + * + * ```js + * const { Map } = require('immutable') + * Map.isMap({}) // false + * Map.isMap(Map()) // true + * ``` + */ + function isMap(maybeMap: unknown): maybeMap is Map; + } + + /** + * Creates a new Immutable Map. + * + * Created with the same key value pairs as the provided Collection.Keyed or + * JavaScript Object or expects a Collection of [K, V] tuple entries. + * + * Note: `Map` is a factory function and not a class, and does not use the + * `new` keyword during construction. + * + * + * ```js + * const { Map } = require('immutable') + * Map({ key: "value" }) + * Map([ [ "key", "value" ] ]) + * ``` + * + * Keep in mind, when using JS objects to construct Immutable Maps, that + * JavaScript Object properties are always strings, even if written in a + * quote-less shorthand, while Immutable Maps accept keys of any type. + * + * + * ```js + * let obj = { 1: "one" } + * Object.keys(obj) // [ "1" ] + * assert.equal(obj["1"], obj[1]) // "one" === "one" + * + * let map = Map(obj) + * assert.notEqual(map.get("1"), map.get(1)) // "one" !== undefined + * ``` + * + * Property access for JavaScript Objects first converts the key to a string, + * but since Immutable Map keys can be of any type the argument to `get()` is + * not altered. + */ + function Map(collection?: Iterable<[K, V]>): Map; + function Map(obj: R): MapOf; + function Map(obj: { [key: string]: V }): Map; + function Map(obj: { [P in K]?: V }): Map; + + /** + * Represent a Map constructed by an object + * + * @ignore + */ + interface MapOf + extends Map { + /** + * Returns the value associated with the provided key, or notSetValue if + * the Collection does not contain this key. + * + * Note: it is possible a key may be associated with an `undefined` value, + * so if `notSetValue` is not provided and this method returns `undefined`, + * that does not guarantee the key was not found. + */ + get(key: K, notSetValue?: unknown): R[K]; + get(key: unknown, notSetValue: NSV): NSV; + + // TODO `` can be used after dropping support for TypeScript 4.x + // reference: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-0.html#const-type-parameters + // after this change, `as const` assertions can be remove from the type tests + getIn

>( + searchKeyPath: [...P], + notSetValue?: unknown + ): RetrievePath; + + set(key: K, value: R[K]): this; + + update(updater: (value: this) => this): this; + update(key: K, updater: (value: R[K]) => R[K]): this; + update( + key: K, + notSetValue: NSV, + updater: (value: R[K]) => R[K] + ): this; + + // Possible best type is MapOf> but Omit seems to broke other function calls + // and generate recursion error with other methods (update, merge, etc.) until those functions are defined in MapOf + delete( + key: K + ): Extract extends never ? never : this; + remove( + key: K + ): Extract extends never ? never : this; + + toJS(): { [K in keyof R]: DeepCopy }; + + toJSON(): { [K in keyof R]: R[K] }; + } + + // Loosely based off of this work. + // https://github.com/immutable-js/immutable-js/issues/1462#issuecomment-584123268 + + /** + * @ignore + * Convert an immutable type to the equivalent plain TS type + * - MapOf -> object + * - List -> Array + */ + type GetNativeType = + S extends MapOf ? T : S extends List ? Array : S; + + /** @ignore */ + type Head> = T extends [ + infer H, + ...Array, + ] + ? H + : never; + /** @ignore */ + type Tail> = T extends [unknown, ...infer I] + ? I + : Array; + /** @ignore */ + type RetrievePathReducer< + T, + C, + L extends ReadonlyArray, + NT = GetNativeType, + > = + // we can not retrieve a path from a primitive type + T extends string | number | boolean | null | undefined + ? never + : C extends keyof NT + ? L extends [] // L extends [] means we are at the end of the path, lets return the current type + ? NT[C] + : // we are not at the end of the path, lets continue with the next key + RetrievePathReducer, Tail> + : // C is not a "key" of NT, so the path is invalid + never; + + /** @ignore */ + type RetrievePath> = P extends [] + ? P + : RetrievePathReducer, Tail

>; + + interface Map extends Collection.Keyed { + /** + * The number of entries in this Map. + */ + readonly size: number; + + // Persistent changes + + /** + * Returns a new Map also containing the new key, value pair. If an equivalent + * key already exists in this Map, it will be replaced. + * + * + * ```js + * const { Map } = require('immutable') + * const originalMap = Map() + * const newerMap = originalMap.set('key', 'value') + * const newestMap = newerMap.set('key', 'newer value') + * + * originalMap + * // Map {} + * newerMap + * // Map { "key": "value" } + * newestMap + * // Map { "key": "newer value" } + * ``` + * + * Note: `set` can be used in `withMutations`. + */ + set(key: K, value: V): this; + + /** + * Returns a new Map which excludes this `key`. + * + * Note: `delete` cannot be safely used in IE8, but is provided to mirror + * the ES6 collection API. + * + * + * ```js + * const { Map } = require('immutable') + * const originalMap = Map({ + * key: 'value', + * otherKey: 'other value' + * }) + * // Map { "key": "value", "otherKey": "other value" } + * originalMap.delete('otherKey') + * // Map { "key": "value" } + * ``` + * + * Note: `delete` can be used in `withMutations`. + * + * @alias remove + */ + delete(key: K): this; + remove(key: K): this; + + /** + * Returns a new Map which excludes the provided `keys`. + * + * + * ```js + * const { Map } = require('immutable') + * const names = Map({ a: "Aaron", b: "Barry", c: "Connor" }) + * names.deleteAll([ 'a', 'c' ]) + * // Map { "b": "Barry" } + * ``` + * + * Note: `deleteAll` can be used in `withMutations`. + * + * @alias removeAll + */ + deleteAll(keys: Iterable): this; + removeAll(keys: Iterable): this; + + /** + * Returns a new Map containing no keys or values. + * + * + * ```js + * const { Map } = require('immutable') + * Map({ key: 'value' }).clear() + * // Map {} + * ``` + * + * Note: `clear` can be used in `withMutations`. + */ + clear(): this; + + /** + * Returns a new Map having updated the value at this `key` with the return + * value of calling `updater` with the existing value. + * + * Similar to: `map.set(key, updater(map.get(key)))`. + * + * + * ```js + * const { Map } = require('immutable') + * const aMap = Map({ key: 'value' }) + * const newMap = aMap.update('key', value => value + value) + * // Map { "key": "valuevalue" } + * ``` + * + * This is most commonly used to call methods on collections within a + * structure of data. For example, in order to `.push()` onto a nested `List`, + * `update` and `push` can be used together: + * + * + * ```js + * const aMap = Map({ nestedList: List([ 1, 2, 3 ]) }) + * const newMap = aMap.update('nestedList', list => list.push(4)) + * // Map { "nestedList": List [ 1, 2, 3, 4 ] } + * ``` + * + * When a `notSetValue` is provided, it is provided to the `updater` + * function when the value at the key does not exist in the Map. + * + * + * ```js + * const aMap = Map({ key: 'value' }) + * const newMap = aMap.update('noKey', 'no value', value => value + value) + * // Map { "key": "value", "noKey": "no valueno value" } + * ``` + * + * However, if the `updater` function returns the same value it was called + * with, then no change will occur. This is still true if `notSetValue` + * is provided. + * + * + * ```js + * const aMap = Map({ apples: 10 }) + * const newMap = aMap.update('oranges', 0, val => val) + * // Map { "apples": 10 } + * assert.strictEqual(newMap, map); + * ``` + * + * For code using ES2015 or later, using `notSetValue` is discourged in + * favor of function parameter default values. This helps to avoid any + * potential confusion with identify functions as described above. + * + * The previous example behaves differently when written with default values: + * + * + * ```js + * const aMap = Map({ apples: 10 }) + * const newMap = aMap.update('oranges', (val = 0) => val) + * // Map { "apples": 10, "oranges": 0 } + * ``` + * + * If no key is provided, then the `updater` function return value is + * returned as well. + * + * + * ```js + * const aMap = Map({ key: 'value' }) + * const result = aMap.update(aMap => aMap.get('key')) + * // "value" + * ``` + * + * This can be very useful as a way to "chain" a normal function into a + * sequence of methods. RxJS calls this "let" and lodash calls it "thru". + * + * For example, to sum the values in a Map + * + * + * ```js + * function sum(collection) { + * return collection.reduce((sum, x) => sum + x, 0) + * } + * + * Map({ x: 1, y: 2, z: 3 }) + * .map(x => x + 1) + * .filter(x => x % 2 === 0) + * .update(sum) + * // 6 + * ``` + * + * Note: `update(key)` can be used in `withMutations`. + */ + update(key: K, notSetValue: V, updater: (value: V) => V): this; + update(key: K, updater: (value: V | undefined) => V | undefined): this; + update(updater: (value: this) => R): R; + + /** + * Returns a new Map resulting from merging the provided Collections + * (or JS objects) into this Map. In other words, this takes each entry of + * each collection and sets it on this Map. + * + * Note: Values provided to `merge` are shallowly converted before being + * merged. No nested values are altered. + * + * + * ```js + * const { Map } = require('immutable') + * const one = Map({ a: 10, b: 20, c: 30 }) + * const two = Map({ b: 40, a: 50, d: 60 }) + * one.merge(two) // Map { "a": 50, "b": 40, "c": 30, "d": 60 } + * two.merge(one) // Map { "b": 20, "a": 10, "d": 60, "c": 30 } + * ``` + * + * Note: `merge` can be used in `withMutations`. + * + * @alias concat + */ + merge( + ...collections: Array> + ): Map | VC>; + merge( + ...collections: Array<{ [key: string]: C }> + ): Map | C>; + + concat( + ...collections: Array> + ): Map | VC>; + concat( + ...collections: Array<{ [key: string]: C }> + ): Map | C>; + + /** + * Like `merge()`, `mergeWith()` returns a new Map resulting from merging + * the provided Collections (or JS objects) into this Map, but uses the + * `merger` function for dealing with conflicts. + * + * + * ```js + * const { Map } = require('immutable') + * const one = Map({ a: 10, b: 20, c: 30 }) + * const two = Map({ b: 40, a: 50, d: 60 }) + * one.mergeWith((oldVal, newVal) => oldVal / newVal, two) + * // { "a": 0.2, "b": 0.5, "c": 30, "d": 60 } + * two.mergeWith((oldVal, newVal) => oldVal / newVal, one) + * // { "b": 2, "a": 5, "d": 60, "c": 30 } + * ``` + * + * Note: `mergeWith` can be used in `withMutations`. + */ + mergeWith( + merger: (oldVal: V, newVal: VC, key: K) => VCC, + ...collections: Array> + ): Map; + mergeWith( + merger: (oldVal: V, newVal: C, key: string) => CC, + ...collections: Array<{ [key: string]: C }> + ): Map; + + /** + * Like `merge()`, but when two compatible collections are encountered with + * the same key, it merges them as well, recursing deeply through the nested + * data. Two collections are considered to be compatible (and thus will be + * merged together) if they both fall into one of three categories: keyed + * (e.g., `Map`s, `Record`s, and objects), indexed (e.g., `List`s and + * arrays), or set-like (e.g., `Set`s). If they fall into separate + * categories, `mergeDeep` will replace the existing collection with the + * collection being merged in. This behavior can be customized by using + * `mergeDeepWith()`. + * + * Note: Indexed and set-like collections are merged using + * `concat()`/`union()` and therefore do not recurse. + * + * + * ```js + * const { Map } = require('immutable') + * const one = Map({ a: Map({ x: 10, y: 10 }), b: Map({ x: 20, y: 50 }) }) + * const two = Map({ a: Map({ x: 2 }), b: Map({ y: 5 }), c: Map({ z: 3 }) }) + * one.mergeDeep(two) + * // Map { + * // "a": Map { "x": 2, "y": 10 }, + * // "b": Map { "x": 20, "y": 5 }, + * // "c": Map { "z": 3 } + * // } + * ``` + * + * Note: `mergeDeep` can be used in `withMutations`. + */ + mergeDeep( + ...collections: Array> + ): Map; + mergeDeep( + ...collections: Array<{ [key: string]: C }> + ): Map; + + /** + * Like `mergeDeep()`, but when two non-collections or incompatible + * collections are encountered at the same key, it uses the `merger` + * function to determine the resulting value. Collections are considered + * incompatible if they fall into separate categories between keyed, + * indexed, and set-like. + * + * + * ```js + * const { Map } = require('immutable') + * const one = Map({ a: Map({ x: 10, y: 10 }), b: Map({ x: 20, y: 50 }) }) + * const two = Map({ a: Map({ x: 2 }), b: Map({ y: 5 }), c: Map({ z: 3 }) }) + * one.mergeDeepWith((oldVal, newVal) => oldVal / newVal, two) + * // Map { + * // "a": Map { "x": 5, "y": 10 }, + * // "b": Map { "x": 20, "y": 10 }, + * // "c": Map { "z": 3 } + * // } + * ``` + * + * Note: `mergeDeepWith` can be used in `withMutations`. + */ + mergeDeepWith( + merger: (oldVal: unknown, newVal: unknown, key: unknown) => unknown, + ...collections: Array | { [key: string]: V }> + ): this; + + // Deep persistent changes + + /** + * Returns a new Map having set `value` at this `keyPath`. If any keys in + * `keyPath` do not exist, a new immutable Map will be created at that key. + * + * + * ```js + * const { Map } = require('immutable') + * const originalMap = Map({ + * subObject: Map({ + * subKey: 'subvalue', + * subSubObject: Map({ + * subSubKey: 'subSubValue' + * }) + * }) + * }) + * + * const newMap = originalMap.setIn(['subObject', 'subKey'], 'ha ha!') + * // Map { + * // "subObject": Map { + * // "subKey": "ha ha!", + * // "subSubObject": Map { "subSubKey": "subSubValue" } + * // } + * // } + * + * const newerMap = originalMap.setIn( + * ['subObject', 'subSubObject', 'subSubKey'], + * 'ha ha ha!' + * ) + * // Map { + * // "subObject": Map { + * // "subKey": "subvalue", + * // "subSubObject": Map { "subSubKey": "ha ha ha!" } + * // } + * // } + * ``` + * + * Plain JavaScript Object or Arrays may be nested within an Immutable.js + * Collection, and setIn() can update those values as well, treating them + * immutably by creating new copies of those values with the changes applied. + * + * + * ```js + * const { Map } = require('immutable') + * const originalMap = Map({ + * subObject: { + * subKey: 'subvalue', + * subSubObject: { + * subSubKey: 'subSubValue' + * } + * } + * }) + * + * originalMap.setIn(['subObject', 'subKey'], 'ha ha!') + * // Map { + * // "subObject": { + * // subKey: "ha ha!", + * // subSubObject: { subSubKey: "subSubValue" } + * // } + * // } + * ``` + * + * If any key in the path exists but cannot be updated (such as a primitive + * like number or a custom Object like Date), an error will be thrown. + * + * Note: `setIn` can be used in `withMutations`. + */ + setIn(keyPath: Iterable, value: unknown): this; + + /** + * Returns a new Map having removed the value at this `keyPath`. If any keys + * in `keyPath` do not exist, no change will occur. + * + * Note: `deleteIn` can be used in `withMutations`. + * + * @alias removeIn + */ + deleteIn(keyPath: Iterable): this; + removeIn(keyPath: Iterable): this; + + /** + * Returns a new Map having applied the `updater` to the entry found at the + * keyPath. + * + * This is most commonly used to call methods on collections nested within a + * structure of data. For example, in order to `.push()` onto a nested `List`, + * `updateIn` and `push` can be used together: + * + * + * ```js + * const { Map, List } = require('immutable') + * const map = Map({ inMap: Map({ inList: List([ 1, 2, 3 ]) }) }) + * const newMap = map.updateIn(['inMap', 'inList'], list => list.push(4)) + * // Map { "inMap": Map { "inList": List [ 1, 2, 3, 4 ] } } + * ``` + * + * If any keys in `keyPath` do not exist, new Immutable `Map`s will + * be created at those keys. If the `keyPath` does not already contain a + * value, the `updater` function will be called with `notSetValue`, if + * provided, otherwise `undefined`. + * + * + * ```js + * const map = Map({ a: Map({ b: Map({ c: 10 }) }) }) + * const newMap = map.updateIn(['a', 'b', 'c'], val => val * 2) + * // Map { "a": Map { "b": Map { "c": 20 } } } + * ``` + * + * If the `updater` function returns the same value it was called with, then + * no change will occur. This is still true if `notSetValue` is provided. + * + * + * ```js + * const map = Map({ a: Map({ b: Map({ c: 10 }) }) }) + * const newMap = map.updateIn(['a', 'b', 'x'], 100, val => val) + * // Map { "a": Map { "b": Map { "c": 10 } } } + * assert.strictEqual(newMap, aMap) + * ``` + * + * For code using ES2015 or later, using `notSetValue` is discourged in + * favor of function parameter default values. This helps to avoid any + * potential confusion with identify functions as described above. + * + * The previous example behaves differently when written with default values: + * + * + * ```js + * const map = Map({ a: Map({ b: Map({ c: 10 }) }) }) + * const newMap = map.updateIn(['a', 'b', 'x'], (val = 100) => val) + * // Map { "a": Map { "b": Map { "c": 10, "x": 100 } } } + * ``` + * + * Plain JavaScript Object or Arrays may be nested within an Immutable.js + * Collection, and updateIn() can update those values as well, treating them + * immutably by creating new copies of those values with the changes applied. + * + * + * ```js + * const map = Map({ a: { b: { c: 10 } } }) + * const newMap = map.updateIn(['a', 'b', 'c'], val => val * 2) + * // Map { "a": { b: { c: 20 } } } + * ``` + * + * If any key in the path exists but cannot be updated (such as a primitive + * like number or a custom Object like Date), an error will be thrown. + * + * Note: `updateIn` can be used in `withMutations`. + */ + updateIn( + keyPath: Iterable, + notSetValue: unknown, + updater: (value: unknown) => unknown + ): this; + updateIn( + keyPath: Iterable, + updater: (value: unknown) => unknown + ): this; + + /** + * A combination of `updateIn` and `merge`, returning a new Map, but + * performing the merge at a point arrived at by following the keyPath. + * In other words, these two lines are equivalent: + * + * ```js + * map.updateIn(['a', 'b', 'c'], abc => abc.merge(y)) + * map.mergeIn(['a', 'b', 'c'], y) + * ``` + * + * Note: `mergeIn` can be used in `withMutations`. + */ + mergeIn(keyPath: Iterable, ...collections: Array): this; + + /** + * A combination of `updateIn` and `mergeDeep`, returning a new Map, but + * performing the deep merge at a point arrived at by following the keyPath. + * In other words, these two lines are equivalent: + * + * ```js + * map.updateIn(['a', 'b', 'c'], abc => abc.mergeDeep(y)) + * map.mergeDeepIn(['a', 'b', 'c'], y) + * ``` + * + * Note: `mergeDeepIn` can be used in `withMutations`. + */ + mergeDeepIn( + keyPath: Iterable, + ...collections: Array + ): this; + + // Transient changes + + /** + * Every time you call one of the above functions, a new immutable Map is + * created. If a pure function calls a number of these to produce a final + * return value, then a penalty on performance and memory has been paid by + * creating all of the intermediate immutable Maps. + * + * If you need to apply a series of mutations to produce a new immutable + * Map, `withMutations()` creates a temporary mutable copy of the Map which + * can apply mutations in a highly performant manner. In fact, this is + * exactly how complex mutations like `merge` are done. + * + * As an example, this results in the creation of 2, not 4, new Maps: + * + * + * ```js + * const { Map } = require('immutable') + * const map1 = Map() + * const map2 = map1.withMutations(map => { + * map.set('a', 1).set('b', 2).set('c', 3) + * }) + * assert.equal(map1.size, 0) + * assert.equal(map2.size, 3) + * ``` + * + * Note: Not all methods can be used on a mutable collection or within + * `withMutations`! Read the documentation for each method to see if it + * is safe to use in `withMutations`. + */ + withMutations(mutator: (mutable: this) => unknown): this; + + /** + * Another way to avoid creation of intermediate Immutable maps is to create + * a mutable copy of this collection. Mutable copies *always* return `this`, + * and thus shouldn't be used for equality. Your function should never return + * a mutable copy of a collection, only use it internally to create a new + * collection. + * + * If possible, use `withMutations` to work with temporary mutable copies as + * it provides an easier to use API and considers many common optimizations. + * + * Note: if the collection is already mutable, `asMutable` returns itself. + * + * Note: Not all methods can be used on a mutable collection or within + * `withMutations`! Read the documentation for each method to see if it + * is safe to use in `withMutations`. + * + * @see `Map#asImmutable` + */ + asMutable(): this; + + /** + * Returns true if this is a mutable copy (see `asMutable()`) and mutative + * alterations have been applied. + * + * @see `Map#asMutable` + */ + wasAltered(): boolean; + + /** + * The yin to `asMutable`'s yang. Because it applies to mutable collections, + * this operation is *mutable* and may return itself (though may not + * return itself, i.e. if the result is an empty collection). Once + * performed, the original mutable copy must no longer be mutated since it + * may be the immutable result. + * + * If possible, use `withMutations` to work with temporary mutable copies as + * it provides an easier to use API and considers many common optimizations. + * + * @see `Map#asMutable` + */ + asImmutable(): this; + + // Sequence algorithms + + /** + * Returns a new Map with values passed through a + * `mapper` function. + * + * Map({ a: 1, b: 2 }).map(x => 10 * x) + * // Map { a: 10, b: 20 } + */ + map( + mapper: (value: V, key: K, iter: this) => M, + context?: unknown + ): Map; + + /** + * @see Collection.Keyed.mapKeys + */ + mapKeys( + mapper: (key: K, value: V, iter: this) => M, + context?: unknown + ): Map; + + /** + * @see Collection.Keyed.mapEntries + */ + mapEntries( + mapper: ( + entry: [K, V], + index: number, + iter: this + ) => [KM, VM] | undefined, + context?: unknown + ): Map; + + /** + * Flat-maps the Map, returning a new Map. + * + * Similar to `data.map(...).flatten(true)`. + */ + flatMap( + mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>, + context?: unknown + ): Map; + + /** + * Returns a new Map with only the entries for which the `predicate` + * function returns true. + * + * Note: `filter()` always returns a new instance, even if it results in + * not filtering out any values. + */ + filter( + predicate: (value: V, key: K, iter: this) => value is F, + context?: unknown + ): Map; + filter( + predicate: (value: V, key: K, iter: this) => unknown, + context?: unknown + ): this; + + /** + * Returns a new Map with the values for which the `predicate` + * function returns false and another for which is returns true. + */ + partition( + predicate: (this: C, value: V, key: K, iter: this) => value is F, + context?: C + ): [Map, Map]; + partition( + predicate: (this: C, value: V, key: K, iter: this) => unknown, + context?: C + ): [this, this]; + + /** + * @see Collection.Keyed.flip + */ + flip(): Map; + + /** + * Returns an OrderedMap of the same type which includes the same entries, + * stably sorted by using a `comparator`. + * + * If a `comparator` is not provided, a default comparator uses `<` and `>`. + * + * `comparator(valueA, valueB)`: + * + * * Returns `0` if the elements should not be swapped. + * * Returns `-1` (or any negative number) if `valueA` comes before `valueB` + * * Returns `1` (or any positive number) if `valueA` comes after `valueB` + * * Alternatively, can return a value of the `PairSorting` enum type + * * Is pure, i.e. it must always return the same value for the same pair + * of values. + * + * + * ```js + * const { Map } = require('immutable') + * Map({ "c": 3, "a": 1, "b": 2 }).sort((a, b) => { + * if (a < b) { return -1; } + * if (a > b) { return 1; } + * if (a === b) { return 0; } + * }); + * // OrderedMap { "a": 1, "b": 2, "c": 3 } + * ``` + * + * Note: `sort()` Always returns a new instance, even if the original was + * already sorted. + * + * Note: This is always an eager operation. + */ + sort(comparator?: Comparator): this & OrderedMap; + + /** + * Like `sort`, but also accepts a `comparatorValueMapper` which allows for + * sorting by more sophisticated means: + * + * + * ```js + * const { Map } = require('immutable') + * const beattles = Map({ + * John: { name: "Lennon" }, + * Paul: { name: "McCartney" }, + * George: { name: "Harrison" }, + * Ringo: { name: "Starr" }, + * }); + * beattles.sortBy(member => member.name); + * ``` + * + * Note: `sortBy()` Always returns a new instance, even if the original was + * already sorted. + * + * Note: This is always an eager operation. + */ + sortBy( + comparatorValueMapper: (value: V, key: K, iter: this) => C, + comparator?: (valueA: C, valueB: C) => number + ): this & OrderedMap; + } + + /** + * A type of Map that has the additional guarantee that the iteration order of + * entries will be the order in which they were set(). + * + * The iteration behavior of OrderedMap is the same as native ES6 Map and + * JavaScript Object. + * + * Note that `OrderedMap` are more expensive than non-ordered `Map` and may + * consume more memory. `OrderedMap#set` is amortized O(log32 N), but not + * stable. + */ + namespace OrderedMap { + /** + * True if the provided value is an OrderedMap. + */ + function isOrderedMap( + maybeOrderedMap: unknown + ): maybeOrderedMap is OrderedMap; + } + + /** + * Creates a new Immutable OrderedMap. + * + * Created with the same key value pairs as the provided Collection.Keyed or + * JavaScript Object or expects a Collection of [K, V] tuple entries. + * + * The iteration order of key-value pairs provided to this constructor will + * be preserved in the OrderedMap. + * + * let newOrderedMap = OrderedMap({key: "value"}) + * let newOrderedMap = OrderedMap([["key", "value"]]) + * + * Note: `OrderedMap` is a factory function and not a class, and does not use + * the `new` keyword during construction. + */ + function OrderedMap(collection?: Iterable<[K, V]>): OrderedMap; + function OrderedMap(obj: { [key: string]: V }): OrderedMap; + + interface OrderedMap extends Map, OrderedCollection<[K, V]> { + /** + * The number of entries in this OrderedMap. + */ + readonly size: number; + + /** + * Returns a new OrderedMap also containing the new key, value pair. If an + * equivalent key already exists in this OrderedMap, it will be replaced + * while maintaining the existing order. + * + * + * ```js + * const { OrderedMap } = require('immutable') + * const originalMap = OrderedMap({a:1, b:1, c:1}) + * const updatedMap = originalMap.set('b', 2) + * + * originalMap + * // OrderedMap {a: 1, b: 1, c: 1} + * updatedMap + * // OrderedMap {a: 1, b: 2, c: 1} + * ``` + * + * Note: `set` can be used in `withMutations`. + */ + set(key: K, value: V): this; + + /** + * Returns a new OrderedMap resulting from merging the provided Collections + * (or JS objects) into this OrderedMap. In other words, this takes each + * entry of each collection and sets it on this OrderedMap. + * + * Note: Values provided to `merge` are shallowly converted before being + * merged. No nested values are altered. + * + * + * ```js + * const { OrderedMap } = require('immutable') + * const one = OrderedMap({ a: 10, b: 20, c: 30 }) + * const two = OrderedMap({ b: 40, a: 50, d: 60 }) + * one.merge(two) // OrderedMap { "a": 50, "b": 40, "c": 30, "d": 60 } + * two.merge(one) // OrderedMap { "b": 20, "a": 10, "d": 60, "c": 30 } + * ``` + * + * Note: `merge` can be used in `withMutations`. + * + * @alias concat + */ + merge( + ...collections: Array> + ): OrderedMap | VC>; + merge( + ...collections: Array<{ [key: string]: C }> + ): OrderedMap | C>; + + concat( + ...collections: Array> + ): OrderedMap | VC>; + concat( + ...collections: Array<{ [key: string]: C }> + ): OrderedMap | C>; + + mergeWith( + merger: (oldVal: V, newVal: VC, key: K) => VCC, + ...collections: Array> + ): OrderedMap; + mergeWith( + merger: (oldVal: V, newVal: C, key: string) => CC, + ...collections: Array<{ [key: string]: C }> + ): OrderedMap; + + mergeDeep( + ...collections: Array> + ): OrderedMap; + mergeDeep( + ...collections: Array<{ [key: string]: C }> + ): OrderedMap; + + // Sequence algorithms + + /** + * Returns a new OrderedMap with values passed through a + * `mapper` function. + * + * OrderedMap({ a: 1, b: 2 }).map(x => 10 * x) + * // OrderedMap { "a": 10, "b": 20 } + * + * Note: `map()` always returns a new instance, even if it produced the same + * value at every step. + */ + map( + mapper: (value: V, key: K, iter: this) => M, + context?: unknown + ): OrderedMap; + + /** + * @see Collection.Keyed.mapKeys + */ + mapKeys( + mapper: (key: K, value: V, iter: this) => M, + context?: unknown + ): OrderedMap; + + /** + * @see Collection.Keyed.mapEntries + */ + mapEntries( + mapper: ( + entry: [K, V], + index: number, + iter: this + ) => [KM, VM] | undefined, + context?: unknown + ): OrderedMap; + + /** + * Flat-maps the OrderedMap, returning a new OrderedMap. + * + * Similar to `data.map(...).flatten(true)`. + */ + flatMap( + mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>, + context?: unknown + ): OrderedMap; + + /** + * Returns a new OrderedMap with only the entries for which the `predicate` + * function returns true. + * + * Note: `filter()` always returns a new instance, even if it results in + * not filtering out any values. + */ + filter( + predicate: (value: V, key: K, iter: this) => value is F, + context?: unknown + ): OrderedMap; + filter( + predicate: (value: V, key: K, iter: this) => unknown, + context?: unknown + ): this; + + /** + * Returns a new OrderedMap with the values for which the `predicate` + * function returns false and another for which is returns true. + */ + partition( + predicate: (this: C, value: V, key: K, iter: this) => value is F, + context?: C + ): [OrderedMap, OrderedMap]; + partition( + predicate: (this: C, value: V, key: K, iter: this) => unknown, + context?: C + ): [this, this]; + + /** + * @see Collection.Keyed.flip + */ + flip(): OrderedMap; + } + + /** + * A Collection of unique values with `O(log32 N)` adds and has. + * + * When iterating a Set, the entries will be (value, value) pairs. Iteration + * order of a Set is undefined, however is stable. Multiple iterations of the + * same Set will iterate in the same order. + * + * Set values, like Map keys, may be of any type. Equality is determined using + * `Immutable.is`, enabling Sets to uniquely include other Immutable + * collections, custom value types, and NaN. + */ + namespace Set { + /** + * True if the provided value is a Set + */ + function isSet(maybeSet: unknown): maybeSet is Set; + + /** + * Creates a new Set containing `values`. + */ + function of(...values: Array): Set; + + /** + * `Set.fromKeys()` creates a new immutable Set containing the keys from + * this Collection or JavaScript Object. + */ + function fromKeys(iter: Collection.Keyed): Set; + function fromKeys(iter: Collection): Set; + function fromKeys(obj: { [key: string]: unknown }): Set; + + /** + * `Set.intersect()` creates a new immutable Set that is the intersection of + * a collection of other sets. + * + * ```js + * const { Set } = require('immutable') + * const intersected = Set.intersect([ + * Set([ 'a', 'b', 'c' ]) + * Set([ 'c', 'a', 't' ]) + * ]) + * // Set [ "a", "c" ] + * ``` + */ + function intersect(sets: Iterable>): Set; + + /** + * `Set.union()` creates a new immutable Set that is the union of a + * collection of other sets. + * + * ```js + * const { Set } = require('immutable') + * const unioned = Set.union([ + * Set([ 'a', 'b', 'c' ]) + * Set([ 'c', 'a', 't' ]) + * ]) + * // Set [ "a", "b", "c", "t" ] + * ``` + */ + function union(sets: Iterable>): Set; + } + + /** + * Create a new immutable Set containing the values of the provided + * collection-like. + * + * Note: `Set` is a factory function and not a class, and does not use the + * `new` keyword during construction. + */ + function Set(collection?: Iterable | ArrayLike): Set; + + interface Set extends Collection.Set { + /** + * The number of items in this Set. + */ + readonly size: number; + + // Persistent changes + + /** + * Returns a new Set which also includes this value. + * + * Note: `add` can be used in `withMutations`. + */ + add(value: T): this; + + /** + * Returns a new Set which excludes this value. + * + * Note: `delete` can be used in `withMutations`. + * + * Note: `delete` **cannot** be safely used in IE8, use `remove` if + * supporting old browsers. + * + * @alias remove + */ + delete(value: T): this; + remove(value: T): this; + + /** + * Returns a new Set containing no values. + * + * Note: `clear` can be used in `withMutations`. + */ + clear(): this; + + /** + * Returns a Set including any value from `collections` that does not already + * exist in this Set. + * + * Note: `union` can be used in `withMutations`. + * @alias merge + * @alias concat + */ + union(...collections: Array>): Set; + merge(...collections: Array>): Set; + concat(...collections: Array>): Set; + + /** + * Returns a Set which has removed any values not also contained + * within `collections`. + * + * Note: `intersect` can be used in `withMutations`. + */ + intersect(...collections: Array>): this; + + /** + * Returns a Set excluding any values contained within `collections`. + * + * + * ```js + * const { OrderedSet } = require('immutable') + * OrderedSet([ 1, 2, 3 ]).subtract([1, 3]) + * // OrderedSet [2] + * ``` + * + * Note: `subtract` can be used in `withMutations`. + */ + subtract(...collections: Array>): this; + + // Transient changes + + /** + * Note: Not all methods can be used on a mutable collection or within + * `withMutations`! Check the documentation for each method to see if it + * mentions being safe to use in `withMutations`. + * + * @see `Map#withMutations` + */ + withMutations(mutator: (mutable: this) => unknown): this; + + /** + * Note: Not all methods can be used on a mutable collection or within + * `withMutations`! Check the documentation for each method to see if it + * mentions being safe to use in `withMutations`. + * + * @see `Map#asMutable` + */ + asMutable(): this; + + /** + * @see `Map#wasAltered` + */ + wasAltered(): boolean; + + /** + * @see `Map#asImmutable` + */ + asImmutable(): this; + + // Sequence algorithms + + /** + * Returns a new Set with values passed through a + * `mapper` function. + * + * Set([1,2]).map(x => 10 * x) + * // Set [10,20] + */ + map( + mapper: (value: T, key: T, iter: this) => M, + context?: unknown + ): Set; + + /** + * Flat-maps the Set, returning a new Set. + * + * Similar to `set.map(...).flatten(true)`. + */ + flatMap( + mapper: (value: T, key: T, iter: this) => Iterable, + context?: unknown + ): Set; + + /** + * Returns a new Set with only the values for which the `predicate` + * function returns true. + * + * Note: `filter()` always returns a new instance, even if it results in + * not filtering out any values. + */ + filter( + predicate: (value: T, key: T, iter: this) => value is F, + context?: unknown + ): Set; + filter( + predicate: (value: T, key: T, iter: this) => unknown, + context?: unknown + ): this; + + /** + * Returns a new Set with the values for which the `predicate` function + * returns false and another for which is returns true. + */ + partition( + predicate: (this: C, value: T, key: T, iter: this) => value is F, + context?: C + ): [Set, Set]; + partition( + predicate: (this: C, value: T, key: T, iter: this) => unknown, + context?: C + ): [this, this]; + + /** + * Returns an OrderedSet of the same type which includes the same entries, + * stably sorted by using a `comparator`. + * + * If a `comparator` is not provided, a default comparator uses `<` and `>`. + * + * `comparator(valueA, valueB)`: + * + * * Returns `0` if the elements should not be swapped. + * * Returns `-1` (or any negative number) if `valueA` comes before `valueB` + * * Returns `1` (or any positive number) if `valueA` comes after `valueB` + * * Alternatively, can return a value of the `PairSorting` enum type + * * Is pure, i.e. it must always return the same value for the same pair + * of values. + * + * + * ```js + * const { Set } = require('immutable') + * Set(['b', 'a', 'c']).sort((a, b) => { + * if (a < b) { return -1; } + * if (a > b) { return 1; } + * if (a === b) { return 0; } + * }); + * // OrderedSet { "a":, "b", "c" } + * ``` + * + * Note: `sort()` Always returns a new instance, even if the original was + * already sorted. + * + * Note: This is always an eager operation. + */ + sort(comparator?: Comparator): this & OrderedSet; + + /** + * Like `sort`, but also accepts a `comparatorValueMapper` which allows for + * sorting by more sophisticated means: + * + * + * ```js + * const { Set } = require('immutable') + * const beattles = Set([ + * { name: "Lennon" }, + * { name: "McCartney" }, + * { name: "Harrison" }, + * { name: "Starr" }, + * ]); + * beattles.sortBy(member => member.name); + * ``` + * + * Note: `sortBy()` Always returns a new instance, even if the original was + * already sorted. + * + * Note: This is always an eager operation. + */ + sortBy( + comparatorValueMapper: (value: T, key: T, iter: this) => C, + comparator?: (valueA: C, valueB: C) => number + ): this & OrderedSet; + } + + /** + * A type of Set that has the additional guarantee that the iteration order of + * values will be the order in which they were `add`ed. + * + * The iteration behavior of OrderedSet is the same as native ES6 Set. + * + * Note that `OrderedSet` are more expensive than non-ordered `Set` and may + * consume more memory. `OrderedSet#add` is amortized O(log32 N), but not + * stable. + */ + namespace OrderedSet { + /** + * True if the provided value is an OrderedSet. + */ + function isOrderedSet( + maybeOrderedSet: unknown + ): maybeOrderedSet is OrderedSet; + + /** + * Creates a new OrderedSet containing `values`. + */ + function of(...values: Array): OrderedSet; + + /** + * `OrderedSet.fromKeys()` creates a new immutable OrderedSet containing + * the keys from this Collection or JavaScript Object. + */ + function fromKeys(iter: Collection.Keyed): OrderedSet; + function fromKeys(iter: Collection): OrderedSet; + function fromKeys(obj: { [key: string]: unknown }): OrderedSet; + } + + /** + * Create a new immutable OrderedSet containing the values of the provided + * collection-like. + * + * Note: `OrderedSet` is a factory function and not a class, and does not use + * the `new` keyword during construction. + */ + function OrderedSet( + collection?: Iterable | ArrayLike + ): OrderedSet; + + interface OrderedSet extends Set, OrderedCollection { + /** + * The number of items in this OrderedSet. + */ + readonly size: number; + + /** + * Returns an OrderedSet including any value from `collections` that does + * not already exist in this OrderedSet. + * + * Note: `union` can be used in `withMutations`. + * @alias merge + * @alias concat + */ + union(...collections: Array>): OrderedSet; + merge(...collections: Array>): OrderedSet; + concat(...collections: Array>): OrderedSet; + + // Sequence algorithms + + /** + * Returns a new Set with values passed through a + * `mapper` function. + * + * OrderedSet([ 1, 2 ]).map(x => 10 * x) + * // OrderedSet [10, 20] + */ + map( + mapper: (value: T, key: T, iter: this) => M, + context?: unknown + ): OrderedSet; + + /** + * Flat-maps the OrderedSet, returning a new OrderedSet. + * + * Similar to `set.map(...).flatten(true)`. + */ + flatMap( + mapper: (value: T, key: T, iter: this) => Iterable, + context?: unknown + ): OrderedSet; + + /** + * Returns a new OrderedSet with only the values for which the `predicate` + * function returns true. + * + * Note: `filter()` always returns a new instance, even if it results in + * not filtering out any values. + */ + filter( + predicate: (value: T, key: T, iter: this) => value is F, + context?: unknown + ): OrderedSet; + filter( + predicate: (value: T, key: T, iter: this) => unknown, + context?: unknown + ): this; + + /** + * Returns a new OrderedSet with the values for which the `predicate` + * function returns false and another for which is returns true. + */ + partition( + predicate: (this: C, value: T, key: T, iter: this) => value is F, + context?: C + ): [OrderedSet, OrderedSet]; + partition( + predicate: (this: C, value: T, key: T, iter: this) => unknown, + context?: C + ): [this, this]; + + /** + * Returns an OrderedSet of the same type "zipped" with the provided + * collections. + * + * Like `zipWith`, but using the default `zipper`: creating an `Array`. + * + * ```js + * const a = OrderedSet([ 1, 2, 3 ]) + * const b = OrderedSet([ 4, 5, 6 ]) + * const c = a.zip(b) + * // OrderedSet [ [ 1, 4 ], [ 2, 5 ], [ 3, 6 ] ] + * ``` + */ + zip(other: Collection): OrderedSet<[T, U]>; + zip( + other1: Collection, + other2: Collection + ): OrderedSet<[T, U, V]>; + zip( + ...collections: Array> + ): OrderedSet; + + /** + * Returns a OrderedSet of the same type "zipped" with the provided + * collections. + * + * Unlike `zip`, `zipAll` continues zipping until the longest collection is + * exhausted. Missing values from shorter collections are filled with `undefined`. + * + * ```js + * const a = OrderedSet([ 1, 2 ]); + * const b = OrderedSet([ 3, 4, 5 ]); + * const c = a.zipAll(b); // OrderedSet [ [ 1, 3 ], [ 2, 4 ], [ undefined, 5 ] ] + * ``` + * + * Note: Since zipAll will return a collection as large as the largest + * input, some results may contain undefined values. TypeScript cannot + * account for these without cases (as of v2.5). + */ + zipAll(other: Collection): OrderedSet<[T, U]>; + zipAll( + other1: Collection, + other2: Collection + ): OrderedSet<[T, U, V]>; + zipAll( + ...collections: Array> + ): OrderedSet; + + /** + * Returns an OrderedSet of the same type "zipped" with the provided + * collections by using a custom `zipper` function. + * + * @see Seq.Indexed.zipWith + */ + zipWith( + zipper: (value: T, otherValue: U) => Z, + otherCollection: Collection + ): OrderedSet; + zipWith( + zipper: (value: T, otherValue: U, thirdValue: V) => Z, + otherCollection: Collection, + thirdCollection: Collection + ): OrderedSet; + zipWith( + zipper: (...values: Array) => Z, + ...collections: Array> + ): OrderedSet; + } + + /** + * Stacks are indexed collections which support very efficient O(1) addition + * and removal from the front using `unshift(v)` and `shift()`. + * + * For familiarity, Stack also provides `push(v)`, `pop()`, and `peek()`, but + * be aware that they also operate on the front of the list, unlike List or + * a JavaScript Array. + * + * Note: `reverse()` or any inherent reverse traversal (`reduceRight`, + * `lastIndexOf`, etc.) is not efficient with a Stack. + * + * Stack is implemented with a Single-Linked List. + */ + namespace Stack { + /** + * True if the provided value is a Stack + */ + function isStack(maybeStack: unknown): maybeStack is Stack; + + /** + * Creates a new Stack containing `values`. + */ + function of(...values: Array): Stack; + } + + /** + * Create a new immutable Stack containing the values of the provided + * collection-like. + * + * The iteration order of the provided collection is preserved in the + * resulting `Stack`. + * + * Note: `Stack` is a factory function and not a class, and does not use the + * `new` keyword during construction. + */ + function Stack(collection?: Iterable | ArrayLike): Stack; + + interface Stack extends Collection.Indexed { + /** + * The number of items in this Stack. + */ + readonly size: number; + + // Reading values + + /** + * Alias for `Stack.first()`. + */ + peek(): T | undefined; + + // Persistent changes + + /** + * Returns a new Stack with 0 size and no values. + * + * Note: `clear` can be used in `withMutations`. + */ + clear(): Stack; + + /** + * Returns a new Stack with the provided `values` prepended, shifting other + * values ahead to higher indices. + * + * This is very efficient for Stack. + * + * Note: `unshift` can be used in `withMutations`. + */ + unshift(...values: Array): Stack; + + /** + * Like `Stack#unshift`, but accepts a collection rather than varargs. + * + * Note: `unshiftAll` can be used in `withMutations`. + */ + unshiftAll(iter: Iterable): Stack; + + /** + * Returns a new Stack with a size ones less than this Stack, excluding + * the first item in this Stack, shifting all other values to a lower index. + * + * Note: this differs from `Array#shift` because it returns a new + * Stack rather than the removed value. Use `first()` or `peek()` to get the + * first value in this Stack. + * + * Note: `shift` can be used in `withMutations`. + */ + shift(): Stack; + + /** + * Alias for `Stack#unshift` and is not equivalent to `List#push`. + */ + push(...values: Array): Stack; + + /** + * Alias for `Stack#unshiftAll`. + */ + pushAll(iter: Iterable): Stack; + + /** + * Alias for `Stack#shift` and is not equivalent to `List#pop`. + */ + pop(): Stack; + + // Transient changes + + /** + * Note: Not all methods can be used on a mutable collection or within + * `withMutations`! Check the documentation for each method to see if it + * mentions being safe to use in `withMutations`. + * + * @see `Map#withMutations` + */ + withMutations(mutator: (mutable: this) => unknown): this; + + /** + * Note: Not all methods can be used on a mutable collection or within + * `withMutations`! Check the documentation for each method to see if it + * mentions being safe to use in `withMutations`. + * + * @see `Map#asMutable` + */ + asMutable(): this; + + /** + * @see `Map#wasAltered` + */ + wasAltered(): boolean; + + /** + * @see `Map#asImmutable` + */ + asImmutable(): this; + + // Sequence algorithms + + /** + * Returns a new Stack with other collections concatenated to this one. + */ + concat(...valuesOrCollections: Array | C>): Stack; + + /** + * Returns a new Stack with values passed through a + * `mapper` function. + * + * Stack([ 1, 2 ]).map(x => 10 * x) + * // Stack [ 10, 20 ] + * + * Note: `map()` always returns a new instance, even if it produced the same + * value at every step. + */ + map( + mapper: (value: T, key: number, iter: this) => M, + context?: unknown + ): Stack; + + /** + * Flat-maps the Stack, returning a new Stack. + * + * Similar to `stack.map(...).flatten(true)`. + */ + flatMap( + mapper: (value: T, key: number, iter: this) => Iterable, + context?: unknown + ): Stack; + + /** + * Returns a new Set with only the values for which the `predicate` + * function returns true. + * + * Note: `filter()` always returns a new instance, even if it results in + * not filtering out any values. + */ + filter( + predicate: (value: T, index: number, iter: this) => value is F, + context?: unknown + ): Set; + filter( + predicate: (value: T, index: number, iter: this) => unknown, + context?: unknown + ): this; + + /** + * Returns a Stack "zipped" with the provided collections. + * + * Like `zipWith`, but using the default `zipper`: creating an `Array`. + * + * ```js + * const a = Stack([ 1, 2, 3 ]); + * const b = Stack([ 4, 5, 6 ]); + * const c = a.zip(b); // Stack [ [ 1, 4 ], [ 2, 5 ], [ 3, 6 ] ] + * ``` + */ + zip(other: Collection): Stack<[T, U]>; + zip( + other: Collection, + other2: Collection + ): Stack<[T, U, V]>; + zip(...collections: Array>): Stack; + + /** + * Returns a Stack "zipped" with the provided collections. + * + * Unlike `zip`, `zipAll` continues zipping until the longest collection is + * exhausted. Missing values from shorter collections are filled with `undefined`. + * + * ```js + * const a = Stack([ 1, 2 ]); + * const b = Stack([ 3, 4, 5 ]); + * const c = a.zipAll(b); // Stack [ [ 1, 3 ], [ 2, 4 ], [ undefined, 5 ] ] + * ``` + * + * Note: Since zipAll will return a collection as large as the largest + * input, some results may contain undefined values. TypeScript cannot + * account for these without cases (as of v2.5). + */ + zipAll(other: Collection): Stack<[T, U]>; + zipAll( + other: Collection, + other2: Collection + ): Stack<[T, U, V]>; + zipAll(...collections: Array>): Stack; + + /** + * Returns a Stack "zipped" with the provided collections by using a + * custom `zipper` function. + * + * ```js + * const a = Stack([ 1, 2, 3 ]); + * const b = Stack([ 4, 5, 6 ]); + * const c = a.zipWith((a, b) => a + b, b); + * // Stack [ 5, 7, 9 ] + * ``` + */ + zipWith( + zipper: (value: T, otherValue: U) => Z, + otherCollection: Collection + ): Stack; + zipWith( + zipper: (value: T, otherValue: U, thirdValue: V) => Z, + otherCollection: Collection, + thirdCollection: Collection + ): Stack; + zipWith( + zipper: (...values: Array) => Z, + ...collections: Array> + ): Stack; + } + + /** + * Returns a Seq.Indexed of numbers from `start` (inclusive) to `end` + * (exclusive), by `step`, where `start` defaults to 0, `step` to 1, and `end` to + * infinity. When `start` is equal to `end`, returns empty range. + * + * Note: `Range` is a factory function and not a class, and does not use the + * `new` keyword during construction. + * + * ```js + * const { Range } = require('immutable') + * Range() // [ 0, 1, 2, 3, ... ] + * Range(10) // [ 10, 11, 12, 13, ... ] + * Range(10, 15) // [ 10, 11, 12, 13, 14 ] + * Range(10, 30, 5) // [ 10, 15, 20, 25 ] + * Range(30, 10, 5) // [ 30, 25, 20, 15 ] + * Range(30, 30, 5) // [] + * ``` + */ + function Range( + start: number, + end: number, + step?: number + ): Seq.Indexed; + + /** + * Returns a Seq.Indexed of `value` repeated `times` times. When `times` is + * not defined, returns an infinite `Seq` of `value`. + * + * Note: `Repeat` is a factory function and not a class, and does not use the + * `new` keyword during construction. + * + * ```js + * const { Repeat } = require('immutable') + * Repeat('foo') // [ 'foo', 'foo', 'foo', ... ] + * Repeat('bar', 4) // [ 'bar', 'bar', 'bar', 'bar' ] + * ``` + */ + function Repeat(value: T, times?: number): Seq.Indexed; + + /** + * A record is similar to a JS object, but enforces a specific set of allowed + * string keys, and has default values. + * + * The `Record()` function produces new Record Factories, which when called + * create Record instances. + * + * ```js + * const { Record } = require('immutable') + * const ABRecord = Record({ a: 1, b: 2 }) + * const myRecord = ABRecord({ b: 3 }) + * ``` + * + * Records always have a value for the keys they define. `remove`ing a key + * from a record simply resets it to the default value for that key. + * + * ```js + * myRecord.get('a') // 1 + * myRecord.get('b') // 3 + * const myRecordWithoutB = myRecord.remove('b') + * myRecordWithoutB.get('b') // 2 + * ``` + * + * Values provided to the constructor not found in the Record type will + * be ignored. For example, in this case, ABRecord is provided a key "x" even + * though only "a" and "b" have been defined. The value for "x" will be + * ignored for this record. + * + * ```js + * const myRecord = ABRecord({ b: 3, x: 10 }) + * myRecord.get('x') // undefined + * ``` + * + * Because Records have a known set of string keys, property get access works + * as expected, however property sets will throw an Error. + * + * Note: IE8 does not support property access. Only use `get()` when + * supporting IE8. + * + * ```js + * myRecord.b // 3 + * myRecord.b = 5 // throws Error + * ``` + * + * Record Types can be extended as well, allowing for custom methods on your + * Record. This is not a common pattern in functional environments, but is in + * many JS programs. + * + * However Record Types are more restricted than typical JavaScript classes. + * They do not use a class constructor, which also means they cannot use + * class properties (since those are technically part of a constructor). + * + * While Record Types can be syntactically created with the JavaScript `class` + * form, the resulting Record function is actually a factory function, not a + * class constructor. Even though Record Types are not classes, JavaScript + * currently requires the use of `new` when creating new Record instances if + * they are defined as a `class`. + * + * ``` + * class ABRecord extends Record({ a: 1, b: 2 }) { + * getAB() { + * return this.a + this.b; + * } + * } + * + * var myRecord = new ABRecord({b: 3}) + * myRecord.getAB() // 4 + * ``` + * + * + * **Flow Typing Records:** + * + * Immutable.js exports two Flow types designed to make it easier to use + * Records with flow typed code, `RecordOf` and `RecordFactory`. + * + * When defining a new kind of Record factory function, use a flow type that + * describes the values the record contains along with `RecordFactory`. + * To type instances of the Record (which the factory function returns), + * use `RecordOf`. + * + * Typically, new Record definitions will export both the Record factory + * function as well as the Record instance type for use in other code. + * + * ```js + * import type { RecordFactory, RecordOf } from 'immutable'; + * + * // Use RecordFactory for defining new Record factory functions. + * type Point3DProps = { x: number, y: number, z: number }; + * const defaultValues: Point3DProps = { x: 0, y: 0, z: 0 }; + * const makePoint3D: RecordFactory = Record(defaultValues); + * export makePoint3D; + * + * // Use RecordOf for defining new instances of that Record. + * export type Point3D = RecordOf; + * const some3DPoint: Point3D = makePoint3D({ x: 10, y: 20, z: 30 }); + * ``` + * + * **Flow Typing Record Subclasses:** + * + * Records can be subclassed as a means to add additional methods to Record + * instances. This is generally discouraged in favor of a more functional API, + * since Subclasses have some minor overhead. However the ability to create + * a rich API on Record types can be quite valuable. + * + * When using Flow to type Subclasses, do not use `RecordFactory`, + * instead apply the props type when subclassing: + * + * ```js + * type PersonProps = {name: string, age: number}; + * const defaultValues: PersonProps = {name: 'Aristotle', age: 2400}; + * const PersonRecord = Record(defaultValues); + * class Person extends PersonRecord { + * getName(): string { + * return this.get('name') + * } + * + * setName(name: string): this { + * return this.set('name', name); + * } + * } + * ``` + * + * **Choosing Records vs plain JavaScript objects** + * + * Records offer a persistently immutable alternative to plain JavaScript + * objects, however they're not required to be used within Immutable.js + * collections. In fact, the deep-access and deep-updating functions + * like `getIn()` and `setIn()` work with plain JavaScript Objects as well. + * + * Deciding to use Records or Objects in your application should be informed + * by the tradeoffs and relative benefits of each: + * + * - *Runtime immutability*: plain JS objects may be carefully treated as + * immutable, however Record instances will *throw* if attempted to be + * mutated directly. Records provide this additional guarantee, however at + * some marginal runtime cost. While JS objects are mutable by nature, the + * use of type-checking tools like [Flow](https://medium.com/@gcanti/immutability-with-flow-faa050a1aef4) + * can help gain confidence in code written to favor immutability. + * + * - *Value equality*: Records use value equality when compared with `is()` + * or `record.equals()`. That is, two Records with the same keys and values + * are equal. Plain objects use *reference equality*. Two objects with the + * same keys and values are not equal since they are different objects. + * This is important to consider when using objects as keys in a `Map` or + * values in a `Set`, which use equality when retrieving values. + * + * - *API methods*: Records have a full featured API, with methods like + * `.getIn()`, and `.equals()`. These can make working with these values + * easier, but comes at the cost of not allowing keys with those names. + * + * - *Default values*: Records provide default values for every key, which + * can be useful when constructing Records with often unchanging values. + * However default values can make using Flow and TypeScript more laborious. + * + * - *Serialization*: Records use a custom internal representation to + * efficiently store and update their values. Converting to and from this + * form isn't free. If converting Records to plain objects is common, + * consider sticking with plain objects to begin with. + */ + namespace Record { + /** + * True if `maybeRecord` is an instance of a Record. + */ + function isRecord(maybeRecord: unknown): maybeRecord is Record; + + /** + * Records allow passing a second parameter to supply a descriptive name + * that appears when converting a Record to a string or in any error + * messages. A descriptive name for any record can be accessed by using this + * method. If one was not provided, the string "Record" is returned. + * + * ```js + * const { Record } = require('immutable') + * const Person = Record({ + * name: null + * }, 'Person') + * + * var me = Person({ name: 'My Name' }) + * me.toString() // "Person { "name": "My Name" }" + * Record.getDescriptiveName(me) // "Person" + * ``` + */ + function getDescriptiveName( + record: RecordOf + ): string; + + /** + * A Record.Factory is created by the `Record()` function. Record instances + * are created by passing it some of the accepted values for that Record + * type: + * + * + * ```js + * // makePerson is a Record Factory function + * const makePerson = Record({ name: null, favoriteColor: 'unknown' }); + * + * // alan is a Record instance + * const alan = makePerson({ name: 'Alan' }); + * ``` + * + * Note that Record Factories return `Record & Readonly`, + * this allows use of both the Record instance API, and direct property + * access on the resulting instances: + * + * + * ```js + * // Use the Record API + * console.log('Record API: ' + alan.get('name')) + * + * // Or direct property access (Readonly) + * console.log('property access: ' + alan.name) + * ``` + * + * **Flow Typing Records:** + * + * Use the `RecordFactory` Flow type to get high quality type checking of + * Records: + * + * ```js + * import type { RecordFactory, RecordOf } from 'immutable'; + * + * // Use RecordFactory for defining new Record factory functions. + * type PersonProps = { name: ?string, favoriteColor: string }; + * const makePerson: RecordFactory = Record({ name: null, favoriteColor: 'unknown' }); + * + * // Use RecordOf for defining new instances of that Record. + * type Person = RecordOf; + * const alan: Person = makePerson({ name: 'Alan' }); + * ``` + */ + namespace Factory {} + + interface Factory { + ( + values?: Partial | Iterable<[string, unknown]> + ): RecordOf; + new ( + values?: Partial | Iterable<[string, unknown]> + ): RecordOf; + + /** + * The name provided to `Record(values, name)` can be accessed with + * `displayName`. + */ + displayName: string; + } + + function Factory( + values?: Partial | Iterable<[string, unknown]> + ): RecordOf; + } + + /** + * Unlike other types in Immutable.js, the `Record()` function creates a new + * Record Factory, which is a function that creates Record instances. + * + * See above for examples of using `Record()`. + * + * Note: `Record` is a factory function and not a class, and does not use the + * `new` keyword during construction. + */ + function Record( + defaultValues: TProps, + name?: string + ): Record.Factory; + + interface Record { + // Reading values + + has(key: string): key is keyof TProps & string; + + /** + * Returns the value associated with the provided key, which may be the + * default value defined when creating the Record factory function. + * + * If the requested key is not defined by this Record type, then + * notSetValue will be returned if provided. Note that this scenario would + * produce an error when using Flow or TypeScript. + */ + get(key: K, notSetValue?: unknown): TProps[K]; + get(key: string, notSetValue: T): T; + + // Reading deep values + + hasIn(keyPath: Iterable): boolean; + getIn(keyPath: Iterable): unknown; + + // Value equality + + equals(other: unknown): boolean; + hashCode(): number; + + // Persistent changes + + set(key: K, value: TProps[K]): this; + update( + key: K, + updater: (value: TProps[K]) => TProps[K] + ): this; + merge( + ...collections: Array | Iterable<[string, unknown]>> + ): this; + mergeDeep( + ...collections: Array | Iterable<[string, unknown]>> + ): this; + + mergeWith( + merger: (oldVal: unknown, newVal: unknown, key: keyof TProps) => unknown, + ...collections: Array | Iterable<[string, unknown]>> + ): this; + mergeDeepWith( + merger: (oldVal: unknown, newVal: unknown, key: unknown) => unknown, + ...collections: Array | Iterable<[string, unknown]>> + ): this; + + /** + * Returns a new instance of this Record type with the value for the + * specific key set to its default value. + * + * @alias remove + */ + delete(key: K): this; + remove(key: K): this; + + /** + * Returns a new instance of this Record type with all values set + * to their default values. + */ + clear(): this; + + // Deep persistent changes + + setIn(keyPath: Iterable, value: unknown): this; + updateIn( + keyPath: Iterable, + updater: (value: unknown) => unknown + ): this; + mergeIn(keyPath: Iterable, ...collections: Array): this; + mergeDeepIn( + keyPath: Iterable, + ...collections: Array + ): this; + + /** + * @alias removeIn + */ + deleteIn(keyPath: Iterable): this; + removeIn(keyPath: Iterable): this; + + // Conversion to JavaScript types + + /** + * Deeply converts this Record to equivalent native JavaScript Object. + * + * Note: This method may not be overridden. Objects with custom + * serialization to plain JS may override toJSON() instead. + */ + toJS(): DeepCopy; + + /** + * Shallowly converts this Record to equivalent native JavaScript Object. + */ + toJSON(): TProps; + + /** + * Shallowly converts this Record to equivalent JavaScript Object. + */ + toObject(): TProps; + + // Transient changes + + /** + * Note: Not all methods can be used on a mutable collection or within + * `withMutations`! Only `set` may be used mutatively. + * + * @see `Map#withMutations` + */ + withMutations(mutator: (mutable: this) => unknown): this; + + /** + * @see `Map#asMutable` + */ + asMutable(): this; + + /** + * @see `Map#wasAltered` + */ + wasAltered(): boolean; + + /** + * @see `Map#asImmutable` + */ + asImmutable(): this; + + // Sequence algorithms + + toSeq(): Seq.Keyed; + + [Symbol.iterator](): IterableIterator<[keyof TProps, TProps[keyof TProps]]>; + } + + /** + * RecordOf is used in TypeScript to define interfaces expecting an + * instance of record with type T. + * + * This is equivalent to an instance of a record created by a Record Factory. + */ + type RecordOf = Record & Readonly; + + /** + * `Seq` describes a lazy operation, allowing them to efficiently chain + * use of all the higher-order collection methods (such as `map` and `filter`) + * by not creating intermediate collections. + * + * **Seq is immutable** — Once a Seq is created, it cannot be + * changed, appended to, rearranged or otherwise modified. Instead, any + * mutative method called on a `Seq` will return a new `Seq`. + * + * **Seq is lazy** — `Seq` does as little work as necessary to respond to any + * method call. Values are often created during iteration, including implicit + * iteration when reducing or converting to a concrete data structure such as + * a `List` or JavaScript `Array`. + * + * For example, the following performs no work, because the resulting + * `Seq`'s values are never iterated: + * + * ```js + * const { Seq } = require('immutable') + * const oddSquares = Seq([ 1, 2, 3, 4, 5, 6, 7, 8 ]) + * .filter(x => x % 2 !== 0) + * .map(x => x * x) + * ``` + * + * Once the `Seq` is used, it performs only the work necessary. In this + * example, no intermediate arrays are ever created, filter is called three + * times, and map is only called once: + * + * ```js + * oddSquares.get(1); // 9 + * ``` + * + * Any collection can be converted to a lazy Seq with `Seq()`. + * + * + * ```js + * const { Map } = require('immutable') + * const map = Map({ a: 1, b: 2, c: 3 }) + * const lazySeq = Seq(map) + * ``` + * + * `Seq` allows for the efficient chaining of operations, allowing for the + * expression of logic that can otherwise be very tedious: + * + * ```js + * lazySeq + * .flip() + * .map(key => key.toUpperCase()) + * .flip() + * // Seq { A: 1, B: 1, C: 1 } + * ``` + * + * As well as expressing logic that would otherwise seem memory or time + * limited, for example `Range` is a special kind of Lazy sequence. + * + * + * ```js + * const { Range } = require('immutable') + * Range(1, Infinity) + * .skip(1000) + * .map(n => -n) + * .filter(n => n % 2 === 0) + * .take(2) + * .reduce((r, n) => r * n, 1) + * // 1006008 + * ``` + * + * Seq is often used to provide a rich collection API to JavaScript Object. + * + * ```js + * Seq({ x: 0, y: 1, z: 2 }).map(v => v * 2).toObject(); + * // { x: 0, y: 2, z: 4 } + * ``` + */ + + namespace Seq { + /** + * True if `maybeSeq` is a Seq, it is not backed by a concrete + * structure such as Map, List, or Set. + */ + function isSeq( + maybeSeq: unknown + ): maybeSeq is + | Seq.Indexed + | Seq.Keyed + | Seq.Set; + + /** + * `Seq` which represents key-value pairs. + */ + namespace Keyed {} + + /** + * Always returns a Seq.Keyed, if input is not keyed, expects an + * collection of [K, V] tuples. + * + * Note: `Seq.Keyed` is a conversion function and not a class, and does not + * use the `new` keyword during construction. + */ + function Keyed(collection?: Iterable<[K, V]>): Seq.Keyed; + function Keyed(obj: { [key: string]: V }): Seq.Keyed; + + interface Keyed extends Seq, Collection.Keyed { + /** + * Deeply converts this Keyed Seq to equivalent native JavaScript Object. + * + * Converts keys to Strings. + */ + toJS(): { [key in PropertyKey]: DeepCopy }; + + /** + * Shallowly converts this Keyed Seq to equivalent native JavaScript Object. + * + * Converts keys to Strings. + */ + toJSON(): { [key in PropertyKey]: V }; + + /** + * Shallowly converts this collection to an Array. + */ + toArray(): Array<[K, V]>; + + /** + * Returns itself + */ + toSeq(): this; + + /** + * Returns a new Seq with other collections concatenated to this one. + * + * All entries will be present in the resulting Seq, even if they + * have the same key. + */ + concat( + ...collections: Array> + ): Seq.Keyed; + concat( + ...collections: Array<{ [key: string]: C }> + ): Seq.Keyed; + + /** + * Returns a new Seq.Keyed with values passed through a + * `mapper` function. + * + * ```js + * const { Seq } = require('immutable') + * Seq.Keyed({ a: 1, b: 2 }).map(x => 10 * x) + * // Seq { "a": 10, "b": 20 } + * ``` + * + * Note: `map()` always returns a new instance, even if it produced the + * same value at every step. + */ + map( + mapper: (value: V, key: K, iter: this) => M, + context?: unknown + ): Seq.Keyed; + + /** + * @see Collection.Keyed.mapKeys + */ + mapKeys( + mapper: (key: K, value: V, iter: this) => M, + context?: unknown + ): Seq.Keyed; + + /** + * @see Collection.Keyed.mapEntries + */ + mapEntries( + mapper: ( + entry: [K, V], + index: number, + iter: this + ) => [KM, VM] | undefined, + context?: unknown + ): Seq.Keyed; + + /** + * Flat-maps the Seq, returning a Seq of the same type. + * + * Similar to `seq.map(...).flatten(true)`. + */ + flatMap( + mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>, + context?: unknown + ): Seq.Keyed; + + /** + * Returns a new Seq with only the entries for which the `predicate` + * function returns true. + * + * Note: `filter()` always returns a new instance, even if it results in + * not filtering out any values. + */ + filter( + predicate: (value: V, key: K, iter: this) => value is F, + context?: unknown + ): Seq.Keyed; + filter( + predicate: (value: V, key: K, iter: this) => unknown, + context?: unknown + ): this; + + /** + * Returns a new keyed Seq with the values for which the `predicate` + * function returns false and another for which is returns true. + */ + partition( + predicate: (this: C, value: V, key: K, iter: this) => value is F, + context?: C + ): [Seq.Keyed, Seq.Keyed]; + partition( + predicate: (this: C, value: V, key: K, iter: this) => unknown, + context?: C + ): [this, this]; + + /** + * @see Collection.Keyed.flip + */ + flip(): Seq.Keyed; + + [Symbol.iterator](): IterableIterator<[K, V]>; + } + + /** + * `Seq` which represents an ordered indexed list of values. + */ + namespace Indexed { + /** + * Provides an Seq.Indexed of the values provided. + */ + function of(...values: Array): Seq.Indexed; + } + + /** + * Always returns Seq.Indexed, discarding associated keys and + * supplying incrementing indices. + * + * Note: `Seq.Indexed` is a conversion function and not a class, and does + * not use the `new` keyword during construction. + */ + function Indexed( + collection?: Iterable | ArrayLike + ): Seq.Indexed; + + interface Indexed extends Seq, Collection.Indexed { + /** + * Deeply converts this Indexed Seq to equivalent native JavaScript Array. + */ + toJS(): Array>; + + /** + * Shallowly converts this Indexed Seq to equivalent native JavaScript Array. + */ + toJSON(): Array; + + /** + * Shallowly converts this collection to an Array. + */ + toArray(): Array; + + /** + * Returns itself + */ + toSeq(): this; + + /** + * Returns a new Seq with other collections concatenated to this one. + */ + concat( + ...valuesOrCollections: Array | C> + ): Seq.Indexed; + + /** + * Returns a new Seq.Indexed with values passed through a + * `mapper` function. + * + * ```js + * const { Seq } = require('immutable') + * Seq.Indexed([ 1, 2 ]).map(x => 10 * x) + * // Seq [ 10, 20 ] + * ``` + * + * Note: `map()` always returns a new instance, even if it produced the + * same value at every step. + */ + map( + mapper: (value: T, key: number, iter: this) => M, + context?: unknown + ): Seq.Indexed; + + /** + * Flat-maps the Seq, returning a a Seq of the same type. + * + * Similar to `seq.map(...).flatten(true)`. + */ + flatMap( + mapper: (value: T, key: number, iter: this) => Iterable, + context?: unknown + ): Seq.Indexed; + + /** + * Returns a new Seq with only the values for which the `predicate` + * function returns true. + * + * Note: `filter()` always returns a new instance, even if it results in + * not filtering out any values. + */ + filter( + predicate: (value: T, index: number, iter: this) => value is F, + context?: unknown + ): Seq.Indexed; + filter( + predicate: (value: T, index: number, iter: this) => unknown, + context?: unknown + ): this; + + /** + * Returns a new indexed Seq with the values for which the `predicate` + * function returns false and another for which is returns true. + */ + partition( + predicate: (this: C, value: T, index: number, iter: this) => value is F, + context?: C + ): [Seq.Indexed, Seq.Indexed]; + partition( + predicate: (this: C, value: T, index: number, iter: this) => unknown, + context?: C + ): [this, this]; + + /** + * Returns a Seq "zipped" with the provided collections. + * + * Like `zipWith`, but using the default `zipper`: creating an `Array`. + * + * ```js + * const a = Seq([ 1, 2, 3 ]); + * const b = Seq([ 4, 5, 6 ]); + * const c = a.zip(b); // Seq [ [ 1, 4 ], [ 2, 5 ], [ 3, 6 ] ] + * ``` + */ + zip(other: Collection): Seq.Indexed<[T, U]>; + zip( + other: Collection, + other2: Collection + ): Seq.Indexed<[T, U, V]>; + zip( + ...collections: Array> + ): Seq.Indexed; + + /** + * Returns a Seq "zipped" with the provided collections. + * + * Unlike `zip`, `zipAll` continues zipping until the longest collection is + * exhausted. Missing values from shorter collections are filled with `undefined`. + * + * ```js + * const a = Seq([ 1, 2 ]); + * const b = Seq([ 3, 4, 5 ]); + * const c = a.zipAll(b); // Seq [ [ 1, 3 ], [ 2, 4 ], [ undefined, 5 ] ] + * ``` + */ + zipAll(other: Collection): Seq.Indexed<[T, U]>; + zipAll( + other: Collection, + other2: Collection + ): Seq.Indexed<[T, U, V]>; + zipAll( + ...collections: Array> + ): Seq.Indexed; + + /** + * Returns a Seq "zipped" with the provided collections by using a + * custom `zipper` function. + * + * ```js + * const a = Seq([ 1, 2, 3 ]); + * const b = Seq([ 4, 5, 6 ]); + * const c = a.zipWith((a, b) => a + b, b); + * // Seq [ 5, 7, 9 ] + * ``` + */ + zipWith( + zipper: (value: T, otherValue: U) => Z, + otherCollection: Collection + ): Seq.Indexed; + zipWith( + zipper: (value: T, otherValue: U, thirdValue: V) => Z, + otherCollection: Collection, + thirdCollection: Collection + ): Seq.Indexed; + zipWith( + zipper: (...values: Array) => Z, + ...collections: Array> + ): Seq.Indexed; + + [Symbol.iterator](): IterableIterator; + } + + /** + * `Seq` which represents a set of values. + * + * Because `Seq` are often lazy, `Seq.Set` does not provide the same guarantee + * of value uniqueness as the concrete `Set`. + */ + namespace Set { + /** + * Returns a Seq.Set of the provided values + */ + function of(...values: Array): Seq.Set; + } + + /** + * Always returns a Seq.Set, discarding associated indices or keys. + * + * Note: `Seq.Set` is a conversion function and not a class, and does not + * use the `new` keyword during construction. + */ + function Set(collection?: Iterable | ArrayLike): Seq.Set; + + interface Set extends Seq, Collection.Set { + /** + * Deeply converts this Set Seq to equivalent native JavaScript Array. + */ + toJS(): Array>; + + /** + * Shallowly converts this Set Seq to equivalent native JavaScript Array. + */ + toJSON(): Array; + + /** + * Shallowly converts this collection to an Array. + */ + toArray(): Array; + + /** + * Returns itself + */ + toSeq(): this; + + /** + * Returns a new Seq with other collections concatenated to this one. + * + * All entries will be present in the resulting Seq, even if they + * are duplicates. + */ + concat(...collections: Array>): Seq.Set; + + /** + * Returns a new Seq.Set with values passed through a + * `mapper` function. + * + * ```js + * Seq.Set([ 1, 2 ]).map(x => 10 * x) + * // Seq { 10, 20 } + * ``` + * + * Note: `map()` always returns a new instance, even if it produced the + * same value at every step. + */ + map( + mapper: (value: T, key: T, iter: this) => M, + context?: unknown + ): Seq.Set; + + /** + * Flat-maps the Seq, returning a Seq of the same type. + * + * Similar to `seq.map(...).flatten(true)`. + */ + flatMap( + mapper: (value: T, key: T, iter: this) => Iterable, + context?: unknown + ): Seq.Set; + + /** + * Returns a new Seq with only the values for which the `predicate` + * function returns true. + * + * Note: `filter()` always returns a new instance, even if it results in + * not filtering out any values. + */ + filter( + predicate: (value: T, key: T, iter: this) => value is F, + context?: unknown + ): Seq.Set; + filter( + predicate: (value: T, key: T, iter: this) => unknown, + context?: unknown + ): this; + + /** + * Returns a new set Seq with the values for which the `predicate` + * function returns false and another for which is returns true. + */ + partition( + predicate: (this: C, value: T, key: T, iter: this) => value is F, + context?: C + ): [Seq.Set, Seq.Set]; + partition( + predicate: (this: C, value: T, key: T, iter: this) => unknown, + context?: C + ): [this, this]; + + [Symbol.iterator](): IterableIterator; + } + } + + /** + * Creates a Seq. + * + * Returns a particular kind of `Seq` based on the input. + * + * * If a `Seq`, that same `Seq`. + * * If an `Collection`, a `Seq` of the same kind (Keyed, Indexed, or Set). + * * If an Array-like, an `Seq.Indexed`. + * * If an Iterable Object, an `Seq.Indexed`. + * * If an Object, a `Seq.Keyed`. + * + * Note: An Iterator itself will be treated as an object, becoming a `Seq.Keyed`, + * which is usually not what you want. You should turn your Iterator Object into + * an iterable object by defining a Symbol.iterator (or @@iterator) method which + * returns `this`. + * + * Note: `Seq` is a conversion function and not a class, and does not use the + * `new` keyword during construction. + */ + function Seq>(seq: S): S; + function Seq(collection: Collection.Keyed): Seq.Keyed; + function Seq(collection: Collection.Set): Seq.Set; + function Seq( + collection: Collection.Indexed | Iterable | ArrayLike + ): Seq.Indexed; + function Seq(obj: { [key: string]: V }): Seq.Keyed; + function Seq(): Seq; + + interface Seq extends Collection { + /** + * Some Seqs can describe their size lazily. When this is the case, + * size will be an integer. Otherwise it will be undefined. + * + * For example, Seqs returned from `map()` or `reverse()` + * preserve the size of the original `Seq` while `filter()` does not. + * + * Note: `Range`, `Repeat` and `Seq`s made from `Array`s and `Object`s will + * always have a size. + */ + readonly size: number | undefined; + + // Force evaluation + + /** + * Because Sequences are lazy and designed to be chained together, they do + * not cache their results. For example, this map function is called a total + * of 6 times, as each `join` iterates the Seq of three values. + * + * var squares = Seq([ 1, 2, 3 ]).map(x => x * x) + * squares.join() + squares.join() + * + * If you know a `Seq` will be used multiple times, it may be more + * efficient to first cache it in memory. Here, the map function is called + * only 3 times. + * + * var squares = Seq([ 1, 2, 3 ]).map(x => x * x).cacheResult() + * squares.join() + squares.join() + * + * Use this method judiciously, as it must fully evaluate a Seq which can be + * a burden on memory and possibly performance. + * + * Note: after calling `cacheResult`, a Seq will always have a `size`. + */ + cacheResult(): this; + + // Sequence algorithms + + /** + * Returns a new Seq with values passed through a + * `mapper` function. + * + * ```js + * const { Seq } = require('immutable') + * Seq([ 1, 2 ]).map(x => 10 * x) + * // Seq [ 10, 20 ] + * ``` + * + * Note: `map()` always returns a new instance, even if it produced the same + * value at every step. + */ + map( + mapper: (value: V, key: K, iter: this) => M, + context?: unknown + ): Seq; + + /** + * Returns a new Seq with values passed through a + * `mapper` function. + * + * ```js + * const { Seq } = require('immutable') + * Seq([ 1, 2 ]).map(x => 10 * x) + * // Seq [ 10, 20 ] + * ``` + * + * Note: `map()` always returns a new instance, even if it produced the same + * value at every step. + * Note: used only for sets. + */ + map( + mapper: (value: V, key: K, iter: this) => M, + context?: unknown + ): Seq; + + /** + * Flat-maps the Seq, returning a Seq of the same type. + * + * Similar to `seq.map(...).flatten(true)`. + */ + flatMap( + mapper: (value: V, key: K, iter: this) => Iterable, + context?: unknown + ): Seq; + + /** + * Flat-maps the Seq, returning a Seq of the same type. + * + * Similar to `seq.map(...).flatten(true)`. + * Note: Used only for sets. + */ + flatMap( + mapper: (value: V, key: K, iter: this) => Iterable, + context?: unknown + ): Seq; + + /** + * Returns a new Seq with only the values for which the `predicate` + * function returns true. + * + * Note: `filter()` always returns a new instance, even if it results in + * not filtering out any values. + */ + filter( + predicate: (value: V, key: K, iter: this) => value is F, + context?: unknown + ): Seq; + filter( + predicate: (value: V, key: K, iter: this) => unknown, + context?: unknown + ): this; + + /** + * Returns a new Seq with the values for which the `predicate` function + * returns false and another for which is returns true. + */ + partition( + predicate: (this: C, value: V, key: K, iter: this) => value is F, + context?: C + ): [Seq, Seq]; + partition( + predicate: (this: C, value: V, key: K, iter: this) => unknown, + context?: C + ): [this, this]; + + /** + * Returns a new Sequence of the same type with other values and + * collection-like concatenated to this one. + * + * All entries will be present in the resulting Seq, even if they + * have the same key. + */ + concat(...valuesOrCollections: Array): Seq; + } + + /** + * The `Collection` is a set of (key, value) entries which can be iterated, and + * is the base class for all collections in `immutable`, allowing them to + * make use of all the Collection methods (such as `map` and `filter`). + * + * Note: A collection is always iterated in the same order, however that order + * may not always be well defined, as is the case for the `Map` and `Set`. + * + * Collection is the abstract base class for concrete data structures. It + * cannot be constructed directly. + * + * Implementations should extend one of the subclasses, `Collection.Keyed`, + * `Collection.Indexed`, or `Collection.Set`. + */ + namespace Collection { + /** + * Keyed Collections have discrete keys tied to each value. + * + * When iterating `Collection.Keyed`, each iteration will yield a `[K, V]` + * tuple, in other words, `Collection#entries` is the default iterator for + * Keyed Collections. + */ + namespace Keyed {} + + /** + * Creates a Collection.Keyed + * + * Similar to `Collection()`, however it expects collection-likes of [K, V] + * tuples if not constructed from a Collection.Keyed or JS Object. + * + * Note: `Collection.Keyed` is a conversion function and not a class, and + * does not use the `new` keyword during construction. + */ + function Keyed(collection?: Iterable<[K, V]>): Collection.Keyed; + function Keyed(obj: { [key: string]: V }): Collection.Keyed; + + interface Keyed extends Collection { + /** + * Deeply converts this Keyed collection to equivalent native JavaScript Object. + * + * Converts keys to Strings. + */ + toJS(): { [key in PropertyKey]: DeepCopy }; + + /** + * Shallowly converts this Keyed collection to equivalent native JavaScript Object. + * + * Converts keys to Strings. + */ + toJSON(): { [key in PropertyKey]: V }; + + /** + * Shallowly converts this collection to an Array. + */ + toArray(): Array<[K, V]>; + + /** + * Returns Seq.Keyed. + * @override + */ + toSeq(): Seq.Keyed; + + // Sequence functions + + /** + * Returns a new Collection.Keyed of the same type where the keys and values + * have been flipped. + * + * + * ```js + * const { Map } = require('immutable') + * Map({ a: 'z', b: 'y' }).flip() + * // Map { "z": "a", "y": "b" } + * ``` + */ + flip(): Collection.Keyed; + + /** + * Returns a new Collection with other collections concatenated to this one. + */ + concat( + ...collections: Array> + ): Collection.Keyed; + concat( + ...collections: Array<{ [key: string]: C }> + ): Collection.Keyed; + + /** + * Returns a new Collection.Keyed with values passed through a + * `mapper` function. + * + * ```js + * const { Collection } = require('immutable') + * Collection.Keyed({ a: 1, b: 2 }).map(x => 10 * x) + * // Seq { "a": 10, "b": 20 } + * ``` + * + * Note: `map()` always returns a new instance, even if it produced the + * same value at every step. + */ + map( + mapper: (value: V, key: K, iter: this) => M, + context?: unknown + ): Collection.Keyed; + + /** + * Returns a new Collection.Keyed of the same type with keys passed through + * a `mapper` function. + * + * + * ```js + * const { Map } = require('immutable') + * Map({ a: 1, b: 2 }).mapKeys(x => x.toUpperCase()) + * // Map { "A": 1, "B": 2 } + * ``` + * + * Note: `mapKeys()` always returns a new instance, even if it produced + * the same key at every step. + */ + mapKeys( + mapper: (key: K, value: V, iter: this) => M, + context?: unknown + ): Collection.Keyed; + + /** + * Returns a new Collection.Keyed of the same type with entries + * ([key, value] tuples) passed through a `mapper` function. + * + * + * ```js + * const { Map } = require('immutable') + * Map({ a: 1, b: 2 }) + * .mapEntries(([ k, v ]) => [ k.toUpperCase(), v * 2 ]) + * // Map { "A": 2, "B": 4 } + * ``` + * + * Note: `mapEntries()` always returns a new instance, even if it produced + * the same entry at every step. + * + * If the mapper function returns `undefined`, then the entry will be filtered + */ + mapEntries( + mapper: ( + entry: [K, V], + index: number, + iter: this + ) => [KM, VM] | undefined, + context?: unknown + ): Collection.Keyed; + + /** + * Flat-maps the Collection, returning a Collection of the same type. + * + * Similar to `collection.map(...).flatten(true)`. + */ + flatMap( + mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>, + context?: unknown + ): Collection.Keyed; + + /** + * Returns a new Collection with only the values for which the `predicate` + * function returns true. + * + * Note: `filter()` always returns a new instance, even if it results in + * not filtering out any values. + */ + filter( + predicate: (value: V, key: K, iter: this) => value is F, + context?: unknown + ): Collection.Keyed; + filter( + predicate: (value: V, key: K, iter: this) => unknown, + context?: unknown + ): this; + + /** + * Returns a new keyed Collection with the values for which the + * `predicate` function returns false and another for which is returns + * true. + */ + partition( + predicate: (this: C, value: V, key: K, iter: this) => value is F, + context?: C + ): [Collection.Keyed, Collection.Keyed]; + partition( + predicate: (this: C, value: V, key: K, iter: this) => unknown, + context?: C + ): [this, this]; + + [Symbol.iterator](): IterableIterator<[K, V]>; + } + + /** + * Indexed Collections have incrementing numeric keys. They exhibit + * slightly different behavior than `Collection.Keyed` for some methods in order + * to better mirror the behavior of JavaScript's `Array`, and add methods + * which do not make sense on non-indexed Collections such as `indexOf`. + * + * Unlike JavaScript arrays, `Collection.Indexed`s are always dense. "Unset" + * indices and `undefined` indices are indistinguishable, and all indices from + * 0 to `size` are visited when iterated. + * + * All Collection.Indexed methods return re-indexed Collections. In other words, + * indices always start at 0 and increment until size. If you wish to + * preserve indices, using them as keys, convert to a Collection.Keyed by + * calling `toKeyedSeq`. + */ + namespace Indexed {} + + /** + * Creates a new Collection.Indexed. + * + * Note: `Collection.Indexed` is a conversion function and not a class, and + * does not use the `new` keyword during construction. + */ + function Indexed( + collection?: Iterable | ArrayLike + ): Collection.Indexed; + + interface Indexed extends Collection, OrderedCollection { + /** + * Deeply converts this Indexed collection to equivalent native JavaScript Array. + */ + toJS(): Array>; + + /** + * Shallowly converts this Indexed collection to equivalent native JavaScript Array. + */ + toJSON(): Array; + + /** + * Shallowly converts this collection to an Array. + */ + toArray(): Array; + + // Reading values + + /** + * Returns the value associated with the provided index, or notSetValue if + * the index is beyond the bounds of the Collection. + * + * `index` may be a negative number, which indexes back from the end of the + * Collection. `s.get(-1)` gets the last item in the Collection. + */ + get(index: number, notSetValue: NSV): T | NSV; + get(index: number): T | undefined; + + // Conversion to Seq + + /** + * Returns Seq.Indexed. + * @override + */ + toSeq(): Seq.Indexed; + + /** + * If this is a collection of [key, value] entry tuples, it will return a + * Seq.Keyed of those entries. + */ + fromEntrySeq(): Seq.Keyed; + + // Combination + + /** + * Returns a Collection of the same type with `separator` between each item + * in this Collection. + */ + interpose(separator: T): this; + + /** + * Returns a Collection of the same type with the provided `collections` + * interleaved into this collection. + * + * The resulting Collection includes the first item from each, then the + * second from each, etc. + * + * + * ```js + * const { List } = require('immutable') + * List([ 1, 2, 3 ]).interleave(List([ 'A', 'B', 'C' ])) + * // List [ 1, "A", 2, "B", 3, "C" ] + * ``` + * + * The shortest Collection stops interleave. + * + * + * ```js + * List([ 1, 2, 3 ]).interleave( + * List([ 'A', 'B' ]), + * List([ 'X', 'Y', 'Z' ]) + * ) + * // List [ 1, "A", "X", 2, "B", "Y" ] + * ``` + * + * Since `interleave()` re-indexes values, it produces a complete copy, + * which has `O(N)` complexity. + * + * Note: `interleave` *cannot* be used in `withMutations`. + */ + interleave(...collections: Array>): this; + + /** + * Splice returns a new indexed Collection by replacing a region of this + * Collection with new values. If values are not provided, it only skips the + * region to be removed. + * + * `index` may be a negative number, which indexes back from the end of the + * Collection. `s.splice(-2)` splices after the second to last item. + * + * + * ```js + * const { List } = require('immutable') + * List([ 'a', 'b', 'c', 'd' ]).splice(1, 2, 'q', 'r', 's') + * // List [ "a", "q", "r", "s", "d" ] + * ``` + * + * Since `splice()` re-indexes values, it produces a complete copy, which + * has `O(N)` complexity. + * + * Note: `splice` *cannot* be used in `withMutations`. + */ + splice(index: number, removeNum: number, ...values: Array): this; + + /** + * Returns a Collection of the same type "zipped" with the provided + * collections. + * + * Like `zipWith`, but using the default `zipper`: creating an `Array`. + * + * + * + * ```js + * const a = List([ 1, 2, 3 ]); + * const b = List([ 4, 5, 6 ]); + * const c = a.zip(b); // List [ [ 1, 4 ], [ 2, 5 ], [ 3, 6 ] ] + * ``` + */ + zip(other: Collection): Collection.Indexed<[T, U]>; + zip( + other: Collection, + other2: Collection + ): Collection.Indexed<[T, U, V]>; + zip( + ...collections: Array> + ): Collection.Indexed; + + /** + * Returns a Collection "zipped" with the provided collections. + * + * Unlike `zip`, `zipAll` continues zipping until the longest collection is + * exhausted. Missing values from shorter collections are filled with `undefined`. + * + * ```js + * const a = List([ 1, 2 ]); + * const b = List([ 3, 4, 5 ]); + * const c = a.zipAll(b); // List [ [ 1, 3 ], [ 2, 4 ], [ undefined, 5 ] ] + * ``` + */ + zipAll(other: Collection): Collection.Indexed<[T, U]>; + zipAll( + other: Collection, + other2: Collection + ): Collection.Indexed<[T, U, V]>; + zipAll( + ...collections: Array> + ): Collection.Indexed; + + /** + * Returns a Collection of the same type "zipped" with the provided + * collections by using a custom `zipper` function. + * + * + * ```js + * const a = List([ 1, 2, 3 ]); + * const b = List([ 4, 5, 6 ]); + * const c = a.zipWith((a, b) => a + b, b); + * // List [ 5, 7, 9 ] + * ``` + */ + zipWith( + zipper: (value: T, otherValue: U) => Z, + otherCollection: Collection + ): Collection.Indexed; + zipWith( + zipper: (value: T, otherValue: U, thirdValue: V) => Z, + otherCollection: Collection, + thirdCollection: Collection + ): Collection.Indexed; + zipWith( + zipper: (...values: Array) => Z, + ...collections: Array> + ): Collection.Indexed; + + // Search for value + + /** + * Returns the first index at which a given value can be found in the + * Collection, or -1 if it is not present. + */ + indexOf(searchValue: T): number; + + /** + * Returns the last index at which a given value can be found in the + * Collection, or -1 if it is not present. + */ + lastIndexOf(searchValue: T): number; + + /** + * Returns the first index in the Collection where a value satisfies the + * provided predicate function. Otherwise -1 is returned. + */ + findIndex( + predicate: (value: T, index: number, iter: this) => boolean, + context?: unknown + ): number; + + /** + * Returns the last index in the Collection where a value satisfies the + * provided predicate function. Otherwise -1 is returned. + */ + findLastIndex( + predicate: (value: T, index: number, iter: this) => boolean, + context?: unknown + ): number; + + // Sequence algorithms + + /** + * Returns a new Collection with other collections concatenated to this one. + */ + concat( + ...valuesOrCollections: Array | C> + ): Collection.Indexed; + + /** + * Returns a new Collection.Indexed with values passed through a + * `mapper` function. + * + * ```js + * const { Collection } = require('immutable') + * Collection.Indexed([1,2]).map(x => 10 * x) + * // Seq [ 1, 2 ] + * ``` + * + * Note: `map()` always returns a new instance, even if it produced the + * same value at every step. + */ + map( + mapper: (value: T, key: number, iter: this) => M, + context?: unknown + ): Collection.Indexed; + + /** + * Flat-maps the Collection, returning a Collection of the same type. + * + * Similar to `collection.map(...).flatten(true)`. + */ + flatMap( + mapper: (value: T, key: number, iter: this) => Iterable, + context?: unknown + ): Collection.Indexed; + + /** + * Returns a new Collection with only the values for which the `predicate` + * function returns true. + * + * Note: `filter()` always returns a new instance, even if it results in + * not filtering out any values. + */ + filter( + predicate: (value: T, index: number, iter: this) => value is F, + context?: unknown + ): Collection.Indexed; + filter( + predicate: (value: T, index: number, iter: this) => unknown, + context?: unknown + ): this; + + /** + * Returns a new indexed Collection with the values for which the + * `predicate` function returns false and another for which is returns + * true. + */ + partition( + predicate: (this: C, value: T, index: number, iter: this) => value is F, + context?: C + ): [Collection.Indexed, Collection.Indexed]; + partition( + predicate: (this: C, value: T, index: number, iter: this) => unknown, + context?: C + ): [this, this]; + + [Symbol.iterator](): IterableIterator; + } + + /** + * Set Collections only represent values. They have no associated keys or + * indices. Duplicate values are possible in the lazy `Seq.Set`s, however + * the concrete `Set` Collection does not allow duplicate values. + * + * Collection methods on Collection.Set such as `map` and `forEach` will provide + * the value as both the first and second arguments to the provided function. + * + * ```js + * const { Collection } = require('immutable') + * const seq = Collection.Set([ 'A', 'B', 'C' ]) + * // Seq { "A", "B", "C" } + * seq.forEach((v, k) => + * assert.equal(v, k) + * ) + * ``` + */ + namespace Set {} + + /** + * Similar to `Collection()`, but always returns a Collection.Set. + * + * Note: `Collection.Set` is a factory function and not a class, and does + * not use the `new` keyword during construction. + */ + function Set(collection?: Iterable | ArrayLike): Collection.Set; + + interface Set extends Collection { + /** + * Deeply converts this Set collection to equivalent native JavaScript Array. + */ + toJS(): Array>; + + /** + * Shallowly converts this Set collection to equivalent native JavaScript Array. + */ + toJSON(): Array; + + /** + * Shallowly converts this collection to an Array. + */ + toArray(): Array; + + /** + * Returns Seq.Set. + * @override + */ + toSeq(): Seq.Set; + + // Sequence algorithms + + /** + * Returns a new Collection with other collections concatenated to this one. + */ + concat(...collections: Array>): Collection.Set; + + /** + * Returns a new Collection.Set with values passed through a + * `mapper` function. + * + * ``` + * Collection.Set([ 1, 2 ]).map(x => 10 * x) + * // Seq { 1, 2 } + * ``` + * + * Note: `map()` always returns a new instance, even if it produced the + * same value at every step. + */ + map( + mapper: (value: T, key: T, iter: this) => M, + context?: unknown + ): Collection.Set; + + /** + * Flat-maps the Collection, returning a Collection of the same type. + * + * Similar to `collection.map(...).flatten(true)`. + */ + flatMap( + mapper: (value: T, key: T, iter: this) => Iterable, + context?: unknown + ): Collection.Set; + + /** + * Returns a new Collection with only the values for which the `predicate` + * function returns true. + * + * Note: `filter()` always returns a new instance, even if it results in + * not filtering out any values. + */ + filter( + predicate: (value: T, key: T, iter: this) => value is F, + context?: unknown + ): Collection.Set; + filter( + predicate: (value: T, key: T, iter: this) => unknown, + context?: unknown + ): this; + + /** + * Returns a new set Collection with the values for which the + * `predicate` function returns false and another for which is returns + * true. + */ + partition( + predicate: (this: C, value: T, key: T, iter: this) => value is F, + context?: C + ): [Collection.Set, Collection.Set]; + partition( + predicate: (this: C, value: T, key: T, iter: this) => unknown, + context?: C + ): [this, this]; + + [Symbol.iterator](): IterableIterator; + } + } + + /** + * Creates a Collection. + * + * The type of Collection created is based on the input. + * + * * If an `Collection`, that same `Collection`. + * * If an Array-like, an `Collection.Indexed`. + * * If an Object with an Iterator defined, an `Collection.Indexed`. + * * If an Object, an `Collection.Keyed`. + * + * This methods forces the conversion of Objects and Strings to Collections. + * If you want to ensure that a Collection of one item is returned, use + * `Seq.of`. + * + * Note: An Iterator itself will be treated as an object, becoming a `Seq.Keyed`, + * which is usually not what you want. You should turn your Iterator Object into + * an iterable object by defining a Symbol.iterator (or @@iterator) method which + * returns `this`. + * + * Note: `Collection` is a conversion function and not a class, and does not + * use the `new` keyword during construction. + */ + function Collection>(collection: I): I; + function Collection( + collection: Iterable | ArrayLike + ): Collection.Indexed; + function Collection(obj: { + [key: string]: V; + }): Collection.Keyed; + function Collection(): Collection; + + interface Collection extends ValueObject { + // Value equality + + /** + * True if this and the other Collection have value equality, as defined + * by `Immutable.is()`. + * + * Note: This is equivalent to `Immutable.is(this, other)`, but provided to + * allow for chained expressions. + */ + equals(other: unknown): boolean; + + /** + * Computes and returns the hashed identity for this Collection. + * + * The `hashCode` of a Collection is used to determine potential equality, + * and is used when adding this to a `Set` or as a key in a `Map`, enabling + * lookup via a different instance. + * + * + * ```js + * const a = List([ 1, 2, 3 ]); + * const b = List([ 1, 2, 3 ]); + * assert.notStrictEqual(a, b); // different instances + * const set = Set([ a ]); + * assert.equal(set.has(b), true); + * ``` + * + * If two values have the same `hashCode`, they are [not guaranteed + * to be equal][Hash Collision]. If two values have different `hashCode`s, + * they must not be equal. + * + * [Hash Collision]: https://en.wikipedia.org/wiki/Collision_(computer_science) + */ + hashCode(): number; + + // Reading values + + /** + * Returns the value associated with the provided key, or notSetValue if + * the Collection does not contain this key. + * + * Note: it is possible a key may be associated with an `undefined` value, + * so if `notSetValue` is not provided and this method returns `undefined`, + * that does not guarantee the key was not found. + */ + get(key: K, notSetValue: NSV): V | NSV; + get(key: K): V | undefined; + + /** + * True if a key exists within this `Collection`, using `Immutable.is` + * to determine equality + */ + has(key: K): boolean; + + /** + * True if a value exists within this `Collection`, using `Immutable.is` + * to determine equality + * @alias contains + */ + includes(value: V): boolean; + contains(value: V): boolean; + + /** + * In case the `Collection` is not empty returns the first element of the + * `Collection`. + * In case the `Collection` is empty returns the optional default + * value if provided, if no default value is provided returns undefined. + */ + first(notSetValue: NSV): V | NSV; + first(): V | undefined; + + /** + * In case the `Collection` is not empty returns the last element of the + * `Collection`. + * In case the `Collection` is empty returns the optional default + * value if provided, if no default value is provided returns undefined. + */ + last(notSetValue: NSV): V | NSV; + last(): V | undefined; + + // Reading deep values + + /** + * Returns the value found by following a path of keys or indices through + * nested Collections. + * + * + * ```js + * const { Map, List } = require('immutable') + * const deepData = Map({ x: List([ Map({ y: 123 }) ]) }); + * deepData.getIn(['x', 0, 'y']) // 123 + * ``` + * + * Plain JavaScript Object or Arrays may be nested within an Immutable.js + * Collection, and getIn() can access those values as well: + * + * + * ```js + * const { Map, List } = require('immutable') + * const deepData = Map({ x: [ { y: 123 } ] }); + * deepData.getIn(['x', 0, 'y']) // 123 + * ``` + */ + getIn(searchKeyPath: Iterable, notSetValue?: unknown): unknown; + + /** + * True if the result of following a path of keys or indices through nested + * Collections results in a set value. + */ + hasIn(searchKeyPath: Iterable): boolean; + + // Persistent changes + + /** + * This can be very useful as a way to "chain" a normal function into a + * sequence of methods. RxJS calls this "let" and lodash calls it "thru". + * + * For example, to sum a Seq after mapping and filtering: + * + * + * ```js + * const { Seq } = require('immutable') + * + * function sum(collection) { + * return collection.reduce((sum, x) => sum + x, 0) + * } + * + * Seq([ 1, 2, 3 ]) + * .map(x => x + 1) + * .filter(x => x % 2 === 0) + * .update(sum) + * // 6 + * ``` + */ + update(updater: (value: this) => R): R; + + // Conversion to JavaScript types + + /** + * Deeply converts this Collection to equivalent native JavaScript Array or Object. + * + * `Collection.Indexed`, and `Collection.Set` become `Array`, while + * `Collection.Keyed` become `Object`, converting keys to Strings. + */ + toJS(): Array> | { [key in PropertyKey]: DeepCopy }; + + /** + * Shallowly converts this Collection to equivalent native JavaScript Array or Object. + * + * `Collection.Indexed`, and `Collection.Set` become `Array`, while + * `Collection.Keyed` become `Object`, converting keys to Strings. + */ + toJSON(): Array | { [key in PropertyKey]: V }; + + /** + * Shallowly converts this collection to an Array. + * + * `Collection.Indexed`, and `Collection.Set` produce an Array of values. + * `Collection.Keyed` produce an Array of [key, value] tuples. + */ + toArray(): Array | Array<[K, V]>; + + /** + * Shallowly converts this Collection to an Object. + * + * Converts keys to Strings. + */ + toObject(): { [key: string]: V }; + + // Conversion to Collections + + /** + * Converts this Collection to a Map, Throws if keys are not hashable. + * + * Note: This is equivalent to `Map(this.toKeyedSeq())`, but provided + * for convenience and to allow for chained expressions. + */ + toMap(): Map; + + /** + * Converts this Collection to a Map, maintaining the order of iteration. + * + * Note: This is equivalent to `OrderedMap(this.toKeyedSeq())`, but + * provided for convenience and to allow for chained expressions. + */ + toOrderedMap(): OrderedMap; + + /** + * Converts this Collection to a Set, discarding keys. Throws if values + * are not hashable. + * + * Note: This is equivalent to `Set(this)`, but provided to allow for + * chained expressions. + */ + toSet(): Set; + + /** + * Converts this Collection to a Set, maintaining the order of iteration and + * discarding keys. + * + * Note: This is equivalent to `OrderedSet(this.valueSeq())`, but provided + * for convenience and to allow for chained expressions. + */ + toOrderedSet(): OrderedSet; + + /** + * Converts this Collection to a List, discarding keys. + * + * This is similar to `List(collection)`, but provided to allow for chained + * expressions. However, when called on `Map` or other keyed collections, + * `collection.toList()` discards the keys and creates a list of only the + * values, whereas `List(collection)` creates a list of entry tuples. + * + * + * ```js + * const { Map, List } = require('immutable') + * var myMap = Map({ a: 'Apple', b: 'Banana' }) + * List(myMap) // List [ [ "a", "Apple" ], [ "b", "Banana" ] ] + * myMap.toList() // List [ "Apple", "Banana" ] + * ``` + */ + toList(): List; + + /** + * Converts this Collection to a Stack, discarding keys. Throws if values + * are not hashable. + * + * Note: This is equivalent to `Stack(this)`, but provided to allow for + * chained expressions. + */ + toStack(): Stack; + + // Conversion to Seq + + /** + * Converts this Collection to a Seq of the same kind (indexed, + * keyed, or set). + */ + toSeq(): Seq; + + /** + * Returns a Seq.Keyed from this Collection where indices are treated as keys. + * + * This is useful if you want to operate on an + * Collection.Indexed and preserve the [index, value] pairs. + * + * The returned Seq will have identical iteration order as + * this Collection. + * + * + * ```js + * const { Seq } = require('immutable') + * const indexedSeq = Seq([ 'A', 'B', 'C' ]) + * // Seq [ "A", "B", "C" ] + * indexedSeq.filter(v => v === 'B') + * // Seq [ "B" ] + * const keyedSeq = indexedSeq.toKeyedSeq() + * // Seq { 0: "A", 1: "B", 2: "C" } + * keyedSeq.filter(v => v === 'B') + * // Seq { 1: "B" } + * ``` + */ + toKeyedSeq(): Seq.Keyed; + + /** + * Returns an Seq.Indexed of the values of this Collection, discarding keys. + */ + toIndexedSeq(): Seq.Indexed; + + /** + * Returns a Seq.Set of the values of this Collection, discarding keys. + */ + toSetSeq(): Seq.Set; + + // Iterators + + /** + * An iterator of this `Collection`'s keys. + * + * Note: this will return an ES6 iterator which does not support + * Immutable.js sequence algorithms. Use `keySeq` instead, if this is + * what you want. + */ + keys(): IterableIterator; + + /** + * An iterator of this `Collection`'s values. + * + * Note: this will return an ES6 iterator which does not support + * Immutable.js sequence algorithms. Use `valueSeq` instead, if this is + * what you want. + */ + values(): IterableIterator; + + /** + * An iterator of this `Collection`'s entries as `[ key, value ]` tuples. + * + * Note: this will return an ES6 iterator which does not support + * Immutable.js sequence algorithms. Use `entrySeq` instead, if this is + * what you want. + */ + entries(): IterableIterator<[K, V]>; + + [Symbol.iterator](): IterableIterator; + + // Collections (Seq) + + /** + * Returns a new Seq.Indexed of the keys of this Collection, + * discarding values. + */ + keySeq(): Seq.Indexed; + + /** + * Returns an Seq.Indexed of the values of this Collection, discarding keys. + */ + valueSeq(): Seq.Indexed; + + /** + * Returns a new Seq.Indexed of [key, value] tuples. + */ + entrySeq(): Seq.Indexed<[K, V]>; + + // Sequence algorithms + + /** + * Returns a new Collection of the same type with values passed through a + * `mapper` function. + * + * + * ```js + * const { Collection } = require('immutable') + * Collection({ a: 1, b: 2 }).map(x => 10 * x) + * // Seq { "a": 10, "b": 20 } + * ``` + * + * Note: `map()` always returns a new instance, even if it produced the same + * value at every step. + */ + map( + mapper: (value: V, key: K, iter: this) => M, + context?: unknown + ): Collection; + + /** + * Note: used only for sets, which return Collection but are otherwise + * identical to normal `map()`. + * + * @ignore + */ + map(...args: Array): unknown; + + /** + * Returns a new Collection of the same type with only the entries for which + * the `predicate` function returns true. + * + * + * ```js + * const { Map } = require('immutable') + * Map({ a: 1, b: 2, c: 3, d: 4}).filter(x => x % 2 === 0) + * // Map { "b": 2, "d": 4 } + * ``` + * + * Note: `filter()` always returns a new instance, even if it results in + * not filtering out any values. + */ + filter( + predicate: (value: V, key: K, iter: this) => value is F, + context?: unknown + ): Collection; + filter( + predicate: (value: V, key: K, iter: this) => unknown, + context?: unknown + ): this; + + /** + * Returns a new Collection of the same type with only the entries for which + * the `predicate` function returns false. + * + * + * ```js + * const { Map } = require('immutable') + * Map({ a: 1, b: 2, c: 3, d: 4}).filterNot(x => x % 2 === 0) + * // Map { "a": 1, "c": 3 } + * ``` + * + * Note: `filterNot()` always returns a new instance, even if it results in + * not filtering out any values. + */ + filterNot( + predicate: (value: V, key: K, iter: this) => boolean, + context?: unknown + ): this; + + /** + * Returns a new Collection with the values for which the `predicate` + * function returns false and another for which is returns true. + */ + partition( + predicate: (this: C, value: V, key: K, iter: this) => value is F, + context?: C + ): [Collection, Collection]; + partition( + predicate: (this: C, value: V, key: K, iter: this) => unknown, + context?: C + ): [this, this]; + + /** + * Returns a new Collection of the same type in reverse order. + */ + reverse(): this; + + /** + * Returns a new Collection of the same type which includes the same entries, + * stably sorted by using a `comparator`. + * + * If a `comparator` is not provided, a default comparator uses `<` and `>`. + * + * `comparator(valueA, valueB)`: + * + * * Returns `0` if the elements should not be swapped. + * * Returns `-1` (or any negative number) if `valueA` comes before `valueB` + * * Returns `1` (or any positive number) if `valueA` comes after `valueB` + * * Alternatively, can return a value of the `PairSorting` enum type + * * Is pure, i.e. it must always return the same value for the same pair + * of values. + * + * When sorting collections which have no defined order, their ordered + * equivalents will be returned. e.g. `map.sort()` returns OrderedMap. + * + * + * ```js + * const { Map } = require('immutable') + * Map({ "c": 3, "a": 1, "b": 2 }).sort((a, b) => { + * if (a < b) { return -1; } + * if (a > b) { return 1; } + * if (a === b) { return 0; } + * }); + * // OrderedMap { "a": 1, "b": 2, "c": 3 } + * ``` + * + * Note: `sort()` Always returns a new instance, even if the original was + * already sorted. + * + * Note: This is always an eager operation. + */ + sort(comparator?: Comparator): this; + + /** + * Like `sort`, but also accepts a `comparatorValueMapper` which allows for + * sorting by more sophisticated means: + * + * + * ```js + * const { Map } = require('immutable') + * const beattles = Map({ + * John: { name: "Lennon" }, + * Paul: { name: "McCartney" }, + * George: { name: "Harrison" }, + * Ringo: { name: "Starr" }, + * }); + * beattles.sortBy(member => member.name); + * ``` + * + * Note: `sortBy()` Always returns a new instance, even if the original was + * already sorted. + * + * Note: This is always an eager operation. + */ + sortBy( + comparatorValueMapper: (value: V, key: K, iter: this) => C, + comparator?: Comparator + ): this; + + /** + * Returns a `Map` of `Collection`, grouped by the return + * value of the `grouper` function. + * + * Note: This is always an eager operation. + * + * + * ```js + * const { List, Map } = require('immutable') + * const listOfMaps = List([ + * Map({ v: 0 }), + * Map({ v: 1 }), + * Map({ v: 1 }), + * Map({ v: 0 }), + * Map({ v: 2 }) + * ]) + * const groupsOfMaps = listOfMaps.groupBy(x => x.get('v')) + * // Map { + * // 0: List [ Map{ "v": 0 }, Map { "v": 0 } ], + * // 1: List [ Map{ "v": 1 }, Map { "v": 1 } ], + * // 2: List [ Map{ "v": 2 } ], + * // } + * ``` + */ + groupBy( + grouper: (value: V, key: K, iter: this) => G, + context?: unknown + ): Map; + + // Side effects + + /** + * The `sideEffect` is executed for every entry in the Collection. + * + * Unlike `Array#forEach`, if any call of `sideEffect` returns + * `false`, the iteration will stop. Returns the number of entries iterated + * (including the last iteration which returned false). + */ + forEach( + sideEffect: (value: V, key: K, iter: this) => unknown, + context?: unknown + ): number; + + // Creating subsets + + /** + * Returns a new Collection of the same type representing a portion of this + * Collection from start up to but not including end. + * + * If begin is negative, it is offset from the end of the Collection. e.g. + * `slice(-2)` returns a Collection of the last two entries. If it is not + * provided the new Collection will begin at the beginning of this Collection. + * + * If end is negative, it is offset from the end of the Collection. e.g. + * `slice(0, -1)` returns a Collection of everything but the last entry. If + * it is not provided, the new Collection will continue through the end of + * this Collection. + * + * If the requested slice is equivalent to the current Collection, then it + * will return itself. + */ + slice(begin?: number, end?: number): this; + + /** + * Returns a new Collection of the same type containing all entries except + * the first. + */ + rest(): this; + + /** + * Returns a new Collection of the same type containing all entries except + * the last. + */ + butLast(): this; + + /** + * Returns a new Collection of the same type which excludes the first `amount` + * entries from this Collection. + */ + skip(amount: number): this; + + /** + * Returns a new Collection of the same type which excludes the last `amount` + * entries from this Collection. + */ + skipLast(amount: number): this; + + /** + * Returns a new Collection of the same type which includes entries starting + * from when `predicate` first returns false. + * + * + * ```js + * const { List } = require('immutable') + * List([ 'dog', 'frog', 'cat', 'hat', 'god' ]) + * .skipWhile(x => x.match(/g/)) + * // List [ "cat", "hat", "god" ] + * ``` + */ + skipWhile( + predicate: (value: V, key: K, iter: this) => boolean, + context?: unknown + ): this; + + /** + * Returns a new Collection of the same type which includes entries starting + * from when `predicate` first returns true. + * + * + * ```js + * const { List } = require('immutable') + * List([ 'dog', 'frog', 'cat', 'hat', 'god' ]) + * .skipUntil(x => x.match(/hat/)) + * // List [ "hat", "god" ] + * ``` + */ + skipUntil( + predicate: (value: V, key: K, iter: this) => boolean, + context?: unknown + ): this; + + /** + * Returns a new Collection of the same type which includes the first `amount` + * entries from this Collection. + */ + take(amount: number): this; + + /** + * Returns a new Collection of the same type which includes the last `amount` + * entries from this Collection. + */ + takeLast(amount: number): this; + + /** + * Returns a new Collection of the same type which includes entries from this + * Collection as long as the `predicate` returns true. + * + * + * ```js + * const { List } = require('immutable') + * List([ 'dog', 'frog', 'cat', 'hat', 'god' ]) + * .takeWhile(x => x.match(/o/)) + * // List [ "dog", "frog" ] + * ``` + */ + takeWhile( + predicate: (value: V, key: K, iter: this) => boolean, + context?: unknown + ): this; + + /** + * Returns a new Collection of the same type which includes entries from this + * Collection as long as the `predicate` returns false. + * + * + * ```js + * const { List } = require('immutable') + * List([ 'dog', 'frog', 'cat', 'hat', 'god' ]) + * .takeUntil(x => x.match(/at/)) + * // List [ "dog", "frog" ] + * ``` + */ + takeUntil( + predicate: (value: V, key: K, iter: this) => boolean, + context?: unknown + ): this; + + // Combination + + /** + * Returns a new Collection of the same type with other values and + * collection-like concatenated to this one. + * + * For Seqs, all entries will be present in the resulting Seq, even if they + * have the same key. + */ + concat( + ...valuesOrCollections: Array + ): Collection; + + /** + * Flattens nested Collections. + * + * Will deeply flatten the Collection by default, returning a Collection of the + * same type, but a `depth` can be provided in the form of a number or + * boolean (where true means to shallowly flatten one level). A depth of 0 + * (or shallow: false) will deeply flatten. + * + * Flattens only others Collection, not Arrays or Objects. + * + * Note: `flatten(true)` operates on Collection> and + * returns Collection + */ + flatten(depth?: number): Collection; + flatten(shallow?: boolean): Collection; + + /** + * Flat-maps the Collection, returning a Collection of the same type. + * + * Similar to `collection.map(...).flatten(true)`. + */ + flatMap( + mapper: (value: V, key: K, iter: this) => Iterable, + context?: unknown + ): Collection; + + /** + * Flat-maps the Collection, returning a Collection of the same type. + * + * Similar to `collection.map(...).flatten(true)`. + * Used for Dictionaries only. + */ + flatMap( + mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>, + context?: unknown + ): Collection; + + // Reducing a value + + /** + * Reduces the Collection to a value by calling the `reducer` for every entry + * in the Collection and passing along the reduced value. + * + * If `initialReduction` is not provided, the first item in the + * Collection will be used. + * + * @see `Array#reduce`. + */ + reduce( + reducer: (reduction: R, value: V, key: K, iter: this) => R, + initialReduction: R, + context?: unknown + ): R; + reduce( + reducer: (reduction: V | R, value: V, key: K, iter: this) => R + ): R; + + /** + * Reduces the Collection in reverse (from the right side). + * + * Note: Similar to this.reverse().reduce(), and provided for parity + * with `Array#reduceRight`. + */ + reduceRight( + reducer: (reduction: R, value: V, key: K, iter: this) => R, + initialReduction: R, + context?: unknown + ): R; + reduceRight( + reducer: (reduction: V | R, value: V, key: K, iter: this) => R + ): R; + + /** + * True if `predicate` returns true for all entries in the Collection. + */ + every( + predicate: (value: V, key: K, iter: this) => boolean, + context?: unknown + ): boolean; + + /** + * True if `predicate` returns true for any entry in the Collection. + */ + some( + predicate: (value: V, key: K, iter: this) => boolean, + context?: unknown + ): boolean; + + /** + * Joins values together as a string, inserting a separator between each. + * The default separator is `","`. + */ + join(separator?: string): string; + + /** + * Returns true if this Collection includes no values. + * + * For some lazy `Seq`, `isEmpty` might need to iterate to determine + * emptiness. At most one iteration will occur. + */ + isEmpty(): boolean; + + /** + * Returns the size of this Collection. + * + * Regardless of if this Collection can describe its size lazily (some Seqs + * cannot), this method will always return the correct size. E.g. it + * evaluates a lazy `Seq` if necessary. + * + * If `predicate` is provided, then this returns the count of entries in the + * Collection for which the `predicate` returns true. + */ + count(): number; + count( + predicate: (value: V, key: K, iter: this) => boolean, + context?: unknown + ): number; + + /** + * Returns a `Seq.Keyed` of counts, grouped by the return value of + * the `grouper` function. + * + * Note: This is not a lazy operation. + */ + countBy( + grouper: (value: V, key: K, iter: this) => G, + context?: unknown + ): Map; + + // Search for value + + /** + * Returns the first value for which the `predicate` returns true. + */ + find( + predicate: (value: V, key: K, iter: this) => boolean, + context?: unknown, + notSetValue?: V + ): V | undefined; + + /** + * Returns the last value for which the `predicate` returns true. + * + * Note: `predicate` will be called for each entry in reverse. + */ + findLast( + predicate: (value: V, key: K, iter: this) => boolean, + context?: unknown, + notSetValue?: V + ): V | undefined; + + /** + * Returns the first [key, value] entry for which the `predicate` returns true. + */ + findEntry( + predicate: (value: V, key: K, iter: this) => boolean, + context?: unknown, + notSetValue?: V + ): [K, V] | undefined; + + /** + * Returns the last [key, value] entry for which the `predicate` + * returns true. + * + * Note: `predicate` will be called for each entry in reverse. + */ + findLastEntry( + predicate: (value: V, key: K, iter: this) => boolean, + context?: unknown, + notSetValue?: V + ): [K, V] | undefined; + + /** + * Returns the key for which the `predicate` returns true. + */ + findKey( + predicate: (value: V, key: K, iter: this) => boolean, + context?: unknown + ): K | undefined; + + /** + * Returns the last key for which the `predicate` returns true. + * + * Note: `predicate` will be called for each entry in reverse. + */ + findLastKey( + predicate: (value: V, key: K, iter: this) => boolean, + context?: unknown + ): K | undefined; + + /** + * Returns the key associated with the search value, or undefined. + */ + keyOf(searchValue: V): K | undefined; + + /** + * Returns the last key associated with the search value, or undefined. + */ + lastKeyOf(searchValue: V): K | undefined; + + /** + * Returns the maximum value in this collection. If any values are + * comparatively equivalent, the first one found will be returned. + * + * The `comparator` is used in the same way as `Collection#sort`. If it is not + * provided, the default comparator is `>`. + * + * When two values are considered equivalent, the first encountered will be + * returned. Otherwise, `max` will operate independent of the order of input + * as long as the comparator is commutative. The default comparator `>` is + * commutative *only* when types do not differ. + * + * If `comparator` returns 0 and either value is NaN, undefined, or null, + * that value will be returned. + */ + max(comparator?: Comparator): V | undefined; + + /** + * Like `max`, but also accepts a `comparatorValueMapper` which allows for + * comparing by more sophisticated means: + * + * + * ```js + * const { List, } = require('immutable'); + * const l = List([ + * { name: 'Bob', avgHit: 1 }, + * { name: 'Max', avgHit: 3 }, + * { name: 'Lili', avgHit: 2 } , + * ]); + * l.maxBy(i => i.avgHit); // will output { name: 'Max', avgHit: 3 } + * ``` + */ + maxBy( + comparatorValueMapper: (value: V, key: K, iter: this) => C, + comparator?: Comparator + ): V | undefined; + + /** + * Returns the minimum value in this collection. If any values are + * comparatively equivalent, the first one found will be returned. + * + * The `comparator` is used in the same way as `Collection#sort`. If it is not + * provided, the default comparator is `<`. + * + * When two values are considered equivalent, the first encountered will be + * returned. Otherwise, `min` will operate independent of the order of input + * as long as the comparator is commutative. The default comparator `<` is + * commutative *only* when types do not differ. + * + * If `comparator` returns 0 and either value is NaN, undefined, or null, + * that value will be returned. + */ + min(comparator?: Comparator): V | undefined; + + /** + * Like `min`, but also accepts a `comparatorValueMapper` which allows for + * comparing by more sophisticated means: + * + * + * ```js + * const { List, } = require('immutable'); + * const l = List([ + * { name: 'Bob', avgHit: 1 }, + * { name: 'Max', avgHit: 3 }, + * { name: 'Lili', avgHit: 2 } , + * ]); + * l.minBy(i => i.avgHit); // will output { name: 'Bob', avgHit: 1 } + * ``` + */ + minBy( + comparatorValueMapper: (value: V, key: K, iter: this) => C, + comparator?: Comparator + ): V | undefined; + + // Comparison + + /** + * True if `iter` includes every value in this Collection. + */ + isSubset(iter: Iterable): boolean; + + /** + * True if this Collection includes every value in `iter`. + */ + isSuperset(iter: Iterable): boolean; + } + + /** + * The interface to fulfill to qualify as a Value Object. + */ + interface ValueObject { + /** + * True if this and the other Collection have value equality, as defined + * by `Immutable.is()`. + * + * Note: This is equivalent to `Immutable.is(this, other)`, but provided to + * allow for chained expressions. + */ + equals(other: unknown): boolean; + + /** + * Computes and returns the hashed identity for this Collection. + * + * The `hashCode` of a Collection is used to determine potential equality, + * and is used when adding this to a `Set` or as a key in a `Map`, enabling + * lookup via a different instance. + * + * + * ```js + * const { List, Set } = require('immutable'); + * const a = List([ 1, 2, 3 ]); + * const b = List([ 1, 2, 3 ]); + * assert.notStrictEqual(a, b); // different instances + * const set = Set([ a ]); + * assert.equal(set.has(b), true); + * ``` + * + * Note: hashCode() MUST return a Uint32 number. The easiest way to + * guarantee this is to return `myHash | 0` from a custom implementation. + * + * If two values have the same `hashCode`, they are [not guaranteed + * to be equal][Hash Collision]. If two values have different `hashCode`s, + * they must not be equal. + * + * Note: `hashCode()` is not guaranteed to always be called before + * `equals()`. Most but not all Immutable.js collections use hash codes to + * organize their internal data structures, while all Immutable.js + * collections use equality during lookups. + * + * [Hash Collision]: https://en.wikipedia.org/wiki/Collision_(computer_science) + */ + hashCode(): number; + } + + /** + * Interface representing all oredered collections. + * This includes `List`, `Stack`, `Map`, `OrderedMap`, `Set`, and `OrderedSet`. + * return of `isOrdered()` return true in that case. + */ + interface OrderedCollection { + /** + * Shallowly converts this collection to an Array. + */ + toArray(): Array; + + [Symbol.iterator](): IterableIterator; + } + + /** + * Deeply converts plain JS objects and arrays to Immutable Maps and Lists. + * + * `fromJS` will convert Arrays and [array-like objects][2] to a List, and + * plain objects (without a custom prototype) to a Map. [Iterable objects][3] + * may be converted to List, Map, or Set. + * + * If a `reviver` is optionally provided, it will be called with every + * collection as a Seq (beginning with the most nested collections + * and proceeding to the top-level collection itself), along with the key + * referring to each collection and the parent JS object provided as `this`. + * For the top level, object, the key will be `""`. This `reviver` is expected + * to return a new Immutable Collection, allowing for custom conversions from + * deep JS objects. Finally, a `path` is provided which is the sequence of + * keys to this value from the starting value. + * + * `reviver` acts similarly to the [same parameter in `JSON.parse`][1]. + * + * If `reviver` is not provided, the default behavior will convert Objects + * into Maps and Arrays into Lists like so: + * + * + * ```js + * const { fromJS, isKeyed } = require('immutable') + * function (key, value) { + * return isKeyed(value) ? value.toMap() : value.toList() + * } + * ``` + * + * Accordingly, this example converts native JS data to OrderedMap and List: + * + * + * ```js + * const { fromJS, isKeyed } = require('immutable') + * fromJS({ a: {b: [10, 20, 30]}, c: 40}, function (key, value, path) { + * console.log(key, value, path) + * return isKeyed(value) ? value.toOrderedMap() : value.toList() + * }) + * + * > "b", [ 10, 20, 30 ], [ "a", "b" ] + * > "a", {b: [10, 20, 30]}, [ "a" ] + * > "", {a: {b: [10, 20, 30]}, c: 40}, [] + * ``` + * + * Keep in mind, when using JS objects to construct Immutable Maps, that + * JavaScript Object properties are always strings, even if written in a + * quote-less shorthand, while Immutable Maps accept keys of any type. + * + * + * ```js + * const { Map } = require('immutable') + * let obj = { 1: "one" }; + * Object.keys(obj); // [ "1" ] + * assert.equal(obj["1"], obj[1]); // "one" === "one" + * + * let map = Map(obj); + * assert.notEqual(map.get("1"), map.get(1)); // "one" !== undefined + * ``` + * + * Property access for JavaScript Objects first converts the key to a string, + * but since Immutable Map keys can be of any type the argument to `get()` is + * not altered. + * + * [1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#Example.3A_Using_the_reviver_parameter + * "Using the reviver parameter" + * [2]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects + * "Working with array-like objects" + * [3]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol + * "The iterable protocol" + */ + function fromJS( + jsValue: JSValue, + reviver?: undefined + ): FromJS; + function fromJS( + jsValue: unknown, + reviver?: ( + key: string | number, + sequence: Collection.Keyed | Collection.Indexed, + path?: Array + ) => unknown + ): Collection; + + type FromJS = JSValue extends FromJSNoTransform + ? JSValue + : JSValue extends Array + ? FromJSArray + : JSValue extends object + ? FromJSObject + : unknown; + + type FromJSNoTransform = + | Collection + | number + | string + | null + | undefined; + + type FromJSArray = + JSValue extends Array ? List> : never; + + type FromJSObject = JSValue extends object + ? Map> + : never; + + /** + * Value equality check with semantics similar to `Object.is`, but treats + * Immutable `Collection`s as values, equal if the second `Collection` includes + * equivalent values. + * + * It's used throughout Immutable when checking for equality, including `Map` + * key equality and `Set` membership. + * + * + * ```js + * const { Map, is } = require('immutable') + * const map1 = Map({ a: 1, b: 1, c: 1 }) + * const map2 = Map({ a: 1, b: 1, c: 1 }) + * assert.equal(map1 !== map2, true) + * assert.equal(Object.is(map1, map2), false) + * assert.equal(is(map1, map2), true) + * ``` + * + * `is()` compares primitive types like strings and numbers, Immutable.js + * collections like `Map` and `List`, but also any custom object which + * implements `ValueObject` by providing `equals()` and `hashCode()` methods. + * + * Note: Unlike `Object.is`, `Immutable.is` assumes `0` and `-0` are the same + * value, matching the behavior of ES6 Map key equality. + */ + function is(first: unknown, second: unknown): boolean; + + /** + * The `hash()` function is an important part of how Immutable determines if + * two values are equivalent and is used to determine how to store those + * values. Provided with any value, `hash()` will return a 31-bit integer. + * + * When designing Objects which may be equal, it's important that when a + * `.equals()` method returns true, that both values `.hashCode()` method + * return the same value. `hash()` may be used to produce those values. + * + * For non-Immutable Objects that do not provide a `.hashCode()` functions + * (including plain Objects, plain Arrays, Date objects, etc), a unique hash + * value will be created for each *instance*. That is, the create hash + * represents referential equality, and not value equality for Objects. This + * ensures that if that Object is mutated over time that its hash code will + * remain consistent, allowing Objects to be used as keys and values in + * Immutable.js collections. + * + * Note that `hash()` attempts to balance between speed and avoiding + * collisions, however it makes no attempt to produce secure hashes. + * + * *New in Version 4.0* + */ + function hash(value: unknown): number; + + /** + * True if `maybeImmutable` is an Immutable Collection or Record. + * + * Note: Still returns true even if the collections is within a `withMutations()`. + * + * + * ```js + * const { isImmutable, Map, List, Stack } = require('immutable'); + * isImmutable([]); // false + * isImmutable({}); // false + * isImmutable(Map()); // true + * isImmutable(List()); // true + * isImmutable(Stack()); // true + * isImmutable(Map().asMutable()); // true + * ``` + */ + function isImmutable( + maybeImmutable: unknown + ): maybeImmutable is Collection; + + /** + * True if `maybeCollection` is a Collection, or any of its subclasses. + * + * + * ```js + * const { isCollection, Map, List, Stack } = require('immutable'); + * isCollection([]); // false + * isCollection({}); // false + * isCollection(Map()); // true + * isCollection(List()); // true + * isCollection(Stack()); // true + * ``` + */ + function isCollection( + maybeCollection: unknown + ): maybeCollection is Collection; + + /** + * True if `maybeKeyed` is a Collection.Keyed, or any of its subclasses. + * + * + * ```js + * const { isKeyed, Map, List, Stack } = require('immutable'); + * isKeyed([]); // false + * isKeyed({}); // false + * isKeyed(Map()); // true + * isKeyed(List()); // false + * isKeyed(Stack()); // false + * ``` + */ + function isKeyed( + maybeKeyed: unknown + ): maybeKeyed is Collection.Keyed; + + /** + * True if `maybeIndexed` is a Collection.Indexed, or any of its subclasses. + * + * + * ```js + * const { isIndexed, Map, List, Stack, Set } = require('immutable'); + * isIndexed([]); // false + * isIndexed({}); // false + * isIndexed(Map()); // false + * isIndexed(List()); // true + * isIndexed(Stack()); // true + * isIndexed(Set()); // false + * ``` + */ + function isIndexed( + maybeIndexed: unknown + ): maybeIndexed is Collection.Indexed; + + /** + * True if `maybeAssociative` is either a Keyed or Indexed Collection. + * + * + * ```js + * const { isAssociative, Map, List, Stack, Set } = require('immutable'); + * isAssociative([]); // false + * isAssociative({}); // false + * isAssociative(Map()); // true + * isAssociative(List()); // true + * isAssociative(Stack()); // true + * isAssociative(Set()); // false + * ``` + */ + function isAssociative( + maybeAssociative: unknown + ): maybeAssociative is + | Collection.Keyed + | Collection.Indexed; + + /** + * True if `maybeOrdered` is a Collection where iteration order is well + * defined. True for Collection.Indexed as well as OrderedMap and OrderedSet. + * + * + * ```js + * const { isOrdered, Map, OrderedMap, List, Set } = require('immutable'); + * isOrdered([]); // false + * isOrdered({}); // false + * isOrdered(Map()); // false + * isOrdered(OrderedMap()); // true + * isOrdered(List()); // true + * isOrdered(Set()); // false + * ``` + */ + function isOrdered( + maybeOrdered: Iterable + ): maybeOrdered is OrderedCollection; + function isOrdered( + maybeOrdered: unknown + ): maybeOrdered is OrderedCollection; + + /** + * True if `maybeValue` is a JavaScript Object which has *both* `equals()` + * and `hashCode()` methods. + * + * Any two instances of *value objects* can be compared for value equality with + * `Immutable.is()` and can be used as keys in a `Map` or members in a `Set`. + */ + function isValueObject(maybeValue: unknown): maybeValue is ValueObject; + + /** + * True if `maybeSeq` is a Seq. + */ + function isSeq( + maybeSeq: unknown + ): maybeSeq is + | Seq.Indexed + | Seq.Keyed + | Seq.Set; + + /** + * True if `maybeList` is a List. + */ + function isList(maybeList: unknown): maybeList is List; + + /** + * True if `maybeMap` is a Map. + * + * Also true for OrderedMaps. + */ + function isMap(maybeMap: unknown): maybeMap is Map; + + /** + * True if `maybeOrderedMap` is an OrderedMap. + */ + function isOrderedMap( + maybeOrderedMap: unknown + ): maybeOrderedMap is OrderedMap; + + /** + * True if `maybeStack` is a Stack. + */ + function isStack(maybeStack: unknown): maybeStack is Stack; + + /** + * True if `maybeSet` is a Set. + * + * Also true for OrderedSets. + */ + function isSet(maybeSet: unknown): maybeSet is Set; + + /** + * True if `maybeOrderedSet` is an OrderedSet. + */ + function isOrderedSet( + maybeOrderedSet: unknown + ): maybeOrderedSet is OrderedSet; + + /** + * True if `maybeRecord` is a Record. + */ + function isRecord(maybeRecord: unknown): maybeRecord is Record; + + /** + * Returns the value within the provided collection associated with the + * provided key, or notSetValue if the key is not defined in the collection. + * + * A functional alternative to `collection.get(key)` which will also work on + * plain Objects and Arrays as an alternative for `collection[key]`. + * + * + * ```js + * const { get } = require('immutable') + * get([ 'dog', 'frog', 'cat' ], 2) // 'frog' + * get({ x: 123, y: 456 }, 'x') // 123 + * get({ x: 123, y: 456 }, 'z', 'ifNotSet') // 'ifNotSet' + * ``` + */ + function get(collection: Collection, key: K): V | undefined; + function get( + collection: Collection, + key: K, + notSetValue: NSV + ): V | NSV; + function get( + record: Record, + key: K, + notSetValue: unknown + ): TProps[K]; + function get(collection: Array, key: number): V | undefined; + function get( + collection: Array, + key: number, + notSetValue: NSV + ): V | NSV; + function get( + object: C, + key: K, + notSetValue: unknown + ): C[K]; + function get( + collection: { [key: PropertyKey]: V }, + key: string + ): V | undefined; + function get( + collection: { [key: PropertyKey]: V }, + key: string, + notSetValue: NSV + ): V | NSV; + + /** + * Returns true if the key is defined in the provided collection. + * + * A functional alternative to `collection.has(key)` which will also work with + * plain Objects and Arrays as an alternative for + * `collection.hasOwnProperty(key)`. + * + * + * ```js + * const { has } = require('immutable') + * has([ 'dog', 'frog', 'cat' ], 2) // true + * has([ 'dog', 'frog', 'cat' ], 5) // false + * has({ x: 123, y: 456 }, 'x') // true + * has({ x: 123, y: 456 }, 'z') // false + * ``` + */ + function has(collection: object, key: unknown): boolean; + + /** + * Returns a copy of the collection with the value at key removed. + * + * A functional alternative to `collection.remove(key)` which will also work + * with plain Objects and Arrays as an alternative for + * `delete collectionCopy[key]`. + * + * + * ```js + * const { remove } = require('immutable') + * const originalArray = [ 'dog', 'frog', 'cat' ] + * remove(originalArray, 1) // [ 'dog', 'cat' ] + * console.log(originalArray) // [ 'dog', 'frog', 'cat' ] + * const originalObject = { x: 123, y: 456 } + * remove(originalObject, 'x') // { y: 456 } + * console.log(originalObject) // { x: 123, y: 456 } + * ``` + */ + function remove>( + collection: C, + key: K + ): C; + function remove< + TProps extends object, + C extends Record, + K extends keyof TProps, + >(collection: C, key: K): C; + function remove>(collection: C, key: number): C; + function remove(collection: C, key: K): C; + function remove( + collection: C, + key: K + ): C; + + /** + * Returns a copy of the collection with the value at key set to the provided + * value. + * + * A functional alternative to `collection.set(key, value)` which will also + * work with plain Objects and Arrays as an alternative for + * `collectionCopy[key] = value`. + * + * + * ```js + * const { set } = require('immutable') + * const originalArray = [ 'dog', 'frog', 'cat' ] + * set(originalArray, 1, 'cow') // [ 'dog', 'cow', 'cat' ] + * console.log(originalArray) // [ 'dog', 'frog', 'cat' ] + * const originalObject = { x: 123, y: 456 } + * set(originalObject, 'x', 789) // { x: 789, y: 456 } + * console.log(originalObject) // { x: 123, y: 456 } + * ``` + */ + function set>( + collection: C, + key: K, + value: V + ): C; + function set< + TProps extends object, + C extends Record, + K extends keyof TProps, + >(record: C, key: K, value: TProps[K]): C; + function set>(collection: C, key: number, value: V): C; + function set(object: C, key: K, value: C[K]): C; + function set( + collection: C, + key: string, + value: V + ): C; + + /** + * Returns a copy of the collection with the value at key set to the result of + * providing the existing value to the updating function. + * + * A functional alternative to `collection.update(key, fn)` which will also + * work with plain Objects and Arrays as an alternative for + * `collectionCopy[key] = fn(collection[key])`. + * + * + * ```js + * const { update } = require('immutable') + * const originalArray = [ 'dog', 'frog', 'cat' ] + * update(originalArray, 1, val => val.toUpperCase()) // [ 'dog', 'FROG', 'cat' ] + * console.log(originalArray) // [ 'dog', 'frog', 'cat' ] + * const originalObject = { x: 123, y: 456 } + * update(originalObject, 'x', val => val * 6) // { x: 738, y: 456 } + * console.log(originalObject) // { x: 123, y: 456 } + * ``` + */ + function update>( + collection: C, + key: K, + updater: (value: V | undefined) => V | undefined + ): C; + function update, NSV>( + collection: C, + key: K, + notSetValue: NSV, + updater: (value: V | NSV) => V + ): C; + function update< + TProps extends object, + C extends Record, + K extends keyof TProps, + >(record: C, key: K, updater: (value: TProps[K]) => TProps[K]): C; + function update< + TProps extends object, + C extends Record, + K extends keyof TProps, + NSV, + >( + record: C, + key: K, + notSetValue: NSV, + updater: (value: TProps[K] | NSV) => TProps[K] + ): C; + function update( + collection: Array, + key: number, + updater: (value: V | undefined) => V | undefined + ): Array; + function update( + collection: Array, + key: number, + notSetValue: NSV, + updater: (value: V | NSV) => V + ): Array; + function update( + object: C, + key: K, + updater: (value: C[K]) => C[K] + ): C; + function update( + object: C, + key: K, + notSetValue: NSV, + updater: (value: C[K] | NSV) => C[K] + ): C; + function update( + collection: C, + key: K, + updater: (value: V) => V + ): { [key: string]: V }; + function update( + collection: C, + key: K, + notSetValue: NSV, + updater: (value: V | NSV) => V + ): { [key: string]: V }; + + // TODO `` can be used after dropping support for TypeScript 4.x + // reference: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-0.html#const-type-parameters + // after this change, `as const` assertions can be remove from the type tests + /** + * Returns the value at the provided key path starting at the provided + * collection, or notSetValue if the key path is not defined. + * + * A functional alternative to `collection.getIn(keypath)` which will also + * work with plain Objects and Arrays. + * + * + * ```js + * const { getIn } = require('immutable') + * getIn({ x: { y: { z: 123 }}}, ['x', 'y', 'z']) // 123 + * getIn({ x: { y: { z: 123 }}}, ['x', 'q', 'p'], 'ifNotSet') // 'ifNotSet' + * ``` + */ + function getIn>( + object: C, + keyPath: [...P] + ): RetrievePath; + function getIn>(object: C, keyPath: P): unknown; + function getIn, NSV>( + collection: C, + keyPath: [...P], + notSetValue: NSV + ): RetrievePath extends never ? NSV : RetrievePath; + function getIn, NSV>( + object: C, + keyPath: P, + notSetValue: NSV + ): unknown; + + /** + * Returns true if the key path is defined in the provided collection. + * + * A functional alternative to `collection.hasIn(keypath)` which will also + * work with plain Objects and Arrays. + * + * + * ```js + * const { hasIn } = require('immutable') + * hasIn({ x: { y: { z: 123 }}}, ['x', 'y', 'z']) // true + * hasIn({ x: { y: { z: 123 }}}, ['x', 'q', 'p']) // false + * ``` + */ + function hasIn( + collection: string | boolean | number, + keyPath: KeyPath + ): never; + function hasIn(collection: unknown, keyPath: KeyPath): boolean; + + /** + * Returns a copy of the collection with the value at the key path removed. + * + * A functional alternative to `collection.removeIn(keypath)` which will also + * work with plain Objects and Arrays. + * + * + * ```js + * const { removeIn } = require('immutable') + * const original = { x: { y: { z: 123 }}} + * removeIn(original, ['x', 'y', 'z']) // { x: { y: {}}} + * console.log(original) // { x: { y: { z: 123 }}} + * ``` + */ + function removeIn(collection: C, keyPath: Iterable): C; + + /** + * Returns a copy of the collection with the value at the key path set to the + * provided value. + * + * A functional alternative to `collection.setIn(keypath)` which will also + * work with plain Objects and Arrays. + * + * + * ```js + * const { setIn } = require('immutable') + * const original = { x: { y: { z: 123 }}} + * setIn(original, ['x', 'y', 'z'], 456) // { x: { y: { z: 456 }}} + * console.log(original) // { x: { y: { z: 123 }}} + * ``` + */ + function setIn( + collection: C, + keyPath: Iterable, + value: unknown + ): C; + + /** + * Returns a copy of the collection with the value at key path set to the + * result of providing the existing value to the updating function. + * + * A functional alternative to `collection.updateIn(keypath)` which will also + * work with plain Objects and Arrays. + * + * + * ```js + * const { updateIn } = require('immutable') + * const original = { x: { y: { z: 123 }}} + * updateIn(original, ['x', 'y', 'z'], val => val * 6) // { x: { y: { z: 738 }}} + * console.log(original) // { x: { y: { z: 123 }}} + * ``` + */ + function updateIn>( + collection: C, + keyPath: KeyPath, + updater: ( + value: RetrievePath> | undefined + ) => unknown | undefined + ): C; + function updateIn, NSV>( + collection: C, + keyPath: KeyPath, + notSetValue: NSV, + updater: (value: RetrievePath> | NSV) => unknown + ): C; + function updateIn< + TProps extends object, + C extends Record, + K extends keyof TProps, + >( + record: C, + keyPath: KeyPath, + updater: (value: RetrievePath>) => unknown + ): C; + function updateIn< + TProps extends object, + C extends Record, + K extends keyof TProps, + NSV, + >( + record: C, + keyPath: KeyPath, + notSetValue: NSV, + updater: (value: RetrievePath> | NSV) => unknown + ): C; + function updateIn>( + collection: Array, + keyPath: KeyPath, + updater: ( + value: RetrievePath> | undefined + ) => unknown | undefined + ): Array; + function updateIn, NSV>( + collection: Array, + keyPath: KeyPath, + notSetValue: NSV, + updater: (value: RetrievePath> | NSV) => unknown + ): Array; + function updateIn( + object: C, + keyPath: KeyPath, + updater: (value: RetrievePath>) => unknown + ): C; + function updateIn( + object: C, + keyPath: KeyPath, + notSetValue: NSV, + updater: (value: RetrievePath> | NSV) => unknown + ): C; + function updateIn< + K extends PropertyKey, + V, + C extends { [key: PropertyKey]: V }, + >( + collection: C, + keyPath: KeyPath, + updater: (value: RetrievePath>) => unknown + ): { [key: PropertyKey]: V }; + function updateIn< + K extends PropertyKey, + V, + C extends { [key: PropertyKey]: V }, + NSV, + >( + collection: C, + keyPath: KeyPath, + notSetValue: NSV, + updater: (value: RetrievePath> | NSV) => unknown + ): { [key: PropertyKey]: V }; + + /** + * Returns a copy of the collection with the remaining collections merged in. + * + * A functional alternative to `collection.merge()` which will also work with + * plain Objects and Arrays. + * + * + * ```js + * const { merge } = require('immutable') + * const original = { x: 123, y: 456 } + * merge(original, { y: 789, z: 'abc' }) // { x: 123, y: 789, z: 'abc' } + * console.log(original) // { x: 123, y: 456 } + * ``` + */ + function merge( + collection: C, + ...collections: Array< + | Iterable + | Iterable<[unknown, unknown]> + | { [key: string]: unknown } + > + ): C; + + /** + * Returns a copy of the collection with the remaining collections merged in, + * calling the `merger` function whenever an existing value is encountered. + * + * A functional alternative to `collection.mergeWith()` which will also work + * with plain Objects and Arrays. + * + * + * ```js + * const { mergeWith } = require('immutable') + * const original = { x: 123, y: 456 } + * mergeWith( + * (oldVal, newVal) => oldVal + newVal, + * original, + * { y: 789, z: 'abc' } + * ) // { x: 123, y: 1245, z: 'abc' } + * console.log(original) // { x: 123, y: 456 } + * ``` + */ + function mergeWith( + merger: (oldVal: unknown, newVal: unknown, key: unknown) => unknown, + collection: C, + ...collections: Array< + | Iterable + | Iterable<[unknown, unknown]> + | { [key: string]: unknown } + > + ): C; + + /** + * Like `merge()`, but when two compatible collections are encountered with + * the same key, it merges them as well, recursing deeply through the nested + * data. Two collections are considered to be compatible (and thus will be + * merged together) if they both fall into one of three categories: keyed + * (e.g., `Map`s, `Record`s, and objects), indexed (e.g., `List`s and + * arrays), or set-like (e.g., `Set`s). If they fall into separate + * categories, `mergeDeep` will replace the existing collection with the + * collection being merged in. This behavior can be customized by using + * `mergeDeepWith()`. + * + * Note: Indexed and set-like collections are merged using + * `concat()`/`union()` and therefore do not recurse. + * + * A functional alternative to `collection.mergeDeep()` which will also work + * with plain Objects and Arrays. + * + * + * ```js + * const { mergeDeep } = require('immutable') + * const original = { x: { y: 123 }} + * mergeDeep(original, { x: { z: 456 }}) // { x: { y: 123, z: 456 }} + * console.log(original) // { x: { y: 123 }} + * ``` + */ + function mergeDeep( + collection: C, + ...collections: Array< + | Iterable + | Iterable<[unknown, unknown]> + | { [key: string]: unknown } + > + ): C; + + /** + * Like `mergeDeep()`, but when two non-collections or incompatible + * collections are encountered at the same key, it uses the `merger` function + * to determine the resulting value. Collections are considered incompatible + * if they fall into separate categories between keyed, indexed, and set-like. + * + * A functional alternative to `collection.mergeDeepWith()` which will also + * work with plain Objects and Arrays. + * + * + * ```js + * const { mergeDeepWith } = require('immutable') + * const original = { x: { y: 123 }} + * mergeDeepWith( + * (oldVal, newVal) => oldVal + newVal, + * original, + * { x: { y: 456 }} + * ) // { x: { y: 579 }} + * console.log(original) // { x: { y: 123 }} + * ``` + */ + function mergeDeepWith( + merger: (oldVal: unknown, newVal: unknown, key: unknown) => unknown, + collection: C, + ...collections: Array< + | Iterable + | Iterable<[unknown, unknown]> + | { [key: string]: unknown } + > + ): C; +} + +/** + * Defines the main export of the immutable module to be the Immutable namespace + * This supports many common module import patterns: + * + * const Immutable = require("immutable"); + * const { List } = require("immutable"); + * import Immutable from "immutable"; + * import * as Immutable from "immutable"; + * import { List } from "immutable"; + * + */ +export = Immutable; + +/** + * A global "Immutable" namespace used by UMD modules which allows the use of + * the full Immutable API. + * + * If using Immutable as an imported module, prefer using: + * + * import Immutable from 'immutable' + * + */ +export as namespace Immutable; diff --git a/type-definitions/immutable.js.flow b/type-definitions/immutable.js.flow index 3cb6844961..9ab444d234 100644 --- a/type-definitions/immutable.js.flow +++ b/type-definitions/immutable.js.flow @@ -2,98 +2,158 @@ * This file provides type definitions for use with the Flow type checker. * * An important caveat when using these definitions is that the types for - * `Iterable.Keyed`, `Iterable.Indexed`, `Seq.Keyed`, and so on are stubs. + * `Collection.Keyed`, `Collection.Indexed`, `Seq.Keyed`, and so on are stubs. * When referring to those types, you can get the proper definitions by - * importing the types `KeyedIterable`, `IndexedIterable`, `KeyedSeq`, etc. + * importing the types `KeyedCollection`, `IndexedCollection`, `KeyedSeq`, etc. * For example, * * import { Seq } from 'immutable' - * import type { IndexedIterable, IndexedSeq } from 'immutable' + * import type { IndexedCollection, IndexedSeq } from 'immutable' * * const someSeq: IndexedSeq = Seq.Indexed.of(1, 2, 3) * - * function takesASeq>(iter: TS): TS { + * function takesASeq>(iter: TS): TS { * return iter.butLast() * } * * takesASeq(someSeq) * - * @flow + * @flow strict */ -/* - * Alias for ECMAScript `Iterable` type, declared in - * https://github.com/facebook/flow/blob/master/lib/core.js - * - * Note that Immutable values implement the `ESIterable` interface. - */ -type ESIterable = $Iterable; - -declare class Iterable extends _Iterable {} - -declare class _Iterable { - static Keyed: KI; - static Indexed: II; - static Set: SI; - - static isIterable(maybeIterable: any): boolean; - static isKeyed(maybeKeyed: any): boolean; - static isIndexed(maybeIndexed: any): boolean; - static isAssociative(maybeAssociative: any): boolean; - static isOrdered(maybeOrdered: any): boolean; - - equals(other: Iterable): boolean; +// Helper type that represents plain objects allowed as arguments to +// some constructors and functions. +type PlainObjInput = { +[key: K]: V, __proto__: null }; + +type K = $Keys; + +// Helper types to extract the "keys" and "values" use by the *In() methods. +type $KeyOf = $Call< + ((?_Collection) => K) & + ((?$ReadOnlyArray) => number) & + ((?RecordInstance | T) => $Keys) & + ((T) => $Keys), + C, +>; + +type $ValOf> = $Call< + ((?_Collection) => V) & + ((?$ReadOnlyArray) => T) & + (>(?RecordInstance | T, K) => $ElementType) & + ((T) => $Values), + C, + K, +>; + +type $IterableOf = $Call< + ( | IndexedCollection | SetCollection>( + V + ) => Iterable<$ValOf>) & + (< + V: + | KeyedCollection + | RecordInstance + | PlainObjInput, + >( + V + ) => Iterable<[$KeyOf, $ValOf]>), + C, +>; + +const PairSorting: $ReadOnly<{ LeftThenRight: number, RightThenLeft: number }> = + { + LeftThenRight: -1, + RightThenLeft: +1, + }; + +type Comparator = (left: T, right: T) => number; + +declare class _Collection implements ValueObject { + equals(other: mixed): boolean; hashCode(): number; - get(key: K): V; - get(key: K, notSetValue: V_): V|V_; + get(key: K, ..._: []): V | void; + get(key: K, notSetValue: NSV): V | NSV; has(key: K): boolean; includes(value: V): boolean; contains(value: V): boolean; - first(): V; - last(): V; - - getIn(searchKeyPath: ESIterable, notSetValue: T): T; - getIn(searchKeyPath: ESIterable): T; - hasIn(searchKeyPath: ESIterable): boolean; - - toJS(): any; - toArray(): V[]; + first(): V | void; + first(notSetValue: NSV): V | NSV; + last(): V | void; + last(notSetValue: NSV): V | NSV; + + hasIn(keyPath: Iterable): boolean; + + getIn(keyPath: [], notSetValue?: mixed): this; + getIn(keyPath: [K], notSetValue: NSV): V | NSV; + getIn>( + keyPath: [K, K2], + notSetValue: NSV + ): $ValOf | NSV; + getIn, K3: $KeyOf<$ValOf>>( + keyPath: [K, K2, K3], + notSetValue: NSV + ): $ValOf<$ValOf, K3> | NSV; + getIn< + NSV, + K2: $KeyOf, + K3: $KeyOf<$ValOf>, + K4: $KeyOf<$ValOf<$ValOf, K3>>, + >( + keyPath: [K, K2, K3, K4], + notSetValue: NSV + ): $ValOf<$ValOf<$ValOf, K3>, K4> | NSV; + getIn< + NSV, + K2: $KeyOf, + K3: $KeyOf<$ValOf>, + K4: $KeyOf<$ValOf<$ValOf, K3>>, + K5: $KeyOf<$ValOf<$ValOf<$ValOf, K3>, K4>>, + >( + keyPath: [K, K2, K3, K4, K5], + notSetValue: NSV + ): $ValOf<$ValOf<$ValOf<$ValOf, K3>, K4>, K5> | NSV; + + update(updater: (value: this) => U): U; + + toJS(): Array | { [key: string]: mixed }; + toJSON(): Array | { [key: string]: V }; + toArray(): Array | Array<[K, V]>; toObject(): { [key: string]: V }; - toMap(): Map; - toOrderedMap(): Map; + toMap(): Map; + toOrderedMap(): OrderedMap; toSet(): Set; - toOrderedSet(): Set; + toOrderedSet(): OrderedSet; toList(): List; toStack(): Stack; - toSeq(): Seq; - toKeyedSeq(): KeyedSeq; + toSeq(): Seq; + toKeyedSeq(): KeyedSeq; toIndexedSeq(): IndexedSeq; toSetSeq(): SetSeq; keys(): Iterator; values(): Iterator; - entries(): Iterator<[K,V]>; + entries(): Iterator<[K, V]>; keySeq(): IndexedSeq; valueSeq(): IndexedSeq; - entrySeq(): IndexedSeq<[K,V]>; + entrySeq(): IndexedSeq<[K, V]>; reverse(): this; - sort(comparator?: (valueA: V, valueB: V) => number): this; + sort(comparator?: Comparator): this; sortBy( comparatorValueMapper: (value: V, key: K, iter: this) => C, - comparator?: (valueA: C, valueB: C) => number + comparator?: Comparator ): this; groupBy( grouper: (value: V, key: K, iter: this) => G, - context?: any + context?: mixed ): KeyedSeq; forEach( sideEffect: (value: V, key: K, iter: this) => any, - context?: any + context?: mixed ): number; slice(begin?: number, end?: number): this; @@ -101,557 +161,2207 @@ declare class _Iterable { butLast(): this; skip(amount: number): this; skipLast(amount: number): this; - skipWhile(predicate: (value: V, key: K, iter: this) => mixed, context?: any): this; - skipUntil(predicate: (value: V, key: K, iter: this) => mixed, context?: any): this; + skipWhile( + predicate: (value: V, key: K, iter: this) => mixed, + context?: mixed + ): this; + skipUntil( + predicate: (value: V, key: K, iter: this) => mixed, + context?: mixed + ): this; take(amount: number): this; takeLast(amount: number): this; - takeWhile(predicate: (value: V, key: K, iter: this) => mixed, context?: any): this; - takeUntil(predicate: (value: V, key: K, iter: this) => mixed, context?: any): this; - flatten(depth?: number): /*this*/Iterable; - flatten(shallow?: boolean): /*this*/Iterable; - - filter( + takeWhile( + predicate: (value: V, key: K, iter: this) => mixed, + context?: mixed + ): this; + takeUntil( predicate: (value: V, key: K, iter: this) => mixed, - context?: any + context?: mixed ): this; filterNot( predicate: (value: V, key: K, iter: this) => mixed, - context?: any + context?: mixed ): this; reduce( reducer: (reduction: R, value: V, key: K, iter: this) => R, - initialReduction?: R, - context?: any, + initialReduction: R, + context?: mixed ): R; + reduce(reducer: (reduction: V | R, value: V, key: K, iter: this) => R): R; reduceRight( reducer: (reduction: R, value: V, key: K, iter: this) => R, - initialReduction?: R, - context?: any, + initialReduction: R, + context?: mixed + ): R; + reduceRight( + reducer: (reduction: V | R, value: V, key: K, iter: this) => R ): R; - every(predicate: (value: V, key: K, iter: this) => mixed, context?: any): boolean; - some(predicate: (value: V, key: K, iter: this) => mixed, context?: any): boolean; + every( + predicate: (value: V, key: K, iter: this) => mixed, + context?: mixed + ): boolean; + some( + predicate: (value: V, key: K, iter: this) => mixed, + context?: mixed + ): boolean; join(separator?: string): string; isEmpty(): boolean; - count(predicate?: (value: V, key: K, iter: this) => mixed, context?: any): number; - countBy(grouper: (value: V, key: K, iter: this) => G, context?: any): Map; + count( + predicate?: (value: V, key: K, iter: this) => mixed, + context?: mixed + ): number; + countBy( + grouper: (value: V, key: K, iter: this) => G, + context?: mixed + ): Map; find( predicate: (value: V, key: K, iter: this) => mixed, - context?: any, - ): ?V; - find( - predicate: (value: V, key: K, iter: this) => mixed, - context: any, - notSetValue: V_ - ): V|V_; - + context?: mixed, + notSetValue?: V + ): V | void; findLast( predicate: (value: V, key: K, iter: this) => mixed, - context?: any, - ): ?V; - findLast( - predicate: (value: V, key: K, iter: this) => mixed, - context: any, - notSetValue: V_ - ): V|V_; - + context?: mixed, + notSetValue?: V + ): V | void; - findEntry(predicate: (value: V, key: K, iter: this) => mixed): ?[K,V]; - findLastEntry(predicate: (value: V, key: K, iter: this) => mixed): ?[K,V]; + findEntry(predicate: (value: V, key: K, iter: this) => mixed): [K, V] | void; + findLastEntry( + predicate: (value: V, key: K, iter: this) => mixed + ): [K, V] | void; - findKey(predicate: (value: V, key: K, iter: this) => mixed, context?: any): ?K; - findLastKey(predicate: (value: V, key: K, iter: this) => mixed, context?: any): ?K; + findKey( + predicate: (value: V, key: K, iter: this) => mixed, + context?: mixed + ): K | void; + findLastKey( + predicate: (value: V, key: K, iter: this) => mixed, + context?: mixed + ): K | void; - keyOf(searchValue: V): ?K; - lastKeyOf(searchValue: V): ?K; + keyOf(searchValue: V): K | void; + lastKeyOf(searchValue: V): K | void; - max(comparator?: (valueA: V, valueB: V) => number): V; + max(comparator?: Comparator): V; maxBy( comparatorValueMapper: (value: V, key: K, iter: this) => C, - comparator?: (valueA: C, valueB: C) => number + comparator?: Comparator ): V; - min(comparator?: (valueA: V, valueB: V) => number): V; + min(comparator?: Comparator): V; minBy( comparatorValueMapper: (value: V, key: K, iter: this) => C, - comparator?: (valueA: C, valueB: C) => number + comparator?: Comparator ): V; - isSubset(iter: Iterable): boolean; - isSubset(iter: ESIterable): boolean; - isSuperset(iter: Iterable): boolean; - isSuperset(iter: ESIterable): boolean; + isSubset(iter: Iterable): boolean; + isSuperset(iter: Iterable): boolean; +} + +declare function isImmutable( + maybeImmutable: mixed +): boolean %checks(maybeImmutable instanceof Collection); +declare function isCollection( + maybeCollection: mixed +): boolean %checks(maybeCollection instanceof Collection); +declare function isKeyed( + maybeKeyed: mixed +): boolean %checks(maybeKeyed instanceof KeyedCollection); +declare function isIndexed( + maybeIndexed: mixed +): boolean %checks(maybeIndexed instanceof IndexedCollection); +declare function isAssociative( + maybeAssociative: mixed +): boolean %checks(maybeAssociative instanceof KeyedCollection || + maybeAssociative instanceof IndexedCollection); +declare function isOrdered( + maybeOrdered: mixed +): boolean %checks(maybeOrdered instanceof IndexedCollection || + maybeOrdered instanceof OrderedMap || + maybeOrdered instanceof OrderedSet); +declare function isValueObject(maybeValue: mixed): boolean; + +declare function isSeq(maybeSeq: any): boolean %checks(maybeSeq instanceof Seq); +declare function isList(maybeList: any): boolean %checks(maybeList instanceof + List); +declare function isMap(maybeMap: any): boolean %checks(maybeMap instanceof Map); +declare function isOrderedMap( + maybeOrderedMap: any +): boolean %checks(maybeOrderedMap instanceof OrderedMap); +declare function isStack(maybeStack: any): boolean %checks(maybeStack instanceof + Stack); +declare function isSet(maybeSet: any): boolean %checks(maybeSet instanceof Set); +declare function isOrderedSet( + maybeOrderedSet: any +): boolean %checks(maybeOrderedSet instanceof OrderedSet); +declare function isRecord( + maybeRecord: any +): boolean %checks(maybeRecord instanceof Record); + +declare interface ValueObject { + equals(other: mixed): boolean; + hashCode(): number; } -declare class KeyedIterable extends Iterable { - static (iter?: ESIterable<[K,V]>): KeyedIterable; - static (obj?: { [key: K]: V }): KeyedIterable; +declare class Collection extends _Collection { + static Keyed: typeof KeyedCollection; + static Indexed: typeof IndexedCollection; + static Set: typeof SetCollection; - @@iterator(): Iterator<[K,V]>; - toSeq(): KeyedSeq; - flip(): /*this*/KeyedIterable; + static isCollection: typeof isCollection; + static isKeyed: typeof isKeyed; + static isIndexed: typeof isIndexed; + static isAssociative: typeof isAssociative; + static isOrdered: typeof isOrdered; +} - mapKeys( - mapper: (key: K, value: V, iter: this) => K_, - context?: any - ): /*this*/KeyedIterable; +declare class KeyedCollection extends Collection { + static ( + values?: Iterable<[K, V]> | PlainObjInput + ): KeyedCollection; - mapEntries( - mapper: (entry: [K,V], index: number, iter: this) => [K_,V_], - context?: any - ): /*this*/KeyedIterable; + toJS(): { [key: string]: mixed }; + toJSON(): { [key: string]: V }; + toArray(): Array<[K, V]>; + @@iterator(): Iterator<[K, V]>; + toSeq(): KeyedSeq; + flip(): KeyedCollection; - concat(...iters: ESIterable<[K,V]>[]): this; + concat( + ...iters: Array | PlainObjInput> + ): KeyedCollection; - map( - mapper: (value: V, key: K, iter: this) => V_, - context?: any - ): /*this*/KeyedIterable; + filter(predicate: typeof Boolean): KeyedCollection>; + filter( + predicate: (value: V, key: K, iter: this) => mixed, + context?: mixed + ): KeyedCollection; - flatMap( - mapper: (value: V, key: K, iter: this) => ESIterable<[K_,V_]>, - context?: any - ): /*this*/KeyedIterable; + partition( + predicate: (value: V, key: K, iter: this) => mixed, + context?: mixed + ): [this, this]; - flatten(depth?: number): /*this*/KeyedIterable; - flatten(shallow?: boolean): /*this*/KeyedIterable; + map( + mapper: (value: V, key: K, iter: this) => M, + context?: mixed + ): KeyedCollection; + + mapKeys( + mapper: (key: K, value: V, iter: this) => M, + context?: mixed + ): KeyedCollection; + + mapEntries( + mapper: (entry: [K, V], index: number, iter: this) => [KM, VM], + context?: mixed + ): KeyedCollection; + + flatMap( + mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>, + context?: mixed + ): KeyedCollection; + + flatten(depth?: number): KeyedCollection; + flatten(shallow?: boolean): KeyedCollection; } -declare class IndexedIterable extends Iterable { - static (iter?: ESIterable): IndexedIterable; +Collection.Keyed = KeyedCollection; + +declare class IndexedCollection<+T> extends Collection { + static (iter?: Iterable): IndexedCollection; + toJS(): Array; + toJSON(): Array; + toArray(): Array; @@iterator(): Iterator; toSeq(): IndexedSeq; - fromEntrySeq(): KeyedSeq; + fromEntrySeq(): KeyedSeq; interpose(separator: T): this; - interleave(...iterables: ESIterable[]): this; - splice( - index: number, - removeNum: number, - ...values: T[] - ): this; - - zip( - a: ESIterable, - $?: null - ): IndexedIterable<[T,A]>; - zip( - a: ESIterable, - b: ESIterable, - $?: null - ): IndexedIterable<[T,A,B]>; - zip( - a: ESIterable, - b: ESIterable, - c: ESIterable, - $?: null - ): IndexedIterable<[T,A,B,C]>; - zip( - a: ESIterable, - b: ESIterable, - c: ESIterable, - d: ESIterable, - $?: null - ): IndexedIterable<[T,A,B,C,D]>; - zip( - a: ESIterable, - b: ESIterable, - c: ESIterable, - d: ESIterable, - e: ESIterable, - $?: null - ): IndexedIterable<[T,A,B,C,D,E]>; - - zipWith( + interleave(...collections: Iterable[]): this; + splice(index: number, removeNum: number, ...values: T[]): this; + + zip(a: Iterable, ..._: []): IndexedCollection<[T, A]>; + zip( + a: Iterable, + b: Iterable, + ..._: [] + ): IndexedCollection<[T, A, B]>; + zip( + a: Iterable, + b: Iterable, + c: Iterable, + ..._: [] + ): IndexedCollection<[T, A, B, C]>; + zip( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + ..._: [] + ): IndexedCollection<[T, A, B, C, D]>; + zip( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + e: Iterable, + ..._: [] + ): IndexedCollection<[T, A, B, C, D, E]>; + + zipAll(a: Iterable, ..._: []): IndexedCollection<[T | void, A | void]>; + zipAll( + a: Iterable, + b: Iterable, + ..._: [] + ): IndexedCollection<[T | void, A | void, B | void]>; + zipAll( + a: Iterable, + b: Iterable, + c: Iterable, + ..._: [] + ): IndexedCollection<[T | void, A | void, B | void, C | void]>; + zipAll( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + ..._: [] + ): IndexedCollection<[T | void, A | void, B | void, C | void, D | void]>; + zipAll( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + e: Iterable, + ..._: [] + ): IndexedCollection< + [T | void, A | void, B | void, C | void, D | void, E | void], + >; + + zipWith( zipper: (value: T, a: A) => R, - a: ESIterable, - $?: null - ): IndexedIterable; - zipWith( + a: Iterable, + ..._: [] + ): IndexedCollection; + zipWith( zipper: (value: T, a: A, b: B) => R, - a: ESIterable, - b: ESIterable, - $?: null - ): IndexedIterable; - zipWith( + a: Iterable, + b: Iterable, + ..._: [] + ): IndexedCollection; + zipWith( zipper: (value: T, a: A, b: B, c: C) => R, - a: ESIterable, - b: ESIterable, - c: ESIterable, - $?: null - ): IndexedIterable; - zipWith( + a: Iterable, + b: Iterable, + c: Iterable, + ..._: [] + ): IndexedCollection; + zipWith( zipper: (value: T, a: A, b: B, c: C, d: D) => R, - a: ESIterable, - b: ESIterable, - c: ESIterable, - d: ESIterable, - $?: null - ): IndexedIterable; - zipWith( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + ..._: [] + ): IndexedCollection; + zipWith( zipper: (value: T, a: A, b: B, c: C, d: D, e: E) => R, - a: ESIterable, - b: ESIterable, - c: ESIterable, - d: ESIterable, - e: ESIterable, - $?: null - ): IndexedIterable; + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + e: Iterable, + ..._: [] + ): IndexedCollection; indexOf(searchValue: T): number; lastIndexOf(searchValue: T): number; findIndex( predicate: (value: T, index: number, iter: this) => mixed, - context?: any + context?: mixed ): number; findLastIndex( predicate: (value: T, index: number, iter: this) => mixed, - context?: any + context?: mixed ): number; - concat(...iters: ESIterable[]): this; + concat(...iters: Array | C>): IndexedCollection; + + filter(predicate: typeof Boolean): IndexedCollection<$NonMaybeType>; + filter( + predicate: (value: T, index: number, iter: this) => mixed, + context?: mixed + ): IndexedCollection; - map( - mapper: (value: T, index: number, iter: this) => U, - context?: any - ): /*this*/IndexedIterable; + partition( + predicate: (value: T, index: number, iter: this) => mixed, + context?: mixed + ): [this, this]; - flatMap( - mapper: (value: T, index: number, iter: this) => ESIterable, - context?: any - ): /*this*/IndexedIterable; + map( + mapper: (value: T, index: number, iter: this) => M, + context?: mixed + ): IndexedCollection; - flatten(depth?: number): /*this*/IndexedIterable; - flatten(shallow?: boolean): /*this*/IndexedIterable; + flatMap( + mapper: (value: T, index: number, iter: this) => Iterable, + context?: mixed + ): IndexedCollection; + + flatten(depth?: number): IndexedCollection; + flatten(shallow?: boolean): IndexedCollection; } -declare class SetIterable extends Iterable { - static (iter?: ESIterable): SetIterable; +declare class SetCollection<+T> extends Collection { + static (iter?: Iterable): SetCollection; + toJS(): Array; + toJSON(): Array; + toArray(): Array; @@iterator(): Iterator; toSeq(): SetSeq; - concat(...iters: ESIterable[]): this; - - // `map` and `flatMap` cannot be defined further up the hiearchy, because the - // implementation for `KeyedIterable` allows the value type to change without - // constraining the key type. That does not work for `SetIterable` - the value - // and key types *must* match. - map( - mapper: (value: T, value: T, iter: this) => U, - context?: any - ): /*this*/SetIterable; + concat(...collections: Iterable[]): SetCollection; - flatMap( - mapper: (value: T, value: T, iter: this) => ESIterable, - context?: any - ): /*this*/SetIterable; + // `filter`, `map` and `flatMap` cannot be defined further up the hierarchy, + // because the implementation for `KeyedCollection` allows the value type to + // change without constraining the key type. That does not work for + // `SetCollection` - the value and key types *must* match. + filter(predicate: typeof Boolean): SetCollection<$NonMaybeType>; + filter( + predicate: (value: T, value: T, iter: this) => mixed, + context?: mixed + ): SetCollection; - flatten(depth?: number): /*this*/SetIterable; - flatten(shallow?: boolean): /*this*/SetIterable; -} + partition( + predicate: (value: T, value: T, iter: this) => mixed, + context?: mixed + ): [this, this]; -declare class Collection extends _Iterable { - size: number; -} + map( + mapper: (value: T, value: T, iter: this) => M, + context?: mixed + ): SetCollection; -declare class KeyedCollection extends Collection mixins KeyedIterable { - toSeq(): KeyedSeq; -} + flatMap( + mapper: (value: T, value: T, iter: this) => Iterable, + context?: mixed + ): SetCollection; -declare class IndexedCollection extends Collection mixins IndexedIterable { - toSeq(): IndexedSeq; + flatten(depth?: number): SetCollection; + flatten(shallow?: boolean): SetCollection; } -declare class SetCollection extends Collection mixins SetIterable { - toSeq(): SetSeq; -} +declare function isSeq(maybeSeq: mixed): boolean %checks(maybeSeq instanceof + Seq); +declare class Seq extends _Collection { + static Keyed: typeof KeyedSeq; + static Indexed: typeof IndexedSeq; + static Set: typeof SetSeq; -declare class Seq extends _Iterable { - static (iter: KeyedSeq): KeyedSeq; - static (iter: SetSeq): SetSeq; - static (iter?: ESIterable): IndexedSeq; - static (iter: { [key: K]: V }): KeyedSeq; + static (values: KeyedSeq): KeyedSeq; + static (values: SetSeq): SetSeq; + static (values: Iterable): IndexedSeq; + static (values?: PlainObjInput): KeyedSeq; - static isSeq(maybeSeq: any): boolean; - static of(...values: T[]): IndexedSeq; + static isSeq: typeof isSeq; - size: ?number; + size: number | void; cacheResult(): this; toSeq(): this; } -declare class KeyedSeq extends Seq mixins KeyedIterable { - static (iter?: ESIterable<[K,V]>): KeyedSeq; - static (iter?: { [key: K]: V }): KeyedSeq; +declare class KeyedSeq extends Seq mixins KeyedCollection { + static ( + values?: Iterable<[K, V]> | PlainObjInput + ): KeyedSeq; + + // Override specialized return types + flip(): KeyedSeq; + + concat( + ...iters: Array | PlainObjInput> + ): KeyedSeq; + + filter(predicate: typeof Boolean): KeyedSeq>; + filter( + predicate: (value: V, key: K, iter: this) => mixed, + context?: mixed + ): KeyedSeq; + + partition( + predicate: (value: V, key: K, iter: this) => mixed, + context?: mixed + ): [this, this]; + + map( + mapper: (value: V, key: K, iter: this) => M, + context?: mixed + ): KeyedSeq; + + mapKeys( + mapper: (key: K, value: V, iter: this) => M, + context?: mixed + ): KeyedSeq; + + mapEntries( + mapper: (entry: [K, V], index: number, iter: this) => [KM, VM], + context?: mixed + ): KeyedSeq; + + flatMap( + mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>, + context?: mixed + ): KeyedSeq; + + flatten(depth?: number): KeyedSeq; + flatten(shallow?: boolean): KeyedSeq; } -declare class IndexedSeq extends Seq mixins IndexedIterable { - static (iter?: ESIterable): IndexedSeq; +declare class IndexedSeq<+T> + extends Seq + mixins IndexedCollection +{ + static (values?: Iterable): IndexedSeq; + static of(...values: T[]): IndexedSeq; + + // Override specialized return types + + concat(...iters: Array | C>): IndexedSeq; + + filter(predicate: typeof Boolean): IndexedSeq<$NonMaybeType>; + filter( + predicate: (value: T, index: number, iter: this) => mixed, + context?: mixed + ): IndexedSeq; + + partition( + predicate: (value: T, index: number, iter: this) => mixed, + context?: mixed + ): [this, this]; + + map( + mapper: (value: T, index: number, iter: this) => M, + context?: mixed + ): IndexedSeq; + + flatMap( + mapper: (value: T, index: number, iter: this) => Iterable, + context?: mixed + ): IndexedSeq; + + flatten(depth?: number): IndexedSeq; + flatten(shallow?: boolean): IndexedSeq; + + zip(a: Iterable, ..._: []): IndexedSeq<[T, A]>; + zip(a: Iterable, b: Iterable, ..._: []): IndexedSeq<[T, A, B]>; + zip( + a: Iterable, + b: Iterable, + c: Iterable, + ..._: [] + ): IndexedSeq<[T, A, B, C]>; + zip( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + ..._: [] + ): IndexedSeq<[T, A, B, C, D]>; + zip( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + e: Iterable, + ..._: [] + ): IndexedSeq<[T, A, B, C, D, E]>; + + zipAll(a: Iterable, ..._: []): IndexedSeq<[T | void, A | void]>; + zipAll( + a: Iterable, + b: Iterable, + ..._: [] + ): IndexedSeq<[T | void, A | void, B | void]>; + zipAll( + a: Iterable, + b: Iterable, + c: Iterable, + ..._: [] + ): IndexedSeq<[T | void, A | void, B | void, C | void]>; + zipAll( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + ..._: [] + ): IndexedSeq<[T | void, A | void, B | void, C | void, D | void]>; + zipAll( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + e: Iterable, + ..._: [] + ): IndexedSeq<[T | void, A | void, B | void, C | void, D | void, E | void]>; + + zipWith( + zipper: (value: T, a: A) => R, + a: Iterable, + ..._: [] + ): IndexedSeq; + zipWith( + zipper: (value: T, a: A, b: B) => R, + a: Iterable, + b: Iterable, + ..._: [] + ): IndexedSeq; + zipWith( + zipper: (value: T, a: A, b: B, c: C) => R, + a: Iterable, + b: Iterable, + c: Iterable, + ..._: [] + ): IndexedSeq; + zipWith( + zipper: (value: T, a: A, b: B, c: C, d: D) => R, + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + ..._: [] + ): IndexedSeq; + zipWith( + zipper: (value: T, a: A, b: B, c: C, d: D, e: E) => R, + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + e: Iterable, + ..._: [] + ): IndexedSeq; } -declare class SetSeq extends Seq mixins SetIterable { - static (iter?: ESIterable): IndexedSeq; +declare class SetSeq<+T> extends Seq mixins SetCollection { + static (values?: Iterable): SetSeq; + static of(...values: T[]): SetSeq; + + // Override specialized return types + + concat(...collections: Iterable[]): SetSeq; + + filter(predicate: typeof Boolean): SetSeq<$NonMaybeType>; + filter( + predicate: (value: T, value: T, iter: this) => mixed, + context?: mixed + ): SetSeq; + + partition( + predicate: (value: T, value: T, iter: this) => mixed, + context?: mixed + ): [this, this]; + + map( + mapper: (value: T, value: T, iter: this) => M, + context?: mixed + ): SetSeq; + + flatMap( + mapper: (value: T, value: T, iter: this) => Iterable, + context?: mixed + ): SetSeq; + + flatten(depth?: number): SetSeq; + flatten(shallow?: boolean): SetSeq; +} + +declare class UpdatableInCollection { + setIn(keyPath: [], value: S): S; + setIn(keyPath: [K], value: V): this; + setIn, S: $ValOf>(keyPath: [K, K2], value: S): this; + setIn, K3: $KeyOf<$ValOf>, S: $ValOf<$ValOf, K3>>( + keyPath: [K, K2, K3], + value: S + ): this; + setIn< + K2: $KeyOf, + K3: $KeyOf<$ValOf>, + K4: $KeyOf<$ValOf<$ValOf, K3>>, + S: $ValOf<$ValOf<$ValOf, K3>, K4>, + >( + keyPath: [K, K2, K3, K4], + value: S + ): this; + setIn< + K2: $KeyOf, + K3: $KeyOf<$ValOf>, + K4: $KeyOf<$ValOf<$ValOf, K3>>, + K5: $KeyOf<$ValOf<$ValOf<$ValOf, K3>, K4>>, + S: $ValOf<$ValOf<$ValOf<$ValOf, K3>, K4>, K5>, + >( + keyPath: [K, K2, K3, K4, K5], + value: S + ): this; + + deleteIn(keyPath: []): void; + deleteIn(keyPath: [K]): this; + deleteIn>(keyPath: [K, K2]): this; + deleteIn, K3: $KeyOf<$ValOf>>( + keyPath: [K, K2, K3] + ): this; + deleteIn< + K2: $KeyOf, + K3: $KeyOf<$ValOf>, + K4: $KeyOf<$ValOf<$ValOf, K3>>, + >( + keyPath: [K, K2, K3, K4] + ): this; + deleteIn< + K2: $KeyOf, + K3: $KeyOf<$ValOf>, + K4: $KeyOf<$ValOf<$ValOf, K3>>, + K5: $KeyOf<$ValOf<$ValOf<$ValOf, K3>, K4>>, + >( + keyPath: [K, K2, K3, K4, K5] + ): this; + + removeIn(keyPath: []): void; + removeIn(keyPath: [K]): this; + removeIn>(keyPath: [K, K2]): this; + removeIn, K3: $KeyOf<$ValOf>>( + keyPath: [K, K2, K3] + ): this; + removeIn< + K2: $KeyOf, + K3: $KeyOf<$ValOf>, + K4: $KeyOf<$ValOf<$ValOf, K3>>, + >( + keyPath: [K, K2, K3, K4] + ): this; + removeIn< + K2: $KeyOf, + K3: $KeyOf<$ValOf>, + K4: $KeyOf<$ValOf<$ValOf, K3>>, + K5: $KeyOf<$ValOf<$ValOf<$ValOf, K3>, K4>>, + >( + keyPath: [K, K2, K3, K4, K5] + ): this; + + updateIn(keyPath: [], notSetValue: mixed, updater: (value: this) => U): U; + updateIn(keyPath: [], updater: (value: this) => U): U; + updateIn(keyPath: [K], notSetValue: NSV, updater: (value: V) => V): this; + updateIn(keyPath: [K], updater: (value: V) => V): this; + updateIn, S: $ValOf>( + keyPath: [K, K2], + notSetValue: NSV, + updater: (value: $ValOf | NSV) => S + ): this; + updateIn, S: $ValOf>( + keyPath: [K, K2], + updater: (value: $ValOf) => S + ): this; + updateIn< + NSV, + K2: $KeyOf, + K3: $KeyOf<$ValOf>, + S: $ValOf<$ValOf, K3>, + >( + keyPath: [K, K2, K3], + notSetValue: NSV, + updater: (value: $ValOf<$ValOf, K3> | NSV) => S + ): this; + updateIn< + K2: $KeyOf, + K3: $KeyOf<$ValOf>, + S: $ValOf<$ValOf, K3>, + >( + keyPath: [K, K2, K3], + updater: (value: $ValOf<$ValOf, K3>) => S + ): this; + updateIn< + NSV, + K2: $KeyOf, + K3: $KeyOf<$ValOf>, + K4: $KeyOf<$ValOf<$ValOf, K3>>, + S: $ValOf<$ValOf<$ValOf, K3>, K4>, + >( + keyPath: [K, K2, K3, K4], + notSetValue: NSV, + updater: (value: $ValOf<$ValOf<$ValOf, K3>, K4> | NSV) => S + ): this; + updateIn< + K2: $KeyOf, + K3: $KeyOf<$ValOf>, + K4: $KeyOf<$ValOf<$ValOf, K3>>, + S: $ValOf<$ValOf<$ValOf, K3>, K4>, + >( + keyPath: [K, K2, K3, K4], + updater: (value: $ValOf<$ValOf<$ValOf, K3>, K4>) => S + ): this; + updateIn< + NSV, + K2: $KeyOf, + K3: $KeyOf<$ValOf>, + K4: $KeyOf<$ValOf<$ValOf, K3>>, + K5: $KeyOf<$ValOf<$ValOf<$ValOf, K3>, K4>>, + S: $ValOf<$ValOf<$ValOf<$ValOf, K3>, K4>, K5>, + >( + keyPath: [K, K2, K3, K4, K5], + notSetValue: NSV, + updater: ( + value: $ValOf<$ValOf<$ValOf<$ValOf, K3>, K4>, K5> | NSV + ) => S + ): this; + updateIn< + K2: $KeyOf, + K3: $KeyOf<$ValOf>, + K4: $KeyOf<$ValOf<$ValOf, K3>>, + K5: $KeyOf<$ValOf<$ValOf<$ValOf, K3>, K4>>, + S: $ValOf<$ValOf<$ValOf<$ValOf, K3>, K4>, K5>, + >( + keyPath: [K, K2, K3, K4, K5], + updater: (value: $ValOf<$ValOf<$ValOf<$ValOf, K3>, K4>, K5>) => S + ): this; } -declare class List extends IndexedCollection { - static (iterable?: ESIterable): List; +declare function isList(maybeList: mixed): boolean %checks(maybeList instanceof + List); +declare class List<+T> + extends IndexedCollection + mixins UpdatableInCollection +{ + static (collection?: Iterable): List; - static isList(maybeList: any): boolean; static of(...values: T[]): List; - set(index: number, value: U): List; + static isList: typeof isList; + + size: number; + + set(index: number, value: U): List; delete(index: number): this; remove(index: number): this; - insert(index: number, value: U): List; + insert(index: number, value: U): List; clear(): this; - push(...values: U[]): List; + push(...values: U[]): List; pop(): this; - unshift(...values: U[]): List; + unshift(...values: U[]): List; shift(): this; - update(updater: (value: this) => List): List; - update(index: number, updater: (value: T) => U): List; - update(index: number, notSetValue: U, updater: (value: T) => U): List; + update(updater: (value: this) => U): U; + update(index: number, updater: (value: T) => U): List; + update( + index: number, + notSetValue: U, + updater: (value: T) => U + ): List; - merge(...iterables: ESIterable[]): List; + merge(...collections: Iterable[]): List; - mergeWith( - merger: (previous: T, next: U, key: number) => V, - ...iterables: ESIterable[] - ): List; + setSize(size: number): this; - mergeDeep(...iterables: ESIterable[]): List; + mergeIn(keyPath: Iterable, ...collections: Iterable[]): this; + mergeDeepIn( + keyPath: Iterable, + ...collections: Iterable[] + ): this; - mergeDeepWith( - merger: (previous: T, next: U, key: number) => V, - ...iterables: ESIterable[] - ): List; + withMutations(mutator: (mutable: this) => mixed): this; + asMutable(): this; + wasAltered(): boolean; + asImmutable(): this; - setSize(size: number): List; - setIn(keyPath: ESIterable, value: any): List; - deleteIn(keyPath: ESIterable, value: any): this; - removeIn(keyPath: ESIterable, value: any): this; + // Override specialized return types - updateIn(keyPath: ESIterable, notSetValue: any, value: any): List; - updateIn(keyPath: ESIterable, value: any): List; + concat(...iters: Array | C>): List; - mergeIn(keyPath: ESIterable, ...iterables: ESIterable[]): List; - mergeDeepIn(keyPath: ESIterable, ...iterables: ESIterable[]): List; + filter(predicate: typeof Boolean): List<$NonMaybeType>; + filter( + predicate: (value: T, index: number, iter: this) => mixed, + context?: mixed + ): List; - withMutations(mutator: (mutable: this) => any): this; - asMutable(): this; - asImmutable(): this; + partition( + predicate: (value: T, index: number, iter: this) => mixed, + context?: mixed + ): [this, this]; - // Overrides that specialize return types map( mapper: (value: T, index: number, iter: this) => M, - context?: any + context?: mixed ): List; flatMap( - mapper: (value: T, index: number, iter: this) => ESIterable, - context?: any + mapper: (value: T, index: number, iter: this) => Iterable, + context?: mixed ): List; - flatten(depth?: number): /*this*/List; - flatten(shallow?: boolean): /*this*/List; + flatten(depth?: number): List; + flatten(shallow?: boolean): List; + + zip(a: Iterable, ..._: []): List<[T, A]>; + zip(a: Iterable, b: Iterable, ..._: []): List<[T, A, B]>; + zip( + a: Iterable, + b: Iterable, + c: Iterable, + ..._: [] + ): List<[T, A, B, C]>; + zip( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + ..._: [] + ): List<[T, A, B, C, D]>; + zip( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + e: Iterable, + ..._: [] + ): List<[T, A, B, C, D, E]>; + + zipAll(a: Iterable, ..._: []): List<[T | void, A | void]>; + zipAll( + a: Iterable, + b: Iterable, + ..._: [] + ): List<[T | void, A | void, B | void]>; + zipAll( + a: Iterable, + b: Iterable, + c: Iterable, + ..._: [] + ): List<[T | void, A | void, B | void, C | void]>; + zipAll( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + ..._: [] + ): List<[T | void, A | void, B | void, C | void, D | void]>; + zipAll( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + e: Iterable, + ..._: [] + ): List<[T | void, A | void, B | void, C | void, D | void, E | void]>; + + zipWith( + zipper: (value: T, a: A) => R, + a: Iterable, + ..._: [] + ): List; + zipWith( + zipper: (value: T, a: A, b: B) => R, + a: Iterable, + b: Iterable, + ..._: [] + ): List; + zipWith( + zipper: (value: T, a: A, b: B, c: C) => R, + a: Iterable, + b: Iterable, + c: Iterable, + ..._: [] + ): List; + zipWith( + zipper: (value: T, a: A, b: B, c: C, d: D) => R, + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + ..._: [] + ): List; + zipWith( + zipper: (value: T, a: A, b: B, c: C, d: D, e: E) => R, + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + e: Iterable, + ..._: [] + ): List; } -declare class Map extends KeyedCollection { - static (): Map; - static (obj?: {[key: string]: V}): Map; - static (iterable?: ESIterable<[K,V]>): Map; +declare function isMap(maybeMap: mixed): boolean %checks(maybeMap instanceof + Map); +declare class Map + extends KeyedCollection + mixins UpdatableInCollection +{ + static (values?: Iterable<[K, V]> | PlainObjInput): Map; - static isMap(maybeMap: any): boolean; + static isMap: typeof isMap; - set(key: K_, value: V_): Map; + size: number; + + set(key: K_, value: V_): Map; delete(key: K): this; remove(key: K): this; clear(): this; - update(updater: (value: this) => Map): Map; - update(key: K, updater: (value: V) => V_): Map; - update(key: K, notSetValue: V_, updater: (value: V) => V_): Map; + deleteAll(keys: Iterable): Map; + removeAll(keys: Iterable): Map; + + update(updater: (value: this) => U): U; + update(key: K, updater: (value: V) => V_): Map; + update( + key: K, + notSetValue: V_, + updater: (value: V) => V_ + ): Map; + + merge( + ...collections: (Iterable<[K_, V_]> | PlainObjInput)[] + ): Map; + concat( + ...collections: (Iterable<[K_, V_]> | PlainObjInput)[] + ): Map; + + mergeWith( + merger: (oldVal: V, newVal: W, key: K) => X, + ...collections: (Iterable<[K_, W]> | PlainObjInput)[] + ): Map; + + mergeDeep( + ...collections: (Iterable<[K_, V_]> | PlainObjInput)[] + ): Map; + + mergeDeepWith( + merger: (oldVal: any, newVal: any, key: any) => mixed, + ...collections: (Iterable<[K_, V_]> | PlainObjInput)[] + ): Map; + + mergeIn( + keyPath: Iterable, + ...collections: (Iterable | PlainObjInput)[] + ): this; + mergeDeepIn( + keyPath: Iterable, + ...collections: (Iterable | PlainObjInput)[] + ): this; - merge( - ...iterables: (ESIterable<[K_,V_]> | { [key: K_]: V_ })[] - ): Map; + withMutations(mutator: (mutable: this) => mixed): this; + asMutable(): this; + wasAltered(): boolean; + asImmutable(): this; - mergeWith( - merger: (previous: V, next: W, key: number) => X, - ...iterables: ESIterable[] - ): Map; + // Override specialized return types - mergeDeep( - ...iterables: (ESIterable<[K_,V_]> | { [key: K_]: V_ })[] - ): Map; + flip(): Map; - mergeDeepWith( - merger: (previous: V, next: W, key: number) => X, - ...iterables: ESIterable[] - ): Map; + filter(predicate: typeof Boolean): Map>; + filter( + predicate: (value: V, key: K, iter: this) => mixed, + context?: mixed + ): Map; - setIn(keyPath: ESIterable, value: any): Map; - deleteIn(keyPath: ESIterable, value: any): this; - removeIn(keyPath: ESIterable, value: any): this; + partition( + predicate: (value: V, key: K, iter: this) => mixed, + context?: mixed + ): [this, this]; - updateIn(keyPath: ESIterable, notSetValue: any, value: any): Map; - updateIn(keyPath: ESIterable, value: any): Map; + map( + mapper: (value: V, key: K, iter: this) => M, + context?: mixed + ): Map; + + mapKeys( + mapper: (key: K, value: V, iter: this) => M, + context?: mixed + ): Map; + + mapEntries( + mapper: (entry: [K, V], index: number, iter: this) => [KM, VM], + context?: mixed + ): Map; + + flatMap( + mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>, + context?: mixed + ): Map; + + flatten(depth?: number): Map; + flatten(shallow?: boolean): Map; +} - mergeIn(keyPath: ESIterable, ...iterables: ESIterable[]): Map; - mergeDeepIn(keyPath: ESIterable, ...iterables: ESIterable[]): Map; +declare function isOrderedMap( + maybeOrderedMap: mixed +): boolean %checks(maybeOrderedMap instanceof OrderedMap); +declare class OrderedMap + extends Map + mixins UpdatableInCollection +{ + static ( + values?: Iterable<[K, V]> | PlainObjInput + ): OrderedMap; - withMutations(mutator: (mutable: this) => any): this; - asMutable(): this; - asImmutable(): this; + static isOrderedMap: typeof isOrderedMap; - // Overrides that specialize return types + size: number; - map( - mapper: (value: V, key: K, iter: this) => V_, - context?: any - ): Map; + set(key: K_, value: V_): OrderedMap; + delete(key: K): this; + remove(key: K): this; + clear(): this; - flatMap( - mapper: (value: V, key: K, iter: this) => ESIterable<[K_,V_]>, - context?: any - ): Map; + update(updater: (value: this) => U): U; + update(key: K, updater: (value: V) => V_): OrderedMap; + update( + key: K, + notSetValue: V_, + updater: (value: V) => V_ + ): OrderedMap; + + merge( + ...collections: (Iterable<[K_, V_]> | PlainObjInput)[] + ): OrderedMap; + concat( + ...collections: (Iterable<[K_, V_]> | PlainObjInput)[] + ): OrderedMap; + + mergeWith( + merger: (oldVal: V, newVal: W, key: K) => X, + ...collections: (Iterable<[K_, W]> | PlainObjInput)[] + ): OrderedMap; + + mergeDeep( + ...collections: (Iterable<[K_, V_]> | PlainObjInput)[] + ): OrderedMap; + + mergeDeepWith( + merger: (oldVal: any, newVal: any, key: any) => mixed, + ...collections: (Iterable<[K_, V_]> | PlainObjInput)[] + ): OrderedMap; + + mergeIn( + keyPath: Iterable, + ...collections: (Iterable | PlainObjInput)[] + ): this; + mergeDeepIn( + keyPath: Iterable, + ...collections: (Iterable | PlainObjInput)[] + ): this; - flip(): Map; + withMutations(mutator: (mutable: this) => mixed): this; + asMutable(): this; + wasAltered(): boolean; + asImmutable(): this; - mapKeys( - mapper: (key: K, value: V, iter: this) => K_, - context?: any - ): Map; + // Override specialized return types - flatten(depth?: number): /*this*/Map; - flatten(shallow?: boolean): /*this*/Map; -} + flip(): OrderedMap; -// OrderedMaps have nothing that Maps do not have. We do not need to override constructor & other statics -declare class OrderedMap extends Map { - static isOrderedMap(maybeOrderedMap: any): bool; + filter(predicate: typeof Boolean): OrderedMap>; + filter( + predicate: (value: V, key: K, iter: this) => mixed, + context?: mixed + ): OrderedMap; + + partition( + predicate: (value: V, key: K, iter: this) => mixed, + context?: mixed + ): [this, this]; + + map( + mapper: (value: V, key: K, iter: this) => M, + context?: mixed + ): OrderedMap; + + mapKeys( + mapper: (key: K, value: V, iter: this) => M, + context?: mixed + ): OrderedMap; + + mapEntries( + mapper: (entry: [K, V], index: number, iter: this) => [KM, VM], + context?: mixed + ): OrderedMap; + + flatMap( + mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>, + context?: mixed + ): OrderedMap; + + flatten(depth?: number): OrderedMap; + flatten(shallow?: boolean): OrderedMap; } -declare class Set extends SetCollection { - static (iterable?: ESIterable): Set; +declare function isSet(maybeSet: mixed): boolean %checks(maybeSet instanceof + Set); +declare class Set<+T> extends SetCollection { + static (values?: Iterable): Set; - static isSet(maybeSet: any): boolean; static of(...values: T[]): Set; - static fromKeys(iter: ESIterable<[T,any]>): Set; - static fromKeys(iter: { [key: string]: any }): Set; + static fromKeys( + values: Iterable<[T, mixed]> | PlainObjInput + ): Set; + + static intersect(sets: Iterable>): Set; + static union(sets: Iterable>): Set; + + static isSet: typeof isSet; - add(value: U): Set; + size: number; + + add(value: U): Set; delete(value: T): this; remove(value: T): this; clear(): this; - union(...iterables: ESIterable[]): Set; - merge(...iterables: ESIterable[]): Set; - intersect(...iterables: ESIterable[]): Set; - subtract(...iterables: ESIterable[]): Set; + union(...collections: Iterable[]): Set; + merge(...collections: Iterable[]): Set; + concat(...collections: Iterable[]): Set; + intersect(...collections: Iterable[]): Set; + subtract(...collections: Iterable[]): this; - withMutations(mutator: (mutable: this) => any): this; + withMutations(mutator: (mutable: this) => mixed): this; asMutable(): this; + wasAltered(): boolean; asImmutable(): this; - // Overrides that specialize return types + // Override specialized return types + + filter(predicate: typeof Boolean): Set<$NonMaybeType>; + filter( + predicate: (value: T, value: T, iter: this) => mixed, + context?: mixed + ): Set; + + partition( + predicate: (value: T, value: T, iter: this) => mixed, + context?: mixed + ): [this, this]; map( mapper: (value: T, value: T, iter: this) => M, - context?: any + context?: mixed ): Set; flatMap( - mapper: (value: T, value: T, iter: this) => ESIterable, - context?: any + mapper: (value: T, value: T, iter: this) => Iterable, + context?: mixed ): Set; - flatten(depth?: number): /*this*/Set; - flatten(shallow?: boolean): /*this*/Set; + flatten(depth?: number): Set; + flatten(shallow?: boolean): Set; } -// OrderedSets have nothing that Sets do not have. We do not need to override constructor & other statics -declare class OrderedSet extends Set { - static isOrderedSet(maybeOrderedSet: any): bool; +// Overrides except for `isOrderedSet` are for specialized return types +declare function isOrderedSet( + maybeOrderedSet: mixed +): boolean %checks(maybeOrderedSet instanceof OrderedSet); +declare class OrderedSet<+T> extends Set { + static (values?: Iterable): OrderedSet; + + static of(...values: T[]): OrderedSet; + static fromKeys( + values: Iterable<[T, mixed]> | PlainObjInput + ): OrderedSet; + + static isOrderedSet: typeof isOrderedSet; + + size: number; + + add(value: U): OrderedSet; + union(...collections: Iterable[]): OrderedSet; + merge(...collections: Iterable[]): OrderedSet; + concat(...collections: Iterable[]): OrderedSet; + intersect(...collections: Iterable[]): OrderedSet; + + filter(predicate: typeof Boolean): OrderedSet<$NonMaybeType>; + filter( + predicate: (value: T, value: T, iter: this) => mixed, + context?: mixed + ): OrderedSet; + + partition( + predicate: (value: T, value: T, iter: this) => mixed, + context?: mixed + ): [this, this]; + + map( + mapper: (value: T, value: T, iter: this) => M, + context?: mixed + ): OrderedSet; + + flatMap( + mapper: (value: T, value: T, iter: this) => Iterable, + context?: mixed + ): OrderedSet; + + flatten(depth?: number): OrderedSet; + flatten(shallow?: boolean): OrderedSet; + + zip(a: Iterable, ..._: []): OrderedSet<[T, A]>; + zip(a: Iterable, b: Iterable, ..._: []): OrderedSet<[T, A, B]>; + zip( + a: Iterable, + b: Iterable, + c: Iterable, + ..._: [] + ): OrderedSet<[T, A, B, C]>; + zip( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + ..._: [] + ): OrderedSet<[T, A, B, C, D]>; + zip( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + e: Iterable, + ..._: [] + ): OrderedSet<[T, A, B, C, D, E]>; + + zipAll(a: Iterable, ..._: []): OrderedSet<[T | void, A | void]>; + zipAll( + a: Iterable, + b: Iterable, + ..._: [] + ): OrderedSet<[T | void, A | void, B | void]>; + zipAll( + a: Iterable, + b: Iterable, + c: Iterable, + ..._: [] + ): OrderedSet<[T | void, A | void, B | void, C | void]>; + zipAll( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + ..._: [] + ): OrderedSet<[T | void, A | void, B | void, C | void, D | void]>; + zipAll( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + e: Iterable, + ..._: [] + ): OrderedSet<[T | void, A | void, B | void, C | void, D | void, E | void]>; + + zipWith( + zipper: (value: T, a: A) => R, + a: Iterable, + ..._: [] + ): OrderedSet; + zipWith( + zipper: (value: T, a: A, b: B) => R, + a: Iterable, + b: Iterable, + ..._: [] + ): OrderedSet; + zipWith( + zipper: (value: T, a: A, b: B, c: C) => R, + a: Iterable, + b: Iterable, + c: Iterable, + ..._: [] + ): OrderedSet; + zipWith( + zipper: (value: T, a: A, b: B, c: C, d: D) => R, + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + ..._: [] + ): OrderedSet; + zipWith( + zipper: (value: T, a: A, b: B, c: C, d: D, e: E) => R, + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + e: Iterable, + ..._: [] + ): OrderedSet; } -declare class Stack extends IndexedCollection { - static (iterable?: ESIterable): Stack; +declare function isStack( + maybeStack: mixed +): boolean %checks(maybeStack instanceof Stack); +declare class Stack<+T> extends IndexedCollection { + static (collection?: Iterable): Stack; - static isStack(maybeStack: any): boolean; + static isStack(maybeStack: mixed): boolean; static of(...values: T[]): Stack; + static isStack: typeof isStack; + + size: number; + peek(): T; clear(): this; - unshift(...values: U[]): Stack; - unshiftAll(iter: ESIterable): Stack; + unshift(...values: U[]): Stack; + unshiftAll(iter: Iterable): Stack; shift(): this; - push(...values: U[]): Stack; - pushAll(iter: ESIterable): Stack; + push(...values: U[]): Stack; + pushAll(iter: Iterable): Stack; pop(): this; - withMutations(mutator: (mutable: this) => any): this; + withMutations(mutator: (mutable: this) => mixed): this; asMutable(): this; + wasAltered(): boolean; asImmutable(): this; - // Overrides that specialize return types + // Override specialized return types + + concat(...iters: Array | C>): Stack; - map( - mapper: (value: T, index: number, iter: this) => U, - context?: any - ): Stack; + filter(predicate: typeof Boolean): Stack<$NonMaybeType>; + filter( + predicate: (value: T, index: number, iter: this) => mixed, + context?: mixed + ): Stack; - flatMap( - mapper: (value: T, index: number, iter: this) => ESIterable, - context?: any - ): Stack; + map( + mapper: (value: T, index: number, iter: this) => M, + context?: mixed + ): Stack; - flatten(depth?: number): /*this*/Stack; - flatten(shallow?: boolean): /*this*/Stack; + flatMap( + mapper: (value: T, index: number, iter: this) => Iterable, + context?: mixed + ): Stack; + + flatten(depth?: number): Stack; + flatten(shallow?: boolean): Stack; + + zip(a: Iterable, ..._: []): Stack<[T, A]>; + zip(a: Iterable, b: Iterable, ..._: []): Stack<[T, A, B]>; + zip( + a: Iterable, + b: Iterable, + c: Iterable, + ..._: [] + ): Stack<[T, A, B, C]>; + zip( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + ..._: [] + ): Stack<[T, A, B, C, D]>; + zip( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + e: Iterable, + ..._: [] + ): Stack<[T, A, B, C, D, E]>; + + zipAll(a: Iterable, ..._: []): Stack<[T | void, A | void]>; + zipAll( + a: Iterable, + b: Iterable, + ..._: [] + ): Stack<[T | void, A | void, B | void]>; + zipAll( + a: Iterable, + b: Iterable, + c: Iterable, + ..._: [] + ): Stack<[T | void, A | void, B | void, C | void]>; + zipAll( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + ..._: [] + ): Stack<[T | void, A | void, B | void, C | void, D | void]>; + zipAll( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + e: Iterable, + ..._: [] + ): Stack<[T | void, A | void, B | void, C | void, D | void, E | void]>; + + zipWith( + zipper: (value: T, a: A) => R, + a: Iterable, + ..._: [] + ): Stack; + zipWith( + zipper: (value: T, a: A, b: B) => R, + a: Iterable, + b: Iterable, + ..._: [] + ): Stack; + zipWith( + zipper: (value: T, a: A, b: B, c: C) => R, + a: Iterable, + b: Iterable, + c: Iterable, + ..._: [] + ): Stack; + zipWith( + zipper: (value: T, a: A, b: B, c: C, d: D) => R, + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + ..._: [] + ): Stack; + zipWith( + zipper: (value: T, a: A, b: B, c: C, d: D, e: E) => R, + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + e: Iterable, + ..._: [] + ): Stack; } -declare function Range(start?: number, end?: number, step?: number): IndexedSeq; +declare function Range( + start?: number, + end?: number, + step?: number +): IndexedSeq; declare function Repeat(value: T, times?: number): IndexedSeq; -//TODO: Once flow can extend normal Objects we can change this back to actually reflect Record behavior. -// For now fallback to any to not break existing Code -declare class Record { - static (spec: T, name?: string): /*T & Record*/any; - get(key: $Keys): A; - set(key: $Keys, value: A): /*T & Record*/this; - remove(key: $Keys): /*T & Record*/this; +// The type of a Record factory function. +type RecordFactory = Class>; + +// The type of runtime Record instances. +type RecordOf = RecordInstance & $ReadOnly; + +// The values of a Record instance. +type _RecordValues | T> = R; +type RecordValues = _RecordValues<*, R>; + +declare function isRecord( + maybeRecord: any +): boolean %checks(maybeRecord instanceof RecordInstance); +declare class Record { + static (spec: Values, name?: string): typeof RecordInstance; + constructor( + spec: Values, + name?: string + ): typeof RecordInstance; + + static isRecord: typeof isRecord; + + static getDescriptiveName(record: RecordInstance): string; } -declare function fromJS(json: any, reviver?: (k: any, v: Iterable) => any): any; -declare function is(first: any, second: any): boolean; +declare class RecordInstance { + static (values?: Iterable<[$Keys, $ValOf]> | $Shape): RecordOf; + // Note: a constructor can only create an instance of RecordInstance, + // it's encouraged to not use `new` when creating Records. + constructor(values?: Iterable<[$Keys, $ValOf]> | $Shape): void; + + size: number; + + has(key: string): boolean; + + get>(key: K, ..._: []): $ElementType; + get, NSV>(key: K, notSetValue: NSV): $ElementType | NSV; + + hasIn(keyPath: Iterable): boolean; + + getIn(keyPath: [], notSetValue?: mixed): this & $ReadOnly; + getIn>(keyPath: [K], notSetValue?: mixed): $ElementType; + getIn, K2: $KeyOf<$ValOf>>( + keyPath: [K, K2], + notSetValue: NSV + ): $ValOf<$ValOf, K2> | NSV; + getIn< + NSV, + K: $Keys, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + >( + keyPath: [K, K2, K3], + notSetValue: NSV + ): $ValOf<$ValOf<$ValOf, K2>, K3> | NSV; + getIn< + NSV, + K: $Keys, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + >( + keyPath: [K, K2, K3, K4], + notSetValue: NSV + ): $ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4> | NSV; + getIn< + NSV, + K: $Keys, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>>, + >( + keyPath: [K, K2, K3, K4, K5], + notSetValue: NSV + ): $ValOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, K5> | NSV; + + equals(other: any): boolean; + hashCode(): number; + + set>(key: K, value: $ElementType): this & $ReadOnly; + update>( + key: K, + updater: (value: $ElementType) => $ElementType + ): this & $ReadOnly; + merge( + ...collections: Array, $ValOf]> | $Shape> + ): this & $ReadOnly; + mergeDeep( + ...collections: Array, $ValOf]> | $Shape> + ): this & $ReadOnly; + + mergeWith( + merger: (oldVal: $ValOf, newVal: $ValOf, key: $Keys) => $ValOf, + ...collections: Array, $ValOf]> | $Shape> + ): this & $ReadOnly; + mergeDeepWith( + merger: (oldVal: any, newVal: any, key: any) => any, + ...collections: Array, $ValOf]> | $Shape> + ): this & $ReadOnly; + + delete>(key: K): this & $ReadOnly; + remove>(key: K): this & $ReadOnly; + clear(): this & $ReadOnly; + + setIn(keyPath: [], value: S): S; + setIn, S: $ValOf>( + keyPath: [K], + value: S + ): this & $ReadOnly; + setIn, K2: $KeyOf<$ValOf>, S: $ValOf<$ValOf, K2>>( + keyPath: [K, K2], + value: S + ): this & $ReadOnly; + setIn< + K: $Keys, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + S: $ValOf<$ValOf<$ValOf, K2>, K3>, + >( + keyPath: [K, K2, K3], + value: S + ): this & $ReadOnly; + setIn< + K: $Keys, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + S: $ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, + >( + keyPath: [K, K2, K3, K4], + value: S + ): this & $ReadOnly; + setIn< + K: $Keys, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>>, + S: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, K5>, + >( + keyPath: [K, K2, K3, K4, K5], + value: S + ): this & $ReadOnly; + + deleteIn(keyPath: []): void; + deleteIn>(keyPath: [K]): this & $ReadOnly; + deleteIn, K2: $KeyOf<$ValOf>>( + keyPath: [K, K2] + ): this & $ReadOnly; + deleteIn< + K: $Keys, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + >( + keyPath: [K, K2, K3] + ): this & $ReadOnly; + deleteIn< + K: $Keys, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + >( + keyPath: [K, K2, K3, K4] + ): this & $ReadOnly; + deleteIn< + K: $Keys, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>>, + >( + keyPath: [K, K2, K3, K4, K5] + ): this & $ReadOnly; + + removeIn(keyPath: []): void; + removeIn>(keyPath: [K]): this & $ReadOnly; + removeIn, K2: $KeyOf<$ValOf>>( + keyPath: [K, K2] + ): this & $ReadOnly; + removeIn< + K: $Keys, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + >( + keyPath: [K, K2, K3] + ): this & $ReadOnly; + removeIn< + K: $Keys, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + >( + keyPath: [K, K2, K3, K4] + ): this & $ReadOnly; + removeIn< + K: $Keys, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>>, + >( + keyPath: [K, K2, K3, K4, K5] + ): this & $ReadOnly; + + updateIn( + keyPath: [], + notSetValue: mixed, + updater: (value: this & T) => U + ): U; + updateIn(keyPath: [], updater: (value: this & T) => U): U; + updateIn, S: $ValOf>( + keyPath: [K], + notSetValue: NSV, + updater: (value: $ValOf) => S + ): this & $ReadOnly; + updateIn, S: $ValOf>( + keyPath: [K], + updater: (value: $ValOf) => S + ): this & $ReadOnly; + updateIn< + NSV, + K: $Keys, + K2: $KeyOf<$ValOf>, + S: $ValOf<$ValOf, K2>, + >( + keyPath: [K, K2], + notSetValue: NSV, + updater: (value: $ValOf<$ValOf, K2> | NSV) => S + ): this & $ReadOnly; + updateIn, K2: $KeyOf<$ValOf>, S: $ValOf<$ValOf, K2>>( + keyPath: [K, K2], + updater: (value: $ValOf<$ValOf, K2>) => S + ): this & $ReadOnly; + updateIn< + NSV, + K: $Keys, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + S: $ValOf<$ValOf<$ValOf, K2>, K3>, + >( + keyPath: [K, K2, K3], + notSetValue: NSV, + updater: (value: $ValOf<$ValOf<$ValOf, K2>, K3> | NSV) => S + ): this & $ReadOnly; + updateIn< + K: $Keys, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + S: $ValOf<$ValOf<$ValOf, K2>, K3>, + >( + keyPath: [K, K2, K3], + updater: (value: $ValOf<$ValOf<$ValOf, K2>, K3>) => S + ): this & $ReadOnly; + updateIn< + NSV, + K: $Keys, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + S: $ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, + >( + keyPath: [K, K2, K3, K4], + notSetValue: NSV, + updater: ( + value: $ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4> | NSV + ) => S + ): this & $ReadOnly; + updateIn< + K: $Keys, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + S: $ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, + >( + keyPath: [K, K2, K3, K4], + updater: (value: $ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>) => S + ): this & $ReadOnly; + updateIn< + NSV, + K: $Keys, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>>, + S: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, K5>, + >( + keyPath: [K, K2, K3, K4, K5], + notSetValue: NSV, + updater: ( + value: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, K5> | NSV + ) => S + ): this & $ReadOnly; + updateIn< + K: $Keys, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>>, + S: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, K5>, + >( + keyPath: [K, K2, K3, K4, K5], + updater: ( + value: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, K5> + ) => S + ): this & $ReadOnly; + + mergeIn( + keyPath: Iterable, + ...collections: Array + ): this & $ReadOnly; + mergeDeepIn( + keyPath: Iterable, + ...collections: Array + ): this & $ReadOnly; + + toSeq(): KeyedSeq<$Keys, any>; + + toJS(): { [key: $Keys]: mixed }; + toJSON(): T; + toObject(): T; + + withMutations(mutator: (mutable: this & T) => mixed): this & $ReadOnly; + asMutable(): this & $ReadOnly; + wasAltered(): boolean; + asImmutable(): this & $ReadOnly; + + @@iterator(): Iterator<[$Keys, $ValOf]>; +} + +declare function fromJS( + jsValue: mixed, + reviver?: ( + key: string | number, + sequence: KeyedCollection | IndexedCollection, + path?: Array + ) => mixed +): Collection; + +declare function is(first: mixed, second: mixed): boolean; +declare function hash(value: mixed): number; + +declare function get>( + collection: C, + key: K, + notSetValue: mixed +): $ValOf; +declare function get, NSV>( + collection: C, + key: K, + notSetValue: NSV +): $ValOf | NSV; + +declare function has(collection: Object, key: mixed): boolean; +declare function remove(collection: C, key: $KeyOf): C; +declare function set, V: $ValOf>( + collection: C, + key: K, + value: V +): C; +declare function update, V: $ValOf, NSV>( + collection: C, + key: K, + notSetValue: NSV, + updater: ($ValOf | NSV) => V +): C; +declare function update, V: $ValOf>( + collection: C, + key: K, + updater: ($ValOf) => V +): C; + +declare function getIn(collection: C, keyPath: [], notSetValue?: mixed): C; +declare function getIn, NSV>( + collection: C, + keyPath: [K], + notSetValue: NSV +): $ValOf | NSV; +declare function getIn, K2: $KeyOf<$ValOf>, NSV>( + collection: C, + keyPath: [K, K2], + notSetValue: NSV +): $ValOf<$ValOf, K2> | NSV; +declare function getIn< + C, + K: $KeyOf, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + NSV, +>( + collection: C, + keyPath: [K, K2, K3], + notSetValue: NSV +): $ValOf<$ValOf<$ValOf, K2>, K3> | NSV; +declare function getIn< + C, + K: $KeyOf, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + NSV, +>( + collection: C, + keyPath: [K, K2, K3, K4], + notSetValue: NSV +): $ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4> | NSV; +declare function getIn< + C, + K: $KeyOf, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>>, + NSV, +>( + collection: C, + keyPath: [K, K2, K3, K4, K5], + notSetValue: NSV +): $ValOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, K5> | NSV; + +declare function hasIn(collection: Object, keyPath: Iterable): boolean; + +declare function removeIn(collection: C, keyPath: []): void; +declare function removeIn>(collection: C, keyPath: [K]): C; +declare function removeIn, K2: $KeyOf<$ValOf>>( + collection: C, + keyPath: [K, K2] +): C; +declare function removeIn< + C, + K: $KeyOf, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, +>( + collection: C, + keyPath: [K, K2, K3] +): C; +declare function removeIn< + C, + K: $KeyOf, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, +>( + collection: C, + keyPath: [K, K2, K3, K4] +): C; +declare function removeIn< + C, + K: $KeyOf, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>>, +>( + collection: C, + keyPath: [K, K2, K3, K4, K5] +): C; + +declare function setIn(collection: Object, keyPath: [], value: S): S; +declare function setIn, S: $ValOf>( + collection: C, + keyPath: [K], + value: S +): C; +declare function setIn< + C, + K: $KeyOf, + K2: $KeyOf<$ValOf>, + S: $ValOf<$ValOf, K2>, +>( + collection: C, + keyPath: [K, K2], + value: S +): C; +declare function setIn< + C, + K: $KeyOf, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + S: $ValOf<$ValOf<$ValOf, K2>, K3>, +>( + collection: C, + keyPath: [K, K2, K3], + value: S +): C; +declare function setIn< + C, + K: $KeyOf, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + S: $ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, +>( + collection: C, + keyPath: [K, K2, K3, K4], + value: S +): C; +declare function setIn< + C, + K: $KeyOf, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>>, + S: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, K5>, +>( + collection: C, + keyPath: [K, K2, K3, K4, K5], + value: S +): C; + +declare function updateIn( + collection: C, + keyPath: [], + notSetValue: mixed, + updater: (value: C) => S +): S; +declare function updateIn( + collection: C, + keyPath: [], + updater: (value: C) => S +): S; +declare function updateIn, S: $ValOf, NSV>( + collection: C, + keyPath: [K], + notSetValue: NSV, + updater: (value: $ValOf | NSV) => S +): C; +declare function updateIn, S: $ValOf>( + collection: C, + keyPath: [K], + updater: (value: $ValOf) => S +): C; +declare function updateIn< + C, + K: $KeyOf, + K2: $KeyOf<$ValOf>, + S: $ValOf<$ValOf, K2>, + NSV, +>( + collection: C, + keyPath: [K, K2], + notSetValue: NSV, + updater: (value: $ValOf<$ValOf, K2> | NSV) => S +): C; +declare function updateIn< + C, + K: $KeyOf, + K2: $KeyOf<$ValOf>, + S: $ValOf<$ValOf, K2>, +>( + collection: C, + keyPath: [K, K2], + updater: (value: $ValOf<$ValOf, K2>) => S +): C; +declare function updateIn< + C, + K: $KeyOf, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + S: $ValOf<$ValOf<$ValOf, K2>, K3>, + NSV, +>( + collection: C, + keyPath: [K, K2, K3], + notSetValue: NSV, + updater: (value: $ValOf<$ValOf<$ValOf, K2>, K3> | NSV) => S +): C; +declare function updateIn< + C, + K: $KeyOf, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + S: $ValOf<$ValOf<$ValOf, K2>, K3>, +>( + collection: C, + keyPath: [K, K2, K3], + updater: (value: $ValOf<$ValOf<$ValOf, K2>, K3>) => S +): C; +declare function updateIn< + C, + K: $KeyOf, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + S: $ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, + NSV, +>( + collection: C, + keyPath: [K, K2, K3, K4], + notSetValue: NSV, + updater: (value: $ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4> | NSV) => S +): C; +declare function updateIn< + C, + K: $KeyOf, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + S: $ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, +>( + collection: C, + keyPath: [K, K2, K3, K4], + updater: (value: $ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>) => S +): C; +declare function updateIn< + C, + K: $KeyOf, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>>, + S: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, K5>, + NSV, +>( + collection: C, + keyPath: [K, K2, K3, K4, K5], + notSetValue: NSV, + updater: ( + value: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, K5> | NSV + ) => S +): C; +declare function updateIn< + C, + K: $KeyOf, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>>, + S: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, K5>, +>( + collection: C, + keyPath: [K, K2, K3, K4, K5], + updater: ( + value: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, K5> + ) => S +): C; + +declare function merge( + collection: C, + ...collections: Array< + | $IterableOf + | $Shape> + | PlainObjInput<$KeyOf, $ValOf>, + > +): C; +declare function mergeWith( + merger: (oldVal: $ValOf, newVal: $ValOf, key: $KeyOf) => $ValOf, + collection: C, + ...collections: Array< + | $IterableOf + | $Shape> + | PlainObjInput<$KeyOf, $ValOf>, + > +): C; +declare function mergeDeep( + collection: C, + ...collections: Array< + | $IterableOf + | $Shape> + | PlainObjInput<$KeyOf, $ValOf>, + > +): C; +declare function mergeDeepWith( + merger: (oldVal: any, newVal: any, key: any) => mixed, + collection: C, + ...collections: Array< + | $IterableOf + | $Shape> + | PlainObjInput<$KeyOf, $ValOf>, + > +): C; export { - Iterable, Collection, Seq, - - // These classes do not actually exist under these names. But it is useful to - // have the types available. - KeyedIterable, - IndexedIterable, - SetIterable, - KeyedCollection, - IndexedCollection, - SetCollection, - KeyedSeq, - IndexedSeq, - SetSeq, + List, + Map, + OrderedMap, + OrderedSet, + Range, + Repeat, + Record, + Set, + Stack, + fromJS, + is, + hash, + isImmutable, + isCollection, + isKeyed, + isIndexed, + isAssociative, + isOrdered, + isRecord, + isValueObject, + get, + has, + remove, + set, + update, + getIn, + hasIn, + removeIn, + setIn, + updateIn, + merge, + mergeWith, + mergeDeep, + mergeDeepWith, +}; + +export default { + Collection, + Seq, List, Map, OrderedMap, OrderedSet, + PairSorting, Range, Repeat, Record, @@ -660,4 +2370,45 @@ export { fromJS, is, -} + hash, + + isImmutable, + isCollection, + isKeyed, + isIndexed, + isAssociative, + isOrdered, + isRecord, + isValueObject, + + get, + has, + remove, + set, + update, + getIn, + hasIn, + removeIn, + setIn, + updateIn, + merge, + mergeWith, + mergeDeep, + mergeDeepWith, +}; + +export type { + Comparator, + KeyedCollection, + IndexedCollection, + SetCollection, + KeyedSeq, + IndexedSeq, + SetSeq, + RecordFactory, + RecordOf, + RecordInstance, + ValueObject, + $KeyOf, + $ValOf, +}; diff --git a/type-definitions/ts-tests/covariance.ts b/type-definitions/ts-tests/covariance.ts new file mode 100644 index 0000000000..b4c01e50e9 --- /dev/null +++ b/type-definitions/ts-tests/covariance.ts @@ -0,0 +1,87 @@ +import { expect, test } from 'tstyche'; +import { + List, + Map, + MapOf, + OrderedMap, + OrderedSet, + Set, + Stack, +} from 'immutable'; + +class A { + x: number; + + constructor() { + this.x = 1; + } +} + +class B extends A { + y: string; + + constructor() { + super(); + this.y = 'B'; + } +} + +class C { + z: string; + + constructor() { + this.z = 'C'; + } +} + +test('List covariance', () => { + expect>().type.toBeAssignableWith(List()); + + expect(List([new B()])).type.toBe>(); + + expect>().type.not.toBeAssignableWith(List()); +}); + +test('Map covariance', () => { + expect>().type.toBeAssignableWith>(); + + expect(Map({ b: new B() })).type.toBe>(); + + expect>().type.not.toBeAssignableWith>(); +}); + +test('Set covariance', () => { + expect>().type.toBeAssignableWith>(); + + expect(Set([new B()])).type.toBe>(); + + expect>().type.not.toBeAssignableWith>(); +}); + +test('Stack covariance', () => { + expect>().type.toBeAssignableWith>(); + + expect(Stack([new B()])).type.toBe>(); + + expect>().type.not.toBeAssignableWith>(); +}); + +test('OrderedMap covariance', () => { + expect>().type.toBeAssignableWith< + OrderedMap + >(); + + expect(OrderedMap({ b: new B() })).type.toBe>(); + + expect>().type.not.toBeAssignableWith< + OrderedMap + >(); +}); + +test('OrderedSet covariance', () => { + expect>().type.toBeAssignableWith>(); + + expect(OrderedSet([new B()])).type.toBe>(); + + expect>().type.not.toBeAssignableWith>(); +}); diff --git a/type-definitions/ts-tests/deepCopy.ts b/type-definitions/ts-tests/deepCopy.ts new file mode 100644 index 0000000000..25e262fd81 --- /dev/null +++ b/type-definitions/ts-tests/deepCopy.ts @@ -0,0 +1,112 @@ +import { describe, expect, test } from 'tstyche'; +import { List, Map, Record, Set, Seq, DeepCopy, Collection } from 'immutable'; + +describe('DeepCopy', () => { + test('basic types', () => { + expect< + DeepCopy<{ + a: number; + b: number; + }> + >().type.toBe<{ + a: number; + b: number; + }>(); + }); + + test('iterables', () => { + expect>().type.toBe(); + + expect>>().type.toBe(); + }); + + test('immutable first-level types', () => { + expect>>().type.toBe<{ + [x: string]: string; + }>(); + + // should be `{ [x: string]: object }`, but there is an issue with circular references + expect>>().type.toBe<{ + [x: string]: unknown; + }>(); + + // should be `{ [x: string]: object; [x: number]: object }`, but there is an issue with circular references + expect>>().type.toBe<{ + [x: string]: unknown; + [x: number]: unknown; + }>(); + + expect>>().type.toBe(); + + expect>>().type.toBe(); + }); + + test('keyed', () => { + expect>>().type.toBe<{ + [x: string]: number; + }>(); + + expect>>().type.toBe<{ + [x: string]: number; + [x: number]: number; + }>(); + + expect>>().type.toBe<{ + [x: string]: number; + [x: number]: number; + }>(); + + expect>>().type.toBe<{ + [x: string]: number; + [x: number]: number; + }>(); + }); + + test('nested', () => { + // should be `{ map: { [x: string]: string }; list: string[]; set: string[] }`, but there is an issue with circular references + expect< + DeepCopy<{ + map: Map; + list: List; + set: Set; + }> + >().type.toBe<{ map: unknown; list: unknown; set: unknown }>(); + + // should be `{ map: { [x: string]: string } }`, but there is an issue with circular references + expect>>>().type.toBe<{ + map: unknown; + }>(); + }); + + test('circular references', () => { + type Article = Record<{ title: string; tag: Tag }>; + type Tag = Record<{ name: string; article: Article }>; + + // should handle circular references here somehow + expect>().type.toBe<{ title: string; tag: unknown }>(); + }); + + test('circular references #1957', () => { + class Foo1 extends Record<{ foo: undefined | Foo1 }>({ + foo: undefined, + }) {} + + class Foo2 extends Record<{ foo?: Foo2 }>({ + foo: undefined, + }) {} + + class Foo3 extends Record<{ foo: null | Foo3 }>({ + foo: null, + }) {} + + expect>().type.toBe<{ foo: unknown }>(); + expect>().type.toBe<{ foo?: unknown }>(); + expect>().type.toBe<{ foo: unknown }>(); + + class FooWithList extends Record<{ foo: undefined | List }>({ + foo: undefined, + }) {} + + expect>().type.toBe<{ foo: unknown }>(); + }); +}); diff --git a/type-definitions/ts-tests/empty.ts b/type-definitions/ts-tests/empty.ts new file mode 100644 index 0000000000..e9425c6eb5 --- /dev/null +++ b/type-definitions/ts-tests/empty.ts @@ -0,0 +1,40 @@ +import { expect, test } from 'tstyche'; +import { Seq, Collection } from 'immutable'; + +test('typed empty Seq', () => { + expect(Seq()).type.toBe>(); + + expect(Seq()).type.toBe>(); + + expect(Seq.Indexed()).type.toBe>(); + + expect(Seq.Indexed()).type.toBe>(); + + expect(Seq.Keyed()).type.toBe>(); + + expect(Seq.Keyed()).type.toBe>(); + + expect(Seq.Set()).type.toBe>(); + + expect(Seq.Set()).type.toBe>(); +}); + +test('typed empty Collection', () => { + expect(Collection()).type.toBe>(); + + expect(Collection()).type.toBe>(); + + expect(Collection.Indexed()).type.toBe>(); + + expect(Collection.Indexed()).type.toBe>(); + + expect(Collection.Keyed()).type.toBe>(); + + expect(Collection.Keyed()).type.toBe< + Collection.Keyed + >(); + + expect(Collection.Set()).type.toBe>(); + + expect(Collection.Set()).type.toBe>(); +}); diff --git a/type-definitions/ts-tests/es6-collections.ts b/type-definitions/ts-tests/es6-collections.ts new file mode 100644 index 0000000000..790bc3cf2b --- /dev/null +++ b/type-definitions/ts-tests/es6-collections.ts @@ -0,0 +1,21 @@ +import { expect, test } from 'tstyche'; +import { Map as ImmutableMap, Set as ImmutableSet } from 'immutable'; + +test('immutable.js collections', () => { + const mapImmutable: ImmutableMap = ImmutableMap< + string, + number + >(); + const setImmutable: ImmutableSet = ImmutableSet(); + + expect(mapImmutable.delete('foo')).type.toBe>(); + expect(setImmutable.delete('bar')).type.toBe>(); +}); + +test('ES6 collections', () => { + const mapES6: Map = new Map(); + const setES6: Set = new Set(); + + expect(mapES6.delete('foo')).type.toBe(); + expect(setES6.delete('bar')).type.toBe(); +}); diff --git a/type-definitions/ts-tests/exports.ts b/type-definitions/ts-tests/exports.ts new file mode 100644 index 0000000000..39f9d2fe49 --- /dev/null +++ b/type-definitions/ts-tests/exports.ts @@ -0,0 +1,112 @@ +// Some tests look like they are repeated in order to avoid false positives. + +import { expect, test } from 'tstyche'; +import * as Immutable from 'immutable'; +import { + List, + Map, + OrderedMap, + OrderedSet, + Range, + Repeat, + Seq, + Set, + Stack, + Collection, +} from 'immutable'; + +test('named imports', () => { + expect(List).type.toBe(); + + expect(Map).type.toBe(); + + expect(OrderedMap).type.toBe(); + + expect(OrderedSet).type.toBe(); + + expect(Range).type.toBe< + ( + start: number, + end: number, + step?: number | undefined + ) => Seq.Indexed + >(); + + expect(Repeat).type.toBe< + (value: T, times?: number | undefined) => Seq.Indexed + >(); + + expect(Seq).type.toBe(); + + expect(Set).type.toBe(); + + expect(Stack).type.toBe(); + + expect(Collection).type.toBe(); + + expect(Collection.Set).type.toBe< + ( + collection?: Iterable | ArrayLike | undefined + ) => Collection.Set + >(); + + expect(Collection.Keyed).type.toBe<{ + (collection?: Iterable<[K, V]> | undefined): Collection.Keyed; + (obj: { [key: string]: V }): Collection.Keyed; + }>(); + + expect(Collection.Indexed).type.toBe< + ( + collection?: Iterable | ArrayLike | undefined + ) => Collection.Indexed + >(); +}); + +test('namespace import', () => { + expect(Immutable.List).type.toBe(); + + expect(Immutable.Map).type.toBe(); + + expect(Immutable.OrderedMap).type.toBe(); + + expect(Immutable.OrderedSet).type.toBe(); + + expect(Immutable.Range).type.toBe< + ( + start: number, + end: number, + step?: number | undefined + ) => Immutable.Seq.Indexed + >(); + + expect(Immutable.Repeat).type.toBe< + (value: T, times?: number | undefined) => Immutable.Seq.Indexed + >(); + + expect(Immutable.Seq).type.toBe(); + + expect(Immutable.Set).type.toBe(); + + expect(Immutable.Stack).type.toBe(); + + expect(Immutable.Collection).type.toBe(); + + expect(Immutable.Collection.Set).type.toBe< + ( + collection?: Iterable | ArrayLike | undefined + ) => Immutable.Collection.Set + >(); + + expect(Immutable.Collection.Keyed).type.toBe<{ + ( + collection?: Iterable<[K, V]> | undefined + ): Immutable.Collection.Keyed; + (obj: { [key: string]: V }): Immutable.Collection.Keyed; + }>(); + + expect(Immutable.Collection.Indexed).type.toBe< + ( + collection?: Iterable | ArrayLike | undefined + ) => Immutable.Collection.Indexed + >(); +}); diff --git a/type-definitions/ts-tests/from-js.ts b/type-definitions/ts-tests/from-js.ts new file mode 100644 index 0000000000..f04a1e78f8 --- /dev/null +++ b/type-definitions/ts-tests/from-js.ts @@ -0,0 +1,46 @@ +import { expect, test } from 'tstyche'; +import { fromJS, Collection, List, Map, MapOf } from 'immutable'; + +test('fromJS', () => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + expect(fromJS({}, (a: any, b: any) => b)).type.toBe< + Collection + >(); + + expect(fromJS('abc')).type.toBe(); + + expect(fromJS([0, 1, 2])).type.toBe>(); + + expect(fromJS(List([0, 1, 2]))).type.toBe>(); + + expect(fromJS({ a: 0, b: 1, c: 2 })).type.toBe< + Map<'b' | 'a' | 'c', number> + >(); + + expect(fromJS(Map({ a: 0, b: 1, c: 2 }))).type.toBe< + MapOf<{ a: number; b: number; c: number }> + >(); + + expect(fromJS([{ a: 0 }])).type.toBe>>(); + + expect(fromJS({ a: [0] })).type.toBe>>(); + + expect(fromJS([[[0]]])).type.toBe>>>(); + + expect(fromJS({ a: { b: { c: 0 } } })).type.toBe< + Map<'a', Map<'b', Map<'c', number>>> + >(); +}); + +test('fromJS in an array of function', () => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const create = [(data: any) => data, fromJS][1]; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + expect(create({ a: 'A' })).type.toBe(); + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const createConst = ([(data: any) => data, fromJS] as const)[1]; + + expect(createConst({ a: 'A' })).type.toBe>(); +}); diff --git a/type-definitions/ts-tests/functional.ts b/type-definitions/ts-tests/functional.ts new file mode 100644 index 0000000000..01a8636c50 --- /dev/null +++ b/type-definitions/ts-tests/functional.ts @@ -0,0 +1,174 @@ +import { expect, test } from 'tstyche'; +import { + get, + getIn, + has, + hasIn, + set, + remove, + update, + Map, + List, + MapOf, +} from 'immutable'; + +test('get', () => { + expect(get([1, 2, 3], 0)).type.toBe(); + + expect(get([1, 2, 3], 0, 'a')).type.toBe(); + + expect(get({ x: 10, y: 20 }, 'x')).type.toBe(); + + expect(get({ x: 10, y: 20 }, 'z', 'missing')).type.toBe(); +}); + +test('getIn', () => { + expect(getIn('a', ['length' as const])).type.toBe(); + + expect(getIn([1, 2, 3], [0])).type.toBe(); + + // first parameter type is Array so we can not detect that the number will be invalid + expect(getIn([1, 2, 3], [99])).type.toBe(); + + // We do not handle List in getIn TS type yet (hard to convert to a tuple) + expect(getIn([1, 2, 3], List([0]))).type.toBe(); + + expect(getIn([1, 2, 3], [0], 'a' as const)).type.toBe(); + + expect(getIn(List([1, 2, 3]), [0])).type.toBe(); + + // first parameter type is Array so we can not detect that the number will be invalid + expect(getIn(List([1, 2, 3]), [99])).type.toBe(); + + expect(getIn(List([1, 2, 3]), ['a' as const])).type.toBe(); + + expect( + getIn(List([1, 2, 3]), ['a' as const], 'missing') + ).type.toBe<'missing'>(); + + expect(getIn({ x: 10, y: 20 }, ['x' as const])).type.toBe(); + + expect( + getIn({ x: 10, y: 20 }, ['z' as const], 'missing') + ).type.toBe<'missing'>(); + + expect(getIn({ x: { y: 20 } }, ['x' as const])).type.toBe<{ y: number }>(); + + expect(getIn({ x: { y: 20 } }, ['z' as const])).type.toBe(); + + expect( + getIn({ x: { y: 20 } }, ['x' as const, 'y' as const]) + ).type.toBe(); + + expect( + getIn({ x: Map({ y: 20 }) }, ['x' as const, 'y' as const]) + ).type.toBe(); + + expect( + getIn(Map({ x: Map({ y: 20 }) }), ['x' as const, 'y' as const]) + ).type.toBe(); + + const o = Map({ x: List([Map({ y: 20 })]) }); + + expect(getIn(o, ['x' as const, 'y' as const])).type.toBe(); + + expect(getIn(o, ['x' as const])).type.toBe>>(); + + expect(getIn(o, ['x' as const, 0])).type.toBe>(); + + expect(getIn(o, ['x' as const, 0, 'y' as const])).type.toBe(); +}); + +test('has', () => { + expect(has([1, 2, 3], 0)).type.toBe(); + + expect(has({ x: 10, y: 20 }, 'x')).type.toBe(); +}); + +test('hasIn', () => { + expect(hasIn('a', ['length' as const])).type.toBe(); + + expect(hasIn(123, [])).type.toBe(); + + expect(hasIn(true, [])).type.toBe(); + + expect(hasIn([1, 2, 3], [0])).type.toBe(); + + // first parameter type is Array so we can not detect that the number will be invalid + expect(hasIn([1, 2, 3], [99])).type.toBe(); + + // We do not handle List in hasIn TS type yet (hard to convert to a tuple) + expect(hasIn([1, 2, 3], List([0]))).type.toBe(); + + expect(hasIn(List([1, 2, 3]), [0])).type.toBe(); + + // first parameter type is Array so we can not detect that the number will be invalid + expect(hasIn(List([1, 2, 3]), [99])).type.toBe(); + + expect(hasIn(List([1, 2, 3]), ['a' as const])).type.toBe(); + + expect(hasIn({ x: 10, y: 20 }, ['x' as const])).type.toBe(); + + expect(hasIn({ x: { y: 20 } }, ['z' as const])).type.toBe(); + + expect( + hasIn({ x: { y: 20 } }, ['x' as const, 'y' as const]) + ).type.toBe(); + + expect( + hasIn({ x: Map({ y: 20 }) }, ['x' as const, 'y' as const]) + ).type.toBe(); + + expect( + hasIn(Map({ x: Map({ y: 20 }) }), ['x' as const, 'y' as const]) + ).type.toBe(); + + const o = Map({ x: List([Map({ y: 20 })]) }); + + expect(hasIn(o, ['x' as const, 'y' as const])).type.toBe(); + + expect(hasIn(o, ['x' as const, 0, 'y' as const])).type.toBe(); +}); + +test('set', () => { + expect(set([1, 2, 3], 0, 10)).type.toBe(); + + expect(set([1, 2, 3], 0, 'a')).type.toRaiseError(); + + expect(set([1, 2, 3], 'a', 0)).type.toRaiseError(); + + expect(set({ x: 10, y: 20 }, 'x', 100)).type.toBe<{ + x: number; + y: number; + }>(); + + expect(set({ x: 10, y: 20 }, 'x', 'a')).type.toRaiseError(); +}); + +test('remove', () => { + expect(remove([1, 2, 3], 0)).type.toBe(); + + expect(remove({ x: 10, y: 20 }, 'x')).type.toBe<{ + x: number; + y: number; + }>(); +}); + +test('update', () => { + expect(update([1, 2, 3], 0, (v: number) => v + 1)).type.toBe(); + + expect(update([1, 2, 3], 0, 1)).type.toRaiseError(); + + expect(update([1, 2, 3], 0, (v: string) => v + 'a')).type.toRaiseError(); + + expect(update([1, 2, 3], 'a', (v: number) => v + 1)).type.toRaiseError(); + + expect(update({ x: 10, y: 20 }, 'x', (v: number) => v + 1)).type.toBe<{ + x: number; + y: number; + }>(); + + expect( + update({ x: 10, y: 20 }, 'x', (v: string) => v + 'a') + ).type.toRaiseError(); +}); diff --git a/type-definitions/ts-tests/groupBy.ts b/type-definitions/ts-tests/groupBy.ts new file mode 100644 index 0000000000..141bfc2912 --- /dev/null +++ b/type-definitions/ts-tests/groupBy.ts @@ -0,0 +1,59 @@ +import { expect, test } from 'tstyche'; +import { + Collection, + List, + Map, + OrderedMap, + Set, + OrderedSet, + Seq, + Stack, + MapOf, +} from 'immutable'; + +test('groupBy', () => { + expect(Collection(['a', 'b', 'c', 'a']).groupBy((v) => v)).type.toBe< + Map> + >(); + + expect( + Collection({ a: 1, b: 2, c: 3, d: 1 }).groupBy((v) => `key-${v}`) + ).type.toBe>>(); + + expect(List(['a', 'b', 'c', 'a']).groupBy((v) => v)).type.toBe< + Map> + >(); + + expect(Seq(['a', 'b', 'c', 'a']).groupBy((v) => v)).type.toBe< + Map> + >(); + + expect(Seq({ a: 1, b: 2, c: 3, d: 1 }).groupBy((v) => `key-${v}`)).type.toBe< + Map> + >(); + + expect(Set(['a', 'b', 'c', 'a']).groupBy((v) => v)).type.toBe< + Map> + >(); + + expect(Stack(['a', 'b', 'c', 'a']).groupBy((v) => v)).type.toBe< + Map> + >(); + + expect(OrderedSet(['a', 'b', 'c', 'a']).groupBy((v) => v)).type.toBe< + Map> + >(); + + expect( + Map({ a: 1, b: 2, c: 3, d: 1 }).groupBy((v) => `key-${v}`) + ).type.toBe>>(); + + // type should be something like Map>> but groupBy returns a wrong type with `this` + expect(Map({ a: 1, b: 2, c: 3, d: 1 }).groupBy((v) => `key-${v}`)).type.toBe< + Map> + >(); + + expect( + OrderedMap({ a: 1, b: 2, c: 3, d: 1 }).groupBy((v) => `key-${v}`) + ).type.toBe>>(); +}); diff --git a/type-definitions/ts-tests/list.ts b/type-definitions/ts-tests/list.ts new file mode 100644 index 0000000000..2b86dca369 --- /dev/null +++ b/type-definitions/ts-tests/list.ts @@ -0,0 +1,403 @@ +import { expect, pick, test } from 'tstyche'; +import { + List, + get, + set, + remove, + update, + setIn, + removeIn, + updateIn, + merge, +} from 'immutable'; + +test('#constructor', () => { + expect(List()).type.toBe>(); + + expect>().type.toBeAssignableWith(List()); + + expect>().type.toBeAssignableWith(List([1, 'a'])); + expect>().type.not.toBeAssignableWith(List([1, 'a'])); +}); + +test('#size', () => { + expect(pick(List(), 'size')).type.toBe<{ readonly size: number }>(); +}); + +test('#setSize', () => { + expect(List().setSize(10)).type.toBe>(); + + expect(List().setSize('foo')).type.toRaiseError(); +}); + +test('.of', () => { + expect(List.of(1, 2, 3)).type.toBe>(); + + expect(List.of('a', 1)).type.toRaiseError(); + + expect(List.of('a', 1)).type.toBe>(); +}); + +test('#get', () => { + expect(List().get(4)).type.toBe(); + + expect(List().get(4, 'a')).type.toBe(); + + expect(List().get(4, 'a')).type.toRaiseError(); + + expect(get(List(), 4)).type.toBe(); + + expect(get(List(), 4, 'a')).type.toBe(); +}); + +test('#set', () => { + expect(List().set(0, 0)).type.toBe>(); + + expect(List().set(1, 'a')).type.toRaiseError(); + + expect(List().set('a', 1)).type.toRaiseError(); + + expect(List().set(0, 1)).type.toBe>(); + + expect(List().set(0, 'a')).type.toBe< + List + >(); + + expect(set(List(), 0, 0)).type.toBe>(); +}); + +test('#first', () => { + const a = List().first(); + // ^? + expect(List().first()).type.toBe(); + expect(List().first('first')).type.toBe(); +}); + +test('#last', () => { + expect(List().last()).type.toBe(); + expect(List().last('last')).type.toBe(); +}); + +test('#set', () => { + expect(set(List(), 1, 'a')).type.toRaiseError(); + + expect(set(List(), 'a', 1)).type.toRaiseError(); +}); + +test('#setIn', () => { + expect(List().setIn([], 0)).type.toBe>(); + + expect(setIn(List(), [], 0)).type.toBe>(); +}); + +test('#insert', () => { + expect(List().insert(0, 0)).type.toBe>(); + + expect(List().insert(1, 'a')).type.toRaiseError(); + + expect(List().insert('a', 1)).type.toRaiseError(); + + expect(List().insert(0, 1)).type.toBe< + List + >(); + + expect(List().insert(0, 'a')).type.toBe< + List + >(); +}); + +test('#push', () => { + expect(List().push(0, 0)).type.toBe>(); + + expect(List().push(1, 'a')).type.toRaiseError(); + + expect(List().push('a', 1)).type.toRaiseError(); + + expect(List().push(0, 1)).type.toBe>(); + + expect(List().push(0, 'a')).type.toBe< + List + >(); +}); + +test('#unshift', () => { + expect(List().unshift(0, 0)).type.toBe>(); + + expect(List().unshift(1, 'a')).type.toRaiseError(); + + expect(List().unshift('a', 1)).type.toRaiseError(); + + expect(List().unshift(0, 1)).type.toBe< + List + >(); + + expect(List().unshift(0, 'a')).type.toBe< + List + >(); +}); + +test('#delete', () => { + expect(List().delete(0)).type.toBe>(); + + expect(List().delete('a')).type.toRaiseError(); +}); + +test('#deleteIn', () => { + expect(List().deleteIn([])).type.toBe>(); +}); + +test('#remove', () => { + expect(List().remove(0)).type.toBe>(); + + expect(List().remove('a')).type.toRaiseError(); + + expect(remove(List(), 0)).type.toBe>(); +}); + +test('#removeIn', () => { + expect(List().removeIn([])).type.toBe>(); + + expect(removeIn(List(), [])).type.toBe>(); +}); + +test('#clear', () => { + expect(List().clear()).type.toBe>(); + + expect(List().clear(10)).type.toRaiseError(); +}); + +test('#pop', () => { + expect(List().pop()).type.toBe>(); + + expect(List().pop(10)).type.toRaiseError(); +}); + +test('#shift', () => { + expect(List().shift()).type.toBe>(); + + expect(List().shift(10)).type.toRaiseError(); +}); + +test('#update', () => { + expect(List().update((v) => 1)).type.toBe(); + + expect( + List().update((v: List | undefined) => v) + ).type.toRaiseError(); + + expect(List().update(0, (v: number | undefined) => 0)).type.toBe< + List + >(); + + expect( + List().update(0, (v: number | undefined) => v + 'a') + ).type.toRaiseError(); + + expect(List().update(1, 10, (v: number | undefined) => 0)).type.toBe< + List + >(); + + expect( + List().update(1, 'a', (v: number | undefined) => 0) + ).type.toRaiseError(); + + expect( + List().update(1, 10, (v: number | undefined) => v + 'a') + ).type.toRaiseError(); + + expect(List().update(1, (v) => v?.toUpperCase())).type.toBe< + List + >(); + + expect(update(List(), 0, (v: number | undefined) => 0)).type.toBe< + List + >(); + + expect( + update(List(), 1, 10, (v: number) => v + 'a') + ).type.toRaiseError(); +}); + +test('#updateIn', () => { + expect(List().updateIn([], (v) => v)).type.toBe>(); + + expect(List().updateIn([], 10)).type.toRaiseError(); + + expect(updateIn(List(), [], (v) => v)).type.toBe>(); +}); + +test('#map', () => { + expect( + List().map((value: number, key: number, iter: List) => 1) + ).type.toBe>(); + + expect( + List().map((value: number, key: number, iter: List) => 'a') + ).type.toBe>(); + + expect( + List().map( + (value: number, key: number, iter: List) => 1 + ) + ).type.toBe>(); + + expect( + List().map( + (value: number, key: number, iter: List) => 1 + ) + ).type.toRaiseError(); + + expect( + List().map( + (value: string, key: number, iter: List) => 1 + ) + ).type.toRaiseError(); + + expect( + List().map( + (value: number, key: string, iter: List) => 1 + ) + ).type.toRaiseError(); + + expect( + List().map( + (value: number, key: number, iter: List) => 1 + ) + ).type.toRaiseError(); + + expect( + List().map( + (value: number, key: number, iter: List) => 'a' + ) + ).type.toRaiseError(); +}); + +test('#flatMap', () => { + expect( + List().flatMap((value: number, key: number, iter: List) => [ + 1, + ]) + ).type.toBe>(); + + expect( + List().flatMap((value: number, key: number, iter: List) => [ + 'a', + ]) + ).type.toBe>(); + + expect(List>().flatMap((list) => list)).type.toBe< + List + >(); + + expect( + List().flatMap( + (value: number, key: number, iter: List) => [1] + ) + ).type.toBe>(); + + expect( + List().flatMap( + (value: number, key: number, iter: List) => [1] + ) + ).type.toRaiseError(); + + expect( + List().flatMap( + (value: string, key: number, iter: List) => [1] + ) + ).type.toRaiseError(); + + expect( + List().flatMap( + (value: number, key: string, iter: List) => [1] + ) + ).type.toRaiseError(); + + expect( + List().flatMap( + (value: number, key: number, iter: List) => [1] + ) + ).type.toRaiseError(); + + expect( + List().flatMap( + (value: number, key: number, iter: List) => ['a'] + ) + ).type.toRaiseError(); +}); + +test('#merge', () => { + expect(List().merge(List())).type.toBe>(); + + expect(List().merge(List())).type.toBe< + List + >(); + + expect(List().merge(List())).type.toBe< + List + >(); + + expect(List().merge(List())).type.toBe< + List + >(); + + expect(merge(List(), List())).type.toBe>(); +}); + +test('#mergeIn', () => { + expect(List().mergeIn([], [])).type.toBe>(); +}); + +test('#mergeDeepIn', () => { + expect(List().mergeDeepIn([], [])).type.toBe>(); +}); + +test('#flatten', () => { + expect(List().flatten()).type.toBe< + Immutable.Collection + >(); + + expect(List().flatten(10)).type.toBe< + Immutable.Collection + >(); + + expect(List().flatten(false)).type.toBe< + Immutable.Collection + >(); + + expect(List().flatten('a')).type.toRaiseError(); +}); + +test('#withMutations', () => { + expect(List().withMutations((mutable) => mutable)).type.toBe< + List + >(); + + expect( + List().withMutations((mutable: List) => mutable) + ).type.toRaiseError(); +}); + +test('#asMutable', () => { + expect(List().asMutable()).type.toBe>(); +}); + +test('#asImmutable', () => { + expect(List().asImmutable()).type.toBe>(); +}); + +test('#toJS', () => { + expect(List>().toJS()).type.toBe(); +}); + +test('#toJSON', () => { + expect(List>().toJSON()).type.toBe[]>(); +}); + +test('for of loops', () => { + const list = List([1, 2, 3, 4]); + + for (const val of list) { + expect(val).type.toBe(); + } +}); diff --git a/type-definitions/ts-tests/map.ts b/type-definitions/ts-tests/map.ts new file mode 100644 index 0000000000..59f39eb36c --- /dev/null +++ b/type-definitions/ts-tests/map.ts @@ -0,0 +1,668 @@ +import { expect, pick, test } from 'tstyche'; +import { Map, List, MapOf, OrderedMap } from 'immutable'; + +test('#constructor', () => { + expect(Map()).type.toBe>(); + + expect(Map()).type.toBe>(); + + expect(Map([[1, 'a']])).type.toBe>(); + + expect(Map([['a', 'a']])).type.toBe>(); + + expect(Map(List<[number, string]>([[1, 'a']]))).type.toBe< + Map + >(); + + expect(Map({ a: 1 })).type.toBe>(); + + expect(Map({ a: 1, b: 'b' })).type.toBe>(); + + expect(Map({ a: Map({ b: Map({ c: 3 }) }) })).type.toBe< + MapOf<{ a: MapOf<{ b: MapOf<{ c: number }> }> }> + >(); + + expect(Map<{ a: string }>({ a: 1 })).type.toRaiseError(); + + expect(Map<{ a: string }>({ a: 'a', b: 'b' })).type.toRaiseError(); + + // TODO this type is really weird, it should be `Map` or MapOf<{ a: string }> See https://github.com/immutable-js/immutable-js/pull/1991#discussion_r1510863932 + expect(Map(List([List(['a', 'b'])]))).type.toBe>>>(); + + expect(Map([[1, 'a']])).type.not.toBeAssignableTo>(); + + expect(Map<'status', string>({ status: 'paid' })).type.toBe< + Map<'status', string> + >(); + + expect(Map<'status' | 'amount', string>({ status: 'paid' })).type.toBe< + Map<'status' | 'amount', string> + >(); + + expect( + Map<'status', string>({ status: 'paid', amount: 10 }) + ).type.toRaiseError(); +}); + +test('#size', () => { + expect(pick(Map(), 'size')).type.toBe<{ readonly size: number }>(); +}); + +test('#get', () => { + expect(Map().get(4)).type.toBe(); + + expect(Map().get(4, 'a')).type.toBe(); + + expect(Map().get(4, 'a')).type.toRaiseError(); + + expect(Map({ a: 4, b: true }).get('a')).type.toBe(); + + expect(Map({ a: 4, b: true }).get('b')).type.toBe(); + + expect( + Map({ a: Map({ b: true }) }) + .get('a') + .get('b') + ).type.toBe(); + + expect(Map({ a: 4 }).get('b')).type.toRaiseError(); + + expect(Map({ a: 4 }).get('b', undefined)).type.toBe(); + + expect(Map({ 1: 4 }).get(1)).type.toBe(); + + expect(Map({ 1: 4 }).get(2)).type.toRaiseError(); + + expect(Map({ 1: 4 }).get(2, 3)).type.toBe<3>(); + + const s1 = Symbol('s1'); + + expect(Map({ [s1]: 4 }).get(s1)).type.toBe(); + + const s2 = Symbol('s2'); + + expect(Map({ [s2]: 4 }).get(s1)).type.toRaiseError(); +}); + +test('#getIn', () => { + const result = Map({ a: 4, b: true }).getIn(['a']); + + expect(result).type.toBe(); + + expect(Map({ a: 4, b: true }).getIn(['a' as const])).type.toBe(); + + expect( + Map({ a: Map({ b: Map({ c: Map({ d: 4 }) }) }) }).getIn([ + 'a' as const, + 'b' as const, + 'c' as const, + 'd' as const, + ]) + ).type.toBe(); + + expect(Map({ a: [1] }).getIn(['a' as const, 0])).type.toBe(); + + expect(Map({ a: List([1]) }).getIn(['a' as const, 0])).type.toBe(); +}); + +test('#set', () => { + expect(Map().set(0, 0)).type.toBe>(); + + expect(Map().set(1, 'a')).type.toRaiseError(); + + expect(Map().set('a', 1)).type.toRaiseError(); + + expect(Map().set(0, 1)).type.toBe< + Map + >(); + + expect(Map().set(0, 'a')).type.toBe< + Map + >(); + + expect(Map({ a: 1 }).set('b', 'b')).type.toRaiseError(); + + expect(Map<{ a: number; b?: string }>({ a: 1 }).set('b', 'b')).type.toBe< + MapOf<{ a: number; b?: string | undefined }> + >(); + + expect( + Map<{ a: number; b?: string }>({ a: 1 }).set('b', undefined) + ).type.toBe>(); + + expect( + Map<{ a: number; b?: string }>({ a: 1 }).set('b', 'b').get('a') + ).type.toBe(); + + expect( + Map<{ a: number; b?: string }>({ a: 1 }).set('b', 'b').get('b') + ).type.toBe(); + + const customer = Map<{ phone: string | number }>({ + phone: 'bar', + }); + + expect(customer).type.toBeAssignableWith(customer.set('phone', 8)); +}); + +test('#setIn', () => { + expect(Map().setIn([], 0)).type.toBe>(); +}); + +test('#delete', () => { + expect(Map().delete(0)).type.toBe>(); + + expect(Map().delete('a')).type.toRaiseError(); + + expect(Map({ a: 1, b: 'b' }).delete('b')).type.toBe(); + + expect( + Map<{ a: number; b?: string }>({ a: 1, b: 'b' }).delete('b') + ).type.toBe>(); + + expect( + Map<{ a?: number; b?: string }>({ a: 1, b: 'b' }).remove('b').delete('a') + ).type.toBe>(); + + expect( + Map<{ a: number; b?: string }>({ a: 1, b: 'b' }).remove('b').get('a') + ).type.toBe(); + + expect( + Map<{ a: number; b?: string }>({ a: 1, b: 'b' }).remove('b').get('b') + ).type.toBe(); +}); + +test('#deleteAll', () => { + expect(Map().deleteAll([0])).type.toBe>(); + + expect(Map().deleteAll([0, 'a'])).type.toRaiseError(); +}); + +test('#deleteIn', () => { + expect(Map().deleteIn([])).type.toBe>(); +}); + +test('#remove', () => { + expect(Map().remove(0)).type.toBe>(); + + expect(Map().remove('a')).type.toRaiseError(); +}); + +test('#removeAll', () => { + expect(Map().removeAll([0])).type.toBe>(); + + expect(Map().removeAll([0, 'a'])).type.toRaiseError(); +}); + +test('#removeIn', () => { + expect(Map().removeIn([])).type.toBe>(); +}); + +test('#clear', () => { + expect(Map().clear()).type.toBe>(); + + expect(Map().clear(10)).type.toRaiseError(); +}); + +test('#update', () => { + expect(Map().update((v) => 1)).type.toBe(); + + expect( + Map().update((v: Map | undefined) => v) + ).type.toRaiseError(); + + expect( + Map().update(0, (v: number | undefined) => 0) + ).type.toBe>(); + + expect( + Map().update(0, (v: number | undefined) => v + 'a') + ).type.toRaiseError(); + + expect( + Map().update(1, 10, (v: number | undefined) => 0) + ).type.toBe>(); + + expect( + Map().update(1, 'a', (v: number | undefined) => 0) + ).type.toRaiseError(); + + expect( + Map().update(1, 10, (v: number | undefined) => v + 'a') + ).type.toRaiseError(); + + expect(Map({ a: 1, b: 'b' }).update('c', (v) => v)).type.toRaiseError(); + + expect(Map({ a: 1, b: 'b' }).update('b', (v) => v.toUpperCase())).type.toBe< + MapOf<{ a: number; b: string }> + >(); + + expect( + Map({ a: 1, b: 'b' }).update('b', 'NSV', (v) => v.toUpperCase()) + ).type.toBe>(); + + expect(Map({ a: 1, b: 'b' }).update((v) => ({ a: 'a' }))).type.toRaiseError(); + + expect( + Map({ a: 1, b: 'b' }).update((v) => v.set('a', 2).set('b', 'B')) + ).type.toBe>(); + + expect( + Map({ a: 1, b: 'b' }).update((v) => v.set('c', 'c')) + ).type.toRaiseError(); + + expect( + Map().update('noKey', (ls) => ls?.toUpperCase()) + ).type.toBe>(); +}); + +test('#updateIn', () => { + expect(Map().updateIn([], (v) => v)).type.toBe< + Map + >(); + + expect(Map().updateIn([], 10)).type.toRaiseError(); +}); + +test('#map', () => { + expect( + Map().map( + (value: number, key: number, iter: Map) => 1 + ) + ).type.toBe>(); + + expect( + Map().map( + (value: number, key: number, iter: Map) => 'a' + ) + ).type.toBe>(); + + expect( + Map().map( + (value: number, key: number, iter: Map) => 1 + ) + ).type.toBe>(); + + expect( + Map().map( + (value: number, key: number, iter: Map) => 1 + ) + ).type.toRaiseError(); + + expect( + Map().map( + (value: string, key: number, iter: Map) => 1 + ) + ).type.toRaiseError(); + + expect( + Map().map( + (value: number, key: string, iter: Map) => 1 + ) + ).type.toRaiseError(); + + expect( + Map().map( + (value: number, key: number, iter: Map) => 1 + ) + ).type.toRaiseError(); + + expect( + Map().map( + (value: number, key: number, iter: Map) => 'a' + ) + ).type.toRaiseError(); +}); + +test('#mapKeys', () => { + expect( + Map().mapKeys( + (value: number, key: number, iter: Map) => 1 + ) + ).type.toBe>(); + + expect( + Map().mapKeys( + (value: number, key: number, iter: Map) => 'a' + ) + ).type.toBe>(); + + expect( + Map().mapKeys( + (value: number, key: number, iter: Map) => 1 + ) + ).type.toBe>(); + + expect( + Map().mapKeys( + (value: number, key: number, iter: Map) => 1 + ) + ).type.toRaiseError(); + + expect( + Map().mapKeys( + (value: string, key: number, iter: Map) => 1 + ) + ).type.toRaiseError(); + + expect( + Map().mapKeys( + (value: number, key: string, iter: Map) => 1 + ) + ).type.toRaiseError(); + + expect( + Map().mapKeys( + (value: number, key: number, iter: Map) => 1 + ) + ).type.toRaiseError(); + + expect( + Map().mapKeys( + (value: number, key: number, iter: Map) => 'a' + ) + ).type.toRaiseError(); +}); + +test('#flatMap', () => { + expect( + Map().flatMap( + (value: number, key: number, iter: Map) => [[0, 1]] + ) + ).type.toBe>(); + + expect( + Map().flatMap( + (value: number, key: number, iter: Map) => [['a', 'b']] + ) + ).type.toBe>(); + + expect( + Map().flatMap( + (value: number, key: number, iter: Map) => [[0, 1]] + ) + ).type.toBe>(); + + expect( + Map().flatMap( + (value: number, key: number, iter: Map) => [[0, 1]] + ) + ).type.toRaiseError(); + + expect( + Map().flatMap( + (value: string, key: number, iter: Map) => [[0, 1]] + ) + ).type.toRaiseError(); + + expect( + Map().flatMap( + (value: number, key: string, iter: Map) => [[0, 1]] + ) + ).type.toRaiseError(); + + expect( + Map().flatMap( + (value: number, key: number, iter: Map) => [[0, 1]] + ) + ).type.toRaiseError(); + + expect( + Map().flatMap( + (value: number, key: number, iter: Map) => [[0, 'a']] + ) + ).type.toRaiseError(); +}); + +test('#merge', () => { + expect(Map().merge({ a: 1 })).type.toBe< + Map + >(); + + expect(Map().merge({ a: { b: 1 } })).type.toBe< + Map + >(); + + expect(Map().merge(Map())).type.toBe< + Map + >(); + + expect(Map().merge(Map())).type.toBe< + Map + >(); + + expect(Map().merge(Map())).type.toBe< + Map + >(); + + expect(Map().merge(Map())).type.toBe< + Map + >(); + + expect(Map({ a: 1 }).merge(Map({ b: 2 }))).type.toBe< + Map<'b' | 'a', number> + >(); +}); + +test('#mergeIn', () => { + expect(Map().mergeIn([], [])).type.toBe< + Map + >(); +}); + +test('#mergeWith', () => { + expect( + Map().mergeWith( + (prev: number, next: number, key: number) => 1, + Map() + ) + ).type.toBe>(); + + expect( + Map().mergeWith( + (prev: string, next: number, key: number) => 1, + Map() + ) + ).type.toRaiseError(); + + expect( + Map().mergeWith( + (prev: number, next: string, key: number) => 1, + Map() + ) + ).type.toRaiseError(); + + expect( + Map().mergeWith( + (prev: number, next: number, key: string) => 1, + Map() + ) + ).type.toRaiseError(); + + expect( + Map().mergeWith( + (prev: number, next: number, key: number) => 'a', + Map() + ) + ).type.toBe>(); + + expect( + Map().mergeWith( + (prev: number, next: number, key: number) => 1, + Map() + ) + ).type.toRaiseError(); + + expect( + Map().mergeWith( + (prev: number, next: number, key: string) => 1, + { a: 1 } + ) + ).type.toBe>(); + + expect( + Map().mergeWith( + (prev: number, next: number, key: string) => 1, + { a: 'a' } + ) + ).type.toRaiseError(); + + expect( + Map().mergeWith( + (prev: number, next: number | string, key: string) => 1, + { a: 'a' } + ) + ).type.toBe>(); + + expect( + Map().mergeWith( + (prev: number | string, next: number | string, key: number) => 1, + Map() + ) + ).type.toBe>(); +}); + +test('#mergeDeep', () => { + expect(Map().mergeDeep({ a: 1 })).type.toBe< + Map + >(); + + expect(Map().mergeDeep({ a: { b: 1 } })).type.toBe< + Map + >(); + + expect(Map().mergeDeep(Map({ a: { b: 1 } }))).type.toBe< + Map + >(); + + expect(Map().mergeDeep(Map())).type.toBe< + Map + >(); + + expect(Map().mergeDeep(Map())).type.toBe< + Map + >(); + + expect( + Map().mergeDeep(Map()) + ).type.toBe>(); + + expect( + Map().mergeDeep(Map()) + ).type.toBe>(); +}); + +test('#mergeDeepIn', () => { + expect(Map().mergeDeepIn([], [])).type.toBe< + Map + >(); +}); + +test('#mergeDeepWith', () => { + expect( + Map().mergeDeepWith( + (prev: unknown, next: unknown, key: unknown) => 1, + Map() + ) + ).type.toBe>(); + + expect( + Map().mergeDeepWith( + (prev: unknown, next: unknown, key: unknown) => 1, + Map() + ) + ).type.toRaiseError(); + + expect( + Map().mergeDeepWith( + (prev: unknown, next: unknown, key: unknown) => 1, + { a: 1 } + ) + ).type.toBe>(); + + expect( + Map().mergeDeepWith( + (prev: unknown, next: unknown, key: unknown) => 1, + { a: 'a' } + ) + ).type.toRaiseError(); + + expect( + Map().mergeDeepWith( + (prev: unknown, next: unknown, key: unknown) => 1, + Map() + ) + ).type.toBe>(); +}); + +test('#flip', () => { + expect(Map().flip()).type.toBe>(); +}); + +test('#sort', () => { + expect(Map().sort()).type.toBe< + Map & OrderedMap + >(); + expect(Map().sort((a, b) => 1)).type.toBe< + Map & OrderedMap + >(); + + expect(Map({ a: 'a' }).sort()).type.toBe< + MapOf<{ a: string }> & OrderedMap<'a', string> + >(); +}); + +test('#sortBy', () => { + expect(Map().sortBy((v) => v)).type.toBe< + Map & OrderedMap + >(); + + expect( + Map().sortBy( + (v) => v, + (a, b) => 1 + ) + ).type.toBe & OrderedMap>(); + expect(Map({ a: 'a' }).sortBy((v) => v)).type.toBe< + MapOf<{ a: string }> & OrderedMap<'a', string> + >(); +}); + +test('#withMutations', () => { + expect(Map().withMutations((mutable) => mutable)).type.toBe< + Map + >(); + + expect( + Map().withMutations((mutable: Map) => mutable) + ).type.toRaiseError(); +}); + +test('#asMutable', () => { + expect(Map().asMutable()).type.toBe>(); +}); + +test('#asImmutable', () => { + expect(Map().asImmutable()).type.toBe>(); +}); + +test('#toJS', () => { + expect(Map().toJS()).type.toBe<{ + [x: string]: number; + [x: number]: number; + [x: symbol]: number; + }>(); + + expect(Map({ a: 'A' }).toJS()).type.toBe<{ a: string }>(); + + expect(Map({ a: Map({ b: 'b' }) }).toJS()).type.toBe<{ + a: { b: string }; + }>(); +}); + +test('#toJSON', () => { + expect(Map({ a: Map({ b: 'b' }) }).toJSON()).type.toBe<{ + a: MapOf<{ b: string }>; + }>(); +}); diff --git a/type-definitions/ts-tests/ordered-map.ts b/type-definitions/ts-tests/ordered-map.ts new file mode 100644 index 0000000000..56341ff76e --- /dev/null +++ b/type-definitions/ts-tests/ordered-map.ts @@ -0,0 +1,504 @@ +import { expect, pick, test } from 'tstyche'; +import { OrderedMap, List } from 'immutable'; + +test('#constructor', () => { + expect(OrderedMap()).type.toBe>(); + + expect(OrderedMap()).type.toBe>(); + + expect(OrderedMap([[1, 'a']])).type.toBe>(); + + expect(OrderedMap(List<[number, string]>([[1, 'a']]))).type.toBe< + OrderedMap + >(); + + expect(OrderedMap({ a: 1 })).type.toBe>(); + + // No longer works in typescript@>=3.9 + // // $ExpectError - TypeScript does not support Lists as tuples + // OrderedMap(List([List(['a', 'b'])])); +}); + +test('#size', () => { + expect(pick(OrderedMap(), 'size')).type.toBe<{ readonly size: number }>(); +}); + +test('#get', () => { + expect(OrderedMap().get(4)).type.toBe(); + + expect(OrderedMap().get(4, 'a')).type.toBe(); + + expect(OrderedMap().get(4, 'a')).type.toRaiseError(); +}); + +test('#set', () => { + expect(OrderedMap().set(0, 0)).type.toBe< + OrderedMap + >(); + + expect(OrderedMap().set(1, 'a')).type.toRaiseError(); + + expect(OrderedMap().set('a', 1)).type.toRaiseError(); + + expect(OrderedMap().set(0, 1)).type.toBe< + OrderedMap + >(); + + expect(OrderedMap().set(0, 'a')).type.toBe< + OrderedMap + >(); +}); + +test('#setIn', () => { + expect(OrderedMap().setIn([], 0)).type.toBe< + OrderedMap + >(); +}); + +test('#delete', () => { + expect(OrderedMap().delete(0)).type.toBe< + OrderedMap + >(); + + expect(OrderedMap().delete('a')).type.toRaiseError(); +}); + +test('#deleteAll', () => { + expect(OrderedMap().deleteAll([0])).type.toBe< + OrderedMap + >(); + + expect(OrderedMap().deleteAll([0, 'a'])).type.toRaiseError(); +}); + +test('#deleteIn', () => { + expect(OrderedMap().deleteIn([])).type.toBe< + OrderedMap + >(); +}); + +test('#remove', () => { + expect(OrderedMap().remove(0)).type.toBe< + OrderedMap + >(); + + expect(OrderedMap().remove('a')).type.toRaiseError(); +}); + +test('#removeAll', () => { + expect(OrderedMap().removeAll([0])).type.toBe< + OrderedMap + >(); + + expect(OrderedMap().removeAll([0, 'a'])).type.toRaiseError(); +}); + +test('#removeIn', () => { + expect(OrderedMap().removeIn([])).type.toBe< + OrderedMap + >(); +}); + +test('#clear', () => { + expect(OrderedMap().clear()).type.toBe< + OrderedMap + >(); + + expect(OrderedMap().clear(10)).type.toRaiseError(); +}); + +test('#update', () => { + expect(OrderedMap().update((v) => 1)).type.toBe(); + + expect( + OrderedMap().update( + (v: OrderedMap | undefined) => v + ) + ).type.toRaiseError(); + + expect( + OrderedMap().update(0, (v: number | undefined) => 0) + ).type.toBe>(); + + expect( + OrderedMap().update(0, (v: number | undefined) => v + 'a') + ).type.toRaiseError(); + + expect( + OrderedMap().update(1, 10, (v: number | undefined) => 0) + ).type.toBe>(); + + expect( + OrderedMap().update(1, 'a', (v: number | undefined) => 0) + ).type.toRaiseError(); + + expect( + OrderedMap().update( + 1, + 10, + (v: number | undefined) => v + 'a' + ) + ).type.toRaiseError(); +}); + +test('#updateIn', () => { + expect(OrderedMap().updateIn([], (v) => v)).type.toBe< + OrderedMap + >(); + + expect(OrderedMap().updateIn([], 10)).type.toRaiseError(); +}); + +test('#map', () => { + expect( + OrderedMap().map( + (value: number, key: number, iter: OrderedMap) => 1 + ) + ).type.toBe>(); + + expect( + OrderedMap().map( + (value: number, key: number, iter: OrderedMap) => 'a' + ) + ).type.toBe>(); + + expect( + OrderedMap().map( + (value: number, key: number, iter: OrderedMap) => 1 + ) + ).type.toBe>(); + + expect( + OrderedMap().map( + (value: number, key: number, iter: OrderedMap) => 1 + ) + ).type.toRaiseError(); + + expect( + OrderedMap().map( + (value: string, key: number, iter: OrderedMap) => 1 + ) + ).type.toRaiseError(); + + expect( + OrderedMap().map( + (value: number, key: string, iter: OrderedMap) => 1 + ) + ).type.toRaiseError(); + + expect( + OrderedMap().map( + (value: number, key: number, iter: OrderedMap) => 1 + ) + ).type.toRaiseError(); + + expect( + OrderedMap().map( + (value: number, key: number, iter: OrderedMap) => 'a' + ) + ).type.toRaiseError(); +}); + +test('#mapKeys', () => { + expect( + OrderedMap().mapKeys( + (value: number, key: number, iter: OrderedMap) => 1 + ) + ).type.toBe>(); + + expect( + OrderedMap().mapKeys( + (value: number, key: number, iter: OrderedMap) => 'a' + ) + ).type.toBe>(); + + expect( + OrderedMap().mapKeys( + (value: number, key: number, iter: OrderedMap) => 1 + ) + ).type.toBe>(); + + expect( + OrderedMap().mapKeys( + (value: number, key: number, iter: OrderedMap) => 1 + ) + ).type.toRaiseError(); + + expect( + OrderedMap().mapKeys( + (value: string, key: number, iter: OrderedMap) => 1 + ) + ).type.toRaiseError(); + + expect( + OrderedMap().mapKeys( + (value: number, key: string, iter: OrderedMap) => 1 + ) + ).type.toRaiseError(); + + expect( + OrderedMap().mapKeys( + (value: number, key: number, iter: OrderedMap) => 1 + ) + ).type.toRaiseError(); + + expect( + OrderedMap().mapKeys( + (value: number, key: number, iter: OrderedMap) => 'a' + ) + ).type.toRaiseError(); +}); + +test('#flatMap', () => { + expect( + OrderedMap().flatMap( + (value: number, key: number, iter: OrderedMap) => [[0, 1]] + ) + ).type.toBe>(); + + expect( + OrderedMap().flatMap( + (value: number, key: number, iter: OrderedMap) => [ + ['a', 'b'], + ] + ) + ).type.toBe>(); + + expect( + OrderedMap().flatMap( + (value: number, key: number, iter: OrderedMap) => [[0, 1]] + ) + ).type.toBe>(); + + expect( + OrderedMap().flatMap( + (value: number, key: number, iter: OrderedMap) => [[0, 1]] + ) + ).type.toRaiseError(); + + expect( + OrderedMap().flatMap( + (value: string, key: number, iter: OrderedMap) => [[0, 1]] + ) + ).type.toRaiseError(); + + expect( + OrderedMap().flatMap( + (value: number, key: string, iter: OrderedMap) => [[0, 1]] + ) + ).type.toRaiseError(); + + expect( + OrderedMap().flatMap( + (value: number, key: number, iter: OrderedMap) => [[0, 1]] + ) + ).type.toRaiseError(); + + expect( + OrderedMap().flatMap( + (value: number, key: number, iter: OrderedMap) => [ + [0, 'a'], + ] + ) + ).type.toRaiseError(); +}); + +test('#merge', () => { + expect(OrderedMap().merge({ a: 1 })).type.toBe< + OrderedMap + >(); + + expect(OrderedMap().merge({ a: { b: 1 } })).type.toBe< + OrderedMap + >(); + + expect( + OrderedMap().merge(OrderedMap()) + ).type.toBe>(); + + expect( + OrderedMap().merge(OrderedMap()) + ).type.toBe>(); + + expect( + OrderedMap().merge(OrderedMap()) + ).type.toBe>(); + + expect( + OrderedMap().merge(OrderedMap()) + ).type.toBe>(); +}); + +test('#mergeIn', () => { + expect(OrderedMap().mergeIn([], [])).type.toBe< + OrderedMap + >(); +}); + +test('#mergeWith', () => { + expect( + OrderedMap().mergeWith( + (prev: number, next: number, key: number) => 1, + OrderedMap() + ) + ).type.toBe>(); + + expect( + OrderedMap().mergeWith( + (prev: string, next: number, key: number) => 1, + OrderedMap() + ) + ).type.toRaiseError(); + + expect( + OrderedMap().mergeWith( + (prev: number, next: string, key: number) => 1, + OrderedMap() + ) + ).type.toRaiseError(); + + expect( + OrderedMap().mergeWith( + (prev: number, next: number, key: string) => 1, + OrderedMap() + ) + ).type.toRaiseError(); + + expect( + OrderedMap().mergeWith( + (prev: number, next: number, key: number) => 'a', + OrderedMap() + ) + ).type.toBe>(); + + expect( + OrderedMap().mergeWith( + (prev: number, next: number, key: number) => 1, + OrderedMap() + ) + ).type.toRaiseError(); + + expect( + OrderedMap().mergeWith( + (prev: number, next: number, key: string) => 1, + { a: 1 } + ) + ).type.toBe>(); + + expect( + OrderedMap().mergeWith( + (prev: number, next: number, key: string) => 1, + { a: 'a' } + ) + ).type.toRaiseError(); + + expect( + OrderedMap().mergeWith( + (prev: number | string, next: number | string, key: number) => 1, + OrderedMap() + ) + ).type.toBe>(); +}); + +test('#mergeDeep', () => { + expect(OrderedMap().mergeDeep({ a: 1 })).type.toBe< + OrderedMap + >(); + + expect(OrderedMap().mergeDeep({ a: { b: 1 } })).type.toBe< + OrderedMap + >(); + + expect( + OrderedMap().mergeDeep(OrderedMap()) + ).type.toBe>(); + + expect( + OrderedMap().mergeDeep(OrderedMap()) + ).type.toBe>(); + + expect( + OrderedMap().mergeDeep( + OrderedMap() + ) + ).type.toBe>(); + + expect( + OrderedMap().mergeDeep( + OrderedMap() + ) + ).type.toBe>(); +}); + +test('#mergeDeepIn', () => { + expect(OrderedMap().mergeDeepIn([], [])).type.toBe< + OrderedMap + >(); +}); + +test('#mergeDeepWith', () => { + expect( + OrderedMap().mergeDeepWith( + (prev: unknown, next: unknown, key: unknown) => 1, + OrderedMap() + ) + ).type.toBe>(); + + expect( + OrderedMap().mergeDeepWith( + (prev: unknown, next: unknown, key: unknown) => 1, + OrderedMap() + ) + ).type.toRaiseError(); + + expect( + OrderedMap().mergeDeepWith( + (prev: unknown, next: unknown, key: unknown) => 1, + { a: 1 } + ) + ).type.toBe>(); + + expect( + OrderedMap().mergeDeepWith( + (prev: unknown, next: unknown, key: unknown) => 1, + { a: 'a' } + ) + ).type.toRaiseError(); + + expect( + OrderedMap().mergeDeepWith( + (prev: unknown, next: unknown, key: unknown) => 1, + OrderedMap() + ) + ).type.toBe>(); +}); + +test('#flip', () => { + expect(OrderedMap().flip()).type.toBe< + OrderedMap + >(); +}); + +test('#withMutations', () => { + expect( + OrderedMap().withMutations((mutable) => mutable) + ).type.toBe>(); + + expect( + OrderedMap().withMutations( + (mutable: OrderedMap) => mutable + ) + ).type.toRaiseError(); +}); + +test('#asMutable', () => { + expect(OrderedMap().asMutable()).type.toBe< + OrderedMap + >(); +}); + +test('#asImmutable', () => { + expect(OrderedMap().asImmutable()).type.toBe< + OrderedMap + >(); +}); diff --git a/type-definitions/ts-tests/ordered-set.ts b/type-definitions/ts-tests/ordered-set.ts new file mode 100644 index 0000000000..b753c09a53 --- /dev/null +++ b/type-definitions/ts-tests/ordered-set.ts @@ -0,0 +1,278 @@ +import { expect, pick, test } from 'tstyche'; +import { Collection, OrderedSet, Map } from 'immutable'; + +test('#constructor', () => { + expect(OrderedSet()).type.toBe>(); + + expect(OrderedSet()).type.toBe>(); + + expect(OrderedSet([1, 'a'])).type.toBe>(); + + expect(OrderedSet([1, 'a'])).type.not.toBeAssignableTo(OrderedSet()); +}); + +test('#size', () => { + expect(pick(OrderedSet(), 'size')).type.toBe<{ readonly size: number }>(); +}); + +test('.of', () => { + expect(OrderedSet.of(1, 2, 3)).type.toBe>(); + + expect(OrderedSet.of('a', 1)).type.toRaiseError(); + + expect(OrderedSet.of('a', 1)).type.toBe< + OrderedSet + >(); +}); + +test('.fromKeys', () => { + expect(OrderedSet.fromKeys(Map())).type.toBe< + OrderedSet + >(); + + expect(OrderedSet.fromKeys(Map())).type.toBe< + OrderedSet + >(); + + expect(OrderedSet.fromKeys({ a: 1 })).type.toBe>(); + + expect( + OrderedSet.fromKeys(Map()) + ).type.toRaiseError(); + + expect( + OrderedSet.fromKeys(Map()) + ).type.toBe>(); +}); + +test('#get', () => { + expect(OrderedSet().get(4)).type.toBe(); + + expect(OrderedSet().get(4, 'a')).type.toBe(); + + expect(OrderedSet().get(4, 'a')).type.toRaiseError(); +}); + +test('#delete', () => { + expect(OrderedSet().delete(0)).type.toBe>(); + + expect(OrderedSet().delete('a')).type.toRaiseError(); +}); + +test('#remove', () => { + expect(OrderedSet().remove(0)).type.toBe>(); + + expect(OrderedSet().remove('a')).type.toRaiseError(); +}); + +test('#clear', () => { + expect(OrderedSet().clear()).type.toBe>(); + + expect(OrderedSet().clear(10)).type.toRaiseError(); +}); + +test('#map', () => { + expect( + OrderedSet().map( + (value: number, key: number, iter: OrderedSet) => 1 + ) + ).type.toBe>(); + + expect( + OrderedSet().map( + (value: number, key: number, iter: OrderedSet) => 'a' + ) + ).type.toBe>(); + + expect( + OrderedSet().map( + (value: number, key: number, iter: OrderedSet) => 1 + ) + ).type.toBe>(); + + expect( + OrderedSet().map( + (value: number, key: number, iter: OrderedSet) => 1 + ) + ).type.toRaiseError(); + + expect( + OrderedSet().map( + (value: string, key: number, iter: OrderedSet) => 1 + ) + ).type.toRaiseError(); + + expect( + OrderedSet().map( + (value: number, key: string, iter: OrderedSet) => 1 + ) + ).type.toRaiseError(); + + expect( + OrderedSet().map( + (value: number, key: number, iter: OrderedSet) => 1 + ) + ).type.toRaiseError(); + + expect( + OrderedSet().map( + (value: number, key: number, iter: OrderedSet) => 'a' + ) + ).type.toRaiseError(); +}); + +test('#flatMap', () => { + expect( + OrderedSet().flatMap( + (value: number, key: number, iter: OrderedSet) => [1] + ) + ).type.toBe>(); + + expect( + OrderedSet().flatMap( + (value: number, key: number, iter: OrderedSet) => ['a'] + ) + ).type.toBe>(); + + expect( + OrderedSet().flatMap( + (value: number, key: number, iter: OrderedSet) => [1] + ) + ).type.toBe>(); + + expect( + OrderedSet().flatMap( + (value: number, key: number, iter: OrderedSet) => [1] + ) + ).type.toRaiseError(); + + expect( + OrderedSet().flatMap( + (value: string, key: number, iter: OrderedSet) => [1] + ) + ).type.toRaiseError(); + + expect( + OrderedSet().flatMap( + (value: number, key: string, iter: OrderedSet) => [1] + ) + ).type.toRaiseError(); + + expect( + OrderedSet().flatMap( + (value: number, key: number, iter: OrderedSet) => [1] + ) + ).type.toRaiseError(); + + expect( + OrderedSet().flatMap( + (value: number, key: number, iter: OrderedSet) => ['a'] + ) + ).type.toRaiseError(); +}); + +test('#union', () => { + expect(OrderedSet().union(OrderedSet())).type.toBe< + OrderedSet + >(); + + expect(OrderedSet().union(OrderedSet())).type.toBe< + OrderedSet + >(); + + expect(OrderedSet().union(OrderedSet())).type.toBe< + OrderedSet + >(); + + expect(OrderedSet().union(OrderedSet())).type.toBe< + OrderedSet + >(); +}); + +test('#merge', () => { + expect(OrderedSet().merge(OrderedSet())).type.toBe< + OrderedSet + >(); + + expect(OrderedSet().merge(OrderedSet())).type.toBe< + OrderedSet + >(); + + expect(OrderedSet().merge(OrderedSet())).type.toBe< + OrderedSet + >(); + + expect(OrderedSet().merge(OrderedSet())).type.toBe< + OrderedSet + >(); +}); + +test('#intersect', () => { + expect(OrderedSet().intersect(OrderedSet())).type.toBe< + OrderedSet + >(); + + expect( + OrderedSet().intersect(OrderedSet()) + ).type.toRaiseError(); + + expect( + OrderedSet().intersect(OrderedSet()) + ).type.toBe>(); + + expect( + OrderedSet().intersect(OrderedSet()) + ).type.toBe>(); +}); + +test('#subtract', () => { + expect(OrderedSet().subtract(OrderedSet())).type.toBe< + OrderedSet + >(); + + expect( + OrderedSet().subtract(OrderedSet()) + ).type.toRaiseError(); + + expect( + OrderedSet().subtract(OrderedSet()) + ).type.toBe>(); + + expect( + OrderedSet().subtract(OrderedSet()) + ).type.toBe>(); +}); + +test('#flatten', () => { + expect(OrderedSet().flatten()).type.toBe< + Collection + >(); + + expect(OrderedSet().flatten(10)).type.toBe< + Collection + >(); + + expect(OrderedSet().flatten(false)).type.toBe< + Collection + >(); + + expect(OrderedSet().flatten('a')).type.toRaiseError(); +}); + +test('#withMutations', () => { + expect(OrderedSet().withMutations((mutable) => mutable)).type.toBe< + OrderedSet + >(); + + expect( + OrderedSet().withMutations((mutable: OrderedSet) => mutable) + ).type.toRaiseError(); +}); + +test('#asMutable', () => { + expect(OrderedSet().asMutable()).type.toBe>(); +}); + +test('#asImmutable', () => { + expect(OrderedSet().asImmutable()).type.toBe>(); +}); diff --git a/type-definitions/ts-tests/partition.ts b/type-definitions/ts-tests/partition.ts new file mode 100644 index 0000000000..a9d4871e94 --- /dev/null +++ b/type-definitions/ts-tests/partition.ts @@ -0,0 +1,184 @@ +/* eslint-disable @typescript-eslint/no-unused-expressions */ +import { expect, test } from 'tstyche'; +import { + Collection, + List, + Map, + OrderedMap, + OrderedSet, + Seq, + Set, +} from 'immutable'; + +abstract class A {} +class B extends A {} + +test('Collection', () => { + type Indexed = Collection.Indexed; + type Keyed = Collection.Keyed; + type Set = Collection.Set; + + (c: Collection) => { + expect(c.partition((x) => x % 2)).type.toBe< + [Collection, Collection] + >(); + }; + + (c: Collection) => { + expect(c.partition((x): x is B => x instanceof B)).type.toBe< + [Collection, Collection] + >(); + }; + + (c: Keyed) => { + expect(c.partition((x) => x % 2)).type.toBe< + [Keyed, Keyed] + >(); + }; + + (c: Keyed) => { + expect(c.partition((x): x is B => x instanceof B)).type.toBe< + [Keyed, Keyed] + >(); + }; + + (c: Indexed) => { + expect(c.partition((x) => x % 2)).type.toBe< + [Indexed, Indexed] + >(); + }; + + (c: Indexed) => { + expect(c.partition((x): x is B => x instanceof B)).type.toBe< + [Indexed, Indexed] + >(); + }; + + (c: Set) => { + expect(c.partition((x) => x % 2)).type.toBe<[Set, Set]>(); + }; + + (c: Set) => { + expect(c.partition((x): x is B => x instanceof B)).type.toBe< + [Set, Set] + >(); + }; +}); + +test('Seq', () => { + type Indexed = Seq.Indexed; + type Keyed = Seq.Keyed; + type Set = Seq.Set; + + (c: Seq) => { + expect(c.partition((x) => x % 2)).type.toBe< + [Seq, Seq] + >(); + }; + + (c: Seq) => { + expect(c.partition((x): x is B => x instanceof B)).type.toBe< + [Seq, Seq] + >(); + }; + + (c: Keyed) => { + expect(c.partition((x) => x % 2)).type.toBe< + [Keyed, Keyed] + >(); + }; + + (c: Keyed) => { + expect(c.partition((x): x is B => x instanceof B)).type.toBe< + [Keyed, Keyed] + >(); + }; + + (c: Indexed) => { + expect(c.partition((x) => x % 2)).type.toBe< + [Indexed, Indexed] + >(); + }; + + (c: Indexed) => { + expect(c.partition((x): x is B => x instanceof B)).type.toBe< + [Indexed, Indexed] + >(); + }; + + (c: Set) => { + expect(c.partition((x) => x % 2)).type.toBe<[Set, Set]>(); + }; + + (c: Set) => { + expect(c.partition((x): x is B => x instanceof B)).type.toBe< + [Set, Set] + >(); + }; +}); + +test('Map', () => { + (c: Map) => { + expect(c.partition((x) => x % 2)).type.toBe< + [Map, Map] + >(); + }; + + (c: Map) => { + expect(c.partition((x): x is B => x instanceof B)).type.toBe< + [Map, Map] + >(); + }; +}); + +test('OrderedMap', () => { + (c: OrderedMap) => { + expect(c.partition((x) => x % 2)).type.toBe< + [OrderedMap, OrderedMap] + >(); + }; + + (c: OrderedMap) => { + expect(c.partition((x): x is B => x instanceof B)).type.toBe< + [OrderedMap, OrderedMap] + >(); + }; +}); + +test('List', () => { + (c: List) => { + expect(c.partition((x) => x % 2)).type.toBe<[List, List]>(); + }; + + (c: List) => { + expect(c.partition((x): x is B => x instanceof B)).type.toBe< + [List, List] + >(); + }; +}); + +test('Set', () => { + (c: Set) => { + expect(c.partition((x) => x % 2)).type.toBe<[Set, Set]>(); + }; + + (c: Set) => { + expect(c.partition((x): x is B => x instanceof B)).type.toBe< + [Set, Set] + >(); + }; +}); + +test('OrderedSet', () => { + (c: OrderedSet) => { + expect(c.partition((x) => x % 2)).type.toBe< + [OrderedSet, OrderedSet] + >(); + }; + + (c: OrderedSet) => { + expect(c.partition((x): x is B => x instanceof B)).type.toBe< + [OrderedSet, OrderedSet] + >(); + }; +}); diff --git a/type-definitions/ts-tests/range.ts b/type-definitions/ts-tests/range.ts new file mode 100644 index 0000000000..79db184113 --- /dev/null +++ b/type-definitions/ts-tests/range.ts @@ -0,0 +1,12 @@ +import { expect, test } from 'tstyche'; +import { Range, Seq } from 'immutable'; + +test('#constructor', () => { + expect(Range(0, 0, 1)).type.toBe>(); + + expect(Range('a', 0, 0)).type.toRaiseError(); + + expect(Range()).type.toRaiseError(); + + expect(Range(1)).type.toRaiseError(); +}); diff --git a/type-definitions/ts-tests/record.ts b/type-definitions/ts-tests/record.ts new file mode 100644 index 0000000000..bb2db4ee3a --- /dev/null +++ b/type-definitions/ts-tests/record.ts @@ -0,0 +1,110 @@ +import { expect, pick, test } from 'tstyche'; +import { List, Map, MapOf, Record, RecordOf, Set } from 'immutable'; + +test('Factory', () => { + const PointXY = Record({ x: 0, y: 0 }); + + expect(PointXY).type.toBe>(); + + expect(PointXY({ x: 'a' })).type.toRaiseError(); + + const pointXY = PointXY(); + + expect(pointXY).type.toBe< + Record<{ x: number; y: number }> & Readonly<{ x: number; y: number }> + >(); + + expect(pick(pointXY, 'x')).type.toBe<{ readonly x: number }>(); + + expect(pick(pointXY, 'y')).type.toBe<{ readonly y: number }>(); + + expect(pointXY.toJS()).type.toBe<{ x: number; y: number }>(); + + class PointClass extends PointXY { + setX(x: number) { + return this.set('x', x); + } + + setY(y: number) { + return this.set('y', y); + } + } + + const point = new PointClass(); + + expect(point).type.toBe(); + + expect(point.x).type.toBe(); + + expect(point.y).type.toBe(); + + expect(point.setX(10)).type.toBe(); + + expect(point.setY(10)).type.toBe(); + + expect(point.toJSON()).type.toBe<{ x: number; y: number }>(); + + expect(point.toJS()).type.toBe<{ x: number; y: number }>(); +}); + +test('.getDescriptiveName', () => { + const PointXY = Record({ x: 0, y: 0 }); + + expect(Record.getDescriptiveName(PointXY())).type.toBe(); + + expect(Record.getDescriptiveName({})).type.toRaiseError(); +}); + +test('Factory', () => { + const WithMap = Record({ + map: Map({ a: 'A' }), + list: List(['a']), + set: Set(['a']), + }); + + const withMap = WithMap(); + + expect(withMap.toJSON()).type.toBe<{ + map: MapOf<{ a: string }>; + list: List; + set: Set; + }>(); + + // should be `{ map: { a: string; }; list: string[]; set: string[]; }` but there is an issue with circular references + expect(withMap.toJS()).type.toBe<{ + map: unknown; + list: unknown; + set: unknown; + }>(); +}); + +test('optional properties', () => { + interface Size { + distance: string; + } + + const Line = Record<{ size?: Size; color?: string }>({ + size: undefined, + color: 'red', + }); + + const line = Line({}); + + // should be { size?: { distance: string; } | undefined; color?: string | undefined; } but there is an issue with circular references + expect(line.toJS()).type.toBe<{ + size?: unknown; + color?: string | undefined; + }>(); +}); + +test('similar properties, but one is optional', () => { + // see https://github.com/immutable-js/immutable-js/issues/1930 + + interface Id { + value: string; + } + + expect>().type.toBeAssignableWith< + RecordOf<{ id: Id }> + >(); +}); diff --git a/type-definitions/ts-tests/repeat.ts b/type-definitions/ts-tests/repeat.ts new file mode 100644 index 0000000000..9506b753f1 --- /dev/null +++ b/type-definitions/ts-tests/repeat.ts @@ -0,0 +1,10 @@ +import { expect, test } from 'tstyche'; +import { Repeat, Seq } from 'immutable'; + +test('#constructor', () => { + expect(Repeat(0, 0)).type.toBe>(); + + expect(Repeat('a', 0)).type.toBe>(); + + expect(Repeat('a', 'b')).type.toRaiseError(); +}); diff --git a/type-definitions/ts-tests/seq.ts b/type-definitions/ts-tests/seq.ts new file mode 100644 index 0000000000..d967acaade --- /dev/null +++ b/type-definitions/ts-tests/seq.ts @@ -0,0 +1,26 @@ +import { expect, pick, test } from 'tstyche'; +import { Seq } from 'immutable'; + +test('#constructor', () => { + expect(Seq([1, 2, 3])).type.toBe>(); +}); + +test('#size', () => { + expect(pick(Seq(), 'size')).type.toBe<{ + readonly size: number | undefined; + }>(); +}); + +test('Set.Indexed concat', () => { + const s: Seq.Indexed = Seq([1]); + expect(s).type.toBe>(); + expect(s.concat([4, 5, 6])).type.toBe>(); + expect(s.concat(Seq([4, 5, 6]))).type.toBe>(); +}); + +test('Set concat', () => { + const s: Seq = Seq([1]); + expect(s).type.toBe>(); + expect(s.concat([4, 5, 6])).type.toBe>(); + expect(s.concat(Seq([4, 5, 6]))).type.toBe>(); +}); diff --git a/type-definitions/ts-tests/set.ts b/type-definitions/ts-tests/set.ts new file mode 100644 index 0000000000..9149417986 --- /dev/null +++ b/type-definitions/ts-tests/set.ts @@ -0,0 +1,274 @@ +import { expect, pick, test } from 'tstyche'; +import { Set, Map, Collection, OrderedSet } from 'immutable'; + +test('#constructor', () => { + expect(Set()).type.toBe>(); + + expect(Set()).type.toBe>(); + + expect(Set([1, 'a'])).type.toBe>(); + + expect>().type.not.toBeAssignableWith(Set([1, 'a'])); +}); + +test('#size', () => { + expect(pick(Set(), 'size')).type.toBe<{ readonly size: number }>(); +}); + +test('.of', () => { + expect(Set.of(1, 2, 3)).type.toBe>(); + + expect(Set.of('a', 1)).type.toRaiseError(); + + expect(Set.of('a', 1)).type.toBe>(); +}); + +test('.fromKeys', () => { + expect(Set.fromKeys(Map())).type.toBe>(); + + expect(Set.fromKeys(Map())).type.toBe>(); + + expect(Set.fromKeys({ a: 1 })).type.toBe>(); + + expect(Set.fromKeys(Map())).type.toRaiseError(); + + expect( + Set.fromKeys(Map()) + ).type.toBe>(); +}); + +test('#get', () => { + expect(Set().get(4)).type.toBe(); + + expect(Set().get(4, 'a')).type.toBe(); + + expect(Set().get(4, 'a')).type.toRaiseError(); +}); + +test('#delete', () => { + expect(Set().delete(0)).type.toBe>(); + + expect(Set().delete('a')).type.toRaiseError(); +}); + +test('#remove', () => { + expect(Set().remove(0)).type.toBe>(); + + expect(Set().remove('a')).type.toRaiseError(); +}); + +test('#clear', () => { + expect(Set().clear()).type.toBe>(); + + expect(Set().clear(10)).type.toRaiseError(); +}); + +test('#map', () => { + expect( + Set().map((value: number, key: number, iter: Set) => 1) + ).type.toBe>(); + + expect( + Set().map((value: number, key: number, iter: Set) => 'a') + ).type.toBe>(); + + expect( + Set().map( + (value: number, key: number, iter: Set) => 1 + ) + ).type.toBe>(); + + expect( + Set().map( + (value: number, key: number, iter: Set) => 1 + ) + ).type.toRaiseError(); + + expect( + Set().map( + (value: string, key: number, iter: Set) => 1 + ) + ).type.toRaiseError(); + + expect( + Set().map( + (value: number, key: string, iter: Set) => 1 + ) + ).type.toRaiseError(); + + expect( + Set().map( + (value: number, key: number, iter: Set) => 1 + ) + ).type.toRaiseError(); + + expect( + Set().map( + (value: number, key: number, iter: Set) => 'a' + ) + ).type.toRaiseError(); +}); + +test('#flatMap', () => { + expect( + Set().flatMap((value: number, key: number, iter: Set) => [ + 1, + ]) + ).type.toBe>(); + + expect( + Set().flatMap((value: number, key: number, iter: Set) => [ + 'a', + ]) + ).type.toBe>(); + + expect( + Set().flatMap( + (value: number, key: number, iter: Set) => [1] + ) + ).type.toBe>(); + + expect( + Set().flatMap( + (value: number, key: number, iter: Set) => [1] + ) + ).type.toRaiseError(); + + expect( + Set().flatMap( + (value: string, key: number, iter: Set) => [1] + ) + ).type.toRaiseError(); + + expect( + Set().flatMap( + (value: number, key: string, iter: Set) => [1] + ) + ).type.toRaiseError(); + + expect( + Set().flatMap( + (value: number, key: number, iter: Set) => [1] + ) + ).type.toRaiseError(); + + expect( + Set().flatMap( + (value: number, key: number, iter: Set) => ['a'] + ) + ).type.toRaiseError(); +}); + +test('#union', () => { + expect(Set().union(Set())).type.toBe>(); + + expect(Set().union(Set())).type.toBe>(); + + expect(Set().union(Set())).type.toBe< + Set + >(); + + expect(Set().union(Set())).type.toBe< + Set + >(); +}); + +test('#merge', () => { + expect(Set().merge(Set())).type.toBe>(); + + expect(Set().merge(Set())).type.toBe>(); + + expect(Set().merge(Set())).type.toBe< + Set + >(); + + expect(Set().merge(Set())).type.toBe< + Set + >(); +}); + +test('#intersect', () => { + expect(Set().intersect(Set())).type.toBe>(); + + expect(Set().intersect(Set())).type.toRaiseError(); + + expect(Set().intersect(Set())).type.toBe< + Set + >(); + + expect(Set().intersect(Set())).type.toBe< + Set + >(); +}); + +test('#subtract', () => { + expect(Set().subtract(Set())).type.toBe>(); + + expect(Set().subtract(Set())).type.toRaiseError(); + + expect(Set().subtract(Set())).type.toBe< + Set + >(); + + expect(Set().subtract(Set())).type.toBe< + Set + >(); +}); + +test('#flatten', () => { + expect(Set().flatten()).type.toBe>(); + + expect(Set().flatten(10)).type.toBe>(); + + expect(Set().flatten(false)).type.toBe< + Collection + >(); + + expect(Set().flatten('a')).type.toRaiseError(); +}); + +test('#sort', () => { + expect(Set().sort()).type.toBe & OrderedSet>(); + expect(Set().sort((a, b) => 1)).type.toBe< + Set & OrderedSet + >(); +}); + +test('#sortBy', () => { + expect(Set().sortBy((v) => v)).type.toBe< + Set & OrderedSet + >(); + + expect( + Set().sortBy( + (v) => v, + (a, b) => 1 + ) + ).type.toBe & OrderedSet>(); +}); + +test('#withMutations', () => { + expect(Set().withMutations((mutable) => mutable)).type.toBe< + Set + >(); + + expect( + Set().withMutations((mutable: Set) => mutable) + ).type.toRaiseError(); +}); + +test('#asMutable', () => { + expect(Set().asMutable()).type.toBe>(); +}); + +test('#asImmutable', () => { + expect(Set().asImmutable()).type.toBe>(); +}); + +test('#toJS', () => { + expect(Set>().toJS()).type.toBe(); +}); + +test('#toJSON', () => { + expect(Set>().toJSON()).type.toBe[]>(); +}); diff --git a/type-definitions/ts-tests/stack.ts b/type-definitions/ts-tests/stack.ts new file mode 100644 index 0000000000..d261b1152a --- /dev/null +++ b/type-definitions/ts-tests/stack.ts @@ -0,0 +1,226 @@ +import { expect, pick, test } from 'tstyche'; +import { Collection, Stack } from 'immutable'; + +test('#constructor', () => { + expect(Stack()).type.toBe>(); + + expect(Stack()).type.toBe>(); + + expect(Stack([1, 'a'])).type.toBe>(); +}); + +test('#size', () => { + expect(pick(Stack(), 'size')).type.toBe<{ readonly size: number }>(); +}); + +test('.of', () => { + expect(Stack.of(1, 2, 3)).type.toBe>(); + + expect(Stack.of('a', 1)).type.toRaiseError(); + + expect(Stack.of('a', 1)).type.toBe>(); +}); + +test('#peek', () => { + expect(Stack().peek()).type.toBe(); +}); + +test('#push', () => { + expect(Stack().push(0)).type.toBe>(); + + expect(Stack().push('a')).type.toRaiseError(); + + expect(Stack().push(0)).type.toBe>(); + + expect(Stack().push('a')).type.toBe< + Stack + >(); +}); + +test('#pushAll', () => { + expect(Stack().pushAll([0])).type.toBe>(); + + expect(Stack().pushAll(['a'])).type.toRaiseError(); + + expect(Stack().pushAll([0])).type.toBe< + Stack + >(); + + expect(Stack().pushAll(['a'])).type.toBe< + Stack + >(); +}); + +test('#unshift', () => { + expect(Stack().unshift(0)).type.toBe>(); + + expect(Stack().unshift('a')).type.toRaiseError(); + + expect(Stack().unshift(0)).type.toBe< + Stack + >(); + + expect(Stack().unshift('a')).type.toBe< + Stack + >(); +}); + +test('#unshiftAll', () => { + expect(Stack().unshiftAll([0])).type.toBe>(); + + expect(Stack().unshiftAll(['a'])).type.toRaiseError(); + + expect(Stack().unshiftAll([1])).type.toBe< + Stack + >(); + + expect(Stack().unshiftAll(['a'])).type.toBe< + Stack + >(); +}); + +test('#clear', () => { + expect(Stack().clear()).type.toBe>(); + + expect(Stack().clear(10)).type.toRaiseError(); +}); + +test('#pop', () => { + expect(Stack().pop()).type.toBe>(); + + expect(Stack().pop(10)).type.toRaiseError(); +}); + +test('#shift', () => { + expect(Stack().shift()).type.toBe>(); + + expect(Stack().shift(10)).type.toRaiseError(); +}); + +test('#map', () => { + expect( + Stack().map((value: number, key: number, iter: Stack) => 1) + ).type.toBe>(); + + expect( + Stack().map( + (value: number, key: number, iter: Stack) => 'a' + ) + ).type.toBe>(); + + expect( + Stack().map( + (value: number, key: number, iter: Stack) => 1 + ) + ).type.toBe>(); + + expect( + Stack().map( + (value: number, key: number, iter: Stack) => 1 + ) + ).type.toRaiseError(); + + expect( + Stack().map( + (value: string, key: number, iter: Stack) => 1 + ) + ).type.toRaiseError(); + + expect( + Stack().map( + (value: number, key: string, iter: Stack) => 1 + ) + ).type.toRaiseError(); + + expect( + Stack().map( + (value: number, key: number, iter: Stack) => 1 + ) + ).type.toRaiseError(); + + expect( + Stack().map( + (value: number, key: number, iter: Stack) => 'a' + ) + ).type.toRaiseError(); +}); + +test('#flatMap', () => { + expect( + Stack().flatMap( + (value: number, key: number, iter: Stack) => [1] + ) + ).type.toBe>(); + + expect( + Stack().flatMap( + (value: number, key: number, iter: Stack) => 'a' + ) + ).type.toBe>(); + + expect( + Stack().flatMap( + (value: number, key: number, iter: Stack) => [1] + ) + ).type.toBe>(); + + expect( + Stack().flatMap( + (value: number, key: number, iter: Stack) => 1 + ) + ).type.toRaiseError(); + + expect( + Stack().flatMap( + (value: string, key: number, iter: Stack) => 1 + ) + ).type.toRaiseError(); + + expect( + Stack().flatMap( + (value: number, key: string, iter: Stack) => 1 + ) + ).type.toRaiseError(); + + expect( + Stack().flatMap( + (value: number, key: number, iter: Stack) => 1 + ) + ).type.toRaiseError(); + + expect( + Stack().flatMap( + (value: number, key: number, iter: Stack) => 'a' + ) + ).type.toRaiseError(); +}); + +test('#flatten', () => { + expect(Stack().flatten()).type.toBe>(); + + expect(Stack().flatten(10)).type.toBe>(); + + expect(Stack().flatten(false)).type.toBe< + Collection + >(); + + expect(Stack().flatten('a')).type.toRaiseError(); +}); + +test('#withMutations', () => { + expect(Stack().withMutations((mutable) => mutable)).type.toBe< + Stack + >(); + + expect( + Stack().withMutations((mutable: Stack) => mutable) + ).type.toRaiseError(); +}); + +test('#asMutable', () => { + expect(Stack().asMutable()).type.toBe>(); +}); + +test('#asImmutable', () => { + expect(Stack().asImmutable()).type.toBe>(); +}); diff --git a/type-definitions/ts-tests/tsconfig.json b/type-definitions/ts-tests/tsconfig.json new file mode 100644 index 0000000000..12fa9cfb76 --- /dev/null +++ b/type-definitions/ts-tests/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "target": "es2015", + "module": "commonjs", + "sourceMap": true, + "strict": true, + "types": [], + "noEmit": true, + "lib": ["es2015"], + "baseUrl": "./", + "paths": { + "immutable": ["../immutable.d.ts"] + } + }, + "exclude": ["node_modules"] +} diff --git a/type-definitions/tsconfig.json b/type-definitions/tsconfig.json new file mode 100644 index 0000000000..18735e2da8 --- /dev/null +++ b/type-definitions/tsconfig.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "target": "es2015", + "module": "commonjs", + "sourceMap": true, + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "lib": ["es2015"], + "types": [] + }, + "files": ["immutable.d.ts"] +} diff --git a/website/.eslintrc b/website/.eslintrc new file mode 100644 index 0000000000..97a2bb84ef --- /dev/null +++ b/website/.eslintrc @@ -0,0 +1,3 @@ +{ + "extends": ["next", "next/core-web-vitals"] +} diff --git a/website/next-env.d.ts b/website/next-env.d.ts new file mode 100644 index 0000000000..1b3be0840f --- /dev/null +++ b/website/next-env.d.ts @@ -0,0 +1,5 @@ +/// +/// + +// NOTE: This file should not be edited +// see https://nextjs.org/docs/app/api-reference/config/typescript for more information. diff --git a/website/next-sitemap.config.js b/website/next-sitemap.config.js new file mode 100644 index 0000000000..e4cc9ee5dd --- /dev/null +++ b/website/next-sitemap.config.js @@ -0,0 +1,16 @@ +// eslint-disable-next-line @typescript-eslint/no-require-imports, no-undef +const { getVersions } = require('./src/static/getVersions'); + +/** @type {import('next-sitemap').IConfig} */ +// eslint-disable-next-line no-undef +module.exports = { + siteUrl: 'https://immutable-js.com', + generateRobotsTxt: true, + outDir: './out', + exclude: [ + '/docs', + ...getVersions() + .slice(1) + .map((version) => `/docs/${version}/*`), + ], +}; diff --git a/website/next.config.js b/website/next.config.js new file mode 100644 index 0000000000..61576f7219 --- /dev/null +++ b/website/next.config.js @@ -0,0 +1,6 @@ +// eslint-disable-next-line no-undef +module.exports = { + reactStrictMode: true, + trailingSlash: true, + output: 'export', +}; diff --git a/website/public/Immutable-Data-and-React-YouTube.png b/website/public/Immutable-Data-and-React-YouTube.png new file mode 100644 index 0000000000..fd5354bd80 Binary files /dev/null and b/website/public/Immutable-Data-and-React-YouTube.png differ diff --git a/pages/src/static/favicon.png b/website/public/favicon.png similarity index 100% rename from pages/src/static/favicon.png rename to website/public/favicon.png diff --git a/website/src/ArrowDown.tsx b/website/src/ArrowDown.tsx new file mode 100644 index 0000000000..662f63466c --- /dev/null +++ b/website/src/ArrowDown.tsx @@ -0,0 +1,31 @@ +import type { JSX } from 'react'; + +export function ArrowDown({ isActive }: { isActive: boolean }): JSX.Element { + return ( + + + + + + ); +} diff --git a/website/src/Defs.tsx b/website/src/Defs.tsx new file mode 100644 index 0000000000..a8a464643d --- /dev/null +++ b/website/src/Defs.tsx @@ -0,0 +1,428 @@ +import type { FocusEvent, JSX, MouseEvent, ReactNode } from 'react'; +import { Fragment, useCallback, useState } from 'react'; +import Link from 'next/link'; +import { + TypeKind, + Type, + InterfaceDefinition, + ObjectMember, + CallSignature, + CallParam, +} from './TypeDefs'; + +export function InterfaceDef({ + name, + def, +}: { + name: string; + def: InterfaceDefinition; +}) { + return ( + + type + {name} + {def.typeParams && ( + <> + {'<'} + {interpose( + ', ', + def.typeParams.map((t, i) => ( + + {t} + + )) + )} + {'>'} + + )} + {def.extends && ( + <> + extends + {interpose( + ', ', + def.extends.map((e, i) => ) + )} + + )} + {def.implements && ( + <> + implements + {interpose( + ', ', + def.implements.map((e, i) => ) + )} + + )} + + ); +} + +export function CallSigDef({ + name, + callSig, +}: { + name: string; + callSig?: CallSignature; +}) { + const shouldWrap = callSigLength(name, callSig) > 80; + + return ( + + {name} + {callSig?.typeParams && ( + <> + {'<'} + {interpose( + ', ', + callSig.typeParams.map((t, i) => ( + + {t} + + )) + )} + {'>'} + + )} + {'('} + {callSig && functionParams(callSig.params, shouldWrap)} + {')'} + {callSig?.type && ( + <> + {': '} + + + )} + + ); +} + +export function TypeDef({ type, prefix }: { type: Type; prefix?: number }) { + switch (type.k) { + case TypeKind.Never: + return wrap('primitive', 'never'); + case TypeKind.Any: + return wrap('primitive', 'any'); + case TypeKind.Unknown: + return wrap('primitive', 'unknown'); + case TypeKind.This: + return wrap('primitive', 'this'); + case TypeKind.Undefined: + return wrap('primitive', 'undefined'); + case TypeKind.Boolean: + return wrap('primitive', 'boolean'); + case TypeKind.Number: + return wrap('primitive', 'number'); + case TypeKind.String: + return wrap('primitive', 'string'); + case TypeKind.Union: + return wrap( + 'union', + interpose( + ' | ', + type.types.map((t, i) => ) + ) + ); + case TypeKind.Intersection: + return wrap( + 'intersection', + interpose( + ' & ', + type.types.map((t, i) => ) + ) + ); + case TypeKind.Tuple: + return wrap( + 'tuple', + <> + {'['} + {interpose( + ', ', + type.types.map((t, i) => ) + )} + {']'} + + ); + case TypeKind.Object: + if (!type.members) { + return wrap('primitive', 'object'); + } + return wrap( + 'object', + <> + {'{'} + {interpose( + ', ', + type.members.map((t, i) => ) + )} + {'}'} + + ); + case TypeKind.Indexed: + return wrap( + 'indexed', + <> + ,{'['} + + {']'} + + ); + case TypeKind.Operator: + return wrap( + 'operator', + <> + {wrap('primitive', type.operator)} + + ); + case TypeKind.Array: + return wrap( + 'array', + <> + + {'[]'} + + ); + case TypeKind.Function: { + const shouldWrap = (prefix || 0) + funcLength(type) > 78; + return wrap( + 'function', + <> + {type.typeParams && ( + <> + {'<'} + {interpose( + ', ', + type.typeParams.map((t, i) => ( + + {t} + + )) + )} + {'>'} + + )} + {'('} + {functionParams(type.params, shouldWrap)} + {') => '} + + + ); + } + case TypeKind.Param: + return wrap('typeParam', type.param); + case TypeKind.Type: { + return wrap( + 'type', + <> + {type.url ? ( + + {type.name} + + ) : ( + {type.name} + )} + {type.args && ( + <> + {'<'} + {interpose( + ', ', + type.args.map((a, i) => ) + )} + {'>'} + + )} + + ); + } + } + throw new Error('Type with unknown kind ' + JSON.stringify(type)); +} + +function wrap(className: string, child: ReactNode) { + return {child}; +} + +function Hover({ + className, + children, +}: { + className?: string; + children: ReactNode; +}) { + const [isOver, setIsOver] = useState(false); + const mouseOver = useCallback( + (event: MouseEvent | FocusEvent) => { + event.stopPropagation(); + setIsOver(true); + }, + [setIsOver] + ); + const mouseOut = useCallback(() => { + setIsOver(false); + }, [setIsOver]); + return ( + + {children} + + ); +} + +export function MemberDef({ member }: { member: ObjectMember }) { + return ( + + {member.index ? ( + <>[{functionParams(member.params, false)}] + ) : ( + {member.name} + )} + {member.type && ( + <> + : + + )} + + ); +} + +function functionParams( + params: Array | undefined, + shouldWrap: boolean +) { + const elements = interpose( + shouldWrap ? ( + <> + {','} +
+ + ) : ( + ', ' + ), + (params ?? []).map((t, i) => ( + + {t.varArgs ? '...' : null} + {t.name} + {t.optional ? '?: ' : ': '} + + + )) + ); + + return shouldWrap ? ( +
{elements}
+ ) : ( + elements + ); +} + +function callSigLength(name: string, sig?: CallSignature): number { + return name.length + (sig ? funcLength(sig) : 2); +} + +function funcLength(sig: CallSignature): number { + return ( + (sig.typeParams ? 2 + sig.typeParams.join(', ').length : 0) + + 2 + + (sig.params ? paramLength(sig.params) : 0) + + (sig.type ? 2 + typeLength(sig.type) : 0) + ); +} + +function paramLength(params: Array): number { + return params.reduce( + (s, p) => + s + + (p.varArgs ? 3 : 0) + + p.name.length + + (p.optional ? 3 : 2) + + typeLength(p.type), + (params.length - 1) * 2 + ); +} + +function memberLength(members: Array): number { + return members.reduce( + (s, m) => + s + + (m.index ? paramLength(m.params || []) + 2 : m.name!.length) + + (m.type ? typeLength(m.type) + 2 : 0), + (members.length - 1) * 2 + ); +} + +function typeLength(type: Type): number { + if (!type) { + throw new Error('Expected type'); + } + switch (type.k) { + case TypeKind.Never: + return 5; + case TypeKind.Any: + return 3; + case TypeKind.Unknown: + return 7; + case TypeKind.This: + return 4; + case TypeKind.Undefined: + return 9; + case TypeKind.Boolean: + return 7; + case TypeKind.Number: + return 6; + case TypeKind.String: + return 6; + case TypeKind.Union: + case TypeKind.Intersection: + return ( + type.types.reduce((s, t) => s + typeLength(t), 0) + + (type.types.length - 1) * 3 + ); + case TypeKind.Tuple: + return ( + 2 + + type.types.reduce((s, t) => s + typeLength(t), 0) + + (type.types.length - 1) * 2 + ); + case TypeKind.Object: + return type.members ? 2 + memberLength(type.members) : 6; + case TypeKind.Indexed: + return 2 + typeLength(type.type) + typeLength(type.index); + case TypeKind.Operator: + return 1 + type.operator.length + typeLength(type.type); + case TypeKind.Array: + return typeLength(type.type) + 2; + case TypeKind.Function: + return 2 + funcLength(type); + case TypeKind.Param: + return type.param.length; + case TypeKind.Type: + return ( + type.name.length + + (!type.args + ? 0 + : type.args.reduce((s, a) => s + typeLength(a), type.args.length * 2)) + ); + } + throw new Error('Type with unknown kind ' + JSON.stringify(type)); +} + +function interpose( + between: ReactNode, + array: Array +): Array { + const result: Array = []; + let i = 0; + for (const value of array) { + result.push(value, {between}); + } + result.pop(); + + return result; +} diff --git a/website/src/DocHeader.tsx b/website/src/DocHeader.tsx new file mode 100644 index 0000000000..b57499a864 --- /dev/null +++ b/website/src/DocHeader.tsx @@ -0,0 +1,20 @@ +import { HeaderLinks, HeaderLogoLink } from './Header'; + +export function DocHeader({ + versions, + currentVersion, +}: { + versions: Array; + currentVersion?: string; +}) { + return ( +
+
+
+ + +
+
+
+ ); +} diff --git a/website/src/DocOverview.tsx b/website/src/DocOverview.tsx new file mode 100644 index 0000000000..71a62ce155 --- /dev/null +++ b/website/src/DocOverview.tsx @@ -0,0 +1,57 @@ +import Link from 'next/link'; +import { MarkdownContent } from './MarkdownContent'; +import type { TypeDefs, TypeDoc } from './TypeDefs'; + +export type OverviewData = { + doc: TypeDoc | null; + api: Array; +}; + +type APIMember = { + label: string; + url: string; + synopsis?: string; +}; + +// Static use only +export function getOverviewData(defs: TypeDefs): OverviewData { + return { + doc: defs.doc || null, + api: Object.values(defs.types).map((def) => { + const member: APIMember = { label: def.label, url: def.url }; + const doc = def.doc || def.call?.doc; + if (doc?.synopsis) { + member.synopsis = doc?.synopsis; + } + return member; + }), + }; +} + +export function DocOverview({ data }: { data: OverviewData }) { + return ( +
+ {data.doc && ( +
+ + {data.doc.description && ( + + )} +
+ )} + +

API

+ + {data.api.map((member) => ( +
+

+ {member.label} +

+ {member.synopsis && ( + + )} +
+ ))} +
+ ); +} diff --git a/website/src/DocSearch.tsx b/website/src/DocSearch.tsx new file mode 100644 index 0000000000..82e07cf313 --- /dev/null +++ b/website/src/DocSearch.tsx @@ -0,0 +1,53 @@ +'use client'; + +import { useEffect, useState } from 'react'; + +export function DocSearch() { + const [enabled, setEnabled] = useState(null); + + useEffect(() => { + const script = document.createElement('script'); + const firstScript = document.getElementsByTagName('script')[0]; + script.src = + 'https://cdn.jsdelivr.net/npm/docsearch.js@2.5.2/dist/cdn/docsearch.min.js'; + script.addEventListener( + 'load', + () => { + // Initialize Algolia search. + // @ts-expect-error -- algolia is set on windows, need proper type + if (window.docsearch) { + // @ts-expect-error -- algolia is set on windows, need proper type + window.docsearch({ + apiKey: '83f61f865ef4cb682e0432410c2f7809', + indexName: 'immutable_js', + inputSelector: '#algolia-docsearch', + }); + setEnabled(true); + } else { + setEnabled(false); + } + }, + false + ); + firstScript?.parentNode?.insertBefore(script, firstScript); + + const link = document.createElement('link'); + const firstLink = document.getElementsByTagName('link')[0]; + link.rel = 'stylesheet'; + link.href = + 'https://cdn.jsdelivr.net/npm/docsearch.js@2.5.2/dist/cdn/docsearch.min.css'; + firstLink?.parentNode?.insertBefore(link, firstLink); + }, []); + + if (enabled === false) return null; + + return ( + + ); +} diff --git a/website/src/Header.tsx b/website/src/Header.tsx new file mode 100644 index 0000000000..b8e8b67d9e --- /dev/null +++ b/website/src/Header.tsx @@ -0,0 +1,198 @@ +'use client'; + +import { useState, useEffect } from 'react'; +import Link from 'next/link'; + +import { SVGSet } from './SVGSet'; +import { Logo } from './Logo'; +import { StarBtn } from './StarBtn'; +import { isMobile } from './isMobile'; + +export function Header({ + versions, + currentVersion, +}: { + versions: Array; + currentVersion?: string; +}) { + const [scroll, setScroll] = useState(0); + + useEffect(() => { + let _pending = false; + function handleScroll() { + if (!_pending) { + const headerHeight = Math.min( + 800, + Math.max(260, document.documentElement.clientHeight * 0.7) + ); + if (window.scrollY < headerHeight) { + _pending = true; + window.requestAnimationFrame(() => { + _pending = false; + setScroll(window.scrollY); + }); + } + } + } + + window.addEventListener('scroll', handleScroll); + return () => { + window.removeEventListener('scroll', handleScroll); + }; + }, []); + + const neg = scroll < 0; + const s = neg ? 0 : scroll; + const sp = isMobile() ? 35 : 70; + + return ( +
+
+
+ + +
+
+
+
+
+
+
+ +
+
+
+
+ {[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0].map((_, i) => ( + + + + + ))} + + + + +
+
+
+ +
+
+
+
+
+ ); +} + +export function HeaderLogoLink() { + return ( + + + + + + + ); +} + +export function HeaderLinks({ + versions, + currentVersion, +}: { + versions: Array; + currentVersion?: string; +}) { + return ( +
+ ); +} + +function DocsDropdown({ + versions, + currentVersion, +}: { + versions: Array; + currentVersion?: string; +}) { + return ( +
+ +
+ + Docs{currentVersion && ` (${currentVersion})`} + +
+
    + {versions.map((v) => ( +
  • + {v} +
  • + ))} +
+
+ ); +} + +function ty(s: number, p: number) { + return (p < s ? p : s) * -0.55; +} + +function o(s: number, p: number) { + return Math.max(0, s > p ? 1 - (s - p) / 350 : 1); +} + +function tz(s: number, p: number) { + return Math.max(0, s > p ? 1 - (s - p) / 20000 : 1); +} + +function t(y: number, z: number) { + return { transform: 'translate3d(0, ' + y + 'px, 0) scale(' + z + ')' }; +} diff --git a/website/src/ImmutableConsole.tsx b/website/src/ImmutableConsole.tsx new file mode 100644 index 0000000000..4875a22058 --- /dev/null +++ b/website/src/ImmutableConsole.tsx @@ -0,0 +1,69 @@ +'use client'; + +import { useEffect } from 'react'; + +type InstallSpace = { + Immutable?: unknown; + module?: unknown; + exports?: unknown; +}; + +let installingVersion: string | undefined; + +export function ImmutableConsole({ version }: { version: string }) { + useEffect(() => { + const installSpace = global as unknown as InstallSpace; + if (installingVersion === version) { + return; + } + installingVersion = version; + installUMD(installSpace, getSourceURL(version)).then((Immutable) => { + installSpace.Immutable = Immutable; + + console.log( + '\n' + + ' ▄▟████▙▄ _ __ __ __ __ _ _ _______ ____ _ _____ \n' + + ' ▟██████████▙ | | | \\ / | \\ / | | | |__ __|/\\ | _ \\| | | ___|\n' + + '██████████████ | | | \\/ | \\/ | | | | | | / \\ | |_) | | | |__ \n' + + '██████████████ | | | |\\ /| | |\\ /| | | | | | | / /\\ \\ | _ <| | | __| \n' + + ' ▜██████████▛ | | | | \\/ | | | \\/ | | |__| | | |/ ____ \\| |_) | |___| |___ \n' + + ' ▀▜████▛▀ |_| |_| |_|_| |_|\\____/ |_/_/ \\_\\____/|_____|_____|\n' + + '\n' + + `Version: ${version}\n` + + '> console.log(Immutable);' + ); + console.log(Immutable); + }); + }, [version]); + return null; +} + +function getSourceURL(version: string) { + if (version === 'latest@main') { + return `https://cdn.jsdelivr.net/gh/immutable-js/immutable-js@npm/dist/immutable.js`; + } + const semver = version[0] === 'v' ? version.slice(1) : version; + return `https://cdn.jsdelivr.net/npm/immutable@${semver}/dist/immutable.js`; +} + +function installUMD(installSpace: InstallSpace, src: string): Promise { + return new Promise((resolve) => { + const installedModule = (installSpace.module = { + exports: (installSpace.exports = {}), + }); + const script = document.createElement('script'); + const firstScript = document.getElementsByTagName('script')[0]; + script.src = src; + script.addEventListener( + 'load', + () => { + installSpace.module = undefined; + installSpace.exports = undefined; + script.remove(); + resolve(installedModule.exports); + }, + false + ); + firstScript?.parentNode?.insertBefore(script, firstScript); + }); +} diff --git a/website/src/Logo.tsx b/website/src/Logo.tsx new file mode 100644 index 0000000000..b9c0bb5e7c --- /dev/null +++ b/website/src/Logo.tsx @@ -0,0 +1,74 @@ +type Props = { + opacity?: number; + inline?: boolean; + color: string; +}; + +export function Logo({ opacity = 1, inline, color }: Props) { + return !inline ? ( + + + + + + + + + + + + ) : ( + + + + + + + + + + + + ); +} diff --git a/website/src/MarkdownContent.tsx b/website/src/MarkdownContent.tsx new file mode 100644 index 0000000000..7f90fca400 --- /dev/null +++ b/website/src/MarkdownContent.tsx @@ -0,0 +1,33 @@ +'use client'; + +import { memo, MouseEvent } from 'react'; +import { useRouter } from 'next/navigation'; + +type Props = { + contents: string; + className?: string; +}; + +// eslint-disable-next-line prefer-arrow-callback +export const MarkdownContent = memo(function MarkdownContent({ + contents, + className, +}) { + const router = useRouter(); + + const handleClick = (event: MouseEvent) => { + const link = event.target as HTMLAnchorElement; + if (link.tagName === 'A' && link.target !== '_blank') { + event.preventDefault(); + router.push(link.href); + } + }; + + return ( +
+ ); +}); diff --git a/website/src/MemberDoc.tsx b/website/src/MemberDoc.tsx new file mode 100644 index 0000000000..7d36ff2c52 --- /dev/null +++ b/website/src/MemberDoc.tsx @@ -0,0 +1,100 @@ +import Link from 'next/link'; +import { Fragment } from 'react'; +import { CallSigDef, MemberDef } from './Defs'; +import { MarkdownContent } from './MarkdownContent'; +import type { MemberDefinition } from './TypeDefs'; + +export function MemberDoc({ member }: { member: MemberDefinition }) { + return ( +
+

+ {member.label} +

+
+ {member.doc && ( + + )} + {!member.signatures ? ( + + + + ) : ( + + {member.signatures.map((callSig, i) => ( + + + {'\n'} + + ))} + + )} + {member.inherited && ( +
+

Inherited from

+ + + {member.inherited.interface}#{member.inherited.label} + + +
+ )} + {member.overrides && ( +
+

Overrides

+ + + {member.overrides.interface}#{member.overrides.label} + + +
+ )} + {member.doc?.notes.map((note, i) => ( +
+

{note.name}

+ {note.name === 'alias' ? ( + + + + ) : ( + + )} +
+ ))} + {member.doc?.description && ( +
+

+ {member.doc.description.slice(0, 5) === ' + +

+ )} +
+
+ ); +} + +// export type ParamTypeMap = { [param: string]: Type }; + +// function getParamTypeMap( +// interfaceDef: InterfaceDefinition | undefined, +// member: MemberDefinition +// ): ParamTypeMap | undefined { +// if (!member.inherited || !interfaceDef?.typeParamsMap) return; +// const defining = member.inherited.split('#')[0] + '>'; +// const paramTypeMap: ParamTypeMap = {}; +// // Filter typeParamsMap down to only those relevant to the defining interface. +// for (const [path, type] of Object.entries(interfaceDef.typeParamsMap)) { +// if (path.startsWith(defining)) { +// paramTypeMap[path.slice(defining.length)] = type; +// } +// } +// return paramTypeMap; +// } diff --git a/website/src/RunkitEmbed.tsx b/website/src/RunkitEmbed.tsx new file mode 100644 index 0000000000..8b394671c1 --- /dev/null +++ b/website/src/RunkitEmbed.tsx @@ -0,0 +1,153 @@ +import Script from 'next/script'; + +export function RunkitEmbed() { + return