Skip to content

Commit

Permalink
Added TypeScript support for $.fn
Browse files Browse the repository at this point in the history
`[key: string]: Function;` is added to `Cash` such that #380 can be resolved.

`ICashArray<HTMLElement>` is also added such that Cash can be array-like with HTMLElement results from `querySelectorAll`.
  • Loading branch information
cyfung1031 committed May 3, 2023
1 parent 61e3b8f commit dc4d3cf
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/core/cash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@
// @require ./find.ts
// @require ./variables.ts

class Cash {
interface ICashArray<T> {
length: number;
[n: number]: T;
}

class Cash implements ICashArray<HTMLElement> {
[key: string]: Function;

constructor ( selector?: Selector, context?: Context | Cash ) {

Expand Down

0 comments on commit dc4d3cf

Please sign in to comment.