Purpose of declare keyword in TypeScript

What is the purpose of the declare keyword?

type Callback = (err: Error | String, data: Array<CalledBackData>) => void;

vs.

declare type Callback = (err: Error | String, data:Array<CalledBackData>) => void;

Cannot find docs that explain the purpose of the declare keyword in TS.

6 Answers
6

Leave a Comment