mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 20:40:20 +00:00
Recommend to use ReadonlyArray (#18429)
This commit is contained in:
@@ -133,6 +133,7 @@ For a good example package, see [base64-js](https://github.com/DefinitelyTyped/D
|
||||
|
||||
* First, follow advice from the [handbook](http://www.typescriptlang.org/docs/handbook/declaration-files/do-s-and-don-ts.html).
|
||||
* Formatting: Either use all tabs, or always use 4 spaces.
|
||||
* `function sum(nums: number[]): number`: Use `ReadonlyArray` if a function does not write to its parameters.
|
||||
* `interface Foo { new(): Foo; }`:
|
||||
This defines a type of objects that are new-able. You probably want `declare class Foo { constructor(); }`.
|
||||
* `const Class: { new(): IClass; }`:
|
||||
|
||||
Reference in New Issue
Block a user