arrgh.js icon indicating copy to clipboard operation
arrgh.js copied to clipboard

Arrgh TypeScript

Open query-wow opened this issue 6 years ago • 4 comments

Hi, i'm a fond user of your project, but recently i've migrated all my projects to typescript. Since there are no types for this lib, i was wondering if there is any intent of creating them or any ETA if they are in development !

Keep up the good work!

Best regards!

query-wow avatar Apr 19 '18 11:04 query-wow

Thanks, good to hear! You're not the first one to request this, so I might just look into this sooner or later.

SanderRossel avatar Apr 20 '18 06:04 SanderRossel

Hi @telmo-rodrigues, I've started diving into the TypeScript definition file syntax. You seem to know a little bit about that, so could you tell me if this is what you're ultimately looking for? If it is, I'll add all the other 100 methods or so :) Any tips are welcome! Thanks.

declare namespace arrgh {
    export class Iterator<T> {
        constructor (moveNext: () => boolean, current: () => T);
        moveNext: () => boolean;
        current: () => T;
    }
    export class Enumerable<T> {
        constructor (enumerable: T[]);
        constructor (enumerable: Enumerable<T>);
        constructor (enumerable: () => Iterator<T>);
        constructor (...args : T);
        aggregate (accumulator: (aggregate: T, element: T) => T) : T;
        aggregate<TAccumulate> (seed: TAccumulate, accumulator: (aggregate: TAccumulate, element: T) => TAccumulate) : TAccumulate;
        aggregate<TAccumulate, TResult> (seed: TAccumulate, accumulator: (aggregate: TAccumulate, element: T) => TAccumulate, selector: (TAccumulate) => TResult) : TResult;
    }
    export class List<T> extends Enumerable<T> {
        
    }
}

SanderRossel avatar May 26 '18 21:05 SanderRossel

Hi @SanderRossel , i've taken a quick look at it and it look at it and it looks great!

If you need any help, i can take some time to review some of the methods!

Keep up the great work and thank you a lot for the time invested in this !

query-wow avatar May 28 '18 09:05 query-wow

Arrgh! Still no TypeScript support!

jvgrootveld avatar Mar 25 '21 12:03 jvgrootveld