Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions crates/target_typescript/output/geojson/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ export interface GeojsonObjectGeometryCollection {
type: "GeometryCollection";
geometries: GeojsonObject[];
bbox?: BoundingBox;
[x: string]: unknown;
}

/**
Expand All @@ -182,6 +183,7 @@ export interface GeojsonObjectLineString {
type: "LineString";
coordinates: Position[];
bbox?: BoundingBox;
[x: string]: unknown;
}

/**
Expand All @@ -192,6 +194,7 @@ export interface GeojsonObjectMultiLineString {
type: "MultiLineString";
coordinates: Position[];
bbox?: BoundingBox;
[x: string]: unknown;
}

/**
Expand All @@ -202,6 +205,7 @@ export interface GeojsonObjectMultiPoint {
type: "MultiPoint";
coordinates: Position[];
bbox?: BoundingBox;
[x: string]: unknown;
}

/**
Expand All @@ -212,6 +216,7 @@ export interface GeojsonObjectMultiPolygon {
type: "MultiPolygon";
coordinates: LinearRing[];
bbox?: BoundingBox;
[x: string]: unknown;
}

/**
Expand All @@ -221,6 +226,7 @@ export interface GeojsonObjectPoint {
type: "Point";
coordinates: Position;
bbox?: BoundingBox;
[x: string]: unknown;
}

/**
Expand All @@ -231,6 +237,7 @@ export interface GeojsonObjectPolygon {
type: "Polygon";
coordinates: LinearRing[];
bbox?: BoundingBox;
[x: string]: unknown;
}

/**
Expand Down
9 changes: 8 additions & 1 deletion crates/target_typescript/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ impl jtd_codegen::target::Target for Target {
target::Item::Struct {
metadata,
name,
has_additional: _,
has_additional,
fields,
} => {
if let Some(s) = metadata.get("typescriptType").and_then(|v| v.as_str()) {
Expand Down Expand Up @@ -195,6 +195,9 @@ impl jtd_codegen::target::Target for Target {
)?;
}
}
if has_additional {
writeln!(out, " [x: string]: unknown;")?;
}
writeln!(out, "}}")?;

None
Expand Down Expand Up @@ -231,6 +234,7 @@ impl jtd_codegen::target::Target for Target {
name,
tag_json_name,
tag_value,
has_additional,
fields,
..
} => {
Expand Down Expand Up @@ -266,6 +270,9 @@ impl jtd_codegen::target::Target for Target {
)?;
}
}
if has_additional {
writeln!(out, " [x: string]: unknown;")?;
}
writeln!(out, "}}")?;

None
Expand Down