tiled-types icon indicating copy to clipboard operation
tiled-types copied to clipboard

TiledObject.properties is optional

Open AdrienLemaire opened this issue 4 years ago • 0 comments

We've noticed that objects without properties will not have a properties key initialized to [] as per the types.

Can we update the types as follow ?

/**
 * @see https://doc.mapeditor.org/en/stable/reference/json-map-format/#object
 */
export interface TiledObject {
    ellipse?: boolean;
    gid?: number;
    height: number;
    id: number;
    name: string;
    point?: boolean;
    polygon?: Point[];
    polyline?: Point[];
-    properties: TiledProperty[];
+    properties?: TiledProperty[];

Using tiled v1.5.0

AdrienLemaire avatar Apr 02 '21 05:04 AdrienLemaire