Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added missing typings #82

Merged
merged 3 commits into from
Oct 14, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,9 @@ declare namespace R {
forEach<T>(fn: (x: T) => void, list: T[]): T[]
forEach<T>(fn: (x: T) => void): (list: T[]) => T[]

groupBy<T>(fn: (x: T) => string, list: T[]): { [index: string]: T[] }
groupBy<T>(fn: (x: T) => string): (list: T[]) => { [index: string]: T[] }

has<T>(s: string, obj: T): boolean
has(s: string): <T>(obj: T) => boolean

Expand All @@ -288,6 +291,12 @@ declare namespace R {
includes(input: any, arrOrStr: any[]|string): boolean
includes(input: any) : (arrOrStr: any[]|string) => boolean

indexBy<T>(fn: (x: T) => string, list: T[]): { [key: string]: T }
indexBy<T>(fn: (x: T) => string): (list: T[]) => { [key: string]: T }

indexOf<T>(x: T, arr: T[]): number;
indexOf<T>(x: T): (arr: T[]) => number;

init<T>(list: T[]): T[]
init(list: string): string

Expand All @@ -305,6 +314,9 @@ declare namespace R {
last<T>(list: T[]): T | undefined
last(list: string): string

lastIndexOf<T>(x: T, arr: T[]): number
lastIndexOf<T>(x: T): (arr: T[]) => number

length<T>(list: T[]): number

map<In, Out>(fn: MapFunction<In, Out>): MapInterface<Out>
Expand Down