Skip to content

Commit

Permalink
docs: Make clear that tiled.activeAsset can be null
Browse files Browse the repository at this point in the history
Also made a few other small corrections.
  • Loading branch information
bjorn committed Feb 21, 2022
1 parent b4b7d4a commit 16773a5
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions docs/scripting-doc/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2903,9 +2903,10 @@ declare namespace tiled {

/**
* Currently selected asset, or `null` if no file is open.
* Can be assigned any open asset in order to change the active asset.
* Can be assigned any open asset in order to change the active asset, or
* a newly created asset to open it in the editor.
*/
export let activeAsset: Asset;
export let activeAsset: Asset | null;

/**
* List of currently opened {@link Asset | assets}.
Expand Down Expand Up @@ -3143,26 +3144,26 @@ declare namespace tiled {
`undefined` if no object was found. See the
{@link tilesetFormats} property for more info.
*/
export function tilesetFormat(shortName: string): TilesetFormat;
export function tilesetFormat(shortName: string): TilesetFormat | undefined;

/**
* Returns the tileset format object that can read the given file, or
`undefined` if no object was found.
*/
export function tilesetFormatForFile(fileName: string): TilesetFormat;
export function tilesetFormatForFile(fileName: string): TilesetFormat | undefined;

/**
* Returns the map format object with the given name, or
* `undefined` if no object was found. See the
* {@link mapFormats} property for more info.
*/
export function mapFormat(shortName: string): MapFormat;
export function mapFormat(shortName: string): MapFormat | undefined;

/**
* Returns the map format object that can read the given file, or
* `undefined` if no object was found.
*/
export function mapFormatForFile(fileName: string): MapFormat;
export function mapFormatForFile(fileName: string): MapFormat | undefined;

/**
* Creates a {@link FilePath} object with the given URL.
Expand Down

0 comments on commit 16773a5

Please sign in to comment.