Skip to content

Commit

Permalink
docs: Added "| null" in a few more places
Browse files Browse the repository at this point in the history
Needed because otherwise TS assumes the references will never be null.
  • Loading branch information
bjorn committed Aug 3, 2023
1 parent 4c366cf commit 99e0599
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/scripting-doc/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,7 @@ declare class TiledObject {
/**
* The asset this object is part of, or `null`.
*/
readonly asset: Asset;
readonly asset: Asset | null;

/**
* Whether the object is read-only.
Expand Down Expand Up @@ -1306,13 +1306,13 @@ declare class MapObject extends TiledObject {
* Layer this object is part of (or `null` in case of a standalone
* object).
*/
layer: ObjectGroup;
layer: ObjectGroup | null;

/**
* Map this object is part of (or `null` in case of a
* standalone object).
*/
readonly map: TileMap;
readonly map: TileMap | null;

/**
* Constructs a new map object, which can be added to an {@link ObjectGroup}.
Expand Down Expand Up @@ -3703,7 +3703,7 @@ interface ToolDefinition {
/**
* Called when the active map was changed.
*/
mapChanged?(this: Tool, oldMap: TileMap, newMap: TileMap): void;
mapChanged?(this: Tool, oldMap: TileMap | null, newMap: TileMap | null): void;

/**
* Called when the hovered tile position changed.
Expand Down

0 comments on commit 99e0599

Please sign in to comment.