uncategorized

web-dev-ts-useful-snippets

How to define params of callback function?

1
2
3
4
5
6
export class OurClass {
onClickCallback: (array: SuperArray[][], columnIndex: number, index: number) => OptionClickResult | null;

constructor(public first: string) {
}
}

TS types

1
2
3
4
5
6
7

private dictinary: { [key: number]: MyModel } = {};

const dictinary = {
1: "First",
2: "Second"
};
Share