# @types/ember__service

> TypeScript definitions for @ember/service

Latest version **4.0.9** (published 2024-01-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/ember__service
pnpm add @types/ember__service
yarn add @types/ember__service
bun add @types/ember__service
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 4.0.9 |
| Published | 2024-01-16 |
| First published | 2018-09-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51435 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/ember__service
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/ember__service
- npm.io page: https://npm.io/package/@types/ember__service

## Dependencies (1)

- [@types/ember__object](https://npm.io/package/@types/ember__object.md) *

## Recent versions

- 4.0.9 (latest) — 2024-01-16
- 4.0.8 (ts4.5) — 2023-11-21
- 4.0.3 (ts4.4) — 2023-06-13
- 3.16.1 (ts3.7) — 2020-09-26
- 3.0.6 (ts2.8) — 2020-03-28
- 3.16.9 — 2024-01-16
- 3.16.8 — 2023-11-21
- 3.16.7 — 2023-11-07
- 4.0.7 — 2023-11-07
- 3.16.6 — 2023-10-18
- 4.0.6 — 2023-10-18
- 3.16.5 — 2023-09-23
- 4.0.5 — 2023-09-23
- 3.16.4 — 2023-09-22
- 4.0.4 — 2023-09-22
- … 12 more at https://npm.io/package/@types/ember__service/versions

## README

# Installation
> `npm install --save @types/ember__service`

# Summary
This package contains type definitions for @ember/service (https://emberjs.com/api/ember/4.0/modules/@ember%2Fservice).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/ember__service.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/ember__service/index.d.ts)
````ts
import EmberObject from "@ember/object";
import ComputedProperty from "@ember/object/computed";

export default class Service extends EmberObject {}
/**
 * Creates a property that lazily looks up a service in the container. There
 * are no restrictions as to what objects a service can be injected into.
 */
export function inject(): ComputedProperty<Service>; // @inject() foo, foo: inject()
export function inject(target: object, propertyKey: string | symbol): void; // @inject foo
export function inject<K extends keyof Registry>(name: K): ComputedProperty<Registry[K]>; // @inject('store') foo      @inject() foo

/**
 * Creates a property that lazily looks up a service in the container. There
 * are no restrictions as to what objects a service can be injected into.
 */
export function service(): ComputedProperty<Service>; // @service() foo, foo: service()
export function service(target: object, propertyKey: string | symbol): void; // @service foo
export function service<K extends keyof Registry>(name: K): ComputedProperty<Registry[K]>; // @service('store') foo      @service() foo

// A type registry for Ember `Service`s. Meant to be declaration-merged so
// string lookups resolve to the correct type.
/* eslint-disable @definitelytyped/strict-export-declare-modifiers */
// eslint-disable-next-line @typescript-eslint/no-empty-interface
interface Registry extends Record<string, Service> {}

declare module "@ember/owner" {
    interface DIRegistry {
        service: Registry;
    }
}

````

### Additional Details
 * Last updated: Tue, 16 Jan 2024 17:36:15 GMT
 * Dependencies: [@types/ember__object](https://npmjs.com/package/@types/ember__object)

# Credits
These definitions were written by [Krystan HuffMenne](https://github.com/gitKrystan), [James C. Davis](https://github.com/jamescdavis), and [Peter Wagenet](https://github.com/wagenet).

---
_Source: https://npm.io/package/@types/ember__service · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
