Skip to content

Commit

Permalink
fix type error used NodeList of attach/detach (#488)
Browse files Browse the repository at this point in the history
  • Loading branch information
sassy authored Jun 6, 2020
1 parent 2d03516 commit 99e4a3d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tributejs.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ export type TributeOptions<T> =
collection: Array<TributeCollection<{ [key: string]: any }>>;
};

type TributeElement = Element | NodeList | HTMLCollection | Array;

This comment has been minimized.

Copy link
@l1b3r

l1b3r Jul 7, 2020

Using Array<T> without type specification as a plain Array is causing

error TS2314: Generic type 'Array<T>' requires 1 type argument(s).

export default class Tribute<T extends {}> {
constructor(options: TributeOptions<T>);

Expand All @@ -91,9 +93,9 @@ export default class Tribute<T extends {}> {

appendCurrent(values: Array<T>, replace?: boolean): void;

attach(to: Element): void;
attach(to: TributeElement): void;

detach(to: Element): void;
detach(to: TributeElement): void;

showMenuForCollection(input: Element, collectionIndex?: number): void;
}

0 comments on commit 99e4a3d

Please sign in to comment.