arrgh.js
arrgh.js copied to clipboard
Arrgh TypeScript
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!
Thanks, good to hear! You're not the first one to request this, so I might just look into this sooner or later.
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> {
}
}
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 !
Arrgh! Still no TypeScript support!