
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
@types/ember__controller
Advanced tools
TypeScript definitions for @ember/controller
npm install --save @types/ember__controller
This package contains type definitions for @ember/controller (https://emberjs.com/api/ember/4.0/modules/@ember%2Fcontroller).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/ember__controller.
import EmberObject from "@ember/object";
import ActionHandler from "@ember/object/-private/action-handler";
import ComputedProperty from "@ember/object/computed";
import Mixin from "@ember/object/mixin";
// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers
type QueryParamTypes = "boolean" | "number" | "array" | "string";
// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers
type QueryParamScopeTypes = "controller" | "model";
// eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers
interface QueryParamConfig {
type?: QueryParamTypes | undefined;
scope?: QueryParamScopeTypes | undefined;
as?: string | undefined;
}
/**
* Additional methods for the Controller.
*/
interface ControllerMixin extends ActionHandler {
/**
* @deprecated until 5.0. Use `RouterService.reaplceWith` instead.
*/
replaceRoute(name: string, ...args: any[]): void;
/**
* @deprecated until 5.0. Use `RouterService.transitionTo` instead.
*/
transitionToRoute(name: string, ...args: any[]): void;
/**
* @deprecated until 5.0. Use `RouterService.transitionTo` instead.
*/
transitionToRoute(...args: any[]): void;
model: unknown;
queryParams: Readonly<Array<string | Record<string, QueryParamConfig | string | undefined>>>;
target: object;
}
export default class Controller extends EmberObject {}
// eslint-disable-next-line @typescript-eslint/no-empty-interface -- used for declaration merge
export default interface Controller extends ControllerMixin {}
export function inject(): ComputedProperty<Controller>;
export function inject<K extends keyof Registry>(name: K): ComputedProperty<Registry[K]>;
export function inject(target: object, propertyKey: string | symbol): void;
// A type registry for Ember `Controller`s. Meant to be declaration-merged
// so string lookups resolve to the correct type.
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface Registry extends Record<string, Controller | undefined> {}
declare module "@ember/owner" {
interface DIRegistry {
controller: Registry;
}
}
// We need to define the `ControllerMixin` type above, but it is not public API
// and should not be importable, so shut off auto-importing.
export {};
These definitions were written by Krystan HuffMenne, James C. Davis, and Peter Wagenet.
FAQs
TypeScript definitions for @ember/controller
The npm package @types/ember__controller receives a total of 40,199 weekly downloads. As such, @types/ember__controller popularity was classified as popular.
We found that @types/ember__controller demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.