Skip to content

Commit

Permalink
Added TypeScript support for $.fn
Browse files Browse the repository at this point in the history
Added TypeScript support for $.fn

`[key: string]: Function;` is added to `Cash` such that #380 can be resolved.

`ArrayLike<HTMLElement>` is also added such that Cash can be array-like with HTMLElement results from `querySelectorAll`.

The element array shall be the normal use for this script. If the array content is other type such as document, window, number, etc, for typescript users, they shall do `$(document)[0] as any as Document`.
  • Loading branch information
cyfung1031 committed May 3, 2023
1 parent 61e3b8f commit 4499af7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/cash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
// @require ./find.ts
// @require ./variables.ts

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

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

Expand Down

0 comments on commit 4499af7

Please sign in to comment.