@types/ember__ordered-set
TypeScript icon, indicating that this package has built-in type declarations

4.0.7 • Public • Published

Installation

npm install --save @types/ember__ordered-set

Summary

This package contains type definitions for @ember/ordered-set (https://github.com/emberjs/ember-ordered-set).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/ember__ordered-set.

index.d.ts

/**
 * The `OrderedSet` class lets you store unique values of any type, whether
 * primitive values or object references. It is mostly similar to the native
 * `Set` class introduced in ES2015.
 */
export default class OrderedSet<T = unknown> {
    constructor();

    // Disable this to let users call like `OrderedSet.create<string>();`. This
    // is a rare case where it's preferable, because it's *much* briefer than
    // `let set: OrderedSet<string> = OrderedSet.create();`. If TS could infer
    // from usage what the type would be, this wouldn't be required, but until
    // it does, this is better than *not* allowing it.
    // eslint-disable-next-line @definitelytyped/no-unnecessary-generics
    static create<T = unknown>(): OrderedSet<T>;

    add(value: T): this;
    clear(): void;
    delete(value: T): boolean;
    forEach(callbackfn: (this: undefined, value: T, value2: T, set: OrderedSet<T>) => void): void;
    forEach<Ctx>(callbackfn: (this: Ctx, value: T, value2: T, set: OrderedSet<T>) => void, context: Ctx): void;
    has(value: T): boolean;
    isEmpty(): boolean;
    toArray(): T[];
    copy(): OrderedSet<T>;
}

Additional Details

  • Last updated: Tue, 16 Jan 2024 17:36:15 GMT
  • Dependencies: none

Credits

These definitions were written by Krystan HuffMenne, James C. Davis, and Peter Wagenet.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/ember__ordered-set

Weekly Downloads

65

Version

4.0.7

License

MIT

Unpacked Size

5.32 kB

Total Files

5

Last publish

Collaborators

  • types