Showing preview only (250K chars total). Download the full file or copy to clipboard to get everything.
Repository: inversify/InversifyJS
Branch: master
Commit: fdd9186891e7
Files: 57
Total size: 234.2 KB
Directory structure:
gitextract_m2iu_kne/
├── .github/
│ ├── FUNDING.yml
│ ├── ISSUE_TEMPLATE/
│ │ ├── bug_report.yml
│ │ ├── config.yml
│ │ └── feature_request.yml
│ └── workflows/
│ └── ci.yml
├── .gitignore
├── .npmignore
├── CHANGELOG.md
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── ISSUE_TEMPLATE.md
├── LICENSE
├── PULL_REQUEST_TEMPLATE.md
├── README.md
├── eslint.config.mjs
├── package.json
├── prettier.config.mjs
├── renovate.json
├── rollup.config.mjs
├── scripts/
│ ├── writeCommonJsPackageJson.mjs
│ └── writeEsmPackageJson.mjs
├── src/
│ ├── index.ts
│ └── test/
│ ├── annotation/
│ │ ├── inject.test.ts
│ │ ├── injectable.test.ts
│ │ ├── multi_inject.test.ts
│ │ ├── named.test.ts
│ │ ├── optional.test.ts
│ │ └── post_construct.test.ts
│ ├── bugs/
│ │ ├── bugs.test.ts
│ │ ├── issue_1190.test.ts
│ │ ├── issue_1297.test.ts
│ │ ├── issue_1416.test.ts
│ │ ├── issue_1515.test.ts
│ │ ├── issue_1518.test.ts
│ │ ├── issue_1564.test.ts
│ │ ├── issue_543.test.ts
│ │ ├── issue_549.test.ts
│ │ ├── issue_706.test.ts
│ │ └── issue_928.test.ts
│ ├── container/
│ │ ├── container.test.ts
│ │ └── container_module.test.ts
│ ├── features/
│ │ ├── named_default.test.ts
│ │ ├── property_injection.test.ts
│ │ ├── provider.test.ts
│ │ ├── request_scope.test.ts
│ │ └── transitive_bindings.test.ts
│ ├── inversify.test.ts
│ └── node/
│ ├── error_messages.test.ts
│ ├── exceptions.test.ts
│ ├── performance.test.ts
│ └── proxies.test.ts
├── tsconfig.base.cjs.json
├── tsconfig.base.esm.json
├── tsconfig.base.json
├── tsconfig.cjs.json
├── tsconfig.esm.json
└── tsconfig.json
================================================
FILE CONTENTS
================================================
================================================
FILE: .github/FUNDING.yml
================================================
github: inversify
open_collective: inversifyjs
================================================
FILE: .github/ISSUE_TEMPLATE/bug_report.yml
================================================
name: "\U0001F41B Bug Report"
description: "If something isn't working as expected \U0001F914"
labels: ["needs triage"]
body:
- type: markdown
attributes:
value: |
Please, submit the issue in the [monorepo](https://github.com/inversify/monorepo/issues/new?template=bug.yml)
Please do not create the issue here, it will be closed.
---
- type: checkboxes
id: no-post
attributes:
label: |
Please do not submit this issue.
description: |
:bangbang: This issue will be closed. :bangbang:
options:
- label: I understand
required: true
================================================
FILE: .github/ISSUE_TEMPLATE/config.yml
================================================
blank_issues_enabled: false
================================================
FILE: .github/ISSUE_TEMPLATE/feature_request.yml
================================================
name: "\U0001F680 Community Ideas"
description: "I have an idea or proposal \U0001F4A1!"
labels: ["needs triage"]
assignees:
- "notaphplover"
body:
- type: markdown
attributes:
value: |
## :heart: We would love to hear your ideas and proposals
Please, submit your idea or proposal in the [monorepo](https://github.com/inversify/monorepo/issues/new?template=feature.yml)
Please do not create the issue here, it will be closed.
---
- type: checkboxes
id: no-post
attributes:
label: |
Please do not submit this issue.
description: |
:bangbang: This issue will be closed. :bangbang:
options:
- label: I understand
required: true
================================================
FILE: .github/workflows/ci.yml
================================================
name: Continuous Integration
on:
push:
branches:
- master
pull_request:
jobs:
Testing:
name: Compile source code and run tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [20.x, 22.x]
os: [ubuntu-latest, windows-latest]
ts-project: [tsconfig.json]
exclude:
- node-version: 22.x
os: ubuntu-latest
ts-project: tsconfig.json
env:
TS_NODE_PROJECT: ${{ matrix.ts-project }}
steps:
- name: Checkout Project
uses: actions/checkout@v5
- name: Install Node.js
uses: actions/setup-node@v5
with:
node-version: ${{ matrix.node-version }}
package-manager-cache: false
- uses: pnpm/action-setup@v3
name: Install pnpm
id: pnpm-install
with:
version: 10.17.1
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
shell: bash
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
- name: Compile source code
run: pnpm run build
- name: Run tests
run: pnpm test
Upload_Coverage_Report:
name: Upload coverage report to codecov
environment: CI
env:
TS_NODE_PROJECT: tsconfig.json
needs: [Testing]
runs-on: ubuntu-latest
steps:
- name: Checkout Project
uses: actions/checkout@v5
- name: Install Node.js
uses: actions/setup-node@v5
with:
node-version: 22.20.0
- uses: pnpm/action-setup@v3
name: Install pnpm
id: pnpm-install
with:
version: 10.17.1
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
shell: bash
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
- name: Compile source code
run: pnpm run build
- name: Run linter
run: pnpm run lint
- name: Run tests
run: pnpm test --coverage
- name: Codecov Upload
uses: codecov/codecov-action@v5
with:
directory: coverage/
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
================================================
FILE: .gitignore
================================================
# Logs
logs
*.log
# Runtime data
pids
*.pid
*.seed
# Coverage directory used by tools like istanbul
coverage
# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules
dist
dts
lib
temp
es
type_definitions/inversify/*.js
src/*.js
src/**/*.js
src/*.js.map
src/**/*.js.map
*.d.ts
*.tsbuildinfo
src/annotation/*.d.ts
src/bindings/*.d.ts
src/constants/*.d.ts
src/container/*.d.ts
src/planning/*.d.ts
src/resolution/*.d.ts
src/syntax/*.d.ts
test/*.js
test/**/*.js
test/*.js.map
test/**/*.js.map
src/**/*.js.map
src/*.js.map
type_definitions/**/*.js
.DS_store
.idea
.nyc_output
================================================
FILE: .npmignore
================================================
.github
.gitignore
.nyc_output
.vscode
build
CODE_OF_CONDUCT.md
CONTRIBUTING.md
coverage
eslint.config.mjs
ISSUE_TEMPLATE.md
**/*.ts
!lib/cjs/**/*.d.ts
lib/esm/**/*.d.ts.map
!lib/esm/index.d.ts
!lib/esm/index.d.ts.map
lib/*/test/**
mocha.opts
prettier.config.mjs
PULL_REQUEST_TEMPLATE.md
renovate.json
rollup.config.mjs
scripts
src
temp
tsconfig.json
tsconfig.base.cjs.json
tsconfig.base.esm.json
tsconfig.base.json
tsconfig.cjs.json
tsconfig.cjs.tsbuildinfo
tsconfig.esm.json
wiki
================================================
FILE: CHANGELOG.md
================================================
# Changelog
All notable changes to this project from 5.0.0 forward 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).
## [Unreleased]
### Added
### Changed
## [7.10.0]
### Added
- Added `InjectFromBaseOptionsLifecycle`.
- Added `InjectFromHierarchyOptionsLifecycle`.
### Changed
- Updated `injectFromBase` with `lifecycle` property.
- Updated `injectFromHierarchy` with `lifecycle` property.
## [7.9.1]
### Changed
- Updated `Container` to trigger autobind options on autobound parent container related binding requests.
## [7.9.0]
### Changed
- Updated `decorate` to allow method parameter decoration.
## [7.8.1]
### Changed
- Fixed `injectFromHierarchy` avoiding crash when traversing `Object` metadata.
## [7.8.0]
### Added
- Added `injectFromHierarchy`.
## [7.7.1]
### Changed
- Fixed a bug involving circular dependencies when resolving services in some edge cases.
- Fixed a bug involving circular dependencies when bindings are bound in some edge cases.
## [7.7.1-beta.0]
### Changed
- Fixed a bug causing `Container.bind` and `Container.unbind` to avoid throwing planning errors.
- Fixed a bug causing wrong cached plans involving bindings with ancestor related constraints.
## [7.7.0]
### Added
- Added `Bind` type.
- Added `IsBound` type.
- Added `OnActivation` type.
- Added `OnDeactivation` type.
- Added `Rebind` type.
- Added `RebindSync` type.
- Added `Unbind` type.
- Added `UnbindSync` type.
### Changed
- Updated `BindOnFluentSyntaxImplementation.onDeactivation` to throw an error on non singleton scoped bindings.
- Updated `ServiceResolutionManager` to provide right `getChained` operation after computed properties are reset.
- Updated `Container` to properly manage bindings bindings on child containers after a parent container restores a snapshot.
## [7.6.1]
### Changed
- Updated `getAll` and `getAllAsync` options with missing `chained` property.
## [7.6.0]
### Added
- Added `MultiInjectOptions`.
### Changed
- Updated `multiInject` decorator with optional `MultiInjectOptions`.
- Updated `getAll` and `getAllAsync` options with optional`chained` property.
## [7.5.4]
### Changed
- Updated `ServiceIdentifier` to rely on `Function` again. This solves an issue affecting classes with protected constructors.
## [7.5.3]
### Changed
- Updated `ServiceIdentifier` removing `Function` in favor of a new `AbstractNewable` type. ServiceIdentifier now uses AbstractNewable instead of Function to better represent abstract classes. This provides better type safety and semantics.
## [7.5.2]
### Changed
- Fixed `Container.snapshot` so snapshot bindings are not updated after a snapshot is taken.
- Fixed a memory leak affecting child containers.
## [7.5.1]
### Changed
- Updated `Container.get` like methods to properly set bindings when autobind mode is set:
- `@injectable` scopes properly handled.
- Autobind mode no longer creates duplicated bindings.
## [7.5.0]
### Changed
- Updated `Container` with `unloadSync`.
- Updated `Container` with `loadSync`.
## [7.4.0]
### Changed
- Updated `ContainerModuleLoadOptions` with `rebind`.
- Updated `ContainerModuleLoadOptions` with `rebindSync`.
- Updated `BindToFluentSyntax.toResolvedValue` with additional type constraints.
## [7.3.0]
### Changed
- Updated `Container` with `rebindSync`.
- Updated `Container` with `unbindSync`.
- Updated `Container` with `rebind`.
- Updated `ContainerModuleLoadOptions` with `unbindSync`.
- Updated `ContainerModuleLoadOptions.unbind` to accept `BindingIdentifier`.
## [7.2.0]
### Added
- Added `BindingIdentifier`.
### Changed
- Updated `BindInFluentSyntax` with `getIdentifier`.
- Updated `Container.unbind` to handle `BindingIdentifier`.
- Updated `BindOnFluentSyntax` with `getIdentifier`.
- Updated `BindWhenFluentSyntax` with `getIdentifier`.
## [7.1.0]
### Added
- Added `BindingActivation`.
- Added `BindingDeactivation`.
## [7.0.2]
### Changed
- Updated `container.get` like methods to no longer initialize twice singleton scoped bindings.
## [7.0.1]
### Changed
- Updated `Container.get` like methods to no longer initialize twice singleton scoped bindings.
## [7.0.0]
Parity version with `7.0.0-alpha.5`
## [7.0.0-alpha.5]
### Changed
- Renamed `BindingMetadata` to `BindingConstraints`.
- Improved performance on `Container.get` like methods.
## [7.0.0-alpha.4]
Parity version with `7.0.0-alpha.3`.
## [6.2.2]
- Solved issue with npm registry.
## [7.0.0-alpha.3]
### Changed
- Updated `BindToFluentSyntax` with `.toResolvedValue`.
## [7.0.0-alpha.2]
### Changed
- Updated `Container` with a plan cache. `Container.get`, `Container.getAll`, `Container.getAllAsync` and `Container.getAsync` performance has been improved.
## [7.0.0-alpha.1]
### Changed
- Updated `GetOptions` with `autobind`.
- Updated `ContainerOptions` with `autobind`.
## [7.0.0-alpha.0]
### Added
- Added `BindInFluentSyntax`.
- Added `BindInWhenOnFluentSyntax`.
- Added `BindOnFluentSyntax`.
- Added `BindingScope`.
- Added `BindToFluentSyntax`.
- Added `BindWhenFluentSyntax`.
- Added `BindWhenOnFluentSyntax`.
- Added `ContainerModuleLoadOptions`.
- Added `DynamicValueBuilder`.
- Added `Factory`.
- Added `GetOptions`.
- Added `GetOptionsTagConstraint`.
- Added `IsBoundOptions`.
- Added `MetadataName`.
- Added `MetadataTag`.
- Added `MetadataTargetName`.
- Added `OptionalGetOptions`.
- Added `Provider`.
- Added `ResolutionContext`.
- Added `bindingScopeValues`.
- Added `bindingTypeValues`.
- Added `injectFromBase` decorator.
### Changed
- Updated `injectable` with optional `scope`.
- [Breaking] Updated `ContainerModule` constructor to receive a callback with `ContainerModuleLoadOptions` instead of `interfaces.ContainerModuleCallBack`.
- [Breaking] Updated `ContainerModule`.load to return `Promise<void>`.
- Updated `ContainerOptions` with `parent`.
- Updated `ContainerOptions` without `autoBindInjectable` and `skipBaseClassChecks`.
- [Breaking] Updated `Container` to no longer expose `id`, `parent` nor `options`.
- [Breaking] Updated `Container` with no `applyCustomMetadataReader`, `applyMiddleware`, `createChild`, `merge` and `rebind` methods.
- [Breaking] Updated `Container` with no `isCurrentBound`, `isBoundNamed`, `isBoundTagged` methods in favor of using `Container.isBound` with `isBoundOptions`.
- [Breaking] Updated `Container` with no `getNamed`, `getTagged`, `tryGet`, `tryGetNamed` and `tryGetTagged` methods in favor of `Container.get` with `OptionalGetOptions` options.
- [Breaking] Updated `Container` with no `getNamedAsync`, `getTaggedAsync`, `tryGetAsync`, `tryGetNamedAsync` and `tryGetTaggedAsync` methods in favor of `Container.getAsync` with `OptionalGetOptions` options.
- [Breaking] Updated `Container` with no `getAllNamed`, `getAllTagged`, `tryGetAll`, `tryGetAllNamed` and `tryGetAllTagged` methods in favor of `Container.getAll` with `GetOptions` options.
- [Breaking] Updated `Container` with no `getAllNamedAsync`, `getAllTaggedAsync`, `tryGetAllAsync`, `tryGetAllNamedAsync` and `tryGetAllTaggedAsync` methods in favor of `Container.getAllAsync` with `GetOptions` options.
- [Breaking] Updated `Container` with no `loadAsync` in favor of an async `Container.load`.
- [Breaking] Updated `Container` with no `unbindAsync` in favor of an async `Container.unbind`.
- [Breaking] Updated `Container` with no `unbindAllAsync` in favor of an async `Container.unbindAll`.
- [Breaking] Updated `Container` with no `unloadAsync` in favor of an async `Container.unload`.
### Fixed
- Updated `decorate` to no longer require a unexpected prototypes to decorate property nor methods.
### Removed
- [Breaking] Removed deprecated `LazyServiceIdentifer`. Use `LazyServiceIdentifier` instead.
- [Breaking] Removed `BindingScopeEnum`. Use `bindingScopeValues` instead.
- [Breaking] Removed `BindingTypeEnum`.
- [Breaking] Removed `TargetTypeEnum`.
- [Breaking] Removed `METADATA_KEY`.
- [Breaking] Removed `AsyncContainerModule`. Use `ContainerModule` instead.
- [Breaking] Removed `createTaggedDecorator`.
- [Breaking] Removed `MetadataReader`.
- [Breaking] Removed `id`.
- [Breaking] Removed `interfaces` types. Rely on new types instead.
- [Breaking] Removed `traverseAncerstors`.
- [Breaking] Removed `taggedConstraint`.
- [Breaking] Removed `namedConstraint`.
- [Breaking] Removed `typeConstraint`.
- [Breaking] Removed `getServiceIdentifierAsString`.
- [Breaking] Removed `multiBindToService`.
## [6.2.1]
### Fixed
- Added missing `LazyServiceIdentifer`.
## [6.2.0]
### Added
- Added `interfaces.GetAllOptions`.
### Changed
- Updated `container.getAll` with `options` optional param.
- Updated `container.getAllAsync` with `options` optional param.
- Updated `interfaces.NextArgs` with optional `isOptional` param.
- Updated `container` with `tryGet`.
- Updated `container` with `tryGetAsync`.
- Updated `container` with `tryGetTagged`.
- Updated `container` with `tryGetTaggedAsync`.
- Updated `container` with `tryGetNamed`.
- Updated `container` with `tryGetNamedAsync`.
- Updated `container` with `tryGetAll`.
- Updated `container` with `tryGetAllAsync`.
- Updated `container` with `tryGetAllTagged`.
- Updated `container` with `tryGetAllTaggedAsync`.
- Updated `container` with `tryGetAllNamed`.
- Updated `container` with `tryGetAllNamedAsync`.
## [6.2.0-beta.1]
### Added
### Changed
- Updated `interfaces.NextArgs` with optional `isOptional` param.
- Updated `container` with `tryGet`.
- Updated `container` with `tryGetAsync`.
- Updated `container` with `tryGetTagged`.
- Updated `container` with `tryGetTaggedAsync`.
- Updated `container` with `tryGetNamed`.
- Updated `container` with `tryGetNamedAsync`.
- Updated `container` with `tryGetAll`.
- Updated `container` with `tryGetAllAsync`.
- Updated `container` with `tryGetAllTagged`.
- Updated `container` with `tryGetAllTaggedAsync`.
- Updated `container` with `tryGetAllNamed`.
- Updated `container` with `tryGetAllNamedAsync`.
### Fixed
## [6.2.0-beta.0]
### Added
- Added `interfaces.GetAllOptions`.
### Changed
- Updated `container.getAll` with `options` optional param.
- Updated `container.getAllAsync` with `options` optional param.
### Fixed
## [6.1.6]
### Fixed
- Fixed unexpected property access while running planning checks on injected base types.
- Updated ESM sourcemaps to refelct the right source code files.
## [6.1.5]
### Changed
- Updated library to import `reflect-metadata`. Importing `reflect-metadata` before bootstraping a module in the userland is no longer required.
### Fixed
- Updated ESM build to provide proper types regardless of the ts resolution module strategy in the userland.
- Fixed container to properly resolve async `.toService` bindings.
- Fixed `.toService` binding to properly disable caching any values.
## [6.1.5-beta.2]
### Fixed
- Updated ESM bundled types to solve circularly referenced types.
## [6.1.5-beta.1]
### Fixed
- Updated ESM build to provide proper types regardless of the ts resolution module strategy in the userland.
## [6.1.5-beta.0]
### Changed
- Updated library to import `reflect-metadata`. Importing `reflect-metadata` before bootstraping a module in the userland is no longer required.
### Fixed
- Fixed container to properly resolve async `.toService` bindings.
- Fixed `.toService` binding to properly disable caching any values.
## [6.1.4]
### Changed
- Updated planner with better error description when a binding can not be properly resolved.
### Fixed
- Updated container to allow deactivating singleton undefined values.
- Updated ESM build to be compatible with both bundler and NodeJS module resolution algorithms.
## [6.1.4-beta.1]
### Fixed
- Updated ESM build to be compatible with both bundler and NodeJS module resolution algorithms.
## [6.1.4-beta.0]
### Changed
- Updated planner with better error description when a binding can not be properly resolved.
## [6.1.3]
### Fixed
- Updated ESM build with missing types.
## [6.1.2]
### Changed
- Updated `package.json` to include the `exports` field for better bundler support.
### Fixed
- Updated fetch metadata flows with better error descriptions.
## [6.1.2-beta.1]
### Changed
- Updated `package.json` to include the `exports` field for better bundler support.
## [6.1.2-beta.0]
### Fixed
- Updated fetch metadata flows with better error descriptions.
## [6.1.1]
### Fixed
- Bumped `@inversifyjs/common` and `@inversifyjs/core` fixing wrong dev engines constraints.
## [6.1.0]
### Changed
- Updated `ServiceIdentifier` to rely on `Function` instead of `Abstract<T>`.
### Fixed
- Fixed `Target.getNameTag` with the right type: `number | string | symbol`.
- Fixed `interfaces.ModuleActivationStore.addDeactivation` to enforce `serviceIdentifier` and `onDeactivation` are consistent.
- Fixed `interfaces.ModuleActivationStore.addActivation` to enforce `serviceIdentifier` and `onDeactivation` are consistent.
## [6.0.3]
### Fixed
property injection tagged as @optional no longer overrides default values with `undefined`.
Updated `targetName` to be a valid `typescript@5` decorator.
## [6.0.2]
### Added
Brought tests up to 100% Code Coverage
### Changed
LazyIdentfier Tests
Removed browser test pipeline, browserify, karma (#1542)
Update all dependencies except typescript (#1531)
### Fixed
Less than 100% code coverage
Use default class property for @optional injected properties (#1467)
Remove circular import (#1516)
Fix strict type checking on @unmanaged decorator (#1499)
Fix typo (LazyServiceIdentifer -> LazyServiceIdentifier) (#1483)
Fix typo (circular dependency error message) (#1485)
## [6.0.1] - 2021-10-14
### Added
- add API method for check dependency only in current container
- createTaggedDecorator #1343
- Async bindings #1132
- Async binding resolution (getAllAsync, getAllNamedAsync, getAllTaggedAsync, getAsync, getNamedAsync, getTaggedAsync, rebindAsync, unbindAsync, unbindAllAsync, unloadAsync) #1132
- Global onActivation / onDeactivation #1132
- Parent/Child onActivation / onDeactivation #1132
- Module onActivation / onDeactivation #1132
- Added @preDestroy decorator #1132
### Changed
- @postConstruct can target an asyncronous function #1132
- Singleton scoped services cache resolved values once the result promise is fulfilled #1320
### Fixed
- only inject decorator can be applied to setters #1342
- Container.resolve should resolve in that container #1338
## [5.1.1] - 2021-04-25
-Fix pre-publish for build artifacts
## [5.1.0] - 2021-04-25
### Added
- Upgrade information for v4.x to v5.x
### Changed
- Update BindingToSyntax with `.toAutoNamedFactory()`.
### Fixed
- Fix `Target.isTagged()` to exclude `optional` from tag injections #1190.
- Update `toConstructor`, `toFactory`, `toFunction`, `toAutoFactory`, `toProvider` and `toConstantValue` to have singleton scope #1297.
- Fix injection on optional properties when targeting ES6 #928
## [5.0.1] - 2018-10-17
### Added
- Updating constructor injection wiki document with concrete injection example #922
### Changed
- Change GUID to incremented counter for better performance #882
### Fixed
- fix broken compilation by adding `.toString()` so symbols serialization #893
- Fix problem with applying options on Container.resolve (fix #914) #915
- Fixed documentation issues
## [4.14.0] - 2018-10-16
Deprecated - Replaced by 5.0.1
================================================
FILE: CODE_OF_CONDUCT.md
================================================
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at remo.jansen@wolksoftware.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
================================================
FILE: CONTRIBUTING.md
================================================
# Contributing to Inversify
## Setup
1 Clone your fork of the repository
```sh
git clone https://github.com/YOUR_USERNAME/InversifyJS.git
```
2 Install npm dependencies
```sh
pnpm install
```
3 Run build process
```sh
pnpm test
```
## Guidelines
- Please try to [combine multiple commits before pushing](http://stackoverflow.com/questions/6934752/combining-multiple-commits-before-pushing-in-git)
- Please use `TDD` when fixing bugs. This means that you should write a unit test that fails because it reproduces the issue, then fix the issue and finally run the test to ensure that the issue has been resolved. This helps us prevent fixed bugs from happening again in the future
- Please keep the test coverage at 100%. Write additional unit tests if necessary
- Please create an issue before sending a PR if it is going to change the public interface of InversifyJS or includes significant architecture changes
- Feel free to ask for help from other members of the InversifyJS team via the chat / mailing list or github issues
================================================
FILE: ISSUE_TEMPLATE.md
================================================
<!--- Provide a general summary of the issue in the Title above -->
## Expected Behavior
<!--- If you're describing a bug, tell us what should happen -->
<!--- If you're suggesting a change/improvement, tell us how it should work -->
## Current Behavior
<!--- If describing a bug, tell us what happens instead of the expected behavior -->
<!--- If suggesting a change/improvement, explain the difference from current behavior -->
## Possible Solution
<!--- Not obligatory, but suggest a fix/reason for the bug, -->
<!--- or ideas how to implement the addition or change -->
## Steps to Reproduce (for bugs)
<!--- Provide a link to a live example, or an unambiguous set of steps to -->
<!--- reproduce this bug. Include code to reproduce, if relevant -->
1.
2.
3.
4.
## Context
<!--- How has this issue affected you? What are you trying to accomplish? -->
<!--- Providing context helps us come up with a solution that is most useful in the real world -->
## Your Environment
<!--- Include as many relevant details about the environment you experienced the bug in -->
* Version used:
* Environment name and version (e.g. Chrome 39, node.js 5.4):
* Operating System and version (desktop or mobile):
* Link to your project:
# Stack trace
<!--- Include stack trace -->
================================================
FILE: LICENSE
================================================
The MIT License (MIT)
Copyright (c) 2015-2017 Remo H. Jansen
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.
================================================
FILE: PULL_REQUEST_TEMPLATE.md
================================================
<!--- Provide a general summary of your changes in the Title above -->
## Description
<!--- Describe your changes in detail -->
## Related Issue
<!--- This project only accepts pull requests related to open issues -->
<!--- If suggesting a new feature or change, please discuss it in an issue first -->
<!--- If fixing a bug, there should be an issue describing it with steps to reproduce -->
<!--- Please link to the issue here: -->
## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
## How Has This Been Tested?
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran to -->
<!--- see how your change affects other areas of the code, etc. -->
## Types of changes
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
- [ ] Updated docs / Refactor code / Added a tests case (non-breaking change)
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
## Checklist:
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
- [ ] My code follows the code style of this project.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [ ] I have read the **CONTRIBUTING** document.
- [ ] I have added tests to cover my changes.
- [ ] All new and existing tests passed.
- [ ] I have updated the changelog.
================================================
FILE: README.md
================================================
> [!NOTE]
> InversifyJS will be moving to the [monorepo](https://github.com/inversify/monorepo). Please, consider creating issues and pull requests there.
>
> Next releases will be published in the monorepo, so consider starring it to be notified.
<p align="center">
<a href="https://www.npmjs.com/package/inversify" target="__blank"><img src="https://img.shields.io/npm/v/inversify?color=0476bc&label=" alt="NPM version"></a>
<a href="https://www.npmjs.com/package/inversify" target="__blank"><img alt="NPM Downloads" src="https://img.shields.io/npm/dm/inversify?color=3890aa&label="></a>
<a href="https://github.com/inversify/InversifyJS#-the-inversifyjs-features-and-api" target="__blank"><img src="https://img.shields.io/static/v1?label=&message=docs&color=1e8a7a" alt="Docs"></a>
<a href="https://codecov.io/gh/inversify/InversifyJS" target="__blank"><img alt="Codecov" src="https://codecov.io/gh/inversify/InversifyJS/branch/master/graph/badge.svg?token=KfAKzuGs01"></a>
<br>
<br>
<a href="https://github.com/inversify/InversifyJS" target="__blank"><img alt="GitHub stars" src="https://img.shields.io/github/stars/inversify/InversifyJS?style=social"></a>
<!--<a href="https://twitter.com/inversifyjs" target="__blank"><img alt="Twitter" src="https://img.shields.io/twitter/follow/InversifyJS.svg?maxAge=86400&style=social"></a>-->
<a href="https://discord.gg/jXcMagAPnm" target="__blank"><img alt="Discord Server" src="https://img.shields.io/discord/816766547879657532?style=social&logo=discord"></a>
</p>
# InversifyJS
A powerful and lightweight inversion of control container for JavaScript & Node.js apps powered by TypeScript.
## 📕 Documentation
Documentation is available at https://inversify.io
## About
InversifyJS is a lightweight inversion of control (IoC) container for TypeScript and JavaScript apps.
An IoC container uses a class constructor to identify and inject its dependencies.
InversifyJS has a friendly API and encourages the usage of the best OOP and IoC practices.
## Motivation
JavaScript now supports object oriented (OO) programming with class based inheritance. These features are great but the truth is that they are also
[dangerous](https://medium.com/@dan_abramov/how-to-use-classes-and-sleep-at-night-9af8de78ccb4).
We need a good OO design ([SOLID](https://en.wikipedia.org/wiki/SOLID_(object-oriented_design)), [Composite Reuse](https://en.wikipedia.org/wiki/Composition_over_inheritance), etc.) to protect ourselves from these threats. The problem is that OO design is difficult and that is exactly why we created InversifyJS.
InversifyJS is a tool that helps JavaScript developers write code with good OO design.
## Philosophy
InversifyJS has been developed with 4 main goals:
1. Allow JavaScript developers to write code that adheres to the SOLID principles.
2. Facilitate and encourage the adherence to the best OOP and IoC practices.
3. Add as little runtime overhead as possible.
4. Provide a state of the art development experience.
## Testimonies
**[Nate Kohari](https://twitter.com/nkohari)** - Author of [Ninject](https://github.com/ninject/Ninject)
> *"Nice work! I've taken a couple shots at creating DI frameworks for JavaScript and TypeScript, but the lack of RTTI really hinders things.*
> *The ES7 metadata gets us part of the way there (as you've discovered). Keep up the great work!"*
**[Michel Weststrate](https://twitter.com/mweststrate)** - Author of [MobX](https://github.com/mobxjs/mobx)
> *Dependency injection like InversifyJS works nicely*
## Some companies using InversifyJS
[<img src="https://avatars0.githubusercontent.com/u/6154722?s=200&v=4" width="100" />](https://opensource.microsoft.com/)[<img src="https://avatars2.githubusercontent.com/u/69631?s=200&v=4" width="100" />](https://code.facebook.com/projects/1021334114569758/nuclide/)[<img src="https://avatars0.githubusercontent.com/u/2232217?s=200&v=4" width="100" />](https://aws.github.io/aws-amplify/)[<img src="https://avatars0.githubusercontent.com/u/1520648?s=200&v=4" width="100" />](https://www.plainconcepts.com/)[<img src="https://avatars3.githubusercontent.com/u/6962987?s=200&v=4" width="100" />](https://api.slack.com/)[<img src="https://pbs.twimg.com/profile_images/827249559046909954/SyaBPcH8_400x400.jpg" width="100" />](http://acia.aon.com/index.php/home/) [<img src="https://avatars3.githubusercontent.com/u/114767?s=200&v=4" width="100" />](https://www.lonelyplanet.com/) [<img src="https://avatars0.githubusercontent.com/u/25283328?s=200&v=4" width="100" />](https://jincor.com/) [<img src="https://avatars1.githubusercontent.com/u/1957282?s=200&v=4" width="100" />](https://www.web-computing.de/) [<img src="https://avatars1.githubusercontent.com/u/17648048?s=200&v=4" width="100" />](https://dcos.io/) [<img src="https://avatars0.githubusercontent.com/u/16970371?s=200&v=4" width="100" />](https://typefox.io/) [<img src="https://avatars0.githubusercontent.com/u/18010308?s=200&v=4" width="100" />](https://code4.ro/) [<img src="https://user-images.githubusercontent.com/10656223/33888109-fae0852e-df43-11e7-97f6-9db543da0bde.png" width="100">](http://www.baidu.com/) [<img src="https://avatars2.githubusercontent.com/u/8085382?s=200&v=4" width="100" />](https://www.imdada.cn/) [<img src="https://avatars2.githubusercontent.com/u/17041151?s=200&v=4" width="100" />](https://www.ato.gov.au/) [<img src="https://avatars1.githubusercontent.com/u/14963540?s=200&v=4" width="100" />](https://www.kaneoh.com/) [<img src="https://avatars0.githubusercontent.com/u/26021686?s=200&v=4" width="100" />](https://particl.io/) [<img src="https://avatars2.githubusercontent.com/u/24523195?s=200&v=4" width="100" />](https://slackmap.com/) [<img src="https://avatars3.githubusercontent.com/u/16556899?s=200&v=4" width="100" />](https://www.go1.com/) [<img src="https://avatars3.githubusercontent.com/u/23475730?s=200&v=4" width="100" />](http://www.stellwagengroup.com/stellwagen-technology/) [<img src="https://avatars1.githubusercontent.com/u/15262567?s=200&v=4" width="100" />](https://www.edrlab.org/) [<img src="https://avatars1.githubusercontent.com/u/10072104?s=200&v=4" width="100" />](https://www.goodgamestudios.com/) [<img src="https://avatars2.githubusercontent.com/u/13613760?s=200&v=4" width="100" />](https://freshfox.at/) [<img src="https://avatars1.githubusercontent.com/u/864482?s=200&v=4" width="100" />](https://schubergphilis.com/)
## Acknowledgements
Thanks a lot to all the [contributors](https://github.com/inversify/InversifyJS/graphs/contributors), all the developers out there using InversifyJS and all those that help us to spread the word by sharing content about InversifyJS online. Without your feedback and support this project would not be possible.
## License
License under the MIT License (MIT)
Copyright © 2015-2017 [Remo H. Jansen](http://www.remojansen.com)
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.
================================================
FILE: eslint.config.mjs
================================================
// @ts-check
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import eslintPrettierConfig from 'eslint-plugin-prettier/recommended';
import simpleImportSort from 'eslint-plugin-simple-import-sort';
/**
* @returns {import('typescript-eslint').ConfigWithExtends}
*/
function buildBaseConfig() {
return {
extends: [
eslint.configs.recommended,
...tseslint.configs.strictTypeChecked,
],
languageOptions: {
parser: tseslint.parser,
parserOptions: {
project: './tsconfig.json',
},
},
plugins: {
'@typescript-eslint': tseslint.plugin,
'simple-import-sort': simpleImportSort,
},
rules: {
'@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
'@typescript-eslint/explicit-member-accessibility': [
'error',
{
overrides: {
constructors: 'no-public',
},
},
],
'@typescript-eslint/member-ordering': ['warn'],
'@typescript-eslint/naming-convention': [
'error',
{
selector: ['classProperty'],
format: ['strictCamelCase', 'UPPER_CASE', 'snake_case'],
leadingUnderscore: 'allow',
},
{
selector: 'typeParameter',
format: ['StrictPascalCase'],
prefix: ['T'],
},
{
selector: ['typeLike'],
format: ['StrictPascalCase'],
},
{
selector: ['function', 'classMethod'],
format: ['strictCamelCase'],
leadingUnderscore: 'allow',
},
{
selector: ['parameter'],
format: ['strictCamelCase'],
leadingUnderscore: 'allow',
},
{
selector: ['variableLike'],
format: ['strictCamelCase', 'UPPER_CASE', 'snake_case'],
},
],
'@typescript-eslint/no-deprecated': 'error',
'@typescript-eslint/no-duplicate-type-constituents': 'off',
'@typescript-eslint/no-dynamic-delete': 'error',
'@typescript-eslint/no-extraneous-class': 'off',
'@typescript-eslint/no-inferrable-types': 'off',
'@typescript-eslint/no-empty-interface': 'warn',
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-floating-promises': ['error'],
'@typescript-eslint/no-unsafe-enum-comparison': 'off',
'no-magic-numbers': 'off',
'@typescript-eslint/no-magic-numbers': [
'warn',
{
ignore: [0, 1],
ignoreArrayIndexes: true,
ignoreEnums: true,
ignoreReadonlyClassProperties: true,
},
],
'@typescript-eslint/no-require-imports': 'error',
'@typescript-eslint/no-unnecessary-type-arguments': 'off',
'@typescript-eslint/no-unused-expressions': ['error'],
'@typescript-eslint/no-useless-constructor': 'error',
'@typescript-eslint/prefer-for-of': 'error',
'@typescript-eslint/prefer-nullish-coalescing': ['off'],
'@typescript-eslint/prefer-optional-chain': 'off',
'@typescript-eslint/prefer-readonly': ['warn'],
'@typescript-eslint/promise-function-async': ['error'],
'@typescript-eslint/require-await': 'off',
'@typescript-eslint/restrict-plus-operands': [
'error',
{
skipCompoundAssignments: false,
},
],
'@typescript-eslint/typedef': [
'error',
{
arrayDestructuring: true,
arrowParameter: true,
memberVariableDeclaration: true,
objectDestructuring: true,
parameter: true,
propertyDeclaration: true,
variableDeclaration: true,
},
],
'@typescript-eslint/unified-signatures': 'error',
'@typescript-eslint/strict-boolean-expressions': 'error',
'@typescript-eslint/switch-exhaustiveness-check': [
'error',
{
considerDefaultExhaustiveForUnions: true,
},
],
'@typescript-eslint/no-unused-vars': [
'warn',
{
args: 'all',
argsIgnorePattern: '^_',
caughtErrors: 'all',
caughtErrorsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
varsIgnorePattern: '^_',
ignoreRestSiblings: true,
},
],
'simple-import-sort/imports': [
'error',
{
groups: [['^\\u0000'], ['^node:'], ['^@?\\w'], ['^'], ['^\\.']],
},
],
'sort-keys': [
'error',
'asc',
{
caseSensitive: false,
natural: true,
},
],
},
};
}
const baseRules = buildBaseConfig();
const config = tseslint.config(
{
...baseRules,
files: ['**/*.ts'],
ignores: ['**/*.test.ts'],
},
{
...baseRules,
files: ['**/*.test.ts'],
rules: {
...(baseRules.rules ?? {}),
'@typescript-eslint/no-confusing-void-expression': 'off',
'@typescript-eslint/unbound-method': 'off',
'@typescript-eslint/no-magic-numbers': 'off',
},
},
/** @type {import('typescript-eslint').ConfigWithExtends} */ (
eslintPrettierConfig
),
);
export default [...config];
================================================
FILE: package.json
================================================
{
"author": "Remo H. Jansen",
"bugs": {
"url": "https://github.com/inversify/InversifyJS/issues"
},
"description": "A powerful and lightweight inversion of control container for JavaScript and Node.js apps powered by TypeScript.",
"dependencies": {
"@inversifyjs/common": "1.5.2",
"@inversifyjs/container": "1.13.0",
"@inversifyjs/core": "9.0.0"
},
"devEngines": {
"packageManager": {
"name": "pnpm",
"version": "^10.13.1",
"onFail": "warn"
},
"runtime": {
"name": "node",
"version": "^22.10.2",
"onFail": "warn"
}
},
"devDependencies": {
"@eslint/js": "9.36.0",
"@rollup/plugin-terser": "0.4.4",
"@rollup/plugin-typescript": "12.1.4",
"@types/chai": "5.2.2",
"@types/mocha": "10.0.10",
"@types/node": "22.18.6",
"@types/sinon": "17.0.4",
"@typescript-eslint/eslint-plugin": "8.47.0",
"@typescript-eslint/parser": "8.47.0",
"chai": "6.0.1",
"eslint": "9.36.0",
"eslint-config-prettier": "10.1.8",
"eslint-plugin-prettier": "5.5.4",
"eslint-plugin-simple-import-sort": "12.1.1",
"mocha": "11.7.2",
"nyc": "17.1.0",
"prettier": "3.6.2",
"rimraf": "6.0.1",
"rollup": "4.52.2",
"rollup-plugin-dts": "6.2.3",
"sinon": "21.0.0",
"ts-loader": "9.5.4",
"tslib": "2.8.1",
"ts-node": "10.9.2",
"typescript": "5.9.2",
"typescript-eslint": "8.44.1"
},
"peerDependencies": {
"reflect-metadata": "~0.2.2"
},
"homepage": "http://inversify.io",
"keywords": [
"dependency injection",
"dependency inversion",
"di",
"inversion of control container",
"ioc",
"javascript",
"node",
"typescript"
],
"license": "MIT",
"main": "lib/cjs/index.js",
"module": "lib/esm/index.js",
"exports": {
".": {
"import": "./lib/esm/index.js",
"require": "./lib/cjs/index.js"
}
},
"name": "inversify",
"repository": {
"type": "git",
"url": "https://github.com/inversify/InversifyJS.git"
},
"scripts": {
"build": "pnpm run build:cjs && pnpm run build:esm",
"build:cjs": "tsc --build tsconfig.cjs.json && node ./scripts/writeCommonJsPackageJson.mjs ./lib/cjs",
"build:esm": "rollup -c ./rollup.config.mjs && node ./scripts/writeEsmPackageJson.mjs ./lib/esm",
"build:clean": "rimraf lib",
"format": "prettier --write ./src/**/*.ts",
"lint": "eslint ./src",
"prebuild": "pnpm run build:clean",
"test": "nyc --reporter=lcov --require ts-node/register mocha src/test/*.test.ts src/test/**/*.test.ts --reporter spec --exit",
"test:cjs": "nyc --reporter=lcov mocha lib/cjs/test/*.test.js lib/cjs/test/**/*.test.js --reporter spec"
},
"sideEffects": false,
"version": "7.10.0"
}
================================================
FILE: prettier.config.mjs
================================================
export default {
printWidth: 80,
tabWidth: 2,
useTabs: false,
semi: true,
singleQuote: true,
bracketSpacing: true,
arrowParens: 'always',
endOfLine: 'lf',
trailingComma: 'all',
};
================================================
FILE: renovate.json
================================================
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"automerge": false,
"extends": [
"config:recommended",
":disableRateLimiting",
":semanticCommitScopeDisabled"
],
"ignoreDeps": [],
"packageRules": [
{
"groupName": "auto merge on patch or minor",
"automerge": true,
"matchUpdateTypes": ["patch", "minor"],
"matchPackageNames": ["!turbo", "!typescript"]
}
],
"rangeStrategy": "bump",
"rebaseWhen": "conflicted",
"semanticCommits": "enabled",
"schedule": ["at any time"]
}
================================================
FILE: rollup.config.mjs
================================================
import fs from 'node:fs/promises';
import terser from '@rollup/plugin-terser';
import typescript from '@rollup/plugin-typescript';
import { dts } from 'rollup-plugin-dts';
/**
* @param {string} path
* @returns {Promise<boolean>}
*/
async function pathExists(path) {
try {
await fs.access(path);
return true;
} catch (_err) {
return false;
}
}
const PACKAGE_JSON_PATH = './package.json';
if (!pathExists(PACKAGE_JSON_PATH)) {
throw new Error(`Expected "${PACKAGE_JSON_PATH}" path to exist`);
}
const packageJsonObject = JSON.parse(await fs.readFile(PACKAGE_JSON_PATH));
const packageDependencies = Object.keys(packageJsonObject.dependencies ?? {});
const packagePeerDependencies = Object.keys(
packageJsonObject.peerDependencies ?? {},
);
/** @type {!import("rollup").MergedRollupOptions[]} */
export default [
{
input: './src/index.ts',
external: [...packageDependencies, ...packagePeerDependencies],
output: [
{
dir: './lib/esm',
format: 'esm',
sourcemap: true,
sourcemapPathTransform: (relativeSourcePath) => {
// Rollup seems to generate source maps pointing to the wrong directory. Ugly patch to fix it
if (relativeSourcePath.startsWith('../')) {
return relativeSourcePath.slice(3);
} else {
return relativeSourcePath;
}
},
},
],
plugins: [
typescript({
tsconfig: './tsconfig.esm.json',
}),
terser(),
],
},
{
input: 'lib/esm/index.d.ts',
output: [{ file: 'lib/esm/index.d.ts', format: 'es' }],
plugins: [
dts({
tsconfig: './tsconfig.esm.json',
}),
],
},
];
================================================
FILE: scripts/writeCommonJsPackageJson.mjs
================================================
#!/usr/bin/env node
import fs from 'node:fs/promises';
import { argv } from 'node:process';
import path from 'node:path';
import { writeFile } from 'node:fs/promises';
/**
* @param {string} path
* @returns {Promise<boolean>}
*/
async function pathExists(path) {
try {
await fs.access(path);
return true;
} catch (_err) {
return false;
}
}
const directory = argv[2];
if (directory === undefined) {
throw new Error('Expected a path');
}
const directoryExists = await pathExists(directory);
if (!directoryExists) {
throw new Error(`Path ${directory} not found`);
}
const filePath = path.join(directory, 'package.json');
const packageJsonFileContent = JSON.stringify(
{
type: 'commonjs',
},
undefined,
2,
);
await writeFile(filePath, packageJsonFileContent);
================================================
FILE: scripts/writeEsmPackageJson.mjs
================================================
#!/usr/bin/env node
import fs from 'node:fs/promises';
import { argv } from 'node:process';
import path from 'node:path';
import { writeFile } from 'node:fs/promises';
/**
* @param {string} path
* @returns {Promise<boolean>}
*/
async function pathExists(path) {
try {
await fs.access(path);
return true;
} catch (_err) {
return false;
}
}
const directory = argv[2];
if (directory === undefined) {
throw new Error('Expected a path');
}
const directoryExists = await pathExists(directory);
if (!directoryExists) {
throw new Error(`Path ${directory} not found`);
}
const filePath = path.join(directory, 'package.json');
const packageJsonFileContent = JSON.stringify(
{
type: 'module',
},
undefined,
2,
);
await writeFile(filePath, packageJsonFileContent);
================================================
FILE: src/index.ts
================================================
import 'reflect-metadata';
export {
Newable,
LazyServiceIdentifier,
ServiceIdentifier,
} from '@inversifyjs/common';
export {
Bind,
BindInFluentSyntax,
BindingIdentifier,
BindInWhenOnFluentSyntax,
BindOnFluentSyntax,
BindToFluentSyntax,
BindWhenFluentSyntax,
BindWhenOnFluentSyntax,
BoundServiceSyntax,
Container,
ContainerModule,
ContainerModuleLoadOptions,
ContainerOptions,
IsBound,
IsBoundOptions,
OnActivation,
OnDeactivation,
Rebind,
RebindSync,
ResolvedValueInjectOptions,
ResolvedValueMetadataInjectOptions,
ResolvedValueMetadataInjectTagOptions,
Unbind,
UnbindSync,
} from '@inversifyjs/container';
export {
BindingActivation,
BindingConstraints,
BindingDeactivation,
BindingScope,
DynamicValueBuilder,
Factory,
GetAllOptions,
GetOptions,
GetOptionsTagConstraint,
InjectFromBaseOptions,
InjectFromBaseOptionsLifecycle,
InjectFromHierarchyOptions,
InjectFromHierarchyOptionsLifecycle,
MetadataName,
MetadataTag,
MultiInjectOptions,
OptionalGetOptions,
// eslint-disable-next-line @typescript-eslint/no-deprecated
Provider,
ResolutionContext,
bindingScopeValues,
bindingTypeValues,
decorate,
inject,
injectFromBase,
injectFromHierarchy,
injectable,
multiInject,
named,
optional,
unmanaged,
tagged,
postConstruct,
preDestroy,
} from '@inversifyjs/core';
================================================
FILE: src/test/annotation/inject.test.ts
================================================
import 'reflect-metadata';
import { LazyServiceIdentifier } from '@inversifyjs/common';
import { expect } from 'chai';
import { decorate, inject, ServiceIdentifier } from '../..';
class Katana {}
class Shuriken {}
const lazySwordId: LazyServiceIdentifier = new LazyServiceIdentifier(
() => 'Sword',
);
class InvalidDecoratorUsageWarrior {
private readonly _primaryWeapon: Katana;
private readonly _secondaryWeapon: Shuriken;
constructor(primary: Katana, secondary: Shuriken) {
this._primaryWeapon = primary;
this._secondaryWeapon = secondary;
}
public test(_a: string) {}
public debug() {
return {
primaryWeapon: this._primaryWeapon,
secondaryWeapon: this._secondaryWeapon,
};
}
}
describe('@inject', () => {
it('Should throw when applied multiple times', () => {
const useDecoratorMoreThanOnce: () => void = function () {
decorate(
[inject('Katana'), inject('Shuriken')],
InvalidDecoratorUsageWarrior,
0,
);
};
const msg: string = `Unexpected injection error.
Cause:
Unexpected injection found. Multiple @inject, @multiInject or @unmanaged decorators found
Details
[class: "InvalidDecoratorUsageWarrior", index: "0"]`;
expect(useDecoratorMoreThanOnce).to.throw(msg);
});
it('Should unwrap LazyServiceIdentifier', () => {
const unwrapped: ServiceIdentifier = lazySwordId.unwrap();
expect(unwrapped).to.be.equal('Sword');
});
});
================================================
FILE: src/test/annotation/injectable.test.ts
================================================
import 'reflect-metadata';
import { expect } from 'chai';
import { decorate, injectable } from '../..';
describe('@injectable', () => {
it('Should throw when applied multiple times', () => {
@injectable()
class Test {}
const useDecoratorMoreThanOnce: () => void = function () {
decorate([injectable(), injectable()], Test);
};
expect(useDecoratorMoreThanOnce).to.throw(
'Cannot apply @injectable decorator multiple times',
);
});
});
================================================
FILE: src/test/annotation/multi_inject.test.ts
================================================
import 'reflect-metadata';
import { expect } from 'chai';
import { decorate, multiInject } from '../..';
type Weapon = object;
class InvalidDecoratorUsageWarrior {
private readonly _primaryWeapon: Weapon;
private readonly _secondaryWeapon: Weapon;
constructor(weapons: [Weapon, Weapon]) {
this._primaryWeapon = weapons[0];
this._secondaryWeapon = weapons[1];
}
public test(_a: string) {}
public debug() {
return {
primaryWeapon: this._primaryWeapon,
secondaryWeapon: this._secondaryWeapon,
};
}
}
describe('@multiInject', () => {
it('Should throw when applied multiple times', () => {
const useDecoratorMoreThanOnce: () => void = function () {
decorate(
[multiInject('Katana'), multiInject('Shuriken')],
InvalidDecoratorUsageWarrior,
0,
);
};
const msg: string = `Unexpected injection error.
Cause:
Unexpected injection found. Multiple @inject, @multiInject or @unmanaged decorators found
Details
[class: "InvalidDecoratorUsageWarrior", index: "0"]`;
expect(useDecoratorMoreThanOnce).to.throw(msg);
});
});
================================================
FILE: src/test/annotation/named.test.ts
================================================
import 'reflect-metadata';
import { expect } from 'chai';
import { decorate, named } from '../..';
type Weapon = unknown;
class InvalidDecoratorUsageWarrior {
private readonly _primaryWeapon: Weapon;
private readonly _secondaryWeapon: Weapon;
constructor(primary: Weapon, secondary: Weapon) {
this._primaryWeapon = primary;
this._secondaryWeapon = secondary;
}
public test(_a: string) {}
public debug() {
return {
primaryWeapon: this._primaryWeapon,
secondaryWeapon: this._secondaryWeapon,
};
}
}
describe('@named', () => {
it('Should throw when applied multiple times', () => {
const useDecoratorMoreThanOnce: () => void = function () {
decorate(
[named('Katana'), named('Shuriken')],
InvalidDecoratorUsageWarrior,
0,
);
};
const msg: string = `Unexpected injection error.
Cause:
Unexpected duplicated named decorator
Details
[class: "InvalidDecoratorUsageWarrior", index: "0"]`;
expect(useDecoratorMoreThanOnce).to.throw(msg);
});
});
================================================
FILE: src/test/annotation/optional.test.ts
================================================
import 'reflect-metadata';
import { expect } from 'chai';
import { Container, inject, injectable, optional } from '../..';
describe('@optional', () => {
it('Should allow to flag dependencies as optional', () => {
@injectable()
class Katana {
public name: string;
constructor() {
this.name = 'Katana';
}
}
@injectable()
class Shuriken {
public name: string;
constructor() {
this.name = 'Shuriken';
}
}
@injectable()
class Ninja {
public name: string;
public katana: Katana;
public shuriken: Shuriken;
constructor(
@inject('Katana') katana: Katana,
@inject('Shuriken') @optional() shuriken: Shuriken,
) {
this.name = 'Ninja';
this.katana = katana;
this.shuriken = shuriken;
}
}
const container: Container = new Container();
container.bind<Katana>('Katana').to(Katana);
container.bind<Ninja>('Ninja').to(Ninja);
let ninja: Ninja = container.get('Ninja');
expect(ninja.name).to.eql('Ninja');
expect(ninja.katana.name).to.eql('Katana');
expect(ninja.shuriken).to.eql(undefined);
container.bind<Shuriken>('Shuriken').to(Shuriken);
ninja = container.get('Ninja');
expect(ninja.name).to.eql('Ninja');
expect(ninja.katana.name).to.eql('Katana');
expect(ninja.shuriken.name).to.eql('Shuriken');
});
it('Should allow to set a default value for dependencies flagged as optional', () => {
@injectable()
class Katana {
public name: string;
constructor() {
this.name = 'Katana';
}
}
@injectable()
class Shuriken {
public name: string;
constructor() {
this.name = 'Shuriken';
}
}
@injectable()
class Ninja {
public name: string;
public katana: Katana;
public shuriken: Shuriken;
constructor(
@inject('Katana') katana: Katana,
@inject('Shuriken')
@optional()
shuriken: Shuriken = { name: 'DefaultShuriken' },
) {
this.name = 'Ninja';
this.katana = katana;
this.shuriken = shuriken;
}
}
const container: Container = new Container();
container.bind<Katana>('Katana').to(Katana);
container.bind<Ninja>('Ninja').to(Ninja);
let ninja: Ninja = container.get('Ninja');
expect(ninja.name).to.eql('Ninja');
expect(ninja.katana.name).to.eql('Katana');
expect(ninja.shuriken.name).to.eql('DefaultShuriken');
container.bind<Shuriken>('Shuriken').to(Shuriken);
ninja = container.get<Ninja>('Ninja');
expect(ninja.name).to.eql('Ninja');
expect(ninja.katana.name).to.eql('Katana');
expect(ninja.shuriken.name).to.eql('Shuriken');
});
it('Should allow to set a default value for class property dependencies flagged as optional', () => {
@injectable()
class Katana {
public name: string;
constructor() {
this.name = 'Katana';
}
}
@injectable()
class Shuriken {
public name: string;
constructor() {
this.name = 'Shuriken';
}
}
@injectable()
class Ninja {
@inject('Katana') public katana?: Katana;
@inject('Shuriken') @optional() public shuriken: Shuriken = {
name: 'DefaultShuriken',
};
public name: string = 'Ninja';
}
const container: Container = new Container();
container.bind<Katana>('Katana').to(Katana);
container.bind<Ninja>('Ninja').to(Ninja);
let ninja: Ninja = container.get('Ninja');
expect(ninja.name).to.eql('Ninja');
expect(ninja.katana?.name).to.eql('Katana');
expect(ninja.shuriken.name).to.eql('DefaultShuriken');
container.bind<Shuriken>('Shuriken').to(Shuriken);
ninja = container.get('Ninja');
expect(ninja.name).to.eql('Ninja');
expect(ninja.katana?.name).to.eql('Katana');
expect(ninja.shuriken.name).to.eql('Shuriken');
});
});
================================================
FILE: src/test/annotation/post_construct.test.ts
================================================
import 'reflect-metadata';
import { expect } from 'chai';
import { postConstruct } from '../..';
describe('@postConstruct', () => {
it('Should throw when applied multiple times', () => {
function setup() {
class Katana {
@postConstruct()
@postConstruct()
public testMethod1() {
/* ... */
}
}
Katana.toString();
}
expect(setup).to.throw('');
});
});
================================================
FILE: src/test/bugs/bugs.test.ts
================================================
import 'reflect-metadata';
import { expect } from 'chai';
import {
BindingConstraints,
Container,
decorate,
inject,
injectable,
injectFromBase,
MetadataName,
named,
ServiceIdentifier,
tagged,
unmanaged,
} from '../..';
describe('Bugs', () => {
it('Should not throw when args length of base and derived class match (property setter)', () => {
@injectable()
class Warrior {
public rank: string | null;
constructor() {
// length = 0
this.rank = null;
}
}
@injectable()
class SamuraiMaster extends Warrior {
constructor() {
// length = 0
super();
this.rank = 'master';
}
}
const container: Container = new Container();
container.bind<SamuraiMaster>(SamuraiMaster).to(SamuraiMaster);
const master: SamuraiMaster = container.get<SamuraiMaster>(SamuraiMaster);
expect(master.rank).eql('master');
});
it('Should not throw when args length of base and derived class match', () => {
// Injecting into the derived class
@injectable()
class Warrior {
protected rank: string;
constructor(rank: string) {
// length = 1
this.rank = rank;
}
}
// eslint-disable-next-line @typescript-eslint/typedef
const TYPES = { Rank: 'Rank' };
@injectable()
class SamuraiMaster extends Warrior {
constructor(
@inject(TYPES.Rank) @named('master') public override rank: string, // length = 1
) {
super(rank);
}
}
const container: Container = new Container();
container.bind<SamuraiMaster>(SamuraiMaster).to(SamuraiMaster);
container
.bind<string>(TYPES.Rank)
.toConstantValue('master')
.whenNamed('master');
const master: SamuraiMaster = container.get<SamuraiMaster>(SamuraiMaster);
expect(master.rank).eql('master');
});
it('Should not throw when args length of base and derived class match', () => {
// Injecting into the derived class with multiple args
@injectable()
class Warrior {
protected rank: string;
constructor(rank: string) {
// length = 1
this.rank = rank;
}
}
interface Weapon {
name: string;
}
@injectable()
class Katana implements Weapon {
public name: string;
constructor() {
this.name = 'Katana';
}
}
// eslint-disable-next-line @typescript-eslint/typedef
const TYPES = {
Rank: 'Rank',
Weapon: 'Weapon',
};
@injectable()
class SamuraiMaster extends Warrior {
public weapon: Weapon;
constructor(
@inject(TYPES.Rank) @named('master') public override rank: string,
@inject(TYPES.Weapon) weapon: Weapon,
) {
// length = 2
super(rank);
this.weapon = weapon;
}
}
const container: Container = new Container();
container.bind<Weapon>(TYPES.Weapon).to(Katana);
container.bind<SamuraiMaster>(SamuraiMaster).to(SamuraiMaster);
container
.bind<string>(TYPES.Rank)
.toConstantValue('master')
.whenNamed('master');
const master: SamuraiMaster = container.get<SamuraiMaster>(SamuraiMaster);
expect(master.rank).eql('master');
expect(master.weapon.name).eql('Katana');
});
it('Should be able to convert a Symbol value to a string', () => {
type Weapon = unknown;
// eslint-disable-next-line @typescript-eslint/typedef
const TYPES = {
Weapon: Symbol.for('Weapon'),
};
const container: Container = new Container();
const throwF: () => void = () => {
container.get<Weapon>(TYPES.Weapon);
};
expect(throwF).to.throw('');
});
it('Should be able to combine tagged injection and constant value bindings', () => {
const container: Container = new Container();
type Intl = unknown;
container
.bind<Intl>('Intl')
.toConstantValue({ hello: 'bonjour' })
.whenTagged('lang', 'fr');
container
.bind<Intl>('Intl')
.toConstantValue({ goodbye: 'au revoir' })
.whenTagged('lang', 'fr');
const f: () => void = function () {
container.get<Intl>('Intl', {
tag: {
key: 'lang',
value: 'fr',
},
});
};
expect(f).to.throw();
});
it('Should be able to combine dynamic value with singleton scope', () => {
const container: Container = new Container();
container
.bind<number>('transient_random')
.toDynamicValue(() => Math.random())
.inTransientScope();
container
.bind<number>('singleton_random')
.toDynamicValue(() => Math.random())
.inSingletonScope();
const a: number = container.get<number>('transient_random');
const b: number = container.get<number>('transient_random');
expect(a).not.to.eql(b);
const c: number = container.get<number>('singleton_random');
const d: number = container.get<number>('singleton_random');
expect(c).to.eql(d);
});
it('Should be able to use an abstract class as the serviceIdentifier', () => {
@injectable()
abstract class Animal {
protected name: string;
constructor(@unmanaged() name: string) {
this.name = name;
}
public move(meters: number) {
return `${this.name} moved ${meters.toString()}m`;
}
public abstract makeSound(input: string): string;
}
@injectable()
class Snake extends Animal {
constructor() {
super('Snake');
}
public makeSound(input: string): string {
return 'sssss' + input;
}
public override move() {
return 'Slithering... ' + super.move(5);
}
}
@injectable()
class Jungle {
public animal: Animal;
constructor(@inject(Animal) animal: Animal) {
this.animal = animal;
}
}
const container: Container = new Container();
container.bind<Animal>(Animal).to(Snake);
container.bind<Jungle>(Jungle).to(Jungle);
const jungle: Jungle = container.get(Jungle);
expect(jungle.animal.makeSound('zzz')).to.eql('ssssszzz');
expect(jungle.animal.move(5)).to.eql('Slithering... Snake moved 5m');
});
it('Should not be able to get a named dependency if no named bindings are registered', () => {
// eslint-disable-next-line @typescript-eslint/typedef
const TYPES = {
Weapon: 'Weapon',
};
interface Weapon {
name: string;
}
@injectable()
class Katana implements Weapon {
public name: string;
constructor() {
this.name = 'Katana';
}
}
const container: Container = new Container();
container.bind<Weapon>(TYPES.Weapon).to(Katana).whenNamed('sword');
const throws: () => void = () => {
container.get<Weapon>(TYPES.Weapon, {
name: 'bow',
});
};
const error: string = `No bindings found for service: "Weapon".
Trying to resolve bindings for "Weapon (Root service)"`;
expect(throws).to.throw(error);
});
it('Should throw a friendly error when binding a non-class using toSelf', () => {
const container: Container = new Container();
const throws: () => void = () => {
container.bind('testId').toSelf();
};
expect(throws).to.throw('');
});
it('Should be able to inject into an abstract class', () => {
type Weapon = unknown;
@injectable()
abstract class BaseSoldier {
public weapon: Weapon;
constructor(@inject('Weapon') weapon: Weapon) {
this.weapon = weapon;
}
}
@injectable()
@injectFromBase({
extendConstructorArguments: true,
})
class Soldier extends BaseSoldier {}
@injectable()
@injectFromBase({
extendConstructorArguments: true,
})
class Archer extends BaseSoldier {}
@injectable()
@injectFromBase({
extendConstructorArguments: true,
})
class Knight extends BaseSoldier {}
@injectable()
class Sword {}
@injectable()
class Bow {}
@injectable()
class DefaultWeapon {}
const container: Container = new Container();
function whenIsAndIsNamed(
serviceIdentifier: ServiceIdentifier,
name: MetadataName,
): (bindingConstraints: BindingConstraints) => boolean {
return (bindingConstraints: BindingConstraints): boolean =>
bindingConstraints.serviceIdentifier === serviceIdentifier &&
bindingConstraints.name === name;
}
container
.bind<Weapon>('Weapon')
.to(DefaultWeapon)
.whenParent(whenIsAndIsNamed('BaseSoldier', 'default'));
container
.bind<Weapon>('Weapon')
.to(Sword)
.whenParent(whenIsAndIsNamed('BaseSoldier', 'knight'));
container
.bind<Weapon>('Weapon')
.to(Bow)
.whenParent(whenIsAndIsNamed('BaseSoldier', 'archer'));
container.bind<BaseSoldier>('BaseSoldier').to(Soldier).whenNamed('default');
container.bind<BaseSoldier>('BaseSoldier').to(Knight).whenNamed('knight');
container.bind<BaseSoldier>('BaseSoldier').to(Archer).whenNamed('archer');
const soldier: BaseSoldier = container.get<BaseSoldier>('BaseSoldier', {
name: 'default',
});
const knight: BaseSoldier = container.get<BaseSoldier>('BaseSoldier', {
name: 'knight',
});
const archer: BaseSoldier = container.get<BaseSoldier>('BaseSoldier', {
name: 'archer',
});
expect(soldier.weapon instanceof DefaultWeapon).to.eql(true);
expect(knight.weapon instanceof Sword).to.eql(true);
expect(archer.weapon instanceof Bow).to.eql(true);
});
it('Should be able apply inject to property shortcut', () => {
interface Weapon {
use(): string;
}
@injectable()
class Katana implements Weapon {
public use() {
return 'Used Katana!';
}
}
@injectable()
class Ninja {
constructor(
@inject('Weapon') @named('sword') private readonly _weapon: Weapon,
) {
//
}
public fight() {
return this._weapon.use();
}
}
const container: Container = new Container();
container.bind<Weapon>('Weapon').to(Katana).whenNamed('sword');
container.bind<Ninja>(Ninja).toSelf();
const ninja: Ninja = container.get<Ninja>(Ninja);
expect(ninja.fight()).eql('Used Katana!');
});
it('Should be able to inject into abstract base class without decorators', () => {
// eslint-disable-next-line @typescript-eslint/typedef
const TYPES = {
Warrior: 'Warrior',
Weapon: 'Weapon',
};
// eslint-disable-next-line @typescript-eslint/typedef
const TAGS = {
Primary: 'Primary',
Priority: 'Priority',
Secondary: 'Secondary',
};
interface Weapon {
name: string;
}
@injectable()
class Katana implements Weapon {
public name: string;
constructor() {
this.name = 'Katana';
}
}
@injectable()
class Shuriken implements Weapon {
public name: string;
constructor() {
this.name = 'Shuriken';
}
}
interface Warrior {
name: string;
primaryWeapon: Weapon;
}
abstract class BaseWarrior implements Warrior {
public name: string;
public primaryWeapon!: Weapon;
constructor(@unmanaged() name: string) {
this.name = name;
}
}
// @injectable()
decorate([injectable()], BaseWarrior);
// @inject(TYPES.Weapon)
inject(TYPES.Weapon)(BaseWarrior.prototype, 'primaryWeapon');
// @tagged(TAGS.Priority, TAGS.Primary)
tagged(TAGS.Priority, TAGS.Primary)(BaseWarrior.prototype, 'primaryWeapon');
@injectable()
@injectFromBase({
extendProperties: true,
})
class Samurai extends BaseWarrior {
@inject(TYPES.Weapon)
@tagged(TAGS.Priority, TAGS.Secondary)
public secondaryWeapon!: Weapon;
constructor() {
super('Samurai');
}
}
const container: Container = new Container();
container.bind<Warrior>(TYPES.Warrior).to(Samurai);
container
.bind<Weapon>(TYPES.Weapon)
.to(Katana)
.whenTagged(TAGS.Priority, TAGS.Primary);
container
.bind<Weapon>(TYPES.Weapon)
.to(Shuriken)
.whenTagged(TAGS.Priority, TAGS.Secondary);
const samurai: Samurai = container.get<Samurai>(TYPES.Warrior);
expect(samurai.name).to.eql('Samurai');
expect(samurai.secondaryWeapon).not.to.eql(undefined);
expect(samurai.secondaryWeapon.name).to.eql('Shuriken');
expect(samurai.primaryWeapon).not.to.eql(undefined);
expect(samurai.primaryWeapon.name).to.eql('Katana');
});
it('Should be able to combine unmanaged and managed injections ', () => {
interface Model<T> {
instance: T;
}
interface RepoBaseInterface<T> {
model: Model<T>;
}
class Type {
public name: string;
constructor() {
this.name = 'Type';
}
}
@injectable()
class RepoBase<T> implements RepoBaseInterface<T> {
public model: Model<T>;
constructor(
// using @unmanaged() here is right
// because entityType is NOT Injected by inversify
@unmanaged() entityType: new () => T,
) {
this.model = { instance: new entityType() };
}
}
@injectable()
class TypedRepo extends RepoBase<Type> {
constructor() {
super(Type); // unmanaged injection (NOT Injected by inversify)
}
}
@injectable()
class BlBase<T> {
public repository: RepoBaseInterface<T>;
constructor(
// using @unmanaged() here would wrong
// because repository is injected by inversify
repository: RepoBaseInterface<T>,
) {
this.repository = repository;
}
}
@injectable()
class TypedBl extends BlBase<Type> {
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
constructor(repository: TypedRepo) {
super(repository);
}
}
const container: Container = new Container();
container.bind<TypedRepo>(TypedRepo).toSelf();
container.bind<TypedBl>('TypedBL').to(TypedBl);
const typedBl: TypedBl = container.get<TypedBl>('TypedBL');
expect(typedBl.repository.model.instance.name).to.eq(new Type().name);
});
it('Should allow missing annotations in base classes', () => {
@injectable()
class Katana implements Katana {
public hit() {
return 'cut!';
}
}
abstract class Warrior {
private readonly _katana: Katana;
constructor(@unmanaged() katana: Katana) {
this._katana = katana;
}
public fight() {
return this._katana.hit();
}
}
@injectable()
class Ninja extends Warrior {
constructor(@inject('Katana') katana: Katana) {
super(katana);
}
}
const container: Container = new Container();
container.bind<Warrior>('Ninja').to(Ninja);
container.bind<Katana>('Katana').to(Katana);
const tryGet: () => void = () => {
container.get<Ninja>('Ninja');
};
expect(tryGet).not.to.throw();
});
});
================================================
FILE: src/test/bugs/issue_1190.test.ts
================================================
import 'reflect-metadata';
import { expect } from 'chai';
import { Container, inject, injectable, named, optional } from '../../index';
describe('Issue 1190', () => {
it('should inject a katana as default weapon to ninja', () => {
// eslint-disable-next-line @typescript-eslint/typedef
const TYPES = {
Weapon: 'Weapon',
};
// eslint-disable-next-line @typescript-eslint/typedef
const TAG = {
throwable: 'throwable',
};
interface Weapon {
name: string;
}
@injectable()
class Katana implements Weapon {
public name: string;
constructor() {
this.name = 'Katana';
}
}
@injectable()
class Shuriken implements Weapon {
public name: string;
constructor() {
this.name = 'Shuriken';
}
}
@injectable()
class Ninja {
public name: string;
public katana: Katana;
public shuriken: Shuriken;
constructor(
@inject(TYPES.Weapon) @optional() katana: Weapon,
@inject(TYPES.Weapon) @named(TAG.throwable) shuriken: Weapon,
) {
this.name = 'Ninja';
this.katana = katana;
this.shuriken = shuriken;
}
}
const container: Container = new Container();
container.bind<Weapon>(TYPES.Weapon).to(Katana).whenDefault();
container.bind<Weapon>(TYPES.Weapon).to(Shuriken).whenNamed(TAG.throwable);
container.bind<Ninja>('Ninja').to(Ninja);
const ninja: Ninja = container.get<Ninja>('Ninja');
expect(ninja.katana).to.deep.eq(new Katana());
});
});
================================================
FILE: src/test/bugs/issue_1297.test.ts
================================================
import 'reflect-metadata';
import { expect } from 'chai';
import * as sinon from 'sinon';
import {
Container,
Factory,
injectable,
Provider,
ResolutionContext,
} from '../..';
describe('Issue 1297', () => {
it('should call onActivation once if the service is a constant value binding', () => {
const container: Container = new Container();
const onActivationHandlerSpy: sinon.SinonSpy<
[ResolutionContext, string],
string
> = sinon.spy<(_: ResolutionContext, message: string) => string>(
(_: ResolutionContext, message: string) => message,
);
container
.bind<string>('message')
.toConstantValue('Hello world')
.onActivation(onActivationHandlerSpy);
container.get('message');
container.get('message');
expect(onActivationHandlerSpy.callCount).to.eq(1);
});
it('should call onActivation once if the service is a factory binding', () => {
@injectable()
class Katana {
public hit() {
return 'cut!';
}
}
const container: Container = new Container();
const onActivationHandlerSpy: sinon.SinonSpy<
[ResolutionContext, Factory<Katana>],
Factory<Katana>
> = sinon.spy<
(_: ResolutionContext, instance: Factory<Katana>) => Factory<Katana>
>((_: ResolutionContext, instance: Factory<Katana>) => instance);
container.bind<Katana>('Katana').to(Katana);
container
.bind<Factory<Katana>>('Factory<Katana>')
.toFactory(
(context: ResolutionContext) => () => context.get<Katana>('Katana'),
)
.onActivation(onActivationHandlerSpy);
container.get('Factory<Katana>');
container.get('Factory<Katana>');
expect(onActivationHandlerSpy.callCount).to.eq(1);
});
it('should call onActivation once if the service is a provider binding', () => {
@injectable()
class Katana {
public hit() {
return 'cut!';
}
}
const container: Container = new Container();
const onActivationHandlerSpy: sinon.SinonSpy<
// eslint-disable-next-line @typescript-eslint/no-deprecated
[ResolutionContext, Provider<Katana>],
// eslint-disable-next-line @typescript-eslint/no-deprecated
Provider<Katana>
> = sinon.spy<
(
_: ResolutionContext,
// eslint-disable-next-line @typescript-eslint/no-deprecated
injectableObj: Provider<Katana>,
// eslint-disable-next-line @typescript-eslint/no-deprecated
) => Provider<Katana>
// eslint-disable-next-line @typescript-eslint/no-deprecated
>((_: ResolutionContext, injectableObj: Provider<Katana>) => injectableObj);
container
// eslint-disable-next-line @typescript-eslint/no-deprecated
.bind<Provider<Katana>>('Provider<Katana>')
// eslint-disable-next-line @typescript-eslint/no-deprecated
.toProvider(
(_context: ResolutionContext) => async () =>
Promise.resolve(new Katana()),
)
.onActivation(onActivationHandlerSpy);
container.get('Provider<Katana>');
container.get('Provider<Katana>');
expect(onActivationHandlerSpy.callCount).to.eq(1);
});
});
================================================
FILE: src/test/bugs/issue_1416.test.ts
================================================
import 'reflect-metadata';
import { describe, it } from 'mocha';
import sinon from 'sinon';
import { Container, injectable, preDestroy } from '../..';
describe('Issue 1416', () => {
it('should allow providing default values on optional bindings', async () => {
@injectable()
class Test1 {
public stub: sinon.SinonStub<unknown[], void> = sinon.stub();
@preDestroy()
public destroy() {
this.stub();
}
}
@injectable()
class Test2 {
public destroy(): void {}
}
@injectable()
class Test3 {
public destroy(): void {}
}
const container: Container = new Container({ defaultScope: 'Singleton' });
container.bind(Test1).toSelf();
container.bind(Test2).toService(Test1);
container.bind(Test3).toService(Test1);
const test1: Test1 = container.get(Test1);
container.get(Test2);
container.get(Test3);
await Promise.all([
container.unbind(Test1),
container.unbind(Test2),
container.unbind(Test3),
]);
sinon.assert.calledOnce(test1.stub);
});
});
================================================
FILE: src/test/bugs/issue_1515.test.ts
================================================
import 'reflect-metadata';
import { expect } from 'chai';
import { Container, inject, injectable, multiInject } from '../..';
describe('Issue 1515', () => {
it('should properly throw on circular dependency', () => {
@injectable()
class Circle1 {
constructor(@inject('circle-2') public readonly circle2: unknown) {}
}
@injectable()
class Circle2 {
constructor(@inject('circle-1') public circle1: unknown) {}
}
@injectable()
class Multi1 {}
@injectable()
class Multi2 {}
@injectable()
class Multi3 {}
@injectable()
class Top {
constructor(
@multiInject('multi-inject') public readonly multis: unknown[],
@inject('circle-1') public readonly circle1: unknown,
) {}
}
const container: Container = new Container();
container.bind('multi-inject').to(Multi1);
container.bind('multi-inject').to(Multi2);
container.bind('multi-inject').to(Multi3);
container.bind('circle-1').to(Circle1);
container.bind('circle-2').to(Circle2);
container.bind(Top).toSelf();
expect(() => {
container.get(Top);
}).to.throw(
'Circular dependency found: Top -> circle-1 -> circle-2 -> circle-1',
);
});
});
================================================
FILE: src/test/bugs/issue_1518.test.ts
================================================
import 'reflect-metadata';
import { expect } from 'chai';
import { Container } from '../..';
describe('Issue 1518', () => {
it('should not throw on deactivating undefined singleton values', async () => {
const container: Container = new Container();
const symbol: symbol = Symbol.for('foo');
container.bind(symbol).toConstantValue(undefined);
console.log(container.get(symbol));
await container.unbind('foo');
expect(() => {}).not.to.throw();
});
});
================================================
FILE: src/test/bugs/issue_1564.test.ts
================================================
import 'reflect-metadata';
import { expect } from 'chai';
import { describe, it } from 'mocha';
import { Container, inject, injectable } from '../..';
describe('Issue 1564', () => {
it('should not throw on getting async services bound using "toService"', async () => {
@injectable()
class Database {
constructor() {
console.log('new Database');
}
}
@injectable()
class Service1 {
constructor(@inject(Database) public database: Database) {
console.log('new Service1');
}
}
@injectable()
class Service2 {
constructor(@inject(Service1) public service1: Service1) {
console.log('new Service2');
}
}
const container: Container = new Container({ defaultScope: 'Request' });
container.bind(Database).toDynamicValue(async () => {
console.log('connecting to db...');
return new Database();
});
container.bind(Service1).toSelf();
container.bind(Service2).toSelf();
container.bind('services').toService(Service1);
container.bind('services').toService(Service2);
const result: unknown[] = await container.getAllAsync('services');
expect(result).to.have.length(2);
});
});
================================================
FILE: src/test/bugs/issue_543.test.ts
================================================
import 'reflect-metadata';
import { expect } from 'chai';
import { Container, inject, injectable } from '../../index';
describe('Issue 543', () => {
it('Should throw correct circular dependency path', () => {
// eslint-disable-next-line @typescript-eslint/typedef
const TYPE = {
Child: Symbol.for('Child'),
Child2: Symbol.for('Child2'),
Circular: Symbol.for('Circular'),
Irrelevant: Symbol.for('Irrelevant1'),
Root: Symbol.for('Root'),
};
@injectable()
class Irrelevant {}
@injectable()
class Child2 {
public circ: unknown;
constructor(@inject(TYPE.Circular) circ: unknown) {
this.circ = circ;
}
}
@injectable()
class Child {
public irrelevant: Irrelevant;
public child2: Child2;
constructor(
@inject(TYPE.Irrelevant) irrelevant: Irrelevant,
@inject(TYPE.Child2) child2: Child2,
) {
this.irrelevant = irrelevant;
this.child2 = child2;
}
}
@injectable()
class Circular {
public irrelevant: Irrelevant;
public child: Child;
constructor(
@inject(TYPE.Irrelevant) irrelevant: Irrelevant,
@inject(TYPE.Child) child: Child,
) {
this.irrelevant = irrelevant;
this.child = child;
}
}
@injectable()
class Root {
public irrelevant: Irrelevant;
public circ: Circular;
constructor(
@inject(TYPE.Irrelevant) irrelevant1: Irrelevant,
@inject(TYPE.Circular) circ: Circular,
) {
this.irrelevant = irrelevant1;
this.circ = circ;
}
}
const container: Container = new Container();
container.bind<Root>(TYPE.Root).to(Root);
container.bind<Irrelevant>(TYPE.Irrelevant).to(Irrelevant);
container.bind<Circular>(TYPE.Circular).to(Circular);
container.bind<Child>(TYPE.Child).to(Child);
container.bind<Child2>(TYPE.Child2).to(Child2);
function throws() {
return container.get(TYPE.Root);
}
expect(throws).to.throw(
'Circular dependency found: Symbol(Root) -> Symbol(Circular) -> Symbol(Child) -> Symbol(Child2) -> Symbol(Circular)',
);
});
});
================================================
FILE: src/test/bugs/issue_549.test.ts
================================================
import 'reflect-metadata';
import { Container, inject, injectable, ResolutionContext } from '../..';
describe('Issue 549', () => {
it('Should throw if circular dependencies found with dynamics', () => {
// eslint-disable-next-line @typescript-eslint/typedef
const TYPE = {
ADynamicValue: Symbol.for('ADynamicValue'),
BDynamicValue: Symbol.for('BDynamicValue'),
};
type InterfaceA = unknown;
type InterfaceB = unknown;
@injectable()
class A {
public b: InterfaceB;
constructor(@inject(TYPE.BDynamicValue) b: InterfaceB) {
this.b = b;
}
}
@injectable()
class B {
public a: InterfaceA;
constructor(@inject(TYPE.ADynamicValue) a: InterfaceA) {
this.a = a;
}
}
const container: Container = new Container({ defaultScope: 'Singleton' });
container.bind(A).toSelf();
container.bind(B).toSelf();
container
.bind(TYPE.ADynamicValue)
.toDynamicValue((ctx: ResolutionContext) => ctx.get(A));
container
.bind(TYPE.BDynamicValue)
.toDynamicValue((ctx: ResolutionContext) => ctx.get(B));
function willThrow() {
return container.get<A>(A);
}
try {
const result: A = willThrow();
throw new Error(
`This line should never be executed. Expected \`willThrow\` to throw! ${JSON.stringify(result)}`,
);
} catch (e) {
const localError: Error = e as Error;
const expectedErrorA: string = '';
const expectedErrorB: string = '';
const matchesErrorA: boolean =
localError.message.indexOf(expectedErrorA) !== -1;
const matchesErrorB: boolean =
localError.message.indexOf(expectedErrorB) !== -1;
if (!matchesErrorA && !matchesErrorB) {
throw new Error(
'Expected `willThrow` to throw:\n' +
`- ${expectedErrorA}\n` +
'or\n' +
`- ${expectedErrorB}\n` +
'but got\n' +
`- ${localError.message}`,
);
}
}
});
});
================================================
FILE: src/test/bugs/issue_706.test.ts
================================================
import 'reflect-metadata';
import { expect } from 'chai';
import { bindingScopeValues, Container, injectable } from '../..';
describe('Issue 706', () => {
it('Should expose BindingScopeEnum as part of the public API', () => {
@injectable()
class SomeClass {
public time: number;
constructor() {
this.time = new Date().getTime();
}
}
const container: Container = new Container({
defaultScope: bindingScopeValues.Singleton,
});
// eslint-disable-next-line @typescript-eslint/typedef
const TYPE = {
SomeClass: Symbol.for('SomeClass'),
};
container.bind<SomeClass>(TYPE.SomeClass).to(SomeClass);
const instanceOne: SomeClass = container.get<SomeClass>(TYPE.SomeClass);
const instanceTwo: SomeClass = container.get<SomeClass>(TYPE.SomeClass);
expect(instanceOne.time).to.eq(instanceTwo.time);
});
});
================================================
FILE: src/test/bugs/issue_928.test.ts
================================================
import 'reflect-metadata';
import { expect } from 'chai';
import { Container, inject, injectable, Newable, optional } from '../..';
describe('Issue 928', () => {
it('should inject the right instances', () => {
let injectedA: unknown;
let injectedB: unknown;
let injectedC: unknown;
// some dependencies
@injectable()
class DepA {
public a: number = 1;
}
@injectable()
class DepB {
public b: number = 1;
}
@injectable()
class DepC {
public c: number = 1;
}
@injectable()
abstract class AbstractCls {
constructor(
@inject(DepA) a: DepA,
@inject(DepB) @optional() b: DepB = { b: 0 },
) {
injectedA = a;
injectedB = b;
}
}
@injectable()
class Cls extends AbstractCls {
constructor(
@inject(DepC) c: DepC,
@inject(DepB) @optional() b: DepB = { b: 0 },
@inject(DepA) a: DepA,
) {
super(a, b);
injectedC = c;
}
}
const container: Container = new Container();
[DepA, DepB, DepC, Cls].forEach((i: Newable<unknown>) =>
container.bind(i).toSelf().inSingletonScope(),
);
container.get(Cls);
expect(injectedA).to.deep.eq(new DepA());
expect(injectedB).to.deep.eq(new DepB());
expect(injectedC).to.deep.eq(new DepC());
});
});
================================================
FILE: src/test/container/container.test.ts
================================================
import 'reflect-metadata';
import { expect } from 'chai';
import * as sinon from 'sinon';
import {
bindingScopeValues,
Container,
inject,
injectable,
postConstruct,
ResolutionContext,
} from '../..';
describe('Container', () => {
let sandbox: sinon.SinonSandbox;
beforeEach(() => {
sandbox = sinon.createSandbox();
});
afterEach(() => {
sandbox.restore();
});
it('Should unbind a binding when requested', async () => {
@injectable()
class Ninja {}
const ninjaId: string = 'Ninja';
const container: Container = new Container();
container.bind<Ninja>(ninjaId).to(Ninja);
await container.unbind(ninjaId);
expect(container.isBound(ninjaId)).equal(false);
});
it('Should unbind a binding when requested', async () => {
@injectable()
class Ninja {}
@injectable()
class Samurai {}
const ninjaId: string = 'Ninja';
const samuraiId: string = 'Samurai';
const container: Container = new Container();
container.bind<Ninja>(ninjaId).to(Ninja);
container.bind<Samurai>(samuraiId).to(Samurai);
expect(container.isBound(ninjaId)).equal(true);
expect(container.isBound(samuraiId)).equal(true);
await container.unbind(ninjaId);
expect(container.isBound(ninjaId)).equal(false);
expect(container.isBound(samuraiId)).equal(true);
});
it('Should be able unbound all dependencies', async () => {
@injectable()
class Ninja {}
@injectable()
class Samurai {}
const ninjaId: string = 'Ninja';
const samuraiId: string = 'Samurai';
const container: Container = new Container();
container.bind<Ninja>(ninjaId).to(Ninja);
container.bind<Samurai>(samuraiId).to(Samurai);
expect(container.isBound(ninjaId)).equal(true);
expect(container.isBound(samuraiId)).equal(true);
await container.unbindAll();
expect(container.isBound(ninjaId)).equal(false);
expect(container.isBound(samuraiId)).equal(false);
});
it('Should NOT be able to get unregistered services', () => {
@injectable()
class Ninja {}
const ninjaId: string = 'Ninja';
const container: Container = new Container();
const throwFunction: () => void = () => {
container.get<Ninja>(ninjaId);
};
expect(throwFunction).to.throw('');
});
it('Should NOT be able to get ambiguous match', () => {
type Warrior = unknown;
@injectable()
class Ninja {}
@injectable()
class Samurai {}
const warriorId: string = 'Warrior';
const container: Container = new Container();
container.bind<Warrior>(warriorId).to(Ninja);
container.bind<Warrior>(warriorId).to(Samurai);
const throwFunction: () => void = () => {
container.get<Warrior>(warriorId);
};
expect(throwFunction).to.throw('');
});
it('Should be able to getAll of unregistered services', () => {
@injectable()
class Ninja {}
const ninjaId: string = 'Ninja';
const container: Container = new Container();
expect(container.getAll<Ninja>(ninjaId)).to.deep.equal([]);
});
it('Should be able to snapshot and restore container', async () => {
@injectable()
class Ninja {}
@injectable()
class Samurai {}
const container: Container = new Container();
container.bind(Ninja).to(Ninja);
container.bind(Samurai).to(Samurai);
expect(container.get(Samurai)).to.be.instanceOf(Samurai);
expect(container.get(Ninja)).to.be.instanceOf(Ninja);
container.snapshot(); // snapshot container = v1
await container.unbind(Ninja);
expect(container.get(Samurai)).to.be.instanceOf(Samurai);
expect(() => container.get(Ninja)).to.throw();
container.snapshot(); // snapshot container = v2
expect(() => container.get(Ninja)).to.throw();
container.bind(Ninja).to(Ninja);
expect(container.get(Samurai)).to.be.instanceOf(Samurai);
expect(container.get(Ninja)).to.be.instanceOf(Ninja);
container.restore(); // restore container to v2
expect(container.get(Samurai)).to.be.instanceOf(Samurai);
expect(() => container.get(Ninja)).to.throw();
container.restore(); // restore container to v1
expect(container.get(Samurai)).to.be.instanceOf(Samurai);
expect(container.get(Ninja)).to.be.instanceOf(Ninja);
expect(() => {
container.restore();
}).to.throw('');
});
it('Should maintain the activation state of a singleton when doing a snapshot of a container', () => {
let timesCalled: number = 0;
@injectable()
class Ninja {
@postConstruct()
public postConstruct() {
timesCalled++;
}
}
const container: Container = new Container();
container.bind<Ninja>(Ninja).to(Ninja).inSingletonScope();
container.get<Ninja>(Ninja);
container.snapshot();
container.restore();
container.get<Ninja>(Ninja);
expect(timesCalled).to.be.equal(1);
});
it('Should save and restore the container activations and deactivations when snapshot and restore', async () => {
const sid: string = 'sid';
const container: Container = new Container();
container.bind<string>(sid).toConstantValue('Value');
let activated: boolean = false;
let deactivated: boolean = false;
container.snapshot();
container.onActivation<string>(sid, (_c: ResolutionContext, i: string) => {
activated = true;
return i;
});
container.onDeactivation(sid, (_i: unknown) => {
deactivated = true;
});
container.restore();
container.get(sid);
await container.unbind(sid);
expect(activated).to.equal(false);
expect(deactivated).to.equal(false);
});
it('Should be able to check is there are bindings available for a given identifier', () => {
const warriorId: string = 'Warrior';
const warriorSymbol: symbol = Symbol.for('Warrior');
@injectable()
class Ninja {}
const container: Container = new Container();
container.bind(Ninja).to(Ninja);
container.bind(warriorId).to(Ninja);
container.bind(warriorSymbol).to(Ninja);
expect(container.isBound(Ninja)).equal(true);
expect(container.isBound(warriorId)).equal(true);
expect(container.isBound(warriorSymbol)).equal(true);
const katanaId: string = 'Katana';
const katanaSymbol: symbol = Symbol.for('Katana');
@injectable()
class Katana {}
expect(container.isBound(Katana)).equal(false);
expect(container.isBound(katanaId)).equal(false);
expect(container.isBound(katanaSymbol)).equal(false);
});
it('Should be able to check is there are bindings available for a given identifier only in current container', () => {
@injectable()
class Ninja {}
const containerParent: Container = new Container();
const containerChild: Container = new Container({
parent: containerParent,
});
containerParent.bind(Ninja).to(Ninja);
expect(containerParent.isBound(Ninja)).to.eql(true);
expect(containerChild.isBound(Ninja)).to.eql(true);
expect(containerChild.isCurrentBound(Ninja)).to.eql(false);
});
it('Should be able to get services from parent container', () => {
const weaponIdentifier: string = 'Weapon';
@injectable()
class Katana {}
const container: Container = new Container();
container.bind(weaponIdentifier).to(Katana);
const childContainer: Container = new Container({ parent: container });
const secondChildContainer: Container = new Container({
parent: childContainer,
});
expect(secondChildContainer.get(weaponIdentifier)).to.be.instanceOf(Katana);
});
it('Should be able to check if services are bound from parent container', () => {
const weaponIdentifier: string = 'Weapon';
@injectable()
class Katana {}
const container: Container = new Container();
container.bind(weaponIdentifier).to(Katana);
const childContainer: Container = new Container({ parent: container });
const secondChildContainer: Container = new Container({
parent: childContainer,
});
expect(secondChildContainer.isBound(weaponIdentifier)).to.be.equal(true);
});
it('Should prioritize requested container to resolve a service identifier', () => {
const weaponIdentifier: string = 'Weapon';
@injectable()
class Katana {}
@injectable()
class DivineRapier {}
const container: Container = new Container();
container.bind(weaponIdentifier).to(Katana);
const childContainer: Container = new Container({ parent: container });
const secondChildContainer: Container = new Container({
parent: childContainer,
});
secondChildContainer.bind(weaponIdentifier).to(DivineRapier);
expect(secondChildContainer.get(weaponIdentifier)).to.be.instanceOf(
DivineRapier,
);
});
it('Should be able to resolve named multi-injection', () => {
interface Intl {
hello?: string;
goodbye?: string;
}
const container: Container = new Container();
container
.bind<Intl>('Intl')
.toConstantValue({ hello: 'bonjour' })
.whenNamed('fr');
container
.bind<Intl>('Intl')
.toConstantValue({ goodbye: 'au revoir' })
.whenNamed('fr');
container
.bind<Intl>('Intl')
.toConstantValue({ hello: 'hola' })
.whenNamed('es');
container
.bind<Intl>('Intl')
.toConstantValue({ goodbye: 'adios' })
.whenNamed('es');
const fr: Intl[] = container.getAll<Intl>('Intl', { name: 'fr' });
expect(fr.length).to.equal(2);
expect(fr[0]?.hello).to.equal('bonjour');
expect(fr[1]?.goodbye).to.equal('au revoir');
const es: Intl[] = container.getAll<Intl>('Intl', { name: 'es' });
expect(es.length).to.equal(2);
expect(es[0]?.hello).to.equal('hola');
expect(es[1]?.goodbye).to.equal('adios');
});
it('Should be able to resolve tagged multi-injection', () => {
interface Intl {
hello?: string;
goodbye?: string;
}
const container: Container = new Container();
container
.bind<Intl>('Intl')
.toConstantValue({ hello: 'bonjour' })
.whenTagged('lang', 'fr');
container
.bind<Intl>('Intl')
.toConstantValue({ goodbye: 'au revoir' })
.whenTagged('lang', 'fr');
container
.bind<Intl>('Intl')
.toConstantValue({ hello: 'hola' })
.whenTagged('lang', 'es');
container
.bind<Intl>('Intl')
.toConstantValue({ goodbye: 'adios' })
.whenTagged('lang', 'es');
const fr: Intl[] = container.getAll<Intl>('Intl', {
tag: { key: 'lang', value: 'fr' },
});
expect(fr.length).to.equal(2);
expect(fr[0]?.hello).to.equal('bonjour');
expect(fr[1]?.goodbye).to.equal('au revoir');
const es: Intl[] = container.getAll<Intl>('Intl', {
tag: { key: 'lang', value: 'es' },
});
expect(es.length).to.equal(2);
expect(es[0]?.hello).to.equal('hola');
expect(es[1]?.goodbye).to.equal('adios');
});
it('Should be able to resolve optional injection', async () => {
const container: Container = new Container();
const serviceIdentifier: string = 'service-id';
expect(container.get(serviceIdentifier, { optional: true })).to.eq(
undefined,
);
expect(container.getAll(serviceIdentifier, { optional: true })).to.deep.eq(
[],
);
expect(
await container.getAllAsync(serviceIdentifier, { optional: true }),
).to.deep.eq([]);
expect(
container.getAll(serviceIdentifier, {
name: 'name',
optional: true,
}),
).to.deep.eq([]);
expect(
await container.getAllAsync(serviceIdentifier, {
name: 'name',
optional: true,
}),
).to.deep.eq([]);
expect(
container.getAll(serviceIdentifier, {
optional: true,
tag: { key: 'tag', value: 'value' },
}),
).to.deep.eq([]);
expect(
await container.getAllAsync(serviceIdentifier, {
optional: true,
tag: { key: 'tag', value: 'value' },
}),
).to.deep.eq([]);
expect(
await container.getAsync(serviceIdentifier, {
optional: true,
}),
).to.eq(undefined);
expect(
container.get(serviceIdentifier, {
name: 'name',
optional: true,
}),
).to.eq(undefined);
expect(
await container.getAsync(serviceIdentifier, {
name: 'name',
optional: true,
}),
).to.eq(undefined);
expect(
container.get(serviceIdentifier, {
optional: true,
tag: { key: 'tag', value: 'value' },
}),
).to.eq(undefined);
expect(
await container.getAsync(serviceIdentifier, {
optional: true,
tag: { key: 'tag', value: 'value' },
}),
).to.eq(undefined);
});
it('Should be able configure the default scope at a global level', () => {
interface Warrior {
health: number;
takeHit(damage: number): void;
}
@injectable()
class Ninja implements Warrior {
public health: number;
constructor() {
this.health = 100;
}
public takeHit(damage: number) {
this.health = this.health - damage;
}
}
// eslint-disable-next-line @typescript-eslint/typedef
const TYPES = {
Warrior: 'Warrior',
};
const container1: Container = new Container();
container1.bind<Warrior>(TYPES.Warrior).to(Ninja);
const transientNinja1: Warrior = container1.get<Warrior>(TYPES.Warrior);
expect(transientNinja1.health).to.equal(100);
transientNinja1.takeHit(10);
expect(transientNinja1.health).to.equal(90);
const transientNinja2: Warrior = container1.get<Warrior>(TYPES.Warrior);
expect(transientNinja2.health).to.equal(100);
transientNinja2.takeHit(10);
expect(transientNinja2.health).to.equal(90);
const container2: Container = new Container({
defaultScope: bindingScopeValues.Singleton,
});
container2.bind<Warrior>(TYPES.Warrior).to(Ninja);
const singletonNinja1: Warrior = container2.get<Warrior>(TYPES.Warrior);
expect(singletonNinja1.health).to.equal(100);
singletonNinja1.takeHit(10);
expect(singletonNinja1.health).to.equal(90);
const singletonNinja2: Warrior = container2.get<Warrior>(TYPES.Warrior);
expect(singletonNinja2.health).to.equal(90);
singletonNinja2.takeHit(10);
expect(singletonNinja2.health).to.equal(80);
});
it('Should be able to override options to child containers', () => {
@injectable()
class Warrior {}
const parent: Container = new Container({
defaultScope: bindingScopeValues.Request,
});
const child: Container = new Container({
defaultScope: 'Singleton',
parent,
});
child.bind(Warrior).toSelf();
const singletonWarrior1: Warrior = child.get(Warrior);
const singletonWarrior2: Warrior = child.get(Warrior);
expect(singletonWarrior1).to.equal(singletonWarrior2);
});
it('Should be able check if a named binding is bound', async () => {
const zero: string = 'Zero';
const invalidDivisor: string = 'InvalidDivisor';
const validDivisor: string = 'ValidDivisor';
const container: Container = new Container();
expect(container.isBound(zero)).to.equal(false);
container.bind<number>(zero).toConstantValue(0);
expect(container.isBound(zero)).to.equal(true);
await container.unbindAll();
expect(container.isBound(zero)).to.equal(false);
container.bind<number>(zero).toConstantValue(0).whenNamed(invalidDivisor);
expect(container.isBound(zero, { name: invalidDivisor })).to.equal(true);
expect(container.isBound(zero, { name: validDivisor })).to.equal(false);
container.bind<number>(zero).toConstantValue(1).whenNamed(validDivisor);
expect(container.isBound(zero, { name: invalidDivisor })).to.equal(true);
expect(container.isBound(zero, { name: validDivisor })).to.equal(true);
});
it('Should be able to check if a named binding is bound from parent container', () => {
const zero: string = 'Zero';
const invalidDivisor: string = 'InvalidDivisor';
const validDivisor: string = 'ValidDivisor';
const container: Container = new Container();
const childContainer: Container = new Container({ parent: container });
const secondChildContainer: Container = new Container({
parent: childContainer,
});
container.bind<number>(zero).toConstantValue(0).whenNamed(invalidDivisor);
expect(
secondChildContainer.isBound(zero, { name: invalidDivisor }),
).to.equal(true);
expect(secondChildContainer.isBound(zero, { name: validDivisor })).to.equal(
false,
);
container.bind<number>(zero).toConstantValue(1).whenNamed(validDivisor);
expect(
secondChildContainer.isBound(zero, { name: invalidDivisor }),
).to.equal(true);
expect(secondChildContainer.isBound(zero, { name: validDivisor })).to.equal(
true,
);
});
it('Should be able to get a tagged binding', () => {
const zero: string = 'Zero';
const isValidDivisor: string = 'IsValidDivisor';
const container: Container = new Container();
container
.bind<number>(zero)
.toConstantValue(0)
.whenTagged(isValidDivisor, false);
expect(
container.get(zero, {
tag: { key: isValidDivisor, value: false },
}),
).to.equal(0);
container
.bind<number>(zero)
.toConstantValue(1)
.whenTagged(isValidDivisor, true);
expect(
container.get(zero, {
tag: { key: isValidDivisor, value: false },
}),
).to.equal(0);
expect(
container.get(zero, {
tag: { key: isValidDivisor, value: true },
}),
).to.equal(1);
});
it('Should be able to get a tagged binding from parent container', () => {
const zero: string = 'Zero';
const isValidDivisor: string = 'IsValidDivisor';
const container: Container = new Container();
const childContainer: Container = new Container({ parent: container });
const secondChildContainer: Container = new Container({
parent: childContainer,
});
container
.bind<number>(zero)
.toConstantValue(0)
.whenTagged(isValidDivisor, false);
container
.bind<number>(zero)
.toConstantValue(1)
.whenTagged(isValidDivisor, true);
expect(
secondChildContainer.get(zero, {
tag: { key: isValidDivisor, value: false },
}),
).to.equal(0);
expect(
secondChildContainer.get(zero, {
tag: { key: isValidDivisor, value: true },
}),
).to.equal(1);
});
it('Should be able check if a tagged binding is bound', async () => {
const zero: string = 'Zero';
const isValidDivisor: string = 'IsValidDivisor';
const container: Container = new Container();
expect(container.isBound(zero)).to.equal(false);
container.bind<number>(zero).toConstantValue(0);
expect(container.isBound(zero)).to.equal(true);
await container.unbindAll();
expect(container.isBound(zero)).to.equal(false);
container
.bind<number>(zero)
.toConstantValue(0)
.whenTagged(isValidDivisor, false);
expect(
container.isBound(zero, {
tag: { key: isValidDivisor, value: false },
}),
).to.equal(true);
expect(
container.isBound(zero, {
tag: { key: isValidDivisor, value: true },
}),
).to.equal(false);
container
.bind<number>(zero)
.toConstantValue(1)
.whenTagged(isValidDivisor, true);
expect(
container.isBound(zero, {
tag: { key: isValidDivisor, value: false },
}),
).to.equal(true);
expect(
container.isBound(zero, {
tag: { key: isValidDivisor, value: true },
}),
).to.equal(true);
});
it('Should be able to check if a tagged binding is bound from parent container', () => {
const zero: string = 'Zero';
const isValidDivisor: string = 'IsValidDivisor';
const container: Container = new Container();
const childContainer: Container = new Container({ parent: container });
const secondChildContainer: Container = new Container({
parent: childContainer,
});
container
.bind<number>(zero)
.toConstantValue(0)
.whenTagged(isValidDivisor, false);
expect(
secondChildContainer.isBound(zero, {
tag: { key: isValidDivisor, value: false },
}),
).to.equal(true);
expect(
secondChildContainer.isBound(zero, {
tag: { key: isValidDivisor, value: true },
}),
).to.equal(false);
container
.bind<number>(zero)
.toConstantValue(1)
.whenTagged(isValidDivisor, true);
expect(
secondChildContainer.isBound(zero, {
tag: { key: isValidDivisor, value: false },
}),
).to.equal(true);
expect(
secondChildContainer.isBound(zero, {
tag: { key: isValidDivisor, value: true },
}),
).to.equal(true);
});
it('Should be able to override a binding using rebind', async () => {
// eslint-disable-next-line @typescript-eslint/typedef
const TYPES = {
someType: 'someType',
};
const container: Container = new Container();
container.bind<number>(TYPES.someType).toConstantValue(1);
container.bind<number>(TYPES.someType).toConstantValue(2);
const values1: unknown[] = container.getAll(TYPES.someType);
expect(values1[0]).to.eq(1);
expect(values1[1]).to.eq(2);
await container.unbind(TYPES.someType);
container.bind<number>(TYPES.someType).toConstantValue(3);
const values2: unknown[] = container.getAll(TYPES.someType);
expect(values2[0]).to.eq(3);
expect(values2[1]).to.eq(undefined);
});
it('Should be able to resolve named multi-injection (async)', async () => {
interface Intl {
hello?: string;
goodbye?: string;
}
const container: Container = new Container();
container
.bind<Intl>('Intl')
.toDynamicValue(async () => Promise.resolve({ hello: 'bonjour' }))
.whenNamed('fr');
container
.bind<Intl>('Intl')
.toDynamicValue(async () => Promise.resolve({ goodbye: 'au revoir' }))
.whenNamed('fr');
container
.bind<Intl>('Intl')
.toDynamicValue(async () => Promise.resolve({ hello: 'hola' }))
.whenNamed('es');
container
.bind<Intl>('Intl')
.toDynamicValue(async () => Promise.resolve({ goodbye: 'adios' }))
.whenNamed('es');
const fr: Intl[] = await container.getAllAsync<Intl>('Intl', {
name: 'fr',
});
expect(fr.length).to.equal(2);
expect(fr[0]?.hello).to.equal('bonjour');
expect(fr[1]?.goodbye).to.equal('au revoir');
const es: Intl[] = await container.getAllAsync<Intl>('Intl', {
name: 'es',
});
expect(es.length).to.equal(2);
expect(es[0]?.hello).to.equal('hola');
expect(es[1]?.goodbye).to.equal('adios');
});
it('Should be able to resolve named (async)', async () => {
interface Intl {
hello?: string;
goodbye?: string;
}
const container: Container = new Container();
container
.bind<Intl>('Intl')
.toDynamicValue(async () => Promise.resolve({ hello: 'bonjour' }))
.whenNamed('fr');
container
.bind<Intl>('Intl')
.toDynamicValue(async () => Promise.resolve({ hello: 'hola' }))
.whenNamed('es');
const fr: Intl = await container.getAsync<Intl>('Intl', { name: 'fr' });
expect(fr.hello).to.equal('bonjour');
const es: Intl = await container.getAsync<Intl>('Intl', { name: 'es' });
expect(es.hello).to.equal('hola');
});
it('Should be able to resolve tagged multi-injection (async)', async () => {
interface Intl {
hello?: string;
goodbye?: string;
}
const container: Container = new Container();
container
.bind<Intl>('Intl')
.toDynamicValue(async () => Promise.resolve({ hello: 'bonjour' }))
.whenTagged('lang', 'fr');
container
.bind<Intl>('Intl')
.toDynamicValue(async () => Promise.resolve({ goodbye: 'au revoir' }))
.whenTagged('lang', 'fr');
container
.bind<Intl>('Intl')
.toDynamicValue(async () => Promise.resolve({ hello: 'hola' }))
.whenTagged('lang', 'es');
container
.bind<Intl>('Intl')
.toDynamicValue(async () => Promise.resolve({ goodbye: 'adios' }))
.whenTagged('lang', 'es');
const fr: Intl[] = await container.getAllAsync<Intl>('Intl', {
tag: { key: 'lang', value: 'fr' },
});
expect(fr.length).to.equal(2);
expect(fr[0]?.hello).to.equal('bonjour');
expect(fr[1]?.goodbye).to.equal('au revoir');
const es: Intl[] = await container.getAllAsync<Intl>('Intl', {
tag: { key: 'lang', value: 'es' },
});
expect(es.length).to.equal(2);
expect(es[0]?.hello).to.equal('hola');
expect(es[1]?.goodbye).to.equal('adios');
});
it('Should be able to get a tagged binding (async)', async () => {
const zero: string = 'Zero';
const isValidDivisor: string = 'IsValidDivisor';
const container: Container = new Container();
container
.bind<number>(zero)
.toDynamicValue(async () => Promise.resolve(0))
.whenTagged(isValidDivisor, false);
expect(
await container.getAsync(zero, {
tag: { key: isValidDivisor, value: false },
}),
).to.equal(0);
container
.bind<number>(zero)
.toDynamicValue(async () => Promise.resolve(1))
.whenTagged(isValidDivisor, true);
expect(
await container.getAsync(zero, {
tag: { key: isValidDivisor, value: false },
}),
).to.equal(0);
expect(
await container.getAsync(zero, {
tag: { key: isValidDivisor, value: true },
}),
).to.equal(1);
});
it('should be able to get all the services binded (async)', async () => {
const serviceIdentifier: string = 'service-identifier';
const container: Container = new Container();
const firstValueBinded: string = 'value-one';
const secondValueBinded: string = 'value-two';
const thirdValueBinded: string = 'value-three';
container.bind(serviceIdentifier).toConstantValue(firstValueBinded);
container.bind(serviceIdentifier).toConstantValue(secondValueBinded);
container
.bind(serviceIdentifier)
.toDynamicValue(async (_: ResolutionContext) =>
Promise.resolve(thirdValueBinded),
);
const services: string[] =
await container.getAllAsync<string>(serviceIdentifier);
expect(services).to.deep.eq([
firstValueBinded,
secondValueBinded,
thirdValueBinded,
]);
});
it('Should be able to inject when symbol property key ', () => {
const weaponProperty: unique symbol = Symbol();
type Weapon = unknown;
@injectable()
class Shuriken {}
@injectable()
class Ninja {
@inject('Weapon')
public [weaponProperty]!: Weapon;
}
const container: Container = new Container();
container.bind('Weapon').to(Shuriken);
container.bind(Ninja).toSelf();
const myNinja: Ninja = container.get(Ninja);
const weapon: Weapon = myNinja[weaponProperty];
expect(weapon).to.be.instanceOf(Shuriken);
});
});
================================================
FILE: src/test/container/container_module.test.ts
================================================
import 'reflect-metadata';
import { expect } from 'chai';
import * as sinon from 'sinon';
import {
Container,
ContainerModule,
ContainerModuleLoadOptions,
ResolutionContext,
} from '../..';
describe('ContainerModule', () => {
it('Should be able to set the registry of a container module', () => {
const registry: (
options: ContainerModuleLoadOptions,
) => Promise<void> = async (_options: ContainerModuleLoadOptions) =>
undefined;
const warriors: ContainerModule = new ContainerModule(registry);
expect(warriors.id).to.be.a('number');
});
it('Should be able to remove some bindings from within a container module', async () => {
const container: Container = new Container();
container.bind<string>('A').toConstantValue('1');
expect(container.get<string>('A')).to.eql('1');
const warriors: ContainerModule = new ContainerModule(
async (options: ContainerModuleLoadOptions) => {
await options.unbind('A');
expect(() => {
container.get<string>('A');
}).to.throw();
options.bind<string>('A').toConstantValue('2');
expect(container.get<string>('A')).to.eql('2');
options.bind<string>('B').toConstantValue('3');
expect(container.get<string>('B')).to.eql('3');
},
);
await container.load(warriors);
expect(container.get<string>('A')).to.eql('2');
expect(container.get<string>('B')).to.eql('3');
});
it('Should be able to check for existence of bindings within a container module', async () => {
const container: Container = new Container();
container.bind<string>('A').toConstantValue('1');
expect(container.get<string>('A')).to.eql('1');
const warriors: ContainerModule = new ContainerModule(
async (options: ContainerModuleLoadOptions) => {
expect(options.isBound('A')).to.eql(true);
await options.unbind('A');
expect(options.isBound('A')).to.eql(false);
},
);
await container.load(warriors);
});
it('Should be able to override a binding using rebind within a container module', async () => {
// eslint-disable-next-line @typescript-eslint/typedef
const TYPES = {
someType: 'someType',
};
const container: Container = new Container();
const module1: ContainerModule = new ContainerModule(
async (options: ContainerModuleLoadOptions) => {
options.bind<number>(TYPES.someType).toConstantValue(1);
options.bind<number>(TYPES.someType).toConstantValue(2);
},
);
const module2: ContainerModule = new ContainerModule(
async (options: ContainerModuleLoadOptions) => {
await options.unbind(TYPES.someType);
options.bind<number>(TYPES.someType).toConstantValue(3);
},
);
await container.load(module1);
const values1: unknown[] = container.getAll(TYPES.someType);
expect(values1[0]).to.eq(1);
expect(values1[1]).to.eq(2);
await container.load(module2);
const values2: unknown[] = container.getAll(TYPES.someType);
expect(values2[0]).to.eq(3);
expect(values2[1]).to.eq(undefined);
});
it('Should be able use await async functions in container modules', async () => {
const container: Container = new Container();
const someAsyncFactory: () => Promise<number> = async () =>
new Promise<number>(
(res: (value: number | PromiseLike<number>) => void) =>
setTimeout(() => {
res(1);
}, 100),
);
const A: unique symbol = Symbol.for('A');
const B: unique symbol = Symbol.for('B');
const moduleOne: ContainerModule = new ContainerModule(
async (options: ContainerModuleLoadOptions) => {
const val: number = await someAsyncFactory();
options.bind(A).toConstantValue(val);
},
);
const moduleTwo: ContainerModule = new ContainerModule(
async (options: ContainerModuleLoadOptions) => {
options.bind(B).toConstantValue(2);
},
);
await container.load(moduleOne, moduleTwo);
const aIsBound: boolean = container.isBound(A);
expect(aIsBound).to.eq(true);
const a: unknown = container.get(A);
expect(a).to.eq(1);
});
it('Should be able to add an activation hook through a container module', async () => {
const container: Container = new Container();
const module: ContainerModule = new ContainerModule(
async (options: ContainerModuleLoadOptions) => {
options
.bind<string>('B')
.toConstantValue('2')
.onActivation(() => 'C');
options.onActivation('A', () => 'B');
container.bind<string>('A').toConstantValue('1');
},
);
await container.load(module);
expect(container.get<string>('A')).to.eql('B');
expect(container.get('B')).to.eql('C');
});
it('Should be able to add a deactivation hook through a container module', async () => {
const container: Container = new Container();
container.bind<string>('A').toConstantValue('1');
let deact: boolean = false;
const warriors: ContainerModule = new ContainerModule(
async (options: ContainerModuleLoadOptions) => {
options.onDeactivation('A', () => {
deact = true;
});
},
);
await container.load(warriors);
container.get('A');
await container.unbind('A');
expect(deact).eql(true);
});
it('Should be able to add an async deactivation hook through a container module (async)', async () => {
const container: Container = new Container();
container.bind<string>('A').toConstantValue('1');
let deact: boolean = false;
const warriors: ContainerModule = new ContainerModule(
async (options: ContainerModuleLoadOptions) => {
options.onDeactivation('A', async () => {
deact = true;
});
},
);
await container.load(warriors);
container.get('A');
await container.unbind('A');
expect(deact).eql(true);
});
it('Should be able to add multiple async deactivation hook through a container module (async)', async () => {
const onActivationHandlerSpy: sinon.SinonSpy<[], Promise<void>> = sinon.spy<
() => Promise<void>
>(async () => undefined);
const serviceIdentifier: string = 'destroyable';
const container: Container = new Container();
const containerModule: ContainerModule = new ContainerModule(
async (options: ContainerModuleLoadOptions) => {
options.onDeactivation(serviceIdentifier, onActivationHandlerSpy);
options.onDeactivation(serviceIdentifier, onActivationHandlerSpy);
},
);
container.bind(serviceIdentifier).toConstantValue(serviceIdentifier);
container.get(serviceIdentifier);
await container.load(containerModule);
await container.unbind(serviceIdentifier);
expect(onActivationHandlerSpy.callCount).to.eq(2);
});
it('Should remove module bindings when unload', async () => {
const sid: string = 'sid';
const container: Container = new Container();
container.bind<string>(sid).toConstantValue('Not module');
const module: ContainerModule = new ContainerModule(
async (options: ContainerModuleLoadOptions) => {
options.bind<string>(sid).toConstantValue('Module');
},
);
await container.load(module);
expect(container.getAll(sid)).to.deep.equal(['Not module', 'Module']);
await container.unload(module);
expect(container.getAll(sid)).to.deep.equal(['Not module']);
});
it('Should deactivate singletons from module bindings when unload', async () => {
const sid: string = 'sid';
const container: Container = new Container();
let moduleBindingDeactivated: string | undefined;
let containerDeactivated: string | undefined;
const module: ContainerModule = new ContainerModule(
async (options: ContainerModuleLoadOptions) => {
options
.bind<string>(sid)
.toConstantValue('Module')
.onDeactivation((injectable: string) => {
moduleBindingDeactivated = injectable;
});
options.onDeactivation<string>(sid, (injectable: string) => {
containerDeactivated = injectable;
});
},
);
await container.load(module);
container.get(sid);
await container.unload(module);
expect(moduleBindingDeactivated).to.equal('Module');
expect(containerDeactivated).to.equal('Module');
});
it('Should remove container handlers from module when unload', async () => {
const sid: string = 'sid';
const container: Container = new Container();
let activatedNotModule: string | undefined;
let deactivatedNotModule: string | undefined;
container.onActivation<string>(
sid,
(_: ResolutionContext, injected: string) => {
activatedNotModule = injected;
return injected;
},
);
container.onDeactivation<string>(sid, (injected: string) => {
deactivatedNotModule = injected;
});
container.bind<string>(sid).toConstantValue('Value');
let activationCount: number = 0;
let deactivationCount: number = 0;
const module: ContainerModule = new ContainerModule(
async (options: ContainerModuleLoadOptions) => {
options.onDeactivation<string>(sid, (_: string) => {
deactivationCount++;
});
options.onActivation<string>(
sid,
(_: ResolutionContext, injected: string) => {
activationCount++;
return injected;
},
);
},
);
await container.load(module);
await container.unload(module);
container.get(sid);
await container.unbind(sid);
expect(activationCount).to.equal(0);
expect(deactivationCount).to.equal(0);
expect(activatedNotModule).to.equal('Value');
expect(deactivatedNotModule).to.equal('Value');
});
it('Should remove module bindings when unloadAsync', async () => {
const sid: string = 'sid';
const container: Container = new Container();
container.onDeactivation(sid, async (_injected: unknown) =>
Promise.resolve(),
);
container.bind<string>(sid).toConstantValue('Not module');
const module: ContainerModule = new ContainerModule(
async (options: ContainerModuleLoadOptions) => {
options.bind<string>(sid).toConstantValue('Module');
},
);
await container.load(module);
let values: unknown[] = container.getAll(sid);
expect(values).to.deep.equal(['Not module', 'Module']);
await container.unload(module);
values = container.getAll(sid);
expect(values).to.deep.equal(['Not module']);
});
it('Should deactivate singletons from module bindings when unloadAsync', async () => {
const sid: string = 'sid';
const container: Container = new Container();
let moduleBindingDeactivated: string | undefined;
let containerDeactivated: string | undefined;
const module: ContainerModule = new ContainerModule(
async (options: ContainerModuleLoadOptions) => {
options
.bind<string>(sid)
.toConstantValue('Module')
.onDeactivation((injectable: string) => {
moduleBindingDeactivated = injectable;
});
options.onDeactivation<string>(sid, async (injectable: string) => {
containerDeactivated = injectable;
return Promise.resolve();
});
},
);
await container.load(module);
container.get(sid);
await container.unload(module);
expect(moduleBindingDeactivated).to.equal('Module');
expect(containerDeactivated).to.equal('Module');
});
it('Should remove container handlers from module when unloadAsync', async () => {
const sid: string = 'sid';
const container: Container = new Container();
let activatedNotModule: string | undefined;
let deactivatedNotModule: string | undefined;
container.onActivation<string>(
sid,
(_: ResolutionContext, injected: string) => {
activatedNotModule = injected;
return injected;
},
);
container.onDeactivation<string>(sid, (injected: string) => {
deactivatedNotModule = injected;
});
container.bind<string>(sid).toConstantValue('Value');
let activationCount: number = 0;
let deactivationCount: number = 0;
const module: ContainerModule = new ContainerModule(
async (options: ContainerModuleLoadOptions) => {
options.onDeactivation<string>(sid, async (_: string) => {
deactivationCount++;
return Promise.resolve();
});
options.onActivation<string>(
sid,
(_: ResolutionContext, injected: string) => {
activationCount++;
return injected;
},
);
},
);
await container.load(module);
await container.unload(module);
container.get(sid);
await container.unbind(sid);
expect(activationCount).to.equal(0);
expect(deactivationCount).to.equal(0);
expect(activatedNotModule).to.equal('Value');
expect(deactivatedNotModule).to.equal('Value');
});
it('should be able to unbindAsync from a module', async () => {
const sid: string = 'sid';
const container: Container = new Container();
const module: ContainerModule = new ContainerModule(
async (options: ContainerModuleLoadOptions) => {
await options.unbind(sid);
},
);
container.bind<string>(sid).toConstantValue('Value');
container.bind<string>(sid).toConstantValue('Value2');
const deactivated: string[] = [];
container.onDeactivation<string>(sid, async (injected: string) => {
deactivated.push(injected);
return Promise.resolve();
});
container.getAll(sid);
await container.load(module);
expect(deactivated).to.deep.equal(['Value', 'Value2']);
//bindings removed
expect(container.getAll(sid)).to.deep.equal([]);
});
});
================================================
FILE: src/test/features/named_default.test.ts
================================================
import 'reflect-metadata';
import { expect } from 'chai';
import { Container, inject, injectable, named } from '../..';
describe('Named default', () => {
it('Should be able to inject a default to avoid ambiguous binding exceptions', () => {
// eslint-disable-next-line @typescript-eslint/typedef
const TYPES = {
Warrior: 'Warrior',
Weapon: 'Weapon',
};
// eslint-disable-next-line @typescript-eslint/typedef
const TAG = {
chinese: 'chinese',
japanese: 'japanese',
throwable: 'throwable',
};
interface Weapon {
name: string;
}
interface Warrior {
name: string;
weapon: Weapon;
}
@injectable()
class Katana implements Weapon {
public name: string;
constructor() {
this.name = 'Katana';
}
}
@injectable()
class Shuriken implements Weapon {
public name: string;
constructor() {
this.name = 'Shuriken';
}
}
@injectable()
class Samurai implements Warrior {
public name: string;
public weapon: Weapon;
constructor(@inject(TYPES.Weapon) weapon: Weapon) {
this.name = 'Samurai';
this.weapon = weapon;
}
}
@injectable()
class Ninja implements Warrior {
public name: string;
public weapon: Weapon;
constructor(@inject(TYPES.Weapon) @named(TAG.throwable) weapon: Weapon) {
this.name = 'Ninja';
this.weapon = weapon;
}
}
const container: Container = new Container();
container.bind<Warrior>(TYPES.Warrior).to(Ninja).whenNamed(TAG.chinese);
container.bind<Warrior>(TYPES.Warrior).to(Samurai).whenNamed(TAG.japanese);
container.bind<Weapon>(TYPES.Weapon).to(Shuriken).whenNamed(TAG.throwable);
container.bind<Weapon>(TYPES.Weapon).to(Katana).whenDefault();
const ninja: Warrior = container.get<Warrior>(TYPES.Warrior, {
name: TAG.chinese,
});
const samurai: Warrior = container.get<Warrior>(TYPES.Warrior, {
name: TAG.japanese,
});
expect(ninja.name).to.eql('Ninja');
expect(ninja.weapon.name).to.eql('Shuriken');
expect(samurai.name).to.eql('Samurai');
expect(samurai.weapon.name).to.eql('Katana');
});
it('Should be able to select a default to avoid ambiguous binding exceptions', () => {
// eslint-disable-next-line @typescript-eslint/typedef
const TYPES = {
Weapon: 'Weapon',
};
// eslint-disable-next-line @typescript-eslint/typedef
const TAG = {
throwable: 'throwable',
};
interface Weapon {
name: string;
}
@injectable()
class Katana implements Weapon {
public name: string;
constructor() {
this.name = 'Katana';
}
}
@injectable()
class Shuriken implements Weapon {
public name: string;
constructor() {
this.name = 'Shuriken';
}
}
const container: Container = new Container();
container.bind<Weapon>(TYPES.Weapon).to(Shuriken).whenNamed(TAG.throwable);
container
.bind<Weapon>(TYPES.Weapon)
.to(Katana)
.inSingletonScope()
.whenDefault();
const defaultWeapon: Weapon = container.get<Weapon>(TYPES.Weapon);
const throwableWeapon: Weapon = container.get<Weapon>(TYPES.Weapon, {
name: TAG.throwable,
});
expect(defaultWeapon.name).eql('Katana');
expect(throwableWeapon.name).eql('Shuriken');
});
});
================================================
FILE: src/test/features/property_injection.test.ts
================================================
import 'reflect-metadata';
import { expect } from 'chai';
import {
Container,
inject,
injectable,
injectFromBase,
multiInject,
named,
optional,
tagged,
unmanaged,
} from '../..';
describe('Property Injection', () => {
it('Should be able to inject a property', () => {
// eslint-disable-next-line @typescript-eslint/typedef
const TYPES = {
Warrior: 'Warrior',
Weapon: 'Weapon',
};
interface Weapon {
name: string;
}
@injectable()
class Katana implements Weapon {
public name: string;
constructor() {
this.name = 'Katana';
}
}
interface Warrior {
name: string;
weapon: Weapon;
}
@injectable()
class Samurai implements Warrior {
@inject(TYPES.Weapon)
public weapon!: Weapon;
public name: string;
constructor() {
this.name = 'Samurai';
}
}
const container: Container = new Container();
container.bind<Warrior>(TYPES.Warrior).to(Samurai);
container.bind<Weapon>(TYPES.Weapon).to(Katana);
const warrior: Warrior = container.get<Warrior>(TYPES.Warrior);
expect(warrior.name).to.eql('Samurai');
expect(warrior.weapon).not.to.eql(undefined);
expect(warrior.weapon.name).to.eql('Katana');
});
it('Should be able to inject a property combined with constructor injection', () => {
// eslint-disable-next-line @typescript-eslint/typedef
const TYPES = {
Warrior: 'Warrior',
Weapon: 'Weapon',
};
// eslint-disable-next-line @typescript-eslint/typedef
const TAGS = {
Primary: 'Primary',
Secondary: 'Secondary',
};
interface Weapon {
name: string;
}
@injectable()
class Katana implements Weapon {
public name: string;
constructor() {
this.name = 'Katana';
}
}
@injectable()
class Shuriken implements Weapon {
public name: string;
constructor() {
this.name = 'Shuriken';
}
}
interface Warrior {
name: string;
primaryWeapon: Weapon;
secondaryWeapon: Weapon;
}
@injectable()
class Samurai implements Warrior {
@inject(TYPES.Weapon)
@named(TAGS.Secondary)
public secondaryWeapon!: Weapon;
public name: string;
public primaryWeapon: Weapon;
constructor(@inject(TYPES.Weapon) @named(TAGS.Primary) weapon: Weapon) {
this.name = 'Samurai';
this.primaryWeapon = weapon;
}
}
const container: Container = new Container();
container.bind<Warrior>(TYPES.Warrior).to(Samurai);
container.bind<Weapon>(TYPES.Weapon).to(Katana).whenNamed(TAGS.Primary);
container.bind<Weapon>(TYPES.Weapon).to(Shuriken).whenNamed(TAGS.Secondary);
const warrior: Warrior = container.get<Warrior>(TYPES.Warrior);
expect(warrior.name).to.eql('Samurai');
expect(warrior.primaryWeapon).not.to.eql(undefined);
expect(warrior.primaryWeapon.name).to.eql('Katana');
expect(warrior.secondaryWeapon).not.to.eql(undefined);
expect(warrior.secondaryWeapon.name).to.eql('Shuriken');
});
it('Should be able to inject a named property', () => {
// eslint-disable-next-line @typescript-eslint/typedef
const TYPES = {
Warrior: 'Warrior',
Weapon: 'Weapon',
};
// eslint-disable-next-line @typescript-eslint/typedef
const TAGS = {
Primary: 'Primary',
Secondary: 'Secondary',
};
interface Weapon {
name: string;
}
@injectable()
class Katana implements Weapon {
public name: string;
constructor() {
this.name = 'Katana';
}
}
@injectable()
class Shuriken implements Weapon {
public name: string;
constructor() {
this.name = 'Shuriken';
}
}
interface Warrior {
name: string;
primaryWeapon: Weapon;
secondaryWeapon: Weapon;
}
@injectable()
class Samurai implements Warrior {
@inject(TYPES.Weapon)
@named(TAGS.Primary)
public primaryWeapon!: Weapon;
@inject(TYPES.Weapon)
@named(TAGS.Secondary)
public secondaryWeapon!: Weapon;
public name: string;
constructor() {
this.name = 'Samurai';
}
}
const container: Container = new Container();
container.bind<Warrior>(TYPES.Warrior).to(Samurai);
container.bind<Weapon>(TYPES.Weapon).to(Katana).whenNamed(TAGS.Primary);
container.bind<Weapon>(TYPES.Weapon).to(Shuriken).whenNamed(TAGS.Secondary);
const warrior: Warrior = container.get<Warrior>(TYPES.Warrior);
expect(warrior.name).to.eql('Samurai');
expect(warrior.primaryWeapon).not.to.eql(undefined);
expect(warrior.primaryWeapon.name).to.eql('Katana');
expect(warrior.secondaryWeapon).not.to.eql(undefined);
expect(warrior.secondaryWeapon.name).to.eql('Shuriken');
});
it('Should be able to inject a tagged property', () => {
// eslint-disable-next-line @typescript-eslint/typedef
const TYPES = {
Warrior: 'Warrior',
Weapon: 'Weapon',
};
// eslint-disable-next-line @typescript-eslint/typedef
const TAGS = {
Primary: 'Primary',
Priority: 'Priority',
Secondary: 'Secondary',
};
interface Weapon {
name: string;
}
@injectable()
class Katana implements Weapon {
public name: string;
constructor() {
this.name = 'Katana';
}
}
@injectable()
class Shuriken implements Weapon {
public name: string;
constructor() {
this.name = 'Shuriken';
}
}
interface Warrior {
name: string;
primaryWeapon: Weapon;
secondaryWeapon: Weapon;
}
@injectable()
class Samurai implements Warrior {
@inject(TYPES.Weapon)
@tagged(TAGS.Priority, TAGS.Primary)
public primaryWeapon!: Weapon;
@inject(TYPES.Weapon)
@tagged(TAGS.Priority, TAGS.Secondary)
public secondaryWeapon!: Weapon;
public name: string;
constructor() {
this.name = 'Samurai';
}
}
const container: Container = new Container();
container.bind<Warrior>(TYPES.Warrior).to(Samurai);
container
.bind<Weapon>(TYPES.Weapon)
.to(Katana)
.whenTagged(TAGS.Priority, TAGS.Primary);
container
.bind<Weapon>(TYPES.Weapon)
.to(Shuriken)
.whenTagged(TAGS.Priority, TAGS.Secondary);
const warrior: Warrior = container.get<Warrior>(TYPES.Warrior);
expect(warrior.name).to.eql('Samurai');
expect(warrior.primaryWeapon).not.to.eql(undefined);
expect(warrior.primaryWeapon.name).to.eql('Katana');
expect(warrior.secondaryWeapon).not.to.eql(undefined);
expect(warrior.secondaryWeapon.name).to.eql('Shuriken');
});
it('Should be able to multi-inject a property', () => {
// eslint-disable-next-line @typescript-eslint/typedef
const TYPES = {
Warrior: 'Warrior',
Weapon: 'Weapon',
};
interface Weapon {
name: string;
}
@injectable()
class Katana implements Weapon {
public name: string;
constructor() {
this.name = 'Katana';
}
}
@injectable()
class Shuriken implements Weapon {
public name: string;
constructor() {
this.name = 'Shuriken';
}
}
interface Warrior {
name: string;
weapons: Weapon[];
}
@injectable()
class Samurai implements Warrior {
@multiInject(TYPES.Weapon)
public weapons!: Weapon[];
public name: string;
constructor() {
this.name = 'Samurai';
}
}
const container: Container = new Container();
container.bind<Warrior>(TYPES.Warrior).to(Samurai);
container.bind<Weapon>(TYPES.Weapon).to(Katana);
container.bind<Weapon>(TYPES.Weapon).to(Shuriken);
const warrior: Warrior = container.get<Warrior>(TYPES.Warrior);
expect(warrior.name).to.eql('Samurai');
expect(warrior.weapons[0]).not.to.eql(undefined);
expect(warrior.weapons[0]?.name).to.eql('Katana');
expect(warrior.weapons[1]).not.to.eql(undefined);
expect(warrior.weapons[1]?.name).to.eql('Shuriken');
});
it('Should be able to inject a property in a base class', () => {
// eslint-disable-next-line @typescript-eslint/typedef
const TYPES = {
Warrior: 'Warrior',
Weapon: 'Weapon',
};
// eslint-disable-next-line @typescript-eslint/typedef
const TAGS = {
Primary: 'Primary',
Priority: 'Priority',
Secondary: 'Secondary',
};
interface Weapon {
name: string;
}
@injectable()
class Katana implements Weapon {
public name: string;
constructor() {
this.name = 'Katana';
}
}
@injectable()
class Shuriken implements Weapon {
public name: string;
constructor() {
this.name = 'Shuriken';
}
}
interface Warrior {
name: string;
primaryWeapon: Weapon;
}
@injectable()
class BaseWarrior implements Warrior {
@inject(TYPES.Weapon)
@tagged(TAGS.Priority, TAGS.Primary)
public primaryWeapon!: Weapon;
public name: string;
constructor(@unmanaged() name: string) {
this.name = name;
}
}
@injectable()
@injectFromBase({
extendConstructorArguments: false,
extendProperties: true,
})
class Samurai extends BaseWarrior {
@inject(TYPES.Weapon)
@tagged(TAGS.Priority, TAGS.Secondary)
public secondaryWeapon!: Weapon;
constructor() {
super('Samurai');
}
}
const container: Container = new Container();
container.bind<Warrior>(TYPES.Warrior).to(Samurai);
container
.bind<Weapon>(TYPES.Weapon)
.to(Katana)
.whenTagged(TAGS.Priority, TAGS.Primary);
container
.bind<Weapon>(TYPES.Weapon)
.to(Shuriken)
.whenTagged(TAGS.Priority, TAGS.Secondary);
const samurai: Samurai = container.get<Samurai>(TYPES.Warrior);
expect(samurai.name).to.eql('Samurai');
expect(samurai.secondaryWeapon).not.to.eql(undefined);
expect(samurai.secondaryWeapon.name).to.eql('Shuriken');
expect(samurai.primaryWeapon).not.to.eql(undefined);
expect(samurai.primaryWeapon.name).to.eql('Katana');
});
it('Should be able to flag a property injection as optional', () => {
// eslint-disable-next-line @typescript-eslint/typedef
const TYPES = {
Route: 'Route',
Router: 'Router',
};
interface Route {
name: string;
}
@injectable()
class Router {
@inject(TYPES.Route)
@optional()
private readonly route!: Route;
public getRoute(): Route {
return this.route;
}
}
const container: Container = new Container();
container.bind<Router>(TYPES.Router).to(Router);
const router1: Router = container.get<Router>(TYPES.Router);
expect(router1.getRoute()).to.eql(undefined);
container.bind<Route>(TYPES.Route).toConstantValue({ name: 'route1' });
const router2: Router = container.get<Router>(TYPES.Router);
expect(router2.getRoute().name).to.eql('route1');
});
});
================================================
FILE: src/test/features/provider.test.ts
================================================
import 'reflect-metadata';
import { expect } from 'chai';
import { Container, injectable, Provider, ResolutionContext } from '../..';
describe('Provider', () => {
it('Should support complex asynchronous initialization processes', (done: Mocha.Done) => {
@injectable()
class Ninja {
public level: number;
public rank: string;
constructor() {
this.level = 0;
this.rank = 'Ninja';
}
public async train(): Promise<number> {
return new Promise<number>(
(resolve: (value: number | PromiseLike<number>) => void) => {
setTimeout(() => {
this.level += 10;
resolve(this.level);
}, 10);
},
);
}
}
@injectable()
class NinjaMaster {
public rank: string;
constructor() {
this.rank = 'NinjaMaster';
}
}
type NinjaMasterProvider = () => Promise<NinjaMaster>;
const container: Container = new Container();
container.bind<Ninja>('Ninja').to(Ninja).inSingletonScope();
// eslint-disable-next-line @typescript-eslint/no-deprecated
container.bind<NinjaMasterProvider>('Provider<NinjaMaster>').toProvider(
(context: ResolutionContext) => async () =>
new Promise<NinjaMaster>(
(
resolve: (value: NinjaMaster | PromiseLike<NinjaMaster>) => void,
reject: (reason?: unknown) => void,
) => {
const ninja: Ninja = context.get<Ninja>('Ninja');
void ninja.train().then((level: number) => {
if (level >= 20) {
resolve(new NinjaMaster());
} else {
// eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors
reject('Not enough training');
}
});
},
),
);
const ninjaMasterProvider: NinjaMasterProvider =
container.get<NinjaMasterProvider>('Provider<NinjaMaster>');
// helper
async function valueOrDefault<T>(
provider: () => Promise<T>,
defaultValue: T,
) {
return new Promise<T>((resolve: (value: T | PromiseLike<T>) => void) => {
provider()
.then((value: T) => {
resolve(value);
})
.catch(() => {
resolve(defaultValue);
});
});
}
void valueOrDefault(ninjaMasterProvider, {
rank: 'DefaultNinjaMaster',
}).then((ninjaMaster: NinjaMaster) => {
expect(ninjaMaster.rank).to.eql('DefaultNinjaMaster');
});
void valueOrDefault(ninjaMasterProvider, {
rank: 'DefaultNinjaMaster',
}).then((ninjaMaster: NinjaMaster) => {
expect(ninjaMaster.rank).to.eql('NinjaMaster');
done();
});
});
it('Should support custom arguments', (done: Mocha.Done) => {
const container: Container = new Container();
interface Sword {
material: string;
damage: number;
}
@injectable()
class Katana implements Sword {
public material!: string;
public damage!: number;
}
container.bind<Sword>('Sword').to(Katana);
// eslint-disable-next-line @typescript-eslint/no-deprecated
type SwordProvider = Provider<Sword, [string, number]>;
// eslint-disable-next-line @typescript-eslint/no-deprecated
container.bind<SwordProvider>('SwordProvider').toProvider(
(context: ResolutionContext): SwordProvider =>
async (material: string, damage: number) =>
new Promise<Sword>(
(resolve: (value: Sword | PromiseLike<Sword>) => void) => {
setTimeout(() => {
const katana: Sword = context.get<Sword>('Sword');
katana.material = material;
katana.damage = damage;
resolve(katana);
}, 10);
},
),
);
const katanaProvider: SwordProvider =
container.get<SwordProvider>('SwordProvider');
void katanaProvider('gold', 100).then((powerfulGoldKatana: Sword) => {
expect(powerfulGoldKatana.material).to.eql('gold');
expect(powerfulGoldKatana.damage).to.eql(100);
void katanaProvider('gold', 10).then((notSoPowerfulGoldKatana: Sword) => {
expect(notSoPowerfulGoldKatana.material).to.eql('gold');
expect(notSoPowerfulGoldKatana.damage).to.eql(10);
done();
});
});
});
it('Should support the declaration of singletons', (done: Mocha.Done) => {
const container: Container = new Container();
interface Warrior {
level: number;
}
@injectable()
class Ninja implements Warrior {
public level: number;
constructor() {
this.level = 0;
}
}
type WarriorProvider = (level: number) => Promise<Warrior>;
container.bind<Warrior>('Warrior').to(Ninja).inSingletonScope(); // Value is singleton!
// eslint-disable-next-line @typescript-eslint/no-deprecated
container.bind<WarriorProvider>('WarriorProvider').toProvider(
(context: ResolutionContext) => async (increaseLevel: number) =>
new Promise<Warrior>((resolve: (value: Warrior) => void) => {
setTimeout(() => {
const warrior: Warrior = context.get<Warrior>('Warrior');
warrior.level += increaseLevel;
resolve(warrior);
}, 100);
}),
);
const warriorProvider: WarriorProvider = container.get('WarriorProvider');
void warriorProvider(10).then((warrior: Warrior) => {
expect(warrior.level).to.eql(10);
void warriorProvider(10).then((warrior2: Warrior) => {
expect(warrior2.level).to.eql(20);
done();
});
});
});
});
================================================
FILE: src/test/features/request_scope.test.ts
================================================
import 'reflect-metadata';
import { expect } from 'chai';
import { performance } from 'perf_hooks';
import { Container, inject, injectable, named } from '../..';
describe('inRequestScope', () => {
it('Should support request scope in basic bindings', () => {
// eslint-disable-next-line @typescript-eslint/typedef
const TYPE = {
Warrior: Symbol('Warrior'),
Weapon: Symbol('Weapon'),
};
interface Weapon {
use(): string;
}
interface Warrior {
primaryWeapon: Weapon;
secondaryWeapon: Weapon;
}
@injectable()
class Katana implements Weapon {
private readonly _madeOn: number;
constructor() {
this._madeOn = performance.now();
}
public use() {
return `Used Katana made on ${this._madeOn.toString()}!`;
}
}
@injectable()
class Samurai implements Warrior {
public primaryWeapon: Weapon;
public secondaryWeapon: Weapon;
constructor(
@inject(TYPE.Weapon) primaryWeapon: Weapon,
@inject(TYPE.Weapon) secondaryWeapon: Weapon,
) {
this.primaryWeapon = primaryWeapon;
this.secondaryWeapon = secondaryWeapon;
}
}
// Without request scope
const container: Container = new Container();
container.bind<Weapon>(TYPE.Weapon).to(Katana);
container.bind<Warrior>(TYPE.Warrior).to(Samurai);
const samurai: Warrior = container.get(TYPE.Warrior);
const samurai2: Warrior = container.get(TYPE.Warrior);
// One requests should use two instances because scope is transient
expect(samurai.primaryWeapon.use()).not.to.eql(
samurai.secondaryWeapon.use(),
);
// One requests should use two instances because scope is transient
expect(samurai2.primaryWeapon.use()).not.to.eql(
samurai2.secondaryWeapon.use(),
);
// Two request should use two Katana instances
// for each instance of Samuari because scope is transient
expect(samurai.primaryWeapon.use()).not.to.eql(
samurai2.primaryWeapon.use(),
);
expect(samurai.secondaryWeapon.use()).not.to.eql(
samurai2.secondaryWeapon.use(),
);
// With request scope
const container1: Container = new Container();
container1.bind<Weapon>(TYPE.Weapon).to(Katana).inRequestScope(); // Important
container1.bind<Warrior>(TYPE.Warrior).to(Samurai);
const samurai3: Warrior = container1.get(TYPE.Warrior);
const samurai4: Warrior = container1.get(TYPE.Warrior);
// One requests should use one instance because scope is request scope
expect(samurai3.primaryWeapon.use()).to.eql(samurai3.secondaryWeapon.use());
// One requests should use one instance because scope is request scope
expect(samurai4.primaryWeapon.use()).to.eql(samurai4.secondaryWeapon.use());
// Two request should use one instances of Katana
// for each instance of Samurai because scope is request scope
expect(samurai3.primaryWeapon.use()).not.to.eql(
samurai4.primaryWeapon.use(),
);
expect(samurai3.secondaryWeapon.use()).not.to.eql(
samurai4.secondaryWeapon.use(),
);
});
it('Should support request scope when using contraints', () => {
// eslint-disable-next-line @typescript-eslint/typedef
const TYPE = {
Warrior: Symbol('Warrior'),
Weapon: Symbol('Weapon'),
};
interface Weapon {
use(): string;
}
interface Warrior {
primaryWeapon: Weapon;
secondaryWeapon: Weapon;
tertiaryWeapon: Weapon;
}
@injectable()
class Katana implements Weapon {
private readonly _madeOn: number;
constructor() {
this._madeOn = performance.now();
}
public use() {
return `Used Katana made on ${this._madeOn.toString()}!`;
}
}
@injectable()
class Shuriken implements Weapon {
private readonly _madeOn: number;
constructor() {
this._madeOn = performance.now();
}
public use() {
return `Used Shuriken made on ${this._madeOn.toString()}!`;
}
}
@injectable()
class Samurai implements Warrior {
public primaryWeapon: Weapon;
public secondaryWeapon: Weapon;
public tertiaryWeapon: Weapon;
constructor(
@inject(TYPE.Weapon) @named('sword') primaryWeapon: Weapon,
@inject(TYPE.Weapon) @named('throwable') secondaryWeapon: Weapon,
@inject(TYPE.Weapon) @named('throwable') tertiaryWeapon: Weapon,
) {
this.primaryWeapon = primaryWeapon;
this.secondaryWeapon = secondaryWeapon;
this.tertiaryWeapon = tertiaryWeapon;
}
}
const container: Container = new Container();
container
.bind<Weapon>(TYPE.Weapon)
.to(Katana)
.inRequestScope()
.whenNamed('sword');
container
.bind<Weapon>(TYPE.Weapon)
.to(Shuriken)
.inRequestScope()
.whenNamed('throwable');
container.bind<Warrior>(TYPE.Warrior).to(Samurai);
const samurai1: Warrior = container.get<Warrior>(TYPE.Warrior);
const samurai2: Warrior = container.get<Warrior>(TYPE.Warrior);
// Katana and Shuriken are two instances
expect(samurai1.primaryWeapon.use()).not.to.eql(
samurai1.secondaryWeapon.use(),
);
// Shuriken should be one shared instance because scope is request scope
expect(samurai1.secondaryWeapon.use()).to.eql(
samurai1.tertiaryWeapon.use(),
);
// Katana and Shuriken are two instances
expect(samurai2.primaryWeapon.use()).not.to.eql(
samurai2.secondaryWeapon.use(),
);
// Shuriken should be one shared instance because scope is request scope
expect(samurai2.secondaryWeapon.use()).to.eql(
samurai2.tertiaryWeapon.use(),
);
// Two request should use one instances of Katana
// for each instance of Samurai because scope is request scope
expect(samurai1.secondaryWeapon.use()).not.to.eql(
samurai2.secondaryWeapon.use(),
);
expect(samurai1.tertiaryWeapon.use()).not.to.eql(
samurai2.tertiaryWeapon.use(),
);
});
});
================================================
FILE: src/test/features/transitive_bindings.test.ts
================================================
import 'reflect-metadata';
import { expect } from 'chai';
import { Container, injectable } from '../..';
describe('Transitive bindings', () => {
it('Should be able to bind to a service', () => {
@injectable()
class MySqlDatabaseTransactionLog {
public time: number;
public name: string;
constructor() {
this.time = new Date().getTime();
this.name = 'MySqlDatabaseTransactionLog';
}
}
@injectable()
class DatabaseTransactionLog {
public time!: number;
public name!: string;
}
@injectable()
class TransactionLog {
public time!: number;
public name!: string;
}
const container: Container = new Container();
container.bind(MySqlDatabaseTransactionLog).toSelf().inSingletonScope();
container
.bind(DatabaseTransactionLog)
.toService(MySqlDatabaseTransactionLog);
container.bind(TransactionLog).toService(DatabaseTransactionLog);
const mySqlDatabaseTransactionLog: MySqlDatabaseTransactionLog =
container.get(MySqlDatabaseTransactionLog);
const databaseTransactionLog: DatabaseTransactionLog = container.get(
DatabaseTransactionLog,
);
const transactionLog: TransactionLog = container.get(TransactionLog);
expect(mySqlDatabaseTransactionLog.name).to.eq(
'MySqlDatabaseTransactionLog',
);
expect(databaseTransactionLog.name).to.eq('MySqlDatabaseTransactionLog');
expect(transactionLog.name).to.eq('MySqlDatabaseTransactionLog');
expect(mySqlDatabaseTransactionLog.time).to.eq(databaseTransactionLog.time);
expect(databaseTransactionLog.time).to.eq(transactionLog.time);
});
});
================================================
FILE: src/test/inversify.test.ts
================================================
import 'reflect-metadata';
import { expect } from 'chai';
import {
BindingConstraints,
Container,
ContainerModule,
ContainerModuleLoadOptions,
decorate,
Factory,
inject,
injectable,
LazyServiceIdentifier,
multiInject,
named,
Newable,
ResolutionContext,
tagged,
} from '..';
describe('InversifyJS', () => {
it('Should be able to resolve and inject dependencies', () => {
interface NinjaInterface {
fight(): string;
sneak(): string;
}
interface KatanaInterface {
hit(): string;
}
interface ShurikenInterface {
throw(): string;
}
@injectable()
class Katana implements KatanaInterface {
public hit() {
return 'cut!';
}
}
@injectable()
class Shuriken implements ShurikenInterface {
public throw() {
return 'hit!';
}
}
@injectable()
class Ninja implements NinjaInterface {
private readonly _katana: KatanaInterface;
private readonly _shuriken: ShurikenInterface;
constructor(
@inject('Katana') katana: KatanaInterface,
@inject('Shuriken') shuriken: ShurikenInterface,
) {
this._katana = katana;
this._shuriken = shuriken;
}
public fight() {
return this._katana.hit();
}
public sneak() {
return this._shuriken.throw();
}
}
const container: Container = new Container();
container.bind<NinjaInterface>('Ninja').to(Ninja);
container.bind<KatanaInterface>('Katana').to(Katana);
container.bind<ShurikenInterface>('Shuriken').to(Shuriken);
const ninja: NinjaInterface = container.get('Ninja');
expect(ninja.fight()).eql('cut!');
expect(ninja.sneak()).eql('hit!');
});
it('Should be able to do setter injection and property injection', () => {
@injectable()
class Shuriken {
public throw() {
return 'hit!';
}
}
@injectable()
class Katana implements Katana {
public hit() {
return 'cut!';
}
}
@injectable()
class Ninja {
@inject(Katana)
public katana!: Katana;
private _shuriken!: Shuriken;
@inject(Shuriken)
public set Shuriken(shuriken: Shuriken) {
this._shuriken = shuriken;
}
public sneak() {
return this._shuriken.throw();
}
public fight() {
return this.katana.hit();
}
}
const container: Container = new Container();
container.bind<Ninja>('Ninja').to(Ninja);
container.bind(Shuriken).toSelf();
container.bind(Katana).toSelf();
const ninja: Ninja = container.get<Ninja>('Ninja');
expect(ninja.sneak()).to.eql('hit!');
expect(ninja.fight()).to.eql('cut!');
});
it('Should be able to resolve and inject dependencies in VanillaJS', () => {
// eslint-disable-next-line @typescript-eslint/typedef
const TYPES = {
Blowgun: 'Blowgun',
Katana: 'Katana',
Ninja: 'Ninja',
Shuriken: 'Shuriken',
};
class Blowgun {
public blow() {
return 'poison!';
}
}
class Katana {
public hit() {
return 'cut!';
}
}
class Shuriken {
public throw() {
return 'hit!';
}
}
class Ninja {
public _katana: Katana;
public _shuriken: Shuriken;
public _blowgun!: Blowgun;
constructor(katana: Katana, shuriken: Shuriken) {
this._katana = katana;
this._shuriken = shuriken;
}
public set blowgun(blowgun: Blowgun) {
this._blowgun = blowgun;
}
public fight() {
return this._katana.hit();
}
public sneak() {
return this._shuriken.throw();
}
public poisonDart() {
return this._blowgun.blow();
}
}
decorate([injectable()], Katana);
decorate([injectable()], Shuriken);
decorate([injectable()], Ninja);
decorate([injectable()], Blowgun);
decorate([inject(TYPES.Katana)], Ninja, 0);
decorate([inject(TYPES.Shuriken)], Ninja, 1);
decorate([inject(TYPES.Blowgun)], Ninja, 'blowgun');
const container: Container = new Container();
container.bind<Ninja>(TYPES.Ninja).to(Ninja);
container.bind<Katana>(TYPES.Katana).to(Katana);
container.bind<Shuriken>(TYPES.Shuriken).to(Shuriken);
container.bind<Blowgun>(TYPES.Blowgun).to(Blowgun);
const ninja: Ninja = container.get(TYPES.Ninja);
expect(ninja.fight()).eql('cut!');
expect(ninja.sneak()).eql('hit!');
expect(ninja.poisonDart()).eql('poison!');
});
it('Should be able to use classes as runtime identifiers', () => {
@injectable()
class Katana {
public hit() {
return 'cut!';
}
}
@injectable()
class Shuriken {
public throw() {
return 'hit!';
}
}
@injectable()
class Ninja {
private readonly _katana: Katana;
private readonly _shuriken: Shuriken;
constructor(katana: Katana, shuriken: Shuriken) {
this._katana = katana;
this._shuriken = shuriken;
}
public fight() {
return this._katana.hit();
}
public sneak() {
return this._shuriken.throw();
}
}
const container: Container = new Container();
container.bind<Ninja>(Ninja).to(Ninja);
container.bind<Katana>(Katana).to(Katana);
container.bind<Shuriken>(Shuriken).to(Shuriken);
const ninja: Ninja = container.get<Ninja>(Ninja);
expect(ninja.fight()).eql('cut!');
expect(ninja.sneak()).eql('hit!');
});
it('Should be able to use Symbols as runtime identifiers', () => {
@injectable()
class Katana {
public hit() {
return 'cut!';
}
}
@injectable()
class Shuriken {
public throw() {
return 'hit!';
}
}
// eslint-disable-next-line @typescript-eslint/typedef
const TYPES = {
Katana: Symbol.for('Katana'),
Ninja: Symbol.for('Ninja'),
Shuriken: Symbol.for('Shuriken'),
};
@injectable()
class Ninja {
private readonly _katana: Katana;
private readonly _shuriken: Shuriken;
constructor(
@inject(TYPES.Katana) katana: Katana,
@inject(TYPES.Shuriken) shuriken: Shuriken,
) {
this._katana = katana;
this._shuriken = shuriken;
}
public fight() {
return this._katana.hit();
}
public sneak() {
return this._shuriken.throw();
}
}
const container: Container = new Container();
container.bind<Ninja>(TYPES.Ninja).to(Ninja);
container.bind<Katana>(TYPES.Katana).to(Katana);
container.bind<Shuriken>(TYPES.Shuriken).to(Shuriken);
const ninja: Ninja = container.get(TYPES.Ninja);
expect(ninja.fight()).eql('cut!');
expect(ninja.sneak()).eql('hit!');
});
it('Should be able to wrap Symbols with LazyServiceIdentifier', () => {
@injectable()
class Katana {
public hit() {
return 'cut!';
}
}
@injectable()
class Shuriken {
public throw() {
return 'hit!';
}
}
// eslint-disable-next-line @typescript-eslint/typedef
const TYPES = {
Katana: Symbol.for('Katana'),
Ninja: Symbol.for('Ninja'),
Shuriken: Symbol.for('Shuriken'),
};
@injectable()
class Ninja implements Ninja {
private readonly _katana: Katana;
private readonly _shuriken: Shuriken;
constructor(
@inject(new LazyServiceIdentifier(() => TYPES.Katana)) katana: Katana,
@inject(new LazyServiceIdentifier(() => TYPES.Shuriken))
shuriken: Shuriken,
) {
this._katana = katana;
this._shuriken = shuriken;
}
public fight() {
return this._katana.hit();
}
public sneak() {
return this._shuriken.throw();
}
}
const container: Container = new Container();
container.bind<Ninja>(TYPES.Ninja).to(Ninja);
container.bind<Katana>(TYPES.Katana).to(Katana);
container.bind<Shuriken>(TYPES.Shuriken).to(Shuriken);
const ninja: Ninja = container.get<Ninja>(TYPES.Ninja);
expect(ninja.fight()).eql('cut!');
expect(ninja.sneak()).eql('hit!');
});
it('Should support Container modules', async () => {
@injectable()
class Katana {
public hit() {
return 'cut!';
}
}
@injectable()
class Shuriken {
public throw() {
return 'hit!';
}
}
@injectable()
class Ninja {
private readonly _katana: Katana;
private readonly _shuriken: Shuriken;
constructor(
@inject('Katana') katana: Katana,
@inject('Shuriken') shuriken: Shuriken,
) {
this._katana = katana;
this._shuriken = shuriken;
}
public fight() {
return this._katana.hit();
}
public sneak() {
return this._shuriken.throw();
}
}
const warriors: ContainerModule = new ContainerModule(
(options: ContainerModuleLoadOptions) => {
options.bind<Ninja>('Ninja').to(Ninja);
},
);
const weapons: ContainerModule = new ContainerModule(
(options: ContainerModuleLoadOptions) => {
options.bind<Katana>('Katana').to(Katana);
options.bind<Shuriken>('Shuriken').to(Shuriken);
},
);
const container: Container = new Container();
// load
await container.load(warriors, weapons);
const ninja: Ninja = container.get('Ninja');
expect(ninja.fight()).eql('cut!');
expect(ninja.sneak()).eql('hit!');
const tryGetNinja: () => void = () => {
container.get('Ninja');
};
const tryGetKatana: () => void = () => {
container.get('Katana');
};
const tryGetShuruken: () => void = () => {
container.get('Shuriken');
};
// unload
await container.unload(warriors);
expect(tryGetNinja).to.throw('');
expect(tryGetKatana).not.to.throw();
expect(tryGetShuruken).not.to.throw();
await container.unload(weapons);
expect(tryGetNinja).to.throw('');
expect(tryGetKatana).to.throw('');
expect(tryGetShuruken).to.throw('');
});
it('Should support control over the scope of the dependencies', () => {
@injectable()
class Katana {
private _usageCount: number;
constructor() {
this._usageCount = 0;
}
public hit() {
this._usageCount = this._usageCount + 1;
return `This katana was used ${this._usageCount.toString()} times!`;
}
}
@injectable()
class Shuriken {
private _shurikenCount: number;
constructor() {
this._shurikenCount = 10;
}
public throw() {
this._shurikenCount = this._shurikenCount - 1;
return `Only ${this._shurikenCount.toString()} items left!`;
}
}
@injectable()
class Ninja {
private readonly _katana: Katana;
private readonly _shuriken: Shuriken;
constructor(
@inject('Katana') katana: Katana,
@inject('Shuriken') shuriken: Shuriken,
) {
this._katana = katana;
this._shuriken = shuriken;
}
public fight() {
return this._katana.hit();
}
public sneak() {
return this._shuriken.throw();
}
}
const container: Container = new Container();
container.bind<Ninja>('Ninja').to(Ninja);
container.bind<Katana>('Katana').to(Katana).inSingletonScope();
container.bind<Shuriken>('Shuriken').to(Shuriken);
const ninja1: Ninja = container.get('Ninja');
expect(ninja1.fight()).eql('This katana was used 1 times!');
expect(ninja1.fight()).eql('This katana was used 2 times!');
expect(ninja1.sneak()).eql('Only 9 items left!');
expect(ninja1.sneak()).eql('Only 8 items left!');
const ninja2: Ninja = container.get('Ninja');
expect(ninja2.fight()).eql('This katana was used 3 times!');
expect(ninja2.sneak()).eql('Only 9 items left!');
});
it('Should support the injection of classes to itself', () => {
const heroName: string = 'superman';
@injectable()
class Hero {
public name: string;
constructor() {
this.name = heroName;
}
}
const container: Container = new Container();
container.bind(Hero).toSelf();
const hero: Hero = container.get(Hero);
expect(hero.name).eql(heroName);
});
it('Should support the injection of constant values', () => {
interface Warrior {
name: string;
}
// eslint-disable-next-line @typescript-eslint/typedef
const TYPES = {
Warrior: 'Warrior',
};
const heroName: string = 'superman';
@injectable()
class Hero implements Warrior {
public name: string;
constructor() {
this.name = heroName;
}
}
const container: Container = new Container();
container.bind<Warrior>(TYPES.Warrior).toConstantValue(new Hero());
const hero: Warrior = container.get(TYPES.Warrior);
expect(hero.name).eql(heroName);
});
it('Should support the injection of dynamic values', async () => {
@injectable()
class UseSymbol {
public currentSymbol: symbol;
constructor(@inject('Symbol') currentDate: symbol) {
this.currentSymbol = currentDate;
}
public doSomething() {
return this.currentSymbol;
}
}
const container: Container = new Container();
container.bind<UseSymbol>('UseSymbol').to(UseSymbol);
container
.bind<symbol>('Symbol')
.toDynamicValue((_context: ResolutionContext) => Symbol());
const subject1: UseSymbol = container.get('UseSymbol');
const subject2: UseSymbol = container.get('UseSymbol');
expect(subject1.doSomething() === subject2.doSomething()).eql(false);
await container.unbind('Symbol');
container.bind<symbol>('Symbol').toConstantValue(Symbol());
const subject3: UseSymbol = container.get('UseSymbol');
const subject4: UseSymbol = container.get('UseSymbol');
expect(subject3.doSomething() === subject4.doSomething()).eql(true);
});
it('Should support the injection of Functions', () => {
const ninjaId: string = 'Ninja';
const longDistanceWeaponId: string = 'LongDistanceWeapon';
const shortDistanceWeaponFactoryId: string = 'ShortDistanceWeaponFactory';
type ShortDistanceWeaponFactory = () => ShortDistanceWeapon;
@injectable()
class KatanaBlade {}
@injectable()
class KatanaHandler {}
interface ShortDistanceWeapon {
handler: KatanaHandler;
blade: KatanaBlade;
}
@injectable()
class Katana implements ShortDistanceWeapon {
public handler: KatanaHandler;
public blade: KatanaBlade;
constructor(handler: KatanaHandler, blade: KatanaBlade) {
this.handler = handler;
this.blade = blade;
}
}
@injectable()
class Shuriken {}
interface Warrior {
shortDistanceWeaponFactory: ShortDistanceWeaponFactory;
longDistanceWeapon: Shuriken;
}
@injectable()
class Ninja implements Warrior {
public shortDistanceWeaponFactory: ShortDistanceWeaponFactory;
public longDistanceWeapon: Shuriken;
constructor(
@inject(shortDistanceWeaponFactoryId)
shortDistanceWeaponFactory: ShortDistanceWeaponFactory,
@inject(longDistanceWeaponId)
longDistanceWeapon: Shuriken,
) {
this.shortDistanceWeaponFactory = shortDistanceWeaponFactory;
this.longDistanceWeapon = longDistanceWeapon;
}
}
const container: Container = new Container();
container.bind<Ninja>(ninjaId).to(Ninja);
container.bind<Shuriken>(longDistanceWeaponId).to(Shuriken);
const katanaFactory: () => Katana = function () {
return new Katana(new KatanaHandler(), new KatanaBlade());
};
container
.bind<ShortDistanceWeaponFactory>(shortDistanceWeaponFactoryId)
.toConstantValue(katanaFactory);
const ninja: Ninja = container.get<Ninja>(ninjaId);
expect(ninja instanceof Ninja).eql(true);
expect(typeof ninja.shortDistanceWeaponFactory === 'function').eql(true);
expect(ninja.shortDistanceWeaponFactory() instanceof Katana).eql(true);
expect(
ninja.shortDistanceWeaponFactory().handler instanceof KatanaHandler,
).eql(true);
expect(ninja.shortDistanceWeaponFactory().blade instanceof KatanaBlade).eql(
true,
);
expect(ninja.longDistanceWeapon instanceof Shuriken).eql(true);
});
it('Should support the injection of class constructors', () => {
@injectable()
class Katana {
public hit() {
return 'cut!';
}
}
@injectable()
class Ninja {
private readonly _katana: Katana;
constructor(@inject('Newable<Katana>') katana: Newable<Katana>) {
this._katana = new katana();
}
public fight() {
return this._katana.hit();
}
}
const container: Container = new Container();
container.bind<Ninja>('Ninja').to(Ninja);
container.bind<Newable<Katana>>('Newable<Katana>').toConstantValue(Katana);
const ninja: Ninja = container.get<Ninja>('Ninja');
expect(ninja.fight()).eql('cut!');
});
it('Should support the injection of user defined factories', () => {
interface Ninja {
fight(): string;
sneak(): string;
}
@injectable()
class Katana {
public hit() {
return 'cut!';
}
}
@injectable()
class Shuriken implements Shuriken {
public throw() {
return 'hit!';
}
}
@injectable()
class NinjaWithUserDefinedFactory implements Ninja {
private readonly _katana: Katana;
private readonly _shuriken: Shuriken;
constructor(
@inject('Factory<Katana>') katanaFactory: () => Katana,
@inject('Shuriken') shuriken: Shuriken,
) {
this._katana = katanaFactory();
this._shuriken = shuriken;
}
public fight() {
return this._katana.hit();
}
public sneak() {
return this._shuriken.throw();
}
}
const container: Container = new Container();
container.bind<Ninja>('Ninja').to(NinjaWithUserDefinedFactory);
container.bind<Shuriken>('Shuriken').to(Shuriken);
container.bind<Katana>('Katana').to(Katana);
container
.bind<Factory<Katana>>('Factory<Katana>')
.toFactory(
(context: ResolutionContext) => () => context.get<Katana>('Katana'),
);
const ninja: Ninja = container.get<Ninja>('Ninja');
expect(ninja.fight()).eql('cut!');
expect(ninja.sneak()).eql('hit!');
});
it('Should support the injection of user defined factories with args', () => {
interface Ninja {
fight(): string;
sneak(): string;
}
interface Weapon {
use(): string;
}
@injectable()
class Katana implements Weapon {
public use() {
return 'katana!';
}
}
@injectable()
class Shuriken implements Weapon {
public use() {
return 'shuriken!';
}
}
@injectable()
class NinjaWithUserDefinedFactory implements Ninja {
private readonly _katana: Weapon;
private readonly _shuriken: Weapon;
constructor(
@inject('Factory<Weapon>')
weaponFactory: (throwable: boolean) => Weapon,
) {
this._katana = weaponFactory(false);
this._shuriken = weaponFactory(true);
}
public fight() {
return this._katana.use();
}
public sneak() {
return this._shuriken.use();
}
}
const container: Container = new Container();
container.bind<Ninja>('Ninja').to(NinjaWithUserDefinedFactory);
container.bind<Weapon>('Weapon').to(Shuriken).whenTagged('throwable', true);
container.bind<Weapon>('Weapon').to(Katana).whenTagged('throwable', false);
container.bind<Factory<Weapon>>('Factory<Weapon>').toFactory(
(context: ResolutionContext) => (throwable: boolean) =>
context.get<Weapon>('Weapon', {
tag: {
key: 'throwable',
value: throwable,
},
}),
);
const ninja: Ninja = container.get<Ninja>('Ninja');
expect(ninja.fight()).eql('katana!');
expect(ninja.sneak()).eql('shuriken!');
});
it('Should support the injection of user defined factories with partial application', () => {
@injectable()
class InjectorPump {}
@injectable()
class SparkPlugs {}
class Engine {
public displacement!: number | null;
}
@injectable()
class DieselEngine implements Engine {
public displacement: number | null;
private readonly _injectorPump: InjectorPump;
constructor(@inject('InjectorPump') injectorPump: InjectorPump) {
this._injectorPump = injectorPump;
this.displacement = null;
}
public debug() {
return this._injectorPump;
}
}
@injectable()
class PetrolEngine implements Engine {
public displacement: number | null;
private readonly _sparkPlugs: SparkPlugs;
constructor(@inject('SparkPlugs') sparkPlugs: SparkPlugs) {
this._sparkPlugs = sparkPlugs;
this.displacement = null;
}
public debug() {
return this._sparkPlugs;
}
}
interface CarFactory {
createEngine(displacement: number): Engine;
}
@injectable()
class DieselCarFactory implements CarFactory {
private readonly _dieselFactory: (displacement: number) => Engine;
constructor(
@inject('Factory<Engine>')
factory: (category: string) => (displacement: number) => Engine,
) {
this._dieselFactory = factory('diesel');
}
public createEngine(displacement: number): Engine {
return this._dieselFactory(displacement);
}
}
const container: Container = new Container();
container.bind<SparkPlugs>('SparkPlugs').to(SparkPlugs);
container.bind<InjectorPump>('InjectorPump').to(InjectorPump);
container.bind<Engine>('Engine').to(PetrolEngine).whenNamed('petrol');
container.bind<Engine>('Engine').to(DieselEngine).whenNamed('diesel');
container
.bind<Factory<(displacement: number) => Engine>>('Factory<Engine>')
.toFactory(
(context: ResolutionContext) =>
(theNamed: string) =>
(displacement: number) => {
const theEngine: Engine = context.get<Engine>('Engine', {
name: theNamed,
});
theEngine.displacement = displacement;
return theEngine;
},
);
container.bind<CarFactory>('DieselCarFactory').to(DieselCarFactory);
const dieselCarFactory: CarFactory =
container.get<CarFactory>('DieselCarFactory');
const engine: Engine = dieselCarFactory.createEngine(300);
expect(engine.displacement).eql(300);
expect(engine instanceof DieselEngine).eql(true);
});
it('Should support the injection of providers', (done: Mocha.Done) => {
type KatanaProvider = () => Promise<Katana>;
interface Ninja {
katana: Katana | null;
katanaProvider: KatanaProvider;
}
@injectable()
class Katana {
public hit() {
return 'cut!';
}
}
@injectable()
class NinjaWithProvider implements Ninja {
public katana: Katana | null;
public katanaProvider: KatanaProvider;
constructor(@inject('Provider<Katana>') katanaProvider: KatanaProvider) {
this.katanaProvider = katanaProvider;
this.katana = null;
}
}
const container: Container = new Container();
container.bind<Ninja>('Ninja').to(NinjaWithProvider);
container.bind<Katana>('Katana').to(Katana);
// eslint-disable-next-line @typescript-eslint/no-deprecated
container.bind<KatanaProvider>('Provider<Katana>').toProvider(
(context: ResolutionContext) => async () =>
new Promise<Katana>((resolve: (value: Katana) => void) => {
const katana: Katana = context.get<Katana>('Katana');
resolve(katana);
}),
);
const ninja: Ninja = container.get<Ninja>('Ninja');
ninja
.katanaProvider()
.then((katana: Katana) => {
ninja.katana = katana;
expect(ninja.katana.hit()).eql('cut!');
done();
})
.catch((_e: unknown) => {
/* do nothing */
});
});
describe('Injection of multiple values with string as keys', () => {
it('Should support the injection of multiple values', () => {
const warriorId: string = 'Warrior';
const weaponId: string = 'Weapon';
interface Weapon {
name: string;
}
@injectable()
class Katana implements Weapon {
public name: string = 'Katana';
}
@injectable()
class Shuriken implements Weapon {
public name: string = 'Shuriken';
}
interface Warrior {
katana: Weapon;
shuriken: Weapon;
}
@injectable()
class Ninja implements Warrior {
public katana: Weapon;
public shuriken: Weapon;
constructor(@multiInject(weaponId) weapons: Weapon[]) {
this.katana = weapons[0] as Weapon;
this.shuriken = weapons[1] as Weapon;
}
}
const container: Container = new Container();
container.bind<Warrior>(warriorId).to(Ninja);
container.bind<Weapon>(weaponId).to(Katana);
container.bind<Weapon>(weaponId).to(Shuriken);
const ninja: Warrior = container.get<Warrior>(warriorId);
expect(ninja.katana.name).eql('Katana');
expect(ninja.shuriken.name).eql('Shuriken');
// if only one value is bound to Weapon
const container2: Container = new Container();
container2.bind<Warrior>(warriorId).to(Ninja);
container2.bind<Weapon>(weaponId).to(Katana);
const ninja2: Ninja = container2.get<Warrior>(warriorId);
expect(ninja2.katana.name).eql('Katana');
});
it('Should support the injection of multiple values with nested inject', () => {
@injectable()
class Katana {
public hit() {
return 'cut!';
}
}
@injectable()
class Shuriken {
public throw() {
return 'hit!';
}
}
@injectable()
class Ninja {
private readonly _katana: Katana;
private readonly _shuriken: Shuriken;
constructor(
@inject('Katana') katana: Katana,
@inject('Shuriken') shuriken: Shuriken,
) {
this._katana = katana;
this._shuriken = shuriken;
}
public fight() {
return this._katana.hit();
}
public sneak() {
return this._shuriken.throw();
}
}
interface School {
ninjaMaster: Ninja;
student: Ninja;
}
@injectable()
class NinjaSchool implements School {
public ninjaMaster: Ninja;
public student: Ninja;
constructor(@multiInject('Ninja') ninja: Ninja[]) {
this.ninjaMaster = ninja[0] as Ninja;
this.student = ninja[1] as Ninja;
}
}
const container: Container = new Container();
container.bind<Katana>('Katana').to(Katana);
container.bind<Shuriken>('Shuriken').to(Shuriken);
container.bind<Ninja>('Ninja').to(Ninja);
container.bind<Ninja>('Ninja').to(Ninja);
container.bind<School>('School').to(NinjaSchool);
const ninjaSchool: School = container.get<School>('School');
expect(ninjaSchool.ninjaMaster.fight()).eql('cut!');
expect(ninjaSchool.ninjaMaster.sneak()).eql('hit!');
expect(ninjaSchool.student.fight()).eql('cut!');
expect(ninjaSchool.student.sneak()).eql('hit!');
});
it('Should support the injection of multiple values with nested multiInject', () => {
const warriorId: string = 'Warrior';
const swordId: string = 'Sword';
const shurikenId: string = 'Shuriken';
const schoolId: string = 'School';
const organisationId: string = 'Organisation';
interface Warrior {
fight(): string;
sneak(): string;
}
interface Sword {
hit(): string;
}
@injectable()
class Katana implements Sword {
public hit() {
return 'cut!';
}
}
@injectable()
class Shuriken {
public throw() {
return 'hit!';
}
}
@injectable()
class Ninja implements Warrior {
private readonly _katana: Sword;
private readonly _shuriken: Shuriken;
constructor(
@inject(swordId) katana: Sword,
@inject(shurikenId) shuriken: Shuriken,
) {
this._katana = katana;
this._shuriken = shuriken;
}
public fight() {
return this._katana.hit();
}
public sneak() {
return this._shuriken.throw();
}
}
interface School {
ninjaMaster: Warrior;
student: Warrior;
}
@injectable()
class NinjaSchool implements School {
public ninjaMaster: Warrior;
public student: Warrior;
constructor(@multiInject(warriorId) ninjas: Ninja[]) {
this.ninjaMaster = ninjas[0] as Ninja;
this.student = ninjas[1] as Ninja;
}
}
interface Organisation {
schools: School[];
}
@injectable()
class NinjaOrganisation implements Organisation {
public schools: School[];
constructor(@multiInject(schoolId) schools: School[]) {
this.schools = schools;
}
}
const container: Container = new Container();
container.bind<Sword>(swordId).to(Katana);
container.bind<Shuriken>(shurikenId).to(Shuriken);
container.bind<Warrior>(warriorId).to(Ninja);
container.bind<Warrior>(warriorId).to(Ninja);
container.bind<School>(schoolId).to(NinjaSchool);
container.bind<School>(schoolId).to(NinjaSchool);
container.bind<Organisation>(organisationId).to(NinjaOrganisation);
const ninjaOrganisation: Organisation =
container.get<Organisation>(organisationId);
for (let i: number = 0; i < 2; i++) {
const ithNinjaOrganizationSchool: School = ninjaOrganisation.schools[
i
] as School;
expect(ithNinjaOrganizationSchool.ninjaMaster.fight()).eql('cut!');
expect(ithNinjaOrganizationSchool.ninjaMaster.sneak()).eql('hit!');
expect(ithNinjaOrganizationSchool.student.fight()).eql('cut!');
expect(ithNinjaOrganizationSchool.student.sneak()).eql('hit!');
}
});
});
describe('Injection of multiple values with class as keys', () => {
it('Should support the injection of multiple values when using classes as keys', () => {
@injectable()
class Weapon {
public name!: string;
}
@injectable()
class Katana extends Weapon {
constructor() {
super();
this.name = 'Katana';
}
}
@injectable()
class Shuriken extends Weapon {
constructor() {
super();
this.name = 'Shuriken';
}
}
@injectable()
class Ninja {
public katana: Weapon;
public shuriken: Weapon;
constructor(@multiInject(Weapon) weapons: Weapon[]) {
this.katana = weapons[0] as Weapon;
this.shuriken = weapons[1] as Weapon;
}
}
const container: Container = new Container();
container.bind<Ninja>(Ninja).to(Ninja);
container.bind<Weapon>(Weapon).to(Katana);
container.bind<Weapon>(Weapon).to(Shuriken);
const ninja: Ninja = container.get<Ninja>(Ninja);
expect(ninja.katana.name).eql('Katana');
expect(ninja.shuriken.name).eql('Shuriken');
// if only one value is bound to Weapon
const container2: Container = new Container();
container2.bind<Ninja>(Ninja).to(Ninja);
container2.bind<Weapon>(Weapon).to(Katana);
const ninja2: Ninja = container2.get<Ninja>(Ninja);
expect(ninja2.katana.name).eql('Katana');
});
it('Should support the injection of multiple values with nested inject', () => {
@injectable()
class Katana {
public hit() {
return 'cut!';
}
}
@injectable()
class Shuriken {
public throw() {
return 'hit!';
}
}
@injectable()
class Ninja {
private readonly _katana: Katana;
private readonly _shuriken: Shuriken;
constructor(katana: Katana, shuriken: Shuriken) {
this._katana = katana;
this._shuriken = shuriken;
}
public fight() {
return this._katana.hit();
}
public sneak() {
return this._shuriken.throw();
}
}
@injectable()
class NinjaSchool {
public ninjaMaster: Ninja;
public student: Ninja;
constructor(@multiInject(Ninja) ninja: Ninja[]) {
this.ninjaMaster = ninja[0] as Ninja;
this.student = ninja[1] as Ninja;
}
}
const container: Container = new Container();
container.bind<Katana>(Katana).to(Katana);
container.bind<Shuriken>(Shuriken).to(Shuriken);
container.bind<Ninja>(Ninja).to(Ninja);
container.bind<Ninja>(Ninja).to(Ninja);
container.bind<NinjaSchool>(NinjaSchool).to(NinjaSchool);
const ninjaSchool: NinjaSchool = container.get<NinjaSchool>(NinjaSchool);
expect(ninjaSchool.ninjaMaster.fight()).eql('cut!');
expect(ninjaSchool.ninjaMaster.sneak()).eql('hit!');
expect(ninjaSchool.student.fight()).eql('cut!');
expect(ninjaSchool.student.sneak()).eql('hit!');
});
it('Should support the injection of multiple values with nested multiInject', () => {
@injectable()
class Katana {
public hit() {
return 'cut!';
}
}
@injectable()
class Shuriken {
public throw() {
return 'hit!';
}
}
@injectable()
class Ninja {
private readonly _katana: Katana;
private readonly _shuriken: Shuriken;
constructor(katana: Katana, shuriken: Shuriken) {
this._katana = katana;
this._shuriken = shuriken;
}
public fight() {
return this._katana.hit();
}
public sneak() {
return this._shuriken.throw();
}
}
@injectable()
class NinjaSchool {
public ninjaMaster: Ninja;
public student: Ninja;
constructor(@multiInject(Ninja) ninjas: Ninja[]) {
this.ninjaMaster = ninjas[0] as Ninja;
this.student = ninjas[1] as Ninja;
}
}
@injectable()
class NinjaOrganisation {
public schools: NinjaSchool[];
constructor(@multiInject(NinjaSchool) schools: NinjaSchool[]) {
this.s
gitextract_m2iu_kne/ ├── .github/ │ ├── FUNDING.yml │ ├── ISSUE_TEMPLATE/ │ │ ├── bug_report.yml │ │ ├── config.yml │ │ └── feature_request.yml │ └── workflows/ │ └── ci.yml ├── .gitignore ├── .npmignore ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE.md ├── LICENSE ├── PULL_REQUEST_TEMPLATE.md ├── README.md ├── eslint.config.mjs ├── package.json ├── prettier.config.mjs ├── renovate.json ├── rollup.config.mjs ├── scripts/ │ ├── writeCommonJsPackageJson.mjs │ └── writeEsmPackageJson.mjs ├── src/ │ ├── index.ts │ └── test/ │ ├── annotation/ │ │ ├── inject.test.ts │ │ ├── injectable.test.ts │ │ ├── multi_inject.test.ts │ │ ├── named.test.ts │ │ ├── optional.test.ts │ │ └── post_construct.test.ts │ ├── bugs/ │ │ ├── bugs.test.ts │ │ ├── issue_1190.test.ts │ │ ├── issue_1297.test.ts │ │ ├── issue_1416.test.ts │ │ ├── issue_1515.test.ts │ │ ├── issue_1518.test.ts │ │ ├── issue_1564.test.ts │ │ ├── issue_543.test.ts │ │ ├── issue_549.test.ts │ │ ├── issue_706.test.ts │ │ └── issue_928.test.ts │ ├── container/ │ │ ├── container.test.ts │ │ └── container_module.test.ts │ ├── features/ │ │ ├── named_default.test.ts │ │ ├── property_injection.test.ts │ │ ├── provider.test.ts │ │ ├── request_scope.test.ts │ │ └── transitive_bindings.test.ts │ ├── inversify.test.ts │ └── node/ │ ├── error_messages.test.ts │ ├── exceptions.test.ts │ ├── performance.test.ts │ └── proxies.test.ts ├── tsconfig.base.cjs.json ├── tsconfig.base.esm.json ├── tsconfig.base.json ├── tsconfig.cjs.json ├── tsconfig.esm.json └── tsconfig.json
Showing preview only (205K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (676 symbols across 31 files)
FILE: eslint.config.mjs
function buildBaseConfig (line 11) | function buildBaseConfig() {
FILE: rollup.config.mjs
function pathExists (line 11) | async function pathExists(path) {
constant PACKAGE_JSON_PATH (line 20) | const PACKAGE_JSON_PATH = './package.json';
FILE: scripts/writeCommonJsPackageJson.mjs
function pathExists (line 12) | async function pathExists(path) {
FILE: scripts/writeEsmPackageJson.mjs
function pathExists (line 12) | async function pathExists(path) {
FILE: src/test/annotation/inject.test.ts
class Katana (line 8) | class Katana {}
class Shuriken (line 9) | class Shuriken {}
class InvalidDecoratorUsageWarrior (line 15) | class InvalidDecoratorUsageWarrior {
method constructor (line 19) | constructor(primary: Katana, secondary: Shuriken) {
method test (line 24) | public test(_a: string) {}
method debug (line 26) | public debug() {
FILE: src/test/annotation/injectable.test.ts
class Test (line 9) | @injectable()
FILE: src/test/annotation/multi_inject.test.ts
type Weapon (line 7) | type Weapon = object;
class InvalidDecoratorUsageWarrior (line 9) | class InvalidDecoratorUsageWarrior {
method constructor (line 13) | constructor(weapons: [Weapon, Weapon]) {
method test (line 18) | public test(_a: string) {}
method debug (line 20) | public debug() {
FILE: src/test/annotation/named.test.ts
type Weapon (line 7) | type Weapon = unknown;
class InvalidDecoratorUsageWarrior (line 9) | class InvalidDecoratorUsageWarrior {
method constructor (line 13) | constructor(primary: Weapon, secondary: Weapon) {
method test (line 18) | public test(_a: string) {}
method debug (line 20) | public debug() {
FILE: src/test/annotation/optional.test.ts
class Katana (line 9) | @injectable()
method constructor (line 12) | constructor() {
method constructor (line 62) | constructor() {
method constructor (line 114) | constructor() {
class Shuriken (line 17) | @injectable()
method constructor (line 20) | constructor() {
method constructor (line 70) | constructor() {
method constructor (line 122) | constructor() {
class Ninja (line 25) | @injectable()
method constructor (line 30) | constructor(
method constructor (line 80) | constructor(
class Katana (line 59) | @injectable()
method constructor (line 12) | constructor() {
method constructor (line 62) | constructor() {
method constructor (line 114) | constructor() {
class Shuriken (line 67) | @injectable()
method constructor (line 20) | constructor() {
method constructor (line 70) | constructor() {
method constructor (line 122) | constructor() {
class Ninja (line 75) | @injectable()
method constructor (line 30) | constructor(
method constructor (line 80) | constructor(
class Katana (line 111) | @injectable()
method constructor (line 12) | constructor() {
method constructor (line 62) | constructor() {
method constructor (line 114) | constructor() {
class Shuriken (line 119) | @injectable()
method constructor (line 20) | constructor() {
method constructor (line 70) | constructor() {
method constructor (line 122) | constructor() {
class Ninja (line 127) | @injectable()
method constructor (line 30) | constructor(
method constructor (line 80) | constructor(
FILE: src/test/annotation/post_construct.test.ts
function setup (line 9) | function setup() {
FILE: src/test/bugs/bugs.test.ts
class Warrior (line 21) | @injectable()
method constructor (line 24) | constructor() {
method constructor (line 52) | constructor(rank: string) {
method constructor (line 87) | constructor(rank: string) {
class SamuraiMaster (line 30) | @injectable()
method constructor (line 32) | constructor() {
method constructor (line 63) | constructor(
method constructor (line 114) | constructor(
class Warrior (line 49) | @injectable()
method constructor (line 24) | constructor() {
method constructor (line 52) | constructor(rank: string) {
method constructor (line 87) | constructor(rank: string) {
class SamuraiMaster (line 61) | @injectable()
method constructor (line 32) | constructor() {
method constructor (line 63) | constructor(
method constructor (line 114) | constructor(
class Warrior (line 84) | @injectable()
method constructor (line 24) | constructor() {
method constructor (line 52) | constructor(rank: string) {
method constructor (line 87) | constructor(rank: string) {
type Weapon (line 93) | interface Weapon {
class Katana (line 97) | @injectable()
method constructor (line 100) | constructor() {
method constructor (line 259) | constructor() {
method use (line 375) | public use() {
method constructor (line 421) | constructor() {
method hit (line 559) | public hit() {
class SamuraiMaster (line 111) | @injectable()
method constructor (line 32) | constructor() {
method constructor (line 63) | constructor(
method constructor (line 114) | constructor(
type Weapon (line 138) | type Weapon = unknown;
type Intl (line 156) | type Intl = unknown;
method constructor (line 206) | constructor(@unmanaged() name: string) {
method move (line 209) | public move(meters: number) {
class Snake (line 215) | @injectable()
method constructor (line 217) | constructor() {
method makeSound (line 220) | public makeSound(input: string): string {
method move (line 223) | public override move() {
class Jungle (line 228) | @injectable()
method constructor (line 231) | constructor(@inject(Animal) animal: Animal) {
type Weapon (line 252) | interface Weapon {
class Katana (line 256) | @injectable()
method constructor (line 100) | constructor() {
method constructor (line 259) | constructor() {
method use (line 375) | public use() {
method constructor (line 421) | constructor() {
method hit (line 559) | public hit() {
type Weapon (line 289) | type Weapon = unknown;
method constructor (line 294) | constructor(@inject('Weapon') weapon: Weapon) {
class Soldier (line 299) | @injectable()
class Archer (line 305) | @injectable()
class Knight (line 311) | @injectable()
class Sword (line 317) | @injectable()
class Bow (line 320) | @injectable()
class DefaultWeapon (line 323) | @injectable()
function whenIsAndIsNamed (line 328) | function whenIsAndIsNamed(
type Weapon (line 369) | interface Weapon {
class Katana (line 373) | @injectable()
method constructor (line 100) | constructor() {
method constructor (line 259) | constructor() {
method use (line 375) | public use() {
method constructor (line 421) | constructor() {
method hit (line 559) | public hit() {
class Ninja (line 380) | @injectable()
method constructor (line 382) | constructor(
method fight (line 387) | public fight() {
method constructor (line 578) | constructor(@inject('Katana') katana: Katana) {
type Weapon (line 414) | interface Weapon {
class Katana (line 418) | @injectable()
method constructor (line 100) | constructor() {
method constructor (line 259) | constructor() {
method use (line 375) | public use() {
method constructor (line 421) | constructor() {
method hit (line 559) | public hit() {
class Shuriken (line 426) | @injectable()
method constructor (line 429) | constructor() {
type Warrior (line 434) | interface Warrior {
method constructor (line 24) | constructor() {
method constructor (line 52) | constructor(rank: string) {
method constructor (line 87) | constructor(rank: string) {
method constructor (line 443) | constructor(@unmanaged() name: string) {
class Samurai (line 457) | @injectable()
method constructor (line 466) | constructor() {
type Model (line 492) | interface Model<T> {
type RepoBaseInterface (line 496) | interface RepoBaseInterface<T> {
class Type (line 500) | class Type {
method constructor (line 502) | constructor() {
class RepoBase (line 507) | @injectable()
method constructor (line 511) | constructor(
class TypedRepo (line 520) | @injectable()
method constructor (line 522) | constructor() {
class BlBase (line 527) | @injectable()
method constructor (line 531) | constructor(
class TypedBl (line 540) | @injectable()
method constructor (line 543) | constructor(repository: TypedRepo) {
class Katana (line 557) | @injectable()
method constructor (line 100) | constructor() {
method constructor (line 259) | constructor() {
method use (line 375) | public use() {
method constructor (line 421) | constructor() {
method hit (line 559) | public hit() {
method constructor (line 567) | constructor(@unmanaged() katana: Katana) {
method fight (line 571) | public fight() {
class Ninja (line 576) | @injectable()
method constructor (line 382) | constructor(
method fight (line 387) | public fight() {
method constructor (line 578) | constructor(@inject('Katana') katana: Katana) {
FILE: src/test/bugs/issue_1190.test.ts
type Weapon (line 19) | interface Weapon {
class Katana (line 23) | @injectable()
method constructor (line 26) | constructor() {
class Shuriken (line 31) | @injectable()
method constructor (line 34) | constructor() {
class Ninja (line 39) | @injectable()
method constructor (line 44) | constructor(
FILE: src/test/bugs/issue_1297.test.ts
class Katana (line 37) | @injectable()
method hit (line 39) | public hit() {
method hit (line 71) | public hit() {
class Katana (line 69) | @injectable()
method hit (line 39) | public hit() {
method hit (line 71) | public hit() {
FILE: src/test/bugs/issue_1416.test.ts
class Test1 (line 10) | @injectable()
method destroy (line 15) | public destroy() {
class Test2 (line 20) | @injectable()
method destroy (line 22) | public destroy(): void {}
class Test3 (line 25) | @injectable()
method destroy (line 27) | public destroy(): void {}
FILE: src/test/bugs/issue_1515.test.ts
class Circle1 (line 9) | @injectable()
method constructor (line 11) | constructor(@inject('circle-2') public readonly circle2: unknown) {}
class Circle2 (line 14) | @injectable()
method constructor (line 16) | constructor(@inject('circle-1') public circle1: unknown) {}
class Multi1 (line 19) | @injectable()
class Multi2 (line 21) | @injectable()
class Multi3 (line 23) | @injectable()
class Top (line 26) | @injectable()
method constructor (line 28) | constructor(
FILE: src/test/bugs/issue_1564.test.ts
class Database (line 10) | @injectable()
method constructor (line 12) | constructor() {
class Service1 (line 17) | @injectable()
method constructor (line 19) | constructor(@inject(Database) public database: Database) {
class Service2 (line 24) | @injectable()
method constructor (line 26) | constructor(@inject(Service1) public service1: Service1) {
FILE: src/test/bugs/issue_543.test.ts
class Irrelevant (line 18) | @injectable()
class Child2 (line 21) | @injectable()
method constructor (line 24) | constructor(@inject(TYPE.Circular) circ: unknown) {
class Child (line 29) | @injectable()
method constructor (line 33) | constructor(
class Circular (line 42) | @injectable()
method constructor (line 46) | constructor(
class Root (line 55) | @injectable()
method constructor (line 59) | constructor(
function throws (line 75) | function throws() {
FILE: src/test/bugs/issue_549.test.ts
type InterfaceA (line 13) | type InterfaceA = unknown;
type InterfaceB (line 14) | type InterfaceB = unknown;
class A (line 16) | @injectable()
method constructor (line 19) | constructor(@inject(TYPE.BDynamicValue) b: InterfaceB) {
class B (line 24) | @injectable()
method constructor (line 27) | constructor(@inject(TYPE.ADynamicValue) a: InterfaceA) {
function willThrow (line 44) | function willThrow() {
FILE: src/test/bugs/issue_706.test.ts
class SomeClass (line 9) | @injectable()
method constructor (line 12) | constructor() {
FILE: src/test/bugs/issue_928.test.ts
class DepA (line 14) | @injectable()
class DepB (line 18) | @injectable()
class DepC (line 22) | @injectable()
method constructor (line 29) | constructor(
class Cls (line 38) | @injectable()
method constructor (line 40) | constructor(
FILE: src/test/container/container.test.ts
class Ninja (line 27) | @injectable()
method postConstruct (line 175) | public postConstruct() {
method constructor (line 478) | constructor() {
method takeHit (line 481) | public takeHit(damage: number) {
class Ninja (line 40) | @injectable()
method postConstruct (line 175) | public postConstruct() {
method constructor (line 478) | constructor() {
method takeHit (line 481) | public takeHit(damage: number) {
class Samurai (line 43) | @injectable()
class Ninja (line 63) | @injectable()
method postConstruct (line 175) | public postConstruct() {
method constructor (line 478) | constructor() {
method takeHit (line 481) | public takeHit(damage: number) {
class Samurai (line 66) | @injectable()
class Ninja (line 86) | @injectable()
method postConstruct (line 175) | public postConstruct() {
method constructor (line 478) | constructor() {
method takeHit (line 481) | public takeHit(damage: number) {
type Warrior (line 99) | type Warrior = unknown;
class Ninja (line 101) | @injectable()
method postConstruct (line 175) | public postConstruct() {
method constructor (line 478) | constructor() {
method takeHit (line 481) | public takeHit(damage: number) {
class Samurai (line 104) | @injectable()
class Ninja (line 120) | @injectable()
method postConstruct (line 175) | public postConstruct() {
method constructor (line 478) | constructor() {
method takeHit (line 481) | public takeHit(damage: number) {
class Ninja (line 130) | @injectable()
method postConstruct (line 175) | public postConstruct() {
method constructor (line 478) | constructor() {
method takeHit (line 481) | public takeHit(damage: number) {
class Samurai (line 133) | @injectable()
class Ninja (line 172) | @injectable()
method postConstruct (line 175) | public postConstruct() {
method constructor (line 478) | constructor() {
method takeHit (line 481) | public takeHit(damage: number) {
class Ninja (line 223) | @injectable()
method postConstruct (line 175) | public postConstruct() {
method constructor (line 478) | constructor() {
method takeHit (line 481) | public takeHit(damage: number) {
class Katana (line 238) | @injectable()
class Ninja (line 247) | @injectable()
method postConstruct (line 175) | public postConstruct() {
method constructor (line 478) | constructor() {
method takeHit (line 481) | public takeHit(damage: number) {
class Katana (line 265) | @injectable()
class Katana (line 283) | @injectable()
class Katana (line 301) | @injectable()
class DivineRapier (line 304) | @injectable()
type Intl (line 323) | interface Intl {
type Intl (line 360) | interface Intl {
type Warrior (line 470) | interface Warrior {
class Ninja (line 475) | @injectable()
method postConstruct (line 175) | public postConstruct() {
method constructor (line 478) | constructor() {
method takeHit (line 481) | public takeHit(damage: number) {
class Warrior (line 533) | @injectable()
type Intl (line 774) | interface Intl {
type Intl (line 815) | interface Intl {
type Intl (line 838) | interface Intl {
type Weapon (line 937) | type Weapon = unknown;
class Shuriken (line 938) | @injectable()
class Ninja (line 940) | @injectable()
method postConstruct (line 175) | public postConstruct() {
method constructor (line 478) | constructor() {
method takeHit (line 481) | public takeHit(damage: number) {
FILE: src/test/features/named_default.test.ts
type Weapon (line 22) | interface Weapon {
type Warrior (line 26) | interface Warrior {
class Katana (line 31) | @injectable()
method constructor (line 34) | constructor() {
method constructor (line 104) | constructor() {
class Shuriken (line 39) | @injectable()
method constructor (line 42) | constructor() {
method constructor (line 112) | constructor() {
class Samurai (line 47) | @injectable()
method constructor (line 51) | constructor(@inject(TYPES.Weapon) weapon: Weapon) {
class Ninja (line 57) | @injectable()
method constructor (line 61) | constructor(@inject(TYPES.Weapon) @named(TAG.throwable) weapon: Weapon) {
type Weapon (line 97) | interface Weapon {
class Katana (line 101) | @injectable()
method constructor (line 34) | constructor() {
method constructor (line 104) | constructor() {
class Shuriken (line 109) | @injectable()
method constructor (line 42) | constructor() {
method constructor (line 112) | constructor() {
FILE: src/test/features/property_injection.test.ts
type Weapon (line 25) | interface Weapon {
class Katana (line 29) | @injectable()
method constructor (line 32) | constructor() {
method constructor (line 83) | constructor() {
method constructor (line 149) | constructor() {
method constructor (line 219) | constructor() {
method constructor (line 288) | constructor() {
method constructor (line 351) | constructor() {
type Warrior (line 37) | interface Warrior {
class Samurai (line 42) | @injectable()
method constructor (line 48) | constructor() {
method constructor (line 110) | constructor(@inject(TYPES.Weapon) @named(TAGS.Primary) weapon: Weapon) {
method constructor (line 180) | constructor() {
method constructor (line 250) | constructor() {
method constructor (line 312) | constructor() {
method constructor (line 391) | constructor() {
type Weapon (line 76) | interface Weapon {
class Katana (line 80) | @injectable()
method constructor (line 32) | constructor() {
method constructor (line 83) | constructor() {
method constructor (line 149) | constructor() {
method constructor (line 219) | constructor() {
method constructor (line 288) | constructor() {
method constructor (line 351) | constructor() {
class Shuriken (line 88) | @injectable()
method constructor (line 91) | constructor() {
method constructor (line 157) | constructor() {
method constructor (line 227) | constructor() {
method constructor (line 296) | constructor() {
method constructor (line 359) | constructor() {
type Warrior (line 96) | interface Warrior {
class Samurai (line 102) | @injectable()
method constructor (line 48) | constructor() {
method constructor (line 110) | constructor(@inject(TYPES.Weapon) @named(TAGS.Primary) weapon: Weapon) {
method constructor (line 180) | constructor() {
method constructor (line 250) | constructor() {
method constructor (line 312) | constructor() {
method constructor (line 391) | constructor() {
type Weapon (line 142) | interface Weapon {
class Katana (line 146) | @injectable()
method constructor (line 32) | constructor() {
method constructor (line 83) | constructor() {
method constructor (line 149) | constructor() {
method constructor (line 219) | constructor() {
method constructor (line 288) | constructor() {
method constructor (line 351) | constructor() {
class Shuriken (line 154) | @injectable()
method constructor (line 91) | constructor() {
method constructor (line 157) | constructor() {
method constructor (line 227) | constructor() {
method constructor (line 296) | constructor() {
method constructor (line 359) | constructor() {
type Warrior (line 162) | interface Warrior {
class Samurai (line 168) | @injectable()
method constructor (line 48) | constructor() {
method constructor (line 110) | constructor(@inject(TYPES.Weapon) @named(TAGS.Primary) weapon: Weapon) {
method constructor (line 180) | constructor() {
method constructor (line 250) | constructor() {
method constructor (line 312) | constructor() {
method constructor (line 391) | constructor() {
type Weapon (line 212) | interface Weapon {
class Katana (line 216) | @injectable()
method constructor (line 32) | constructor() {
method constructor (line 83) | constructor() {
method constructor (line 149) | constructor() {
method constructor (line 219) | constructor() {
method constructor (line 288) | constructor() {
method constructor (line 351) | constructor() {
class Shuriken (line 224) | @injectable()
method constructor (line 91) | constructor() {
method constructor (line 157) | constructor() {
method constructor (line 227) | constructor() {
method constructor (line 296) | constructor() {
method constructor (line 359) | constructor() {
type Warrior (line 232) | interface Warrior {
class Samurai (line 238) | @injectable()
method constructor (line 48) | constructor() {
method constructor (line 110) | constructor(@inject(TYPES.Weapon) @named(TAGS.Primary) weapon: Weapon) {
method constructor (line 180) | constructor() {
method constructor (line 250) | constructor() {
method constructor (line 312) | constructor() {
method constructor (line 391) | constructor() {
type Weapon (line 281) | interface Weapon {
class Katana (line 285) | @injectable()
method constructor (line 32) | constructor() {
method constructor (line 83) | constructor() {
method constructor (line 149) | constructor() {
method constructor (line 219) | constructor() {
method constructor (line 288) | constructor() {
method constructor (line 351) | constructor() {
class Shuriken (line 293) | @injectable()
method constructor (line 91) | constructor() {
method constructor (line 157) | constructor() {
method constructor (line 227) | constructor() {
method constructor (line 296) | constructor() {
method constructor (line 359) | constructor() {
type Warrior (line 301) | interface Warrior {
class Samurai (line 306) | @injectable()
method constructor (line 48) | constructor() {
method constructor (line 110) | constructor(@inject(TYPES.Weapon) @named(TAGS.Primary) weapon: Weapon) {
method constructor (line 180) | constructor() {
method constructor (line 250) | constructor() {
method constructor (line 312) | constructor() {
method constructor (line 391) | constructor() {
type Weapon (line 344) | interface Weapon {
class Katana (line 348) | @injectable()
method constructor (line 32) | constructor() {
method constructor (line 83) | constructor() {
method constructor (line 149) | constructor() {
method constructor (line 219) | constructor() {
method constructor (line 288) | constructor() {
method constructor (line 351) | constructor() {
class Shuriken (line 356) | @injectable()
method constructor (line 91) | constructor() {
method constructor (line 157) | constructor() {
method constructor (line 227) | constructor() {
method constructor (line 296) | constructor() {
method constructor (line 359) | constructor() {
type Warrior (line 364) | interface Warrior {
class BaseWarrior (line 369) | @injectable()
method constructor (line 376) | constructor(@unmanaged() name: string) {
class Samurai (line 381) | @injectable()
method constructor (line 48) | constructor() {
method constructor (line 110) | constructor(@inject(TYPES.Weapon) @named(TAGS.Primary) weapon: Weapon) {
method constructor (line 180) | constructor() {
method constructor (line 250) | constructor() {
method constructor (line 312) | constructor() {
method constructor (line 391) | constructor() {
type Route (line 422) | interface Route {
class Router (line 426) | @injectable()
method getRoute (line 432) | public getRoute(): Route {
FILE: src/test/features/provider.test.ts
class Ninja (line 9) | @injectable()
method constructor (line 13) | constructor() {
method train (line 17) | public async train(): Promise<number> {
method constructor (line 159) | constructor() {
class NinjaMaster (line 29) | @injectable()
method constructor (line 32) | constructor() {
type NinjaMasterProvider (line 37) | type NinjaMasterProvider = () => Promise<NinjaMaster>;
function valueOrDefault (line 68) | async function valueOrDefault<T>(
type Sword (line 100) | interface Sword {
class Katana (line 105) | @injectable()
type SwordProvider (line 114) | type SwordProvider = Provider<Sword, [string, number]>;
type Warrior (line 152) | interface Warrior {
class Ninja (line 156) | @injectable()
method constructor (line 13) | constructor() {
method train (line 17) | public async train(): Promise<number> {
method constructor (line 159) | constructor() {
type WarriorProvider (line 164) | type WarriorProvider = (level: number) => Promise<Warrior>;
FILE: src/test/features/request_scope.test.ts
type Weapon (line 16) | interface Weapon {
type Warrior (line 20) | interface Warrior {
class Katana (line 25) | @injectable()
method constructor (line 28) | constructor() {
method use (line 31) | public use() {
method constructor (line 118) | constructor() {
method use (line 121) | public use() {
class Samurai (line 36) | @injectable()
method constructor (line 40) | constructor(
method constructor (line 142) | constructor(
type Weapon (line 105) | interface Weapon {
type Warrior (line 109) | interface Warrior {
class Katana (line 115) | @injectable()
method constructor (line 28) | constructor() {
method use (line 31) | public use() {
method constructor (line 118) | constructor() {
method use (line 121) | public use() {
class Shuriken (line 126) | @injectable()
method constructor (line 129) | constructor() {
method use (line 132) | public use() {
class Samurai (line 137) | @injectable()
method constructor (line 40) | constructor(
method constructor (line 142) | constructor(
FILE: src/test/features/transitive_bindings.test.ts
class MySqlDatabaseTransactionLog (line 9) | @injectable()
method constructor (line 13) | constructor() {
class DatabaseTransactionLog (line 19) | @injectable()
class TransactionLog (line 25) | @injectable()
FILE: src/test/inversify.test.ts
type NinjaInterface (line 24) | interface NinjaInterface {
type KatanaInterface (line 29) | interface KatanaInterface {
type ShurikenInterface (line 33) | interface ShurikenInterface {
class Katana (line 37) | @injectable()
method hit (line 39) | public hit() {
method hit (line 92) | public hit() {
method hit (line 142) | public hit() {
method hit (line 202) | public hit() {
method hit (line 246) | public hit() {
method hit (line 300) | public hit() {
method hit (line 355) | public hit() {
method constructor (line 437) | constructor() {
method hit (line 440) | public hit() {
method constructor (line 592) | constructor(handler: KatanaHandler, blade: KatanaBlade) {
method hit (line 649) | public hit() {
method hit (line 684) | public hit() {
method use (line 745) | public use() {
method hit (line 894) | public hit() {
method hit (line 992) | public hit() {
method hit (line 1074) | public hit() {
method constructor (line 1170) | constructor() {
method hit (line 1215) | public hit() {
method hit (line 1274) | public hit() {
method hit (line 1416) | public hit() {
method hit (line 1492) | public hit() {
method constructor (line 1708) | constructor() {
method constructor (line 1744) | constructor() {
method constructor (line 1804) | constructor() {
class Shuriken (line 44) | @injectable()
method throw (line 46) | public throw() {
method throw (line 86) | public throw() {
method throw (line 148) | public throw() {
method throw (line 209) | public throw() {
method throw (line 253) | public throw() {
method throw (line 307) | public throw() {
method throw (line 362) | public throw() {
method constructor (line 449) | constructor() {
method throw (line 452) | public throw() {
method throw (line 691) | public throw() {
method use (line 752) | public use() {
method throw (line 999) | public throw() {
method throw (line 1081) | public throw() {
method constructor (line 1178) | constructor() {
method throw (line 1222) | public throw() {
method throw (line 1281) | public throw() {
method throw (line 1423) | public throw() {
method throw (line 1499) | public throw() {
method constructor (line 1716) | constructor() {
method constructor (line 1752) | constructor() {
class Ninja (line 51) | @injectable()
method constructor (line 56) | constructor(
method fight (line 64) | public fight() {
method sneak (line 67) | public sneak() {
method Shuriken (line 104) | public set Shuriken(shuriken: Shuriken) {
method sneak (line 108) | public sneak() {
method fight (line 111) | public fight() {
method constructor (line 158) | constructor(katana: Katana, shuriken: Shuriken) {
method blowgun (line 163) | public set blowgun(blowgun: Blowgun) {
method fight (line 167) | public fight() {
method sneak (line 170) | public sneak() {
method poisonDart (line 173) | public poisonDart() {
method constructor (line 219) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 224) | public fight() {
method sneak (line 227) | public sneak() {
method constructor (line 270) | constructor(
method fight (line 278) | public fight() {
method sneak (line 281) | public sneak() {
method constructor (line 324) | constructor(
method fight (line 333) | public fight() {
method sneak (line 336) | public sneak() {
method constructor (line 372) | constructor(
method fight (line 380) | public fight() {
method sneak (line 383) | public sneak() {
method constructor (line 463) | constructor(
method fight (line 471) | public fight() {
method sneak (line 474) | public sneak() {
method constructor (line 610) | constructor(
method constructor (line 658) | constructor(@inject('Newable<Katana>') katana: Newable<Katana>) {
method fight (line 662) | public fight() {
method constructor (line 965) | constructor(@multiInject(weaponId) weapons: Weapon[]) {
method constructor (line 1009) | constructor(
method fight (line 1017) | public fight() {
method sneak (line 1020) | public sneak() {
method constructor (line 1091) | constructor(
method fight (line 1099) | public fight() {
method sneak (line 1102) | public sneak() {
method constructor (line 1188) | constructor(@multiInject(Weapon) weapons: Weapon[]) {
method constructor (line 1232) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1237) | public fight() {
method sneak (line 1240) | public sneak() {
method constructor (line 1291) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1296) | public fight() {
method sneak (line 1299) | public sneak() {
method constructor (line 1381) | constructor(@multiInject(TYPES.Weapon) weapons: Weapon[]) {
method constructor (line 1433) | constructor(
method fight (line 1441) | public fight() {
method sneak (line 1444) | public sneak() {
method constructor (line 1509) | constructor(
method fight (line 1517) | public fight() {
method sneak (line 1520) | public sneak() {
method constructor (line 1600) | constructor(
method constructor (line 1644) | constructor(
method constructor (line 1681) | constructor(
class Shuriken (line 84) | @injectable()
method throw (line 46) | public throw() {
method throw (line 86) | public throw() {
method throw (line 148) | public throw() {
method throw (line 209) | public throw() {
method throw (line 253) | public throw() {
method throw (line 307) | public throw() {
method throw (line 362) | public throw() {
method constructor (line 449) | constructor() {
method throw (line 452) | public throw() {
method throw (line 691) | public throw() {
method use (line 752) | public use() {
method throw (line 999) | public throw() {
method throw (line 1081) | public throw() {
method constructor (line 1178) | constructor() {
method throw (line 1222) | public throw() {
method throw (line 1281) | public throw() {
method throw (line 1423) | public throw() {
method throw (line 1499) | public throw() {
method constructor (line 1716) | constructor() {
method constructor (line 1752) | constructor() {
class Katana (line 90) | @injectable()
method hit (line 39) | public hit() {
method hit (line 92) | public hit() {
method hit (line 142) | public hit() {
method hit (line 202) | public hit() {
method hit (line 246) | public hit() {
method hit (line 300) | public hit() {
method hit (line 355) | public hit() {
method constructor (line 437) | constructor() {
method hit (line 440) | public hit() {
method constructor (line 592) | constructor(handler: KatanaHandler, blade: KatanaBlade) {
method hit (line 649) | public hit() {
method hit (line 684) | public hit() {
method use (line 745) | public use() {
method hit (line 894) | public hit() {
method hit (line 992) | public hit() {
method hit (line 1074) | public hit() {
method constructor (line 1170) | constructor() {
method hit (line 1215) | public hit() {
method hit (line 1274) | public hit() {
method hit (line 1416) | public hit() {
method hit (line 1492) | public hit() {
method constructor (line 1708) | constructor() {
method constructor (line 1744) | constructor() {
method constructor (line 1804) | constructor() {
class Ninja (line 97) | @injectable()
method constructor (line 56) | constructor(
method fight (line 64) | public fight() {
method sneak (line 67) | public sneak() {
method Shuriken (line 104) | public set Shuriken(shuriken: Shuriken) {
method sneak (line 108) | public sneak() {
method fight (line 111) | public fight() {
method constructor (line 158) | constructor(katana: Katana, shuriken: Shuriken) {
method blowgun (line 163) | public set blowgun(blowgun: Blowgun) {
method fight (line 167) | public fight() {
method sneak (line 170) | public sneak() {
method poisonDart (line 173) | public poisonDart() {
method constructor (line 219) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 224) | public fight() {
method sneak (line 227) | public sneak() {
method constructor (line 270) | constructor(
method fight (line 278) | public fight() {
method sneak (line 281) | public sneak() {
method constructor (line 324) | constructor(
method fight (line 333) | public fight() {
method sneak (line 336) | public sneak() {
method constructor (line 372) | constructor(
method fight (line 380) | public fight() {
method sneak (line 383) | public sneak() {
method constructor (line 463) | constructor(
method fight (line 471) | public fight() {
method sneak (line 474) | public sneak() {
method constructor (line 610) | constructor(
method constructor (line 658) | constructor(@inject('Newable<Katana>') katana: Newable<Katana>) {
method fight (line 662) | public fight() {
method constructor (line 965) | constructor(@multiInject(weaponId) weapons: Weapon[]) {
method constructor (line 1009) | constructor(
method fight (line 1017) | public fight() {
method sneak (line 1020) | public sneak() {
method constructor (line 1091) | constructor(
method fight (line 1099) | public fight() {
method sneak (line 1102) | public sneak() {
method constructor (line 1188) | constructor(@multiInject(Weapon) weapons: Weapon[]) {
method constructor (line 1232) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1237) | public fight() {
method sneak (line 1240) | public sneak() {
method constructor (line 1291) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1296) | public fight() {
method sneak (line 1299) | public sneak() {
method constructor (line 1381) | constructor(@multiInject(TYPES.Weapon) weapons: Weapon[]) {
method constructor (line 1433) | constructor(
method fight (line 1441) | public fight() {
method sneak (line 1444) | public sneak() {
method constructor (line 1509) | constructor(
method fight (line 1517) | public fight() {
method sneak (line 1520) | public sneak() {
method constructor (line 1600) | constructor(
method constructor (line 1644) | constructor(
method constructor (line 1681) | constructor(
class Blowgun (line 135) | class Blowgun {
method blow (line 136) | public blow() {
class Katana (line 141) | class Katana {
method hit (line 39) | public hit() {
method hit (line 92) | public hit() {
method hit (line 142) | public hit() {
method hit (line 202) | public hit() {
method hit (line 246) | public hit() {
method hit (line 300) | public hit() {
method hit (line 355) | public hit() {
method constructor (line 437) | constructor() {
method hit (line 440) | public hit() {
method constructor (line 592) | constructor(handler: KatanaHandler, blade: KatanaBlade) {
method hit (line 649) | public hit() {
method hit (line 684) | public hit() {
method use (line 745) | public use() {
method hit (line 894) | public hit() {
method hit (line 992) | public hit() {
method hit (line 1074) | public hit() {
method constructor (line 1170) | constructor() {
method hit (line 1215) | public hit() {
method hit (line 1274) | public hit() {
method hit (line 1416) | public hit() {
method hit (line 1492) | public hit() {
method constructor (line 1708) | constructor() {
method constructor (line 1744) | constructor() {
method constructor (line 1804) | constructor() {
class Shuriken (line 147) | class Shuriken {
method throw (line 46) | public throw() {
method throw (line 86) | public throw() {
method throw (line 148) | public throw() {
method throw (line 209) | public throw() {
method throw (line 253) | public throw() {
method throw (line 307) | public throw() {
method throw (line 362) | public throw() {
method constructor (line 449) | constructor() {
method throw (line 452) | public throw() {
method throw (line 691) | public throw() {
method use (line 752) | public use() {
method throw (line 999) | public throw() {
method throw (line 1081) | public throw() {
method constructor (line 1178) | constructor() {
method throw (line 1222) | public throw() {
method throw (line 1281) | public throw() {
method throw (line 1423) | public throw() {
method throw (line 1499) | public throw() {
method constructor (line 1716) | constructor() {
method constructor (line 1752) | constructor() {
class Ninja (line 153) | class Ninja {
method constructor (line 56) | constructor(
method fight (line 64) | public fight() {
method sneak (line 67) | public sneak() {
method Shuriken (line 104) | public set Shuriken(shuriken: Shuriken) {
method sneak (line 108) | public sneak() {
method fight (line 111) | public fight() {
method constructor (line 158) | constructor(katana: Katana, shuriken: Shuriken) {
method blowgun (line 163) | public set blowgun(blowgun: Blowgun) {
method fight (line 167) | public fight() {
method sneak (line 170) | public sneak() {
method poisonDart (line 173) | public poisonDart() {
method constructor (line 219) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 224) | public fight() {
method sneak (line 227) | public sneak() {
method constructor (line 270) | constructor(
method fight (line 278) | public fight() {
method sneak (line 281) | public sneak() {
method constructor (line 324) | constructor(
method fight (line 333) | public fight() {
method sneak (line 336) | public sneak() {
method constructor (line 372) | constructor(
method fight (line 380) | public fight() {
method sneak (line 383) | public sneak() {
method constructor (line 463) | constructor(
method fight (line 471) | public fight() {
method sneak (line 474) | public sneak() {
method constructor (line 610) | constructor(
method constructor (line 658) | constructor(@inject('Newable<Katana>') katana: Newable<Katana>) {
method fight (line 662) | public fight() {
method constructor (line 965) | constructor(@multiInject(weaponId) weapons: Weapon[]) {
method constructor (line 1009) | constructor(
method fight (line 1017) | public fight() {
method sneak (line 1020) | public sneak() {
method constructor (line 1091) | constructor(
method fight (line 1099) | public fight() {
method sneak (line 1102) | public sneak() {
method constructor (line 1188) | constructor(@multiInject(Weapon) weapons: Weapon[]) {
method constructor (line 1232) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1237) | public fight() {
method sneak (line 1240) | public sneak() {
method constructor (line 1291) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1296) | public fight() {
method sneak (line 1299) | public sneak() {
method constructor (line 1381) | constructor(@multiInject(TYPES.Weapon) weapons: Weapon[]) {
method constructor (line 1433) | constructor(
method fight (line 1441) | public fight() {
method sneak (line 1444) | public sneak() {
method constructor (line 1509) | constructor(
method fight (line 1517) | public fight() {
method sneak (line 1520) | public sneak() {
method constructor (line 1600) | constructor(
method constructor (line 1644) | constructor(
method constructor (line 1681) | constructor(
class Katana (line 200) | @injectable()
method hit (line 39) | public hit() {
method hit (line 92) | public hit() {
method hit (line 142) | public hit() {
method hit (line 202) | public hit() {
method hit (line 246) | public hit() {
method hit (line 300) | public hit() {
method hit (line 355) | public hit() {
method constructor (line 437) | constructor() {
method hit (line 440) | public hit() {
method constructor (line 592) | constructor(handler: KatanaHandler, blade: KatanaBlade) {
method hit (line 649) | public hit() {
method hit (line 684) | public hit() {
method use (line 745) | public use() {
method hit (line 894) | public hit() {
method hit (line 992) | public hit() {
method hit (line 1074) | public hit() {
method constructor (line 1170) | constructor() {
method hit (line 1215) | public hit() {
method hit (line 1274) | public hit() {
method hit (line 1416) | public hit() {
method hit (line 1492) | public hit() {
method constructor (line 1708) | constructor() {
method constructor (line 1744) | constructor() {
method constructor (line 1804) | constructor() {
class Shuriken (line 207) | @injectable()
method throw (line 46) | public throw() {
method throw (line 86) | public throw() {
method throw (line 148) | public throw() {
method throw (line 209) | public throw() {
method throw (line 253) | public throw() {
method throw (line 307) | public throw() {
method throw (line 362) | public throw() {
method constructor (line 449) | constructor() {
method throw (line 452) | public throw() {
method throw (line 691) | public throw() {
method use (line 752) | public use() {
method throw (line 999) | public throw() {
method throw (line 1081) | public throw() {
method constructor (line 1178) | constructor() {
method throw (line 1222) | public throw() {
method throw (line 1281) | public throw() {
method throw (line 1423) | public throw() {
method throw (line 1499) | public throw() {
method constructor (line 1716) | constructor() {
method constructor (line 1752) | constructor() {
class Ninja (line 214) | @injectable()
method constructor (line 56) | constructor(
method fight (line 64) | public fight() {
method sneak (line 67) | public sneak() {
method Shuriken (line 104) | public set Shuriken(shuriken: Shuriken) {
method sneak (line 108) | public sneak() {
method fight (line 111) | public fight() {
method constructor (line 158) | constructor(katana: Katana, shuriken: Shuriken) {
method blowgun (line 163) | public set blowgun(blowgun: Blowgun) {
method fight (line 167) | public fight() {
method sneak (line 170) | public sneak() {
method poisonDart (line 173) | public poisonDart() {
method constructor (line 219) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 224) | public fight() {
method sneak (line 227) | public sneak() {
method constructor (line 270) | constructor(
method fight (line 278) | public fight() {
method sneak (line 281) | public sneak() {
method constructor (line 324) | constructor(
method fight (line 333) | public fight() {
method sneak (line 336) | public sneak() {
method constructor (line 372) | constructor(
method fight (line 380) | public fight() {
method sneak (line 383) | public sneak() {
method constructor (line 463) | constructor(
method fight (line 471) | public fight() {
method sneak (line 474) | public sneak() {
method constructor (line 610) | constructor(
method constructor (line 658) | constructor(@inject('Newable<Katana>') katana: Newable<Katana>) {
method fight (line 662) | public fight() {
method constructor (line 965) | constructor(@multiInject(weaponId) weapons: Weapon[]) {
method constructor (line 1009) | constructor(
method fight (line 1017) | public fight() {
method sneak (line 1020) | public sneak() {
method constructor (line 1091) | constructor(
method fight (line 1099) | public fight() {
method sneak (line 1102) | public sneak() {
method constructor (line 1188) | constructor(@multiInject(Weapon) weapons: Weapon[]) {
method constructor (line 1232) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1237) | public fight() {
method sneak (line 1240) | public sneak() {
method constructor (line 1291) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1296) | public fight() {
method sneak (line 1299) | public sneak() {
method constructor (line 1381) | constructor(@multiInject(TYPES.Weapon) weapons: Weapon[]) {
method constructor (line 1433) | constructor(
method fight (line 1441) | public fight() {
method sneak (line 1444) | public sneak() {
method constructor (line 1509) | constructor(
method fight (line 1517) | public fight() {
method sneak (line 1520) | public sneak() {
method constructor (line 1600) | constructor(
method constructor (line 1644) | constructor(
method constructor (line 1681) | constructor(
class Katana (line 244) | @injectable()
method hit (line 39) | public hit() {
method hit (line 92) | public hit() {
method hit (line 142) | public hit() {
method hit (line 202) | public hit() {
method hit (line 246) | public hit() {
method hit (line 300) | public hit() {
method hit (line 355) | public hit() {
method constructor (line 437) | constructor() {
method hit (line 440) | public hit() {
method constructor (line 592) | constructor(handler: KatanaHandler, blade: KatanaBlade) {
method hit (line 649) | public hit() {
method hit (line 684) | public hit() {
method use (line 745) | public use() {
method hit (line 894) | public hit() {
method hit (line 992) | public hit() {
method hit (line 1074) | public hit() {
method constructor (line 1170) | constructor() {
method hit (line 1215) | public hit() {
method hit (line 1274) | public hit() {
method hit (line 1416) | public hit() {
method hit (line 1492) | public hit() {
method constructor (line 1708) | constructor() {
method constructor (line 1744) | constructor() {
method constructor (line 1804) | constructor() {
class Shuriken (line 251) | @injectable()
method throw (line 46) | public throw() {
method throw (line 86) | public throw() {
method throw (line 148) | public throw() {
method throw (line 209) | public throw() {
method throw (line 253) | public throw() {
method throw (line 307) | public throw() {
method throw (line 362) | public throw() {
method constructor (line 449) | constructor() {
method throw (line 452) | public throw() {
method throw (line 691) | public throw() {
method use (line 752) | public use() {
method throw (line 999) | public throw() {
method throw (line 1081) | public throw() {
method constructor (line 1178) | constructor() {
method throw (line 1222) | public throw() {
method throw (line 1281) | public throw() {
method throw (line 1423) | public throw() {
method throw (line 1499) | public throw() {
method constructor (line 1716) | constructor() {
method constructor (line 1752) | constructor() {
class Ninja (line 265) | @injectable()
method constructor (line 56) | constructor(
method fight (line 64) | public fight() {
method sneak (line 67) | public sneak() {
method Shuriken (line 104) | public set Shuriken(shuriken: Shuriken) {
method sneak (line 108) | public sneak() {
method fight (line 111) | public fight() {
method constructor (line 158) | constructor(katana: Katana, shuriken: Shuriken) {
method blowgun (line 163) | public set blowgun(blowgun: Blowgun) {
method fight (line 167) | public fight() {
method sneak (line 170) | public sneak() {
method poisonDart (line 173) | public poisonDart() {
method constructor (line 219) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 224) | public fight() {
method sneak (line 227) | public sneak() {
method constructor (line 270) | constructor(
method fight (line 278) | public fight() {
method sneak (line 281) | public sneak() {
method constructor (line 324) | constructor(
method fight (line 333) | public fight() {
method sneak (line 336) | public sneak() {
method constructor (line 372) | constructor(
method fight (line 380) | public fight() {
method sneak (line 383) | public sneak() {
method constructor (line 463) | constructor(
method fight (line 471) | public fight() {
method sneak (line 474) | public sneak() {
method constructor (line 610) | constructor(
method constructor (line 658) | constructor(@inject('Newable<Katana>') katana: Newable<Katana>) {
method fight (line 662) | public fight() {
method constructor (line 965) | constructor(@multiInject(weaponId) weapons: Weapon[]) {
method constructor (line 1009) | constructor(
method fight (line 1017) | public fight() {
method sneak (line 1020) | public sneak() {
method constructor (line 1091) | constructor(
method fight (line 1099) | public fight() {
method sneak (line 1102) | public sneak() {
method constructor (line 1188) | constructor(@multiInject(Weapon) weapons: Weapon[]) {
method constructor (line 1232) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1237) | public fight() {
method sneak (line 1240) | public sneak() {
method constructor (line 1291) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1296) | public fight() {
method sneak (line 1299) | public sneak() {
method constructor (line 1381) | constructor(@multiInject(TYPES.Weapon) weapons: Weapon[]) {
method constructor (line 1433) | constructor(
method fight (line 1441) | public fight() {
method sneak (line 1444) | public sneak() {
method constructor (line 1509) | constructor(
method fight (line 1517) | public fight() {
method sneak (line 1520) | public sneak() {
method constructor (line 1600) | constructor(
method constructor (line 1644) | constructor(
method constructor (line 1681) | constructor(
class Katana (line 298) | @injectable()
method hit (line 39) | public hit() {
method hit (line 92) | public hit() {
method hit (line 142) | public hit() {
method hit (line 202) | public hit() {
method hit (line 246) | public hit() {
method hit (line 300) | public hit() {
method hit (line 355) | public hit() {
method constructor (line 437) | constructor() {
method hit (line 440) | public hit() {
method constructor (line 592) | constructor(handler: KatanaHandler, blade: KatanaBlade) {
method hit (line 649) | public hit() {
method hit (line 684) | public hit() {
method use (line 745) | public use() {
method hit (line 894) | public hit() {
method hit (line 992) | public hit() {
method hit (line 1074) | public hit() {
method constructor (line 1170) | constructor() {
method hit (line 1215) | public hit() {
method hit (line 1274) | public hit() {
method hit (line 1416) | public hit() {
method hit (line 1492) | public hit() {
method constructor (line 1708) | constructor() {
method constructor (line 1744) | constructor() {
method constructor (line 1804) | constructor() {
class Shuriken (line 305) | @injectable()
method throw (line 46) | public throw() {
method throw (line 86) | public throw() {
method throw (line 148) | public throw() {
method throw (line 209) | public throw() {
method throw (line 253) | public throw() {
method throw (line 307) | public throw() {
method throw (line 362) | public throw() {
method constructor (line 449) | constructor() {
method throw (line 452) | public throw() {
method throw (line 691) | public throw() {
method use (line 752) | public use() {
method throw (line 999) | public throw() {
method throw (line 1081) | public throw() {
method constructor (line 1178) | constructor() {
method throw (line 1222) | public throw() {
method throw (line 1281) | public throw() {
method throw (line 1423) | public throw() {
method throw (line 1499) | public throw() {
method constructor (line 1716) | constructor() {
method constructor (line 1752) | constructor() {
class Ninja (line 319) | @injectable()
method constructor (line 56) | constructor(
method fight (line 64) | public fight() {
method sneak (line 67) | public sneak() {
method Shuriken (line 104) | public set Shuriken(shuriken: Shuriken) {
method sneak (line 108) | public sneak() {
method fight (line 111) | public fight() {
method constructor (line 158) | constructor(katana: Katana, shuriken: Shuriken) {
method blowgun (line 163) | public set blowgun(blowgun: Blowgun) {
method fight (line 167) | public fight() {
method sneak (line 170) | public sneak() {
method poisonDart (line 173) | public poisonDart() {
method constructor (line 219) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 224) | public fight() {
method sneak (line 227) | public sneak() {
method constructor (line 270) | constructor(
method fight (line 278) | public fight() {
method sneak (line 281) | public sneak() {
method constructor (line 324) | constructor(
method fight (line 333) | public fight() {
method sneak (line 336) | public sneak() {
method constructor (line 372) | constructor(
method fight (line 380) | public fight() {
method sneak (line 383) | public sneak() {
method constructor (line 463) | constructor(
method fight (line 471) | public fight() {
method sneak (line 474) | public sneak() {
method constructor (line 610) | constructor(
method constructor (line 658) | constructor(@inject('Newable<Katana>') katana: Newable<Katana>) {
method fight (line 662) | public fight() {
method constructor (line 965) | constructor(@multiInject(weaponId) weapons: Weapon[]) {
method constructor (line 1009) | constructor(
method fight (line 1017) | public fight() {
method sneak (line 1020) | public sneak() {
method constructor (line 1091) | constructor(
method fight (line 1099) | public fight() {
method sneak (line 1102) | public sneak() {
method constructor (line 1188) | constructor(@multiInject(Weapon) weapons: Weapon[]) {
method constructor (line 1232) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1237) | public fight() {
method sneak (line 1240) | public sneak() {
method constructor (line 1291) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1296) | public fight() {
method sneak (line 1299) | public sneak() {
method constructor (line 1381) | constructor(@multiInject(TYPES.Weapon) weapons: Weapon[]) {
method constructor (line 1433) | constructor(
method fight (line 1441) | public fight() {
method sneak (line 1444) | public sneak() {
method constructor (line 1509) | constructor(
method fight (line 1517) | public fight() {
method sneak (line 1520) | public sneak() {
method constructor (line 1600) | constructor(
method constructor (line 1644) | constructor(
method constructor (line 1681) | constructor(
class Katana (line 353) | @injectable()
method hit (line 39) | public hit() {
method hit (line 92) | public hit() {
method hit (line 142) | public hit() {
method hit (line 202) | public hit() {
method hit (line 246) | public hit() {
method hit (line 300) | public hit() {
method hit (line 355) | public hit() {
method constructor (line 437) | constructor() {
method hit (line 440) | public hit() {
method constructor (line 592) | constructor(handler: KatanaHandler, blade: KatanaBlade) {
method hit (line 649) | public hit() {
method hit (line 684) | public hit() {
method use (line 745) | public use() {
method hit (line 894) | public hit() {
method hit (line 992) | public hit() {
method hit (line 1074) | public hit() {
method constructor (line 1170) | constructor() {
method hit (line 1215) | public hit() {
method hit (line 1274) | public hit() {
method hit (line 1416) | public hit() {
method hit (line 1492) | public hit() {
method constructor (line 1708) | constructor() {
method constructor (line 1744) | constructor() {
method constructor (line 1804) | constructor() {
class Shuriken (line 360) | @injectable()
method throw (line 46) | public throw() {
method throw (line 86) | public throw() {
method throw (line 148) | public throw() {
method throw (line 209) | public throw() {
method throw (line 253) | public throw() {
method throw (line 307) | public throw() {
method throw (line 362) | public throw() {
method constructor (line 449) | constructor() {
method throw (line 452) | public throw() {
method throw (line 691) | public throw() {
method use (line 752) | public use() {
method throw (line 999) | public throw() {
method throw (line 1081) | public throw() {
method constructor (line 1178) | constructor() {
method throw (line 1222) | public throw() {
method throw (line 1281) | public throw() {
method throw (line 1423) | public throw() {
method throw (line 1499) | public throw() {
method constructor (line 1716) | constructor() {
method constructor (line 1752) | constructor() {
class Ninja (line 367) | @injectable()
method constructor (line 56) | constructor(
method fight (line 64) | public fight() {
method sneak (line 67) | public sneak() {
method Shuriken (line 104) | public set Shuriken(shuriken: Shuriken) {
method sneak (line 108) | public sneak() {
method fight (line 111) | public fight() {
method constructor (line 158) | constructor(katana: Katana, shuriken: Shuriken) {
method blowgun (line 163) | public set blowgun(blowgun: Blowgun) {
method fight (line 167) | public fight() {
method sneak (line 170) | public sneak() {
method poisonDart (line 173) | public poisonDart() {
method constructor (line 219) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 224) | public fight() {
method sneak (line 227) | public sneak() {
method constructor (line 270) | constructor(
method fight (line 278) | public fight() {
method sneak (line 281) | public sneak() {
method constructor (line 324) | constructor(
method fight (line 333) | public fight() {
method sneak (line 336) | public sneak() {
method constructor (line 372) | constructor(
method fight (line 380) | public fight() {
method sneak (line 383) | public sneak() {
method constructor (line 463) | constructor(
method fight (line 471) | public fight() {
method sneak (line 474) | public sneak() {
method constructor (line 610) | constructor(
method constructor (line 658) | constructor(@inject('Newable<Katana>') katana: Newable<Katana>) {
method fight (line 662) | public fight() {
method constructor (line 965) | constructor(@multiInject(weaponId) weapons: Weapon[]) {
method constructor (line 1009) | constructor(
method fight (line 1017) | public fight() {
method sneak (line 1020) | public sneak() {
method constructor (line 1091) | constructor(
method fight (line 1099) | public fight() {
method sneak (line 1102) | public sneak() {
method constructor (line 1188) | constructor(@multiInject(Weapon) weapons: Weapon[]) {
method constructor (line 1232) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1237) | public fight() {
method sneak (line 1240) | public sneak() {
method constructor (line 1291) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1296) | public fight() {
method sneak (line 1299) | public sneak() {
method constructor (line 1381) | constructor(@multiInject(TYPES.Weapon) weapons: Weapon[]) {
method constructor (line 1433) | constructor(
method fight (line 1441) | public fight() {
method sneak (line 1444) | public sneak() {
method constructor (line 1509) | constructor(
method fight (line 1517) | public fight() {
method sneak (line 1520) | public sneak() {
method constructor (line 1600) | constructor(
method constructor (line 1644) | constructor(
method constructor (line 1681) | constructor(
class Katana (line 434) | @injectable()
method hit (line 39) | public hit() {
method hit (line 92) | public hit() {
method hit (line 142) | public hit() {
method hit (line 202) | public hit() {
method hit (line 246) | public hit() {
method hit (line 300) | public hit() {
method hit (line 355) | public hit() {
method constructor (line 437) | constructor() {
method hit (line 440) | public hit() {
method constructor (line 592) | constructor(handler: KatanaHandler, blade: KatanaBlade) {
method hit (line 649) | public hit() {
method hit (line 684) | public hit() {
method use (line 745) | public use() {
method hit (line 894) | public hit() {
method hit (line 992) | public hit() {
method hit (line 1074) | public hit() {
method constructor (line 1170) | constructor() {
method hit (line 1215) | public hit() {
method hit (line 1274) | public hit() {
method hit (line 1416) | public hit() {
method hit (line 1492) | public hit() {
method constructor (line 1708) | constructor() {
method constructor (line 1744) | constructor() {
method constructor (line 1804) | constructor() {
class Shuriken (line 446) | @injectable()
method throw (line 46) | public throw() {
method throw (line 86) | public throw() {
method throw (line 148) | public throw() {
method throw (line 209) | public throw() {
method throw (line 253) | public throw() {
method throw (line 307) | public throw() {
method throw (line 362) | public throw() {
method constructor (line 449) | constructor() {
method throw (line 452) | public throw() {
method throw (line 691) | public throw() {
method use (line 752) | public use() {
method throw (line 999) | public throw() {
method throw (line 1081) | public throw() {
method constructor (line 1178) | constructor() {
method throw (line 1222) | public throw() {
method throw (line 1281) | public throw() {
method throw (line 1423) | public throw() {
method throw (line 1499) | public throw() {
method constructor (line 1716) | constructor() {
method constructor (line 1752) | constructor() {
class Ninja (line 458) | @injectable()
method constructor (line 56) | constructor(
method fight (line 64) | public fight() {
method sneak (line 67) | public sneak() {
method Shuriken (line 104) | public set Shuriken(shuriken: Shuriken) {
method sneak (line 108) | public sneak() {
method fight (line 111) | public fight() {
method constructor (line 158) | constructor(katana: Katana, shuriken: Shuriken) {
method blowgun (line 163) | public set blowgun(blowgun: Blowgun) {
method fight (line 167) | public fight() {
method sneak (line 170) | public sneak() {
method poisonDart (line 173) | public poisonDart() {
method constructor (line 219) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 224) | public fight() {
method sneak (line 227) | public sneak() {
method constructor (line 270) | constructor(
method fight (line 278) | public fight() {
method sneak (line 281) | public sneak() {
method constructor (line 324) | constructor(
method fight (line 333) | public fight() {
method sneak (line 336) | public sneak() {
method constructor (line 372) | constructor(
method fight (line 380) | public fight() {
method sneak (line 383) | public sneak() {
method constructor (line 463) | constructor(
method fight (line 471) | public fight() {
method sneak (line 474) | public sneak() {
method constructor (line 610) | constructor(
method constructor (line 658) | constructor(@inject('Newable<Katana>') katana: Newable<Katana>) {
method fight (line 662) | public fight() {
method constructor (line 965) | constructor(@multiInject(weaponId) weapons: Weapon[]) {
method constructor (line 1009) | constructor(
method fight (line 1017) | public fight() {
method sneak (line 1020) | public sneak() {
method constructor (line 1091) | constructor(
method fight (line 1099) | public fight() {
method sneak (line 1102) | public sneak() {
method constructor (line 1188) | constructor(@multiInject(Weapon) weapons: Weapon[]) {
method constructor (line 1232) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1237) | public fight() {
method sneak (line 1240) | public sneak() {
method constructor (line 1291) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1296) | public fight() {
method sneak (line 1299) | public sneak() {
method constructor (line 1381) | constructor(@multiInject(TYPES.Weapon) weapons: Weapon[]) {
method constructor (line 1433) | constructor(
method fight (line 1441) | public fight() {
method sneak (line 1444) | public sneak() {
method constructor (line 1509) | constructor(
method fight (line 1517) | public fight() {
method sneak (line 1520) | public sneak() {
method constructor (line 1600) | constructor(
method constructor (line 1644) | constructor(
method constructor (line 1681) | constructor(
class Hero (line 498) | @injectable()
method constructor (line 501) | constructor() {
method constructor (line 528) | constructor() {
type Warrior (line 514) | interface Warrior {
class Hero (line 525) | @injectable()
method constructor (line 501) | constructor() {
method constructor (line 528) | constructor() {
class UseSymbol (line 541) | @injectable()
method constructor (line 544) | constructor(@inject('Symbol') currentDate: symbol) {
method doSomething (line 547) | public doSomething() {
type ShortDistanceWeaponFactory (line 575) | type ShortDistanceWeaponFactory = () => ShortDistanceWeapon;
class KatanaBlade (line 577) | @injectable()
class KatanaHandler (line 580) | @injectable()
type ShortDistanceWeapon (line 583) | interface ShortDistanceWeapon {
class Katana (line 588) | @injectable()
method hit (line 39) | public hit() {
method hit (line 92) | public hit() {
method hit (line 142) | public hit() {
method hit (line 202) | public hit() {
method hit (line 246) | public hit() {
method hit (line 300) | public hit() {
method hit (line 355) | public hit() {
method constructor (line 437) | constructor() {
method hit (line 440) | public hit() {
method constructor (line 592) | constructor(handler: KatanaHandler, blade: KatanaBlade) {
method hit (line 649) | public hit() {
method hit (line 684) | public hit() {
method use (line 745) | public use() {
method hit (line 894) | public hit() {
method hit (line 992) | public hit() {
method hit (line 1074) | public hit() {
method constructor (line 1170) | constructor() {
method hit (line 1215) | public hit() {
method hit (line 1274) | public hit() {
method hit (line 1416) | public hit() {
method hit (line 1492) | public hit() {
method constructor (line 1708) | constructor() {
method constructor (line 1744) | constructor() {
method constructor (line 1804) | constructor() {
class Shuriken (line 598) | @injectable()
method throw (line 46) | public throw() {
method throw (line 86) | public throw() {
method throw (line 148) | public throw() {
method throw (line 209) | public throw() {
method throw (line 253) | public throw() {
method throw (line 307) | public throw() {
method throw (line 362) | public throw() {
method constructor (line 449) | constructor() {
method throw (line 452) | public throw() {
method throw (line 691) | public throw() {
method use (line 752) | public use() {
method throw (line 999) | public throw() {
method throw (line 1081) | public throw() {
method constructor (line 1178) | constructor() {
method throw (line 1222) | public throw() {
method throw (line 1281) | public throw() {
method throw (line 1423) | public throw() {
method throw (line 1499) | public throw() {
method constructor (line 1716) | constructor() {
method constructor (line 1752) | constructor() {
type Warrior (line 601) | interface Warrior {
class Ninja (line 606) | @injectable()
method constructor (line 56) | constructor(
method fight (line 64) | public fight() {
method sneak (line 67) | public sneak() {
method Shuriken (line 104) | public set Shuriken(shuriken: Shuriken) {
method sneak (line 108) | public sneak() {
method fight (line 111) | public fight() {
method constructor (line 158) | constructor(katana: Katana, shuriken: Shuriken) {
method blowgun (line 163) | public set blowgun(blowgun: Blowgun) {
method fight (line 167) | public fight() {
method sneak (line 170) | public sneak() {
method poisonDart (line 173) | public poisonDart() {
method constructor (line 219) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 224) | public fight() {
method sneak (line 227) | public sneak() {
method constructor (line 270) | constructor(
method fight (line 278) | public fight() {
method sneak (line 281) | public sneak() {
method constructor (line 324) | constructor(
method fight (line 333) | public fight() {
method sneak (line 336) | public sneak() {
method constructor (line 372) | constructor(
method fight (line 380) | public fight() {
method sneak (line 383) | public sneak() {
method constructor (line 463) | constructor(
method fight (line 471) | public fight() {
method sneak (line 474) | public sneak() {
method constructor (line 610) | constructor(
method constructor (line 658) | constructor(@inject('Newable<Katana>') katana: Newable<Katana>) {
method fight (line 662) | public fight() {
method constructor (line 965) | constructor(@multiInject(weaponId) weapons: Weapon[]) {
method constructor (line 1009) | constructor(
method fight (line 1017) | public fight() {
method sneak (line 1020) | public sneak() {
method constructor (line 1091) | constructor(
method fight (line 1099) | public fight() {
method sneak (line 1102) | public sneak() {
method constructor (line 1188) | constructor(@multiInject(Weapon) weapons: Weapon[]) {
method constructor (line 1232) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1237) | public fight() {
method sneak (line 1240) | public sneak() {
method constructor (line 1291) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1296) | public fight() {
method sneak (line 1299) | public sneak() {
method constructor (line 1381) | constructor(@multiInject(TYPES.Weapon) weapons: Weapon[]) {
method constructor (line 1433) | constructor(
method fight (line 1441) | public fight() {
method sneak (line 1444) | public sneak() {
method constructor (line 1509) | constructor(
method fight (line 1517) | public fight() {
method sneak (line 1520) | public sneak() {
method constructor (line 1600) | constructor(
method constructor (line 1644) | constructor(
method constructor (line 1681) | constructor(
class Katana (line 647) | @injectable()
method hit (line 39) | public hit() {
method hit (line 92) | public hit() {
method hit (line 142) | public hit() {
method hit (line 202) | public hit() {
method hit (line 246) | public hit() {
method hit (line 300) | public hit() {
method hit (line 355) | public hit() {
method constructor (line 437) | constructor() {
method hit (line 440) | public hit() {
method constructor (line 592) | constructor(handler: KatanaHandler, blade: KatanaBlade) {
method hit (line 649) | public hit() {
method hit (line 684) | public hit() {
method use (line 745) | public use() {
method hit (line 894) | public hit() {
method hit (line 992) | public hit() {
method hit (line 1074) | public hit() {
method constructor (line 1170) | constructor() {
method hit (line 1215) | public hit() {
method hit (line 1274) | public hit() {
method hit (line 1416) | public hit() {
method hit (line 1492) | public hit() {
method constructor (line 1708) | constructor() {
method constructor (line 1744) | constructor() {
method constructor (line 1804) | constructor() {
class Ninja (line 654) | @injectable()
method constructor (line 56) | constructor(
method fight (line 64) | public fight() {
method sneak (line 67) | public sneak() {
method Shuriken (line 104) | public set Shuriken(shuriken: Shuriken) {
method sneak (line 108) | public sneak() {
method fight (line 111) | public fight() {
method constructor (line 158) | constructor(katana: Katana, shuriken: Shuriken) {
method blowgun (line 163) | public set blowgun(blowgun: Blowgun) {
method fight (line 167) | public fight() {
method sneak (line 170) | public sneak() {
method poisonDart (line 173) | public poisonDart() {
method constructor (line 219) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 224) | public fight() {
method sneak (line 227) | public sneak() {
method constructor (line 270) | constructor(
method fight (line 278) | public fight() {
method sneak (line 281) | public sneak() {
method constructor (line 324) | constructor(
method fight (line 333) | public fight() {
method sneak (line 336) | public sneak() {
method constructor (line 372) | constructor(
method fight (line 380) | public fight() {
method sneak (line 383) | public sneak() {
method constructor (line 463) | constructor(
method fight (line 471) | public fight() {
method sneak (line 474) | public sneak() {
method constructor (line 610) | constructor(
method constructor (line 658) | constructor(@inject('Newable<Katana>') katana: Newable<Katana>) {
method fight (line 662) | public fight() {
method constructor (line 965) | constructor(@multiInject(weaponId) weapons: Weapon[]) {
method constructor (line 1009) | constructor(
method fight (line 1017) | public fight() {
method sneak (line 1020) | public sneak() {
method constructor (line 1091) | constructor(
method fight (line 1099) | public fight() {
method sneak (line 1102) | public sneak() {
method constructor (line 1188) | constructor(@multiInject(Weapon) weapons: Weapon[]) {
method constructor (line 1232) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1237) | public fight() {
method sneak (line 1240) | public sneak() {
method constructor (line 1291) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1296) | public fight() {
method sneak (line 1299) | public sneak() {
method constructor (line 1381) | constructor(@multiInject(TYPES.Weapon) weapons: Weapon[]) {
method constructor (line 1433) | constructor(
method fight (line 1441) | public fight() {
method sneak (line 1444) | public sneak() {
method constructor (line 1509) | constructor(
method fight (line 1517) | public fight() {
method sneak (line 1520) | public sneak() {
method constructor (line 1600) | constructor(
method constructor (line 1644) | constructor(
method constructor (line 1681) | constructor(
type Ninja (line 677) | interface Ninja {
method constructor (line 56) | constructor(
method fight (line 64) | public fight() {
method sneak (line 67) | public sneak() {
method Shuriken (line 104) | public set Shuriken(shuriken: Shuriken) {
method sneak (line 108) | public sneak() {
method fight (line 111) | public fight() {
method constructor (line 158) | constructor(katana: Katana, shuriken: Shuriken) {
method blowgun (line 163) | public set blowgun(blowgun: Blowgun) {
method fight (line 167) | public fight() {
method sneak (line 170) | public sneak() {
method poisonDart (line 173) | public poisonDart() {
method constructor (line 219) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 224) | public fight() {
method sneak (line 227) | public sneak() {
method constructor (line 270) | constructor(
method fight (line 278) | public fight() {
method sneak (line 281) | public sneak() {
method constructor (line 324) | constructor(
method fight (line 333) | public fight() {
method sneak (line 336) | public sneak() {
method constructor (line 372) | constructor(
method fight (line 380) | public fight() {
method sneak (line 383) | public sneak() {
method constructor (line 463) | constructor(
method fight (line 471) | public fight() {
method sneak (line 474) | public sneak() {
method constructor (line 610) | constructor(
method constructor (line 658) | constructor(@inject('Newable<Katana>') katana: Newable<Katana>) {
method fight (line 662) | public fight() {
method constructor (line 965) | constructor(@multiInject(weaponId) weapons: Weapon[]) {
method constructor (line 1009) | constructor(
method fight (line 1017) | public fight() {
method sneak (line 1020) | public sneak() {
method constructor (line 1091) | constructor(
method fight (line 1099) | public fight() {
method sneak (line 1102) | public sneak() {
method constructor (line 1188) | constructor(@multiInject(Weapon) weapons: Weapon[]) {
method constructor (line 1232) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1237) | public fight() {
method sneak (line 1240) | public sneak() {
method constructor (line 1291) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1296) | public fight() {
method sneak (line 1299) | public sneak() {
method constructor (line 1381) | constructor(@multiInject(TYPES.Weapon) weapons: Weapon[]) {
method constructor (line 1433) | constructor(
method fight (line 1441) | public fight() {
method sneak (line 1444) | public sneak() {
method constructor (line 1509) | constructor(
method fight (line 1517) | public fight() {
method sneak (line 1520) | public sneak() {
method constructor (line 1600) | constructor(
method constructor (line 1644) | constructor(
method constructor (line 1681) | constructor(
class Katana (line 682) | @injectable()
method hit (line 39) | public hit() {
method hit (line 92) | public hit() {
method hit (line 142) | public hit() {
method hit (line 202) | public hit() {
method hit (line 246) | public hit() {
method hit (line 300) | public hit() {
method hit (line 355) | public hit() {
method constructor (line 437) | constructor() {
method hit (line 440) | public hit() {
method constructor (line 592) | constructor(handler: KatanaHandler, blade: KatanaBlade) {
method hit (line 649) | public hit() {
method hit (line 684) | public hit() {
method use (line 745) | public use() {
method hit (line 894) | public hit() {
method hit (line 992) | public hit() {
method hit (line 1074) | public hit() {
method constructor (line 1170) | constructor() {
method hit (line 1215) | public hit() {
method hit (line 1274) | public hit() {
method hit (line 1416) | public hit() {
method hit (line 1492) | public hit() {
method constructor (line 1708) | constructor() {
method constructor (line 1744) | constructor() {
method constructor (line 1804) | constructor() {
class Shuriken (line 689) | @injectable()
method throw (line 46) | public throw() {
method throw (line 86) | public throw() {
method throw (line 148) | public throw() {
method throw (line 209) | public throw() {
method throw (line 253) | public throw() {
method throw (line 307) | public throw() {
method throw (line 362) | public throw() {
method constructor (line 449) | constructor() {
method throw (line 452) | public throw() {
method throw (line 691) | public throw() {
method use (line 752) | public use() {
method throw (line 999) | public throw() {
method throw (line 1081) | public throw() {
method constructor (line 1178) | constructor() {
method throw (line 1222) | public throw() {
method throw (line 1281) | public throw() {
method throw (line 1423) | public throw() {
method throw (line 1499) | public throw() {
method constructor (line 1716) | constructor() {
method constructor (line 1752) | constructor() {
class NinjaWithUserDefinedFactory (line 696) | @injectable()
method constructor (line 701) | constructor(
method fight (line 709) | public fight() {
method sneak (line 712) | public sneak() {
method constructor (line 762) | constructor(
method fight (line 770) | public fight() {
method sneak (line 773) | public sneak() {
type Ninja (line 734) | interface Ninja {
method constructor (line 56) | constructor(
method fight (line 64) | public fight() {
method sneak (line 67) | public sneak() {
method Shuriken (line 104) | public set Shuriken(shuriken: Shuriken) {
method sneak (line 108) | public sneak() {
method fight (line 111) | public fight() {
method constructor (line 158) | constructor(katana: Katana, shuriken: Shuriken) {
method blowgun (line 163) | public set blowgun(blowgun: Blowgun) {
method fight (line 167) | public fight() {
method sneak (line 170) | public sneak() {
method poisonDart (line 173) | public poisonDart() {
method constructor (line 219) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 224) | public fight() {
method sneak (line 227) | public sneak() {
method constructor (line 270) | constructor(
method fight (line 278) | public fight() {
method sneak (line 281) | public sneak() {
method constructor (line 324) | constructor(
method fight (line 333) | public fight() {
method sneak (line 336) | public sneak() {
method constructor (line 372) | constructor(
method fight (line 380) | public fight() {
method sneak (line 383) | public sneak() {
method constructor (line 463) | constructor(
method fight (line 471) | public fight() {
method sneak (line 474) | public sneak() {
method constructor (line 610) | constructor(
method constructor (line 658) | constructor(@inject('Newable<Katana>') katana: Newable<Katana>) {
method fight (line 662) | public fight() {
method constructor (line 965) | constructor(@multiInject(weaponId) weapons: Weapon[]) {
method constructor (line 1009) | constructor(
method fight (line 1017) | public fight() {
method sneak (line 1020) | public sneak() {
method constructor (line 1091) | constructor(
method fight (line 1099) | public fight() {
method sneak (line 1102) | public sneak() {
method constructor (line 1188) | constructor(@multiInject(Weapon) weapons: Weapon[]) {
method constructor (line 1232) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1237) | public fight() {
method sneak (line 1240) | public sneak() {
method constructor (line 1291) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1296) | public fight() {
method sneak (line 1299) | public sneak() {
method constructor (line 1381) | constructor(@multiInject(TYPES.Weapon) weapons: Weapon[]) {
method constructor (line 1433) | constructor(
method fight (line 1441) | public fight() {
method sneak (line 1444) | public sneak() {
method constructor (line 1509) | constructor(
method fight (line 1517) | public fight() {
method sneak (line 1520) | public sneak() {
method constructor (line 1600) | constructor(
method constructor (line 1644) | constructor(
method constructor (line 1681) | constructor(
type Weapon (line 739) | interface Weapon {
class Katana (line 743) | @injectable()
method hit (line 39) | public hit() {
method hit (line 92) | public hit() {
method hit (line 142) | public hit() {
method hit (line 202) | public hit() {
method hit (line 246) | public hit() {
method hit (line 300) | public hit() {
method hit (line 355) | public hit() {
method constructor (line 437) | constructor() {
method hit (line 440) | public hit() {
method constructor (line 592) | constructor(handler: KatanaHandler, blade: KatanaBlade) {
method hit (line 649) | public hit() {
method hit (line 684) | public hit() {
method use (line 745) | public use() {
method hit (line 894) | public hit() {
method hit (line 992) | public hit() {
method hit (line 1074) | public hit() {
method constructor (line 1170) | constructor() {
method hit (line 1215) | public hit() {
method hit (line 1274) | public hit() {
method hit (line 1416) | public hit() {
method hit (line 1492) | public hit() {
method constructor (line 1708) | constructor() {
method constructor (line 1744) | constructor() {
method constructor (line 1804) | constructor() {
class Shuriken (line 750) | @injectable()
method throw (line 46) | public throw() {
method throw (line 86) | public throw() {
method throw (line 148) | public throw() {
method throw (line 209) | public throw() {
method throw (line 253) | public throw() {
method throw (line 307) | public throw() {
method throw (line 362) | public throw() {
method constructor (line 449) | constructor() {
method throw (line 452) | public throw() {
method throw (line 691) | public throw() {
method use (line 752) | public use() {
method throw (line 999) | public throw() {
method throw (line 1081) | public throw() {
method constructor (line 1178) | constructor() {
method throw (line 1222) | public throw() {
method throw (line 1281) | public throw() {
method throw (line 1423) | public throw() {
method throw (line 1499) | public throw() {
method constructor (line 1716) | constructor() {
method constructor (line 1752) | constructor() {
class NinjaWithUserDefinedFactory (line 757) | @injectable()
method constructor (line 701) | constructor(
method fight (line 709) | public fight() {
method sneak (line 712) | public sneak() {
method constructor (line 762) | constructor(
method fight (line 770) | public fight() {
method sneak (line 773) | public sneak() {
class InjectorPump (line 800) | @injectable()
class SparkPlugs (line 803) | @injectable()
class Engine (line 806) | class Engine {
class DieselEngine (line 810) | @injectable()
method constructor (line 814) | constructor(@inject('InjectorPump') injectorPump: InjectorPump) {
method debug (line 818) | public debug() {
class PetrolEngine (line 823) | @injectable()
method constructor (line 827) | constructor(@inject('SparkPlugs') sparkPlugs: SparkPlugs) {
method debug (line 831) | public debug() {
type CarFactory (line 836) | interface CarFactory {
class DieselCarFactory (line 840) | @injectable()
method constructor (line 843) | constructor(
method createEngine (line 849) | public createEngine(displacement: number): Engine {
type KatanaProvider (line 885) | type KatanaProvider = () => Promise<Katana>;
type Ninja (line 887) | interface Ninja {
method constructor (line 56) | constructor(
method fight (line 64) | public fight() {
method sneak (line 67) | public sneak() {
method Shuriken (line 104) | public set Shuriken(shuriken: Shuriken) {
method sneak (line 108) | public sneak() {
method fight (line 111) | public fight() {
method constructor (line 158) | constructor(katana: Katana, shuriken: Shuriken) {
method blowgun (line 163) | public set blowgun(blowgun: Blowgun) {
method fight (line 167) | public fight() {
method sneak (line 170) | public sneak() {
method poisonDart (line 173) | public poisonDart() {
method constructor (line 219) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 224) | public fight() {
method sneak (line 227) | public sneak() {
method constructor (line 270) | constructor(
method fight (line 278) | public fight() {
method sneak (line 281) | public sneak() {
method constructor (line 324) | constructor(
method fight (line 333) | public fight() {
method sneak (line 336) | public sneak() {
method constructor (line 372) | constructor(
method fight (line 380) | public fight() {
method sneak (line 383) | public sneak() {
method constructor (line 463) | constructor(
method fight (line 471) | public fight() {
method sneak (line 474) | public sneak() {
method constructor (line 610) | constructor(
method constructor (line 658) | constructor(@inject('Newable<Katana>') katana: Newable<Katana>) {
method fight (line 662) | public fight() {
method constructor (line 965) | constructor(@multiInject(weaponId) weapons: Weapon[]) {
method constructor (line 1009) | constructor(
method fight (line 1017) | public fight() {
method sneak (line 1020) | public sneak() {
method constructor (line 1091) | constructor(
method fight (line 1099) | public fight() {
method sneak (line 1102) | public sneak() {
method constructor (line 1188) | constructor(@multiInject(Weapon) weapons: Weapon[]) {
method constructor (line 1232) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1237) | public fight() {
method sneak (line 1240) | public sneak() {
method constructor (line 1291) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1296) | public fight() {
method sneak (line 1299) | public sneak() {
method constructor (line 1381) | constructor(@multiInject(TYPES.Weapon) weapons: Weapon[]) {
method constructor (line 1433) | constructor(
method fight (line 1441) | public fight() {
method sneak (line 1444) | public sneak() {
method constructor (line 1509) | constructor(
method fight (line 1517) | public fight() {
method sneak (line 1520) | public sneak() {
method constructor (line 1600) | constructor(
method constructor (line 1644) | constructor(
method constructor (line 1681) | constructor(
class Katana (line 892) | @injectable()
method hit (line 39) | public hit() {
method hit (line 92) | public hit() {
method hit (line 142) | public hit() {
method hit (line 202) | public hit() {
method hit (line 246) | public hit() {
method hit (line 300) | public hit() {
method hit (line 355) | public hit() {
method constructor (line 437) | constructor() {
method hit (line 440) | public hit() {
method constructor (line 592) | constructor(handler: KatanaHandler, blade: KatanaBlade) {
method hit (line 649) | public hit() {
method hit (line 684) | public hit() {
method use (line 745) | public use() {
method hit (line 894) | public hit() {
method hit (line 992) | public hit() {
method hit (line 1074) | public hit() {
method constructor (line 1170) | constructor() {
method hit (line 1215) | public hit() {
method hit (line 1274) | public hit() {
method hit (line 1416) | public hit() {
method hit (line 1492) | public hit() {
method constructor (line 1708) | constructor() {
method constructor (line 1744) | constructor() {
method constructor (line 1804) | constructor() {
class NinjaWithProvider (line 899) | @injectable()
method constructor (line 904) | constructor(@inject('Provider<Katana>') katanaProvider: KatanaProvider) {
type Weapon (line 942) | interface Weapon {
class Katana (line 946) | @injectable()
method hit (line 39) | public hit() {
method hit (line 92) | public hit() {
method hit (line 142) | public hit() {
method hit (line 202) | public hit() {
method hit (line 246) | public hit() {
method hit (line 300) | public hit() {
method hit (line 355) | public hit() {
method constructor (line 437) | constructor() {
method hit (line 440) | public hit() {
method constructor (line 592) | constructor(handler: KatanaHandler, blade: KatanaBlade) {
method hit (line 649) | public hit() {
method hit (line 684) | public hit() {
method use (line 745) | public use() {
method hit (line 894) | public hit() {
method hit (line 992) | public hit() {
method hit (line 1074) | public hit() {
method constructor (line 1170) | constructor() {
method hit (line 1215) | public hit() {
method hit (line 1274) | public hit() {
method hit (line 1416) | public hit() {
method hit (line 1492) | public hit() {
method constructor (line 1708) | constructor() {
method constructor (line 1744) | constructor() {
method constructor (line 1804) | constructor() {
class Shuriken (line 951) | @injectable()
method throw (line 46) | public throw() {
method throw (line 86) | public throw() {
method throw (line 148) | public throw() {
method throw (line 209) | public throw() {
method throw (line 253) | public throw() {
method throw (line 307) | public throw() {
method throw (line 362) | public throw() {
method constructor (line 449) | constructor() {
method throw (line 452) | public throw() {
method throw (line 691) | public throw() {
method use (line 752) | public use() {
method throw (line 999) | public throw() {
method throw (line 1081) | public throw() {
method constructor (line 1178) | constructor() {
method throw (line 1222) | public throw() {
method throw (line 1281) | public throw() {
method throw (line 1423) | public throw() {
method throw (line 1499) | public throw() {
method constructor (line 1716) | constructor() {
method constructor (line 1752) | constructor() {
type Warrior (line 956) | interface Warrior {
class Ninja (line 961) | @injectable()
method constructor (line 56) | constructor(
method fight (line 64) | public fight() {
method sneak (line 67) | public sneak() {
method Shuriken (line 104) | public set Shuriken(shuriken: Shuriken) {
method sneak (line 108) | public sneak() {
method fight (line 111) | public fight() {
method constructor (line 158) | constructor(katana: Katana, shuriken: Shuriken) {
method blowgun (line 163) | public set blowgun(blowgun: Blowgun) {
method fight (line 167) | public fight() {
method sneak (line 170) | public sneak() {
method poisonDart (line 173) | public poisonDart() {
method constructor (line 219) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 224) | public fight() {
method sneak (line 227) | public sneak() {
method constructor (line 270) | constructor(
method fight (line 278) | public fight() {
method sneak (line 281) | public sneak() {
method constructor (line 324) | constructor(
method fight (line 333) | public fight() {
method sneak (line 336) | public sneak() {
method constructor (line 372) | constructor(
method fight (line 380) | public fight() {
method sneak (line 383) | public sneak() {
method constructor (line 463) | constructor(
method fight (line 471) | public fight() {
method sneak (line 474) | public sneak() {
method constructor (line 610) | constructor(
method constructor (line 658) | constructor(@inject('Newable<Katana>') katana: Newable<Katana>) {
method fight (line 662) | public fight() {
method constructor (line 965) | constructor(@multiInject(weaponId) weapons: Weapon[]) {
method constructor (line 1009) | constructor(
method fight (line 1017) | public fight() {
method sneak (line 1020) | public sneak() {
method constructor (line 1091) | constructor(
method fight (line 1099) | public fight() {
method sneak (line 1102) | public sneak() {
method constructor (line 1188) | constructor(@multiInject(Weapon) weapons: Weapon[]) {
method constructor (line 1232) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1237) | public fight() {
method sneak (line 1240) | public sneak() {
method constructor (line 1291) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1296) | public fight() {
method sneak (line 1299) | public sneak() {
method constructor (line 1381) | constructor(@multiInject(TYPES.Weapon) weapons: Weapon[]) {
method constructor (line 1433) | constructor(
method fight (line 1441) | public fight() {
method sneak (line 1444) | public sneak() {
method constructor (line 1509) | constructor(
method fight (line 1517) | public fight() {
method sneak (line 1520) | public sneak() {
method constructor (line 1600) | constructor(
method constructor (line 1644) | constructor(
method constructor (line 1681) | constructor(
class Katana (line 990) | @injectable()
method hit (line 39) | public hit() {
method hit (line 92) | public hit() {
method hit (line 142) | public hit() {
method hit (line 202) | public hit() {
method hit (line 246) | public hit() {
method hit (line 300) | public hit() {
method hit (line 355) | public hit() {
method constructor (line 437) | constructor() {
method hit (line 440) | public hit() {
method constructor (line 592) | constructor(handler: KatanaHandler, blade: KatanaBlade) {
method hit (line 649) | public hit() {
method hit (line 684) | public hit() {
method use (line 745) | public use() {
method hit (line 894) | public hit() {
method hit (line 992) | public hit() {
method hit (line 1074) | public hit() {
method constructor (line 1170) | constructor() {
method hit (line 1215) | public hit() {
method hit (line 1274) | public hit() {
method hit (line 1416) | public hit() {
method hit (line 1492) | public hit() {
method constructor (line 1708) | constructor() {
method constructor (line 1744) | constructor() {
method constructor (line 1804) | constructor() {
class Shuriken (line 997) | @injectable()
method throw (line 46) | public throw() {
method throw (line 86) | public throw() {
method throw (line 148) | public throw() {
method throw (line 209) | public throw() {
method throw (line 253) | public throw() {
method throw (line 307) | public throw() {
method throw (line 362) | public throw() {
method constructor (line 449) | constructor() {
method throw (line 452) | public throw() {
method throw (line 691) | public throw() {
method use (line 752) | public use() {
method throw (line 999) | public throw() {
method throw (line 1081) | public throw() {
method constructor (line 1178) | constructor() {
method throw (line 1222) | public throw() {
method throw (line 1281) | public throw() {
method throw (line 1423) | public throw() {
method throw (line 1499) | public throw() {
method constructor (line 1716) | constructor() {
method constructor (line 1752) | constructor() {
class Ninja (line 1004) | @injectable()
method constructor (line 56) | constructor(
method fight (line 64) | public fight() {
method sneak (line 67) | public sneak() {
method Shuriken (line 104) | public set Shuriken(shuriken: Shuriken) {
method sneak (line 108) | public sneak() {
method fight (line 111) | public fight() {
method constructor (line 158) | constructor(katana: Katana, shuriken: Shuriken) {
method blowgun (line 163) | public set blowgun(blowgun: Blowgun) {
method fight (line 167) | public fight() {
method sneak (line 170) | public sneak() {
method poisonDart (line 173) | public poisonDart() {
method constructor (line 219) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 224) | public fight() {
method sneak (line 227) | public sneak() {
method constructor (line 270) | constructor(
method fight (line 278) | public fight() {
method sneak (line 281) | public sneak() {
method constructor (line 324) | constructor(
method fight (line 333) | public fight() {
method sneak (line 336) | public sneak() {
method constructor (line 372) | constructor(
method fight (line 380) | public fight() {
method sneak (line 383) | public sneak() {
method constructor (line 463) | constructor(
method fight (line 471) | public fight() {
method sneak (line 474) | public sneak() {
method constructor (line 610) | constructor(
method constructor (line 658) | constructor(@inject('Newable<Katana>') katana: Newable<Katana>) {
method fight (line 662) | public fight() {
method constructor (line 965) | constructor(@multiInject(weaponId) weapons: Weapon[]) {
method constructor (line 1009) | constructor(
method fight (line 1017) | public fight() {
method sneak (line 1020) | public sneak() {
method constructor (line 1091) | constructor(
method fight (line 1099) | public fight() {
method sneak (line 1102) | public sneak() {
method constructor (line 1188) | constructor(@multiInject(Weapon) weapons: Weapon[]) {
method constructor (line 1232) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1237) | public fight() {
method sneak (line 1240) | public sneak() {
method constructor (line 1291) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1296) | public fight() {
method sneak (line 1299) | public sneak() {
method constructor (line 1381) | constructor(@multiInject(TYPES.Weapon) weapons: Weapon[]) {
method constructor (line 1433) | constructor(
method fight (line 1441) | public fight() {
method sneak (line 1444) | public sneak() {
method constructor (line 1509) | constructor(
method fight (line 1517) | public fight() {
method sneak (line 1520) | public sneak() {
method constructor (line 1600) | constructor(
method constructor (line 1644) | constructor(
method constructor (line 1681) | constructor(
type School (line 1025) | interface School {
class NinjaSchool (line 1030) | @injectable()
method constructor (line 1035) | constructor(@multiInject('Ninja') ninja: Ninja[]) {
method constructor (line 1117) | constructor(@multiInject(warriorId) ninjas: Ninja[]) {
method constructor (line 1250) | constructor(@multiInject(Ninja) ninja: Ninja[]) {
method constructor (line 1309) | constructor(@multiInject(Ninja) ninjas: Ninja[]) {
method constructor (line 1459) | constructor(@multiInject(TYPES.Ninja) ninja: Ninja[]) {
method constructor (line 1535) | constructor(@multiInject(TYPES.Ninja) ninjas: Ninja[]) {
type Warrior (line 1063) | interface Warrior {
type Sword (line 1068) | interface Sword {
method constructor (line 1874) | constructor(@inject('Material') material: Material) {
method constructor (line 1969) | constructor(@inject('Material') material: Material) {
method constructor (line 2067) | constructor(@inject('Material') material: Material) {
method constructor (line 2220) | constructor(@inject('Material') material: Material) {
method constructor (line 2334) | constructor(@inject('Material') material: Material) {
method constructor (line 2469) | constructor(@inject('Material') material: Material) {
class Katana (line 1072) | @injectable()
method hit (line 39) | public hit() {
method hit (line 92) | public hit() {
method hit (line 142) | public hit() {
method hit (line 202) | public hit() {
method hit (line 246) | public hit() {
method hit (line 300) | public hit() {
method hit (line 355) | public hit() {
method constructor (line 437) | constructor() {
method hit (line 440) | public hit() {
method constructor (line 592) | constructor(handler: KatanaHandler, blade: KatanaBlade) {
method hit (line 649) | public hit() {
method hit (line 684) | public hit() {
method use (line 745) | public use() {
method hit (line 894) | public hit() {
method hit (line 992) | public hit() {
method hit (line 1074) | public hit() {
method constructor (line 1170) | constructor() {
method hit (line 1215) | public hit() {
method hit (line 1274) | public hit() {
method hit (line 1416) | public hit() {
method hit (line 1492) | public hit() {
method constructor (line 1708) | constructor() {
method constructor (line 1744) | constructor() {
method constructor (line 1804) | constructor() {
class Shuriken (line 1079) | @injectable()
method throw (line 46) | public throw() {
method throw (line 86) | public throw() {
method throw (line 148) | public throw() {
method throw (line 209) | public throw() {
method throw (line 253) | public throw() {
method throw (line 307) | public throw() {
method throw (line 362) | public throw() {
method constructor (line 449) | constructor() {
method throw (line 452) | public throw() {
method throw (line 691) | public throw() {
method use (line 752) | public use() {
method throw (line 999) | public throw() {
method throw (line 1081) | public throw() {
method constructor (line 1178) | constructor() {
method throw (line 1222) | public throw() {
method throw (line 1281) | public throw() {
method throw (line 1423) | public throw() {
method throw (line 1499) | public throw() {
method constructor (line 1716) | constructor() {
method constructor (line 1752) | constructor() {
class Ninja (line 1086) | @injectable()
method constructor (line 56) | constructor(
method fight (line 64) | public fight() {
method sneak (line 67) | public sneak() {
method Shuriken (line 104) | public set Shuriken(shuriken: Shuriken) {
method sneak (line 108) | public sneak() {
method fight (line 111) | public fight() {
method constructor (line 158) | constructor(katana: Katana, shuriken: Shuriken) {
method blowgun (line 163) | public set blowgun(blowgun: Blowgun) {
method fight (line 167) | public fight() {
method sneak (line 170) | public sneak() {
method poisonDart (line 173) | public poisonDart() {
method constructor (line 219) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 224) | public fight() {
method sneak (line 227) | public sneak() {
method constructor (line 270) | constructor(
method fight (line 278) | public fight() {
method sneak (line 281) | public sneak() {
method constructor (line 324) | constructor(
method fight (line 333) | public fight() {
method sneak (line 336) | public sneak() {
method constructor (line 372) | constructor(
method fight (line 380) | public fight() {
method sneak (line 383) | public sneak() {
method constructor (line 463) | constructor(
method fight (line 471) | public fight() {
method sneak (line 474) | public sneak() {
method constructor (line 610) | constructor(
method constructor (line 658) | constructor(@inject('Newable<Katana>') katana: Newable<Katana>) {
method fight (line 662) | public fight() {
method constructor (line 965) | constructor(@multiInject(weaponId) weapons: Weapon[]) {
method constructor (line 1009) | constructor(
method fight (line 1017) | public fight() {
method sneak (line 1020) | public sneak() {
method constructor (line 1091) | constructor(
method fight (line 1099) | public fight() {
method sneak (line 1102) | public sneak() {
method constructor (line 1188) | constructor(@multiInject(Weapon) weapons: Weapon[]) {
method constructor (line 1232) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1237) | public fight() {
method sneak (line 1240) | public sneak() {
method constructor (line 1291) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1296) | public fight() {
method sneak (line 1299) | public sneak() {
method constructor (line 1381) | constructor(@multiInject(TYPES.Weapon) weapons: Weapon[]) {
method constructor (line 1433) | constructor(
method fight (line 1441) | public fight() {
method sneak (line 1444) | public sneak() {
method constructor (line 1509) | constructor(
method fight (line 1517) | public fight() {
method sneak (line 1520) | public sneak() {
method constructor (line 1600) | constructor(
method constructor (line 1644) | constructor(
method constructor (line 1681) | constructor(
type School (line 1107) | interface School {
class NinjaSchool (line 1112) | @injectable()
method constructor (line 1035) | constructor(@multiInject('Ninja') ninja: Ninja[]) {
method constructor (line 1117) | constructor(@multiInject(warriorId) ninjas: Ninja[]) {
method constructor (line 1250) | constructor(@multiInject(Ninja) ninja: Ninja[]) {
method constructor (line 1309) | constructor(@multiInject(Ninja) ninjas: Ninja[]) {
method constructor (line 1459) | constructor(@multiInject(TYPES.Ninja) ninja: Ninja[]) {
method constructor (line 1535) | constructor(@multiInject(TYPES.Ninja) ninjas: Ninja[]) {
type Organisation (line 1123) | interface Organisation {
class NinjaOrganisation (line 1127) | @injectable()
method constructor (line 1131) | constructor(@multiInject(schoolId) schools: School[]) {
method constructor (line 1319) | constructor(@multiInject(NinjaSchool) schools: NinjaSchool[]) {
method constructor (line 1549) | constructor(@multiInject(TYPES.School) schools: School[]) {
class Weapon (line 1163) | @injectable()
class Katana (line 1168) | @injectable()
method hit (line 39) | public hit() {
method hit (line 92) | public hit() {
method hit (line 142) | public hit() {
method hit (line 202) | public hit() {
method hit (line 246) | public hit() {
method hit (line 300) | public hit() {
method hit (line 355) | public hit() {
method constructor (line 437) | constructor() {
method hit (line 440) | public hit() {
method constructor (line 592) | constructor(handler: KatanaHandler, blade: KatanaBlade) {
method hit (line 649) | public hit() {
method hit (line 684) | public hit() {
method use (line 745) | public use() {
method hit (line 894) | public hit() {
method hit (line 992) | public hit() {
method hit (line 1074) | public hit() {
method constructor (line 1170) | constructor() {
method hit (line 1215) | public hit() {
method hit (line 1274) | public hit() {
method hit (line 1416) | public hit() {
method hit (line 1492) | public hit() {
method constructor (line 1708) | constructor() {
method constructor (line 1744) | constructor() {
method constructor (line 1804) | constructor() {
class Shuriken (line 1176) | @injectable()
method throw (line 46) | public throw() {
method throw (line 86) | public throw() {
method throw (line 148) | public throw() {
method throw (line 209) | public throw() {
method throw (line 253) | public throw() {
method throw (line 307) | public throw() {
method throw (line 362) | public throw() {
method constructor (line 449) | constructor() {
method throw (line 452) | public throw() {
method throw (line 691) | public throw() {
method use (line 752) | public use() {
method throw (line 999) | public throw() {
method throw (line 1081) | public throw() {
method constructor (line 1178) | constructor() {
method throw (line 1222) | public throw() {
method throw (line 1281) | public throw() {
method throw (line 1423) | public throw() {
method throw (line 1499) | public throw() {
method constructor (line 1716) | constructor() {
method constructor (line 1752) | constructor() {
class Ninja (line 1184) | @injectable()
method constructor (line 56) | constructor(
method fight (line 64) | public fight() {
method sneak (line 67) | public sneak() {
method Shuriken (line 104) | public set Shuriken(shuriken: Shuriken) {
method sneak (line 108) | public sneak() {
method fight (line 111) | public fight() {
method constructor (line 158) | constructor(katana: Katana, shuriken: Shuriken) {
method blowgun (line 163) | public set blowgun(blowgun: Blowgun) {
method fight (line 167) | public fight() {
method sneak (line 170) | public sneak() {
method poisonDart (line 173) | public poisonDart() {
method constructor (line 219) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 224) | public fight() {
method sneak (line 227) | public sneak() {
method constructor (line 270) | constructor(
method fight (line 278) | public fight() {
method sneak (line 281) | public sneak() {
method constructor (line 324) | constructor(
method fight (line 333) | public fight() {
method sneak (line 336) | public sneak() {
method constructor (line 372) | constructor(
method fight (line 380) | public fight() {
method sneak (line 383) | public sneak() {
method constructor (line 463) | constructor(
method fight (line 471) | public fight() {
method sneak (line 474) | public sneak() {
method constructor (line 610) | constructor(
method constructor (line 658) | constructor(@inject('Newable<Katana>') katana: Newable<Katana>) {
method fight (line 662) | public fight() {
method constructor (line 965) | constructor(@multiInject(weaponId) weapons: Weapon[]) {
method constructor (line 1009) | constructor(
method fight (line 1017) | public fight() {
method sneak (line 1020) | public sneak() {
method constructor (line 1091) | constructor(
method fight (line 1099) | public fight() {
method sneak (line 1102) | public sneak() {
method constructor (line 1188) | constructor(@multiInject(Weapon) weapons: Weapon[]) {
method constructor (line 1232) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1237) | public fight() {
method sneak (line 1240) | public sneak() {
method constructor (line 1291) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1296) | public fight() {
method sneak (line 1299) | public sneak() {
method constructor (line 1381) | constructor(@multiInject(TYPES.Weapon) weapons: Weapon[]) {
method constructor (line 1433) | constructor(
method fight (line 1441) | public fight() {
method sneak (line 1444) | public sneak() {
method constructor (line 1509) | constructor(
method fight (line 1517) | public fight() {
method sneak (line 1520) | public sneak() {
method constructor (line 1600) | constructor(
method constructor (line 1644) | constructor(
method constructor (line 1681) | constructor(
class Katana (line 1213) | @injectable()
method hit (line 39) | public hit() {
method hit (line 92) | public hit() {
method hit (line 142) | public hit() {
method hit (line 202) | public hit() {
method hit (line 246) | public hit() {
method hit (line 300) | public hit() {
method hit (line 355) | public hit() {
method constructor (line 437) | constructor() {
method hit (line 440) | public hit() {
method constructor (line 592) | constructor(handler: KatanaHandler, blade: KatanaBlade) {
method hit (line 649) | public hit() {
method hit (line 684) | public hit() {
method use (line 745) | public use() {
method hit (line 894) | public hit() {
method hit (line 992) | public hit() {
method hit (line 1074) | public hit() {
method constructor (line 1170) | constructor() {
method hit (line 1215) | public hit() {
method hit (line 1274) | public hit() {
method hit (line 1416) | public hit() {
method hit (line 1492) | public hit() {
method constructor (line 1708) | constructor() {
method constructor (line 1744) | constructor() {
method constructor (line 1804) | constructor() {
class Shuriken (line 1220) | @injectable()
method throw (line 46) | public throw() {
method throw (line 86) | public throw() {
method throw (line 148) | public throw() {
method throw (line 209) | public throw() {
method throw (line 253) | public throw() {
method throw (line 307) | public throw() {
method throw (line 362) | public throw() {
method constructor (line 449) | constructor() {
method throw (line 452) | public throw() {
method throw (line 691) | public throw() {
method use (line 752) | public use() {
method throw (line 999) | public throw() {
method throw (line 1081) | public throw() {
method constructor (line 1178) | constructor() {
method throw (line 1222) | public throw() {
method throw (line 1281) | public throw() {
method throw (line 1423) | public throw() {
method throw (line 1499) | public throw() {
method constructor (line 1716) | constructor() {
method constructor (line 1752) | constructor() {
class Ninja (line 1227) | @injectable()
method constructor (line 56) | constructor(
method fight (line 64) | public fight() {
method sneak (line 67) | public sneak() {
method Shuriken (line 104) | public set Shuriken(shuriken: Shuriken) {
method sneak (line 108) | public sneak() {
method fight (line 111) | public fight() {
method constructor (line 158) | constructor(katana: Katana, shuriken: Shuriken) {
method blowgun (line 163) | public set blowgun(blowgun: Blowgun) {
method fight (line 167) | public fight() {
method sneak (line 170) | public sneak() {
method poisonDart (line 173) | public poisonDart() {
method constructor (line 219) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 224) | public fight() {
method sneak (line 227) | public sneak() {
method constructor (line 270) | constructor(
method fight (line 278) | public fight() {
method sneak (line 281) | public sneak() {
method constructor (line 324) | constructor(
method fight (line 333) | public fight() {
method sneak (line 336) | public sneak() {
method constructor (line 372) | constructor(
method fight (line 380) | public fight() {
method sneak (line 383) | public sneak() {
method constructor (line 463) | constructor(
method fight (line 471) | public fight() {
method sneak (line 474) | public sneak() {
method constructor (line 610) | constructor(
method constructor (line 658) | constructor(@inject('Newable<Katana>') katana: Newable<Katana>) {
method fight (line 662) | public fight() {
method constructor (line 965) | constructor(@multiInject(weaponId) weapons: Weapon[]) {
method constructor (line 1009) | constructor(
method fight (line 1017) | public fight() {
method sneak (line 1020) | public sneak() {
method constructor (line 1091) | constructor(
method fight (line 1099) | public fight() {
method sneak (line 1102) | public sneak() {
method constructor (line 1188) | constructor(@multiInject(Weapon) weapons: Weapon[]) {
method constructor (line 1232) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1237) | public fight() {
method sneak (line 1240) | public sneak() {
method constructor (line 1291) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1296) | public fight() {
method sneak (line 1299) | public sneak() {
method constructor (line 1381) | constructor(@multiInject(TYPES.Weapon) weapons: Weapon[]) {
method constructor (line 1433) | constructor(
method fight (line 1441) | public fight() {
method sneak (line 1444) | public sneak() {
method constructor (line 1509) | constructor(
method fight (line 1517) | public fight() {
method sneak (line 1520) | public sneak() {
method constructor (line 1600) | constructor(
method constructor (line 1644) | constructor(
method constructor (line 1681) | constructor(
class NinjaSchool (line 1245) | @injectable()
method constructor (line 1035) | constructor(@multiInject('Ninja') ninja: Ninja[]) {
method constructor (line 1117) | constructor(@multiInject(warriorId) ninjas: Ninja[]) {
method constructor (line 1250) | constructor(@multiInject(Ninja) ninja: Ninja[]) {
method constructor (line 1309) | constructor(@multiInject(Ninja) ninjas: Ninja[]) {
method constructor (line 1459) | constructor(@multiInject(TYPES.Ninja) ninja: Ninja[]) {
method constructor (line 1535) | constructor(@multiInject(TYPES.Ninja) ninjas: Ninja[]) {
class Katana (line 1272) | @injectable()
method hit (line 39) | public hit() {
method hit (line 92) | public hit() {
method hit (line 142) | public hit() {
method hit (line 202) | public hit() {
method hit (line 246) | public hit() {
method hit (line 300) | public hit() {
method hit (line 355) | public hit() {
method constructor (line 437) | constructor() {
method hit (line 440) | public hit() {
method constructor (line 592) | constructor(handler: KatanaHandler, blade: KatanaBlade) {
method hit (line 649) | public hit() {
method hit (line 684) | public hit() {
method use (line 745) | public use() {
method hit (line 894) | public hit() {
method hit (line 992) | public hit() {
method hit (line 1074) | public hit() {
method constructor (line 1170) | constructor() {
method hit (line 1215) | public hit() {
method hit (line 1274) | public hit() {
method hit (line 1416) | public hit() {
method hit (line 1492) | public hit() {
method constructor (line 1708) | constructor() {
method constructor (line 1744) | constructor() {
method constructor (line 1804) | constructor() {
class Shuriken (line 1279) | @injectable()
method throw (line 46) | public throw() {
method throw (line 86) | public throw() {
method throw (line 148) | public throw() {
method throw (line 209) | public throw() {
method throw (line 253) | public throw() {
method throw (line 307) | public throw() {
method throw (line 362) | public throw() {
method constructor (line 449) | constructor() {
method throw (line 452) | public throw() {
method throw (line 691) | public throw() {
method use (line 752) | public use() {
method throw (line 999) | public throw() {
method throw (line 1081) | public throw() {
method constructor (line 1178) | constructor() {
method throw (line 1222) | public throw() {
method throw (line 1281) | public throw() {
method throw (line 1423) | public throw() {
method throw (line 1499) | public throw() {
method constructor (line 1716) | constructor() {
method constructor (line 1752) | constructor() {
class Ninja (line 1286) | @injectable()
method constructor (line 56) | constructor(
method fight (line 64) | public fight() {
method sneak (line 67) | public sneak() {
method Shuriken (line 104) | public set Shuriken(shuriken: Shuriken) {
method sneak (line 108) | public sneak() {
method fight (line 111) | public fight() {
method constructor (line 158) | constructor(katana: Katana, shuriken: Shuriken) {
method blowgun (line 163) | public set blowgun(blowgun: Blowgun) {
method fight (line 167) | public fight() {
method sneak (line 170) | public sneak() {
method poisonDart (line 173) | public poisonDart() {
method constructor (line 219) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 224) | public fight() {
method sneak (line 227) | public sneak() {
method constructor (line 270) | constructor(
method fight (line 278) | public fight() {
method sneak (line 281) | public sneak() {
method constructor (line 324) | constructor(
method fight (line 333) | public fight() {
method sneak (line 336) | public sneak() {
method constructor (line 372) | constructor(
method fight (line 380) | public fight() {
method sneak (line 383) | public sneak() {
method constructor (line 463) | constructor(
method fight (line 471) | public fight() {
method sneak (line 474) | public sneak() {
method constructor (line 610) | constructor(
method constructor (line 658) | constructor(@inject('Newable<Katana>') katana: Newable<Katana>) {
method fight (line 662) | public fight() {
method constructor (line 965) | constructor(@multiInject(weaponId) weapons: Weapon[]) {
method constructor (line 1009) | constructor(
method fight (line 1017) | public fight() {
method sneak (line 1020) | public sneak() {
method constructor (line 1091) | constructor(
method fight (line 1099) | public fight() {
method sneak (line 1102) | public sneak() {
method constructor (line 1188) | constructor(@multiInject(Weapon) weapons: Weapon[]) {
method constructor (line 1232) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1237) | public fight() {
method sneak (line 1240) | public sneak() {
method constructor (line 1291) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1296) | public fight() {
method sneak (line 1299) | public sneak() {
method constructor (line 1381) | constructor(@multiInject(TYPES.Weapon) weapons: Weapon[]) {
method constructor (line 1433) | constructor(
method fight (line 1441) | public fight() {
method sneak (line 1444) | public sneak() {
method constructor (line 1509) | constructor(
method fight (line 1517) | public fight() {
method sneak (line 1520) | public sneak() {
method constructor (line 1600) | constructor(
method constructor (line 1644) | constructor(
method constructor (line 1681) | constructor(
class NinjaSchool (line 1304) | @injectable()
method constructor (line 1035) | constructor(@multiInject('Ninja') ninja: Ninja[]) {
method constructor (line 1117) | constructor(@multiInject(warriorId) ninjas: Ninja[]) {
method constructor (line 1250) | constructor(@multiInject(Ninja) ninja: Ninja[]) {
method constructor (line 1309) | constructor(@multiInject(Ninja) ninjas: Ninja[]) {
method constructor (line 1459) | constructor(@multiInject(TYPES.Ninja) ninja: Ninja[]) {
method constructor (line 1535) | constructor(@multiInject(TYPES.Ninja) ninjas: Ninja[]) {
class NinjaOrganisation (line 1315) | @injectable()
method constructor (line 1131) | constructor(@multiInject(schoolId) schools: School[]) {
method constructor (line 1319) | constructor(@multiInject(NinjaSchool) schools: NinjaSchool[]) {
method constructor (line 1549) | constructor(@multiInject(TYPES.School) schools: School[]) {
type Weapon (line 1358) | interface Weapon {
class Katana (line 1362) | @injectable()
method hit (line 39) | public hit() {
method hit (line 92) | public hit() {
method hit (line 142) | public hit() {
method hit (line 202) | public hit() {
method hit (line 246) | public hit() {
method hit (line 300) | public hit() {
method hit (line 355) | public hit() {
method constructor (line 437) | constructor() {
method hit (line 440) | public hit() {
method constructor (line 592) | constructor(handler: KatanaHandler, blade: KatanaBlade) {
method hit (line 649) | public hit() {
method hit (line 684) | public hit() {
method use (line 745) | public use() {
method hit (line 894) | public hit() {
method hit (line 992) | public hit() {
method hit (line 1074) | public hit() {
method constructor (line 1170) | constructor() {
method hit (line 1215) | public hit() {
method hit (line 1274) | public hit() {
method hit (line 1416) | public hit() {
method hit (line 1492) | public hit() {
method constructor (line 1708) | constructor() {
method constructor (line 1744) | constructor() {
method constructor (line 1804) | constructor() {
class Shuriken (line 1367) | @injectable()
method throw (line 46) | public throw() {
method throw (line 86) | public throw() {
method throw (line 148) | public throw() {
method throw (line 209) | public throw() {
method throw (line 253) | public throw() {
method throw (line 307) | public throw() {
method throw (line 362) | public throw() {
method constructor (line 449) | constructor() {
method throw (line 452) | public throw() {
method throw (line 691) | public throw() {
method use (line 752) | public use() {
method throw (line 999) | public throw() {
method throw (line 1081) | public throw() {
method constructor (line 1178) | constructor() {
method throw (line 1222) | public throw() {
method throw (line 1281) | public throw() {
method throw (line 1423) | public throw() {
method throw (line 1499) | public throw() {
method constructor (line 1716) | constructor() {
method constructor (line 1752) | constructor() {
type Warrior (line 1372) | interface Warrior {
class Ninja (line 1377) | @injectable()
method constructor (line 56) | constructor(
method fight (line 64) | public fight() {
method sneak (line 67) | public sneak() {
method Shuriken (line 104) | public set Shuriken(shuriken: Shuriken) {
method sneak (line 108) | public sneak() {
method fight (line 111) | public fight() {
method constructor (line 158) | constructor(katana: Katana, shuriken: Shuriken) {
method blowgun (line 163) | public set blowgun(blowgun: Blowgun) {
method fight (line 167) | public fight() {
method sneak (line 170) | public sneak() {
method poisonDart (line 173) | public poisonDart() {
method constructor (line 219) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 224) | public fight() {
method sneak (line 227) | public sneak() {
method constructor (line 270) | constructor(
method fight (line 278) | public fight() {
method sneak (line 281) | public sneak() {
method constructor (line 324) | constructor(
method fight (line 333) | public fight() {
method sneak (line 336) | public sneak() {
method constructor (line 372) | constructor(
method fight (line 380) | public fight() {
method sneak (line 383) | public sneak() {
method constructor (line 463) | constructor(
method fight (line 471) | public fight() {
method sneak (line 474) | public sneak() {
method constructor (line 610) | constructor(
method constructor (line 658) | constructor(@inject('Newable<Katana>') katana: Newable<Katana>) {
method fight (line 662) | public fight() {
method constructor (line 965) | constructor(@multiInject(weaponId) weapons: Weapon[]) {
method constructor (line 1009) | constructor(
method fight (line 1017) | public fight() {
method sneak (line 1020) | public sneak() {
method constructor (line 1091) | constructor(
method fight (line 1099) | public fight() {
method sneak (line 1102) | public sneak() {
method constructor (line 1188) | constructor(@multiInject(Weapon) weapons: Weapon[]) {
method constructor (line 1232) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1237) | public fight() {
method sneak (line 1240) | public sneak() {
method constructor (line 1291) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1296) | public fight() {
method sneak (line 1299) | public sneak() {
method constructor (line 1381) | constructor(@multiInject(TYPES.Weapon) weapons: Weapon[]) {
method constructor (line 1433) | constructor(
method fight (line 1441) | public fight() {
method sneak (line 1444) | public sneak() {
method constructor (line 1509) | constructor(
method fight (line 1517) | public fight() {
method sneak (line 1520) | public sneak() {
method constructor (line 1600) | constructor(
method constructor (line 1644) | constructor(
method constructor (line 1681) | constructor(
class Katana (line 1414) | @injectable()
method hit (line 39) | public hit() {
method hit (line 92) | public hit() {
method hit (line 142) | public hit() {
method hit (line 202) | public hit() {
method hit (line 246) | public hit() {
method hit (line 300) | public hit() {
method hit (line 355) | public hit() {
method constructor (line 437) | constructor() {
method hit (line 440) | public hit() {
method constructor (line 592) | constructor(handler: KatanaHandler, blade: KatanaBlade) {
method hit (line 649) | public hit() {
method hit (line 684) | public hit() {
method use (line 745) | public use() {
method hit (line 894) | public hit() {
method hit (line 992) | public hit() {
method hit (line 1074) | public hit() {
method constructor (line 1170) | constructor() {
method hit (line 1215) | public hit() {
method hit (line 1274) | public hit() {
method hit (line 1416) | public hit() {
method hit (line 1492) | public hit() {
method constructor (line 1708) | constructor() {
method constructor (line 1744) | constructor() {
method constructor (line 1804) | constructor() {
class Shuriken (line 1421) | @injectable()
method throw (line 46) | public throw() {
method throw (line 86) | public throw() {
method throw (line 148) | public throw() {
method throw (line 209) | public throw() {
method throw (line 253) | public throw() {
method throw (line 307) | public throw() {
method throw (line 362) | public throw() {
method constructor (line 449) | constructor() {
method throw (line 452) | public throw() {
method throw (line 691) | public throw() {
method use (line 752) | public use() {
method throw (line 999) | public throw() {
method throw (line 1081) | public throw() {
method constructor (line 1178) | constructor() {
method throw (line 1222) | public throw() {
method throw (line 1281) | public throw() {
method throw (line 1423) | public throw() {
method throw (line 1499) | public throw() {
method constructor (line 1716) | constructor() {
method constructor (line 1752) | constructor() {
class Ninja (line 1428) | @injectable()
method constructor (line 56) | constructor(
method fight (line 64) | public fight() {
method sneak (line 67) | public sneak() {
method Shuriken (line 104) | public set Shuriken(shuriken: Shuriken) {
method sneak (line 108) | public sneak() {
method fight (line 111) | public fight() {
method constructor (line 158) | constructor(katana: Katana, shuriken: Shuriken) {
method blowgun (line 163) | public set blowgun(blowgun: Blowgun) {
method fight (line 167) | public fight() {
method sneak (line 170) | public sneak() {
method poisonDart (line 173) | public poisonDart() {
method constructor (line 219) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 224) | public fight() {
method sneak (line 227) | public sneak() {
method constructor (line 270) | constructor(
method fight (line 278) | public fight() {
method sneak (line 281) | public sneak() {
method constructor (line 324) | constructor(
method fight (line 333) | public fight() {
method sneak (line 336) | public sneak() {
method constructor (line 372) | constructor(
method fight (line 380) | public fight() {
method sneak (line 383) | public sneak() {
method constructor (line 463) | constructor(
method fight (line 471) | public fight() {
method sneak (line 474) | public sneak() {
method constructor (line 610) | constructor(
method constructor (line 658) | constructor(@inject('Newable<Katana>') katana: Newable<Katana>) {
method fight (line 662) | public fight() {
method constructor (line 965) | constructor(@multiInject(weaponId) weapons: Weapon[]) {
method constructor (line 1009) | constructor(
method fight (line 1017) | public fight() {
method sneak (line 1020) | public sneak() {
method constructor (line 1091) | constructor(
method fight (line 1099) | public fight() {
method sneak (line 1102) | public sneak() {
method constructor (line 1188) | constructor(@multiInject(Weapon) weapons: Weapon[]) {
method constructor (line 1232) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1237) | public fight() {
method sneak (line 1240) | public sneak() {
method constructor (line 1291) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1296) | public fight() {
method sneak (line 1299) | public sneak() {
method constructor (line 1381) | constructor(@multiInject(TYPES.Weapon) weapons: Weapon[]) {
method constructor (line 1433) | constructor(
method fight (line 1441) | public fight() {
method sneak (line 1444) | public sneak() {
method constructor (line 1509) | constructor(
method fight (line 1517) | public fight() {
method sneak (line 1520) | public sneak() {
method constructor (line 1600) | constructor(
method constructor (line 1644) | constructor(
method constructor (line 1681) | constructor(
type School (line 1449) | interface School {
class NinjaSchool (line 1454) | @injectable()
method constructor (line 1035) | constructor(@multiInject('Ninja') ninja: Ninja[]) {
method constructor (line 1117) | constructor(@multiInject(warriorId) ninjas: Ninja[]) {
method constructor (line 1250) | constructor(@multiInject(Ninja) ninja: Ninja[]) {
method constructor (line 1309) | constructor(@multiInject(Ninja) ninjas: Ninja[]) {
method constructor (line 1459) | constructor(@multiInject(TYPES.Ninja) ninja: Ninja[]) {
method constructor (line 1535) | constructor(@multiInject(TYPES.Ninja) ninjas: Ninja[]) {
class Katana (line 1490) | @injectable()
method hit (line 39) | public hit() {
method hit (line 92) | public hit() {
method hit (line 142) | public hit() {
method hit (line 202) | public hit() {
method hit (line 246) | public hit() {
method hit (line 300) | public hit() {
method hit (line 355) | public hit() {
method constructor (line 437) | constructor() {
method hit (line 440) | public hit() {
method constructor (line 592) | constructor(handler: KatanaHandler, blade: KatanaBlade) {
method hit (line 649) | public hit() {
method hit (line 684) | public hit() {
method use (line 745) | public use() {
method hit (line 894) | public hit() {
method hit (line 992) | public hit() {
method hit (line 1074) | public hit() {
method constructor (line 1170) | constructor() {
method hit (line 1215) | public hit() {
method hit (line 1274) | public hit() {
method hit (line 1416) | public hit() {
method hit (line 1492) | public hit() {
method constructor (line 1708) | constructor() {
method constructor (line 1744) | constructor() {
method constructor (line 1804) | constructor() {
class Shuriken (line 1497) | @injectable()
method throw (line 46) | public throw() {
method throw (line 86) | public throw() {
method throw (line 148) | public throw() {
method throw (line 209) | public throw() {
method throw (line 253) | public throw() {
method throw (line 307) | public throw() {
method throw (line 362) | public throw() {
method constructor (line 449) | constructor() {
method throw (line 452) | public throw() {
method throw (line 691) | public throw() {
method use (line 752) | public use() {
method throw (line 999) | public throw() {
method throw (line 1081) | public throw() {
method constructor (line 1178) | constructor() {
method throw (line 1222) | public throw() {
method throw (line 1281) | public throw() {
method throw (line 1423) | public throw() {
method throw (line 1499) | public throw() {
method constructor (line 1716) | constructor() {
method constructor (line 1752) | constructor() {
class Ninja (line 1504) | @injectable()
method constructor (line 56) | constructor(
method fight (line 64) | public fight() {
method sneak (line 67) | public sneak() {
method Shuriken (line 104) | public set Shuriken(shuriken: Shuriken) {
method sneak (line 108) | public sneak() {
method fight (line 111) | public fight() {
method constructor (line 158) | constructor(katana: Katana, shuriken: Shuriken) {
method blowgun (line 163) | public set blowgun(blowgun: Blowgun) {
method fight (line 167) | public fight() {
method sneak (line 170) | public sneak() {
method poisonDart (line 173) | public poisonDart() {
method constructor (line 219) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 224) | public fight() {
method sneak (line 227) | public sneak() {
method constructor (line 270) | constructor(
method fight (line 278) | public fight() {
method sneak (line 281) | public sneak() {
method constructor (line 324) | constructor(
method fight (line 333) | public fight() {
method sneak (line 336) | public sneak() {
method constructor (line 372) | constructor(
method fight (line 380) | public fight() {
method sneak (line 383) | public sneak() {
method constructor (line 463) | constructor(
method fight (line 471) | public fight() {
method sneak (line 474) | public sneak() {
method constructor (line 610) | constructor(
method constructor (line 658) | constructor(@inject('Newable<Katana>') katana: Newable<Katana>) {
method fight (line 662) | public fight() {
method constructor (line 965) | constructor(@multiInject(weaponId) weapons: Weapon[]) {
method constructor (line 1009) | constructor(
method fight (line 1017) | public fight() {
method sneak (line 1020) | public sneak() {
method constructor (line 1091) | constructor(
method fight (line 1099) | public fight() {
method sneak (line 1102) | public sneak() {
method constructor (line 1188) | constructor(@multiInject(Weapon) weapons: Weapon[]) {
method constructor (line 1232) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1237) | public fight() {
method sneak (line 1240) | public sneak() {
method constructor (line 1291) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1296) | public fight() {
method sneak (line 1299) | public sneak() {
method constructor (line 1381) | constructor(@multiInject(TYPES.Weapon) weapons: Weapon[]) {
method constructor (line 1433) | constructor(
method fight (line 1441) | public fight() {
method sneak (line 1444) | public sneak() {
method constructor (line 1509) | constructor(
method fight (line 1517) | public fight() {
method sneak (line 1520) | public sneak() {
method constructor (line 1600) | constructor(
method constructor (line 1644) | constructor(
method constructor (line 1681) | constructor(
type School (line 1525) | interface School {
class NinjaSchool (line 1530) | @injectable()
method constructor (line 1035) | constructor(@multiInject('Ninja') ninja: Ninja[]) {
method constructor (line 1117) | constructor(@multiInject(warriorId) ninjas: Ninja[]) {
method constructor (line 1250) | constructor(@multiInject(Ninja) ninja: Ninja[]) {
method constructor (line 1309) | constructor(@multiInject(Ninja) ninjas: Ninja[]) {
method constructor (line 1459) | constructor(@multiInject(TYPES.Ninja) ninja: Ninja[]) {
method constructor (line 1535) | constructor(@multiInject(TYPES.Ninja) ninjas: Ninja[]) {
type Organisation (line 1541) | interface Organisation {
class NinjaOrganisation (line 1545) | @injectable()
method constructor (line 1131) | constructor(@multiInject(schoolId) schools: School[]) {
method constructor (line 1319) | constructor(@multiInject(NinjaSchool) schools: NinjaSchool[]) {
method constructor (line 1549) | constructor(@multiInject(TYPES.School) schools: School[]) {
type Tag (line 1581) | enum Tag {
class Katana (line 1585) | @injectable()
method hit (line 39) | public hit() {
method hit (line 92) | public hit() {
method hit (line 142) | public hit() {
method hit (line 202) | public hit() {
method hit (line 246) | public hit() {
method hit (line 300) | public hit() {
method hit (line 355) | public hit() {
method constructor (line 437) | constructor() {
method hit (line 440) | public hit() {
method constructor (line 592) | constructor(handler: KatanaHandler, blade: KatanaBlade) {
method hit (line 649) | public hit() {
method hit (line 684) | public hit() {
method use (line 745) | public use() {
method hit (line 894) | public hit() {
method hit (line 992) | public hit() {
method hit (line 1074) | public hit() {
method constructor (line 1170) | constructor() {
method hit (line 1215) | public hit() {
method hit (line 1274) | public hit() {
method hit (line 1416) | public hit() {
method hit (line 1492) | public hit() {
method constructor (line 1708) | constructor() {
method constructor (line 1744) | constructor() {
method constructor (line 1804) | constructor() {
class Shuriken (line 1588) | @injectable()
method throw (line 46) | public throw() {
method throw (line 86) | public throw() {
method throw (line 148) | public throw() {
method throw (line 209) | public throw() {
method throw (line 253) | public throw() {
method throw (line 307) | public throw() {
method throw (line 362) | public throw() {
method constructor (line 449) | constructor() {
method throw (line 452) | public throw() {
method throw (line 691) | public throw() {
method use (line 752) | public use() {
method throw (line 999) | public throw() {
method throw (line 1081) | public throw() {
method constructor (line 1178) | constructor() {
method throw (line 1222) | public throw() {
method throw (line 1281) | public throw() {
method throw (line 1423) | public throw() {
method throw (line 1499) | public throw() {
method constructor (line 1716) | constructor() {
method constructor (line 1752) | constructor() {
type Warrior (line 1591) | interface Warrior {
class Ninja (line 1596) | @injectable()
method constructor (line 56) | constructor(
method fight (line 64) | public fight() {
method sneak (line 67) | public sneak() {
method Shuriken (line 104) | public set Shuriken(shuriken: Shuriken) {
method sneak (line 108) | public sneak() {
method fight (line 111) | public fight() {
method constructor (line 158) | constructor(katana: Katana, shuriken: Shuriken) {
method blowgun (line 163) | public set blowgun(blowgun: Blowgun) {
method fight (line 167) | public fight() {
method sneak (line 170) | public sneak() {
method poisonDart (line 173) | public poisonDart() {
method constructor (line 219) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 224) | public fight() {
method sneak (line 227) | public sneak() {
method constructor (line 270) | constructor(
method fight (line 278) | public fight() {
method sneak (line 281) | public sneak() {
method constructor (line 324) | constructor(
method fight (line 333) | public fight() {
method sneak (line 336) | public sneak() {
method constructor (line 372) | constructor(
method fight (line 380) | public fight() {
method sneak (line 383) | public sneak() {
method constructor (line 463) | constructor(
method fight (line 471) | public fight() {
method sneak (line 474) | public sneak() {
method constructor (line 610) | constructor(
method constructor (line 658) | constructor(@inject('Newable<Katana>') katana: Newable<Katana>) {
method fight (line 662) | public fight() {
method constructor (line 965) | constructor(@multiInject(weaponId) weapons: Weapon[]) {
method constructor (line 1009) | constructor(
method fight (line 1017) | public fight() {
method sneak (line 1020) | public sneak() {
method constructor (line 1091) | constructor(
method fight (line 1099) | public fight() {
method sneak (line 1102) | public sneak() {
method constructor (line 1188) | constructor(@multiInject(Weapon) weapons: Weapon[]) {
method constructor (line 1232) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1237) | public fight() {
method sneak (line 1240) | public sneak() {
method constructor (line 1291) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1296) | public fight() {
method sneak (line 1299) | public sneak() {
method constructor (line 1381) | constructor(@multiInject(TYPES.Weapon) weapons: Weapon[]) {
method constructor (line 1433) | constructor(
method fight (line 1441) | public fight() {
method sneak (line 1444) | public sneak() {
method constructor (line 1509) | constructor(
method fight (line 1517) | public fight() {
method sneak (line 1520) | public sneak() {
method constructor (line 1600) | constructor(
method constructor (line 1644) | constructor(
method constructor (line 1681) | constructor(
class Katana (line 1620) | @injectable()
method hit (line 39) | public hit() {
method hit (line 92) | public hit() {
method hit (line 142) | public hit() {
method hit (line 202) | public hit() {
method hit (line 246) | public hit() {
method hit (line 300) | public hit() {
method hit (line 355) | public hit() {
method constructor (line 437) | constructor() {
method hit (line 440) | public hit() {
method constructor (line 592) | constructor(handler: KatanaHandler, blade: KatanaBlade) {
method hit (line 649) | public hit() {
method hit (line 684) | public hit() {
method use (line 745) | public use() {
method hit (line 894) | public hit() {
method hit (line 992) | public hit() {
method hit (line 1074) | public hit() {
method constructor (line 1170) | constructor() {
method hit (line 1215) | public hit() {
method hit (line 1274) | public hit() {
method hit (line 1416) | public hit() {
method hit (line 1492) | public hit() {
method constructor (line 1708) | constructor() {
method constructor (line 1744) | constructor() {
method constructor (line 1804) | constructor() {
class Shuriken (line 1623) | @injectable()
method throw (line 46) | public throw() {
method throw (line 86) | public throw() {
method throw (line 148) | public throw() {
method throw (line 209) | public throw() {
method throw (line 253) | public throw() {
method throw (line 307) | public throw() {
method throw (line 362) | public throw() {
method constructor (line 449) | constructor() {
method throw (line 452) | public throw() {
method throw (line 691) | public throw() {
method use (line 752) | public use() {
method throw (line 999) | public throw() {
method throw (line 1081) | public throw() {
method constructor (line 1178) | constructor() {
method throw (line 1222) | public throw() {
method throw (line 1281) | public throw() {
method throw (line 1423) | public throw() {
method throw (line 1499) | public throw() {
method constructor (line 1716) | constructor() {
method constructor (line 1752) | constructor() {
type Warrior (line 1626) | interface Warrior {
class Ninja (line 1640) | @injectable()
method constructor (line 56) | constructor(
method fight (line 64) | public fight() {
method sneak (line 67) | public sneak() {
method Shuriken (line 104) | public set Shuriken(shuriken: Shuriken) {
method sneak (line 108) | public sneak() {
method fight (line 111) | public fight() {
method constructor (line 158) | constructor(katana: Katana, shuriken: Shuriken) {
method blowgun (line 163) | public set blowgun(blowgun: Blowgun) {
method fight (line 167) | public fight() {
method sneak (line 170) | public sneak() {
method poisonDart (line 173) | public poisonDart() {
method constructor (line 219) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 224) | public fight() {
method sneak (line 227) | public sneak() {
method constructor (line 270) | constructor(
method fight (line 278) | public fight() {
method sneak (line 281) | public sneak() {
method constructor (line 324) | constructor(
method fight (line 333) | public fight() {
method sneak (line 336) | public sneak() {
method constructor (line 372) | constructor(
method fight (line 380) | public fight() {
method sneak (line 383) | public sneak() {
method constructor (line 463) | constructor(
method fight (line 471) | public fight() {
method sneak (line 474) | public sneak() {
method constructor (line 610) | constructor(
method constructor (line 658) | constructor(@inject('Newable<Katana>') katana: Newable<Katana>) {
method fight (line 662) | public fight() {
method constructor (line 965) | constructor(@multiInject(weaponId) weapons: Weapon[]) {
method constructor (line 1009) | constructor(
method fight (line 1017) | public fight() {
method sneak (line 1020) | public sneak() {
method constructor (line 1091) | constructor(
method fight (line 1099) | public fight() {
method sneak (line 1102) | public sneak() {
method constructor (line 1188) | constructor(@multiInject(Weapon) weapons: Weapon[]) {
method constructor (line 1232) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1237) | public fight() {
method sneak (line 1240) | public sneak() {
method constructor (line 1291) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1296) | public fight() {
method sneak (line 1299) | public sneak() {
method constructor (line 1381) | constructor(@multiInject(TYPES.Weapon) weapons: Weapon[]) {
method constructor (line 1433) | constructor(
method fight (line 1441) | public fight() {
method sneak (line 1444) | public sneak() {
method constructor (line 1509) | constructor(
method fight (line 1517) | public fight() {
method sneak (line 1520) | public sneak() {
method constructor (line 1600) | constructor(
method constructor (line 1644) | constructor(
method constructor (line 1681) | constructor(
class Katana (line 1666) | @injectable()
method hit (line 39) | public hit() {
method hit (line 92) | public hit() {
method hit (line 142) | public hit() {
method hit (line 202) | public hit() {
method hit (line 246) | public hit() {
method hit (line 300) | public hit() {
method hit (line 355) | public hit() {
method constructor (line 437) | constructor() {
method hit (line 440) | public hit() {
method constructor (line 592) | constructor(handler: KatanaHandler, blade: KatanaBlade) {
method hit (line 649) | public hit() {
method hit (line 684) | public hit() {
method use (line 745) | public use() {
method hit (line 894) | public hit() {
method hit (line 992) | public hit() {
method hit (line 1074) | public hit() {
method constructor (line 1170) | constructor() {
method hit (line 1215) | public hit() {
method hit (line 1274) | public hit() {
method hit (line 1416) | public hit() {
method hit (line 1492) | public hit() {
method constructor (line 1708) | constructor() {
method constructor (line 1744) | constructor() {
method constructor (line 1804) | constructor() {
class Shuriken (line 1669) | @injectable()
method throw (line 46) | public throw() {
method throw (line 86) | public throw() {
method throw (line 148) | public throw() {
method throw (line 209) | public throw() {
method throw (line 253) | public throw() {
method throw (line 307) | public throw() {
method throw (line 362) | public throw() {
method constructor (line 449) | constructor() {
method throw (line 452) | public throw() {
method throw (line 691) | public throw() {
method use (line 752) | public use() {
method throw (line 999) | public throw() {
method throw (line 1081) | public throw() {
method constructor (line 1178) | constructor() {
method throw (line 1222) | public throw() {
method throw (line 1281) | public throw() {
method throw (line 1423) | public throw() {
method throw (line 1499) | public throw() {
method constructor (line 1716) | constructor() {
method constructor (line 1752) | constructor() {
type Warrior (line 1672) | interface Warrior {
class Ninja (line 1677) | @injectable()
method constructor (line 56) | constructor(
method fight (line 64) | public fight() {
method sneak (line 67) | public sneak() {
method Shuriken (line 104) | public set Shuriken(shuriken: Shuriken) {
method sneak (line 108) | public sneak() {
method fight (line 111) | public fight() {
method constructor (line 158) | constructor(katana: Katana, shuriken: Shuriken) {
method blowgun (line 163) | public set blowgun(blowgun: Blowgun) {
method fight (line 167) | public fight() {
method sneak (line 170) | public sneak() {
method poisonDart (line 173) | public poisonDart() {
method constructor (line 219) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 224) | public fight() {
method sneak (line 227) | public sneak() {
method constructor (line 270) | constructor(
method fight (line 278) | public fight() {
method sneak (line 281) | public sneak() {
method constructor (line 324) | constructor(
method fight (line 333) | public fight() {
method sneak (line 336) | public sneak() {
method constructor (line 372) | constructor(
method fight (line 380) | public fight() {
method sneak (line 383) | public sneak() {
method constructor (line 463) | constructor(
method fight (line 471) | public fight() {
method sneak (line 474) | public sneak() {
method constructor (line 610) | constructor(
method constructor (line 658) | constructor(@inject('Newable<Katana>') katana: Newable<Katana>) {
method fight (line 662) | public fight() {
method constructor (line 965) | constructor(@multiInject(weaponId) weapons: Weapon[]) {
method constructor (line 1009) | constructor(
method fight (line 1017) | public fight() {
method sneak (line 1020) | public sneak() {
method constructor (line 1091) | constructor(
method fight (line 1099) | public fight() {
method sneak (line 1102) | public sneak() {
method constructor (line 1188) | constructor(@multiInject(Weapon) weapons: Weapon[]) {
method constructor (line 1232) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1237) | public fight() {
method sneak (line 1240) | public sneak() {
method constructor (line 1291) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1296) | public fight() {
method sneak (line 1299) | public sneak() {
method constructor (line 1381) | constructor(@multiInject(TYPES.Weapon) weapons: Weapon[]) {
method constructor (line 1433) | constructor(
method fight (line 1441) | public fight() {
method sneak (line 1444) | public sneak() {
method constructor (line 1509) | constructor(
method fight (line 1517) | public fight() {
method sneak (line 1520) | public sneak() {
method constructor (line 1600) | constructor(
method constructor (line 1644) | constructor(
method constructor (line 1681) | constructor(
type Weapon (line 1701) | interface Weapon {
class Katana (line 1705) | @injectable()
method hit (line 39) | public hit() {
method hit (line 92) | public hit() {
method hit (line 142) | public hit() {
method hit (line 202) | public hit() {
method hit (line 246) | public hit() {
method hit (line 300) | public hit() {
method hit (line 355) | public hit() {
method constructor (line 437) | constructor() {
method hit (line 440) | public hit() {
method constructor (line 592) | constructor(handler: KatanaHandler, blade: KatanaBlade) {
method hit (line 649) | public hit() {
method hit (line 684) | public hit() {
method use (line 745) | public use() {
method hit (line 894) | public hit() {
method hit (line 992) | public hit() {
method hit (line 1074) | public hit() {
method constructor (line 1170) | constructor() {
method hit (line 1215) | public hit() {
method hit (line 1274) | public hit() {
method hit (line 1416) | public hit() {
method hit (line 1492) | public hit() {
method constructor (line 1708) | constructor() {
method constructor (line 1744) | constructor() {
method constructor (line 1804) | constructor() {
class Shuriken (line 1713) | @injectable()
method throw (line 46) | public throw() {
method throw (line 86) | public throw() {
method throw (line 148) | public throw() {
method throw (line 209) | public throw() {
method throw (line 253) | public throw() {
method throw (line 307) | public throw() {
method throw (line 362) | public throw() {
method constructor (line 449) | constructor() {
method throw (line 452) | public throw() {
method throw (line 691) | public throw() {
method use (line 752) | public use() {
method throw (line 999) | public throw() {
method throw (line 1081) | public throw() {
method constructor (line 1178) | constructor() {
method throw (line 1222) | public throw() {
method throw (line 1281) | public throw() {
method throw (line 1423) | public throw() {
method throw (line 1499) | public throw() {
method constructor (line 1716) | constructor() {
method constructor (line 1752) | constructor() {
type Weapon (line 1737) | interface Weapon {
class Katana (line 1741) | @injectable()
method hit (line 39) | public hit() {
method hit (line 92) | public hit() {
method hit (line 142) | public hit() {
method hit (line 202) | public hit() {
method hit (line 246) | public hit() {
method hit (line 300) | public hit() {
method hit (line 355) | public hit() {
method constructor (line 437) | constructor() {
method hit (line 440) | public hit() {
method constructor (line 592) | constructor(handler: KatanaHandler, blade: KatanaBlade) {
method hit (line 649) | public hit() {
method hit (line 684) | public hit() {
method use (line 745) | public use() {
method hit (line 894) | public hit() {
method hit (line 992) | public hit() {
method hit (line 1074) | public hit() {
method constructor (line 1170) | constructor() {
method hit (line 1215) | public hit() {
method hit (line 1274) | public hit() {
method hit (line 1416) | public hit() {
method hit (line 1492) | public hit() {
method constructor (line 1708) | constructor() {
method constructor (line 1744) | constructor() {
method constructor (line 1804) | constructor() {
class Shuriken (line 1749) | @injectable()
method throw (line 46) | public throw() {
method throw (line 86) | public throw() {
method throw (line 148) | public throw() {
method throw (line 209) | public throw() {
method throw (line 253) | public throw() {
method throw (line 307) | public throw() {
method throw (line 362) | public throw() {
method constructor (line 449) | constructor() {
method throw (line 452) | public throw() {
method throw (line 691) | public throw() {
method use (line 752) | public use() {
method throw (line 999) | public throw() {
method throw (line 1081) | public throw() {
method constructor (line 1178) | constructor() {
method throw (line 1222) | public throw() {
method throw (line 1281) | public throw() {
method throw (line 1423) | public throw() {
method throw (line 1499) | public throw() {
method constructor (line 1716) | constructor() {
method constructor (line 1752) | constructor() {
type Weapon (line 1793) | interface Weapon {
type Warrior (line 1797) | interface Warrior {
class Katana (line 1801) | @injectable()
method hit (line 39) | public hit() {
method hit (line 92) | public hit() {
method hit (line 142) | public hit() {
method hit (line 202) | public hit() {
method hit (line 246) | public hit() {
method hit (line 300) | public hit() {
method hit (line 355) | public hit() {
method constructor (line 437) | constructor() {
method hit (line 440) | public hit() {
method constructor (line 592) | constructor(handler: KatanaHandler, blade: KatanaBlade) {
method hit (line 649) | public hit() {
method hit (line 684) | public hit() {
method use (line 745) | public use() {
method hit (line 894) | public hit() {
method hit (line 992) | public hit() {
method hit (line 1074) | public hit() {
method constructor (line 1170) | constructor() {
method hit (line 1215) | public hit() {
method hit (line 1274) | public hit() {
method hit (line 1416) | public hit() {
method hit (line 1492) | public hit() {
method constructor (line 1708) | constructor() {
method constructor (line 1744) | constructor() {
method constructor (line 1804) | constructor() {
class Samurai (line 1809) | @injectable()
method constructor (line 1813) | constructor(weapon: Weapon) {
method constructor (line 2603) | constructor(rank: string) {
method constructor (line 2639) | constructor(rank: string) {
class SamuraiMaster (line 1818) | @injectable()
method constructor (line 1821) | constructor(@inject(SYMBOLS.Weapon) weapon: Weapon) {
method constructor (line 2610) | constructor(@inject(SYMBOLS.RANK) rank: string) {
method constructor (line 2646) | constructor() {
type Material (line 1847) | interface Material {
class Wood (line 1851) | @injectable()
method constructor (line 1854) | constructor() {
method constructor (line 1949) | constructor() {
method constructor (line 2047) | constructor() {
method constructor (line 2200) | constructor() {
method constructor (line 2314) | constructor() {
method constructor (line 2449) | constructor() {
class Iron (line 1859) | @injectable()
method constructor (line 1862) | constructor() {
method constructor (line 1957) | constructor() {
method constructor (line 2055) | constructor() {
method constructor (line 2208) | constructor() {
method constructor (line 2322) | constructor() {
method constructor (line 2457) | constructor() {
type Weapon (line 1867) | interface Weapon {
class Sword (line 1871) | @injectable()
method constructor (line 1874) | constructor(@inject('Material') material: Material) {
method constructor (line 1969) | constructor(@inject('Material') material: Material) {
method constructor (line 2067) | constructor(@inject('Material') material: Material) {
method constructor (line 2220) | constructor(@inject('Material') material: Material) {
method constructor (line 2334) | constructor(@inject('Material') material: Material) {
method constructor (line 2469) | constructor(@inject('Material') material: Material) {
type Ninja (line 1879) | interface Ninja {
method constructor (line 56) | constructor(
method fight (line 64) | public fight() {
method sneak (line 67) | public sneak() {
method Shuriken (line 104) | public set Shuriken(shuriken: Shuriken) {
method sneak (line 108) | public sneak() {
method fight (line 111) | public fight() {
method constructor (line 158) | constructor(katana: Katana, shuriken: Shuriken) {
method blowgun (line 163) | public set blowgun(blowgun: Blowgun) {
method fight (line 167) | public fight() {
method sneak (line 170) | public sneak() {
method poisonDart (line 173) | public poisonDart() {
method constructor (line 219) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 224) | public fight() {
method sneak (line 227) | public sneak() {
method constructor (line 270) | constructor(
method fight (line 278) | public fight() {
method sneak (line 281) | public sneak() {
method constructor (line 324) | constructor(
method fight (line 333) | public fight() {
method sneak (line 336) | public sneak() {
method constructor (line 372) | constructor(
method fight (line 380) | public fight() {
method sneak (line 383) | public sneak() {
method constructor (line 463) | constructor(
method fight (line 471) | public fight() {
method sneak (line 474) | public sneak() {
method constructor (line 610) | constructor(
method constructor (line 658) | constructor(@inject('Newable<Katana>') katana: Newable<Katana>) {
method fight (line 662) | public fight() {
method constructor (line 965) | constructor(@multiInject(weaponId) weapons: Weapon[]) {
method constructor (line 1009) | constructor(
method fight (line 1017) | public fight() {
method sneak (line 1020) | public sneak() {
method constructor (line 1091) | constructor(
method fight (line 1099) | public fight() {
method sneak (line 1102) | public sneak() {
method constructor (line 1188) | constructor(@multiInject(Weapon) weapons: Weapon[]) {
method constructor (line 1232) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1237) | public fight() {
method sneak (line 1240) | public sneak() {
method constructor (line 1291) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1296) | public fight() {
method sneak (line 1299) | public sneak() {
method constructor (line 1381) | constructor(@multiInject(TYPES.Weapon) weapons: Weapon[]) {
method constructor (line 1433) | constructor(
method fight (line 1441) | public fight() {
method sneak (line 1444) | public sneak() {
method constructor (line 1509) | constructor(
method fight (line 1517) | public fight() {
method sneak (line 1520) | public sneak() {
method constructor (line 1600) | constructor(
method constructor (line 1644) | constructor(
method constructor (line 1681) | constructor(
class NinjaStudent (line 1883) | @injectable()
method constructor (line 1887) | constructor(@inject('Weapon') @named('non-lethal') weapon: Weapon) {
method constructor (line 1982) | constructor(@inject('Weapon') @tagged('lethal', false) weapon: Weapon) {
method constructor (line 2080) | constructor(@inject('Weapon') weapon: Weapon) {
method constructor (line 2233) | constructor(@inject('Weapon') weapon: Weapon) {
method constructor (line 2347) | constructor(@inject('Weapon') weapon: Weapon) {
method constructor (line 2482) | constructor(@inject('Weapon') weapon: Weapon) {
class NinjaMaster (line 1892) | @injectable()
method constructor (line 1896) | constructor(@inject('Weapon') @named('lethal') weapon: Weapon) {
method constructor (line 1991) | constructor(@inject('Weapon') @tagged('lethal', true) weapon: Weapon) {
method constructor (line 2089) | constructor(@inject('Weapon') weapon: Weapon) {
method constructor (line 2242) | constructor(@inject('Weapon') weapon: Weapon) {
method constructor (line 2356) | constructor(@inject('Weapon') weapon: Weapon) {
method constructor (line 2491) | constructor(@inject('Weapon') weapon: Weapon) {
type Material (line 1942) | interface Material {
class Wood (line 1946) | @injectable()
method constructor (line 1854) | constructor() {
method constructor (line 1949) | constructor() {
method constructor (line 2047) | constructor() {
method constructor (line 2200) | constructor() {
method constructor (line 2314) | constructor() {
method constructor (line 2449) | constructor() {
class Iron (line 1954) | @injectable()
method constructor (line 1862) | constructor() {
method constructor (line 1957) | constructor() {
method constructor (line 2055) | constructor() {
method constructor (line 2208) | constructor() {
method constructor (line 2322) | constructor() {
method constructor (line 2457) | constructor() {
type Weapon (line 1962) | interface Weapon {
class Sword (line 1966) | @injectable()
method constructor (line 1874) | constructor(@inject('Material') material: Material) {
method constructor (line 1969) | constructor(@inject('Material') material: Material) {
method constructor (line 2067) | constructor(@inject('Material') material: Material) {
method constructor (line 2220) | constructor(@inject('Material') material: Material) {
method constructor (line 2334) | constructor(@inject('Material') material: Material) {
method constructor (line 2469) | constructor(@inject('Material') material: Material) {
type Ninja (line 1974) | interface Ninja {
method constructor (line 56) | constructor(
method fight (line 64) | public fight() {
method sneak (line 67) | public sneak() {
method Shuriken (line 104) | public set Shuriken(shuriken: Shuriken) {
method sneak (line 108) | public sneak() {
method fight (line 111) | public fight() {
method constructor (line 158) | constructor(katana: Katana, shuriken: Shuriken) {
method blowgun (line 163) | public set blowgun(blowgun: Blowgun) {
method fight (line 167) | public fight() {
method sneak (line 170) | public sneak() {
method poisonDart (line 173) | public poisonDart() {
method constructor (line 219) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 224) | public fight() {
method sneak (line 227) | public sneak() {
method constructor (line 270) | constructor(
method fight (line 278) | public fight() {
method sneak (line 281) | public sneak() {
method constructor (line 324) | constructor(
method fight (line 333) | public fight() {
method sneak (line 336) | public sneak() {
method constructor (line 372) | constructor(
method fight (line 380) | public fight() {
method sneak (line 383) | public sneak() {
method constructor (line 463) | constructor(
method fight (line 471) | public fight() {
method sneak (line 474) | public sneak() {
method constructor (line 610) | constructor(
method constructor (line 658) | constructor(@inject('Newable<Katana>') katana: Newable<Katana>) {
method fight (line 662) | public fight() {
method constructor (line 965) | constructor(@multiInject(weaponId) weapons: Weapon[]) {
method constructor (line 1009) | constructor(
method fight (line 1017) | public fight() {
method sneak (line 1020) | public sneak() {
method constructor (line 1091) | constructor(
method fight (line 1099) | public fight() {
method sneak (line 1102) | public sneak() {
method constructor (line 1188) | constructor(@multiInject(Weapon) weapons: Weapon[]) {
method constructor (line 1232) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1237) | public fight() {
method sneak (line 1240) | public sneak() {
method constructor (line 1291) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1296) | public fight() {
method sneak (line 1299) | public sneak() {
method constructor (line 1381) | constructor(@multiInject(TYPES.Weapon) weapons: Weapon[]) {
method constructor (line 1433) | constructor(
method fight (line 1441) | public fight() {
method sneak (line 1444) | public sneak() {
method constructor (line 1509) | constructor(
method fight (line 1517) | public fight() {
method sneak (line 1520) | public sneak() {
method constructor (line 1600) | constructor(
method constructor (line 1644) | constructor(
method constructor (line 1681) | constructor(
class NinjaStudent (line 1978) | @injectable()
method constructor (line 1887) | constructor(@inject('Weapon') @named('non-lethal') weapon: Weapon) {
method constructor (line 1982) | constructor(@inject('Weapon') @tagged('lethal', false) weapon: Weapon) {
method constructor (line 2080) | constructor(@inject('Weapon') weapon: Weapon) {
method constructor (line 2233) | constructor(@inject('Weapon') weapon: Weapon) {
method constructor (line 2347) | constructor(@inject('Weapon') weapon: Weapon) {
method constructor (line 2482) | constructor(@inject('Weapon') weapon: Weapon) {
class NinjaMaster (line 1987) | @injectable()
method constructor (line 1896) | constructor(@inject('Weapon') @named('lethal') weapon: Weapon) {
method constructor (line 1991) | constructor(@inject('Weapon') @tagged('lethal', true) weapon: Weapon) {
method constructor (line 2089) | constructor(@inject('Weapon') weapon: Weapon) {
method constructor (line 2242) | constructor(@inject('Weapon') weapon: Weapon) {
method constructor (line 2356) | constructor(@inject('Weapon') weapon: Weapon) {
method constructor (line 2491) | constructor(@inject('Weapon') weapon: Weapon) {
type Material (line 2040) | interface Material {
class Wood (line 2044) | @injectable()
method constructor (line 1854) | constructor() {
method constructor (line 1949) | constructor() {
method constructor (line 2047) | constructor() {
method constructor (line 2200) | constructor() {
method constructor (line 2314) | constructor() {
method constructor (line 2449) | constructor() {
class Iron (line 2052) | @injectable()
method constructor (line 1862) | constructor() {
method constructor (line 1957) | constructor() {
method constructor (line 2055) | constructor() {
method constructor (line 2208) | constructor() {
method constructor (line 2322) | constructor() {
method constructor (line 2457) | constructor() {
type Weapon (line 2060) | interface Weapon {
class Sword (line 2064) | @injectable()
method constructor (line 1874) | constructor(@inject('Material') material: Material) {
method constructor (line 1969) | constructor(@inject('Material') material: Material) {
method constructor (line 2067) | constructor(@inject('Material') material: Material) {
method constructor (line 2220) | constructor(@inject('Material') material: Material) {
method constructor (line 2334) | constructor(@inject('Material') material: Material) {
method constructor (line 2469) | constructor(@inject('Material') material: Material) {
type Ninja (line 2072) | interface Ninja {
method constructor (line 56) | constructor(
method fight (line 64) | public fight() {
method sneak (line 67) | public sneak() {
method Shuriken (line 104) | public set Shuriken(shuriken: Shuriken) {
method sneak (line 108) | public sneak() {
method fight (line 111) | public fight() {
method constructor (line 158) | constructor(katana: Katana, shuriken: Shuriken) {
method blowgun (line 163) | public set blowgun(blowgun: Blowgun) {
method fight (line 167) | public fight() {
method sneak (line 170) | public sneak() {
method poisonDart (line 173) | public poisonDart() {
method constructor (line 219) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 224) | public fight() {
method sneak (line 227) | public sneak() {
method constructor (line 270) | constructor(
method fight (line 278) | public fight() {
method sneak (line 281) | public sneak() {
method constructor (line 324) | constructor(
method fight (line 333) | public fight() {
method sneak (line 336) | public sneak() {
method constructor (line 372) | constructor(
method fight (line 380) | public fight() {
method sneak (line 383) | public sneak() {
method constructor (line 463) | constructor(
method fight (line 471) | public fight() {
method sneak (line 474) | public sneak() {
method constructor (line 610) | constructor(
method constructor (line 658) | constructor(@inject('Newable<Katana>') katana: Newable<Katana>) {
method fight (line 662) | public fight() {
method constructor (line 965) | constructor(@multiInject(weaponId) weapons: Weapon[]) {
method constructor (line 1009) | constructor(
method fight (line 1017) | public fight() {
method sneak (line 1020) | public sneak() {
method constructor (line 1091) | constructor(
method fight (line 1099) | public fight() {
method sneak (line 1102) | public sneak() {
method constructor (line 1188) | constructor(@multiInject(Weapon) weapons: Weapon[]) {
method constructor (line 1232) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1237) | public fight() {
method sneak (line 1240) | public sneak() {
method constructor (line 1291) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1296) | public fight() {
method sneak (line 1299) | public sneak() {
method constructor (line 1381) | constructor(@multiInject(TYPES.Weapon) weapons: Weapon[]) {
method constructor (line 1433) | constructor(
method fight (line 1441) | public fight() {
method sneak (line 1444) | public sneak() {
method constructor (line 1509) | constructor(
method fight (line 1517) | public fight() {
method sneak (line 1520) | public sneak() {
method constructor (line 1600) | constructor(
method constructor (line 1644) | constructor(
method constructor (line 1681) | constructor(
class NinjaStudent (line 2076) | @injectable()
method constructor (line 1887) | constructor(@inject('Weapon') @named('non-lethal') weapon: Weapon) {
method constructor (line 1982) | constructor(@inject('Weapon') @tagged('lethal', false) weapon: Weapon) {
method constructor (line 2080) | constructor(@inject('Weapon') weapon: Weapon) {
method constructor (line 2233) | constructor(@inject('Weapon') weapon: Weapon) {
method constructor (line 2347) | constructor(@inject('Weapon') weapon: Weapon) {
method constructor (line 2482) | constructor(@inject('Weapon') weapon: Weapon) {
class NinjaMaster (line 2085) | @injectable()
method constructor (line 1896) | constructor(@inject('Weapon') @named('lethal') weapon: Weapon) {
method constructor (line 1991) | constructor(@inject('Weapon') @tagged('lethal', true) weapon: Weapon) {
method constructor (line 2089) | constructor(@inject('Weapon') weapon: Weapon) {
method constructor (line 2242) | constructor(@inject('Weapon') weapon: Weapon) {
method constructor (line 2356) | constructor(@inject('Weapon') weapon: Weapon) {
method constructor (line 2491) | constructor(@inject('Weapon') weapon: Weapon) {
function isNinjaStudentConstraint (line 2094) | function isNinjaStudentConstraint(
function isNinjaMasterConstraint (line 2103) | function isNinjaMasterConstraint(
type Material (line 2193) | interface Material {
class Wood (line 2197) | @injectable()
method constructor (line 1854) | constructor() {
method constructor (line 1949) | constructor() {
method constructor (line 2047) | constructor() {
method constructor (line 2200) | constructor() {
method constructor (line 2314) | constructor() {
method constructor (line 2449) | constructor() {
class Iron (line 2205) | @injectable()
method constructor (line 1862) | constructor() {
method constructor (line 1957) | constructor() {
method constructor (line 2055) | constructor() {
method constructor (line 2208) | constructor() {
method constructor (line 2322) | constructor() {
method constructor (line 2457) | constructor() {
type Weapon (line 2213) | interface Weapon {
class Sword (line 2217) | @injectable()
method constructor (line 1874) | constructor(@inject('Material') material: Material) {
method constructor (line 1969) | constructor(@inject('Material') material: Material) {
method constructor (line 2067) | constructor(@inject('Material') material: Material) {
method constructor (line 2220) | constructor(@inject('Material') material: Material) {
method constructor (line 2334) | constructor(@inject('Material') material: Material) {
method constructor (line 2469) | constructor(@inject('Material') material: Material) {
type Ninja (line 2225) | interface Ninja {
method constructor (line 56) | constructor(
method fight (line 64) | public fight() {
method sneak (line 67) | public sneak() {
method Shuriken (line 104) | public set Shuriken(shuriken: Shuriken) {
method sneak (line 108) | public sneak() {
method fight (line 111) | public fight() {
method constructor (line 158) | constructor(katana: Katana, shuriken: Shuriken) {
method blowgun (line 163) | public set blowgun(blowgun: Blowgun) {
method fight (line 167) | public fight() {
method sneak (line 170) | public sneak() {
method poisonDart (line 173) | public poisonDart() {
method constructor (line 219) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 224) | public fight() {
method sneak (line 227) | public sneak() {
method constructor (line 270) | constructor(
method fight (line 278) | public fight() {
method sneak (line 281) | public sneak() {
method constructor (line 324) | constructor(
method fight (line 333) | public fight() {
method sneak (line 336) | public sneak() {
method constructor (line 372) | constructor(
method fight (line 380) | public fight() {
method sneak (line 383) | public sneak() {
method constructor (line 463) | constructor(
method fight (line 471) | public fight() {
method sneak (line 474) | public sneak() {
method constructor (line 610) | constructor(
method constructor (line 658) | constructor(@inject('Newable<Katana>') katana: Newable<Katana>) {
method fight (line 662) | public fight() {
method constructor (line 965) | constructor(@multiInject(weaponId) weapons: Weapon[]) {
method constructor (line 1009) | constructor(
method fight (line 1017) | public fight() {
method sneak (line 1020) | public sneak() {
method constructor (line 1091) | constructor(
method fight (line 1099) | public fight() {
method sneak (line 1102) | public sneak() {
method constructor (line 1188) | constructor(@multiInject(Weapon) weapons: Weapon[]) {
method constructor (line 1232) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1237) | public fight() {
method sneak (line 1240) | public sneak() {
method constructor (line 1291) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1296) | public fight() {
method sneak (line 1299) | public sneak() {
method constructor (line 1381) | constructor(@multiInject(TYPES.Weapon) weapons: Weapon[]) {
method constructor (line 1433) | constructor(
method fight (line 1441) | public fight() {
method sneak (line 1444) | public sneak() {
method constructor (line 1509) | constructor(
method fight (line 1517) | public fight() {
method sneak (line 1520) | public sneak() {
method constructor (line 1600) | constructor(
method constructor (line 1644) | constructor(
method constructor (line 1681) | constructor(
class NinjaStudent (line 2229) | @injectable()
method constructor (line 1887) | constructor(@inject('Weapon') @named('non-lethal') weapon: Weapon) {
method constructor (line 1982) | constructor(@inject('Weapon') @tagged('lethal', false) weapon: Weapon) {
method constructor (line 2080) | constructor(@inject('Weapon') weapon: Weapon) {
method constructor (line 2233) | constructor(@inject('Weapon') weapon: Weapon) {
method constructor (line 2347) | constructor(@inject('Weapon') weapon: Weapon) {
method constructor (line 2482) | constructor(@inject('Weapon') weapon: Weapon) {
class NinjaMaster (line 2238) | @injectable()
method constructor (line 1896) | constructor(@inject('Weapon') @named('lethal') weapon: Weapon) {
method constructor (line 1991) | constructor(@inject('Weapon') @tagged('lethal', true) weapon: Weapon) {
method constructor (line 2089) | constructor(@inject('Weapon') weapon: Weapon) {
method constructor (line 2242) | constructor(@inject('Weapon') weapon: Weapon) {
method constructor (line 2356) | constructor(@inject('Weapon') weapon: Weapon) {
method constructor (line 2491) | constructor(@inject('Weapon') weapon: Weapon) {
type Material (line 2307) | interface Material {
class Wood (line 2311) | @injectable()
method constructor (line 1854) | constructor() {
method constructor (line 1949) | constructor() {
method constructor (line 2047) | constructor() {
method constructor (line 2200) | constructor() {
method constructor (line 2314) | constructor() {
method constructor (line 2449) | constructor() {
class Iron (line 2319) | @injectable()
method constructor (line 1862) | constructor() {
method constructor (line 1957) | constructor() {
method constructor (line 2055) | constructor() {
method constructor (line 2208) | constructor() {
method constructor (line 2322) | constructor() {
method constructor (line 2457) | constructor() {
type Weapon (line 2327) | interface Weapon {
class Sword (line 2331) | @injectable()
method constructor (line 1874) | constructor(@inject('Material') material: Material) {
method constructor (line 1969) | constructor(@inject('Material') material: Material) {
method constructor (line 2067) | constructor(@inject('Material') material: Material) {
method constructor (line 2220) | constructor(@inject('Material') material: Material) {
method constructor (line 2334) | constructor(@inject('Material') material: Material) {
method constructor (line 2469) | constructor(@inject('Material') material: Material) {
type Ninja (line 2339) | interface Ninja {
method constructor (line 56) | constructor(
method fight (line 64) | public fight() {
method sneak (line 67) | public sneak() {
method Shuriken (line 104) | public set Shuriken(shuriken: Shuriken) {
method sneak (line 108) | public sneak() {
method fight (line 111) | public fight() {
method constructor (line 158) | constructor(katana: Katana, shuriken: Shuriken) {
method blowgun (line 163) | public set blowgun(blowgun: Blowgun) {
method fight (line 167) | public fight() {
method sneak (line 170) | public sneak() {
method poisonDart (line 173) | public poisonDart() {
method constructor (line 219) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 224) | public fight() {
method sneak (line 227) | public sneak() {
method constructor (line 270) | constructor(
method fight (line 278) | public fight() {
method sneak (line 281) | public sneak() {
method constructor (line 324) | constructor(
method fight (line 333) | public fight() {
method sneak (line 336) | public sneak() {
method constructor (line 372) | constructor(
method fight (line 380) | public fight() {
method sneak (line 383) | public sneak() {
method constructor (line 463) | constructor(
method fight (line 471) | public fight() {
method sneak (line 474) | public sneak() {
method constructor (line 610) | constructor(
method constructor (line 658) | constructor(@inject('Newable<Katana>') katana: Newable<Katana>) {
method fight (line 662) | public fight() {
method constructor (line 965) | constructor(@multiInject(weaponId) weapons: Weapon[]) {
method constructor (line 1009) | constructor(
method fight (line 1017) | public fight() {
method sneak (line 1020) | public sneak() {
method constructor (line 1091) | constructor(
method fight (line 1099) | public fight() {
method sneak (line 1102) | public sneak() {
method constructor (line 1188) | constructor(@multiInject(Weapon) weapons: Weapon[]) {
method constructor (line 1232) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1237) | public fight() {
method sneak (line 1240) | public sneak() {
method constructor (line 1291) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 1296) | public fight() {
method sneak (line 1299) | public sneak() {
method constructor (line 1381) | constructor(@multiInject(TYPES.Weapon) weapons: Weapon[]) {
method constructor (line 1433) | constructor(
method fight (line 1441) | public fight() {
method sneak (line 1444) | public sneak() {
method constructor (line 1509) | constructor(
method fight (line 1517) | public fight() {
method sneak (line 1520) | public sneak() {
method constructor (line 1600) | constructor(
method constructor (line 1644) | constructor(
method constructor (line 1681) | constructor(
class NinjaStudent (line 2343) | @injectable()
method constructor (line 1887) | constructor(@inject('Weapon') @named('non-lethal') weapon: Weapon) {
method constructor (line 1982) | constructor(@inject('Weapon') @tagged('lethal', false) weapon: Weapon) {
method constructor (line 2080) | constructor(@inject('Weapon') weapon: Weapon) {
method constructor (line 2233) | constructor(@inject('Weapon') weapon: Weapon) {
method constructor (line 2347) | constructor(@inject('Weapon') weapon: Weapon) {
method constructor (line 2482) | constructor(@inject('Weapon') weapon: Weapon) {
class NinjaMaster (line 2352) | @injectable()
method constructor (line 1896) | constructor(@inject('Weapon') @named('lethal') weapon: Weapon) {
method constructor (line 1991) | constructor(@inject('Weapon') @tagged('lethal', true) weapon: Weapon) {
method constructor (line 2089) | constructor(@inject('Weapon') weapon: Weapon) {
method constructor (line 2242) | constructor(@inject('Weapon') weapon: Weapon) {
method constructor (line 2356) | constructor(@inject('Weapon') weapon: Weapon) {
method constructor (line 2491) | constructor(@inject('Weapon') weapon: Weapon) {
type Material (line 2442) | interface Material {
class Wood (line 2446) | @injectable()
method constructor (line 1854) | constructor() {
method constructor (line 1949) | constructor() {
method constructor (line 2047) | constructor() {
method constructor (line 2200) | constructor() {
method constructor (line 2314) | constructor() {
method constructor (line 2449) | constructor() {
class Iron (line 2454) | @injectable()
method constructor (line 1862) | constructor() {
method constructor (line 1957) | constructor() {
method constructor (line 2055) | constructor() {
method constructor (line 2208) | constructor() {
method constructor (line 2322) | constructor() {
method constructor (line 2457) | constructor() {
type Weapon (line 2462) | interface Weapon {
class Sword (line 2466) | @injectable()
method constructor (line 1874) | constructor(@inject('Material') material: Material) {
method constructor (line 1969) | constructor(@inject('Material') material: Material) {
method constructor (line 2067) | constructor(@inject('Material') material: Material) {
method constructor (line 2220) | constructor(@inject('Material') material: Material) {
method constructor (line 2334) | constructor(@inject('Material') material: Material) {
method constructor (line 2469) | constructor(@inject('Material') material: Material) {
type Ninja (line 2474) | interface Ninja {
method constructor (line 56) | constructor(
method fight (line 64) | public fight() {
method sneak (line 67) | public sneak() {
method Shuriken (line 104) | public set Shuriken(shuriken: Shuriken) {
method sneak (line 108) | public sneak() {
method fight (line 111) | public fight() {
method constructor (line 158) | constructor(katana: Katana, shuriken: Shuriken) {
method blowgun (line 163) | public set blowgun(blowgun: Blowgun) {
method fight (line 167) | public fight() {
method sneak (line 170) | public sneak() {
method poisonDart (line 173) | public poisonDart() {
method constructor (line 219) | constructor(katana: Katana, shuriken: Shuriken) {
method fight (line 224) | public fight() {
method sneak (line 227) | public sneak() {
method constructor (line 270) | constructor(
method fight (line 278) | public fight() {
method sneak (line 281) | public sneak() {
method constructor (line 324) | constructor(
method fight (line 333) | public fight() {
method sneak (line 336) | public sneak() {
method constructor (line 372) | constructor(
method fight (line 380) | public fight() {
method sneak (line 383) | public sneak() {
method constructor (line 463) | constructor(
method fight (line 471) | public fight() {
method sneak (line 474) | public sneak() {
method constructor (line 610) | constructor(
method constructor (line 658) | constructor(@inject('Newable<Katana>') katana: Newable<Katana>) {
method fight (line 662) | public fight() {
method constructor (line 965) | constructor(@multi
Condensed preview — 57 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (252K chars).
[
{
"path": ".github/FUNDING.yml",
"chars": 47,
"preview": "github: inversify\nopen_collective: inversifyjs\n"
},
{
"path": ".github/ISSUE_TEMPLATE/bug_report.yml",
"chars": 637,
"preview": "name: \"\\U0001F41B Bug Report\"\ndescription: \"If something isn't working as expected \\U0001F914\"\nlabels: [\"needs triage\"]\n"
},
{
"path": ".github/ISSUE_TEMPLATE/config.yml",
"chars": 27,
"preview": "blank_issues_enabled: false"
},
{
"path": ".github/ISSUE_TEMPLATE/feature_request.yml",
"chars": 744,
"preview": "name: \"\\U0001F680 Community Ideas\"\ndescription: \"I have an idea or proposal \\U0001F4A1!\"\nlabels: [\"needs triage\"]\nassign"
},
{
"path": ".github/workflows/ci.yml",
"chars": 2931,
"preview": "name: Continuous Integration\n\non:\n push:\n branches:\n - master\n pull_request:\n\njobs:\n Testing:\n name: Compi"
},
{
"path": ".gitignore",
"chars": 652,
"preview": "# Logs\nlogs\n*.log\n\n# Runtime data\npids\n*.pid\n*.seed\n\n# Coverage directory used by tools like istanbul\ncoverage\n\n# Depend"
},
{
"path": ".npmignore",
"chars": 482,
"preview": ".github\n.gitignore\n.nyc_output\n.vscode\nbuild\nCODE_OF_CONDUCT.md\nCONTRIBUTING.md\ncoverage\neslint.config.mjs\nISSUE_TEMPLAT"
},
{
"path": "CHANGELOG.md",
"chars": 15427,
"preview": "# Changelog\nAll notable changes to this project from 5.0.0 forward will be documented in this file.\n\nThe format is based"
},
{
"path": "CODE_OF_CONDUCT.md",
"chars": 3225,
"preview": "# Contributor Covenant Code of Conduct\n\n## Our Pledge\n\nIn the interest of fostering an open and welcoming environment, w"
},
{
"path": "CONTRIBUTING.md",
"chars": 1041,
"preview": "# Contributing to Inversify\n\n## Setup\n\n1 Clone your fork of the repository\n\n```sh\ngit clone https://github.com/YOUR_USER"
},
{
"path": "ISSUE_TEMPLATE.md",
"chars": 1270,
"preview": "<!--- Provide a general summary of the issue in the Title above -->\n\n## Expected Behavior\n<!--- If you're describing a b"
},
{
"path": "LICENSE",
"chars": 1087,
"preview": "The MIT License (MIT)\n\nCopyright (c) 2015-2017 Remo H. Jansen\n\nPermission is hereby granted, free of charge, to any pers"
},
{
"path": "PULL_REQUEST_TEMPLATE.md",
"chars": 1716,
"preview": "<!--- Provide a general summary of your changes in the Title above -->\n\n## Description\n\n<!--- Describe your changes in d"
},
{
"path": "README.md",
"chars": 7895,
"preview": "> [!NOTE] \n> InversifyJS will be moving to the [monorepo](https://github.com/inversify/monorepo). Please, consider crea"
},
{
"path": "eslint.config.mjs",
"chars": 5187,
"preview": "// @ts-check\n\nimport eslint from '@eslint/js';\nimport tseslint from 'typescript-eslint';\nimport eslintPrettierConfig fro"
},
{
"path": "package.json",
"chars": 2756,
"preview": "{\n \"author\": \"Remo H. Jansen\",\n \"bugs\": {\n \"url\": \"https://github.com/inversify/InversifyJS/issues\"\n },\n \"descrip"
},
{
"path": "prettier.config.mjs",
"chars": 198,
"preview": "export default {\n printWidth: 80,\n tabWidth: 2,\n useTabs: false,\n semi: true,\n singleQuote: true,\n bracketSpacing:"
},
{
"path": "renovate.json",
"chars": 552,
"preview": "{\n \"$schema\": \"https://docs.renovatebot.com/renovate-schema.json\",\n \"automerge\": false,\n \"extends\": [\n \"config:rec"
},
{
"path": "rollup.config.mjs",
"chars": 1702,
"preview": "import fs from 'node:fs/promises';\n\nimport terser from '@rollup/plugin-terser';\nimport typescript from '@rollup/plugin-t"
},
{
"path": "scripts/writeCommonJsPackageJson.mjs",
"chars": 801,
"preview": "#!/usr/bin/env node\n\nimport fs from 'node:fs/promises';\nimport { argv } from 'node:process';\nimport path from 'node:path"
},
{
"path": "scripts/writeEsmPackageJson.mjs",
"chars": 799,
"preview": "#!/usr/bin/env node\n\nimport fs from 'node:fs/promises';\nimport { argv } from 'node:process';\nimport path from 'node:path"
},
{
"path": "src/index.ts",
"chars": 1383,
"preview": "import 'reflect-metadata';\n\nexport {\n Newable,\n LazyServiceIdentifier,\n ServiceIdentifier,\n} from '@inversifyjs/commo"
},
{
"path": "src/test/annotation/inject.test.ts",
"chars": 1457,
"preview": "import 'reflect-metadata';\n\nimport { LazyServiceIdentifier } from '@inversifyjs/common';\nimport { expect } from 'chai';\n"
},
{
"path": "src/test/annotation/injectable.test.ts",
"chars": 479,
"preview": "import 'reflect-metadata';\n\nimport { expect } from 'chai';\n\nimport { decorate, injectable } from '../..';\n\ndescribe('@in"
},
{
"path": "src/test/annotation/multi_inject.test.ts",
"chars": 1118,
"preview": "import 'reflect-metadata';\n\nimport { expect } from 'chai';\n\nimport { decorate, multiInject } from '../..';\n\ntype Weapon "
},
{
"path": "src/test/annotation/named.test.ts",
"chars": 1049,
"preview": "import 'reflect-metadata';\n\nimport { expect } from 'chai';\n\nimport { decorate, named } from '../..';\n\ntype Weapon = unkn"
},
{
"path": "src/test/annotation/optional.test.ts",
"chars": 3964,
"preview": "import 'reflect-metadata';\n\nimport { expect } from 'chai';\n\nimport { Container, inject, injectable, optional } from '../"
},
{
"path": "src/test/annotation/post_construct.test.ts",
"chars": 428,
"preview": "import 'reflect-metadata';\n\nimport { expect } from 'chai';\n\nimport { postConstruct } from '../..';\n\ndescribe('@postConst"
},
{
"path": "src/test/bugs/bugs.test.ts",
"chars": 15112,
"preview": "import 'reflect-metadata';\n\nimport { expect } from 'chai';\n\nimport {\n BindingConstraints,\n Container,\n decorate,\n in"
},
{
"path": "src/test/bugs/issue_1190.test.ts",
"chars": 1568,
"preview": "import 'reflect-metadata';\n\nimport { expect } from 'chai';\n\nimport { Container, inject, injectable, named, optional } fr"
},
{
"path": "src/test/bugs/issue_1297.test.ts",
"chars": 3160,
"preview": "import 'reflect-metadata';\n\nimport { expect } from 'chai';\nimport * as sinon from 'sinon';\n\nimport {\n Container,\n Fact"
},
{
"path": "src/test/bugs/issue_1416.test.ts",
"chars": 1084,
"preview": "import 'reflect-metadata';\n\nimport { describe, it } from 'mocha';\nimport sinon from 'sinon';\n\nimport { Container, inject"
},
{
"path": "src/test/bugs/issue_1515.test.ts",
"chars": 1242,
"preview": "import 'reflect-metadata';\n\nimport { expect } from 'chai';\n\nimport { Container, inject, injectable, multiInject } from '"
},
{
"path": "src/test/bugs/issue_1518.test.ts",
"chars": 485,
"preview": "import 'reflect-metadata';\n\nimport { expect } from 'chai';\n\nimport { Container } from '../..';\n\ndescribe('Issue 1518', ("
},
{
"path": "src/test/bugs/issue_1564.test.ts",
"chars": 1219,
"preview": "import 'reflect-metadata';\n\nimport { expect } from 'chai';\nimport { describe, it } from 'mocha';\n\nimport { Container, in"
},
{
"path": "src/test/bugs/issue_543.test.ts",
"chars": 2197,
"preview": "import 'reflect-metadata';\n\nimport { expect } from 'chai';\n\nimport { Container, inject, injectable } from '../../index';"
},
{
"path": "src/test/bugs/issue_549.test.ts",
"chars": 2041,
"preview": "import 'reflect-metadata';\n\nimport { Container, inject, injectable, ResolutionContext } from '../..';\n\ndescribe('Issue 5"
},
{
"path": "src/test/bugs/issue_706.test.ts",
"chars": 894,
"preview": "import 'reflect-metadata';\n\nimport { expect } from 'chai';\n\nimport { bindingScopeValues, Container, injectable } from '."
},
{
"path": "src/test/bugs/issue_928.test.ts",
"chars": 1363,
"preview": "import 'reflect-metadata';\n\nimport { expect } from 'chai';\n\nimport { Container, inject, injectable, Newable, optional } "
},
{
"path": "src/test/container/container.test.ts",
"chars": 27203,
"preview": "import 'reflect-metadata';\n\nimport { expect } from 'chai';\nimport * as sinon from 'sinon';\n\nimport {\n bindingScopeValue"
},
{
"path": "src/test/container/container_module.test.ts",
"chars": 13967,
"preview": "import 'reflect-metadata';\n\nimport { expect } from 'chai';\nimport * as sinon from 'sinon';\n\nimport {\n Container,\n Cont"
},
{
"path": "src/test/features/named_default.test.ts",
"chars": 3438,
"preview": "import 'reflect-metadata';\n\nimport { expect } from 'chai';\n\nimport { Container, inject, injectable, named } from '../..'"
},
{
"path": "src/test/features/property_injection.test.ts",
"chars": 11165,
"preview": "import 'reflect-metadata';\n\nimport { expect } from 'chai';\n\nimport {\n Container,\n inject,\n injectable,\n injectFromBa"
},
{
"path": "src/test/features/provider.test.ts",
"chars": 5691,
"preview": "import 'reflect-metadata';\n\nimport { expect } from 'chai';\n\nimport { Container, injectable, Provider, ResolutionContext "
},
{
"path": "src/test/features/request_scope.test.ts",
"chars": 6072,
"preview": "import 'reflect-metadata';\n\nimport { expect } from 'chai';\nimport { performance } from 'perf_hooks';\n\nimport { Container"
},
{
"path": "src/test/features/transitive_bindings.test.ts",
"chars": 1669,
"preview": "import 'reflect-metadata';\n\nimport { expect } from 'chai';\n\nimport { Container, injectable } from '../..';\n\ndescribe('Tr"
},
{
"path": "src/test/inversify.test.ts",
"chars": 69319,
"preview": "import 'reflect-metadata';\n\nimport { expect } from 'chai';\n\nimport {\n BindingConstraints,\n Container,\n ContainerModul"
},
{
"path": "src/test/node/error_messages.test.ts",
"chars": 3694,
"preview": "import 'reflect-metadata';\n\nimport { expect } from 'chai';\n\nimport { Container, injectable } from '../..';\n\ndescribe('Er"
},
{
"path": "src/test/node/exceptions.test.ts",
"chars": 1038,
"preview": "import 'reflect-metadata';\n\nimport { expect } from 'chai';\n\nimport { Container, inject, injectable } from '../..';\n\ndesc"
},
{
"path": "src/test/node/performance.test.ts",
"chars": 3815,
"preview": "import 'reflect-metadata';\n\nimport { expect } from 'chai';\nimport { performance } from 'perf_hooks';\n\nimport { Container"
},
{
"path": "src/test/node/proxies.test.ts",
"chars": 1711,
"preview": "import 'reflect-metadata';\n\nimport { expect } from 'chai';\n\nimport { Container, inject, injectable, ResolutionContext } "
},
{
"path": "tsconfig.base.cjs.json",
"chars": 182,
"preview": "{\n \"$schema\": \"http://json.schemastore.org/tsconfig\",\n \"extends\": \"./tsconfig.base.json\",\n \"compilerOptions\": {\n \""
},
{
"path": "tsconfig.base.esm.json",
"chars": 211,
"preview": "{\n \"$schema\": \"http://json.schemastore.org/tsconfig\",\n \"extends\": \"./tsconfig.base.json\",\n \"compilerOptions\": {\n \""
},
{
"path": "tsconfig.base.json",
"chars": 658,
"preview": "{\n \"$schema\": \"http://json.schemastore.org/tsconfig\",\n \"compilerOptions\": {\n \"declaration\": true,\n \"declarationM"
},
{
"path": "tsconfig.cjs.json",
"chars": 248,
"preview": "{\n \"$schema\": \"http://json.schemastore.org/tsconfig\",\n \"extends\": \"./tsconfig.base.cjs.json\",\n \"compilerOptions\": {\n "
},
{
"path": "tsconfig.esm.json",
"chars": 248,
"preview": "{\n \"$schema\": \"http://json.schemastore.org/tsconfig\",\n \"extends\": \"./tsconfig.base.esm.json\",\n \"compilerOptions\": {\n "
},
{
"path": "tsconfig.json",
"chars": 92,
"preview": "{\n \"$schema\": \"http://json.schemastore.org/tsconfig\",\n \"extends\": \"./tsconfig.cjs.json\"\n}\n"
}
]
About this extraction
This page contains the full source code of the inversify/InversifyJS GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 57 files (234.2 KB), approximately 59.8k tokens, and a symbol index with 676 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.