ts-list-comprehension
Version:
List comprehension for TypeScript
53 lines (52 loc) • 1.27 kB
TypeScript
export declare const range: (a: number, b: number, step?: number) => number[];
export declare const repeat: <a>(...sequence: a[]) => (times: number) => a[];
interface Zip {
<a, b>(a: a[], b: b[]): [a, b][];
<a, b, c>(a: a[], b: b[], c: c[]): [a, b, c][];
<a, b, c, d>(a: a[], b: b[], c: c[], d: d[]): [a, b, c, d][];
<a, b, c, d, e>(a: a[], b: b[], c: c[], d: d[], e: e[]): [a, b, c, d, e][];
<a, b, c, d, e, f>(a: a[], b: b[], c: c[], d: d[], e: e[], f: f[]): [a, b, c, d, e, f][];
}
export declare const zip: Zip;
declare const charMap: {
a: string;
b: string;
c: string;
d: string;
e: string;
f: string;
g: string;
h: string;
i: string;
j: string;
k: string;
l: string;
m: string;
n: string;
o: string;
p: string;
q: string;
r: string;
s: string;
t: string;
u: string;
v: string;
w: string;
x: string;
y: string;
z: string;
};
declare const digits: {
'0': string;
'1': string;
'2': string;
'3': string;
'4': string;
'5': string;
'6': string;
'8': string;
'9': string;
};
export declare type char = keyof typeof charMap | keyof typeof digits;
export declare const chars: (a: char, b: char) => char[];
export {};